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

            _callSearchPhoneNumbers = clientHelper.BuildApiCall <SearchPhoneNumbersRequest, SearchPhoneNumbersResponse>(grpcClient.SearchPhoneNumbersAsync, grpcClient.SearchPhoneNumbers, effectiveSettings.SearchPhoneNumbersSettings);
            Modify_ApiCall(ref _callSearchPhoneNumbers);
            Modify_SearchPhoneNumbersApiCall(ref _callSearchPhoneNumbers);
            OnConstruction(grpcClient, effectiveSettings, clientHelper);
        }
Beispiel #2
0
        /// <summary>
        /// Creates a <see cref="PhoneNumbersClient"/> 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="PhoneNumbersSettings"/>.</param>
        /// <returns>The created <see cref="PhoneNumbersClient"/>.</returns>
        internal static PhoneNumbersClient Create(grpccore::CallInvoker callInvoker, PhoneNumbersSettings settings = null)
        {
            gax::GaxPreconditions.CheckNotNull(callInvoker, nameof(callInvoker));
            grpcinter::Interceptor interceptor = settings?.Interceptor;

            if (interceptor != null)
            {
                callInvoker = grpcinter::CallInvokerExtensions.Intercept(callInvoker, interceptor);
            }
            PhoneNumbers.PhoneNumbersClient grpcClient = new PhoneNumbers.PhoneNumbersClient(callInvoker);
            return(new PhoneNumbersClientImpl(grpcClient, settings));
        }
Beispiel #3
0
 partial void OnConstruction(PhoneNumbers.PhoneNumbersClient grpcClient, PhoneNumbersSettings effectiveSettings, gaxgrpc::ClientHelper clientHelper);