コード例 #1
0
        /// <summary>
        /// Update an existing user role in your account's default service
        /// </summary>
        /// <param name="options"> Update Role parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Role </returns>
        public static async System.Threading.Tasks.Task <RoleResource> UpdateAsync(UpdateRoleOptions options,
                                                                                   ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildUpdateRequest(options, client));

            return(FromJson(response.Content));
        }
コード例 #2
0
 private static Request BuildUpdateRequest(UpdateRoleOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Conversations,
                "/v1/Roles/" + options.PathSid + "",
                postParams: options.GetParams(),
                headerParams: null
                ));
 }
コード例 #3
0
        /// <summary>
        /// Update an existing user role in your account's default service
        /// </summary>
        /// <param name="pathSid"> The SID of the Role resource to update </param>
        /// <param name="permission"> A permission the role should have </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Role </returns>
        public static RoleResource Update(string pathSid, List <string> permission, ITwilioRestClient client = null)
        {
            var options = new UpdateRoleOptions(pathSid, permission);

            return(Update(options, client));
        }