api_key_response_dto.dart 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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 APIKeyResponseDto {
  11. /// Returns a new [APIKeyResponseDto] instance.
  12. APIKeyResponseDto({
  13. required this.createdAt,
  14. required this.id,
  15. required this.name,
  16. required this.updatedAt,
  17. });
  18. DateTime createdAt;
  19. String id;
  20. String name;
  21. DateTime updatedAt;
  22. @override
  23. bool operator ==(Object other) => identical(this, other) || other is APIKeyResponseDto &&
  24. other.createdAt == createdAt &&
  25. other.id == id &&
  26. other.name == name &&
  27. other.updatedAt == updatedAt;
  28. @override
  29. int get hashCode =>
  30. // ignore: unnecessary_parenthesis
  31. (createdAt.hashCode) +
  32. (id.hashCode) +
  33. (name.hashCode) +
  34. (updatedAt.hashCode);
  35. @override
  36. String toString() => 'APIKeyResponseDto[createdAt=$createdAt, id=$id, name=$name, updatedAt=$updatedAt]';
  37. Map<String, dynamic> toJson() {
  38. final json = <String, dynamic>{};
  39. json[r'createdAt'] = this.createdAt.toUtc().toIso8601String();
  40. json[r'id'] = this.id;
  41. json[r'name'] = this.name;
  42. json[r'updatedAt'] = this.updatedAt.toUtc().toIso8601String();
  43. return json;
  44. }
  45. /// Returns a new [APIKeyResponseDto] instance and imports its values from
  46. /// [value] if it's a [Map], null otherwise.
  47. // ignore: prefer_constructors_over_static_methods
  48. static APIKeyResponseDto? fromJson(dynamic value) {
  49. if (value is Map) {
  50. final json = value.cast<String, dynamic>();
  51. return APIKeyResponseDto(
  52. createdAt: mapDateTime(json, r'createdAt', r'')!,
  53. id: mapValueOfType<String>(json, r'id')!,
  54. name: mapValueOfType<String>(json, r'name')!,
  55. updatedAt: mapDateTime(json, r'updatedAt', r'')!,
  56. );
  57. }
  58. return null;
  59. }
  60. static List<APIKeyResponseDto> listFromJson(dynamic json, {bool growable = false,}) {
  61. final result = <APIKeyResponseDto>[];
  62. if (json is List && json.isNotEmpty) {
  63. for (final row in json) {
  64. final value = APIKeyResponseDto.fromJson(row);
  65. if (value != null) {
  66. result.add(value);
  67. }
  68. }
  69. }
  70. return result.toList(growable: growable);
  71. }
  72. static Map<String, APIKeyResponseDto> mapFromJson(dynamic json) {
  73. final map = <String, APIKeyResponseDto>{};
  74. if (json is Map && json.isNotEmpty) {
  75. json = json.cast<String, dynamic>(); // ignore: parameter_assignments
  76. for (final entry in json.entries) {
  77. final value = APIKeyResponseDto.fromJson(entry.value);
  78. if (value != null) {
  79. map[entry.key] = value;
  80. }
  81. }
  82. }
  83. return map;
  84. }
  85. // maps a json object with a list of APIKeyResponseDto-objects as value to a dart map
  86. static Map<String, List<APIKeyResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
  87. final map = <String, List<APIKeyResponseDto>>{};
  88. if (json is Map && json.isNotEmpty) {
  89. // ignore: parameter_assignments
  90. json = json.cast<String, dynamic>();
  91. for (final entry in json.entries) {
  92. map[entry.key] = APIKeyResponseDto.listFromJson(entry.value, growable: growable,);
  93. }
  94. }
  95. return map;
  96. }
  97. /// The list of required keys that must be present in a JSON.
  98. static const requiredKeys = <String>{
  99. 'createdAt',
  100. 'id',
  101. 'name',
  102. 'updatedAt',
  103. };
  104. }