fromJson static method
Returns a new UpdateEventRequest instance and imports its values from
value if it's a Map, null otherwise.
Implementation
// ignore: prefer_constructors_over_static_methods
static UpdateEventRequest? 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'account_id'), 'Required key "UpdateEventRequest[account_id]" is missing from JSON.');
assert(json[r'account_id'] != null, 'Required key "UpdateEventRequest[account_id]" has a null value in JSON.');
assert(json.containsKey(r'updates'), 'Required key "UpdateEventRequest[updates]" is missing from JSON.');
assert(json[r'updates'] != null, 'Required key "UpdateEventRequest[updates]" has a null value in JSON.');
return true;
}());
return UpdateEventRequest(
accountId: mapValueOfType<String>(json, r'account_id')!,
updates: mapCastOfType<String, Object>(json, r'updates')!,
sendUpdates: UpdateEventRequestSendUpdatesEnum.fromJson(json[r'send_updates']),
);
}
return null;
}