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,120 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'transaction_page.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// CopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class _$TransactionPageCWProxy {
|
||||
TransactionPage items(List<TransactionOut> items);
|
||||
|
||||
TransactionPage page(int page);
|
||||
|
||||
TransactionPage pageSize(int pageSize);
|
||||
|
||||
TransactionPage total(int total);
|
||||
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `TransactionPage(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// TransactionPage(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
TransactionPage call({
|
||||
List<TransactionOut> items,
|
||||
int page,
|
||||
int pageSize,
|
||||
int total,
|
||||
});
|
||||
}
|
||||
|
||||
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfTransactionPage.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfTransactionPage.copyWith.fieldName(...)`
|
||||
class _$TransactionPageCWProxyImpl implements _$TransactionPageCWProxy {
|
||||
const _$TransactionPageCWProxyImpl(this._value);
|
||||
|
||||
final TransactionPage _value;
|
||||
|
||||
@override
|
||||
TransactionPage items(List<TransactionOut> items) => this(items: items);
|
||||
|
||||
@override
|
||||
TransactionPage page(int page) => this(page: page);
|
||||
|
||||
@override
|
||||
TransactionPage pageSize(int pageSize) => this(pageSize: pageSize);
|
||||
|
||||
@override
|
||||
TransactionPage total(int total) => this(total: total);
|
||||
|
||||
@override
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `TransactionPage(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// TransactionPage(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
TransactionPage call({
|
||||
Object? items = const $CopyWithPlaceholder(),
|
||||
Object? page = const $CopyWithPlaceholder(),
|
||||
Object? pageSize = const $CopyWithPlaceholder(),
|
||||
Object? total = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return TransactionPage(
|
||||
items: items == const $CopyWithPlaceholder()
|
||||
? _value.items
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: items as List<TransactionOut>,
|
||||
page: page == const $CopyWithPlaceholder()
|
||||
? _value.page
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: page as int,
|
||||
pageSize: pageSize == const $CopyWithPlaceholder()
|
||||
? _value.pageSize
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: pageSize as int,
|
||||
total: total == const $CopyWithPlaceholder()
|
||||
? _value.total
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: total as int,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension $TransactionPageCopyWith on TransactionPage {
|
||||
/// Returns a callable class that can be used as follows: `instanceOfTransactionPage.copyWith(...)` or like so:`instanceOfTransactionPage.copyWith.fieldName(...)`.
|
||||
// ignore: library_private_types_in_public_api
|
||||
_$TransactionPageCWProxy get copyWith => _$TransactionPageCWProxyImpl(this);
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
TransactionPage _$TransactionPageFromJson(Map<String, dynamic> json) =>
|
||||
$checkedCreate('TransactionPage', json, ($checkedConvert) {
|
||||
$checkKeys(
|
||||
json,
|
||||
requiredKeys: const ['items', 'page', 'page_size', 'total'],
|
||||
);
|
||||
final val = TransactionPage(
|
||||
items: $checkedConvert(
|
||||
'items',
|
||||
(v) => (v as List<dynamic>)
|
||||
.map((e) => TransactionOut.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
),
|
||||
page: $checkedConvert('page', (v) => (v as num).toInt()),
|
||||
pageSize: $checkedConvert('page_size', (v) => (v as num).toInt()),
|
||||
total: $checkedConvert('total', (v) => (v as num).toInt()),
|
||||
);
|
||||
return val;
|
||||
}, fieldKeyMap: const {'pageSize': 'page_size'});
|
||||
|
||||
Map<String, dynamic> _$TransactionPageToJson(TransactionPage instance) =>
|
||||
<String, dynamic>{
|
||||
'items': instance.items.map((e) => e.toJson()).toList(),
|
||||
'page': instance.page,
|
||||
'page_size': instance.pageSize,
|
||||
'total': instance.total,
|
||||
};
|
||||
Reference in New Issue
Block a user