예제 #1
0
        /// <summary>
        /// create
        /// </summary>
        /// <param name="options"> Create FieldType parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of FieldType </returns>
        public static FieldTypeResource Create(CreateFieldTypeOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }
예제 #2
0
 private static Request BuildCreateRequest(CreateFieldTypeOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Preview,
                "/understand/Services/" + options.PathServiceSid + "/FieldTypes",
                client.Region,
                postParams: options.GetParams()
                ));
 }
예제 #3
0
        /// <summary>
        /// create
        /// </summary>
        /// <param name="pathServiceSid"> The service_sid </param>
        /// <param name="uniqueName"> The unique_name </param>
        /// <param name="friendlyName"> The friendly_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> CreateAsync(string pathServiceSid,
                                                                                        string uniqueName,
                                                                                        string friendlyName      = null,
                                                                                        ITwilioRestClient client = null)
        {
            var options = new CreateFieldTypeOptions(pathServiceSid, uniqueName)
            {
                FriendlyName = friendlyName
            };

            return(await CreateAsync(options, client));
        }
예제 #4
0
        /// <summary>
        /// create
        /// </summary>
        /// <param name="pathServiceSid"> The service_sid </param>
        /// <param name="uniqueName"> The unique_name </param>
        /// <param name="friendlyName"> The friendly_name </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of FieldType </returns>
        public static FieldTypeResource Create(string pathServiceSid,
                                               string uniqueName,
                                               string friendlyName      = null,
                                               ITwilioRestClient client = null)
        {
            var options = new CreateFieldTypeOptions(pathServiceSid, uniqueName)
            {
                FriendlyName = friendlyName
            };

            return(Create(options, client));
        }
예제 #5
0
        /// <summary>
        /// create
        /// </summary>
        /// <param name="options"> Create 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> CreateAsync(CreateFieldTypeOptions options,
                                                                                        ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }