CampaignLabelServiceClient implements BackgroundResource { public final MutateCampaignLabelsResponse mutateCampaignLabels( String customerId, List<CampaignLabelOperation> operations) { MutateCampaignLabelsRequest request = MutateCampaignLabelsRequest.newBuilder() .setCustomerId(customerId) .addAllOperations(operations) .build(); return mutateCampaignLabels(request); } protected  CampaignLabelServiceClient(CampaignLabelServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") protected  CampaignLabelServiceClient(CampaignLabelServiceStub stub); static final CampaignLabelServiceClient create(); static final CampaignLabelServiceClient create(CampaignLabelServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") static final CampaignLabelServiceClient create(CampaignLabelServiceStub stub); final CampaignLabelServiceSettings getSettings(); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") CampaignLabelServiceStub getStub(); final CampaignLabel getCampaignLabel(CampaignLabelName resourceName); final CampaignLabel getCampaignLabel(String resourceName); final CampaignLabel getCampaignLabel(GetCampaignLabelRequest request); final UnaryCallable<GetCampaignLabelRequest, CampaignLabel> getCampaignLabelCallable(); final MutateCampaignLabelsResponse mutateCampaignLabels(
      String customerId, List<CampaignLabelOperation> operations); final MutateCampaignLabelsResponse mutateCampaignLabels(
      MutateCampaignLabelsRequest request); final UnaryCallable<MutateCampaignLabelsRequest, MutateCampaignLabelsResponse> mutateCampaignLabelsCallable(); @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 mutateCampaignLabelsTest() { MutateCampaignLabelsResponse expectedResponse = MutateCampaignLabelsResponse.newBuilder().build(); mockCampaignLabelService.addResponse(expectedResponse); String customerId = "customerId-1772061412"; List<CampaignLabelOperation> operations = new ArrayList<>(); MutateCampaignLabelsResponse actualResponse = client.mutateCampaignLabels(customerId, operations); Assert.assertEquals(expectedResponse, actualResponse); List<AbstractMessage> actualRequests = mockCampaignLabelService.getRequests(); Assert.assertEquals(1, actualRequests.size()); MutateCampaignLabelsRequest actualRequest = (MutateCampaignLabelsRequest) 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 mutateCampaignLabelsExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockCampaignLabelService.addException(exception); try { String customerId = "customerId-1772061412"; List<CampaignLabelOperation> operations = new ArrayList<>(); client.mutateCampaignLabels(customerId, operations); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { } }