validate_access_token_response_dto.dart 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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 ValidateAccessTokenResponseDto {
  11. /// Returns a new [ValidateAccessTokenResponseDto] instance.
  12. ValidateAccessTokenResponseDto({
  13. required this.authStatus,
  14. });
  15. bool authStatus;
  16. @override
  17. bool operator ==(Object other) => identical(this, other) || other is ValidateAccessTokenResponseDto &&
  18. other.authStatus == authStatus;
  19. @override
  20. int get hashCode =>
  21. // ignore: unnecessary_parenthesis
  22. (authStatus.hashCode);
  23. @override
  24. String toString() => 'ValidateAccessTokenResponseDto[authStatus=$authStatus]';
  25. Map<String, dynamic> toJson() {
  26. final json = <String, dynamic>{};
  27. json[r'authStatus'] = this.authStatus;
  28. return json;
  29. }
  30. /// Returns a new [ValidateAccessTokenResponseDto] instance and imports its values from
  31. /// [value] if it's a [Map], null otherwise.
  32. // ignore: prefer_constructors_over_static_methods
  33. static ValidateAccessTokenResponseDto? fromJson(dynamic value) {
  34. if (value is Map) {
  35. final json = value.cast<String, dynamic>();
  36. // Ensure that the map contains the required keys.
  37. // Note 1: the values aren't checked for validity beyond being non-null.
  38. // Note 2: this code is stripped in release mode!
  39. assert(() {
  40. requiredKeys.forEach((key) {
  41. assert(json.containsKey(key), 'Required key "ValidateAccessTokenResponseDto[$key]" is missing from JSON.');
  42. assert(json[key] != null, 'Required key "ValidateAccessTokenResponseDto[$key]" has a null value in JSON.');
  43. });
  44. return true;
  45. }());
  46. return ValidateAccessTokenResponseDto(
  47. authStatus: mapValueOfType<bool>(json, r'authStatus')!,
  48. );
  49. }
  50. return null;
  51. }
  52. static List<ValidateAccessTokenResponseDto> listFromJson(dynamic json, {bool growable = false,}) {
  53. final result = <ValidateAccessTokenResponseDto>[];
  54. if (json is List && json.isNotEmpty) {
  55. for (final row in json) {
  56. final value = ValidateAccessTokenResponseDto.fromJson(row);
  57. if (value != null) {
  58. result.add(value);
  59. }
  60. }
  61. }
  62. return result.toList(growable: growable);
  63. }
  64. static Map<String, ValidateAccessTokenResponseDto> mapFromJson(dynamic json) {
  65. final map = <String, ValidateAccessTokenResponseDto>{};
  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 = ValidateAccessTokenResponseDto.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 ValidateAccessTokenResponseDto-objects as value to a dart map
  78. static Map<String, List<ValidateAccessTokenResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
  79. final map = <String, List<ValidateAccessTokenResponseDto>>{};
  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] = ValidateAccessTokenResponseDto.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. 'authStatus',
  92. };
  93. }