AdGroupAdLabelServiceClient implements BackgroundResource { public final MutateAdGroupAdLabelsResponse mutateAdGroupAdLabels( String customerId, List<AdGroupAdLabelOperation> operations) { MutateAdGroupAdLabelsRequest request = MutateAdGroupAdLabelsRequest.newBuilder() .setCustomerId(customerId) .addAllOperations(operations) .build(); return mutateAdGroupAdLabels(request); } protected  AdGroupAdLabelServiceClient(AdGroupAdLabelServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") protected  AdGroupAdLabelServiceClient(AdGroupAdLabelServiceStub stub); static final AdGroupAdLabelServiceClient create(); static final AdGroupAdLabelServiceClient create(AdGroupAdLabelServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") static final AdGroupAdLabelServiceClient create(AdGroupAdLabelServiceStub stub); final AdGroupAdLabelServiceSettings getSettings(); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") AdGroupAdLabelServiceStub getStub(); final AdGroupAdLabel getAdGroupAdLabel(AdGroupAdLabelName resourceName); final AdGroupAdLabel getAdGroupAdLabel(String resourceName); final AdGroupAdLabel getAdGroupAdLabel(GetAdGroupAdLabelRequest request); final UnaryCallable<GetAdGroupAdLabelRequest, AdGroupAdLabel> getAdGroupAdLabelCallable(); final MutateAdGroupAdLabelsResponse mutateAdGroupAdLabels(
      String customerId, List<AdGroupAdLabelOperation> operations); final MutateAdGroupAdLabelsResponse mutateAdGroupAdLabels(
      MutateAdGroupAdLabelsRequest request); final UnaryCallable<MutateAdGroupAdLabelsRequest, MutateAdGroupAdLabelsResponse> mutateAdGroupAdLabelsCallable(); @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 mutateAdGroupAdLabelsTest() { MutateAdGroupAdLabelsResponse expectedResponse = MutateAdGroupAdLabelsResponse.newBuilder().build(); mockAdGroupAdLabelService.addResponse(expectedResponse); String customerId = "customerId-1772061412"; List<AdGroupAdLabelOperation> operations = new ArrayList<>(); MutateAdGroupAdLabelsResponse actualResponse = client.mutateAdGroupAdLabels(customerId, operations); Assert.assertEquals(expectedResponse, actualResponse); List<AbstractMessage> actualRequests = mockAdGroupAdLabelService.getRequests(); Assert.assertEquals(1, actualRequests.size()); MutateAdGroupAdLabelsRequest actualRequest = (MutateAdGroupAdLabelsRequest) 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 mutateAdGroupAdLabelsExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockAdGroupAdLabelService.addException(exception); try { String customerId = "customerId-1772061412"; List<AdGroupAdLabelOperation> operations = new ArrayList<>(); client.mutateAdGroupAdLabels(customerId, operations); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { } }