/// <summary> /// Retrieve a list of all Bundles for an account. /// </summary> /// <param name="options"> Read Bundle parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Bundle </returns> public static ResourceSet <BundleResource> Read(ReadBundleOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildReadRequest(options, client)); var page = Page <BundleResource> .FromJson("results", response.Content); return(new ResourceSet <BundleResource>(page, options, client)); }
private static Request BuildReadRequest(ReadBundleOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Get, Rest.Domain.Numbers, "/v2/RegulatoryCompliance/Bundles", queryParams: options.GetParams() )); }
/// <summary> /// Retrieve a list of all Bundles for an account. /// </summary> /// <param name="status"> The verification status of the Bundle resource </param> /// <param name="friendlyName"> The string that you assigned to describe the resource </param> /// <param name="regulationSid"> The unique string of a regulation. </param> /// <param name="isoCountry"> The ISO country code of the country </param> /// <param name="numberType"> The type of phone number </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 Bundle </returns> public static async System.Threading.Tasks.Task <ResourceSet <BundleResource> > ReadAsync(BundleResource.StatusEnum status = null, string friendlyName = null, string regulationSid = null, string isoCountry = null, string numberType = null, int?pageSize = null, long?limit = null, ITwilioRestClient client = null) { var options = new ReadBundleOptions() { Status = status, FriendlyName = friendlyName, RegulationSid = regulationSid, IsoCountry = isoCountry, NumberType = numberType, PageSize = pageSize, Limit = limit }; return(await ReadAsync(options, client)); }
/// <summary> /// Retrieve a list of all Bundles for an account. /// </summary> /// <param name="options"> Read Bundle parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of Bundle </returns> public static async System.Threading.Tasks.Task <ResourceSet <BundleResource> > ReadAsync(ReadBundleOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client)); var page = Page <BundleResource> .FromJson("results", response.Content); return(new ResourceSet <BundleResource>(page, options, client)); }