AdParameterServiceClient implements BackgroundResource { public final AdParameter getAdParameter(AdParameterName resourceName) { GetAdParameterRequest request = GetAdParameterRequest.newBuilder() .setResourceName(resourceName == null ? null : resourceName.toString()) .build(); return getAdParameter(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 getAdParameterTest() { com.google.ads.googleads.v5.services.AdParameterName resourceName2 = com.google.ads.googleads.v5.services.AdParameterName.of("[CUSTOMER]", "[AD_PARAMETER]"); AdGroupCriterionName adGroupCriterion = AdGroupCriterionName.of("[CUSTOMER]", "[AD_GROUP_CRITERION]"); long parameterIndex = 763436220L; String insertionText = "insertionText-1755831107"; AdParameter expectedResponse = AdParameter.newBuilder() .setResourceName(resourceName2.toString()) .setAdGroupCriterion(adGroupCriterion.toString()) .setParameterIndex(parameterIndex) .setInsertionText(insertionText) .build(); mockAdParameterService.addResponse(expectedResponse); AdParameterName resourceName = AdParameterName.of("[CUSTOMER]", "[AD_PARAMETER]"); AdParameter actualResponse = client.getAdParameter(resourceName); Assert.assertEquals(expectedResponse, actualResponse); List<AbstractMessage> actualRequests = mockAdParameterService.getRequests(); Assert.assertEquals(1, actualRequests.size()); GetAdParameterRequest actualRequest = (GetAdParameterRequest) actualRequests.get(0); Assert.assertEquals(resourceName, AdParameterName.parse(actualRequest.getResourceName())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern())); }
@Test @SuppressWarnings("all") public void getAdParameterExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockAdParameterService.addException(exception); try { AdParameterName resourceName = AdParameterName.of("[CUSTOMER]", "[AD_PARAMETER]"); client.getAdParameter(resourceName); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { } }