toMap method

Map<String, dynamic> toMap()

Serializes this step to a map suitable for YAML output.

Implementation

Map<String, dynamic> toMap() {
  return <String, dynamic>{
    'type': 'export_artifact',
    'id': id,
    'artifact': declaration.id,
    'kind': declaration.kind.name,
    'primary_path': declaration.primaryPath,
    if (declaration.companions.isNotEmpty)
      'companions': declaration.companions
          .map(
            (c) => <String, dynamic>{
              'path': c.path,
              'role': c.role.name,
              'optional': c.optional,
            },
          )
          .toList(),
  };
}