toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  final json = <String, dynamic>{};
    json[r'id'] = this.id;
  if (this.name != null) {
    json[r'name'] = this.name;
  } else {
    json[r'name'] = null;
  }
  if (this.description != null) {
    json[r'description'] = this.description;
  } else {
    json[r'description'] = null;
  }
    json[r'scopes'] = this.scopes;
  if (this.workspaceId != null) {
    json[r'workspaceId'] = this.workspaceId;
  } else {
    json[r'workspaceId'] = null;
  }
  if (this.createdAt != null) {
    json[r'createdAt'] = this.createdAt!.toUtc().toIso8601String();
  } else {
    json[r'createdAt'] = null;
  }
  if (this.lastUsedAt != null) {
    json[r'lastUsedAt'] = this.lastUsedAt!.toUtc().toIso8601String();
  } else {
    json[r'lastUsedAt'] = null;
  }
  if (this.expiresAt != null) {
    json[r'expiresAt'] = this.expiresAt!.toUtc().toIso8601String();
  } else {
    json[r'expiresAt'] = null;
  }
  if (this.tokenPrefix != null) {
    json[r'tokenPrefix'] = this.tokenPrefix;
  } else {
    json[r'tokenPrefix'] = null;
  }
  return json;
}