/// <summary>
        /// Update a specific Stream.
        /// </summary>
        /// <param name="options"> Update SyncStream parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of SyncStream </returns>
        public static SyncStreamResource Update(UpdateSyncStreamOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildUpdateRequest(options, client));

            return(FromJson(response.Content));
        }
 private static Request BuildUpdateRequest(UpdateSyncStreamOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Sync,
                "/v1/Services/" + options.PathServiceSid + "/Streams/" + options.PathSid + "",
                postParams: options.GetParams()
                ));
 }
        /// <summary>
        /// Update a specific Stream.
        /// </summary>
        /// <param name="pathServiceSid"> The SID of the Sync Service with the Sync Stream resource to update </param>
        /// <param name="pathSid"> The SID of the Stream resource to update </param>
        /// <param name="ttl"> How long, in seconds, before the Stream expires and is deleted </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of SyncStream </returns>
        public static async System.Threading.Tasks.Task <SyncStreamResource> UpdateAsync(string pathServiceSid,
                                                                                         string pathSid,
                                                                                         int?ttl = null,
                                                                                         ITwilioRestClient client = null)
        {
            var options = new UpdateSyncStreamOptions(pathServiceSid, pathSid)
            {
                Ttl = ttl
            };

            return(await UpdateAsync(options, client));
        }
        /// <summary>
        /// Update a specific Stream.
        /// </summary>
        /// <param name="pathServiceSid"> The SID of the Sync Service with the Sync Stream resource to update </param>
        /// <param name="pathSid"> The SID of the Stream resource to update </param>
        /// <param name="ttl"> How long, in seconds, before the Stream expires and is deleted </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of SyncStream </returns>
        public static SyncStreamResource Update(string pathServiceSid,
                                                string pathSid,
                                                int?ttl = null,
                                                ITwilioRestClient client = null)
        {
            var options = new UpdateSyncStreamOptions(pathServiceSid, pathSid)
            {
                Ttl = ttl
            };

            return(Update(options, client));
        }
        /// <summary>
        /// Update a specific Stream.
        /// </summary>
        /// <param name="options"> Update SyncStream parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of SyncStream </returns>
        public static async System.Threading.Tasks.Task <SyncStreamResource> UpdateAsync(UpdateSyncStreamOptions options,
                                                                                         ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildUpdateRequest(options, client));

            return(FromJson(response.Content));
        }