CustomerLabelServiceClient implements BackgroundResource { public final MutateCustomerLabelsResponse mutateCustomerLabels( String customerId, List<CustomerLabelOperation> operations) { MutateCustomerLabelsRequest request = MutateCustomerLabelsRequest.newBuilder() .setCustomerId(customerId) .addAllOperations(operations) .build(); return mutateCustomerLabels(request); } protected  CustomerLabelServiceClient(CustomerLabelServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") protected  CustomerLabelServiceClient(CustomerLabelServiceStub stub); static final CustomerLabelServiceClient create(); static final CustomerLabelServiceClient create(CustomerLabelServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") static final CustomerLabelServiceClient create(CustomerLabelServiceStub stub); final CustomerLabelServiceSettings getSettings(); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") CustomerLabelServiceStub getStub(); final CustomerLabel getCustomerLabel(CustomerLabelName resourceName); final CustomerLabel getCustomerLabel(String resourceName); final CustomerLabel getCustomerLabel(GetCustomerLabelRequest request); final UnaryCallable<GetCustomerLabelRequest, CustomerLabel> getCustomerLabelCallable(); final MutateCustomerLabelsResponse mutateCustomerLabels(
      String customerId, List<CustomerLabelOperation> operations); final MutateCustomerLabelsResponse mutateCustomerLabels(
      MutateCustomerLabelsRequest request); final UnaryCallable<MutateCustomerLabelsRequest, MutateCustomerLabelsResponse> mutateCustomerLabelsCallable(); @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 mutateCustomerLabelsTest() { MutateCustomerLabelsResponse expectedResponse = MutateCustomerLabelsResponse.newBuilder().build(); mockCustomerLabelService.addResponse(expectedResponse); String customerId = "customerId-1772061412"; List<CustomerLabelOperation> operations = new ArrayList<>(); MutateCustomerLabelsResponse actualResponse = client.mutateCustomerLabels(customerId, operations); Assert.assertEquals(expectedResponse, actualResponse); List<AbstractMessage> actualRequests = mockCustomerLabelService.getRequests(); Assert.assertEquals(1, actualRequests.size()); MutateCustomerLabelsRequest actualRequest = (MutateCustomerLabelsRequest) 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 mutateCustomerLabelsExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockCustomerLabelService.addException(exception); try { String customerId = "customerId-1772061412"; List<CustomerLabelOperation> operations = new ArrayList<>(); client.mutateCustomerLabels(customerId, operations); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { } }