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

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

            BatchProcessDocumentsOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClient(), effectiveSettings.BatchProcessDocumentsOperationsSettings);
            _callBatchProcessDocuments            = clientHelper.BuildApiCall <BatchProcessDocumentsRequest, lro::Operation>(grpcClient.BatchProcessDocumentsAsync, grpcClient.BatchProcessDocuments, effectiveSettings.BatchProcessDocumentsSettings).WithGoogleRequestParam("parent", request => request.Parent);
            Modify_ApiCall(ref _callBatchProcessDocuments);
            Modify_BatchProcessDocumentsApiCall(ref _callBatchProcessDocuments);
            _callProcessDocument = clientHelper.BuildApiCall <ProcessDocumentRequest, Document>(grpcClient.ProcessDocumentAsync, grpcClient.ProcessDocument, effectiveSettings.ProcessDocumentSettings).WithGoogleRequestParam("parent", request => request.Parent);
            Modify_ApiCall(ref _callProcessDocument);
            Modify_ProcessDocumentApiCall(ref _callProcessDocument);
            OnConstruction(grpcClient, effectiveSettings, clientHelper);
        }
Example #3
0
 partial void OnConstruction(DocumentUnderstandingService.DocumentUnderstandingServiceClient grpcClient, DocumentUnderstandingServiceSettings effectiveSettings, gaxgrpc::ClientHelper clientHelper);