Exemple #1
0
        /// <summary>
        /// update
        /// </summary>
        /// <param name="pathTrunkSid"> The SID of the Trunk from which to update the OriginationUrl </param>
        /// <param name="pathSid"> The unique string that identifies the resource </param>
        /// <param name="weight"> The value that determines the relative load the URI should receive compared to others with
        ///              the same priority </param>
        /// <param name="priority"> The relative importance of the URI </param>
        /// <param name="enabled"> Whether the URL is enabled </param>
        /// <param name="friendlyName"> A string to describe the resource </param>
        /// <param name="sipUrl"> The SIP address you want Twilio to route your Origination calls to </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of OriginationUrl </returns>
        public static OriginationUrlResource Update(string pathTrunkSid,
                                                    string pathSid,
                                                    int?weight               = null,
                                                    int?priority             = null,
                                                    bool?enabled             = null,
                                                    string friendlyName      = null,
                                                    Uri sipUrl               = null,
                                                    ITwilioRestClient client = null)
        {
            var options = new UpdateOriginationUrlOptions(pathTrunkSid, pathSid)
            {
                Weight = weight, Priority = priority, Enabled = enabled, FriendlyName = friendlyName, SipUrl = sipUrl
            };

            return(Update(options, client));
        }
Exemple #2
0
        /// <summary>
        /// update
        /// </summary>
        /// <param name="pathTrunkSid"> The SID of the Trunk from which to update the OriginationUrl </param>
        /// <param name="pathSid"> The unique string that identifies the resource </param>
        /// <param name="weight"> The value that determines the relative load the URI should receive compared to others with
        ///              the same priority </param>
        /// <param name="priority"> The relative importance of the URI </param>
        /// <param name="enabled"> Whether the URL is enabled </param>
        /// <param name="friendlyName"> A string to describe the resource </param>
        /// <param name="sipUrl"> The SIP address you want Twilio to route your Origination calls to </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of OriginationUrl </returns>
        public static async System.Threading.Tasks.Task <OriginationUrlResource> UpdateAsync(string pathTrunkSid,
                                                                                             string pathSid,
                                                                                             int?weight               = null,
                                                                                             int?priority             = null,
                                                                                             bool?enabled             = null,
                                                                                             string friendlyName      = null,
                                                                                             Uri sipUrl               = null,
                                                                                             ITwilioRestClient client = null)
        {
            var options = new UpdateOriginationUrlOptions(pathTrunkSid, pathSid)
            {
                Weight = weight, Priority = priority, Enabled = enabled, FriendlyName = friendlyName, SipUrl = sipUrl
            };

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

            return(FromJson(response.Content));
        }