/// <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); }
/// <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)); }
partial void OnConstruction(SpeechTranslationService.SpeechTranslationServiceClient grpcClient, SpeechTranslationServiceSettings effectiveSettings, gaxgrpc::ClientHelper clientHelper);