AdGroupExtensionSettingServiceClient implements BackgroundResource { public final AdGroupExtensionSetting getAdGroupExtensionSetting( AdGroupExtensionSettingName resourceName) { GetAdGroupExtensionSettingRequest request = GetAdGroupExtensionSettingRequest.newBuilder() .setResourceName(resourceName == null ? null : resourceName.toString()) .build(); return getAdGroupExtensionSetting(request); } protected  AdGroupExtensionSettingServiceClient(AdGroupExtensionSettingServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") protected  AdGroupExtensionSettingServiceClient(AdGroupExtensionSettingServiceStub stub); static final AdGroupExtensionSettingServiceClient create(); static final AdGroupExtensionSettingServiceClient create(
      AdGroupExtensionSettingServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") static final AdGroupExtensionSettingServiceClient create(
      AdGroupExtensionSettingServiceStub stub); final AdGroupExtensionSettingServiceSettings getSettings(); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") AdGroupExtensionSettingServiceStub getStub(); final AdGroupExtensionSetting getAdGroupExtensionSetting(
      AdGroupExtensionSettingName resourceName); final AdGroupExtensionSetting getAdGroupExtensionSetting(String resourceName); final AdGroupExtensionSetting getAdGroupExtensionSetting(
      GetAdGroupExtensionSettingRequest request); final UnaryCallable<GetAdGroupExtensionSettingRequest, AdGroupExtensionSetting> getAdGroupExtensionSettingCallable(); final MutateAdGroupExtensionSettingsResponse mutateAdGroupExtensionSettings(
      String customerId, List<AdGroupExtensionSettingOperation> operations); final MutateAdGroupExtensionSettingsResponse mutateAdGroupExtensionSettings(
      MutateAdGroupExtensionSettingsRequest request); final UnaryCallable<
          MutateAdGroupExtensionSettingsRequest, MutateAdGroupExtensionSettingsResponse> mutateAdGroupExtensionSettingsCallable(); @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 getAdGroupExtensionSettingTest() { com.google.ads.googleads.v5.services.AdGroupExtensionSettingName resourceName2 = com.google.ads.googleads.v5.services.AdGroupExtensionSettingName.of( "[CUSTOMER]", "[AD_GROUP_EXTENSION_SETTING]"); AdGroupExtensionSetting expectedResponse = AdGroupExtensionSetting.newBuilder().setResourceName(resourceName2.toString()).build(); mockAdGroupExtensionSettingService.addResponse(expectedResponse); AdGroupExtensionSettingName resourceName = AdGroupExtensionSettingName.of("[CUSTOMER]", "[AD_GROUP_EXTENSION_SETTING]"); AdGroupExtensionSetting actualResponse = client.getAdGroupExtensionSetting(resourceName); Assert.assertEquals(expectedResponse, actualResponse); List<AbstractMessage> actualRequests = mockAdGroupExtensionSettingService.getRequests(); Assert.assertEquals(1, actualRequests.size()); GetAdGroupExtensionSettingRequest actualRequest = (GetAdGroupExtensionSettingRequest) actualRequests.get(0); Assert.assertEquals( resourceName, AdGroupExtensionSettingName.parse(actualRequest.getResourceName())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern())); }
@Test @SuppressWarnings("all") public void getAdGroupExtensionSettingExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockAdGroupExtensionSettingService.addException(exception); try { AdGroupExtensionSettingName resourceName = AdGroupExtensionSettingName.of("[CUSTOMER]", "[AD_GROUP_EXTENSION_SETTING]"); client.getAdGroupExtensionSetting(resourceName); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { } }