/// <summary> /// read /// </summary> /// <param name="options"> Read Role parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Role </returns> public static ResourceSet <RoleResource> Read(ReadRoleOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildReadRequest(options, client)); var page = Page <RoleResource> .FromJson("roles", response.Content); return(new ResourceSet <RoleResource>(page, options, client)); }
/// <summary> /// read /// </summary> /// /// <param name="pathServiceSid"> The service_sid </param> /// <param name="pageSize"> Page size </param> /// <param name="limit"> Record limit </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Role </returns> public static ResourceSet <RoleResource> Read(string pathServiceSid, int?pageSize = null, long?limit = null, ITwilioRestClient client = null) { var options = new ReadRoleOptions(pathServiceSid) { PageSize = pageSize, Limit = limit }; return(Read(options, client)); }
/// <summary> /// read /// </summary> /// /// <param name="pathServiceSid"> The service_sid </param> /// <param name="pageSize"> Page size </param> /// <param name="limit"> Record limit </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 <ResourceSet <RoleResource> > ReadAsync(string pathServiceSid, int?pageSize = null, long?limit = null, ITwilioRestClient client = null) { var options = new ReadRoleOptions(pathServiceSid) { PageSize = pageSize, Limit = limit }; return(await ReadAsync(options, client)); }
private static Request BuildReadRequest(ReadRoleOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Get, Rest.Domain.IpMessaging, "/v2/Services/" + options.PathServiceSid + "/Roles", queryParams: options.GetParams() )); }
/// <summary> /// read /// </summary> /// <param name="options"> Read 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 <ResourceSet <RoleResource> > ReadAsync(ReadRoleOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client)); var page = Page <RoleResource> .FromJson("roles", response.Content); return(new ResourceSet <RoleResource>(page, options, client)); }