Beispiel #1
0
        /// <summary>
        /// fetch
        /// </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));
        }
Beispiel #2
0
        /// <summary>
        /// fetch
        /// </summary>
        /// <param name="pathFlowSid"> The flow_sid </param>
        /// <param name="pathExecutionSid"> The execution_sid </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));
        }
Beispiel #3
0
        /// <summary>
        /// fetch
        /// </summary>
        /// <param name="pathFlowSid"> The flow_sid </param>
        /// <param name="pathExecutionSid"> The execution_sid </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));
        }
 private static Request BuildFetchRequest(FetchExecutionContextOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Studio,
                "/v2/Flows/" + options.PathFlowSid + "/Executions/" + options.PathExecutionSid + "/Context",
                queryParams: options.GetParams()
                ));
 }
Beispiel #5
0
        /// <summary>
        /// fetch
        /// </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));
        }