Example #1
0
        /// <summary>
        /// read
        /// </summary>
        ///
        /// <param name="device"> The device </param>
        /// <param name="sim"> The sim </param>
        /// <param name="status"> The status </param>
        /// <param name="direction"> The direction </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 device = null, string sim = null, string status = null, string direction = null, int?pageSize = null, long?limit = null, ITwilioRestClient client = null)
        {
            var options = new ReadCommandOptions {
                Device = device, Sim = sim, Status = status, Direction = direction, PageSize = pageSize, Limit = limit
            };

            return(await ReadAsync(options, client));
        }
Example #2
0
        /// <summary>
        /// read
        /// </summary>
        ///
        /// <param name="device"> The device </param>
        /// <param name="sim"> The sim </param>
        /// <param name="status"> The status </param>
        /// <param name="direction"> The direction </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 device = null, string sim = null, string status = null, string direction = null, int?pageSize = null, long?limit = null, ITwilioRestClient client = null)
        {
            var options = new ReadCommandOptions {
                Device = device, Sim = sim, Status = status, Direction = direction, PageSize = pageSize, Limit = limit
            };

            return(Read(options, client));
        }
Example #3
0
        /// <summary>
        /// read
        /// </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));
        }
Example #4
0
 private static Request BuildReadRequest(ReadCommandOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Preview,
                "/wireless/Commands",
                queryParams: options.GetParams()
                ));
 }
Example #5
0
        /// <summary>
        /// read
        /// </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));
        }