check_duplicate_asset_response_dto.dart 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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. this.id,
  14. required this.isExist,
  15. });
  16. ///
  17. /// Please note: This property should have been non-nullable! Since the specification file
  18. /// does not include a default value (using the "default:" property), however, the generated
  19. /// source code must fall back to having a nullable type.
  20. /// Consider adding a "default:" property in the specification file to hide this note.
  21. ///
  22. String? id;
  23. bool isExist;
  24. @override
  25. bool operator ==(Object other) => identical(this, other) || other is CheckDuplicateAssetResponseDto &&
  26. other.id == id &&
  27. other.isExist == isExist;
  28. @override
  29. int get hashCode =>
  30. // ignore: unnecessary_parenthesis
  31. (id == null ? 0 : id!.hashCode) +
  32. (isExist.hashCode);
  33. @override
  34. String toString() => 'CheckDuplicateAssetResponseDto[id=$id, isExist=$isExist]';
  35. Map<String, dynamic> toJson() {
  36. final json = <String, dynamic>{};
  37. if (this.id != null) {
  38. json[r'id'] = this.id;
  39. } else {
  40. // json[r'id'] = null;
  41. }
  42. json[r'isExist'] = this.isExist;
  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. return CheckDuplicateAssetResponseDto(
  52. id: mapValueOfType<String>(json, r'id'),
  53. isExist: mapValueOfType<bool>(json, r'isExist')!,
  54. );
  55. }
  56. return null;
  57. }
  58. static List<CheckDuplicateAssetResponseDto> listFromJson(dynamic json, {bool growable = false,}) {
  59. final result = <CheckDuplicateAssetResponseDto>[];
  60. if (json is List && json.isNotEmpty) {
  61. for (final row in json) {
  62. final value = CheckDuplicateAssetResponseDto.fromJson(row);
  63. if (value != null) {
  64. result.add(value);
  65. }
  66. }
  67. }
  68. return result.toList(growable: growable);
  69. }
  70. static Map<String, CheckDuplicateAssetResponseDto> mapFromJson(dynamic json) {
  71. final map = <String, CheckDuplicateAssetResponseDto>{};
  72. if (json is Map && json.isNotEmpty) {
  73. json = json.cast<String, dynamic>(); // ignore: parameter_assignments
  74. for (final entry in json.entries) {
  75. final value = CheckDuplicateAssetResponseDto.fromJson(entry.value);
  76. if (value != null) {
  77. map[entry.key] = value;
  78. }
  79. }
  80. }
  81. return map;
  82. }
  83. // maps a json object with a list of CheckDuplicateAssetResponseDto-objects as value to a dart map
  84. static Map<String, List<CheckDuplicateAssetResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
  85. final map = <String, List<CheckDuplicateAssetResponseDto>>{};
  86. if (json is Map && json.isNotEmpty) {
  87. // ignore: parameter_assignments
  88. json = json.cast<String, dynamic>();
  89. for (final entry in json.entries) {
  90. map[entry.key] = CheckDuplicateAssetResponseDto.listFromJson(entry.value, growable: growable,);
  91. }
  92. }
  93. return map;
  94. }
  95. /// The list of required keys that must be present in a JSON.
  96. static const requiredKeys = <String>{
  97. 'isExist',
  98. };
  99. }