// Generated by Create API
// https://github.com/CreateAPI/CreateAPI

import Foundation
import Get
import URLQueryEncoder

extension Paths.Discover {
    public var shortcutsSongs: ShortcutsSongs {
        ShortcutsSongs(path: path + "/shortcuts_songs")
    }

    public struct ShortcutsSongs {
        /// Path: `/api/discover/shortcuts_songs`
        public let path: String

        /// Get Shortcuts
        ///
        /// Api get request for 'Discover' section of shortcuts
        /// based on the shortcut_type and shortcut_context, we will return the appropriate playlist to play music on platform
        public func get(shortcutType: ShortcutType, contextSongId: String? = nil) -> Request<GenAPI.ShortcutResponse> {
            Request(path: path, method: "GET", query: makeGetQuery(shortcutType, contextSongId), id: "studio_api_discover_api_get_shortcuts")
        }

        private func makeGetQuery(_ shortcutType: ShortcutType, _ contextSongId: String?) -> [(String, String?)] {
            let encoder = URLQueryEncoder()
            encoder.encode(shortcutType, forKey: "shortcut_type")
            encoder.encode(contextSongId, forKey: "context_song_id")
            return encoder.items
        }

        public struct ShortcutType: RawRepresentable, Codable, Equatable {
            public let rawValue: String

            public init(rawValue: String) {
                self.rawValue = rawValue
            }

            public static let likedSongs = Self(rawValue: "liked_songs")
            public static let likedPlaylists = Self(rawValue: "liked_playlists")
            public static let onRepeat = Self(rawValue: "on_repeat")
            public static let mySongs = Self(rawValue: "my_songs")
            public static let recentlyPlayed = Self(rawValue: "recently_played")
            public static let songRadios = Self(rawValue: "song_radios")
            public static let playedPlaylists = Self(rawValue: "played_playlists")
        }
    }
}
