Пример #1
0
        /// <summary>
        /// Modify the properties of a given Account
        /// </summary>
        ///
        /// <param name="options"> Update PublicKey parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of PublicKey </returns>
        public static PublicKeyResource Update(UpdatePublicKeyOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildUpdateRequest(options, client));

            return(FromJson(response.Content));
        }
Пример #2
0
        /// <summary>
        /// Modify the properties of a given Account
        /// </summary>
        ///
        /// <param name="pathSid"> Fetch by unique Credential Sid </param>
        /// <param name="friendlyName"> A human readable description of this resource </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of PublicKey </returns>
        public static async System.Threading.Tasks.Task <PublicKeyResource> UpdateAsync(string pathSid, string friendlyName = null, ITwilioRestClient client = null)
        {
            var options = new UpdatePublicKeyOptions(pathSid)
            {
                FriendlyName = friendlyName
            };

            return(await UpdateAsync(options, client));
        }
Пример #3
0
        /// <summary>
        /// Modify the properties of a given Account
        /// </summary>
        ///
        /// <param name="pathSid"> Fetch by unique Credential Sid </param>
        /// <param name="friendlyName"> A human readable description of this resource </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of PublicKey </returns>
        public static PublicKeyResource Update(string pathSid, string friendlyName = null, ITwilioRestClient client = null)
        {
            var options = new UpdatePublicKeyOptions(pathSid)
            {
                FriendlyName = friendlyName
            };

            return(Update(options, client));
        }
 private static Request BuildUpdateRequest(UpdatePublicKeyOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Accounts,
                "/v1/Credentials/PublicKeys/" + options.PathSid + "",
                postParams: options.GetParams()
                ));
 }
Пример #5
0
        /// <summary>
        /// Modify the properties of a given Account
        /// </summary>
        ///
        /// <param name="options"> Update PublicKey parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of PublicKey </returns>
        public static async System.Threading.Tasks.Task <PublicKeyResource> UpdateAsync(UpdatePublicKeyOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildUpdateRequest(options, client));

            return(FromJson(response.Content));
        }