Exemplo n.º 1
0
        /// <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));
        }
Exemplo n.º 2
0
        /// <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));
        }
Exemplo n.º 3
0
        /// <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));
        }
Exemplo n.º 4
0
 private static Request BuildReadRequest(ReadRoleOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Chat,
                "/v2/Services/" + options.PathServiceSid + "/Roles",
                queryParams: options.GetParams()
                ));
 }
Exemplo n.º 5
0
        /// <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));
        }