chore(app): сгенерированный Dart-клиент из OpenAPI
openapi-generator-cli -g dart-dio. Генерируется, но коммитится: CI ловит дрейф openapi/openapi.json, а приложение собирается без запуска генератора. Пересобирается через just gen-client после любого изменения роутов.
This commit is contained in:
@@ -0,0 +1,137 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'runway_out.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// CopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class _$RunwayOutCWProxy {
|
||||
RunwayOut asOf(DateTime asOf);
|
||||
|
||||
RunwayOut avgBaseline3mRub(String avgBaseline3mRub);
|
||||
|
||||
RunwayOut liquidReserveRub(String liquidReserveRub);
|
||||
|
||||
RunwayOut runwayMonths(String? runwayMonths);
|
||||
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `RunwayOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// RunwayOut(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
RunwayOut call({
|
||||
DateTime asOf,
|
||||
String avgBaseline3mRub,
|
||||
String liquidReserveRub,
|
||||
String? runwayMonths,
|
||||
});
|
||||
}
|
||||
|
||||
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfRunwayOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfRunwayOut.copyWith.fieldName(...)`
|
||||
class _$RunwayOutCWProxyImpl implements _$RunwayOutCWProxy {
|
||||
const _$RunwayOutCWProxyImpl(this._value);
|
||||
|
||||
final RunwayOut _value;
|
||||
|
||||
@override
|
||||
RunwayOut asOf(DateTime asOf) => this(asOf: asOf);
|
||||
|
||||
@override
|
||||
RunwayOut avgBaseline3mRub(String avgBaseline3mRub) =>
|
||||
this(avgBaseline3mRub: avgBaseline3mRub);
|
||||
|
||||
@override
|
||||
RunwayOut liquidReserveRub(String liquidReserveRub) =>
|
||||
this(liquidReserveRub: liquidReserveRub);
|
||||
|
||||
@override
|
||||
RunwayOut runwayMonths(String? runwayMonths) =>
|
||||
this(runwayMonths: runwayMonths);
|
||||
|
||||
@override
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `RunwayOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// RunwayOut(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
RunwayOut call({
|
||||
Object? asOf = const $CopyWithPlaceholder(),
|
||||
Object? avgBaseline3mRub = const $CopyWithPlaceholder(),
|
||||
Object? liquidReserveRub = const $CopyWithPlaceholder(),
|
||||
Object? runwayMonths = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return RunwayOut(
|
||||
asOf: asOf == const $CopyWithPlaceholder()
|
||||
? _value.asOf
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: asOf as DateTime,
|
||||
avgBaseline3mRub: avgBaseline3mRub == const $CopyWithPlaceholder()
|
||||
? _value.avgBaseline3mRub
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: avgBaseline3mRub as String,
|
||||
liquidReserveRub: liquidReserveRub == const $CopyWithPlaceholder()
|
||||
? _value.liquidReserveRub
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: liquidReserveRub as String,
|
||||
runwayMonths: runwayMonths == const $CopyWithPlaceholder()
|
||||
? _value.runwayMonths
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: runwayMonths as String?,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension $RunwayOutCopyWith on RunwayOut {
|
||||
/// Returns a callable class that can be used as follows: `instanceOfRunwayOut.copyWith(...)` or like so:`instanceOfRunwayOut.copyWith.fieldName(...)`.
|
||||
// ignore: library_private_types_in_public_api
|
||||
_$RunwayOutCWProxy get copyWith => _$RunwayOutCWProxyImpl(this);
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
RunwayOut _$RunwayOutFromJson(Map<String, dynamic> json) => $checkedCreate(
|
||||
'RunwayOut',
|
||||
json,
|
||||
($checkedConvert) {
|
||||
$checkKeys(
|
||||
json,
|
||||
requiredKeys: const [
|
||||
'as_of',
|
||||
'avg_baseline_3m_rub',
|
||||
'liquid_reserve_rub',
|
||||
'runway_months',
|
||||
],
|
||||
);
|
||||
final val = RunwayOut(
|
||||
asOf: $checkedConvert('as_of', (v) => DateTime.parse(v as String)),
|
||||
avgBaseline3mRub: $checkedConvert(
|
||||
'avg_baseline_3m_rub',
|
||||
(v) => v as String,
|
||||
),
|
||||
liquidReserveRub: $checkedConvert(
|
||||
'liquid_reserve_rub',
|
||||
(v) => v as String,
|
||||
),
|
||||
runwayMonths: $checkedConvert('runway_months', (v) => v as String?),
|
||||
);
|
||||
return val;
|
||||
},
|
||||
fieldKeyMap: const {
|
||||
'asOf': 'as_of',
|
||||
'avgBaseline3mRub': 'avg_baseline_3m_rub',
|
||||
'liquidReserveRub': 'liquid_reserve_rub',
|
||||
'runwayMonths': 'runway_months',
|
||||
},
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$RunwayOutToJson(RunwayOut instance) => <String, dynamic>{
|
||||
'as_of': instance.asOf.toIso8601String(),
|
||||
'avg_baseline_3m_rub': instance.avgBaseline3mRub,
|
||||
'liquid_reserve_rub': instance.liquidReserveRub,
|
||||
'runway_months': instance.runwayMonths,
|
||||
};
|
||||
Reference in New Issue
Block a user