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

import Foundation

public struct RegeneratePlaylistSpec: Codable, Equatable {
    public var configuration: [String: ConfigurationItem]?
    public var modelName: String

    public struct ConfigurationItem: 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 init(configuration: [String: ConfigurationItem]? = nil, modelName: String) {
        self.configuration = configuration
        self.modelName = modelName
    }
}
