ModelFieldDefinition
public enum ModelFieldDefinition
Warning
Although this haspublic
access, it is intended for internal & codegen use and should not be used
directly by host applications. The behavior of this may change without warning.
-
Declaration
Swift
case field(name: String, type: ModelFieldType, nullability: ModelFieldNullability, isReadOnly: Bool, association: ModelAssociation?, attributes: [ModelFieldAttribute], authRules: AuthRules)
-
Declaration
Swift
public static func field(_ key: CodingKey, is nullability: ModelFieldNullability = .required, isReadOnly: Bool = false, ofType type: ModelFieldType = .string, attributes: [ModelFieldAttribute] = [], association: ModelAssociation? = nil, authRules: AuthRules = []) -> ModelFieldDefinition
-
Declaration
Swift
public static func id(_ key: CodingKey) -> ModelFieldDefinition
-
Declaration
Swift
public static func id(_ name: String = "id") -> ModelFieldDefinition
-
Declaration
Swift
public static func hasMany(_ key: CodingKey, is nullability: ModelFieldNullability = .required, isReadOnly: Bool = false, ofType type: Model.Type, associatedWith associatedKey: CodingKey) -> ModelFieldDefinition
-
Declaration
Swift
public static func hasMany(_ key: CodingKey, is nullability: ModelFieldNullability = .required, isReadOnly: Bool = false, ofType type: Model.Type, associatedFields associatedKeys: [CodingKey]) -> ModelFieldDefinition
-
Declaration
Swift
public static func hasOne(_ key: CodingKey, is nullability: ModelFieldNullability = .required, isReadOnly: Bool = false, ofType type: Model.Type, associatedWith associatedKey: CodingKey, targetName: String? = nil) -> ModelFieldDefinition
-
Declaration
Swift
public static func hasOne(_ key: CodingKey, is nullability: ModelFieldNullability = .required, isReadOnly: Bool = false, ofType type: Model.Type, associatedWith associatedKey: CodingKey, targetNames: [String]) -> ModelFieldDefinition
-
Declaration
Swift
public static func hasOne(_ key: CodingKey, is nullability: ModelFieldNullability = .required, isReadOnly: Bool = false, ofType type: Model.Type, associatedFields associatedKeys: [CodingKey], targetNames: [String] = []) -> ModelFieldDefinition
-
Declaration
Swift
public static func belongsTo(_ key: CodingKey, is nullability: ModelFieldNullability = .required, isReadOnly: Bool = false, ofType type: Model.Type, associatedWith associatedKey: CodingKey? = nil, targetName: String? = nil) -> ModelFieldDefinition
-
Declaration
Swift
public static func belongsTo(_ key: CodingKey, is nullability: ModelFieldNullability = .required, isReadOnly: Bool = false, ofType type: Model.Type, associatedWith associatedKey: CodingKey? = nil, targetNames: [String]) -> ModelFieldDefinition
-
Declaration
Swift
public var modelField: ModelField { get }