VolumeAttachmentStatus.fromJson constructor

VolumeAttachmentStatus.fromJson(
  1. Map<String, dynamic> json
)

Creates a VolumeAttachmentStatus from JSON data.

Implementation

factory VolumeAttachmentStatus.fromJson(Map<String, dynamic> json) {
  final tempAttachErrorJson = json['attachError'];
  final tempAttachedJson = json['attached'];
  final tempAttachmentMetadataJson = json['attachmentMetadata'];
  final tempDetachErrorJson = json['detachError'];

  final VolumeError? tempAttachError = tempAttachErrorJson != null
      ? VolumeError.fromJson(tempAttachErrorJson)
      : null;
  final bool tempAttached = tempAttachedJson;

  final Map<String, String>? tempAttachmentMetadata =
      tempAttachmentMetadataJson != null
          ? Map<String, String>.from(tempAttachmentMetadataJson)
          : null;

  final VolumeError? tempDetachError = tempDetachErrorJson != null
      ? VolumeError.fromJson(tempDetachErrorJson)
      : null;

  return VolumeAttachmentStatus(
    attachError: tempAttachError,
    attached: tempAttached,
    attachmentMetadata: tempAttachmentMetadata,
    detachError: tempDetachError,
  );
}