Beispiel #1
0
        /// <summary>
        /// Retrieve an Engagement
        /// </summary>
        /// <param name="options"> Fetch Engagement parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Engagement </returns>
        public static EngagementResource Fetch(FetchEngagementOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }
Beispiel #2
0
        /// <summary>
        /// Retrieve an Engagement
        /// </summary>
        /// <param name="pathFlowSid"> Flow Sid. </param>
        /// <param name="pathSid"> Engagement Sid. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Engagement </returns>
        public static async System.Threading.Tasks.Task <EngagementResource> FetchAsync(string pathFlowSid,
                                                                                        string pathSid,
                                                                                        ITwilioRestClient client = null)
        {
            var options = new FetchEngagementOptions(pathFlowSid, pathSid);

            return(await FetchAsync(options, client));
        }
Beispiel #3
0
 private static Request BuildFetchRequest(FetchEngagementOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Studio,
                "/v1/Flows/" + options.PathFlowSid + "/Engagements/" + options.PathSid + "",
                queryParams: options.GetParams()
                ));
 }
Beispiel #4
0
        /// <summary>
        /// Retrieve an Engagement
        /// </summary>
        /// <param name="pathFlowSid"> Flow Sid. </param>
        /// <param name="pathSid"> Engagement Sid. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Engagement </returns>
        public static EngagementResource Fetch(string pathFlowSid, string pathSid, ITwilioRestClient client = null)
        {
            var options = new FetchEngagementOptions(pathFlowSid, pathSid);

            return(Fetch(options, client));
        }
Beispiel #5
0
        /// <summary>
        /// Retrieve an Engagement
        /// </summary>
        /// <param name="options"> Fetch Engagement parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Engagement </returns>
        public static async System.Threading.Tasks.Task <EngagementResource> FetchAsync(FetchEngagementOptions options,
                                                                                        ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }