Beispiel #1
0
 private static Request BuildReadRequest(ReadTranscriptionOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Api,
                "/2010-04-01/Accounts/" + (options.PathAccountSid ?? client.AccountSid) + "/Recordings/" + options.PathRecordingSid + "/Transcriptions.json",
                queryParams: options.GetParams()
                ));
 }
        /// <summary>
        /// read
        /// </summary>
        ///
        /// <param name="pathRecordingSid"> The recording_sid </param>
        /// <param name="pathAccountSid"> The account_sid </param>
        /// <param name="pageSize"> Page size </param>
        /// <param name="limit"> Record limit </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Transcription </returns>
        public static ResourceSet <TranscriptionResource> Read(string pathRecordingSid, string pathAccountSid = null, int?pageSize = null, long?limit = null, ITwilioRestClient client = null)
        {
            var options = new ReadTranscriptionOptions(pathRecordingSid)
            {
                PathAccountSid = pathAccountSid, PageSize = pageSize, Limit = limit
            };

            return(Read(options, client));
        }
        /// <summary>
        /// read
        /// </summary>
        ///
        /// <param name="pathRecordingSid"> The recording_sid </param>
        /// <param name="pathAccountSid"> The account_sid </param>
        /// <param name="pageSize"> Page size </param>
        /// <param name="limit"> Record limit </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Transcription </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <TranscriptionResource> > ReadAsync(string pathRecordingSid, string pathAccountSid = null, int?pageSize = null, long?limit = null, ITwilioRestClient client = null)
        {
            var options = new ReadTranscriptionOptions(pathRecordingSid)
            {
                PathAccountSid = pathAccountSid, PageSize = pageSize, Limit = limit
            };

            return(await ReadAsync(options, client));
        }
        /// <summary>
        /// read
        /// </summary>
        ///
        /// <param name="options"> Read Transcription parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Transcription </returns>
        public static ResourceSet <TranscriptionResource> Read(ReadTranscriptionOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildReadRequest(options, client));

            var page = Page <TranscriptionResource> .FromJson("transcriptions", response.Content);

            return(new ResourceSet <TranscriptionResource>(page, options, client));
        }
Beispiel #5
0
        /// <summary>
        /// read
        /// </summary>
        /// <param name="options"> Read Transcription parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Transcription </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <TranscriptionResource> > ReadAsync(ReadTranscriptionOptions options,
                                                                                                         ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildReadRequest(options, client));

            var page = Page <TranscriptionResource> .FromJson("transcriptions", response.Content);

            return(new ResourceSet <TranscriptionResource>(page, options, client));
        }