![]() |
Diffusion Apple API 6.11.5
Unified Client Library for iOS, tvOS and OS X / macOS
|
A schema.
A schema describes data value format in terms of one or more record definitions. A record definition describes the layout of a record and comprises one or more field definitions.
Within the data value there can be multiple occurrences of a record or field described by a single definition. The defined (or allowed, when describing variable numbers) number of occurrences of each definition is referred to as its 'multiplicity'. The multiplicity can be fixed (the item occurs a fixed number of times), or variable (the item occurs from a minimum number of times to a maximum number of times). If a variable field is used it must be the last in a record definition and if a variable record is used it must be the last in the schema definition.
A field may be defined as of type 'string', 'integer' or 'decimal'. A decimal type has a further property of 'scale' which defines the number of digits to the right of the decimal point.
Class Methods | |
(nullable instancetype) | + schemaWithJSONData:error: |
Properties | |
NSArray< PTDiffusionRecordV2SchemaRecord * > * | records |
Instance Methods | |
(NSData *) | - JSONData |
(PTDiffusionMutableRecordV2Model *) | - createMutableModel |
(BOOL) | - isEqualToRecordV2Schema: |
- (PTDiffusionMutableRecordV2Model *) createMutableModel |
Create a mutable model based upon the schema.
The model will be created with all mandatory record occurrences and all mandatory field occurrences initialized to default values.
Such a model may be mutated and used to generate updated PTDiffusionRecordV2 instances for updating purposes.
- (BOOL) isEqualToRecordV2Schema: | (nullable PTDiffusionRecordV2Schema *) | schema |
Compares the receiver to the given schema.
schema | The schema object with which to compare the receiver. |
YES
if the schema is equal to the contents of the receiver, otherwise NO
.- (NSData *) JSONData |
Returns the schema in a JSON format.
+ (nullable instancetype) schemaWithJSONData: | (NSData *) | jsonData | |
error: | (NSError **) | error | |
Returns a schema object initialized from the given JSON definition.
jsonData | Encoded JSON string representation of the schema. |
error | If this method returns nil to indicate that an error occurred then this will be populated with the reason for that failure. |
nil
if an error occurred, in which case *error
will be populated with the failure reason.
|
readnonatomicassign |
An immutable, ordered list of record definitions.
There will be at least one.