StorageVersionList.fromJson constructor

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

Creates a StorageVersionList from JSON data.

Implementation

factory StorageVersionList.fromJson(Map<String, dynamic> json) {
  final tempApiVersionJson = json['apiVersion'];
  final tempItemsJson = json['items'];
  final tempKindJson = json['kind'];
  final tempMetadataJson = json['metadata'];

  final String? tempApiVersion = tempApiVersionJson;

  final List<StorageVersion> tempItems = List<dynamic>.from(tempItemsJson)
      .map(
        (e) => StorageVersion.fromJson(
          Map<String, dynamic>.from(e),
        ),
      )
      .toList();

  final String? tempKind = tempKindJson;
  final ListMeta? tempMetadata =
      tempMetadataJson != null ? ListMeta.fromJson(tempMetadataJson) : null;

  return StorageVersionList(
    apiVersion: tempApiVersion,
    items: tempItems,
    kind: tempKind,
    metadata: tempMetadata,
  );
}