Beispiel #1
0
        /// <summary>
        /// Retrieve a list of all End-User Types.
        /// </summary>
        /// <param name="options"> Read EndUserType parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of EndUserType </returns>
        public static ResourceSet <EndUserTypeResource> Read(ReadEndUserTypeOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildReadRequest(options, client));

            var page = Page <EndUserTypeResource> .FromJson("end_user_types", response.Content);

            return(new ResourceSet <EndUserTypeResource>(page, options, client));
        }
Beispiel #2
0
 private static Request BuildReadRequest(ReadEndUserTypeOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Numbers,
                "/v2/RegulatoryCompliance/EndUserTypes",
                queryParams: options.GetParams()
                ));
 }
Beispiel #3
0
        /// <summary>
        /// Retrieve a list of all End-User Types.
        /// </summary>
        /// <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 EndUserType </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <EndUserTypeResource> > ReadAsync(int?pageSize             = null,
                                                                                                       long?limit               = null,
                                                                                                       ITwilioRestClient client = null)
        {
            var options = new ReadEndUserTypeOptions()
            {
                PageSize = pageSize, Limit = limit
            };

            return(await ReadAsync(options, client));
        }
Beispiel #4
0
        /// <summary>
        /// Retrieve a list of all End-User Types.
        /// </summary>
        /// <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 EndUserType </returns>
        public static ResourceSet <EndUserTypeResource> Read(int?pageSize             = null,
                                                             long?limit               = null,
                                                             ITwilioRestClient client = null)
        {
            var options = new ReadEndUserTypeOptions()
            {
                PageSize = pageSize, Limit = limit
            };

            return(Read(options, client));
        }
Beispiel #5
0
        /// <summary>
        /// Retrieve a list of all End-User Types.
        /// </summary>
        /// <param name="options"> Read EndUserType parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of EndUserType </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <EndUserTypeResource> > ReadAsync(ReadEndUserTypeOptions options,
                                                                                                       ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildReadRequest(options, client));

            var page = Page <EndUserTypeResource> .FromJson("end_user_types", response.Content);

            return(new ResourceSet <EndUserTypeResource>(page, options, client));
        }