Ejemplo n.º 1
0
        /// <summary>
        /// fetch
        /// </summary>
        ///
        /// <param name="options"> Fetch 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 <DeviceResource> FetchAsync(FetchDeviceOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// fetch
        /// </summary>
        /// <param name="options"> Fetch Device parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Device </returns>
        public static DeviceResource Fetch(FetchDeviceOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// fetch
        /// </summary>
        /// <param name="pathFleetSid"> The fleet_sid </param>
        /// <param name="pathSid"> A string that uniquely identifies the Device. </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 <DeviceResource> FetchAsync(string pathFleetSid,
                                                                                    string pathSid,
                                                                                    ITwilioRestClient client = null)
        {
            var options = new FetchDeviceOptions(pathFleetSid, pathSid);

            return(await FetchAsync(options, client));
        }
 private static Request BuildFetchRequest(FetchDeviceOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Preview,
                "/DeployedDevices/Fleets/" + options.PathFleetSid + "/Devices/" + options.PathSid + "",
                queryParams: options.GetParams()
                ));
 }
Ejemplo n.º 5
0
        /// <summary>
        /// fetch
        /// </summary>
        /// <param name="pathFleetSid"> The fleet_sid </param>
        /// <param name="pathSid"> A string that uniquely identifies the Device. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Device </returns>
        public static DeviceResource Fetch(string pathFleetSid, string pathSid, ITwilioRestClient client = null)
        {
            var options = new FetchDeviceOptions(pathFleetSid, pathSid);

            return(Fetch(options, client));
        }