Exemplo n.º 1
0
        /// <summary>
        /// create
        /// </summary>
        /// <param name="options"> Create Intent parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Intent </returns>
        public static IntentResource Create(CreateIntentOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }
Exemplo n.º 2
0
        /// <summary>
        /// create
        /// </summary>
        /// <param name="options"> Create Intent parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Intent </returns>
        public static async System.Threading.Tasks.Task <IntentResource> CreateAsync(CreateIntentOptions options,
                                                                                     ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }
Exemplo n.º 3
0
 private static Request BuildCreateRequest(CreateIntentOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Preview,
                "/understand/Assistants/" + options.PathAssistantSid + "/Intents",
                client.Region,
                postParams: options.GetParams()
                ));
 }
Exemplo n.º 4
0
        /// <summary>
        /// create
        /// </summary>
        /// <param name="pathAssistantSid"> The assistant_sid </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="friendlyName"> A user-provided string that identifies this resource. It is non-unique and can up to
        ///                    255 characters long. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Intent </returns>
        public static async System.Threading.Tasks.Task <IntentResource> CreateAsync(string pathAssistantSid,
                                                                                     string uniqueName,
                                                                                     string friendlyName      = null,
                                                                                     ITwilioRestClient client = null)
        {
            var options = new CreateIntentOptions(pathAssistantSid, uniqueName)
            {
                FriendlyName = friendlyName
            };

            return(await CreateAsync(options, client));
        }
Exemplo n.º 5
0
        /// <summary>
        /// create
        /// </summary>
        /// <param name="pathAssistantSid"> The assistant_sid </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="friendlyName"> A user-provided string that identifies this resource. It is non-unique and can up to
        ///                    255 characters long. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Intent </returns>
        public static IntentResource Create(string pathAssistantSid,
                                            string uniqueName,
                                            string friendlyName      = null,
                                            ITwilioRestClient client = null)
        {
            var options = new CreateIntentOptions(pathAssistantSid, uniqueName)
            {
                FriendlyName = friendlyName
            };

            return(Create(options, client));
        }