Example #1
0
        /// <summary>
        /// Fetch an instance of a recording for a call
        /// </summary>
        /// <param name="options"> Fetch Recording parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Recording </returns>
        public static RecordingResource Fetch(FetchRecordingOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }
 private static Request BuildFetchRequest(FetchRecordingOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Api,
                "/2010-04-01/Accounts/" + (options.PathAccountSid ?? client.AccountSid) + "/Conferences/" + options.PathConferenceSid + "/Recordings/" + options.PathSid + ".json",
                queryParams: options.GetParams()
                ));
 }
Example #3
0
        /// <summary>
        /// Fetch an instance of a recording for a call
        /// </summary>
        /// <param name="pathConferenceSid"> Fetch by unique Conference SID for the recording </param>
        /// <param name="pathSid"> The unique string that identifies the resource </param>
        /// <param name="pathAccountSid"> The SID of the Account that created the resource to fetch </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Recording </returns>
        public static async System.Threading.Tasks.Task <RecordingResource> FetchAsync(string pathConferenceSid,
                                                                                       string pathSid,
                                                                                       string pathAccountSid    = null,
                                                                                       ITwilioRestClient client = null)
        {
            var options = new FetchRecordingOptions(pathConferenceSid, pathSid)
            {
                PathAccountSid = pathAccountSid
            };

            return(await FetchAsync(options, client));
        }
Example #4
0
        /// <summary>
        /// Fetch an instance of a recording for a call
        /// </summary>
        /// <param name="pathConferenceSid"> Fetch by unique Conference SID for the recording </param>
        /// <param name="pathSid"> The unique string that identifies the resource </param>
        /// <param name="pathAccountSid"> The SID of the Account that created the resource to fetch </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Recording </returns>
        public static RecordingResource Fetch(string pathConferenceSid,
                                              string pathSid,
                                              string pathAccountSid    = null,
                                              ITwilioRestClient client = null)
        {
            var options = new FetchRecordingOptions(pathConferenceSid, pathSid)
            {
                PathAccountSid = pathAccountSid
            };

            return(Fetch(options, client));
        }
Example #5
0
        /// <summary>
        /// Fetch an instance of a recording for a call
        /// </summary>
        /// <param name="options"> Fetch Recording parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Recording </returns>
        public static async System.Threading.Tasks.Task <RecordingResource> FetchAsync(FetchRecordingOptions options,
                                                                                       ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }