コード例 #1
0
        /// <summary>
        /// Update an instance of a usage trigger
        /// </summary>
        ///
        /// <param name="options"> Update Trigger parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Trigger </returns>
        public static TriggerResource Update(UpdateTriggerOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildUpdateRequest(options, client));

            return(FromJson(response.Content));
        }
コード例 #2
0
        /// <summary>
        /// Update an instance of a usage trigger
        /// </summary>
        ///
        /// <param name="pathSid"> The sid </param>
        /// <param name="pathAccountSid"> The account_sid </param>
        /// <param name="callbackMethod"> HTTP method to use with callback_url </param>
        /// <param name="callbackUrl"> URL Twilio will request when the trigger fires </param>
        /// <param name="friendlyName"> A user-specified, human-readable name for the trigger. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Trigger </returns>
        public static async System.Threading.Tasks.Task <TriggerResource> UpdateAsync(string pathSid, string pathAccountSid = null, Twilio.Http.HttpMethod callbackMethod = null, Uri callbackUrl = null, string friendlyName = null, ITwilioRestClient client = null)
        {
            var options = new UpdateTriggerOptions(pathSid)
            {
                PathAccountSid = pathAccountSid, CallbackMethod = callbackMethod, CallbackUrl = callbackUrl, FriendlyName = friendlyName
            };

            return(await UpdateAsync(options, client));
        }
コード例 #3
0
        /// <summary>
        /// Update an instance of a usage trigger
        /// </summary>
        ///
        /// <param name="pathSid"> The sid </param>
        /// <param name="pathAccountSid"> The account_sid </param>
        /// <param name="callbackMethod"> HTTP method to use with callback_url </param>
        /// <param name="callbackUrl"> URL Twilio will request when the trigger fires </param>
        /// <param name="friendlyName"> A user-specified, human-readable name for the trigger. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Trigger </returns>
        public static TriggerResource Update(string pathSid, string pathAccountSid = null, Twilio.Http.HttpMethod callbackMethod = null, Uri callbackUrl = null, string friendlyName = null, ITwilioRestClient client = null)
        {
            var options = new UpdateTriggerOptions(pathSid)
            {
                PathAccountSid = pathAccountSid, CallbackMethod = callbackMethod, CallbackUrl = callbackUrl, FriendlyName = friendlyName
            };

            return(Update(options, client));
        }
コード例 #4
0
 private static Request BuildUpdateRequest(UpdateTriggerOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Api,
                "/2010-04-01/Accounts/" + (options.PathAccountSid ?? client.AccountSid) + "/Usage/Triggers/" + options.PathSid + ".json",
                client.Region,
                postParams: options.GetParams()
                ));
 }
コード例 #5
0
        /// <summary>
        /// Update an instance of a usage trigger
        /// </summary>
        ///
        /// <param name="options"> Update Trigger parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Trigger </returns>
        public static async System.Threading.Tasks.Task <TriggerResource> UpdateAsync(UpdateTriggerOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildUpdateRequest(options, client));

            return(FromJson(response.Content));
        }