Exemple #1
0
        /// <summary>
        /// Retrieve the most recent context for an Engagement.
        /// </summary>
        /// <param name="options"> Fetch EngagementContext parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of EngagementContext </returns>
        public static EngagementContextResource Fetch(FetchEngagementContextOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }
Exemple #2
0
        /// <summary>
        /// Retrieve the most recent context for an Engagement.
        /// </summary>
        /// <param name="pathFlowSid"> Flow SID </param>
        /// <param name="pathEngagementSid"> Engagement SID </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of EngagementContext </returns>
        public static async System.Threading.Tasks.Task <EngagementContextResource> FetchAsync(string pathFlowSid,
                                                                                               string pathEngagementSid,
                                                                                               ITwilioRestClient client = null)
        {
            var options = new FetchEngagementContextOptions(pathFlowSid, pathEngagementSid);

            return(await FetchAsync(options, client));
        }
Exemple #3
0
        /// <summary>
        /// Retrieve the most recent context for an Engagement.
        /// </summary>
        /// <param name="pathFlowSid"> Flow SID </param>
        /// <param name="pathEngagementSid"> Engagement SID </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of EngagementContext </returns>
        public static EngagementContextResource Fetch(string pathFlowSid,
                                                      string pathEngagementSid,
                                                      ITwilioRestClient client = null)
        {
            var options = new FetchEngagementContextOptions(pathFlowSid, pathEngagementSid);

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

            return(FromJson(response.Content));
        }