Пример #1
0
 private KeywordsSettings(KeywordsSettings existing) : base(existing)
 {
     gax::GaxPreconditions.CheckNotNull(existing, nameof(existing));
     Method1Settings = existing.Method1Settings;
     Method2Settings = existing.Method2Settings;
     OnCopy(existing);
 }
Пример #2
0
        /// <summary>
        /// Creates a <see cref="KeywordsClient"/> 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="KeywordsSettings"/>.</param>
        /// <param name="logger">Optional <see cref="mel::ILogger"/>.</param>
        /// <returns>The created <see cref="KeywordsClient"/>.</returns>
        internal static KeywordsClient Create(grpccore::CallInvoker callInvoker, KeywordsSettings 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);
            }
            Keywords.KeywordsClient grpcClient = new Keywords.KeywordsClient(callInvoker);
            return(new KeywordsClientImpl(grpcClient, settings, logger));
        }
Пример #3
0
        /// <summary>
        /// Constructs a client wrapper for the Keywords service, with the specified gRPC client and settings.
        /// </summary>
        /// <param name="grpcClient">The underlying gRPC client.</param>
        /// <param name="settings">The base <see cref="KeywordsSettings"/> used within this client.</param>
        /// <param name="logger">Optional <see cref="mel::ILogger"/> to use within this client.</param>
        public KeywordsClientImpl(Keywords.KeywordsClient grpcClient, KeywordsSettings settings, mel::ILogger logger)
        {
            GrpcClient = grpcClient;
            KeywordsSettings      effectiveSettings = settings ?? KeywordsSettings.GetDefault();
            gaxgrpc::ClientHelper clientHelper      = new gaxgrpc::ClientHelper(effectiveSettings, logger);

            _callMethod1 = clientHelper.BuildApiCall <Request, Response>("Method1", grpcClient.Method1Async, grpcClient.Method1, effectiveSettings.Method1Settings);
            Modify_ApiCall(ref _callMethod1);
            Modify_Method1ApiCall(ref _callMethod1);
            _callMethod2 = clientHelper.BuildApiCall <Resource, Response>("Method2", grpcClient.Method2Async, grpcClient.Method2, effectiveSettings.Method2Settings);
            Modify_ApiCall(ref _callMethod2);
            Modify_Method2ApiCall(ref _callMethod2);
            OnConstruction(grpcClient, effectiveSettings, clientHelper);
        }
Пример #4
0
 partial void OnConstruction(Keywords.KeywordsClient grpcClient, KeywordsSettings effectiveSettings, gaxgrpc::ClientHelper clientHelper);
Пример #5
0
 partial void OnCopy(KeywordsSettings existing);