fromJson static method
Returns a new PendingCommentToSyncOutbound instance and imports its values from
value if it's a Map, null otherwise.
Implementation
// ignore: prefer_constructors_over_static_methods
static PendingCommentToSyncOutbound? fromJson(dynamic value) {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
assert(json.containsKey(r'_id'), 'Required key "PendingCommentToSyncOutbound[_id]" is missing from JSON.');
assert(json[r'_id'] != null, 'Required key "PendingCommentToSyncOutbound[_id]" has a null value in JSON.');
assert(json.containsKey(r'commentId'), 'Required key "PendingCommentToSyncOutbound[commentId]" is missing from JSON.');
assert(json[r'commentId'] != null, 'Required key "PendingCommentToSyncOutbound[commentId]" has a null value in JSON.');
assert(json.containsKey(r'externalId'), 'Required key "PendingCommentToSyncOutbound[externalId]" is missing from JSON.');
assert(json.containsKey(r'createdAt'), 'Required key "PendingCommentToSyncOutbound[createdAt]" is missing from JSON.');
assert(json[r'createdAt'] != null, 'Required key "PendingCommentToSyncOutbound[createdAt]" has a null value in JSON.');
assert(json.containsKey(r'tenantId'), 'Required key "PendingCommentToSyncOutbound[tenantId]" is missing from JSON.');
assert(json[r'tenantId'] != null, 'Required key "PendingCommentToSyncOutbound[tenantId]" has a null value in JSON.');
assert(json.containsKey(r'attemptCount'), 'Required key "PendingCommentToSyncOutbound[attemptCount]" is missing from JSON.');
assert(json[r'attemptCount'] != null, 'Required key "PendingCommentToSyncOutbound[attemptCount]" has a null value in JSON.');
assert(json.containsKey(r'nextAttemptAt'), 'Required key "PendingCommentToSyncOutbound[nextAttemptAt]" is missing from JSON.');
assert(json[r'nextAttemptAt'] != null, 'Required key "PendingCommentToSyncOutbound[nextAttemptAt]" has a null value in JSON.');
assert(json.containsKey(r'eventType'), 'Required key "PendingCommentToSyncOutbound[eventType]" is missing from JSON.');
assert(json[r'eventType'] != null, 'Required key "PendingCommentToSyncOutbound[eventType]" has a null value in JSON.');
assert(json.containsKey(r'type'), 'Required key "PendingCommentToSyncOutbound[type]" is missing from JSON.');
assert(json[r'type'] != null, 'Required key "PendingCommentToSyncOutbound[type]" has a null value in JSON.');
assert(json.containsKey(r'domain'), 'Required key "PendingCommentToSyncOutbound[domain]" is missing from JSON.');
assert(json[r'domain'] != null, 'Required key "PendingCommentToSyncOutbound[domain]" has a null value in JSON.');
assert(json.containsKey(r'lastError'), 'Required key "PendingCommentToSyncOutbound[lastError]" is missing from JSON.');
assert(json[r'lastError'] != null, 'Required key "PendingCommentToSyncOutbound[lastError]" has a null value in JSON.');
return true;
}());
return PendingCommentToSyncOutbound(
id: mapValueOfType<String>(json, r'_id')!,
commentId: mapValueOfType<String>(json, r'commentId')!,
comment: FComment.fromJson(json[r'comment']),
externalId: mapValueOfType<String>(json, r'externalId'),
createdAt: mapDateTime(json, r'createdAt', r'')!,
tenantId: mapValueOfType<String>(json, r'tenantId')!,
attemptCount: mapValueOfType<double>(json, r'attemptCount')!,
nextAttemptAt: mapDateTime(json, r'nextAttemptAt', r'')!,
eventType: mapValueOfType<double>(json, r'eventType')!,
type: mapValueOfType<double>(json, r'type')!,
domain: mapValueOfType<String>(json, r'domain')!,
lastError: mapValueOfType<Object>(json, r'lastError')!,
webhookId: mapValueOfType<String>(json, r'webhookId'),
);
}
return null;
}