KeywordPlanCampaignServiceClient implements BackgroundResource { public final MutateKeywordPlanCampaignsResponse mutateKeywordPlanCampaigns( String customerId, List<KeywordPlanCampaignOperation> operations) { MutateKeywordPlanCampaignsRequest request = MutateKeywordPlanCampaignsRequest.newBuilder() .setCustomerId(customerId) .addAllOperations(operations) .build(); return mutateKeywordPlanCampaigns(request); } protected  KeywordPlanCampaignServiceClient(KeywordPlanCampaignServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") protected  KeywordPlanCampaignServiceClient(KeywordPlanCampaignServiceStub stub); static final KeywordPlanCampaignServiceClient create(); static final KeywordPlanCampaignServiceClient create(
      KeywordPlanCampaignServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") static final KeywordPlanCampaignServiceClient create(KeywordPlanCampaignServiceStub stub); final KeywordPlanCampaignServiceSettings getSettings(); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") KeywordPlanCampaignServiceStub getStub(); final KeywordPlanCampaign getKeywordPlanCampaign(KeywordPlanCampaignName resourceName); final KeywordPlanCampaign getKeywordPlanCampaign(String resourceName); final KeywordPlanCampaign getKeywordPlanCampaign(GetKeywordPlanCampaignRequest request); final UnaryCallable<GetKeywordPlanCampaignRequest, KeywordPlanCampaign> getKeywordPlanCampaignCallable(); final MutateKeywordPlanCampaignsResponse mutateKeywordPlanCampaigns(
      String customerId, List<KeywordPlanCampaignOperation> operations); final MutateKeywordPlanCampaignsResponse mutateKeywordPlanCampaigns(
      MutateKeywordPlanCampaignsRequest request); final UnaryCallable<MutateKeywordPlanCampaignsRequest, MutateKeywordPlanCampaignsResponse> mutateKeywordPlanCampaignsCallable(); @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 mutateKeywordPlanCampaignsTest() { MutateKeywordPlanCampaignsResponse expectedResponse = MutateKeywordPlanCampaignsResponse.newBuilder().build(); mockKeywordPlanCampaignService.addResponse(expectedResponse); String customerId = "customerId-1772061412"; List<KeywordPlanCampaignOperation> operations = new ArrayList<>(); MutateKeywordPlanCampaignsResponse actualResponse = client.mutateKeywordPlanCampaigns(customerId, operations); Assert.assertEquals(expectedResponse, actualResponse); List<AbstractMessage> actualRequests = mockKeywordPlanCampaignService.getRequests(); Assert.assertEquals(1, actualRequests.size()); MutateKeywordPlanCampaignsRequest actualRequest = (MutateKeywordPlanCampaignsRequest) 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 mutateKeywordPlanCampaignsExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockKeywordPlanCampaignService.addException(exception); try { String customerId = "customerId-1772061412"; List<KeywordPlanCampaignOperation> operations = new ArrayList<>(); client.mutateKeywordPlanCampaigns(customerId, operations); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { } }