コード例 #1
0
        /// <summary>
        /// create
        /// </summary>
        /// <param name="options"> Create Field parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Field </returns>
        public static FieldResource Create(CreateFieldOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }
コード例 #2
0
        /// <summary>
        /// create
        /// </summary>
        /// <param name="options"> Create Field parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Field </returns>
        public static async System.Threading.Tasks.Task <FieldResource> CreateAsync(CreateFieldOptions options,
                                                                                    ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }
コード例 #3
0
        /// <summary>
        /// create
        /// </summary>
        /// <param name="pathServiceSid"> The service_sid </param>
        /// <param name="pathIntentSid"> The intent_sid </param>
        /// <param name="fieldType"> The field_type </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 Field </returns>
        public static async System.Threading.Tasks.Task <FieldResource> CreateAsync(string pathServiceSid,
                                                                                    string pathIntentSid,
                                                                                    string fieldType,
                                                                                    string uniqueName,
                                                                                    ITwilioRestClient client = null)
        {
            var options = new CreateFieldOptions(pathServiceSid, pathIntentSid, fieldType, uniqueName);

            return(await CreateAsync(options, client));
        }
コード例 #4
0
        /// <summary>
        /// create
        /// </summary>
        /// <param name="pathServiceSid"> The service_sid </param>
        /// <param name="pathIntentSid"> The intent_sid </param>
        /// <param name="fieldType"> The field_type </param>
        /// <param name="uniqueName"> The unique_name </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Field </returns>
        public static FieldResource Create(string pathServiceSid,
                                           string pathIntentSid,
                                           string fieldType,
                                           string uniqueName,
                                           ITwilioRestClient client = null)
        {
            var options = new CreateFieldOptions(pathServiceSid, pathIntentSid, fieldType, uniqueName);

            return(Create(options, client));
        }
コード例 #5
0
 private static Request BuildCreateRequest(CreateFieldOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Preview,
                "/understand/Services/" + options.PathServiceSid + "/Intents/" + options.PathIntentSid + "/Fields",
                client.Region,
                postParams: options.GetParams()
                ));
 }