/// <summary>
        /// update
        /// </summary>
        /// <param name="options"> Update Credential parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Credential </returns>
        public static CredentialResource Update(UpdateCredentialOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildUpdateRequest(options, client));

            return(FromJson(response.Content));
        }
Beispiel #2
0
        /// <summary>
        /// update
        /// </summary>
        ///
        /// <param name="pathSid"> The sid </param>
        /// <param name="friendlyName"> The friendly_name </param>
        /// <param name="certificate"> The certificate </param>
        /// <param name="privateKey"> The private_key </param>
        /// <param name="sandbox"> The sandbox </param>
        /// <param name="apiKey"> The api_key </param>
        /// <param name="secret"> The secret </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Credential </returns>
        public static async System.Threading.Tasks.Task <CredentialResource> UpdateAsync(string pathSid, string friendlyName = null, string certificate = null, string privateKey = null, bool?sandbox = null, string apiKey = null, string secret = null, ITwilioRestClient client = null)
        {
            var options = new UpdateCredentialOptions(pathSid)
            {
                FriendlyName = friendlyName, Certificate = certificate, PrivateKey = privateKey, Sandbox = sandbox, ApiKey = apiKey, Secret = secret
            };

            return(await UpdateAsync(options, client));
        }
 private static Request BuildUpdateRequest(UpdateCredentialOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.IpMessaging,
                "/v2/Credentials/" + options.PathSid + "",
                postParams: options.GetParams()
                ));
 }
Beispiel #4
0
        /// <summary>
        /// update
        /// </summary>
        ///
        /// <param name="pathSid"> The sid </param>
        /// <param name="friendlyName"> The friendly_name </param>
        /// <param name="certificate"> The certificate </param>
        /// <param name="privateKey"> The private_key </param>
        /// <param name="sandbox"> The sandbox </param>
        /// <param name="apiKey"> The api_key </param>
        /// <param name="secret"> The secret </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Credential </returns>
        public static CredentialResource Update(string pathSid, string friendlyName = null, string certificate = null, string privateKey = null, bool?sandbox = null, string apiKey = null, string secret = null, ITwilioRestClient client = null)
        {
            var options = new UpdateCredentialOptions(pathSid)
            {
                FriendlyName = friendlyName, Certificate = certificate, PrivateKey = privateKey, Sandbox = sandbox, ApiKey = apiKey, Secret = secret
            };

            return(Update(options, client));
        }
        /// <summary>
        /// update
        /// </summary>
        /// <param name="options"> Update Credential parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Credential </returns>
        public static async System.Threading.Tasks.Task <CredentialResource> UpdateAsync(UpdateCredentialOptions options,
                                                                                         ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildUpdateRequest(options, client));

            return(FromJson(response.Content));
        }