Exemplo n.º 1
0
        /// <summary>
        /// Retrieve the most recent context for an Execution.
        /// </summary>
        /// <param name="options"> Fetch ExecutionContext parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of ExecutionContext </returns>
        public static ExecutionContextResource Fetch(FetchExecutionContextOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Retrieve the most recent context for an Execution.
        /// </summary>
        /// <param name="pathFlowSid"> The SID of the Flow </param>
        /// <param name="pathExecutionSid"> The SID of the Execution </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of ExecutionContext </returns>
        public static async System.Threading.Tasks.Task <ExecutionContextResource> FetchAsync(string pathFlowSid,
                                                                                              string pathExecutionSid,
                                                                                              ITwilioRestClient client = null)
        {
            var options = new FetchExecutionContextOptions(pathFlowSid, pathExecutionSid);

            return(await FetchAsync(options, client));
        }
Exemplo n.º 3
0
        /// <summary>
        /// Retrieve the most recent context for an Execution.
        /// </summary>
        /// <param name="pathFlowSid"> The SID of the Flow </param>
        /// <param name="pathExecutionSid"> The SID of the Execution </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of ExecutionContext </returns>
        public static ExecutionContextResource Fetch(string pathFlowSid,
                                                     string pathExecutionSid,
                                                     ITwilioRestClient client = null)
        {
            var options = new FetchExecutionContextOptions(pathFlowSid, pathExecutionSid);

            return(Fetch(options, client));
        }
Exemplo n.º 4
0
 private static Request BuildFetchRequest(FetchExecutionContextOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Studio,
                "/v1/Flows/" + options.PathFlowSid + "/Executions/" + options.PathExecutionSid + "/Context",
                queryParams: options.GetParams()
                ));
 }
Exemplo n.º 5
0
        /// <summary>
        /// Retrieve the most recent context for an Execution.
        /// </summary>
        /// <param name="options"> Fetch ExecutionContext parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of ExecutionContext </returns>
        public static async System.Threading.Tasks.Task <ExecutionContextResource> FetchAsync(FetchExecutionContextOptions options,
                                                                                              ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }