toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  final json = <String, dynamic>{};
  if (this.name != null) {
    json[r'name'] = this.name;
  } else {
    json[r'name'] = null;
  }
    json[r'key'] = this.key;
  if (this.expiry != null) {
    json[r'expiry'] = this.expiry!.toUtc().toIso8601String();
  } else {
    json[r'expiry'] = null;
  }
    json[r'status'] = this.status;
    json[r'uses'] = this.uses;
    json[r'protected'] = this.protected;
  if (this.version != null) {
    json[r'version'] = this.version;
  } else {
    json[r'version'] = null;
  }
    json[r'suspended'] = this.suspended;
    json[r'floating'] = this.floating;
  if (this.scheme != null) {
    json[r'scheme'] = this.scheme;
  } else {
    json[r'scheme'] = null;
  }
    json[r'strict'] = this.strict;
  if (this.maxMachines != null) {
    json[r'maxMachines'] = this.maxMachines;
  } else {
    json[r'maxMachines'] = null;
  }
  if (this.maxProcesses != null) {
    json[r'maxProcesses'] = this.maxProcesses;
  } else {
    json[r'maxProcesses'] = null;
  }
  if (this.maxCores != null) {
    json[r'maxCores'] = this.maxCores;
  } else {
    json[r'maxCores'] = null;
  }
  if (this.maxUses != null) {
    json[r'maxUses'] = this.maxUses;
  } else {
    json[r'maxUses'] = null;
  }
    json[r'requireHeartbeat'] = this.requireHeartbeat;
    json[r'requireCheckIn'] = this.requireCheckIn;
  if (this.lastValidated != null) {
    json[r'lastValidated'] = this.lastValidated!.toUtc().toIso8601String();
  } else {
    json[r'lastValidated'] = null;
  }
  if (this.lastCheckOut != null) {
    json[r'lastCheckOut'] = this.lastCheckOut!.toUtc().toIso8601String();
  } else {
    json[r'lastCheckOut'] = null;
  }
  if (this.lastCheckIn != null) {
    json[r'lastCheckIn'] = this.lastCheckIn!.toUtc().toIso8601String();
  } else {
    json[r'lastCheckIn'] = null;
  }
  if (this.nextCheckIn != null) {
    json[r'nextCheckIn'] = this.nextCheckIn!.toUtc().toIso8601String();
  } else {
    json[r'nextCheckIn'] = null;
  }
    json[r'metadata'] = this.metadata;
    json[r'created'] = this.created.toUtc().toIso8601String();
    json[r'updated'] = this.updated.toUtc().toIso8601String();
  return json;
}