/// <summary>
        /// Retrieve a list of Commands from your account.
        /// </summary>
        /// <param name="options"> Read Command parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Command </returns>
        public static ResourceSet <CommandResource> Read(ReadCommandOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildReadRequest(options, client));

            var page = Page <CommandResource> .FromJson("commands", response.Content);

            return(new ResourceSet <CommandResource>(page, options, client));
        }
 private static Request BuildReadRequest(ReadCommandOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Supersim,
                "/v1/Commands",
                queryParams: options.GetParams()
                ));
 }
        /// <summary>
        /// Retrieve a list of Commands from your account.
        /// </summary>
        /// <param name="sim"> The SID or unique name of the Sim that Command was sent to or from. </param>
        /// <param name="status"> The status of the Command </param>
        /// <param name="direction"> The direction of the Command </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 Command </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <CommandResource> > ReadAsync(string sim = null,
                                                                                                   CommandResource.StatusEnum status       = null,
                                                                                                   CommandResource.DirectionEnum direction = null,
                                                                                                   int?pageSize             = null,
                                                                                                   long?limit               = null,
                                                                                                   ITwilioRestClient client = null)
        {
            var options = new ReadCommandOptions()
            {
                Sim = sim, Status = status, Direction = direction, PageSize = pageSize, Limit = limit
            };

            return(await ReadAsync(options, client));
        }
        /// <summary>
        /// Retrieve a list of Commands from your account.
        /// </summary>
        /// <param name="sim"> The SID or unique name of the Sim that Command was sent to or from. </param>
        /// <param name="status"> The status of the Command </param>
        /// <param name="direction"> The direction of the Command </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 Command </returns>
        public static ResourceSet <CommandResource> Read(string sim = null,
                                                         CommandResource.StatusEnum status       = null,
                                                         CommandResource.DirectionEnum direction = null,
                                                         int?pageSize             = null,
                                                         long?limit               = null,
                                                         ITwilioRestClient client = null)
        {
            var options = new ReadCommandOptions()
            {
                Sim = sim, Status = status, Direction = direction, PageSize = pageSize, Limit = limit
            };

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

            var page = Page <CommandResource> .FromJson("commands", response.Content);

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