AdParameterServiceClient implements BackgroundResource { public final MutateAdParametersResponse mutateAdParameters( String customerId, List<AdParameterOperation> operations) { MutateAdParametersRequest request = MutateAdParametersRequest.newBuilder() .setCustomerId(customerId) .addAllOperations(operations) .build(); return mutateAdParameters(request); } protected  AdParameterServiceClient(AdParameterServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") protected  AdParameterServiceClient(AdParameterServiceStub stub); static final AdParameterServiceClient create(); static final AdParameterServiceClient create(AdParameterServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") static final AdParameterServiceClient create(AdParameterServiceStub stub); final AdParameterServiceSettings getSettings(); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") AdParameterServiceStub getStub(); final AdParameter getAdParameter(AdParameterName resourceName); final AdParameter getAdParameter(String resourceName); final AdParameter getAdParameter(GetAdParameterRequest request); final UnaryCallable<GetAdParameterRequest, AdParameter> getAdParameterCallable(); final MutateAdParametersResponse mutateAdParameters(
      String customerId, List<AdParameterOperation> operations); final MutateAdParametersResponse mutateAdParameters(MutateAdParametersRequest request); final UnaryCallable<MutateAdParametersRequest, MutateAdParametersResponse> mutateAdParametersCallable(); @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 mutateAdParametersTest() { MutateAdParametersResponse expectedResponse = MutateAdParametersResponse.newBuilder().build(); mockAdParameterService.addResponse(expectedResponse); String customerId = "customerId-1772061412"; List<AdParameterOperation> operations = new ArrayList<>(); MutateAdParametersResponse actualResponse = client.mutateAdParameters(customerId, operations); Assert.assertEquals(expectedResponse, actualResponse); List<AbstractMessage> actualRequests = mockAdParameterService.getRequests(); Assert.assertEquals(1, actualRequests.size()); MutateAdParametersRequest actualRequest = (MutateAdParametersRequest) 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 mutateAdParametersExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockAdParameterService.addException(exception); try { String customerId = "customerId-1772061412"; List<AdParameterOperation> operations = new ArrayList<>(); client.mutateAdParameters(customerId, operations); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { } }