コード例 #1
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));
        }
コード例 #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));
        }
コード例 #3
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));
        }
コード例 #4
0
 private static Request BuildReadRequest(ReadRoleOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.IpMessaging,
                "/v2/Services/" + options.PathServiceSid + "/Roles",
                queryParams: options.GetParams()
                ));
 }
コード例 #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));
        }