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

import Foundation
import Get
import URLQueryEncoder

extension Paths.Myradio.WithRadioId {
    public var reaction: Reaction {
        Reaction(path: path + "/reaction")
    }

    public struct Reaction {
        /// Path: `/api/myradio/{radio_id}/reaction`
        public let path: String

        /// Post Radio Station Reaction
        ///
        /// Post a reaction to a comment.
        public func post(reaction: Reaction) -> Request<Void> {
            Request(path: path, method: "POST", query: makePostQuery(reaction), id: "studio_api_radio_api_post_radio_station_reaction")
        }

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

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

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

            public static let like = Self(rawValue: "LIKE")
            public static let dislike = Self(rawValue: "DISLIKE")
        }
    }
}
