/*
 * @Author       : WuWei
 * @LastEditors  : WuWei
 * @Date         : 2023-10-26 09:56:02
 * @LastEditTime : 2023-10-30 15:53:57
 * @Description  : Do not edit
 */
import 'package:wisdom_cli/wisdom_cli.dart';

class AssetListModel {
  String? type;
  List<AssetsOfAssetListModel>? assets;

  AssetListModel({
    this.type,
    this.assets,
  });

  AssetListModel.fromJson(json) {
    Map<String, dynamic> map = Map.from(json ?? {});

    type = map['type'];
    assets = List<AssetsOfAssetListModel>.from(
        (map["assets"] ?? []).map((x) => AssetsOfAssetListModel.fromJson(x)));
  }

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = Map<String, dynamic>();

    json['type'] = this.type;
    json['assets'] = List<dynamic>.from((assets ?? []).map((x) => x.toJson()));

    return json;
  }
}

class AssetsOfAssetListModel extends WPickerEntity {
  String? code;
  String? name;
  bool? isIntelligent;
  String? type;

  AssetsOfAssetListModel({
    this.code,
    this.name,
    this.isIntelligent,
    this.type,
  });

  AssetsOfAssetListModel.fromJson(json) {
    Map<String, dynamic> map = Map.from(json ?? {});

    code = map['code'];
    name = map['name'];
    isIntelligent = map['isIntelligent'];
    type = map['type'];
  }

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = Map<String, dynamic>();

    json['code'] = this.code;
    json['name'] = this.name;
    json['isIntelligent'] = this.isIntelligent;
    json['type'] = this.type;
    return json;
  }

  @override
  bool get selectDisabled => false;

  @override
  String get selectName => this.name ?? '';

  @override
  Object get selectUnique => this.code ?? '';
}
