/// <summary>
        /// update
        /// </summary>
        /// <param name="options"> Update Member parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Member </returns>
        public static MemberResource Update(UpdateMemberOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildUpdateRequest(options, client));

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

            return(FromJson(response.Content));
        }
        /// <summary>
        /// update
        /// </summary>
        ///
        /// <param name="pathServiceSid"> The service_sid </param>
        /// <param name="pathChannelSid"> The channel_sid </param>
        /// <param name="pathSid"> The sid </param>
        /// <param name="roleSid"> The role_sid </param>
        /// <param name="lastConsumedMessageIndex"> The last_consumed_message_index </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Member </returns>
        public static async System.Threading.Tasks.Task <MemberResource> UpdateAsync(string pathServiceSid, string pathChannelSid, string pathSid, string roleSid = null, int?lastConsumedMessageIndex = null, ITwilioRestClient client = null)
        {
            var options = new UpdateMemberOptions(pathServiceSid, pathChannelSid, pathSid)
            {
                RoleSid = roleSid, LastConsumedMessageIndex = lastConsumedMessageIndex
            };

            return(await UpdateAsync(options, client));
        }
        /// <summary>
        /// update
        /// </summary>
        ///
        /// <param name="pathServiceSid"> The service_sid </param>
        /// <param name="pathChannelSid"> The channel_sid </param>
        /// <param name="pathSid"> The sid </param>
        /// <param name="roleSid"> The role_sid </param>
        /// <param name="lastConsumedMessageIndex"> The last_consumed_message_index </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Member </returns>
        public static MemberResource Update(string pathServiceSid, string pathChannelSid, string pathSid, string roleSid = null, int?lastConsumedMessageIndex = null, ITwilioRestClient client = null)
        {
            var options = new UpdateMemberOptions(pathServiceSid, pathChannelSid, pathSid)
            {
                RoleSid = roleSid, LastConsumedMessageIndex = lastConsumedMessageIndex
            };

            return(Update(options, client));
        }
 private static Request BuildUpdateRequest(UpdateMemberOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Chat,
                "/v1/Services/" + options.PathServiceSid + "/Channels/" + options.PathChannelSid + "/Members/" + options.PathSid + "",
                postParams: options.GetParams()
                ));
 }