Example #1
0
        /// <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));
        }
Example #2
0
        /// <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));
        }
Example #3
0
        /// <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));
        }
Example #4
0
        /// <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,
                "/v2/Services/" + options.PathServiceSid + "/Channels/" + options.PathChannelSid + "/Members/" + options.PathSid + "",
                postParams: options.GetParams()
                ));
 }
Example #6
0
        /// <summary>
        /// update
        /// </summary>
        /// <param name="pathServiceSid"> Sid of the Service this member belongs to. </param>
        /// <param name="pathChannelSid"> Key that uniquely defines the channel this member belongs to. </param>
        /// <param name="pathSid"> Key that uniquely defines the member to update. </param>
        /// <param name="roleSid"> The role to be assigned to this member. </param>
        /// <param name="lastConsumedMessageIndex"> Field used to specify the last consumed Message index for the Channel for
        ///                                this Member. </param>
        /// <param name="lastConsumptionTimestamp"> ISO8601 time indicating the last datetime the Member consumed a Message in
        ///                                the Channel. </param>
        /// <param name="dateCreated"> The ISO8601 time specifying the datetime the Members should be set as being created.
        ///                   </param>
        /// <param name="dateUpdated"> The ISO8601 time specifying the datetime the Member should be set as having been last
        ///                   updated. </param>
        /// <param name="attributes"> An optional string metadata field you can use to store any data you wish. </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,
                                                                                     DateTime?lastConsumptionTimestamp = null,
                                                                                     DateTime?dateCreated     = null,
                                                                                     DateTime?dateUpdated     = null,
                                                                                     string attributes        = null,
                                                                                     ITwilioRestClient client = null)
        {
            var options = new UpdateMemberOptions(pathServiceSid, pathChannelSid, pathSid)
            {
                RoleSid = roleSid, LastConsumedMessageIndex = lastConsumedMessageIndex, LastConsumptionTimestamp = lastConsumptionTimestamp, DateCreated = dateCreated, DateUpdated = dateUpdated, Attributes = attributes
            };

            return(await UpdateAsync(options, client));
        }
        /// <summary>
        /// update
        /// </summary>
        /// <param name="pathServiceSid"> The SID of the Service to create the resource under </param>
        /// <param name="pathChannelSid"> The SID of the channel the member to update belongs to </param>
        /// <param name="pathSid"> The SID of the Member resource to update </param>
        /// <param name="roleSid"> The SID of the Role to assign to the member </param>
        /// <param name="lastConsumedMessageIndex"> The index of the last consumed Message for the Channel for the Member
        ///                                </param>
        /// <param name="lastConsumptionTimestamp"> The ISO 8601 based timestamp string representing the datetime of the last
        ///                                Message read event for the Member within the Channel </param>
        /// <param name="dateCreated"> The ISO 8601 date and time in GMT when the resource was created </param>
        /// <param name="dateUpdated"> The ISO 8601 date and time in GMT when the resource was updated </param>
        /// <param name="attributes"> A valid JSON string that contains application-specific data </param>
        /// <param name="xTwilioWebhookEnabled"> The X-Twilio-Webhook-Enabled HTTP request header </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,
                                            DateTime?lastConsumptionTimestamp = null,
                                            DateTime?dateCreated = null,
                                            DateTime?dateUpdated = null,
                                            string attributes    = null,
                                            MemberResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null,
                                            ITwilioRestClient client = null)
        {
            var options = new UpdateMemberOptions(pathServiceSid, pathChannelSid, pathSid)
            {
                RoleSid = roleSid, LastConsumedMessageIndex = lastConsumedMessageIndex, LastConsumptionTimestamp = lastConsumptionTimestamp, DateCreated = dateCreated, DateUpdated = dateUpdated, Attributes = attributes, XTwilioWebhookEnabled = xTwilioWebhookEnabled
            };

            return(Update(options, client));
        }