예제 #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));
        }
예제 #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));
        }
예제 #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));
        }
예제 #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()
                ));
 }
예제 #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));
        }