private static Request BuildReadRequest(ReadDependentHostedNumberOrderOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Preview,
                "/HostedNumbers/AuthorizationDocuments/" + options.PathSigningDocumentSid + "/DependentHostedNumberOrders",
                queryParams: options.GetParams()
                ));
 }
        /// <summary>
        /// Retrieve a list of dependent HostedNumberOrders belonging to the AuthorizationDocument.
        /// </summary>
        /// <param name="options"> Read DependentHostedNumberOrder parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of DependentHostedNumberOrder </returns>
        public static ResourceSet <DependentHostedNumberOrderResource> Read(ReadDependentHostedNumberOrderOptions options,
                                                                            ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildReadRequest(options, client));

            var page = Page <DependentHostedNumberOrderResource> .FromJson("items", response.Content);

            return(new ResourceSet <DependentHostedNumberOrderResource>(page, options, client));
        }
        /// <summary>
        /// Retrieve a list of dependent HostedNumberOrders belonging to the AuthorizationDocument.
        /// </summary>
        /// <param name="pathSigningDocumentSid"> The signing_document_sid </param>
        /// <param name="status"> The Status of this HostedNumberOrder. </param>
        /// <param name="phoneNumber"> An E164 formatted phone number. </param>
        /// <param name="incomingPhoneNumberSid"> IncomingPhoneNumber sid. </param>
        /// <param name="friendlyName"> A human readable description of this resource. </param>
        /// <param name="uniqueName"> A unique, developer assigned name of this HostedNumberOrder. </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 DependentHostedNumberOrder </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <DependentHostedNumberOrderResource> > ReadAsync(string pathSigningDocumentSid,
                                                                                                                      DependentHostedNumberOrderResource.StatusEnum status = null,
                                                                                                                      Types.PhoneNumber phoneNumber = null,
                                                                                                                      string incomingPhoneNumberSid = null,
                                                                                                                      string friendlyName           = null,
                                                                                                                      string uniqueName             = null,
                                                                                                                      int?pageSize             = null,
                                                                                                                      long?limit               = null,
                                                                                                                      ITwilioRestClient client = null)
        {
            var options = new ReadDependentHostedNumberOrderOptions(pathSigningDocumentSid)
            {
                Status = status, PhoneNumber = phoneNumber, IncomingPhoneNumberSid = incomingPhoneNumberSid, FriendlyName = friendlyName, UniqueName = uniqueName, PageSize = pageSize, Limit = limit
            };

            return(await ReadAsync(options, client));
        }
        /// <summary>
        /// Retrieve a list of dependent HostedNumberOrders belonging to the AuthorizationDocument.
        /// </summary>
        /// <param name="options"> Read DependentHostedNumberOrder parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of DependentHostedNumberOrder </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <DependentHostedNumberOrderResource> > ReadAsync(ReadDependentHostedNumberOrderOptions options,
                                                                                                                      ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildReadRequest(options, client));

            var page = Page <DependentHostedNumberOrderResource> .FromJson("items", response.Content);

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