private AdMobApiSettings(AdMobApiSettings existing) : base(existing) { gax::GaxPreconditions.CheckNotNull(existing, nameof(existing)); GetPublisherAccountSettings = existing.GetPublisherAccountSettings; ListPublisherAccountsSettings = existing.ListPublisherAccountsSettings; GenerateNetworkReportSettings = existing.GenerateNetworkReportSettings; GenerateMediationReportSettings = existing.GenerateMediationReportSettings; OnCopy(existing); }
/// <summary> /// Creates a <see cref="AdMobApiClient"/> which uses the specified call invoker for remote operations. /// </summary> /// <param name="callInvoker"> /// The <see cref="grpccore::CallInvoker"/> for remote operations. Must not be null. /// </param> /// <param name="settings">Optional <see cref="AdMobApiSettings"/>.</param> /// <returns>The created <see cref="AdMobApiClient"/>.</returns> internal static AdMobApiClient Create(grpccore::CallInvoker callInvoker, AdMobApiSettings settings = null) { gax::GaxPreconditions.CheckNotNull(callInvoker, nameof(callInvoker)); grpcinter::Interceptor interceptor = settings?.Interceptor; if (interceptor != null) { callInvoker = grpcinter::CallInvokerExtensions.Intercept(callInvoker, interceptor); } AdMobApi.AdMobApiClient grpcClient = new AdMobApi.AdMobApiClient(callInvoker); return(new AdMobApiClientImpl(grpcClient, settings)); }
/// <summary> /// Constructs a client wrapper for the AdMobApi service, with the specified gRPC client and settings. /// </summary> /// <param name="grpcClient">The underlying gRPC client.</param> /// <param name="settings">The base <see cref="AdMobApiSettings"/> used within this client.</param> public AdMobApiClientImpl(AdMobApi.AdMobApiClient grpcClient, AdMobApiSettings settings) { GrpcClient = grpcClient; AdMobApiSettings effectiveSettings = settings ?? AdMobApiSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); _callGetPublisherAccount = clientHelper.BuildApiCall <GetPublisherAccountRequest, PublisherAccount>(grpcClient.GetPublisherAccountAsync, grpcClient.GetPublisherAccount, effectiveSettings.GetPublisherAccountSettings).WithGoogleRequestParam("name", request => request.Name); Modify_ApiCall(ref _callGetPublisherAccount); Modify_GetPublisherAccountApiCall(ref _callGetPublisherAccount); _callListPublisherAccounts = clientHelper.BuildApiCall <ListPublisherAccountsRequest, ListPublisherAccountsResponse>(grpcClient.ListPublisherAccountsAsync, grpcClient.ListPublisherAccounts, effectiveSettings.ListPublisherAccountsSettings); Modify_ApiCall(ref _callListPublisherAccounts); Modify_ListPublisherAccountsApiCall(ref _callListPublisherAccounts); _callGenerateNetworkReport = clientHelper.BuildApiCall <GenerateNetworkReportRequest, GenerateNetworkReportResponse>(grpcClient.GenerateNetworkReport, effectiveSettings.GenerateNetworkReportSettings).WithGoogleRequestParam("parent", request => request.Parent); Modify_ApiCall(ref _callGenerateNetworkReport); Modify_GenerateNetworkReportApiCall(ref _callGenerateNetworkReport); _callGenerateMediationReport = clientHelper.BuildApiCall <GenerateMediationReportRequest, GenerateMediationReportResponse>(grpcClient.GenerateMediationReport, effectiveSettings.GenerateMediationReportSettings).WithGoogleRequestParam("parent", request => request.Parent); Modify_ApiCall(ref _callGenerateMediationReport); Modify_GenerateMediationReportApiCall(ref _callGenerateMediationReport); OnConstruction(grpcClient, effectiveSettings, clientHelper); }
partial void OnCopy(AdMobApiSettings existing);
partial void OnConstruction(AdMobApi.AdMobApiClient grpcClient, AdMobApiSettings effectiveSettings, gaxgrpc::ClientHelper clientHelper);