api_key_create_dto.dart 3.1 KB

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