toJson method

Map<String, Object> toJson()

Converts a VolumeAttachmentStatus instance to JSON data.

Implementation

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

  final tempAttachError = attachError;
  final tempAttached = attached;
  final tempAttachmentMetadata = attachmentMetadata;
  final tempDetachError = detachError;

  if (tempAttachError != null) {
    jsonData['attachError'] = tempAttachError.toJson();
  }

  jsonData['attached'] = tempAttached;

  if (tempAttachmentMetadata != null) {
    jsonData['attachmentMetadata'] = tempAttachmentMetadata;
  }

  if (tempDetachError != null) {
    jsonData['detachError'] = tempDetachError.toJson();
  }

  return jsonData;
}