private static Request BuildReadRequest(ReadSubscribedTrackOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Video,
                "/v1/Rooms/" + options.PathRoomSid + "/Participants/" + options.PathParticipantSid + "/SubscribedTracks",
                queryParams: options.GetParams()
                ));
 }
        /// <summary>
        /// Returns a list of tracks that are subscribed for the participant.
        /// </summary>
        /// <param name="options"> Read SubscribedTrack parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of SubscribedTrack </returns>
        public static ResourceSet <SubscribedTrackResource> Read(ReadSubscribedTrackOptions options,
                                                                 ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildReadRequest(options, client));

            var page = Page <SubscribedTrackResource> .FromJson("subscribed_tracks", response.Content);

            return(new ResourceSet <SubscribedTrackResource>(page, options, client));
        }
        /// <summary>
        /// Returns a list of tracks that are subscribed for the participant.
        /// </summary>
        /// <param name="pathRoomSid"> The SID of the Room resource with the Track resources to read </param>
        /// <param name="pathParticipantSid"> The SID of the participant that subscribes to the Track resources 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 SubscribedTrack </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <SubscribedTrackResource> > ReadAsync(string pathRoomSid,
                                                                                                           string pathParticipantSid,
                                                                                                           int?pageSize             = null,
                                                                                                           long?limit               = null,
                                                                                                           ITwilioRestClient client = null)
        {
            var options = new ReadSubscribedTrackOptions(pathRoomSid, pathParticipantSid)
            {
                PageSize = pageSize, Limit = limit
            };

            return(await ReadAsync(options, client));
        }
        /// <summary>
        /// Returns a list of tracks that are subscribed for the participant.
        /// </summary>
        /// <param name="pathRoomSid"> The SID of the Room resource with the Track resources to read </param>
        /// <param name="pathParticipantSid"> The SID of the participant that subscribes to the Track resources 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 SubscribedTrack </returns>
        public static ResourceSet <SubscribedTrackResource> Read(string pathRoomSid,
                                                                 string pathParticipantSid,
                                                                 int?pageSize             = null,
                                                                 long?limit               = null,
                                                                 ITwilioRestClient client = null)
        {
            var options = new ReadSubscribedTrackOptions(pathRoomSid, pathParticipantSid)
            {
                PageSize = pageSize, Limit = limit
            };

            return(Read(options, client));
        }
        /// <summary>
        /// read
        /// </summary>
        /// <param name="pathRoomSid"> The room_sid </param>
        /// <param name="pathSubscriberSid"> The subscriber_sid </param>
        /// <param name="dateCreatedAfter"> The date_created_after </param>
        /// <param name="dateCreatedBefore"> The date_created_before </param>
        /// <param name="track"> The track </param>
        /// <param name="publisher"> The publisher </param>
        /// <param name="kind"> The kind </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 SubscribedTrack </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <SubscribedTrackResource> > ReadAsync(string pathRoomSid,
                                                                                                           string pathSubscriberSid,
                                                                                                           DateTime?dateCreatedAfter  = null,
                                                                                                           DateTime?dateCreatedBefore = null,
                                                                                                           string track     = null,
                                                                                                           string publisher = null,
                                                                                                           SubscribedTrackResource.KindEnum kind = null,
                                                                                                           int?pageSize             = null,
                                                                                                           long?limit               = null,
                                                                                                           ITwilioRestClient client = null)
        {
            var options = new ReadSubscribedTrackOptions(pathRoomSid, pathSubscriberSid)
            {
                DateCreatedAfter = dateCreatedAfter, DateCreatedBefore = dateCreatedBefore, Track = track, Publisher = publisher, Kind = kind, PageSize = pageSize, Limit = limit
            };

            return(await ReadAsync(options, client));
        }
        /// <summary>
        /// Returns a list of tracks that are subscribed for the participant.
        /// </summary>
        /// <param name="options"> Read SubscribedTrack parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of SubscribedTrack </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <SubscribedTrackResource> > ReadAsync(ReadSubscribedTrackOptions options,
                                                                                                           ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildReadRequest(options, client));

            var page = Page <SubscribedTrackResource> .FromJson("subscribed_tracks", response.Content);

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