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

import Foundation
import Get
import URLQueryEncoder

extension Paths.Playlist {
    public var setMetadata: SetMetadata {
        SetMetadata(path: path + "/set_metadata")
    }

    public struct SetMetadata {
        /// Path: `/api/playlist/set_metadata`
        public let path: String

        /// Set Playlist Metadata
        public func post(_ body: GenAPI.PlaylistUpdateMetadataSpec) -> Request<PostResponse> {
            Request(path: path, method: "POST", body: body, id: "studio_api_bots_playlist_api_set_playlist_metadata")
        }

        /// Response
        public struct PostResponse: Decodable, Equatable {
            public var playlistSchema: GenAPI.PlaylistSchema?
            public var genericModerationErrorSchema: GenAPI.GenericModerationErrorSchema?

            public init(playlistSchema: GenAPI.PlaylistSchema? = nil, genericModerationErrorSchema: GenAPI.GenericModerationErrorSchema? = nil) {
                self.playlistSchema = playlistSchema
                self.genericModerationErrorSchema = genericModerationErrorSchema
            }

            public init(from decoder: Decoder) throws {
                let container = try decoder.singleValueContainer()
                self.playlistSchema = try? container.decode(GenAPI.PlaylistSchema.self)
                self.genericModerationErrorSchema = try? container.decode(GenAPI.GenericModerationErrorSchema.self)
            }
        }
    }
}
