Exemple #1
0
        /// <summary>
        /// Returns a single Track resource represented by `TrackNameOrSid`.
        /// </summary>
        /// <param name="options"> Fetch PublishedTrack parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of PublishedTrack </returns>
        public static PublishedTrackResource Fetch(FetchPublishedTrackOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }
Exemple #2
0
        /// <summary>
        /// Returns a single Track resource represented by `TrackNameOrSid`.
        /// </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="pathSid"> A 34 character string that uniquely identifies this resource. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of PublishedTrack </returns>
        public static PublishedTrackResource Fetch(string pathRoomSid,
                                                   string pathParticipantSid,
                                                   string pathSid,
                                                   ITwilioRestClient client = null)
        {
            var options = new FetchPublishedTrackOptions(pathRoomSid, pathParticipantSid, pathSid);

            return(Fetch(options, client));
        }
Exemple #3
0
        /// <summary>
        /// Returns a single Track resource represented by `TrackNameOrSid`.
        /// </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="pathSid"> A 34 character string that uniquely identifies this resource. </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 <PublishedTrackResource> FetchAsync(string pathRoomSid,
                                                                                            string pathParticipantSid,
                                                                                            string pathSid,
                                                                                            ITwilioRestClient client = null)
        {
            var options = new FetchPublishedTrackOptions(pathRoomSid, pathParticipantSid, pathSid);

            return(await FetchAsync(options, client));
        }
 private static Request BuildFetchRequest(FetchPublishedTrackOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Video,
                "/v1/Rooms/" + options.PathRoomSid + "/Participants/" + options.PathParticipantSid + "/PublishedTracks/" + options.PathSid + "",
                queryParams: options.GetParams()
                ));
 }
Exemple #5
0
        /// <summary>
        /// Returns a single Track resource represented by `TrackNameOrSid`.
        /// </summary>
        /// <param name="options"> Fetch 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 <PublishedTrackResource> FetchAsync(FetchPublishedTrackOptions options,
                                                                                            ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }