/// <summary> /// Creates a <see cref="CampaignSharedSetServiceClient"/> 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="CampaignSharedSetServiceSettings"/>.</param> /// <returns>The created <see cref="CampaignSharedSetServiceClient"/>.</returns> public static CampaignSharedSetServiceClient Create(grpccore::CallInvoker callInvoker, CampaignSharedSetServiceSettings settings = null) { gax::GaxPreconditions.CheckNotNull(callInvoker, nameof(callInvoker)); grpccore::Interceptors.Interceptor interceptor = settings?.Interceptor; if (interceptor != null) { callInvoker = grpccore::Interceptors.CallInvokerExtensions.Intercept(callInvoker, interceptor); } CampaignSharedSetService.CampaignSharedSetServiceClient grpcClient = new CampaignSharedSetService.CampaignSharedSetServiceClient(callInvoker); return(new CampaignSharedSetServiceClientImpl(grpcClient, settings)); }
/// <summary> /// Constructs a client wrapper for the CampaignSharedSetService service, with the specified gRPC client and /// settings. /// </summary> /// <param name="grpcClient">The underlying gRPC client.</param> /// <param name="settings"> /// The base <see cref="CampaignSharedSetServiceSettings"/> used within this client. /// </param> public CampaignSharedSetServiceClientImpl(CampaignSharedSetService.CampaignSharedSetServiceClient grpcClient, CampaignSharedSetServiceSettings settings) { GrpcClient = grpcClient; CampaignSharedSetServiceSettings effectiveSettings = settings ?? CampaignSharedSetServiceSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); _callGetCampaignSharedSet = clientHelper.BuildApiCall <GetCampaignSharedSetRequest, gagvr::CampaignSharedSet>(grpcClient.GetCampaignSharedSetAsync, grpcClient.GetCampaignSharedSet, effectiveSettings.GetCampaignSharedSetSettings).WithGoogleRequestParam("resource_name", request => request.ResourceName); Modify_ApiCall(ref _callGetCampaignSharedSet); Modify_GetCampaignSharedSetApiCall(ref _callGetCampaignSharedSet); _callMutateCampaignSharedSets = clientHelper.BuildApiCall <MutateCampaignSharedSetsRequest, MutateCampaignSharedSetsResponse>(grpcClient.MutateCampaignSharedSetsAsync, grpcClient.MutateCampaignSharedSets, effectiveSettings.MutateCampaignSharedSetsSettings).WithGoogleRequestParam("customer_id", request => request.CustomerId); Modify_ApiCall(ref _callMutateCampaignSharedSets); Modify_MutateCampaignSharedSetsApiCall(ref _callMutateCampaignSharedSets); OnConstruction(grpcClient, effectiveSettings, clientHelper); }
/// <summary> /// Constructs a client wrapper for the CampaignSharedSetService service, with the specified gRPC client and settings. /// </summary> /// <param name="grpcClient">The underlying gRPC client.</param> /// <param name="settings">The base <see cref="CampaignSharedSetServiceSettings"/> used within this client </param> public CampaignSharedSetServiceClientImpl(CampaignSharedSetService.CampaignSharedSetServiceClient grpcClient, CampaignSharedSetServiceSettings settings) { GrpcClient = grpcClient; CampaignSharedSetServiceSettings effectiveSettings = settings ?? CampaignSharedSetServiceSettings.GetDefault(); gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings); _callGetCampaignSharedSet = clientHelper.BuildApiCall <GetCampaignSharedSetRequest, gagvr::CampaignSharedSet>( GrpcClient.GetCampaignSharedSetAsync, GrpcClient.GetCampaignSharedSet, effectiveSettings.GetCampaignSharedSetSettings) .WithCallSettingsOverlay(request => gaxgrpc::CallSettings.FromHeader("x-goog-request-params", $"resource_name={request.ResourceName}")); _callMutateCampaignSharedSets = clientHelper.BuildApiCall <MutateCampaignSharedSetsRequest, MutateCampaignSharedSetsResponse>( GrpcClient.MutateCampaignSharedSetsAsync, GrpcClient.MutateCampaignSharedSets, effectiveSettings.MutateCampaignSharedSetsSettings) .WithCallSettingsOverlay(request => gaxgrpc::CallSettings.FromHeader("x-goog-request-params", $"customer_id={request.CustomerId}")); Modify_ApiCall(ref _callGetCampaignSharedSet); Modify_GetCampaignSharedSetApiCall(ref _callGetCampaignSharedSet); Modify_ApiCall(ref _callMutateCampaignSharedSets); Modify_MutateCampaignSharedSetsApiCall(ref _callMutateCampaignSharedSets); OnConstruction(grpcClient, effectiveSettings, clientHelper); }
partial void OnConstruction(CampaignSharedSetService.CampaignSharedSetServiceClient grpcClient, CampaignSharedSetServiceSettings effectiveSettings, gaxgrpc::ClientHelper clientHelper);