AdGroupBidModifierServiceClient implements BackgroundResource { public final MutateAdGroupBidModifiersResponse mutateAdGroupBidModifiers( String customerId, List<AdGroupBidModifierOperation> operations) { MutateAdGroupBidModifiersRequest request = MutateAdGroupBidModifiersRequest.newBuilder() .setCustomerId(customerId) .addAllOperations(operations) .build(); return mutateAdGroupBidModifiers(request); } protected  AdGroupBidModifierServiceClient(AdGroupBidModifierServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") protected  AdGroupBidModifierServiceClient(AdGroupBidModifierServiceStub stub); static final AdGroupBidModifierServiceClient create(); static final AdGroupBidModifierServiceClient create(
      AdGroupBidModifierServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") static final AdGroupBidModifierServiceClient create(AdGroupBidModifierServiceStub stub); final AdGroupBidModifierServiceSettings getSettings(); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") AdGroupBidModifierServiceStub getStub(); final AdGroupBidModifier getAdGroupBidModifier(AdGroupBidModifierName resourceName); final AdGroupBidModifier getAdGroupBidModifier(String resourceName); final AdGroupBidModifier getAdGroupBidModifier(GetAdGroupBidModifierRequest request); final UnaryCallable<GetAdGroupBidModifierRequest, AdGroupBidModifier> getAdGroupBidModifierCallable(); final MutateAdGroupBidModifiersResponse mutateAdGroupBidModifiers(
      String customerId, List<AdGroupBidModifierOperation> operations); final MutateAdGroupBidModifiersResponse mutateAdGroupBidModifiers(
      MutateAdGroupBidModifiersRequest request); final UnaryCallable<MutateAdGroupBidModifiersRequest, MutateAdGroupBidModifiersResponse> mutateAdGroupBidModifiersCallable(); @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 mutateAdGroupBidModifiersTest() { MutateAdGroupBidModifiersResponse expectedResponse = MutateAdGroupBidModifiersResponse.newBuilder().build(); mockAdGroupBidModifierService.addResponse(expectedResponse); String customerId = "customerId-1772061412"; List<AdGroupBidModifierOperation> operations = new ArrayList<>(); MutateAdGroupBidModifiersResponse actualResponse = client.mutateAdGroupBidModifiers(customerId, operations); Assert.assertEquals(expectedResponse, actualResponse); List<AbstractMessage> actualRequests = mockAdGroupBidModifierService.getRequests(); Assert.assertEquals(1, actualRequests.size()); MutateAdGroupBidModifiersRequest actualRequest = (MutateAdGroupBidModifiersRequest) 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 mutateAdGroupBidModifiersExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockAdGroupBidModifierService.addException(exception); try { String customerId = "customerId-1772061412"; List<AdGroupBidModifierOperation> operations = new ArrayList<>(); client.mutateAdGroupBidModifiers(customerId, operations); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { } }