예제 #1
0
        /// <summary>
        /// Delete a specific Key credential from the Fleet, effectively disallowing any inbound client connections that are
        /// presenting it.
        /// </summary>
        /// <param name="options"> Delete Key parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Key </returns>
        public static bool Delete(DeleteKeyOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildDeleteRequest(options, client));

            return(response.StatusCode == System.Net.HttpStatusCode.NoContent);
        }
예제 #2
0
        /// <summary>
        /// Delete a specific Key credential from the Fleet, effectively disallowing any inbound client connections that are
        /// presenting it.
        /// </summary>
        ///
        /// <param name="options"> Delete 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 <bool> DeleteAsync(DeleteKeyOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildDeleteRequest(options, client));

            return(response.StatusCode == System.Net.HttpStatusCode.NoContent);
        }
예제 #3
0
        /// <summary>
        /// Delete a specific Key credential from the Fleet, effectively disallowing any inbound client connections that are
        /// presenting it.
        /// </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 <bool> DeleteAsync(string pathFleetSid,
                                                                           string pathSid,
                                                                           ITwilioRestClient client = null)
        {
            var options = new DeleteKeyOptions(pathFleetSid, pathSid);

            return(await DeleteAsync(options, client));
        }
예제 #4
0
 private static Request BuildDeleteRequest(DeleteKeyOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Delete,
                Rest.Domain.Preview,
                "/DeployedDevices/Fleets/" + options.PathFleetSid + "/Keys/" + options.PathSid + "",
                queryParams: options.GetParams()
                ));
 }
예제 #5
0
        /// <summary>
        /// Delete a specific Key credential from the Fleet, effectively disallowing any inbound client connections that are
        /// presenting it.
        /// </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 bool Delete(string pathFleetSid, string pathSid, ITwilioRestClient client = null)
        {
            var options = new DeleteKeyOptions(pathFleetSid, pathSid);

            return(Delete(options, client));
        }