/// <summary> /// update /// </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)); }
/// <summary> /// update /// </summary> /// <param name="pathServiceSid"> The SID of the Service to update the resource from </param> /// <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> Task that resolves to A single instance of Role </returns> public static async System.Threading.Tasks.Task <RoleResource> UpdateAsync(string pathServiceSid, string pathSid, List <string> permission, ITwilioRestClient client = null) { var options = new UpdateRoleOptions(pathServiceSid, pathSid, permission); return(await UpdateAsync(options, client)); }
/// <summary> /// update /// </summary> /// <param name="pathServiceSid"> The SID of the Service to update the resource from </param> /// <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 pathServiceSid, string pathSid, List <string> permission, ITwilioRestClient client = null) { var options = new UpdateRoleOptions(pathServiceSid, pathSid, permission); return(Update(options, client)); }
private static Request BuildUpdateRequest(UpdateRoleOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Post, Rest.Domain.IpMessaging, "/v2/Services/" + options.PathServiceSid + "/Roles/" + options.PathSid + "", postParams: options.GetParams() )); }