Ejemplo n.º 1
0
        /// <summary>
        /// Fetch information about a specific Key credential in the Fleet.
        /// </summary>
        /// <param name="options"> Fetch Key parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Key </returns>
        public static KeyResource Fetch(FetchKeyOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// fetch
        /// </summary>
        ///
        /// <param name="options"> Fetch Key parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Key </returns>
        public static async System.Threading.Tasks.Task <KeyResource> FetchAsync(FetchKeyOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Fetch information about a specific Key credential in the Fleet.
        /// </summary>
        /// <param name="pathFleetSid"> The fleet_sid </param>
        /// <param name="pathSid"> A string that uniquely identifies the Key. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Key </returns>
        public static async System.Threading.Tasks.Task <KeyResource> FetchAsync(string pathFleetSid,
                                                                                 string pathSid,
                                                                                 ITwilioRestClient client = null)
        {
            var options = new FetchKeyOptions(pathFleetSid, pathSid);

            return(await FetchAsync(options, client));
        }
Ejemplo n.º 4
0
 private static Request BuildFetchRequest(FetchKeyOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Preview,
                "/DeployedDevices/Fleets/" + options.PathFleetSid + "/Keys/" + options.PathSid + "",
                queryParams: options.GetParams()
                ));
 }
Ejemplo n.º 5
0
        /// <summary>
        /// Fetch information about a specific Key credential in the Fleet.
        /// </summary>
        /// <param name="pathFleetSid"> The fleet_sid </param>
        /// <param name="pathSid"> A string that uniquely identifies the Key. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Key </returns>
        public static KeyResource Fetch(string pathFleetSid, string pathSid, ITwilioRestClient client = null)
        {
            var options = new FetchKeyOptions(pathFleetSid, pathSid);

            return(Fetch(options, client));
        }