Exemplo n.º 1
0
        /// <summary>
        /// Changes the status of the recording to paused, stopped, or in-progress. Note: Pass `Twilio.CURRENT` instead of
        /// recording sid to reference current active recording.
        /// </summary>
        /// <param name="options"> Update Recording parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Recording </returns>
        public static RecordingResource Update(UpdateRecordingOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildUpdateRequest(options, client));

            return(FromJson(response.Content));
        }
 private static Request BuildUpdateRequest(UpdateRecordingOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Api,
                "/2010-04-01/Accounts/" + (options.PathAccountSid ?? client.AccountSid) + "/Calls/" + options.PathCallSid + "/Recordings/" + options.PathSid + ".json",
                postParams: options.GetParams()
                ));
 }
Exemplo n.º 3
0
        /// <summary>
        /// Changes the status of the recording to paused, stopped, or in-progress
        /// </summary>
        /// <param name="pathCallSid"> The call_sid </param>
        /// <param name="pathSid"> The sid </param>
        /// <param name="status"> The status to change the recording to. </param>
        /// <param name="pathAccountSid"> The account_sid </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> UpdateAsync(string pathCallSid,
                                                                                        string pathSid,
                                                                                        RecordingResource.StatusEnum status,
                                                                                        string pathAccountSid    = null,
                                                                                        ITwilioRestClient client = null)
        {
            var options = new UpdateRecordingOptions(pathCallSid, pathSid, status)
            {
                PathAccountSid = pathAccountSid
            };

            return(await UpdateAsync(options, client));
        }
Exemplo n.º 4
0
        /// <summary>
        /// Changes the status of the recording to paused, stopped, or in-progress
        /// </summary>
        /// <param name="pathCallSid"> The call_sid </param>
        /// <param name="pathSid"> The sid </param>
        /// <param name="status"> The status to change the recording to. </param>
        /// <param name="pathAccountSid"> The account_sid </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Recording </returns>
        public static RecordingResource Update(string pathCallSid,
                                               string pathSid,
                                               RecordingResource.StatusEnum status,
                                               string pathAccountSid    = null,
                                               ITwilioRestClient client = null)
        {
            var options = new UpdateRecordingOptions(pathCallSid, pathSid, status)
            {
                PathAccountSid = pathAccountSid
            };

            return(Update(options, client));
        }
Exemplo n.º 5
0
        /// <summary>
        /// Changes the status of the recording to paused, stopped, or in-progress. Note: Pass `Twilio.CURRENT` instead of
        /// recording sid to reference current active recording.
        /// </summary>
        /// <param name="options"> Update 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> UpdateAsync(UpdateRecordingOptions options,
                                                                                        ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildUpdateRequest(options, client));

            return(FromJson(response.Content));
        }