AdGroupCriterionLabelServiceClient implements BackgroundResource { public final MutateAdGroupCriterionLabelsResponse mutateAdGroupCriterionLabels( String customerId, List<AdGroupCriterionLabelOperation> operations) { MutateAdGroupCriterionLabelsRequest request = MutateAdGroupCriterionLabelsRequest.newBuilder() .setCustomerId(customerId) .addAllOperations(operations) .build(); return mutateAdGroupCriterionLabels(request); } protected  AdGroupCriterionLabelServiceClient(AdGroupCriterionLabelServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") protected  AdGroupCriterionLabelServiceClient(AdGroupCriterionLabelServiceStub stub); static final AdGroupCriterionLabelServiceClient create(); static final AdGroupCriterionLabelServiceClient create(
      AdGroupCriterionLabelServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") static final AdGroupCriterionLabelServiceClient create(
      AdGroupCriterionLabelServiceStub stub); final AdGroupCriterionLabelServiceSettings getSettings(); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") AdGroupCriterionLabelServiceStub getStub(); final AdGroupCriterionLabel getAdGroupCriterionLabel(
      AdGroupCriterionLabelName resourceName); final AdGroupCriterionLabel getAdGroupCriterionLabel(String resourceName); final AdGroupCriterionLabel getAdGroupCriterionLabel(
      GetAdGroupCriterionLabelRequest request); final UnaryCallable<GetAdGroupCriterionLabelRequest, AdGroupCriterionLabel> getAdGroupCriterionLabelCallable(); final MutateAdGroupCriterionLabelsResponse mutateAdGroupCriterionLabels(
      String customerId, List<AdGroupCriterionLabelOperation> operations); final MutateAdGroupCriterionLabelsResponse mutateAdGroupCriterionLabels(
      MutateAdGroupCriterionLabelsRequest request); final UnaryCallable<
          MutateAdGroupCriterionLabelsRequest, MutateAdGroupCriterionLabelsResponse> mutateAdGroupCriterionLabelsCallable(); @Override final void close(); @Override void shutdown(); @Override boolean isShutdown(); @Override boolean isTerminated(); @Override void shutdownNow(); @Override boolean awaitTermination(long duration, TimeUnit unit);  }
@Test @SuppressWarnings("all") public void mutateAdGroupCriterionLabelsTest() { MutateAdGroupCriterionLabelsResponse expectedResponse = MutateAdGroupCriterionLabelsResponse.newBuilder().build(); mockAdGroupCriterionLabelService.addResponse(expectedResponse); String customerId = "customerId-1772061412"; List<AdGroupCriterionLabelOperation> operations = new ArrayList<>(); MutateAdGroupCriterionLabelsResponse actualResponse = client.mutateAdGroupCriterionLabels(customerId, operations); Assert.assertEquals(expectedResponse, actualResponse); List<AbstractMessage> actualRequests = mockAdGroupCriterionLabelService.getRequests(); Assert.assertEquals(1, actualRequests.size()); MutateAdGroupCriterionLabelsRequest actualRequest = (MutateAdGroupCriterionLabelsRequest) actualRequests.get(0); Assert.assertEquals(customerId, actualRequest.getCustomerId()); Assert.assertEquals(operations, actualRequest.getOperationsList()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern())); }
@Test @SuppressWarnings("all") public void mutateAdGroupCriterionLabelsExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockAdGroupCriterionLabelService.addException(exception); try { String customerId = "customerId-1772061412"; List<AdGroupCriterionLabelOperation> operations = new ArrayList<>(); client.mutateAdGroupCriterionLabels(customerId, operations); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { } }