Пример #1
0
        protected Service(IApi api)
        {
            this.HttpClient = new HttpClient();

            this.HttpClient.Timeout = ClientTimeout;
            this.HttpClient.DefaultRequestHeaders.Accept.Add(MediaTypeWithQualityHeaderValue.Parse(ApplicationJson));
            this.HttpClient.BaseAddress = api.Base();

            this.jsonSerializerSettings = new JsonSerializerSettings {
                ContractResolver = this.defaultContractResolver
            };
        }
 public static Uri GetMediaWaveUri(
     this IApi api,
     long audioRecordingId,
     double startOffsetSeconds,
     double endOffsetSeconds,
     int?sampleRate = null,
     byte?channel   = 0)
 {
     return(api.Base(
                $"audio_recordings/{audioRecordingId}/media.wav?"
                + $"start_offset={startOffsetSeconds}&end_offset={endOffsetSeconds}"
                + (sampleRate.HasValue ? $"&sample_rate={sampleRate.Value}" : string.Empty)
                + (channel.HasValue ? $"&channel={channel.Value}" : string.Empty)));
 }
 public static Uri GetMediaInfoUri(this IApi api, long audioRecordingId, double startOffsetSeconds, double endOffsetSeconds)
 {
     return(api.Base($"audio_recordings/{audioRecordingId}/media.json?start_offset={startOffsetSeconds}&end_offset={endOffsetSeconds}"));
 }
 public static Uri GetMediaInfoUri(this IApi api, long audioRecordingId)
 {
     return(api.Base($"audio_recordings/{audioRecordingId}/media.json"));
 }
 public static Uri GetSessionValidateUri(this IApi api)
 {
     return(api.Base("security/user"));
 }
 public static Uri GetLoginUri(this IApi api)
 {
     return(api.Base("security"));
 }
 public static Uri GetAudioRecordingUri(this IApi api, long audioRecordingId)
 {
     return(api.Base($"audio_recordings/{audioRecordingId}"));
 }
 public static Uri GetAudioEventFilterUri(this IApi api)
 {
     return(api.Base("audio_events/filter"));
 }