ApiKey class final

API key

Annotations
  • @immutable

Constructors

ApiKey({required String id, required String name, required Role role, required List<String> scopes, String? prefix, String? createdBy, required String createdAt, String? expiresAt, String? lastUsedAt, String? revokedAt, Map<String, Object?> extra = const {}})
Creates a ApiKey.
const
ApiKey.fromJson(Map<String, Object?> json, [String path = ''])
Decodes json; throws FormatException (with the JSON path) on a missing required member or a type mismatch. Unknown members and explicit nulls go to extra.
factory

Properties

createdAt → String
RFC 3339 UTC with milliseconds, e.g. 2026-10-19T12:00:00.000Z.
final
createdBy → String?
createdBy member.
final
expiresAt → String?
expiresAt member.
final
extra → Map<String, Object?>
Members this version does not model (incl. x-* extensions and explicit nulls); written back by toJson.
final
hashCode → int
The hash code for this object.
no setteroverride
id → String
id member.
final
lastUsedAt → String?
lastUsedAt member.
final
name → String
name member.
final
prefix → String?
public part of the token (fdk_<id>) for recognition in logs
final
revokedAt → String?
revokedAt member.
final
role → Role
Role = scope bundle (02e §3.6). Open enum: clients map unknown roles to UNKNOWN.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
scopes → List<String>
scopes member.
final

Methods

copyWith({String? id, String? name, Role? role, List<String>? scopes, String? prefix, String? createdBy, String? createdAt, String? expiresAt, String? lastUsedAt, String? revokedAt, Map<String, Object?>? extra}) → ApiKey
A copy with the given members replaced (a member cannot be reset to null this way).
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, Object?>
Encodes to JSON (absent members omitted, extra merged back).
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
override

Constants

schemaId → const String
$id of the schema this model describes.