Exemplo n.º 1
0
        /// <summary>
        /// Retrieve a list of all Devices belonging to the Fleet.
        /// </summary>
        /// <param name="options"> Read Device parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Device </returns>
        public static ResourceSet <DeviceResource> Read(ReadDeviceOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildReadRequest(options, client));

            var page = Page <DeviceResource> .FromJson("devices", response.Content);

            return(new ResourceSet <DeviceResource>(page, options, client));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Retrieve a list of all Devices belonging to the Fleet.
        /// </summary>
        ///
        /// <param name="pathFleetSid"> The fleet_sid </param>
        /// <param name="deploymentSid"> Find all Devices grouped under the specified Deployment. </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 Device </returns>
        public static ResourceSet <DeviceResource> Read(string pathFleetSid, string deploymentSid = null, int?pageSize = null, long?limit = null, ITwilioRestClient client = null)
        {
            var options = new ReadDeviceOptions(pathFleetSid)
            {
                DeploymentSid = deploymentSid, PageSize = pageSize, Limit = limit
            };

            return(Read(options, client));
        }
Exemplo n.º 3
0
        /// <summary>
        /// Retrieve a list of all Devices belonging to the Fleet.
        /// </summary>
        ///
        /// <param name="pathFleetSid"> The fleet_sid </param>
        /// <param name="deploymentSid"> Find all Devices grouped under the specified Deployment. </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 Device </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <DeviceResource> > ReadAsync(string pathFleetSid, string deploymentSid = null, int?pageSize = null, long?limit = null, ITwilioRestClient client = null)
        {
            var options = new ReadDeviceOptions(pathFleetSid)
            {
                DeploymentSid = deploymentSid, PageSize = pageSize, Limit = limit
            };

            return(await ReadAsync(options, client));
        }
 private static Request BuildReadRequest(ReadDeviceOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Preview,
                "/DeployedDevices/Fleets/" + options.PathFleetSid + "/Devices",
                queryParams: options.GetParams()
                ));
 }
Exemplo n.º 5
0
        /// <summary>
        /// Retrieve a list of all Devices belonging to the Fleet.
        /// </summary>
        /// <param name="options"> Read Device parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Device </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <DeviceResource> > ReadAsync(ReadDeviceOptions options,
                                                                                                  ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildReadRequest(options, client));

            var page = Page <DeviceResource> .FromJson("devices", response.Content);

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