/// <summary>
        /// Update the given properties of a specific Key credential in the Fleet, giving it a friendly name or assigning to a
        /// Device.
        /// </summary>
        /// <param name="options"> Update Key parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Key </returns>
        public static KeyResource Update(UpdateKeyOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildUpdateRequest(options, client));

            return(FromJson(response.Content));
        }
Exemple #2
0
        /// <summary>
        /// Update the given properties of a specific Key credential in the Fleet, giving it a friendly name or assigning to a
        /// Device.
        /// </summary>
        ///
        /// <param name="options"> Update 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> UpdateAsync(UpdateKeyOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildUpdateRequest(options, client));

            return(FromJson(response.Content));
        }
 private static Request BuildUpdateRequest(UpdateKeyOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Preview,
                "/DeployedDevices/Fleets/" + options.PathFleetSid + "/Keys/" + options.PathSid + "",
                postParams: options.GetParams()
                ));
 }
Exemple #4
0
        /// <summary>
        /// Update the given properties of a specific Key credential in the Fleet, giving it a friendly name or assigning to a
        /// Device.
        /// </summary>
        ///
        /// <param name="pathFleetSid"> The fleet_sid </param>
        /// <param name="pathSid"> A string that uniquely identifies the Key. </param>
        /// <param name="friendlyName"> The human readable description for this Key. </param>
        /// <param name="deviceSid"> The unique identifier of a Key to be authenticated. </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> UpdateAsync(string pathFleetSid, string pathSid, string friendlyName = null, string deviceSid = null, ITwilioRestClient client = null)
        {
            var options = new UpdateKeyOptions(pathFleetSid, pathSid)
            {
                FriendlyName = friendlyName, DeviceSid = deviceSid
            };

            return(await UpdateAsync(options, client));
        }
Exemple #5
0
        /// <summary>
        /// Update the given properties of a specific Key credential in the Fleet, giving it a friendly name or assigning to a
        /// Device.
        /// </summary>
        ///
        /// <param name="pathFleetSid"> The fleet_sid </param>
        /// <param name="pathSid"> A string that uniquely identifies the Key. </param>
        /// <param name="friendlyName"> The human readable description for this Key. </param>
        /// <param name="deviceSid"> The unique identifier of a Key to be authenticated. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Key </returns>
        public static KeyResource Update(string pathFleetSid, string pathSid, string friendlyName = null, string deviceSid = null, ITwilioRestClient client = null)
        {
            var options = new UpdateKeyOptions(pathFleetSid, pathSid)
            {
                FriendlyName = friendlyName, DeviceSid = deviceSid
            };

            return(Update(options, client));
        }