toJson method

Map<String, Object> toJson()

Converts a GitRepoVolumeSource instance to JSON data.

Implementation

Map<String, Object> toJson() {
  final jsonData = <String, Object>{};

  final tempDirectory = directory;
  final tempRepository = repository;
  final tempRevision = revision;

  if (tempDirectory != null) {
    jsonData['directory'] = tempDirectory;
  }

  jsonData['repository'] = tempRepository;

  if (tempRevision != null) {
    jsonData['revision'] = tempRevision;
  }

  return jsonData;
}