Exemple #1
0
        /// <summary>
        /// update
        /// </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));
        }
Exemple #2
0
        /// <summary>
        /// update
        /// </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));
        }
Exemple #3
0
        /// <summary>
        /// update
        /// </summary>
        ///
        /// <param name="pathServiceSid"> The service_sid </param>
        /// <param name="pathSid"> The sid </param>
        /// <param name="roleSid"> The role_sid </param>
        /// <param name="attributes"> The attributes </param>
        /// <param name="friendlyName"> The friendly_name </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 pathServiceSid, string pathSid, string roleSid = null, string attributes = null, string friendlyName = null, ITwilioRestClient client = null)
        {
            var options = new UpdateUserOptions(pathServiceSid, pathSid)
            {
                RoleSid = roleSid, Attributes = attributes, FriendlyName = friendlyName
            };

            return(await UpdateAsync(options, client));
        }
Exemple #4
0
        /// <summary>
        /// update
        /// </summary>
        ///
        /// <param name="pathServiceSid"> The service_sid </param>
        /// <param name="pathSid"> The sid </param>
        /// <param name="roleSid"> The role_sid </param>
        /// <param name="attributes"> The attributes </param>
        /// <param name="friendlyName"> The friendly_name </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of User </returns>
        public static UserResource Update(string pathServiceSid, string pathSid, string roleSid = null, string attributes = null, string friendlyName = null, ITwilioRestClient client = null)
        {
            var options = new UpdateUserOptions(pathServiceSid, pathSid)
            {
                RoleSid = roleSid, Attributes = attributes, FriendlyName = friendlyName
            };

            return(Update(options, client));
        }
Exemple #5
0
 private static Request BuildUpdateRequest(UpdateUserOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.IpMessaging,
                "/v1/Services/" + options.PathServiceSid + "/Users/" + options.PathSid + "",
                postParams: options.GetParams()
                ));
 }