コード例 #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));
 }
コード例 #2
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);
            _callMutateSharedCriteria = clientHelper.BuildApiCall <MutateSharedCriteriaRequest, MutateSharedCriteriaResponse>(
                GrpcClient.MutateSharedCriteriaAsync, GrpcClient.MutateSharedCriteria, effectiveSettings.MutateSharedCriteriaSettings);
            Modify_ApiCall(ref _callGetSharedCriterion);
            Modify_GetSharedCriterionApiCall(ref _callGetSharedCriterion);
            Modify_ApiCall(ref _callMutateSharedCriteria);
            Modify_MutateSharedCriteriaApiCall(ref _callMutateSharedCriteria);
            OnConstruction(grpcClient, effectiveSettings, clientHelper);
        }
コード例 #3
0
 partial void OnConstruction(SharedCriterionService.SharedCriterionServiceClient grpcClient, SharedCriterionServiceSettings effectiveSettings, gaxgrpc::ClientHelper clientHelper);