Esempio n. 1
0
        /// <summary>
        /// Update an existing conversation user in your service
        /// </summary>
        /// <param name="options"> Update User parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of User </returns>
        public static UserResource Update(UpdateUserOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildUpdateRequest(options, client));

            return(FromJson(response.Content));
        }
Esempio n. 2
0
        /// <summary>
        /// Update an existing conversation user in your service
        /// </summary>
        /// <param name="options"> Update User parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of User </returns>
        public static async System.Threading.Tasks.Task <UserResource> UpdateAsync(UpdateUserOptions options,
                                                                                   ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildUpdateRequest(options, client));

            return(FromJson(response.Content));
        }
Esempio n. 3
0
 private static Request BuildUpdateRequest(UpdateUserOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Conversations,
                "/v1/Services/" + options.PathChatServiceSid + "/Users/" + options.PathSid + "",
                postParams: options.GetParams(),
                headerParams: options.GetHeaderParams()
                ));
 }
Esempio n. 4
0
        /// <summary>
        /// Update an existing conversation user in your service
        /// </summary>
        /// <param name="pathChatServiceSid"> The SID of the Conversation Service that the resource is associated with </param>
        /// <param name="pathSid"> The SID of the User resource to update </param>
        /// <param name="friendlyName"> The string that you assigned to describe the resource </param>
        /// <param name="attributes"> The JSON Object string that stores application-specific data </param>
        /// <param name="roleSid"> The SID of a service-level Role to assign to the user </param>
        /// <param name="xTwilioWebhookEnabled"> The X-Twilio-Webhook-Enabled HTTP request header </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of User </returns>
        public static async System.Threading.Tasks.Task <UserResource> UpdateAsync(string pathChatServiceSid,
                                                                                   string pathSid,
                                                                                   string friendlyName = null,
                                                                                   string attributes   = null,
                                                                                   string roleSid      = null,
                                                                                   UserResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null,
                                                                                   ITwilioRestClient client = null)
        {
            var options = new UpdateUserOptions(pathChatServiceSid, pathSid)
            {
                FriendlyName = friendlyName, Attributes = attributes, RoleSid = roleSid, XTwilioWebhookEnabled = xTwilioWebhookEnabled
            };

            return(await UpdateAsync(options, client));
        }
Esempio n. 5
0
        /// <summary>
        /// Update an existing conversation user in your service
        /// </summary>
        /// <param name="pathChatServiceSid"> The SID of the Conversation Service that the resource is associated with </param>
        /// <param name="pathSid"> The SID of the User resource to update </param>
        /// <param name="friendlyName"> The string that you assigned to describe the resource </param>
        /// <param name="attributes"> The JSON Object string that stores application-specific data </param>
        /// <param name="roleSid"> The SID of a service-level Role to assign to the user </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 User </returns>
        public static UserResource Update(string pathChatServiceSid,
                                          string pathSid,
                                          string friendlyName = null,
                                          string attributes   = null,
                                          string roleSid      = null,
                                          UserResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null,
                                          ITwilioRestClient client = null)
        {
            var options = new UpdateUserOptions(pathChatServiceSid, pathSid)
            {
                FriendlyName = friendlyName, Attributes = attributes, RoleSid = roleSid, XTwilioWebhookEnabled = xTwilioWebhookEnabled
            };

            return(Update(options, client));
        }