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

import Foundation
import Get
import URLQueryEncoder

extension Paths.Clips {
    public var getSongsByIds: GetSongsByIds {
        GetSongsByIds(path: path + "/get_songs_by_ids")
    }

    public struct GetSongsByIds {
        /// Path: `/api/clips/get_songs_by_ids`
        public let path: String

        /// Retrieve Songs By Ids
        ///
        /// Used by the web player to get the clips in the queue.
        public func get(ids: [String]) -> Request<GenAPI.GetSongsByIdsSchema> {
            Request(path: path, method: "GET", query: makeGetQuery(ids), id: "studio_api_clips_api_retrieve_songs_by_ids")
        }

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