/// <summary>
        /// Creates a <see cref="PolicyTagManagerSerializationClient"/> 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="PolicyTagManagerSerializationSettings"/>.</param>
        /// <returns>The created <see cref="PolicyTagManagerSerializationClient"/>.</returns>
        internal static PolicyTagManagerSerializationClient Create(grpccore::CallInvoker callInvoker, PolicyTagManagerSerializationSettings settings = null)
        {
            gax::GaxPreconditions.CheckNotNull(callInvoker, nameof(callInvoker));
            grpcinter::Interceptor interceptor = settings?.Interceptor;

            if (interceptor != null)
            {
                callInvoker = grpcinter::CallInvokerExtensions.Intercept(callInvoker, interceptor);
            }
            PolicyTagManagerSerialization.PolicyTagManagerSerializationClient grpcClient = new PolicyTagManagerSerialization.PolicyTagManagerSerializationClient(callInvoker);
            return(new PolicyTagManagerSerializationClientImpl(grpcClient, settings));
        }
コード例 #2
0
        /// <summary>
        /// Constructs a client wrapper for the PolicyTagManagerSerialization service, with the specified gRPC client
        /// and settings.
        /// </summary>
        /// <param name="grpcClient">The underlying gRPC client.</param>
        /// <param name="settings">
        /// The base <see cref="PolicyTagManagerSerializationSettings"/> used within this client.
        /// </param>
        public PolicyTagManagerSerializationClientImpl(PolicyTagManagerSerialization.PolicyTagManagerSerializationClient grpcClient, PolicyTagManagerSerializationSettings settings)
        {
            GrpcClient = grpcClient;
            PolicyTagManagerSerializationSettings effectiveSettings = settings ?? PolicyTagManagerSerializationSettings.GetDefault();
            gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings);

            _callImportTaxonomies = clientHelper.BuildApiCall <ImportTaxonomiesRequest, ImportTaxonomiesResponse>(grpcClient.ImportTaxonomiesAsync, grpcClient.ImportTaxonomies, effectiveSettings.ImportTaxonomiesSettings).WithGoogleRequestParam("parent", request => request.Parent);
            Modify_ApiCall(ref _callImportTaxonomies);
            Modify_ImportTaxonomiesApiCall(ref _callImportTaxonomies);
            _callExportTaxonomies = clientHelper.BuildApiCall <ExportTaxonomiesRequest, ExportTaxonomiesResponse>(grpcClient.ExportTaxonomiesAsync, grpcClient.ExportTaxonomies, effectiveSettings.ExportTaxonomiesSettings).WithGoogleRequestParam("parent", request => request.Parent);
            Modify_ApiCall(ref _callExportTaxonomies);
            Modify_ExportTaxonomiesApiCall(ref _callExportTaxonomies);
            OnConstruction(grpcClient, effectiveSettings, clientHelper);
        }
 partial void OnConstruction(PolicyTagManagerSerialization.PolicyTagManagerSerializationClient grpcClient, PolicyTagManagerSerializationSettings effectiveSettings, gaxgrpc::ClientHelper clientHelper);