openapi-generator-cli -g dart-dio. Генерируется, но коммитится: CI ловит дрейф openapi/openapi.json, а приложение собирается без запуска генератора. Пересобирается через just gen-client после любого изменения роутов.
107 lines
1.7 KiB
Dart
107 lines
1.7 KiB
Dart
//
|
|
// 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<String, dynamic> json) => _$TokenPairFromJson(json);
|
|
|
|
Map<String, dynamic> toJson() => _$TokenPairToJson(this);
|
|
|
|
@override
|
|
String toString() {
|
|
return toJson().toString();
|
|
}
|
|
|
|
}
|
|
|