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

            return(FromJson(response.Content));
        }
コード例 #2
0
 private static Request BuildUpdateRequest(UpdateConnectionPolicyTargetOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Voice,
                "/v1/ConnectionPolicies/" + options.PathConnectionPolicySid + "/Targets/" + options.PathSid + "",
                postParams: options.GetParams()
                ));
 }
コード例 #3
0
        /// <summary>
        /// update
        /// </summary>
        /// <param name="pathConnectionPolicySid"> The SID of the Connection Policy that owns the Target </param>
        /// <param name="pathSid"> The unique string that identifies the resource </param>
        /// <param name="friendlyName"> A string to describe the resource </param>
        /// <param name="target"> The SIP address you want Twilio to route your calls to </param>
        /// <param name="priority"> The relative importance of the target </param>
        /// <param name="weight"> The value that determines the relative load the Target should receive compared to others with
        ///              the same priority </param>
        /// <param name="enabled"> Whether the Target is enabled </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of ConnectionPolicyTarget </returns>
        public static async System.Threading.Tasks.Task <ConnectionPolicyTargetResource> UpdateAsync(string pathConnectionPolicySid,
                                                                                                     string pathSid,
                                                                                                     string friendlyName      = null,
                                                                                                     Uri target               = null,
                                                                                                     int?priority             = null,
                                                                                                     int?weight               = null,
                                                                                                     bool?enabled             = null,
                                                                                                     ITwilioRestClient client = null)
        {
            var options = new UpdateConnectionPolicyTargetOptions(pathConnectionPolicySid, pathSid)
            {
                FriendlyName = friendlyName, Target = target, Priority = priority, Weight = weight, Enabled = enabled
            };

            return(await UpdateAsync(options, client));
        }
コード例 #4
0
        /// <summary>
        /// update
        /// </summary>
        /// <param name="pathConnectionPolicySid"> The SID of the Connection Policy that owns the Target </param>
        /// <param name="pathSid"> The unique string that identifies the resource </param>
        /// <param name="friendlyName"> A string to describe the resource </param>
        /// <param name="target"> The SIP address you want Twilio to route your calls to </param>
        /// <param name="priority"> The relative importance of the target </param>
        /// <param name="weight"> The value that determines the relative load the Target should receive compared to others with
        ///              the same priority </param>
        /// <param name="enabled"> Whether the Target is enabled </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of ConnectionPolicyTarget </returns>
        public static ConnectionPolicyTargetResource Update(string pathConnectionPolicySid,
                                                            string pathSid,
                                                            string friendlyName      = null,
                                                            Uri target               = null,
                                                            int?priority             = null,
                                                            int?weight               = null,
                                                            bool?enabled             = null,
                                                            ITwilioRestClient client = null)
        {
            var options = new UpdateConnectionPolicyTargetOptions(pathConnectionPolicySid, pathSid)
            {
                FriendlyName = friendlyName, Target = target, Priority = priority, Weight = weight, Enabled = enabled
            };

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

            return(FromJson(response.Content));
        }