Ejemplo n.º 1
0
 private static Request BuildReadRequest(ReadParticipantOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Messaging,
                "/v1/Sessions/" + options.PathSessionSid + "/Participants",
                client.Region,
                queryParams: options.GetParams()
                ));
 }
Ejemplo n.º 2
0
        /// <summary>
        /// read
        /// </summary>
        /// <param name="pathSessionSid"> The SID of the Session with the participants to read </param>
        /// <param name="pageSize"> Page size </param>
        /// <param name="limit"> Record limit </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Participant </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <ParticipantResource> > ReadAsync(string pathSessionSid,
                                                                                                       int?pageSize             = null,
                                                                                                       long?limit               = null,
                                                                                                       ITwilioRestClient client = null)
        {
            var options = new ReadParticipantOptions(pathSessionSid)
            {
                PageSize = pageSize, Limit = limit
            };

            return(await ReadAsync(options, client));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// read
        /// </summary>
        /// <param name="pathSessionSid"> The SID of the Session with the participants to read </param>
        /// <param name="pageSize"> Page size </param>
        /// <param name="limit"> Record limit </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Participant </returns>
        public static ResourceSet <ParticipantResource> Read(string pathSessionSid,
                                                             int?pageSize             = null,
                                                             long?limit               = null,
                                                             ITwilioRestClient client = null)
        {
            var options = new ReadParticipantOptions(pathSessionSid)
            {
                PageSize = pageSize, Limit = limit
            };

            return(Read(options, client));
        }
Ejemplo n.º 4
0
        /// <summary>
        /// read
        /// </summary>
        /// <param name="options"> Read Participant parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Participant </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <ParticipantResource> > ReadAsync(ReadParticipantOptions options,
                                                                                                       ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildReadRequest(options, client));

            var page = Page <ParticipantResource> .FromJson("participants", response.Content);

            return(new ResourceSet <ParticipantResource>(page, options, client));
        }