Beispiel #1
0
 /// <summary>
 /// Creates a <see cref="SharedCriterionServiceClient"/> 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="SharedCriterionServiceSettings"/>.</param>
 /// <returns>The created <see cref="SharedCriterionServiceClient"/>.</returns>
 public static SharedCriterionServiceClient Create(grpccore::CallInvoker callInvoker, SharedCriterionServiceSettings settings = null)
 {
     gax::GaxPreconditions.CheckNotNull(callInvoker, nameof(callInvoker));
     grpccore::Interceptors.Interceptor interceptor = settings?.Interceptor;
     if (interceptor != null)
     {
         callInvoker = grpccore::Interceptors.CallInvokerExtensions.Intercept(callInvoker, interceptor);
     }
     SharedCriterionService.SharedCriterionServiceClient grpcClient = new SharedCriterionService.SharedCriterionServiceClient(callInvoker);
     return(new SharedCriterionServiceClientImpl(grpcClient, settings));
 }
        /// <summary>
        /// Constructs a client wrapper for the SharedCriterionService service, with the specified gRPC client and
        /// settings.
        /// </summary>
        /// <param name="grpcClient">The underlying gRPC client.</param>
        /// <param name="settings">
        /// The base <see cref="SharedCriterionServiceSettings"/> used within this client.
        /// </param>
        public SharedCriterionServiceClientImpl(SharedCriterionService.SharedCriterionServiceClient grpcClient, SharedCriterionServiceSettings settings)
        {
            GrpcClient = grpcClient;
            SharedCriterionServiceSettings effectiveSettings = settings ?? SharedCriterionServiceSettings.GetDefault();
            gaxgrpc::ClientHelper          clientHelper      = new gaxgrpc::ClientHelper(effectiveSettings);

            _callGetSharedCriterion = clientHelper.BuildApiCall <GetSharedCriterionRequest, gagvr::SharedCriterion>(grpcClient.GetSharedCriterionAsync, grpcClient.GetSharedCriterion, effectiveSettings.GetSharedCriterionSettings).WithGoogleRequestParam("resource_name", request => request.ResourceName);
            Modify_ApiCall(ref _callGetSharedCriterion);
            Modify_GetSharedCriterionApiCall(ref _callGetSharedCriterion);
            _callMutateSharedCriteria = clientHelper.BuildApiCall <MutateSharedCriteriaRequest, MutateSharedCriteriaResponse>(grpcClient.MutateSharedCriteriaAsync, grpcClient.MutateSharedCriteria, effectiveSettings.MutateSharedCriteriaSettings).WithGoogleRequestParam("customer_id", request => request.CustomerId);
            Modify_ApiCall(ref _callMutateSharedCriteria);
            Modify_MutateSharedCriteriaApiCall(ref _callMutateSharedCriteria);
            OnConstruction(grpcClient, effectiveSettings, clientHelper);
        }
Beispiel #3
0
        /// <summary>
        /// Constructs a client wrapper for the SharedCriterionService service, with the specified gRPC client and settings.
        /// </summary>
        /// <param name="grpcClient">The underlying gRPC client.</param>
        /// <param name="settings">The base <see cref="SharedCriterionServiceSettings"/> used within this client </param>
        public SharedCriterionServiceClientImpl(SharedCriterionService.SharedCriterionServiceClient grpcClient, SharedCriterionServiceSettings settings)
        {
            GrpcClient = grpcClient;
            SharedCriterionServiceSettings effectiveSettings = settings ?? SharedCriterionServiceSettings.GetDefault();
            gaxgrpc::ClientHelper          clientHelper      = new gaxgrpc::ClientHelper(effectiveSettings);

            _callGetSharedCriterion = clientHelper.BuildApiCall <GetSharedCriterionRequest, gagvr::SharedCriterion>(
                GrpcClient.GetSharedCriterionAsync, GrpcClient.GetSharedCriterion, effectiveSettings.GetSharedCriterionSettings)
                                      .WithCallSettingsOverlay(request => gaxgrpc::CallSettings.FromHeader("x-goog-request-params", $"resource_name={request.ResourceName}"));
            _callMutateSharedCriteria = clientHelper.BuildApiCall <MutateSharedCriteriaRequest, MutateSharedCriteriaResponse>(
                GrpcClient.MutateSharedCriteriaAsync, GrpcClient.MutateSharedCriteria, effectiveSettings.MutateSharedCriteriaSettings)
                                        .WithCallSettingsOverlay(request => gaxgrpc::CallSettings.FromHeader("x-goog-request-params", $"customer_id={request.CustomerId}"));
            Modify_ApiCall(ref _callGetSharedCriterion);
            Modify_GetSharedCriterionApiCall(ref _callGetSharedCriterion);
            Modify_ApiCall(ref _callMutateSharedCriteria);
            Modify_MutateSharedCriteriaApiCall(ref _callMutateSharedCriteria);
            OnConstruction(grpcClient, effectiveSettings, clientHelper);
        }
Beispiel #4
0
 partial void OnConstruction(SharedCriterionService.SharedCriterionServiceClient grpcClient, SharedCriterionServiceSettings effectiveSettings, gaxgrpc::ClientHelper clientHelper);