/// <summary>
        /// Returns a single Track resource represented by `track_sid`.  Note: This is one resource with the Video API that
        /// requires a SID, be Track Name on the subscriber side is not guaranteed to be unique.
        /// </summary>
        /// <param name="options"> Fetch SubscribedTrack parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of SubscribedTrack </returns>
        public static SubscribedTrackResource Fetch(FetchSubscribedTrackOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }
        /// <summary>
        /// Returns a single Track resource represented by `track_sid`.  Note: This is one resource with the Video API that
        /// requires a SID, be Track Name on the subscriber side is not guaranteed to be unique.
        /// </summary>
        /// <param name="pathRoomSid"> The SID of the Room where the Track resource to fetch is subscribed </param>
        /// <param name="pathParticipantSid"> The SID of the participant that subscribes to the Track resource to fetch </param>
        /// <param name="pathSid"> The SID that identifies the resource to fetch </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of SubscribedTrack </returns>
        public static SubscribedTrackResource Fetch(string pathRoomSid,
                                                    string pathParticipantSid,
                                                    string pathSid,
                                                    ITwilioRestClient client = null)
        {
            var options = new FetchSubscribedTrackOptions(pathRoomSid, pathParticipantSid, pathSid);

            return(Fetch(options, client));
        }
        /// <summary>
        /// Returns a single Track resource represented by `track_sid`.  Note: This is one resource with the Video API that
        /// requires a SID, be Track Name on the subscriber side is not guaranteed to be unique.
        /// </summary>
        /// <param name="pathRoomSid"> The SID of the Room where the Track resource to fetch is subscribed </param>
        /// <param name="pathParticipantSid"> The SID of the participant that subscribes to the Track resource to fetch </param>
        /// <param name="pathSid"> The SID that identifies the resource to fetch </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 <SubscribedTrackResource> FetchAsync(string pathRoomSid,
                                                                                             string pathParticipantSid,
                                                                                             string pathSid,
                                                                                             ITwilioRestClient client = null)
        {
            var options = new FetchSubscribedTrackOptions(pathRoomSid, pathParticipantSid, pathSid);

            return(await FetchAsync(options, client));
        }
 private static Request BuildFetchRequest(FetchSubscribedTrackOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Video,
                "/v1/Rooms/" + options.PathRoomSid + "/Participants/" + options.PathParticipantSid + "/SubscribedTracks/" + options.PathSid + "",
                queryParams: options.GetParams()
                ));
 }
        /// <summary>
        /// Returns a single Track resource represented by `track_sid`.  Note: This is one resource with the Video API that
        /// requires a SID, be Track Name on the subscriber side is not guaranteed to be unique.
        /// </summary>
        /// <param name="options"> Fetch 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 <SubscribedTrackResource> FetchAsync(FetchSubscribedTrackOptions options,
                                                                                             ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }