fromJson static method
Returns a new ApiKeysUpdate instance and imports its values from
value if it's a Map, null otherwise.
Implementation
// ignore: prefer_constructors_over_static_methods
static ApiKeysUpdate? 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(() {
return true;
}());
return ApiKeysUpdate(
userId: mapValueOfType<String>(json, r'user_id'),
companyId: mapValueOfType<String>(json, r'company_id'),
roleId: mapValueOfType<int>(json, r'role_id'),
keyType: mapValueOfType<String>(json, r'key_type'),
isSystemGenerated: mapValueOfType<bool>(json, r'is_system_generated'),
mcpDeploymentId: mapValueOfType<String>(json, r'mcp_deployment_id'),
endpointId: mapValueOfType<String>(json, r'endpoint_id'),
name: mapValueOfType<String>(json, r'name'),
expirationDateUtc: mapDateTime(json, r'expiration_date_utc', r''),
);
}
return null;
}