Пример #1
0
        /// <summary>
        /// Update a specific Service.
        /// </summary>
        /// <param name="options"> Update Service parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Service </returns>
        public static ServiceResource Update(UpdateServiceOptions 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(UpdateServiceOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Authy,
                "/v1/Services/" + options.PathSid + "",
                postParams: options.GetParams()
                ));
 }
Пример #3
0
        /// <summary>
        /// Update a specific Service.
        /// </summary>
        /// <param name="pathSid"> A string that uniquely identifies this Service. </param>
        /// <param name="friendlyName"> A human readable description of this resource. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Service </returns>
        public static ServiceResource Update(string pathSid, string friendlyName = null, ITwilioRestClient client = null)
        {
            var options = new UpdateServiceOptions(pathSid)
            {
                FriendlyName = friendlyName
            };

            return(Update(options, client));
        }
Пример #4
0
        /// <summary>
        /// Update a specific Service.
        /// </summary>
        /// <param name="pathSid"> A string that uniquely identifies this Service. </param>
        /// <param name="friendlyName"> A human readable description of this resource. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Service </returns>
        public static async System.Threading.Tasks.Task <ServiceResource> UpdateAsync(string pathSid,
                                                                                      string friendlyName      = null,
                                                                                      ITwilioRestClient client = null)
        {
            var options = new UpdateServiceOptions(pathSid)
            {
                FriendlyName = friendlyName
            };

            return(await UpdateAsync(options, client));
        }
Пример #5
0
        /// <summary>
        /// Update a specific Service.
        /// </summary>
        /// <param name="options"> Update Service parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Service </returns>
        public static async System.Threading.Tasks.Task <ServiceResource> UpdateAsync(UpdateServiceOptions options,
                                                                                      ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildUpdateRequest(options, client));

            return(FromJson(response.Content));
        }