check_duplicate_asset_response_dto.dart 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. //
  2. // AUTO-GENERATED FILE, DO NOT MODIFY!
  3. //
  4. // @dart=2.12
  5. // ignore_for_file: unused_element, unused_import
  6. // ignore_for_file: always_put_required_named_parameters_first
  7. // ignore_for_file: constant_identifier_names
  8. // ignore_for_file: lines_longer_than_80_chars
  9. part of openapi.api;
  10. class CheckDuplicateAssetResponseDto {
  11. /// Returns a new [CheckDuplicateAssetResponseDto] instance.
  12. CheckDuplicateAssetResponseDto({
  13. required this.isExist,
  14. this.id,
  15. });
  16. bool isExist;
  17. ///
  18. /// Please note: This property should have been non-nullable! Since the specification file
  19. /// does not include a default value (using the "default:" property), however, the generated
  20. /// source code must fall back to having a nullable type.
  21. /// Consider adding a "default:" property in the specification file to hide this note.
  22. ///
  23. String? id;
  24. @override
  25. bool operator ==(Object other) => identical(this, other) || other is CheckDuplicateAssetResponseDto &&
  26. other.isExist == isExist &&
  27. other.id == id;
  28. @override
  29. int get hashCode =>
  30. // ignore: unnecessary_parenthesis
  31. (isExist.hashCode) +
  32. (id == null ? 0 : id!.hashCode);
  33. @override
  34. String toString() => 'CheckDuplicateAssetResponseDto[isExist=$isExist, id=$id]';
  35. Map<String, dynamic> toJson() {
  36. final _json = <String, dynamic>{};
  37. _json[r'isExist'] = isExist;
  38. if (id != null) {
  39. _json[r'id'] = id;
  40. } else {
  41. _json[r'id'] = null;
  42. }
  43. return _json;
  44. }
  45. /// Returns a new [CheckDuplicateAssetResponseDto] instance and imports its values from
  46. /// [value] if it's a [Map], null otherwise.
  47. // ignore: prefer_constructors_over_static_methods
  48. static CheckDuplicateAssetResponseDto? fromJson(dynamic value) {
  49. if (value is Map) {
  50. final json = value.cast<String, dynamic>();
  51. // Ensure that the map contains the required keys.
  52. // Note 1: the values aren't checked for validity beyond being non-null.
  53. // Note 2: this code is stripped in release mode!
  54. assert(() {
  55. requiredKeys.forEach((key) {
  56. assert(json.containsKey(key), 'Required key "CheckDuplicateAssetResponseDto[$key]" is missing from JSON.');
  57. assert(json[key] != null, 'Required key "CheckDuplicateAssetResponseDto[$key]" has a null value in JSON.');
  58. });
  59. return true;
  60. }());
  61. return CheckDuplicateAssetResponseDto(
  62. isExist: mapValueOfType<bool>(json, r'isExist')!,
  63. id: mapValueOfType<String>(json, r'id'),
  64. );
  65. }
  66. return null;
  67. }
  68. static List<CheckDuplicateAssetResponseDto>? listFromJson(dynamic json, {bool growable = false,}) {
  69. final result = <CheckDuplicateAssetResponseDto>[];
  70. if (json is List && json.isNotEmpty) {
  71. for (final row in json) {
  72. final value = CheckDuplicateAssetResponseDto.fromJson(row);
  73. if (value != null) {
  74. result.add(value);
  75. }
  76. }
  77. }
  78. return result.toList(growable: growable);
  79. }
  80. static Map<String, CheckDuplicateAssetResponseDto> mapFromJson(dynamic json) {
  81. final map = <String, CheckDuplicateAssetResponseDto>{};
  82. if (json is Map && json.isNotEmpty) {
  83. json = json.cast<String, dynamic>(); // ignore: parameter_assignments
  84. for (final entry in json.entries) {
  85. final value = CheckDuplicateAssetResponseDto.fromJson(entry.value);
  86. if (value != null) {
  87. map[entry.key] = value;
  88. }
  89. }
  90. }
  91. return map;
  92. }
  93. // maps a json object with a list of CheckDuplicateAssetResponseDto-objects as value to a dart map
  94. static Map<String, List<CheckDuplicateAssetResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
  95. final map = <String, List<CheckDuplicateAssetResponseDto>>{};
  96. if (json is Map && json.isNotEmpty) {
  97. json = json.cast<String, dynamic>(); // ignore: parameter_assignments
  98. for (final entry in json.entries) {
  99. final value = CheckDuplicateAssetResponseDto.listFromJson(entry.value, growable: growable,);
  100. if (value != null) {
  101. map[entry.key] = value;
  102. }
  103. }
  104. }
  105. return map;
  106. }
  107. /// The list of required keys that must be present in a JSON.
  108. static const requiredKeys = <String>{
  109. 'isExist',
  110. };
  111. }