Пример #1
0
        /// <summary>
        /// Update an existing conversation user in your account's default 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));
        }
Пример #2
0
        /// <summary>
        /// Update an existing conversation user in your account's default 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));
        }
Пример #3
0
 private static Request BuildUpdateRequest(UpdateUserOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Conversations,
                "/v1/Users/" + options.PathSid + "",
                postParams: options.GetParams(),
                headerParams: options.GetHeaderParams()
                ));
 }
Пример #4
0
        /// <summary>
        /// Update an existing conversation user in your account's default service
        /// </summary>
        /// <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 pathSid,
                                                                                   string friendlyName = null,
                                                                                   string attributes   = null,
                                                                                   string roleSid      = null,
                                                                                   UserResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null,
                                                                                   ITwilioRestClient client = null)
        {
            var options = new UpdateUserOptions(pathSid)
            {
                FriendlyName = friendlyName, Attributes = attributes, RoleSid = roleSid, XTwilioWebhookEnabled = xTwilioWebhookEnabled
            };

            return(await UpdateAsync(options, client));
        }
Пример #5
0
        /// <summary>
        /// Update an existing conversation user in your account's default service
        /// </summary>
        /// <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 pathSid,
                                          string friendlyName = null,
                                          string attributes   = null,
                                          string roleSid      = null,
                                          UserResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null,
                                          ITwilioRestClient client = null)
        {
            var options = new UpdateUserOptions(pathSid)
            {
                FriendlyName = friendlyName, Attributes = attributes, RoleSid = roleSid, XTwilioWebhookEnabled = xTwilioWebhookEnabled
            };

            return(Update(options, client));
        }