Exemple #1
0
 private static Request BuildReadRequest(ReadParticipantOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Api,
                "/2010-04-01/Accounts/" + (options.PathAccountSid ?? client.AccountSid) + "/Conferences/" + options.PathConferenceSid + "/Participants.json",
                client.Region,
                queryParams: options.GetParams()
                ));
 }
        /// <summary>
        /// Retrieve a list of participants belonging to the account used to make the request
        /// </summary>
        /// <param name="pathConferenceSid"> The string that uniquely identifies this conference </param>
        /// <param name="pathAccountSid"> The account_sid </param>
        /// <param name="muted"> Filter by muted participants </param>
        /// <param name="hold"> Only show participants that are held or unheld. </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 pathConferenceSid,
                                                                                                       string pathAccountSid    = null,
                                                                                                       bool?muted               = null,
                                                                                                       bool?hold                = null,
                                                                                                       int?pageSize             = null,
                                                                                                       long?limit               = null,
                                                                                                       ITwilioRestClient client = null)
        {
            var options = new ReadParticipantOptions(pathConferenceSid)
            {
                PathAccountSid = pathAccountSid, Muted = muted, Hold = hold, PageSize = pageSize, Limit = limit
            };

            return(await ReadAsync(options, client));
        }
Exemple #3
0
        /// <summary>
        /// Retrieve a list of participants belonging to the account used to make the request
        /// </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));
        }