CampaignBidModifierServiceClient implements BackgroundResource { public final MutateCampaignBidModifiersResponse mutateCampaignBidModifiers( String customerId, List<CampaignBidModifierOperation> operations) { MutateCampaignBidModifiersRequest request = MutateCampaignBidModifiersRequest.newBuilder() .setCustomerId(customerId) .addAllOperations(operations) .build(); return mutateCampaignBidModifiers(request); } protected  CampaignBidModifierServiceClient(CampaignBidModifierServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") protected  CampaignBidModifierServiceClient(CampaignBidModifierServiceStub stub); static final CampaignBidModifierServiceClient create(); static final CampaignBidModifierServiceClient create(
      CampaignBidModifierServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") static final CampaignBidModifierServiceClient create(CampaignBidModifierServiceStub stub); final CampaignBidModifierServiceSettings getSettings(); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") CampaignBidModifierServiceStub getStub(); final CampaignBidModifier getCampaignBidModifier(CampaignBidModifierName resourceName); final CampaignBidModifier getCampaignBidModifier(String resourceName); final CampaignBidModifier getCampaignBidModifier(GetCampaignBidModifierRequest request); final UnaryCallable<GetCampaignBidModifierRequest, CampaignBidModifier> getCampaignBidModifierCallable(); final MutateCampaignBidModifiersResponse mutateCampaignBidModifiers(
      String customerId, List<CampaignBidModifierOperation> operations); final MutateCampaignBidModifiersResponse mutateCampaignBidModifiers(
      MutateCampaignBidModifiersRequest request); final UnaryCallable<MutateCampaignBidModifiersRequest, MutateCampaignBidModifiersResponse> mutateCampaignBidModifiersCallable(); @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 mutateCampaignBidModifiersTest() { MutateCampaignBidModifiersResponse expectedResponse = MutateCampaignBidModifiersResponse.newBuilder().build(); mockCampaignBidModifierService.addResponse(expectedResponse); String customerId = "customerId-1772061412"; List<CampaignBidModifierOperation> operations = new ArrayList<>(); MutateCampaignBidModifiersResponse actualResponse = client.mutateCampaignBidModifiers(customerId, operations); Assert.assertEquals(expectedResponse, actualResponse); List<AbstractMessage> actualRequests = mockCampaignBidModifierService.getRequests(); Assert.assertEquals(1, actualRequests.size()); MutateCampaignBidModifiersRequest actualRequest = (MutateCampaignBidModifiersRequest) 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 mutateCampaignBidModifiersExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockCampaignBidModifierService.addException(exception); try { String customerId = "customerId-1772061412"; List<CampaignBidModifierOperation> operations = new ArrayList<>(); client.mutateCampaignBidModifiers(customerId, operations); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { } }