예제 #1
0
        /// <summary>
        /// Constructs a client wrapper for the RegionInstances service, with the specified gRPC client and settings.
        /// </summary>
        /// <param name="grpcClient">The underlying gRPC client.</param>
        /// <param name="settings">The base <see cref="RegionInstancesSettings"/> used within this client.</param>
        public RegionInstancesClientImpl(RegionInstances.RegionInstancesClient grpcClient, RegionInstancesSettings settings)
        {
            GrpcClient = grpcClient;
            RegionInstancesSettings effectiveSettings = settings ?? RegionInstancesSettings.GetDefault();
            gaxgrpc::ClientHelper   clientHelper      = new gaxgrpc::ClientHelper(effectiveSettings);

            _callBulkInsert = clientHelper.BuildApiCall <BulkInsertRegionInstanceRequest, Operation>(grpcClient.BulkInsertAsync, grpcClient.BulkInsert, effectiveSettings.BulkInsertSettings).WithGoogleRequestParam("project", request => request.Project).WithGoogleRequestParam("region", request => request.Region);
            Modify_ApiCall(ref _callBulkInsert);
            Modify_BulkInsertApiCall(ref _callBulkInsert);
            OnConstruction(grpcClient, effectiveSettings, clientHelper);
        }
        /// <summary>
        /// Creates a <see cref="RegionInstancesClient"/> 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="RegionInstancesSettings"/>.</param>
        /// <returns>The created <see cref="RegionInstancesClient"/>.</returns>
        internal static RegionInstancesClient Create(grpccore::CallInvoker callInvoker, RegionInstancesSettings settings = null)
        {
            gax::GaxPreconditions.CheckNotNull(callInvoker, nameof(callInvoker));
            grpcinter::Interceptor interceptor = settings?.Interceptor;

            if (interceptor != null)
            {
                callInvoker = grpcinter::CallInvokerExtensions.Intercept(callInvoker, interceptor);
            }
            RegionInstances.RegionInstancesClient grpcClient = new RegionInstances.RegionInstancesClient(callInvoker);
            return(new RegionInstancesClientImpl(grpcClient, settings));
        }
 partial void OnConstruction(RegionInstances.RegionInstancesClient grpcClient, RegionInstancesSettings effectiveSettings, gaxgrpc::ClientHelper clientHelper);