コード例 #1
0
        /// <summary>
        /// Update a credential resource.
        /// </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));
        }
コード例 #2
0
        /// <summary>
        /// update
        /// </summary>
        ///
        /// <param name="pathCredentialListSid"> The credential_list_sid </param>
        /// <param name="pathSid"> The sid </param>
        /// <param name="pathAccountSid"> The account_sid </param>
        /// <param name="password"> The password </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 pathCredentialListSid, string pathSid, string pathAccountSid = null, string password = null, ITwilioRestClient client = null)
        {
            var options = new UpdateCredentialOptions(pathCredentialListSid, pathSid)
            {
                PathAccountSid = pathAccountSid, Password = password
            };

            return(await UpdateAsync(options, client));
        }
コード例 #3
0
 private static Request BuildUpdateRequest(UpdateCredentialOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Api,
                "/2010-04-01/Accounts/" + (options.PathAccountSid ?? client.AccountSid) + "/SIP/CredentialLists/" + options.PathCredentialListSid + "/Credentials/" + options.PathSid + ".json",
                postParams: options.GetParams()
                ));
 }
コード例 #4
0
        /// <summary>
        /// update
        /// </summary>
        ///
        /// <param name="pathCredentialListSid"> The credential_list_sid </param>
        /// <param name="pathSid"> The sid </param>
        /// <param name="pathAccountSid"> The account_sid </param>
        /// <param name="password"> The password </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Credential </returns>
        public static CredentialResource Update(string pathCredentialListSid, string pathSid, string pathAccountSid = null, string password = null, ITwilioRestClient client = null)
        {
            var options = new UpdateCredentialOptions(pathCredentialListSid, pathSid)
            {
                PathAccountSid = pathAccountSid, Password = password
            };

            return(Update(options, client));
        }
コード例 #5
0
        /// <summary>
        /// Update a credential resource.
        /// </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));
        }