Map<String, Object?> toJson() => { 'name': name, 'kind': kind, 'location': location.toJson(), if (containerName != null) 'containerName': containerName, };