toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() => {
  'version': version,
  'kind': kind,
  if (variables != null) 'variables': variables!.map((e) => e.toJson()).toList(),
  if (environment != null) 'environment': environment!.map((e) => e.toJson()).toList(),

  'name': name,
  if (image != null) 'image': image,
  if (description != null) 'description': description,
  if (ports.isNotEmpty) 'ports': ports.map((e) => e.toJson()).toList(),
  if (command != null) 'command': command,
  'role': role,
  if (secrets.isNotEmpty) 'secrets': secrets,
  if (roomStoragePath != null) 'room_storage_path': roomStoragePath,
  if (roomStorageSubpath != null) 'room_storage_subpath': roomStorageSubpath,
};