     /// - Returns: The serialized state for this object.
     public func serialized() -> JSON {
         return [
-            "typeName": typeName,
-            "contentType": contentType.rawValue,
-            "presets": presets.map { $0.serialized().object },
-            "data": data.object
+            CodingKeys.typeName.rawValue: typeName,
+            CodingKeys.contentType.rawValue: contentType.rawValue,
+            CodingKeys.presets.rawValue: presets.map { $0.serialized().object },
+            CodingKeys.data.rawValue: data.object
         ]
     }
     

        
        self.typeName = name
        self.contentType = contentType
        self.data = json["data"]
    }
    
    fileprivate init() {

    /// - Returns: A deserialized instance of this component type
    /// - Throws: Any type of error during deserialization.
    public init(json: JSON) throws {
        guard let name = json[CodingKeys.typeName].string else {
            throw DeserializationError.invalidSerialized(message: "Missing 'typeName'")
        }
        guard let type = json[CodingKeys.contentType].string else {
            throw DeserializationError.invalidSerialized(message: "Missing 'contentType'")
        }
        guard let contentType = ContentType(rawValue: type) else {
            throw DeserializationError.invalidSerialized(message: "Invalid content type \(type)")
        }
        if json[CodingKeys.data].type == .null || json[CodingKeys.data].type == .unknown {
            throw DeserializationError.invalidSerialized(message: "Missing 'data'")
        }
        if let presets = json[CodingKeys.presets].array {
            self.presets = try presets.map { try SerializedPreset(json: $0) }
        } else {
            self.presets = []
