// // AUTO-GENERATED FILE, DO NOT MODIFY! // // ignore_for_file: unused_element import 'package:copy_with_extension/copy_with_extension.dart'; import 'package:json_annotation/json_annotation.dart'; part 'token_pair.g.dart'; @CopyWith() @JsonSerializable( checked: true, createToJson: true, disallowUnrecognizedKeys: false, explicitToJson: true, ) class TokenPair { /// Returns a new [TokenPair] instance. TokenPair({ required this.accessToken, required this.expiresIn, required this.refreshToken, this.tokenType = 'bearer', }); @JsonKey( name: r'access_token', required: true, includeIfNull: false, ) final String accessToken; @JsonKey( name: r'expires_in', required: true, includeIfNull: false, ) final int expiresIn; @JsonKey( name: r'refresh_token', required: true, includeIfNull: false, ) final String refreshToken; @JsonKey( defaultValue: 'bearer', name: r'token_type', required: false, includeIfNull: false, ) final String? tokenType; @override bool operator ==(Object other) => identical(this, other) || other is TokenPair && other.accessToken == accessToken && other.expiresIn == expiresIn && other.refreshToken == refreshToken && other.tokenType == tokenType; @override int get hashCode => accessToken.hashCode + expiresIn.hashCode + refreshToken.hashCode + tokenType.hashCode; factory TokenPair.fromJson(Map json) => _$TokenPairFromJson(json); Map toJson() => _$TokenPairToJson(this); @override String toString() { return toJson().toString(); } }