/// <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));
        }
예제 #2
0
 private static Request BuildUpdateRequest(UpdateFieldTypeOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Preview,
                "/understand/Assistants/" + options.PathAssistantSid + "/FieldTypes/" + options.PathSid + "",
                postParams: options.GetParams()
                ));
 }
        /// <summary>
        /// update
        /// </summary>
        /// <param name="pathAssistantSid"> The assistant_sid </param>
        /// <param name="pathSid"> The sid </param>
        /// <param name="friendlyName"> A user-provided string that identifies this resource. It is non-unique and can up to
        ///                    255 characters long. </param>
        /// <param name="uniqueName"> A user-provided string that uniquely identifies this resource as an alternative to the
        ///                  sid. Unique up to 64 characters long. </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 pathAssistantSid,
                                                                                        string pathSid,
                                                                                        string friendlyName      = null,
                                                                                        string uniqueName        = null,
                                                                                        ITwilioRestClient client = null)
        {
            var options = new UpdateFieldTypeOptions(pathAssistantSid, pathSid)
            {
                FriendlyName = friendlyName, UniqueName = uniqueName
            };

            return(await UpdateAsync(options, client));
        }
        /// <summary>
        /// update
        /// </summary>
        /// <param name="pathAssistantSid"> The assistant_sid </param>
        /// <param name="pathSid"> The sid </param>
        /// <param name="friendlyName"> A user-provided string that identifies this resource. It is non-unique and can up to
        ///                    255 characters long. </param>
        /// <param name="uniqueName"> A user-provided string that uniquely identifies this resource as an alternative to the
        ///                  sid. Unique up to 64 characters long. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of FieldType </returns>
        public static FieldTypeResource Update(string pathAssistantSid,
                                               string pathSid,
                                               string friendlyName      = null,
                                               string uniqueName        = null,
                                               ITwilioRestClient client = null)
        {
            var options = new UpdateFieldTypeOptions(pathAssistantSid, pathSid)
            {
                FriendlyName = friendlyName, UniqueName = uniqueName
            };

            return(Update(options, client));
        }
        /// <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));
        }