/// <summary>
        /// read
        /// </summary>
        /// <param name="options"> Read PublishedTrack parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of PublishedTrack </returns>
        public static ResourceSet <PublishedTrackResource> Read(ReadPublishedTrackOptions options,
                                                                ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildReadRequest(options, client));

            var page = Page <PublishedTrackResource> .FromJson("published_tracks", response.Content);

            return(new ResourceSet <PublishedTrackResource>(page, options, client));
        }
 private static Request BuildReadRequest(ReadPublishedTrackOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Video,
                "/v1/Rooms/" + options.PathRoomSid + "/Participants/" + options.PathParticipantSid + "/PublishedTracks",
                client.Region,
                queryParams: options.GetParams()
                ));
 }
        /// <summary>
        /// read
        /// </summary>
        /// <param name="pathRoomSid"> The room_sid </param>
        /// <param name="pathParticipantSid"> The participant_sid </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 PublishedTrack </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <PublishedTrackResource> > ReadAsync(string pathRoomSid,
                                                                                                          string pathParticipantSid,
                                                                                                          int?pageSize             = null,
                                                                                                          long?limit               = null,
                                                                                                          ITwilioRestClient client = null)
        {
            var options = new ReadPublishedTrackOptions(pathRoomSid, pathParticipantSid)
            {
                PageSize = pageSize, Limit = limit
            };

            return(await ReadAsync(options, client));
        }
        /// <summary>
        /// read
        /// </summary>
        /// <param name="pathRoomSid"> The room_sid </param>
        /// <param name="pathParticipantSid"> The participant_sid </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 PublishedTrack </returns>
        public static ResourceSet <PublishedTrackResource> Read(string pathRoomSid,
                                                                string pathParticipantSid,
                                                                int?pageSize             = null,
                                                                long?limit               = null,
                                                                ITwilioRestClient client = null)
        {
            var options = new ReadPublishedTrackOptions(pathRoomSid, pathParticipantSid)
            {
                PageSize = pageSize, Limit = limit
            };

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

            var page = Page <PublishedTrackResource> .FromJson("published_tracks", response.Content);

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