private static Request BuildReadRequest(ReadPublishedTrackOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Video,
                "/v1/Rooms/" + options.PathRoomSid + "/Participants/" + options.PathParticipantSid + "/PublishedTracks",
                queryParams: options.GetParams()
                ));
 }
예제 #2
0
        /// <summary>
        /// Returns a list of tracks associated with a given Participant. Only `currently` Published Tracks are in the list
        /// resource.
        /// </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));
        }
예제 #3
0
        /// <summary>
        /// Returns a list of tracks associated with a given Participant. Only `currently` Published Tracks are in the list
        /// resource.
        /// </summary>
        /// <param name="pathRoomSid"> Unique Room identifier where this Track is published. </param>
        /// <param name="pathParticipantSid"> Unique Participant identifier that publishes this Track. </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));
        }
예제 #4
0
        /// <summary>
        /// Returns a list of tracks associated with a given Participant. Only `currently` Published Tracks are in the list
        /// resource.
        /// </summary>
        /// <param name="pathRoomSid"> Unique Room identifier where this Track is published. </param>
        /// <param name="pathParticipantSid"> Unique Participant identifier that publishes this Track. </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));
        }
예제 #5
0
        /// <summary>
        /// Returns a list of tracks associated with a given Participant. Only `currently` Published Tracks are in the list
        /// resource.
        /// </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));
        }