AWSMTLModel

Objective-C

@interface AWSMTLModel : NSObject <NSCopying>

// Returns a new instance of the receiver initialized using
// -initWithDictionary:error:.
+ (instancetype)modelWithDictionary:(NSDictionary *)dictionaryValue error:(NSError **)error;

// Initializes the receiver with default values.
//
// This is the designated initializer for this class.
- (instancetype)init;

// Initializes the receiver using key-value coding, setting the keys and values
// in the given dictionary.
//
// Subclass implementations may override this method, calling the super
// implementation, in order to perform further processing and initialization
// after deserialization.
//
// dictionaryValue - Property keys and values to set on the receiver. Any NSNull
//                   values will be converted to nil before being used. KVC
//                   validation methods will automatically be invoked for all of
//                   the properties given. If nil, this method is equivalent to
//                   -init.
// error           - If not NULL, this may be set to any error that occurs
//                   (like a KVC validation error).
//
// Returns an initialized model object, or nil if validation failed.
- (instancetype)initWithDictionary:(NSDictionary *)dictionaryValue error:(NSError **)error;

// Returns the keys for all @property declarations, except for `readonly`
// properties without ivars, or properties on MTLModel itself.
+ (NSSet *)propertyKeys;

// A dictionary representing the properties of the receiver.
//
// The default implementation combines the values corresponding to all
// +propertyKeys into a dictionary, with any nil values represented by NSNull.
//
// This property must never be nil.
@property (nonatomic, copy, readonly) NSDictionary *dictionaryValue;

// Merges the value of the given key on the receiver with the value of the same
// key from the given model object, giving precedence to the other model object.
//
// By default, this method looks for a `-merge<Key>FromModel:` method on the
// receiver, and invokes it if found. If not found, and `model` is not nil, the
// value for the given key is taken from `model`.
- (void)mergeValueForKey:(NSString *)key fromModel:(AWSMTLModel *)model;

// Merges the values of the given model object into the receiver, using
// -mergeValueForKey:fromModel: for each key in +propertyKeys.
//
// `model` must be an instance of the receiver's class or a subclass thereof.
- (void)mergeValuesForKeysFromModel:(AWSMTLModel *)model;

// Compares the receiver with another object for equality.
//
// The default implementation is equivalent to comparing both models'
// -dictionaryValue.
//
// Note that this may lead to infinite loops if the receiver holds a circular
// reference to another MTLModel and both use the default behavior.
// It is recommended to override -isEqual: in this scenario.
- (BOOL)isEqual:(id)object;

// A string that describes the contents of the receiver.
//
// The default implementation is based on the receiver's class and its
// -dictionaryValue.
//
// Note that this may lead to infinite loops if the receiver holds a circular
// reference to another MTLModel and both use the default behavior.
// It is recommended to override -description in this scenario.
- (NSString *)description;

@end

Swift

class AWSMTLModel : NSObject, NSCopying

Undocumented

  • Undocumented

    Declaration

    Objective-C

    + (instancetype)modelWithDictionary:(NSDictionary *)dictionaryValue error:(NSError **)error;
  • Undocumented

    Declaration

    Objective-C

    - (instancetype)init;

    Swift

    init!()
  • Undocumented

    Declaration

    Objective-C

    - (instancetype)initWithDictionary:(NSDictionary *)dictionaryValue error:(NSError **)error;

    Swift

    init(dictionary dictionaryValue: [AnyHashable : Any]!, error: ()) throws
  • Undocumented

    Declaration

    Objective-C

    + (NSSet *)propertyKeys;

    Swift

    class func propertyKeys() -> Set<AnyHashable>!
  • Undocumented

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly) NSDictionary *dictionaryValue

    Swift

    var dictionaryValue: [AnyHashable : Any]! { get }
  • Undocumented

    Declaration

    Objective-C

    - (void)mergeValueForKey:(NSString *)key fromModel:(AWSMTLModel *)model;

    Swift

    func mergeValue(forKey key: String!, from model: AWSMTLModel!)
  • Undocumented

    Declaration

    Objective-C

    - (void)mergeValuesForKeysFromModel:(AWSMTLModel *)model;

    Swift

    func mergeValuesForKeys(from model: AWSMTLModel!)
  • Undocumented

    Declaration

    Objective-C

    - (BOOL)isEqual:(id)object;

    Swift

    func isEqual(_ object: Any!) -> Bool
  • Undocumented

    Declaration

    Objective-C

    - (NSString *)description;

    Swift

    func description() -> String!

NSCoding

  • Undocumented

    Declaration

    Objective-C

    - (id)initWithCoder:(NSCoder *)coder;

    Swift

    init!(coder: NSCoder!)
  • Undocumented

    Declaration

    Objective-C

    - (void)encodeWithCoder:(NSCoder *)coder;

    Swift

    func encode(with coder: NSCoder!)
  • Undocumented

    Declaration

    Objective-C

    + (NSDictionary *)encodingBehaviorsByPropertyKey;

    Swift

    class func encodingBehaviorsByPropertyKey() -> [AnyHashable : Any]!
  • Undocumented

    Declaration

    Objective-C

    + (NSDictionary *)allowedSecureCodingClassesByPropertyKey;

    Swift

    class func allowedSecureCodingClassesByPropertyKey() -> [AnyHashable : Any]!
  • Undocumented

    Declaration

    Objective-C

    - (id)decodeValueForKey:(NSString *)key withCoder:(NSCoder *)coder modelVersion:(NSUInteger)modelVersion;

    Swift

    func decodeValue(forKey key: String!, with coder: NSCoder!, modelVersion: UInt) -> Any!
  • Undocumented

    Declaration

    Objective-C

    + (NSUInteger)modelVersion;

    Swift

    class func modelVersion() -> UInt

OldArchiveSupport

  • Undocumented

    Declaration

    Objective-C

    + (NSDictionary *)dictionaryValueFromArchivedExternalRepresentation:(NSDictionary *)externalRepresentation version:(NSUInteger)fromVersion;

    Swift

    class func dictionaryValue(fromArchivedExternalRepresentation externalRepresentation: [AnyHashable : Any]!, version fromVersion: UInt) -> [AnyHashable : Any]!

Validation

  • Undocumented

    Declaration

    Objective-C

    - (BOOL)validate:(NSError **)error;

    Swift

    func validate() throws

Unavailable

  • Deprecated

    Replaced by +modelWithDictionary:error:

    Undocumented

    Declaration

    Objective-C

    + (instancetype)modelWithDictionary:(NSDictionary *)dictionaryValue __attribute__((deprecated("Replaced by +modelWithDictionary:error:")));
  • Deprecated

    Replaced by -initWithDictionary:error:

    Undocumented

    Declaration

    Objective-C

    - (instancetype)initWithDictionary:(NSDictionary *)dictionaryValue __attribute__((deprecated("Replaced by -initWithDictionary:error:")));

    Swift

    init!(dictionary dictionaryValue: [AnyHashable : Any]!)
  • Deprecated

    Replaced by -[MTLJSONAdapter initWithJSONDictionary:modelClass:]

    Undocumented

    Declaration

    Objective-C

    + (instancetype)modelWithExternalRepresentation:(NSDictionary *)externalRepresentation __attribute__((deprecated("Replaced by -[MTLJSONAdapter initWithJSONDictionary:modelClass:]")));
  • Deprecated

    Replaced by -[MTLJSONAdapter initWithJSONDictionary:modelClass:]

    Undocumented

    Declaration

    Objective-C

    - (instancetype)initWithExternalRepresentation:(NSDictionary *)externalRepresentation __attribute__((deprecated("Replaced by -[MTLJSONAdapter initWithJSONDictionary:modelClass:]")));

    Swift

    init!(externalRepresentation: [AnyHashable : Any]!)
  • Deprecated

    Replaced by MTLJSONAdapter.JSONDictionary

    Undocumented

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly) NSDictionary *externalRepresentation

    Swift

    var externalRepresentation: [AnyHashable : Any]! { get }
  • Deprecated

    Replaced by +JSONKeyPathsByPropertyKey in

    Undocumented

    Declaration

    Objective-C

    + (NSDictionary *)externalRepresentationKeyPathsByPropertyKey __attribute__((deprecated("Replaced by +JSONKeyPathsByPropertyKey in <MTLJSONSerializing>")));

    Swift

    class func externalRepresentationKeyPathsByPropertyKey() -> [AnyHashable : Any]!
  • Deprecated

    Replaced by +JSONTransformerForKey: in

    Undocumented

    Declaration

    Objective-C

    + (NSValueTransformer *)transformerForKey:(NSString *)key __attribute__((deprecated("Replaced by +JSONTransformerForKey: in <MTLJSONSerializing>")));

    Swift

    class func transformer(forKey key: String!) -> ValueTransformer!
  • Deprecated

    Replaced by -decodeValueForKey:withCoder:modelVersion:

    Undocumented

    Declaration

    Objective-C

    + (NSDictionary *)migrateExternalRepresentation:(NSDictionary *)externalRepresentation fromVersion:(NSUInteger)fromVersion __attribute__((deprecated("Replaced by -decodeValueForKey:withCoder:modelVersion:")));

    Swift

    class func migrateExternalRepresentation(_ externalRepresentation: [AnyHashable : Any]!, fromVersion: UInt) -> [AnyHashable : Any]!