Esempio n. 1
0
 private SpeechTranslationServiceSettings(SpeechTranslationServiceSettings existing) : base(existing)
 {
     gax::GaxPreconditions.CheckNotNull(existing, nameof(existing));
     StreamingTranslateSpeechSettings          = existing.StreamingTranslateSpeechSettings;
     StreamingTranslateSpeechStreamingSettings = existing.StreamingTranslateSpeechStreamingSettings;
     OnCopy(existing);
 }
Esempio n. 2
0
        /// <summary>
        /// Constructs a client wrapper for the SpeechTranslationService service, with the specified gRPC client and
        /// settings.
        /// </summary>
        /// <param name="grpcClient">The underlying gRPC client.</param>
        /// <param name="settings">
        /// The base <see cref="SpeechTranslationServiceSettings"/> used within this client.
        /// </param>
        public SpeechTranslationServiceClientImpl(SpeechTranslationService.SpeechTranslationServiceClient grpcClient, SpeechTranslationServiceSettings settings)
        {
            GrpcClient = grpcClient;
            SpeechTranslationServiceSettings effectiveSettings = settings ?? SpeechTranslationServiceSettings.GetDefault();
            gaxgrpc::ClientHelper            clientHelper      = new gaxgrpc::ClientHelper(effectiveSettings);

            _callStreamingTranslateSpeech = clientHelper.BuildApiCall <StreamingTranslateSpeechRequest, StreamingTranslateSpeechResponse>(grpcClient.StreamingTranslateSpeech, effectiveSettings.StreamingTranslateSpeechSettings, effectiveSettings.StreamingTranslateSpeechStreamingSettings);
            Modify_ApiCall(ref _callStreamingTranslateSpeech);
            Modify_StreamingTranslateSpeechApiCall(ref _callStreamingTranslateSpeech);
            OnConstruction(grpcClient, effectiveSettings, clientHelper);
        }
Esempio n. 3
0
 partial void OnCopy(SpeechTranslationServiceSettings existing);
Esempio n. 4
0
 partial void OnConstruction(SpeechTranslationService.SpeechTranslationServiceClient grpcClient, SpeechTranslationServiceSettings effectiveSettings, gaxgrpc::ClientHelper clientHelper);
Esempio n. 5
0
        /// <summary>
        /// Creates a <see cref="SpeechTranslationServiceClient"/> 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="SpeechTranslationServiceSettings"/>.</param>
        /// <returns>The created <see cref="SpeechTranslationServiceClient"/>.</returns>
        internal static SpeechTranslationServiceClient Create(grpccore::CallInvoker callInvoker, SpeechTranslationServiceSettings settings = null)
        {
            gax::GaxPreconditions.CheckNotNull(callInvoker, nameof(callInvoker));
            grpcinter::Interceptor interceptor = settings?.Interceptor;

            if (interceptor != null)
            {
                callInvoker = grpcinter::CallInvokerExtensions.Intercept(callInvoker, interceptor);
            }
            SpeechTranslationService.SpeechTranslationServiceClient grpcClient = new SpeechTranslationService.SpeechTranslationServiceClient(callInvoker);
            return(new SpeechTranslationServiceClientImpl(grpcClient, settings));
        }