toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  final json = <String, dynamic>{};
    json[r'id'] = this.id;
    json[r'user'] = this.user;
    json[r'created'] = this.created.toUtc().toIso8601String();
    json[r'updated'] = this.updated.toUtc().toIso8601String();
    json[r'entity_id'] = this.entityId;
    json[r'credential'] = this.credential;
  if (this.metadata != null) {
    json[r'metadata'] = this.metadata;
  } else {
    json[r'metadata'] = null;
  }
  if (this.issuedOn != null) {
    json[r'issued_on'] = this.issuedOn!.toUtc().toIso8601String();
  } else {
    json[r'issued_on'] = null;
  }
  if (this.revoked != null) {
    json[r'revoked'] = this.revoked;
  } else {
    json[r'revoked'] = null;
  }
  if (this.revocationReason != null) {
    json[r'revocation_reason'] = this.revocationReason;
  } else {
    json[r'revocation_reason'] = null;
  }
  if (this.expiresAt != null) {
    json[r'expires_at'] = this.expiresAt!.toUtc().toIso8601String();
  } else {
    json[r'expires_at'] = null;
  }
  if (this.hashed != null) {
    json[r'hashed'] = this.hashed;
  } else {
    json[r'hashed'] = null;
  }
  if (this.salt != null) {
    json[r'salt'] = this.salt;
  } else {
    json[r'salt'] = null;
  }
  if (this.narrative != null) {
    json[r'narrative'] = this.narrative;
  } else {
    json[r'narrative'] = null;
  }
  if (this.acceptance != null) {
    json[r'acceptance'] = this.acceptance;
  } else {
    json[r'acceptance'] = null;
  }
  if (this.item != null) {
    json[r'item'] = this.item;
  } else {
    json[r'item'] = null;
  }
  return json;
}