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

            return(FromJson(response.Content));
        }
Beispiel #2
0
 private static Request BuildFetchRequest(FetchMessageInteractionOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Proxy,
                "/v1/Services/" + options.PathServiceSid + "/Sessions/" + options.PathSessionSid + "/Participants/" + options.PathParticipantSid + "/MessageInteractions/" + options.PathSid + "",
                queryParams: options.GetParams()
                ));
 }
Beispiel #3
0
        /// <summary>
        /// fetch
        /// </summary>
        /// <param name="pathServiceSid"> The SID of the Service to fetch the resource from </param>
        /// <param name="pathSessionSid"> The SID of the parent Session </param>
        /// <param name="pathParticipantSid"> The SID of the Participant resource </param>
        /// <param name="pathSid"> The unique string that identifies the resource </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of MessageInteraction </returns>
        public static async System.Threading.Tasks.Task <MessageInteractionResource> FetchAsync(string pathServiceSid,
                                                                                                string pathSessionSid,
                                                                                                string pathParticipantSid,
                                                                                                string pathSid,
                                                                                                ITwilioRestClient client = null)
        {
            var options = new FetchMessageInteractionOptions(pathServiceSid, pathSessionSid, pathParticipantSid, pathSid);

            return(await FetchAsync(options, client));
        }
Beispiel #4
0
        /// <summary>
        /// fetch
        /// </summary>
        /// <param name="pathServiceSid"> The SID of the Service to fetch the resource from </param>
        /// <param name="pathSessionSid"> The SID of the parent Session </param>
        /// <param name="pathParticipantSid"> The SID of the Participant resource </param>
        /// <param name="pathSid"> The unique string that identifies the resource </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of MessageInteraction </returns>
        public static MessageInteractionResource Fetch(string pathServiceSid,
                                                       string pathSessionSid,
                                                       string pathParticipantSid,
                                                       string pathSid,
                                                       ITwilioRestClient client = null)
        {
            var options = new FetchMessageInteractionOptions(pathServiceSid, pathSessionSid, pathParticipantSid, pathSid);

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

            return(FromJson(response.Content));
        }