Exemplo n.º 1
0
        /// <summary>
        /// Fetch a specific Interaction.
        /// </summary>
        ///
        /// <param name="options"> Fetch Interaction parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Interaction </returns>
        public static InteractionResource Fetch(FetchInteractionOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Fetch a specific Interaction.
        /// </summary>
        /// <param name="pathServiceSid"> Service Sid. </param>
        /// <param name="pathSessionSid"> Session Sid. </param>
        /// <param name="pathSid"> A string that uniquely identifies this Interaction. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Interaction </returns>
        public static async System.Threading.Tasks.Task <InteractionResource> FetchAsync(string pathServiceSid,
                                                                                         string pathSessionSid,
                                                                                         string pathSid,
                                                                                         ITwilioRestClient client = null)
        {
            var options = new FetchInteractionOptions(pathServiceSid, pathSessionSid, pathSid);

            return(await FetchAsync(options, client));
        }
Exemplo n.º 3
0
        /// <summary>
        /// Fetch a specific Interaction.
        /// </summary>
        /// <param name="pathServiceSid"> Service Sid. </param>
        /// <param name="pathSessionSid"> Session Sid. </param>
        /// <param name="pathSid"> A string that uniquely identifies this Interaction. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Interaction </returns>
        public static InteractionResource Fetch(string pathServiceSid,
                                                string pathSessionSid,
                                                string pathSid,
                                                ITwilioRestClient client = null)
        {
            var options = new FetchInteractionOptions(pathServiceSid, pathSessionSid, pathSid);

            return(Fetch(options, client));
        }
Exemplo n.º 4
0
 private static Request BuildFetchRequest(FetchInteractionOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Preview,
                "/Proxy/Services/" + options.PathServiceSid + "/Sessions/" + options.PathSessionSid + "/Interactions/" + options.PathSid + "",
                client.Region,
                queryParams: options.GetParams()
                ));
 }
Exemplo n.º 5
0
        /// <summary>
        /// Fetch a specific Interaction.
        /// </summary>
        ///
        /// <param name="options"> Fetch Interaction parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Interaction </returns>
        public static async System.Threading.Tasks.Task <InteractionResource> FetchAsync(FetchInteractionOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }