Exemplo n.º 1
0
        /// <summary>
        /// update
        /// </summary>
        /// <param name="options"> Update FieldType parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of FieldType </returns>
        public static FieldTypeResource Update(UpdateFieldTypeOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildUpdateRequest(options, client));

            return(FromJson(response.Content));
        }
Exemplo n.º 2
0
 private static Request BuildUpdateRequest(UpdateFieldTypeOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Preview,
                "/understand/Services/" + options.PathServiceSid + "/FieldTypes/" + options.PathSid + "",
                client.Region,
                postParams: options.GetParams()
                ));
 }
Exemplo n.º 3
0
        /// <summary>
        /// update
        /// </summary>
        /// <param name="pathServiceSid"> The service_sid </param>
        /// <param name="pathSid"> The sid </param>
        /// <param name="friendlyName"> The friendly_name </param>
        /// <param name="uniqueName"> The unique_name </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of FieldType </returns>
        public static async System.Threading.Tasks.Task <FieldTypeResource> UpdateAsync(string pathServiceSid,
                                                                                        string pathSid,
                                                                                        string friendlyName      = null,
                                                                                        string uniqueName        = null,
                                                                                        ITwilioRestClient client = null)
        {
            var options = new UpdateFieldTypeOptions(pathServiceSid, pathSid)
            {
                FriendlyName = friendlyName, UniqueName = uniqueName
            };

            return(await UpdateAsync(options, client));
        }
Exemplo n.º 4
0
        /// <summary>
        /// update
        /// </summary>
        /// <param name="pathServiceSid"> The service_sid </param>
        /// <param name="pathSid"> The sid </param>
        /// <param name="friendlyName"> The friendly_name </param>
        /// <param name="uniqueName"> The unique_name </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of FieldType </returns>
        public static FieldTypeResource Update(string pathServiceSid,
                                               string pathSid,
                                               string friendlyName      = null,
                                               string uniqueName        = null,
                                               ITwilioRestClient client = null)
        {
            var options = new UpdateFieldTypeOptions(pathServiceSid, pathSid)
            {
                FriendlyName = friendlyName, UniqueName = uniqueName
            };

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

            return(FromJson(response.Content));
        }