コード例 #1
0
 private SequenceServiceSettings(SequenceServiceSettings existing) : base(existing)
 {
     gax::GaxPreconditions.CheckNotNull(existing, nameof(existing));
     CreateSequenceSettings    = existing.CreateSequenceSettings;
     GetSequenceReportSettings = existing.GetSequenceReportSettings;
     AttemptSequenceSettings   = existing.AttemptSequenceSettings;
     OnCopy(existing);
 }
コード例 #2
0
        /// <summary>
        /// Constructs a client wrapper for the SequenceService service, with the specified gRPC client and settings.
        /// </summary>
        /// <param name="grpcClient">The underlying gRPC client.</param>
        /// <param name="settings">The base <see cref="SequenceServiceSettings"/> used within this client.</param>
        /// <param name="logger">Optional <see cref="mel::ILogger"/> to use within this client.</param>
        public SequenceServiceClientImpl(SequenceService.SequenceServiceClient grpcClient, SequenceServiceSettings settings, mel::ILogger logger)
        {
            GrpcClient = grpcClient;
            SequenceServiceSettings effectiveSettings = settings ?? SequenceServiceSettings.GetDefault();
            gaxgrpc::ClientHelper   clientHelper      = new gaxgrpc::ClientHelper(effectiveSettings, logger);

            _callCreateSequence = clientHelper.BuildApiCall <CreateSequenceRequest, Sequence>("CreateSequence", grpcClient.CreateSequenceAsync, grpcClient.CreateSequence, effectiveSettings.CreateSequenceSettings);
            Modify_ApiCall(ref _callCreateSequence);
            Modify_CreateSequenceApiCall(ref _callCreateSequence);
            _callGetSequenceReport = clientHelper.BuildApiCall <GetSequenceReportRequest, SequenceReport>("GetSequenceReport", grpcClient.GetSequenceReportAsync, grpcClient.GetSequenceReport, effectiveSettings.GetSequenceReportSettings).WithGoogleRequestParam("name", request => request.Name);
            Modify_ApiCall(ref _callGetSequenceReport);
            Modify_GetSequenceReportApiCall(ref _callGetSequenceReport);
            _callAttemptSequence = clientHelper.BuildApiCall <AttemptSequenceRequest, wkt::Empty>("AttemptSequence", grpcClient.AttemptSequenceAsync, grpcClient.AttemptSequence, effectiveSettings.AttemptSequenceSettings).WithGoogleRequestParam("name", request => request.Name);
            Modify_ApiCall(ref _callAttemptSequence);
            Modify_AttemptSequenceApiCall(ref _callAttemptSequence);
            OnConstruction(grpcClient, effectiveSettings, clientHelper);
        }
コード例 #3
0
 partial void OnConstruction(SequenceService.SequenceServiceClient grpcClient, SequenceServiceSettings effectiveSettings, gaxgrpc::ClientHelper clientHelper);
コード例 #4
0
 partial void OnCopy(SequenceServiceSettings existing);
コード例 #5
0
        /// <summary>
        /// Creates a <see cref="SequenceServiceClient"/> 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="SequenceServiceSettings"/>.</param>
        /// <param name="logger">Optional <see cref="mel::ILogger"/>.</param>
        /// <returns>The created <see cref="SequenceServiceClient"/>.</returns>
        internal static SequenceServiceClient Create(grpccore::CallInvoker callInvoker, SequenceServiceSettings settings = null, mel::ILogger logger = null)
        {
            gax::GaxPreconditions.CheckNotNull(callInvoker, nameof(callInvoker));
            grpcinter::Interceptor interceptor = settings?.Interceptor;

            if (interceptor != null)
            {
                callInvoker = grpcinter::CallInvokerExtensions.Intercept(callInvoker, interceptor);
            }
            SequenceService.SequenceServiceClient grpcClient = new SequenceService.SequenceServiceClient(callInvoker);
            return(new SequenceServiceClientImpl(grpcClient, settings, logger));
        }