Ejemplo n.º 1
0
        /// <summary>
        /// Returns JSON actions for this Task.
        /// </summary>
        /// <param name="options"> Fetch TaskActions parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of TaskActions </returns>
        public static TaskActionsResource Fetch(FetchTaskActionsOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Returns JSON actions for this Task.
        /// </summary>
        /// <param name="pathAssistantSid"> The unique ID of the parent Assistant. </param>
        /// <param name="pathTaskSid"> The unique ID of the Task. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of TaskActions </returns>
        public static async System.Threading.Tasks.Task <TaskActionsResource> FetchAsync(string pathAssistantSid,
                                                                                         string pathTaskSid,
                                                                                         ITwilioRestClient client = null)
        {
            var options = new FetchTaskActionsOptions(pathAssistantSid, pathTaskSid);

            return(await FetchAsync(options, client));
        }
 private static Request BuildFetchRequest(FetchTaskActionsOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Preview,
                "/understand/Assistants/" + options.PathAssistantSid + "/Tasks/" + options.PathTaskSid + "/Actions",
                queryParams: options.GetParams()
                ));
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Returns JSON actions for this Task.
        /// </summary>
        /// <param name="pathAssistantSid"> The unique ID of the parent Assistant. </param>
        /// <param name="pathTaskSid"> The unique ID of the Task. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of TaskActions </returns>
        public static TaskActionsResource Fetch(string pathAssistantSid, string pathTaskSid, ITwilioRestClient client = null)
        {
            var options = new FetchTaskActionsOptions(pathAssistantSid, pathTaskSid);

            return(Fetch(options, client));
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Returns JSON actions for this Task.
        /// </summary>
        /// <param name="options"> Fetch TaskActions parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of TaskActions </returns>
        public static async System.Threading.Tasks.Task <TaskActionsResource> FetchAsync(FetchTaskActionsOptions options,
                                                                                         ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }