/// <summary> /// Initializes a new instance of the <see cref="T:Xamarin.Cognitive.Speech.SpeechApiClient"/> class. /// </summary> /// <param name="subscriptionKey">A valid subscription key for the Speech API.</param> /// <param name="speechRegion">The <see cref="SpeechRegion"/> where your speech service is deployed.</param> /// <param name="authEndpoint">The endpoint used to get the authentication token for the Speech API. Defaults to <see cref="Endpoint.Authentication"/>. To use a custom auth endpoint, set this to an <see cref="Endpoint"/> with your endpoint details.</param> /// <param name="speechEndpoint">The endpoint used to talk to the Speech API. Defaults to <see cref="Endpoint.SpeechServiceApi"/>. To use a CRIS/Custom Speech Service endpoint, set this to an <see cref="Endpoint"/> with the details for your CRIS service.</param> public SpeechApiClient(string subscriptionKey, SpeechRegion speechRegion, Endpoint authEndpoint = null, Endpoint speechEndpoint = null) { this.subscriptionKey = subscriptionKey; this.authEndpoint = authEndpoint ?? Endpoints.Authentication; this.speechEndpoint = speechEndpoint ?? Endpoints.SpeechServiceApi; this.SpeechRegion = speechRegion; client = new HttpClient(); AuthClient = new AuthenticationClient(this.authEndpoint, this.subscriptionKey, this.SpeechRegion); }