示例#1
0
        /// <summary>
        /// Update a specific Service resource.
        /// </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.Serverless,
                "/v1/Services/" + options.PathSid + "",
                postParams: options.GetParams()
                ));
 }
示例#3
0
        /// <summary>
        /// Update a specific Service resource.
        /// </summary>
        /// <param name="pathSid"> The SID of the Service resource to update </param>
        /// <param name="includeCredentials"> Whether to inject Account credentials into a function invocation context </param>
        /// <param name="friendlyName"> A string to describe the Service 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,
                                                                                      bool?includeCredentials  = null,
                                                                                      string friendlyName      = null,
                                                                                      ITwilioRestClient client = null)
        {
            var options = new UpdateServiceOptions(pathSid)
            {
                IncludeCredentials = includeCredentials, FriendlyName = friendlyName
            };

            return(await UpdateAsync(options, client));
        }
示例#4
0
        /// <summary>
        /// Update a specific Service resource.
        /// </summary>
        /// <param name="pathSid"> The SID of the Service resource to update </param>
        /// <param name="includeCredentials"> Whether to inject Account credentials into a function invocation context </param>
        /// <param name="friendlyName"> A string to describe the Service 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,
                                             bool?includeCredentials  = null,
                                             string friendlyName      = null,
                                             ITwilioRestClient client = null)
        {
            var options = new UpdateServiceOptions(pathSid)
            {
                IncludeCredentials = includeCredentials, FriendlyName = friendlyName
            };

            return(Update(options, client));
        }
示例#5
0
        /// <summary>
        /// Update a specific Service resource.
        /// </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));
        }