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

import Foundation

/// Selected fields from GeneratedClip.metadata.
public struct GenMetadataSchema: Codable, Equatable {
    public var artistClipId: String?
    public var avgBpm: Double?
    public var batchOffset: Int?
    public var canPublishWithVocal: Bool?
    public var canRemix: Bool?
    public var complementOfId: String?
    public var concatHistory: [ConcatHistoryItem]?
    public var configurations: [String: Configuration]?
    public var contestIds: [String]?
    public var continueAt: Double?
    /// ControlSlidersSchema
    public var controlSliders: ControlSlidersSchema?
    public var controlTags: String?
    public var coverClipId: String?
    public var coverEndS: Double?
    public var coverStartS: Double?
    public var duration: Double?
    public var editSessionId: String?
    public var editedClipId: String?
    public var errorMessage: String?
    public var errorType: String?
    public var existingStems: [String]?
    public var freeQuotaCategory: String?
    public var gptDescriptionPrompt: String?
    public var hasStem: Bool?
    public var hasVocal: Bool?
    public var history: [HistoryItem]?
    public var imageToSongImageIds: [String]?
    public var imageToSongImageUrls: [String]?
    public var infill: Bool?
    public var infillLyrics: String?
    public var isAudioUploadTosAccepted: Bool?
    public var isImageToSong: Bool?
    public var isLoudnessUnderThreshold: Bool?
    public var isRemix: Bool?
    public var isSunoShort: Bool?
    public var key: String?
    public var lyricsUpdated: Bool?
    public var maxBpm: Double?
    public var minBpm: Double?
    /// ModelBadgesSchema
    ///
    /// Combined schema for both songcard and songrow model badges.
    public var modelBadges: ModelBadgesSchema?
    public var negativeTags: String?
    public var normalizeVolume: Bool?
    public var optOutVideoCoverHook: Bool?
    public var overpaintingClipId: String?
    public var overrideFutureClipId: String?
    public var overrideFutureStartSeconds: Double?
    public var overrideHistoryClipId: String?
    public var overrideHistoryEndSeconds: Double?
    public var personaId: String?
    public var playlistId: String?
    public var priority: Int?
    public var prompt: String?
    public var refundCredits: Bool?
    public var remix: String?
    public var secondaryBadges: [BadgeSchema]?
    public var showRemix: Bool?
    public var speedClipId: String?
    public var stemFromId: String?
    public var stemTask: String?
    public var stemTypeGroupName: String?
    public var stemTypeId: Int?
    public var stream: Bool?
    public var stylesLyricsClipId: String?
    public var tags: String?
    public var task: Task?
    public var type: String?
    public var underpaintingClipId: String?
    public var upsampleClipId: String?
    public var usesLatestModel: Bool?
    public var variationCategory: VariationCategory?
    public var videoIsStale: Bool?
    public var videoToSongVideoOutputUrl: String?
    public var videoToSongVideoUploadId: String?
    public var videoToSongVideoUploadUrl: String?
    public var videoUploadHeight: Int?
    public var videoUploadWidth: Int?

    public struct ConcatHistoryItem: Codable, Equatable {
        public var string: String?
        public var object: [String: AnyJSON]?

        public init(string: String? = nil, object: [String: AnyJSON]? = nil) {
            self.string = string
            self.object = object
        }

        public init(from decoder: Decoder) throws {
            let container = try decoder.singleValueContainer()
            self.string = try? container.decode(String.self)
            self.object = try? container.decode([String: AnyJSON].self)
        }

        public func encode(to encoder: Encoder) throws {
            var container = encoder.singleValueContainer()
            if let value = string { try container.encode(value) }
            if let value = object { try container.encode(value) }
        }
    }

    public struct Configuration: Codable, Equatable {
        public var int: Int?
        public var double: Double?
        public var string: String?
        public var bool: Bool?

        public init(int: Int? = nil, double: Double? = nil, string: String? = nil, bool: Bool? = nil) {
            self.int = int
            self.double = double
            self.string = string
            self.bool = bool
        }

        public init(from decoder: Decoder) throws {
            let container = try decoder.singleValueContainer()
            self.int = try? container.decode(Int.self)
            self.double = try? container.decode(Double.self)
            self.string = try? container.decode(String.self)
            self.bool = try? container.decode(Bool.self)
        }

        public func encode(to encoder: Encoder) throws {
            var container = encoder.singleValueContainer()
            if let value = int { try container.encode(value) }
            if let value = double { try container.encode(value) }
            if let value = string { try container.encode(value) }
            if let value = bool { try container.encode(value) }
        }
    }

    public struct HistoryItem: Codable, Equatable {
        public var string: String?
        public var object: [String: AnyJSON]?

        public init(string: String? = nil, object: [String: AnyJSON]? = nil) {
            self.string = string
            self.object = object
        }

        public init(from decoder: Decoder) throws {
            let container = try decoder.singleValueContainer()
            self.string = try? container.decode(String.self)
            self.object = try? container.decode([String: AnyJSON].self)
        }

        public func encode(to encoder: Encoder) throws {
            var container = encoder.singleValueContainer()
            if let value = string { try container.encode(value) }
            if let value = object { try container.encode(value) }
        }
    }

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

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

        public static let extend = Self(rawValue: "extend")
        public static let uploadExtend = Self(rawValue: "upload_extend")
        public static let infill = Self(rawValue: "infill")
        public static let fixedInfill = Self(rawValue: "fixed_infill")
        public static let infillIntro = Self(rawValue: "infill_intro")
        public static let infillOutro = Self(rawValue: "infill_outro")
        public static let coverInfill = Self(rawValue: "cover_infill")
        public static let coverExtend = Self(rawValue: "cover_extend")
        public static let artistInfill = Self(rawValue: "artist_infill")
        public static let artistConsistency = Self(rawValue: "artist_consistency")
        public static let cover = Self(rawValue: "cover")
        public static let imageToSong = Self(rawValue: "image_to_song")
        public static let videoToSong = Self(rawValue: "video_to_song")
        public static let concat = Self(rawValue: "concat")
        public static let concatInfilling = Self(rawValue: "concat_infilling")
        public static let upsample = Self(rawValue: "upsample")
        public static let twitterToSong = Self(rawValue: "twitter_to_song")
        public static let artistCover = Self(rawValue: "artist_cover")
        public static let voxCover = Self(rawValue: "vox_cover")
        public static let artistExtend = Self(rawValue: "artist_extend")
        public static let artistCoverExtend = Self(rawValue: "artist_cover_extend")
        public static let vox = Self(rawValue: "vox")
        public static let stem = Self(rawValue: "stem")
        public static let genStem = Self(rawValue: "gen_stem")
        public static let generate = Self(rawValue: "generate")
        public static let nonauthPreview = Self(rawValue: "nonauth_preview")
        public static let multiArtistConsistency = Self(rawValue: "multi_artist_consistency")
        public static let playlistCondition = Self(rawValue: "playlist_condition")
        public static let underpainting = Self(rawValue: "underpainting")
        public static let overpainting = Self(rawValue: "overpainting")
        public static let stemCondition = Self(rawValue: "stem_condition")
        public static let coverStemCondition = Self(rawValue: "cover_stem_condition")
        public static let artistStemCondition = Self(rawValue: "artist_stem_condition")
        public static let stemInfill = Self(rawValue: "stem_infill")
        public static let stemConditionInfill = Self(rawValue: "stem_condition_infill")
        public static let voxPlaylistCondition = Self(rawValue: "vox_playlist_condition")
        public static let sampleCondition = Self(rawValue: "sample_condition")
        public static let empty = Self(rawValue: "")
    }

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

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

        public static let subtle = Self(rawValue: "subtle")
        public static let normal = Self(rawValue: "normal")
        public static let high = Self(rawValue: "high")
    }

    public init(artistClipId: String? = nil, avgBpm: Double? = nil, batchOffset: Int? = nil, canPublishWithVocal: Bool? = nil, canRemix: Bool? = nil, complementOfId: String? = nil, concatHistory: [ConcatHistoryItem]? = nil, configurations: [String: Configuration]? = nil, contestIds: [String]? = nil, continueAt: Double? = nil, controlSliders: ControlSlidersSchema? = nil, controlTags: String? = nil, coverClipId: String? = nil, coverEndS: Double? = nil, coverStartS: Double? = nil, duration: Double? = nil, editSessionId: String? = nil, editedClipId: String? = nil, errorMessage: String? = nil, errorType: String? = nil, existingStems: [String]? = nil, freeQuotaCategory: String? = nil, gptDescriptionPrompt: String? = nil, hasStem: Bool? = nil, hasVocal: Bool? = nil, history: [HistoryItem]? = nil, imageToSongImageIds: [String]? = nil, imageToSongImageUrls: [String]? = nil, infill: Bool? = nil, infillLyrics: String? = nil, isAudioUploadTosAccepted: Bool? = nil, isImageToSong: Bool? = nil, isLoudnessUnderThreshold: Bool? = nil, isRemix: Bool? = nil, isSunoShort: Bool? = nil, key: String? = nil, lyricsUpdated: Bool? = nil, maxBpm: Double? = nil, minBpm: Double? = nil, modelBadges: ModelBadgesSchema? = nil, negativeTags: String? = nil, normalizeVolume: Bool? = nil, optOutVideoCoverHook: Bool? = nil, overpaintingClipId: String? = nil, overrideFutureClipId: String? = nil, overrideFutureStartSeconds: Double? = nil, overrideHistoryClipId: String? = nil, overrideHistoryEndSeconds: Double? = nil, personaId: String? = nil, playlistId: String? = nil, priority: Int? = nil, prompt: String? = nil, refundCredits: Bool? = nil, remix: String? = nil, secondaryBadges: [BadgeSchema]? = nil, showRemix: Bool? = nil, speedClipId: String? = nil, stemFromId: String? = nil, stemTask: String? = nil, stemTypeGroupName: String? = nil, stemTypeId: Int? = nil, stream: Bool? = nil, stylesLyricsClipId: String? = nil, tags: String? = nil, task: Task? = nil, type: String? = nil, underpaintingClipId: String? = nil, upsampleClipId: String? = nil, usesLatestModel: Bool? = nil, variationCategory: VariationCategory? = nil, videoIsStale: Bool? = nil, videoToSongVideoOutputUrl: String? = nil, videoToSongVideoUploadId: String? = nil, videoToSongVideoUploadUrl: String? = nil, videoUploadHeight: Int? = nil, videoUploadWidth: Int? = nil) {
        self.artistClipId = artistClipId
        self.avgBpm = avgBpm
        self.batchOffset = batchOffset
        self.canPublishWithVocal = canPublishWithVocal
        self.canRemix = canRemix
        self.complementOfId = complementOfId
        self.concatHistory = concatHistory
        self.configurations = configurations
        self.contestIds = contestIds
        self.continueAt = continueAt
        self.controlSliders = controlSliders
        self.controlTags = controlTags
        self.coverClipId = coverClipId
        self.coverEndS = coverEndS
        self.coverStartS = coverStartS
        self.duration = duration
        self.editSessionId = editSessionId
        self.editedClipId = editedClipId
        self.errorMessage = errorMessage
        self.errorType = errorType
        self.existingStems = existingStems
        self.freeQuotaCategory = freeQuotaCategory
        self.gptDescriptionPrompt = gptDescriptionPrompt
        self.hasStem = hasStem
        self.hasVocal = hasVocal
        self.history = history
        self.imageToSongImageIds = imageToSongImageIds
        self.imageToSongImageUrls = imageToSongImageUrls
        self.infill = infill
        self.infillLyrics = infillLyrics
        self.isAudioUploadTosAccepted = isAudioUploadTosAccepted
        self.isImageToSong = isImageToSong
        self.isLoudnessUnderThreshold = isLoudnessUnderThreshold
        self.isRemix = isRemix
        self.isSunoShort = isSunoShort
        self.key = key
        self.lyricsUpdated = lyricsUpdated
        self.maxBpm = maxBpm
        self.minBpm = minBpm
        self.modelBadges = modelBadges
        self.negativeTags = negativeTags
        self.normalizeVolume = normalizeVolume
        self.optOutVideoCoverHook = optOutVideoCoverHook
        self.overpaintingClipId = overpaintingClipId
        self.overrideFutureClipId = overrideFutureClipId
        self.overrideFutureStartSeconds = overrideFutureStartSeconds
        self.overrideHistoryClipId = overrideHistoryClipId
        self.overrideHistoryEndSeconds = overrideHistoryEndSeconds
        self.personaId = personaId
        self.playlistId = playlistId
        self.priority = priority
        self.prompt = prompt
        self.refundCredits = refundCredits
        self.remix = remix
        self.secondaryBadges = secondaryBadges
        self.showRemix = showRemix
        self.speedClipId = speedClipId
        self.stemFromId = stemFromId
        self.stemTask = stemTask
        self.stemTypeGroupName = stemTypeGroupName
        self.stemTypeId = stemTypeId
        self.stream = stream
        self.stylesLyricsClipId = stylesLyricsClipId
        self.tags = tags
        self.task = task
        self.type = type
        self.underpaintingClipId = underpaintingClipId
        self.upsampleClipId = upsampleClipId
        self.usesLatestModel = usesLatestModel
        self.variationCategory = variationCategory
        self.videoIsStale = videoIsStale
        self.videoToSongVideoOutputUrl = videoToSongVideoOutputUrl
        self.videoToSongVideoUploadId = videoToSongVideoUploadId
        self.videoToSongVideoUploadUrl = videoToSongVideoUploadUrl
        self.videoUploadHeight = videoUploadHeight
        self.videoUploadWidth = videoUploadWidth
    }
}
