AdGroupLabelServiceClient implements BackgroundResource { public final MutateAdGroupLabelsResponse mutateAdGroupLabels( String customerId, List<AdGroupLabelOperation> operations) { MutateAdGroupLabelsRequest request = MutateAdGroupLabelsRequest.newBuilder() .setCustomerId(customerId) .addAllOperations(operations) .build(); return mutateAdGroupLabels(request); } protected  AdGroupLabelServiceClient(AdGroupLabelServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") protected  AdGroupLabelServiceClient(AdGroupLabelServiceStub stub); static final AdGroupLabelServiceClient create(); static final AdGroupLabelServiceClient create(AdGroupLabelServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") static final AdGroupLabelServiceClient create(AdGroupLabelServiceStub stub); final AdGroupLabelServiceSettings getSettings(); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") AdGroupLabelServiceStub getStub(); final AdGroupLabel getAdGroupLabel(AdGroupLabelName resourceName); final AdGroupLabel getAdGroupLabel(String resourceName); final AdGroupLabel getAdGroupLabel(GetAdGroupLabelRequest request); final UnaryCallable<GetAdGroupLabelRequest, AdGroupLabel> getAdGroupLabelCallable(); final MutateAdGroupLabelsResponse mutateAdGroupLabels(
      String customerId, List<AdGroupLabelOperation> operations); final MutateAdGroupLabelsResponse mutateAdGroupLabels(MutateAdGroupLabelsRequest request); final UnaryCallable<MutateAdGroupLabelsRequest, MutateAdGroupLabelsResponse> mutateAdGroupLabelsCallable(); @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 mutateAdGroupLabelsTest() { MutateAdGroupLabelsResponse expectedResponse = MutateAdGroupLabelsResponse.newBuilder().build(); mockAdGroupLabelService.addResponse(expectedResponse); String customerId = "customerId-1772061412"; List<AdGroupLabelOperation> operations = new ArrayList<>(); MutateAdGroupLabelsResponse actualResponse = client.mutateAdGroupLabels(customerId, operations); Assert.assertEquals(expectedResponse, actualResponse); List<AbstractMessage> actualRequests = mockAdGroupLabelService.getRequests(); Assert.assertEquals(1, actualRequests.size()); MutateAdGroupLabelsRequest actualRequest = (MutateAdGroupLabelsRequest) 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 mutateAdGroupLabelsExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockAdGroupLabelService.addException(exception); try { String customerId = "customerId-1772061412"; List<AdGroupLabelOperation> operations = new ArrayList<>(); client.mutateAdGroupLabels(customerId, operations); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { } }