public T Request <T>(
            [NotNull] SearchRequest <T> req,
            bool outputString) where T : SearchBase
        {
            if (req.Username.IsEmpty())
            {
                req.Username = _session.Username;
            }
            if (req.Country.IsEmpty())
            {
                req.Country = _session.CountryCode;
            }
            if (req.Locale.IsEmpty())
            {
                req.Locale = _session.Locale;
            }

            if (!outputString)
            {
                return(_session.Mercury().SendSync(new JsonMercuryRequest <T>(RawMercuryRequest.Get(req.BuildUrl()))));
            }
            else
            {
                var test = _session.Mercury().SendSync(new JsonMercuryRequest <string>(RawMercuryRequest.Get(req.BuildUrl())));
                Debug.WriteLine(test);
                return(default(T));
            }
        }
 public static JsonMercuryRequest <string> GetStationFor([NotNull] string context)
 {
     return(new JsonMercuryRequest <string>(RawMercuryRequest.Get("hm://radio-apollo/v3/stations/" + context)));
 }
 public static RawMercuryRequest AutoplayQuery([NotNull] string context)
 {
     return(RawMercuryRequest.Get("hm://autoplay-enabled/query?uri=" + context));
 }
 public static JsonMercuryRequest <MercuryArtist> GetArtist([NotNull] ArtistId id)
 {
     return(new JsonMercuryRequest <MercuryArtist>(RawMercuryRequest.Get(id.ToMercuryUri())));
 }
 public static JsonMercuryRequest <string> GetGenericJson([NotNull] string uri)
 {
     return(new JsonMercuryRequest <string>(RawMercuryRequest.Get(uri)));
 }
 public static JsonMercuryRequest <StoredToken> RequestToken([NotNull] string deviceId, [NotNull] string[] scope)
 {
     return(new JsonMercuryRequest <StoredToken>(RawMercuryRequest.Get(
                                                     $"hm://keymaster/token/authenticated?scope={string.Join(",", scope)}&client_id={KEYMASTER_CLIENT_ID}&device_id={deviceId}")));
 }
 public static JsonMercuryRequest <string> ResolveContext([NotNull] string uri)
 {
     return(new JsonMercuryRequest <string>(RawMercuryRequest.Get(
                                                $"hm://context-resolve/v1/{uri}")));
 }