/// <summary>
        /// Retrieve a list of all Flows.
        /// </summary>
        /// <param name="options"> Read Flow parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Flow </returns>
        public static ResourceSet <FlowResource> Read(ReadFlowOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildReadRequest(options, client));

            var page = Page <FlowResource> .FromJson("flows", response.Content);

            return(new ResourceSet <FlowResource>(page, options, client));
        }
 private static Request BuildReadRequest(ReadFlowOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Preview,
                "/Studio/Flows",
                client.Region,
                queryParams: options.GetParams()
                ));
 }
        /// <summary>
        /// Retrieve a list of all Flows.
        /// </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 Flow </returns>
        public static ResourceSet <FlowResource> Read(int?pageSize             = null,
                                                      long?limit               = null,
                                                      ITwilioRestClient client = null)
        {
            var options = new ReadFlowOptions()
            {
                PageSize = pageSize, Limit = limit
            };

            return(Read(options, client));
        }
        /// <summary>
        /// Retrieve a list of all Flows.
        /// </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 Flow </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <FlowResource> > ReadAsync(int?pageSize             = null,
                                                                                                long?limit               = null,
                                                                                                ITwilioRestClient client = null)
        {
            var options = new ReadFlowOptions()
            {
                PageSize = pageSize, Limit = limit
            };

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

            var page = Page <FlowResource> .FromJson("flows", response.Content);

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