Пример #1
0
        /// <summary>
        /// Retrieve a list of all Regulations.
        /// </summary>
        /// <param name="options"> Read Regulation parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Regulation </returns>
        public static ResourceSet <RegulationResource> Read(ReadRegulationOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildReadRequest(options, client));

            var page = Page <RegulationResource> .FromJson("results", response.Content);

            return(new ResourceSet <RegulationResource>(page, options, client));
        }
 private static Request BuildReadRequest(ReadRegulationOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Numbers,
                "/v2/RegulatoryCompliance/Regulations",
                queryParams: options.GetParams()
                ));
 }
Пример #3
0
        /// <summary>
        /// Retrieve a list of all Regulations.
        /// </summary>
        /// <param name="endUserType"> The type of End User of the Regulation resource </param>
        /// <param name="isoCountry"> The ISO country code of the phone number's country </param>
        /// <param name="numberType"> The type of phone number being regulated </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 Regulation </returns>
        public static ResourceSet <RegulationResource> Read(RegulationResource.EndUserTypeEnum endUserType = null,
                                                            string isoCountry        = null,
                                                            string numberType        = null,
                                                            int?pageSize             = null,
                                                            long?limit               = null,
                                                            ITwilioRestClient client = null)
        {
            var options = new ReadRegulationOptions()
            {
                EndUserType = endUserType, IsoCountry = isoCountry, NumberType = numberType, PageSize = pageSize, Limit = limit
            };

            return(Read(options, client));
        }
Пример #4
0
        /// <summary>
        /// Retrieve a list of all Regulations.
        /// </summary>
        /// <param name="endUserType"> The type of End User of the Regulation resource </param>
        /// <param name="isoCountry"> The ISO country code of the phone number's country </param>
        /// <param name="numberType"> The type of phone number being regulated </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 Regulation </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <RegulationResource> > ReadAsync(RegulationResource.EndUserTypeEnum endUserType = null,
                                                                                                      string isoCountry        = null,
                                                                                                      string numberType        = null,
                                                                                                      int?pageSize             = null,
                                                                                                      long?limit               = null,
                                                                                                      ITwilioRestClient client = null)
        {
            var options = new ReadRegulationOptions()
            {
                EndUserType = endUserType, IsoCountry = isoCountry, NumberType = numberType, PageSize = pageSize, Limit = limit
            };

            return(await ReadAsync(options, client));
        }
Пример #5
0
        /// <summary>
        /// Retrieve a list of all Regulations.
        /// </summary>
        /// <param name="options"> Read Regulation parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Regulation </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <RegulationResource> > ReadAsync(ReadRegulationOptions options,
                                                                                                      ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildReadRequest(options, client));

            var page = Page <RegulationResource> .FromJson("results", response.Content);

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