api_key_create_response_dto.dart 3.1 KB

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