tstor/ui/lib/api/torrent.graphql.dart

1324 lines
39 KiB
Dart
Raw Normal View History

2024-04-24 17:36:33 +00:00
import 'dart:async';
import 'package:flutter/widgets.dart' as widgets;
import 'package:gql/ast.dart';
import 'package:graphql/client.dart' as graphql;
import 'package:graphql_flutter/graphql_flutter.dart' as graphql_flutter;
class Variables$Mutation$MarkTorrentDownload {
factory Variables$Mutation$MarkTorrentDownload({required String infohash}) =>
Variables$Mutation$MarkTorrentDownload._({
r'infohash': infohash,
});
Variables$Mutation$MarkTorrentDownload._(this._$data);
factory Variables$Mutation$MarkTorrentDownload.fromJson(
Map<String, dynamic> data) {
final result$data = <String, dynamic>{};
final l$infohash = data['infohash'];
result$data['infohash'] = (l$infohash as String);
return Variables$Mutation$MarkTorrentDownload._(result$data);
}
Map<String, dynamic> _$data;
String get infohash => (_$data['infohash'] as String);
Map<String, dynamic> toJson() {
final result$data = <String, dynamic>{};
final l$infohash = infohash;
result$data['infohash'] = l$infohash;
return result$data;
}
CopyWith$Variables$Mutation$MarkTorrentDownload<
Variables$Mutation$MarkTorrentDownload>
get copyWith => CopyWith$Variables$Mutation$MarkTorrentDownload(
this,
(i) => i,
);
@override
bool operator ==(Object other) {
if (identical(this, other)) {
return true;
}
if (other is! Variables$Mutation$MarkTorrentDownload ||
runtimeType != other.runtimeType) {
return false;
}
final l$infohash = infohash;
final lOther$infohash = other.infohash;
if (l$infohash != lOther$infohash) {
return false;
}
return true;
}
@override
int get hashCode {
final l$infohash = infohash;
return Object.hashAll([l$infohash]);
}
}
abstract class CopyWith$Variables$Mutation$MarkTorrentDownload<TRes> {
factory CopyWith$Variables$Mutation$MarkTorrentDownload(
Variables$Mutation$MarkTorrentDownload instance,
TRes Function(Variables$Mutation$MarkTorrentDownload) then,
) = _CopyWithImpl$Variables$Mutation$MarkTorrentDownload;
factory CopyWith$Variables$Mutation$MarkTorrentDownload.stub(TRes res) =
_CopyWithStubImpl$Variables$Mutation$MarkTorrentDownload;
TRes call({String? infohash});
}
class _CopyWithImpl$Variables$Mutation$MarkTorrentDownload<TRes>
implements CopyWith$Variables$Mutation$MarkTorrentDownload<TRes> {
_CopyWithImpl$Variables$Mutation$MarkTorrentDownload(
this._instance,
this._then,
);
final Variables$Mutation$MarkTorrentDownload _instance;
final TRes Function(Variables$Mutation$MarkTorrentDownload) _then;
static const _undefined = <dynamic, dynamic>{};
@override
TRes call({Object? infohash = _undefined}) =>
_then(Variables$Mutation$MarkTorrentDownload._({
..._instance._$data,
if (infohash != _undefined && infohash != null)
'infohash': (infohash as String),
}));
}
class _CopyWithStubImpl$Variables$Mutation$MarkTorrentDownload<TRes>
implements CopyWith$Variables$Mutation$MarkTorrentDownload<TRes> {
_CopyWithStubImpl$Variables$Mutation$MarkTorrentDownload(this._res);
final TRes _res;
@override
call({String? infohash}) => _res;
}
class Mutation$MarkTorrentDownload {
Mutation$MarkTorrentDownload({
this.downloadTorrent,
this.$__typename = 'Mutation',
});
factory Mutation$MarkTorrentDownload.fromJson(Map<String, dynamic> json) {
final l$downloadTorrent = json['downloadTorrent'];
final l$$__typename = json['__typename'];
return Mutation$MarkTorrentDownload(
downloadTorrent: l$downloadTorrent == null
? null
: Mutation$MarkTorrentDownload$downloadTorrent.fromJson(
(l$downloadTorrent as Map<String, dynamic>)),
$__typename: (l$$__typename as String),
);
}
final Mutation$MarkTorrentDownload$downloadTorrent? downloadTorrent;
final String $__typename;
Map<String, dynamic> toJson() {
final resultData = <String, dynamic>{};
final l$downloadTorrent = downloadTorrent;
resultData['downloadTorrent'] = l$downloadTorrent?.toJson();
final l$$__typename = $__typename;
resultData['__typename'] = l$$__typename;
return resultData;
}
@override
int get hashCode {
final l$downloadTorrent = downloadTorrent;
final l$$__typename = $__typename;
return Object.hashAll([
l$downloadTorrent,
l$$__typename,
]);
}
@override
bool operator ==(Object other) {
if (identical(this, other)) {
return true;
}
if (other is! Mutation$MarkTorrentDownload ||
runtimeType != other.runtimeType) {
return false;
}
final l$downloadTorrent = downloadTorrent;
final lOther$downloadTorrent = other.downloadTorrent;
if (l$downloadTorrent != lOther$downloadTorrent) {
return false;
}
final l$$__typename = $__typename;
final lOther$$__typename = other.$__typename;
if (l$$__typename != lOther$$__typename) {
return false;
}
return true;
}
}
extension UtilityExtension$Mutation$MarkTorrentDownload
on Mutation$MarkTorrentDownload {
CopyWith$Mutation$MarkTorrentDownload<Mutation$MarkTorrentDownload>
get copyWith => CopyWith$Mutation$MarkTorrentDownload(
this,
(i) => i,
);
}
abstract class CopyWith$Mutation$MarkTorrentDownload<TRes> {
factory CopyWith$Mutation$MarkTorrentDownload(
Mutation$MarkTorrentDownload instance,
TRes Function(Mutation$MarkTorrentDownload) then,
) = _CopyWithImpl$Mutation$MarkTorrentDownload;
factory CopyWith$Mutation$MarkTorrentDownload.stub(TRes res) =
_CopyWithStubImpl$Mutation$MarkTorrentDownload;
TRes call({
Mutation$MarkTorrentDownload$downloadTorrent? downloadTorrent,
String? $__typename,
});
CopyWith$Mutation$MarkTorrentDownload$downloadTorrent<TRes>
get downloadTorrent;
}
class _CopyWithImpl$Mutation$MarkTorrentDownload<TRes>
implements CopyWith$Mutation$MarkTorrentDownload<TRes> {
_CopyWithImpl$Mutation$MarkTorrentDownload(
this._instance,
this._then,
);
final Mutation$MarkTorrentDownload _instance;
final TRes Function(Mutation$MarkTorrentDownload) _then;
static const _undefined = <dynamic, dynamic>{};
@override
TRes call({
Object? downloadTorrent = _undefined,
Object? $__typename = _undefined,
}) =>
_then(Mutation$MarkTorrentDownload(
downloadTorrent: downloadTorrent == _undefined
? _instance.downloadTorrent
: (downloadTorrent
as Mutation$MarkTorrentDownload$downloadTorrent?),
$__typename: $__typename == _undefined || $__typename == null
? _instance.$__typename
: ($__typename as String),
));
@override
CopyWith$Mutation$MarkTorrentDownload$downloadTorrent<TRes>
get downloadTorrent {
final local$downloadTorrent = _instance.downloadTorrent;
return local$downloadTorrent == null
? CopyWith$Mutation$MarkTorrentDownload$downloadTorrent.stub(
_then(_instance))
: CopyWith$Mutation$MarkTorrentDownload$downloadTorrent(
local$downloadTorrent, (e) => call(downloadTorrent: e));
}
}
class _CopyWithStubImpl$Mutation$MarkTorrentDownload<TRes>
implements CopyWith$Mutation$MarkTorrentDownload<TRes> {
_CopyWithStubImpl$Mutation$MarkTorrentDownload(this._res);
final TRes _res;
@override
call({
Mutation$MarkTorrentDownload$downloadTorrent? downloadTorrent,
String? $__typename,
}) =>
_res;
@override
CopyWith$Mutation$MarkTorrentDownload$downloadTorrent<TRes>
get downloadTorrent =>
CopyWith$Mutation$MarkTorrentDownload$downloadTorrent.stub(_res);
}
const documentNodeMutationMarkTorrentDownload = DocumentNode(definitions: [
OperationDefinitionNode(
type: OperationType.mutation,
name: NameNode(value: 'MarkTorrentDownload'),
variableDefinitions: [
VariableDefinitionNode(
variable: VariableNode(name: NameNode(value: 'infohash')),
type: NamedTypeNode(
name: NameNode(value: 'String'),
isNonNull: true,
),
defaultValue: DefaultValueNode(value: null),
directives: [],
)
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'downloadTorrent'),
alias: null,
arguments: [
ArgumentNode(
name: NameNode(value: 'infohash'),
value: VariableNode(name: NameNode(value: 'infohash')),
)
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'task'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: '__typename'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
FieldNode(
name: NameNode(value: '__typename'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
FieldNode(
name: NameNode(value: '__typename'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
]);
Mutation$MarkTorrentDownload _parserFn$Mutation$MarkTorrentDownload(
Map<String, dynamic> data) =>
Mutation$MarkTorrentDownload.fromJson(data);
typedef OnMutationCompleted$Mutation$MarkTorrentDownload = FutureOr<void>
Function(
Map<String, dynamic>?,
Mutation$MarkTorrentDownload?,
);
class Options$Mutation$MarkTorrentDownload
extends graphql.MutationOptions<Mutation$MarkTorrentDownload> {
Options$Mutation$MarkTorrentDownload({
super.operationName,
required Variables$Mutation$MarkTorrentDownload variables,
super.fetchPolicy,
super.errorPolicy,
super.cacheRereadPolicy,
Object? optimisticResult,
Mutation$MarkTorrentDownload? typedOptimisticResult,
super.context,
OnMutationCompleted$Mutation$MarkTorrentDownload? onCompleted,
super.update,
super.onError,
}) : onCompletedWithParsed = onCompleted,
super(
variables: variables.toJson(),
optimisticResult: optimisticResult ?? typedOptimisticResult?.toJson(),
onCompleted: onCompleted == null
? null
: (data) => onCompleted(
data,
data == null
? null
: _parserFn$Mutation$MarkTorrentDownload(data),
),
document: documentNodeMutationMarkTorrentDownload,
parserFn: _parserFn$Mutation$MarkTorrentDownload,
);
final OnMutationCompleted$Mutation$MarkTorrentDownload? onCompletedWithParsed;
@override
List<Object?> get properties => [
...super.onCompleted == null
? super.properties
: super.properties.where((property) => property != onCompleted),
onCompletedWithParsed,
];
}
class WatchOptions$Mutation$MarkTorrentDownload
extends graphql.WatchQueryOptions<Mutation$MarkTorrentDownload> {
WatchOptions$Mutation$MarkTorrentDownload({
super.operationName,
required Variables$Mutation$MarkTorrentDownload variables,
super.fetchPolicy,
super.errorPolicy,
super.cacheRereadPolicy,
Object? optimisticResult,
Mutation$MarkTorrentDownload? typedOptimisticResult,
super.context,
super.pollInterval,
super.eagerlyFetchResults,
super.carryForwardDataOnException,
super.fetchResults,
}) : super(
variables: variables.toJson(),
optimisticResult: optimisticResult ?? typedOptimisticResult?.toJson(),
document: documentNodeMutationMarkTorrentDownload,
parserFn: _parserFn$Mutation$MarkTorrentDownload,
);
}
extension ClientExtension$Mutation$MarkTorrentDownload
on graphql.GraphQLClient {
Future<graphql.QueryResult<Mutation$MarkTorrentDownload>>
mutate$MarkTorrentDownload(
Options$Mutation$MarkTorrentDownload options) async =>
await mutate(options);
graphql.ObservableQuery<Mutation$MarkTorrentDownload>
watchMutation$MarkTorrentDownload(
WatchOptions$Mutation$MarkTorrentDownload options) =>
watchMutation(options);
}
class Mutation$MarkTorrentDownload$HookResult {
Mutation$MarkTorrentDownload$HookResult(
this.runMutation,
this.result,
);
final RunMutation$Mutation$MarkTorrentDownload runMutation;
final graphql.QueryResult<Mutation$MarkTorrentDownload> result;
}
Mutation$MarkTorrentDownload$HookResult useMutation$MarkTorrentDownload(
[WidgetOptions$Mutation$MarkTorrentDownload? options]) {
final result = graphql_flutter
.useMutation(options ?? WidgetOptions$Mutation$MarkTorrentDownload());
return Mutation$MarkTorrentDownload$HookResult(
(variables, {optimisticResult, typedOptimisticResult}) =>
result.runMutation(
variables.toJson(),
optimisticResult: optimisticResult ?? typedOptimisticResult?.toJson(),
),
result.result,
);
}
graphql.ObservableQuery<Mutation$MarkTorrentDownload>
useWatchMutation$MarkTorrentDownload(
WatchOptions$Mutation$MarkTorrentDownload options) =>
graphql_flutter.useWatchMutation(options);
class WidgetOptions$Mutation$MarkTorrentDownload
extends graphql.MutationOptions<Mutation$MarkTorrentDownload> {
WidgetOptions$Mutation$MarkTorrentDownload({
super.operationName,
super.fetchPolicy,
super.errorPolicy,
super.cacheRereadPolicy,
Object? optimisticResult,
Mutation$MarkTorrentDownload? typedOptimisticResult,
super.context,
OnMutationCompleted$Mutation$MarkTorrentDownload? onCompleted,
super.update,
super.onError,
}) : onCompletedWithParsed = onCompleted,
super(
optimisticResult: optimisticResult ?? typedOptimisticResult?.toJson(),
onCompleted: onCompleted == null
? null
: (data) => onCompleted(
data,
data == null
? null
: _parserFn$Mutation$MarkTorrentDownload(data),
),
document: documentNodeMutationMarkTorrentDownload,
parserFn: _parserFn$Mutation$MarkTorrentDownload,
);
final OnMutationCompleted$Mutation$MarkTorrentDownload? onCompletedWithParsed;
@override
List<Object?> get properties => [
...super.onCompleted == null
? super.properties
: super.properties.where((property) => property != onCompleted),
onCompletedWithParsed,
];
}
typedef RunMutation$Mutation$MarkTorrentDownload
= graphql.MultiSourceResult<Mutation$MarkTorrentDownload> Function(
Variables$Mutation$MarkTorrentDownload, {
Object? optimisticResult,
Mutation$MarkTorrentDownload? typedOptimisticResult,
});
typedef Builder$Mutation$MarkTorrentDownload = widgets.Widget Function(
RunMutation$Mutation$MarkTorrentDownload,
graphql.QueryResult<Mutation$MarkTorrentDownload>?,
);
class Mutation$MarkTorrentDownload$Widget
extends graphql_flutter.Mutation<Mutation$MarkTorrentDownload> {
Mutation$MarkTorrentDownload$Widget({
super.key,
WidgetOptions$Mutation$MarkTorrentDownload? options,
required Builder$Mutation$MarkTorrentDownload builder,
}) : super(
options: options ?? WidgetOptions$Mutation$MarkTorrentDownload(),
builder: (
run,
result,
) =>
builder(
(
variables, {
optimisticResult,
typedOptimisticResult,
}) =>
run(
variables.toJson(),
optimisticResult:
optimisticResult ?? typedOptimisticResult?.toJson(),
),
result,
),
);
}
class Mutation$MarkTorrentDownload$downloadTorrent {
Mutation$MarkTorrentDownload$downloadTorrent({
this.task,
this.$__typename = 'DownloadTorrentResponse',
});
factory Mutation$MarkTorrentDownload$downloadTorrent.fromJson(
Map<String, dynamic> json) {
final l$task = json['task'];
final l$$__typename = json['__typename'];
return Mutation$MarkTorrentDownload$downloadTorrent(
task: l$task == null
? null
: Mutation$MarkTorrentDownload$downloadTorrent$task.fromJson(
(l$task as Map<String, dynamic>)),
$__typename: (l$$__typename as String),
);
}
final Mutation$MarkTorrentDownload$downloadTorrent$task? task;
final String $__typename;
Map<String, dynamic> toJson() {
final resultData = <String, dynamic>{};
final l$task = task;
resultData['task'] = l$task?.toJson();
final l$$__typename = $__typename;
resultData['__typename'] = l$$__typename;
return resultData;
}
@override
int get hashCode {
final l$task = task;
final l$$__typename = $__typename;
return Object.hashAll([
l$task,
l$$__typename,
]);
}
@override
bool operator ==(Object other) {
if (identical(this, other)) {
return true;
}
if (other is! Mutation$MarkTorrentDownload$downloadTorrent ||
runtimeType != other.runtimeType) {
return false;
}
final l$task = task;
final lOther$task = other.task;
if (l$task != lOther$task) {
return false;
}
final l$$__typename = $__typename;
final lOther$$__typename = other.$__typename;
if (l$$__typename != lOther$$__typename) {
return false;
}
return true;
}
}
extension UtilityExtension$Mutation$MarkTorrentDownload$downloadTorrent
on Mutation$MarkTorrentDownload$downloadTorrent {
CopyWith$Mutation$MarkTorrentDownload$downloadTorrent<
Mutation$MarkTorrentDownload$downloadTorrent>
get copyWith => CopyWith$Mutation$MarkTorrentDownload$downloadTorrent(
this,
(i) => i,
);
}
abstract class CopyWith$Mutation$MarkTorrentDownload$downloadTorrent<TRes> {
factory CopyWith$Mutation$MarkTorrentDownload$downloadTorrent(
Mutation$MarkTorrentDownload$downloadTorrent instance,
TRes Function(Mutation$MarkTorrentDownload$downloadTorrent) then,
) = _CopyWithImpl$Mutation$MarkTorrentDownload$downloadTorrent;
factory CopyWith$Mutation$MarkTorrentDownload$downloadTorrent.stub(TRes res) =
_CopyWithStubImpl$Mutation$MarkTorrentDownload$downloadTorrent;
TRes call({
Mutation$MarkTorrentDownload$downloadTorrent$task? task,
String? $__typename,
});
CopyWith$Mutation$MarkTorrentDownload$downloadTorrent$task<TRes> get task;
}
class _CopyWithImpl$Mutation$MarkTorrentDownload$downloadTorrent<TRes>
implements CopyWith$Mutation$MarkTorrentDownload$downloadTorrent<TRes> {
_CopyWithImpl$Mutation$MarkTorrentDownload$downloadTorrent(
this._instance,
this._then,
);
final Mutation$MarkTorrentDownload$downloadTorrent _instance;
final TRes Function(Mutation$MarkTorrentDownload$downloadTorrent) _then;
static const _undefined = <dynamic, dynamic>{};
@override
TRes call({
Object? task = _undefined,
Object? $__typename = _undefined,
}) =>
_then(Mutation$MarkTorrentDownload$downloadTorrent(
task: task == _undefined
? _instance.task
: (task as Mutation$MarkTorrentDownload$downloadTorrent$task?),
$__typename: $__typename == _undefined || $__typename == null
? _instance.$__typename
: ($__typename as String),
));
@override
CopyWith$Mutation$MarkTorrentDownload$downloadTorrent$task<TRes> get task {
final local$task = _instance.task;
return local$task == null
? CopyWith$Mutation$MarkTorrentDownload$downloadTorrent$task.stub(
_then(_instance))
: CopyWith$Mutation$MarkTorrentDownload$downloadTorrent$task(
local$task, (e) => call(task: e));
}
}
class _CopyWithStubImpl$Mutation$MarkTorrentDownload$downloadTorrent<TRes>
implements CopyWith$Mutation$MarkTorrentDownload$downloadTorrent<TRes> {
_CopyWithStubImpl$Mutation$MarkTorrentDownload$downloadTorrent(this._res);
final TRes _res;
@override
call({
Mutation$MarkTorrentDownload$downloadTorrent$task? task,
String? $__typename,
}) =>
_res;
@override
CopyWith$Mutation$MarkTorrentDownload$downloadTorrent$task<TRes> get task =>
CopyWith$Mutation$MarkTorrentDownload$downloadTorrent$task.stub(_res);
}
class Mutation$MarkTorrentDownload$downloadTorrent$task {
Mutation$MarkTorrentDownload$downloadTorrent$task({
required this.id,
this.$__typename = 'Task',
});
factory Mutation$MarkTorrentDownload$downloadTorrent$task.fromJson(
Map<String, dynamic> json) {
final l$id = json['id'];
final l$$__typename = json['__typename'];
return Mutation$MarkTorrentDownload$downloadTorrent$task(
id: (l$id as String),
$__typename: (l$$__typename as String),
);
}
final String id;
final String $__typename;
Map<String, dynamic> toJson() {
final resultData = <String, dynamic>{};
final l$id = id;
resultData['id'] = l$id;
final l$$__typename = $__typename;
resultData['__typename'] = l$$__typename;
return resultData;
}
@override
int get hashCode {
final l$id = id;
final l$$__typename = $__typename;
return Object.hashAll([
l$id,
l$$__typename,
]);
}
@override
bool operator ==(Object other) {
if (identical(this, other)) {
return true;
}
if (other is! Mutation$MarkTorrentDownload$downloadTorrent$task ||
runtimeType != other.runtimeType) {
return false;
}
final l$id = id;
final lOther$id = other.id;
if (l$id != lOther$id) {
return false;
}
final l$$__typename = $__typename;
final lOther$$__typename = other.$__typename;
if (l$$__typename != lOther$$__typename) {
return false;
}
return true;
}
}
extension UtilityExtension$Mutation$MarkTorrentDownload$downloadTorrent$task
on Mutation$MarkTorrentDownload$downloadTorrent$task {
CopyWith$Mutation$MarkTorrentDownload$downloadTorrent$task<
Mutation$MarkTorrentDownload$downloadTorrent$task>
get copyWith =>
CopyWith$Mutation$MarkTorrentDownload$downloadTorrent$task(
this,
(i) => i,
);
}
abstract class CopyWith$Mutation$MarkTorrentDownload$downloadTorrent$task<
TRes> {
factory CopyWith$Mutation$MarkTorrentDownload$downloadTorrent$task(
Mutation$MarkTorrentDownload$downloadTorrent$task instance,
TRes Function(Mutation$MarkTorrentDownload$downloadTorrent$task) then,
) = _CopyWithImpl$Mutation$MarkTorrentDownload$downloadTorrent$task;
factory CopyWith$Mutation$MarkTorrentDownload$downloadTorrent$task.stub(
TRes res) =
_CopyWithStubImpl$Mutation$MarkTorrentDownload$downloadTorrent$task;
TRes call({
String? id,
String? $__typename,
});
}
class _CopyWithImpl$Mutation$MarkTorrentDownload$downloadTorrent$task<TRes>
implements
CopyWith$Mutation$MarkTorrentDownload$downloadTorrent$task<TRes> {
_CopyWithImpl$Mutation$MarkTorrentDownload$downloadTorrent$task(
this._instance,
this._then,
);
final Mutation$MarkTorrentDownload$downloadTorrent$task _instance;
final TRes Function(Mutation$MarkTorrentDownload$downloadTorrent$task) _then;
static const _undefined = <dynamic, dynamic>{};
@override
TRes call({
Object? id = _undefined,
Object? $__typename = _undefined,
}) =>
_then(Mutation$MarkTorrentDownload$downloadTorrent$task(
id: id == _undefined || id == null ? _instance.id : (id as String),
$__typename: $__typename == _undefined || $__typename == null
? _instance.$__typename
: ($__typename as String),
));
}
class _CopyWithStubImpl$Mutation$MarkTorrentDownload$downloadTorrent$task<TRes>
implements
CopyWith$Mutation$MarkTorrentDownload$downloadTorrent$task<TRes> {
_CopyWithStubImpl$Mutation$MarkTorrentDownload$downloadTorrent$task(
this._res);
final TRes _res;
@override
call({
String? id,
String? $__typename,
}) =>
_res;
}
class Query$ListTorrents {
Query$ListTorrents({
required this.torrents,
this.$__typename = 'Query',
});
factory Query$ListTorrents.fromJson(Map<String, dynamic> json) {
final l$torrents = json['torrents'];
final l$$__typename = json['__typename'];
return Query$ListTorrents(
torrents: (l$torrents as List<dynamic>)
.map((e) =>
Query$ListTorrents$torrents.fromJson((e as Map<String, dynamic>)))
.toList(),
$__typename: (l$$__typename as String),
);
}
final List<Query$ListTorrents$torrents> torrents;
final String $__typename;
Map<String, dynamic> toJson() {
final resultData = <String, dynamic>{};
final l$torrents = torrents;
resultData['torrents'] = l$torrents.map((e) => e.toJson()).toList();
final l$$__typename = $__typename;
resultData['__typename'] = l$$__typename;
return resultData;
}
@override
int get hashCode {
final l$torrents = torrents;
final l$$__typename = $__typename;
return Object.hashAll([
Object.hashAll(l$torrents.map((v) => v)),
l$$__typename,
]);
}
@override
bool operator ==(Object other) {
if (identical(this, other)) {
return true;
}
if (other is! Query$ListTorrents || runtimeType != other.runtimeType) {
return false;
}
final l$torrents = torrents;
final lOther$torrents = other.torrents;
if (l$torrents.length != lOther$torrents.length) {
return false;
}
for (int i = 0; i < l$torrents.length; i++) {
final l$torrents$entry = l$torrents[i];
final lOther$torrents$entry = lOther$torrents[i];
if (l$torrents$entry != lOther$torrents$entry) {
return false;
}
}
final l$$__typename = $__typename;
final lOther$$__typename = other.$__typename;
if (l$$__typename != lOther$$__typename) {
return false;
}
return true;
}
}
extension UtilityExtension$Query$ListTorrents on Query$ListTorrents {
CopyWith$Query$ListTorrents<Query$ListTorrents> get copyWith =>
CopyWith$Query$ListTorrents(
this,
(i) => i,
);
}
abstract class CopyWith$Query$ListTorrents<TRes> {
factory CopyWith$Query$ListTorrents(
Query$ListTorrents instance,
TRes Function(Query$ListTorrents) then,
) = _CopyWithImpl$Query$ListTorrents;
factory CopyWith$Query$ListTorrents.stub(TRes res) =
_CopyWithStubImpl$Query$ListTorrents;
TRes call({
List<Query$ListTorrents$torrents>? torrents,
String? $__typename,
});
TRes torrents(
Iterable<Query$ListTorrents$torrents> Function(
Iterable<
CopyWith$Query$ListTorrents$torrents<
Query$ListTorrents$torrents>>)
fn);
}
class _CopyWithImpl$Query$ListTorrents<TRes>
implements CopyWith$Query$ListTorrents<TRes> {
_CopyWithImpl$Query$ListTorrents(
this._instance,
this._then,
);
final Query$ListTorrents _instance;
final TRes Function(Query$ListTorrents) _then;
static const _undefined = <dynamic, dynamic>{};
@override
TRes call({
Object? torrents = _undefined,
Object? $__typename = _undefined,
}) =>
_then(Query$ListTorrents(
torrents: torrents == _undefined || torrents == null
? _instance.torrents
: (torrents as List<Query$ListTorrents$torrents>),
$__typename: $__typename == _undefined || $__typename == null
? _instance.$__typename
: ($__typename as String),
));
@override
TRes torrents(
Iterable<Query$ListTorrents$torrents> Function(
Iterable<
CopyWith$Query$ListTorrents$torrents<
Query$ListTorrents$torrents>>)
fn) =>
call(
torrents: fn(_instance.torrents
.map((e) => CopyWith$Query$ListTorrents$torrents(
e,
(i) => i,
))).toList());
}
class _CopyWithStubImpl$Query$ListTorrents<TRes>
implements CopyWith$Query$ListTorrents<TRes> {
_CopyWithStubImpl$Query$ListTorrents(this._res);
final TRes _res;
@override
call({
List<Query$ListTorrents$torrents>? torrents,
String? $__typename,
}) =>
_res;
@override
torrents(fn) => _res;
}
const documentNodeQueryListTorrents = DocumentNode(definitions: [
OperationDefinitionNode(
type: OperationType.query,
name: NameNode(value: 'ListTorrents'),
variableDefinitions: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'torrents'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'name'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'infohash'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'bytesCompleted'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'bytesMissing'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: '__typename'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
FieldNode(
name: NameNode(value: '__typename'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
]);
Query$ListTorrents _parserFn$Query$ListTorrents(Map<String, dynamic> data) =>
Query$ListTorrents.fromJson(data);
typedef OnQueryComplete$Query$ListTorrents = FutureOr<void> Function(
Map<String, dynamic>?,
Query$ListTorrents?,
);
class Options$Query$ListTorrents
extends graphql.QueryOptions<Query$ListTorrents> {
Options$Query$ListTorrents({
super.operationName,
super.fetchPolicy,
super.errorPolicy,
super.cacheRereadPolicy,
Object? optimisticResult,
Query$ListTorrents? typedOptimisticResult,
super.pollInterval,
super.context,
OnQueryComplete$Query$ListTorrents? onComplete,
super.onError,
}) : onCompleteWithParsed = onComplete,
super(
optimisticResult: optimisticResult ?? typedOptimisticResult?.toJson(),
onComplete: onComplete == null
? null
: (data) => onComplete(
data,
data == null ? null : _parserFn$Query$ListTorrents(data),
),
document: documentNodeQueryListTorrents,
parserFn: _parserFn$Query$ListTorrents,
);
final OnQueryComplete$Query$ListTorrents? onCompleteWithParsed;
@override
List<Object?> get properties => [
...super.onComplete == null
? super.properties
: super.properties.where((property) => property != onComplete),
onCompleteWithParsed,
];
}
class WatchOptions$Query$ListTorrents
extends graphql.WatchQueryOptions<Query$ListTorrents> {
WatchOptions$Query$ListTorrents({
super.operationName,
super.fetchPolicy,
super.errorPolicy,
super.cacheRereadPolicy,
Object? optimisticResult,
Query$ListTorrents? typedOptimisticResult,
super.context,
super.pollInterval,
super.eagerlyFetchResults,
super.carryForwardDataOnException,
super.fetchResults,
}) : super(
optimisticResult: optimisticResult ?? typedOptimisticResult?.toJson(),
document: documentNodeQueryListTorrents,
parserFn: _parserFn$Query$ListTorrents,
);
}
class FetchMoreOptions$Query$ListTorrents extends graphql.FetchMoreOptions {
FetchMoreOptions$Query$ListTorrents(
{required super.updateQuery})
: super(
document: documentNodeQueryListTorrents,
);
}
extension ClientExtension$Query$ListTorrents on graphql.GraphQLClient {
Future<graphql.QueryResult<Query$ListTorrents>> query$ListTorrents(
[Options$Query$ListTorrents? options]) async =>
await query(options ?? Options$Query$ListTorrents());
graphql.ObservableQuery<Query$ListTorrents> watchQuery$ListTorrents(
[WatchOptions$Query$ListTorrents? options]) =>
watchQuery(options ?? WatchOptions$Query$ListTorrents());
void writeQuery$ListTorrents({
required Query$ListTorrents data,
bool broadcast = true,
}) =>
writeQuery(
const graphql.Request(
operation:
graphql.Operation(document: documentNodeQueryListTorrents)),
data: data.toJson(),
broadcast: broadcast,
);
Query$ListTorrents? readQuery$ListTorrents({bool optimistic = true}) {
final result = readQuery(
const graphql.Request(
operation:
graphql.Operation(document: documentNodeQueryListTorrents)),
optimistic: optimistic,
);
return result == null ? null : Query$ListTorrents.fromJson(result);
}
}
graphql_flutter.QueryHookResult<Query$ListTorrents> useQuery$ListTorrents(
[Options$Query$ListTorrents? options]) =>
graphql_flutter.useQuery(options ?? Options$Query$ListTorrents());
graphql.ObservableQuery<Query$ListTorrents> useWatchQuery$ListTorrents(
[WatchOptions$Query$ListTorrents? options]) =>
graphql_flutter.useWatchQuery(options ?? WatchOptions$Query$ListTorrents());
class Query$ListTorrents$Widget
extends graphql_flutter.Query<Query$ListTorrents> {
Query$ListTorrents$Widget({
super.key,
Options$Query$ListTorrents? options,
required super.builder,
}) : super(
options: options ?? Options$Query$ListTorrents(),
);
}
class Query$ListTorrents$torrents {
Query$ListTorrents$torrents({
required this.name,
required this.infohash,
required this.bytesCompleted,
required this.bytesMissing,
this.$__typename = 'Torrent',
});
factory Query$ListTorrents$torrents.fromJson(Map<String, dynamic> json) {
final l$name = json['name'];
final l$infohash = json['infohash'];
final l$bytesCompleted = json['bytesCompleted'];
final l$bytesMissing = json['bytesMissing'];
final l$$__typename = json['__typename'];
return Query$ListTorrents$torrents(
name: (l$name as String),
infohash: (l$infohash as String),
bytesCompleted: (l$bytesCompleted as int),
bytesMissing: (l$bytesMissing as int),
$__typename: (l$$__typename as String),
);
}
final String name;
final String infohash;
final int bytesCompleted;
final int bytesMissing;
final String $__typename;
Map<String, dynamic> toJson() {
final resultData = <String, dynamic>{};
final l$name = name;
resultData['name'] = l$name;
final l$infohash = infohash;
resultData['infohash'] = l$infohash;
final l$bytesCompleted = bytesCompleted;
resultData['bytesCompleted'] = l$bytesCompleted;
final l$bytesMissing = bytesMissing;
resultData['bytesMissing'] = l$bytesMissing;
final l$$__typename = $__typename;
resultData['__typename'] = l$$__typename;
return resultData;
}
@override
int get hashCode {
final l$name = name;
final l$infohash = infohash;
final l$bytesCompleted = bytesCompleted;
final l$bytesMissing = bytesMissing;
final l$$__typename = $__typename;
return Object.hashAll([
l$name,
l$infohash,
l$bytesCompleted,
l$bytesMissing,
l$$__typename,
]);
}
@override
bool operator ==(Object other) {
if (identical(this, other)) {
return true;
}
if (other is! Query$ListTorrents$torrents ||
runtimeType != other.runtimeType) {
return false;
}
final l$name = name;
final lOther$name = other.name;
if (l$name != lOther$name) {
return false;
}
final l$infohash = infohash;
final lOther$infohash = other.infohash;
if (l$infohash != lOther$infohash) {
return false;
}
final l$bytesCompleted = bytesCompleted;
final lOther$bytesCompleted = other.bytesCompleted;
if (l$bytesCompleted != lOther$bytesCompleted) {
return false;
}
final l$bytesMissing = bytesMissing;
final lOther$bytesMissing = other.bytesMissing;
if (l$bytesMissing != lOther$bytesMissing) {
return false;
}
final l$$__typename = $__typename;
final lOther$$__typename = other.$__typename;
if (l$$__typename != lOther$$__typename) {
return false;
}
return true;
}
}
extension UtilityExtension$Query$ListTorrents$torrents
on Query$ListTorrents$torrents {
CopyWith$Query$ListTorrents$torrents<Query$ListTorrents$torrents>
get copyWith => CopyWith$Query$ListTorrents$torrents(
this,
(i) => i,
);
}
abstract class CopyWith$Query$ListTorrents$torrents<TRes> {
factory CopyWith$Query$ListTorrents$torrents(
Query$ListTorrents$torrents instance,
TRes Function(Query$ListTorrents$torrents) then,
) = _CopyWithImpl$Query$ListTorrents$torrents;
factory CopyWith$Query$ListTorrents$torrents.stub(TRes res) =
_CopyWithStubImpl$Query$ListTorrents$torrents;
TRes call({
String? name,
String? infohash,
int? bytesCompleted,
int? bytesMissing,
String? $__typename,
});
}
class _CopyWithImpl$Query$ListTorrents$torrents<TRes>
implements CopyWith$Query$ListTorrents$torrents<TRes> {
_CopyWithImpl$Query$ListTorrents$torrents(
this._instance,
this._then,
);
final Query$ListTorrents$torrents _instance;
final TRes Function(Query$ListTorrents$torrents) _then;
static const _undefined = <dynamic, dynamic>{};
@override
TRes call({
Object? name = _undefined,
Object? infohash = _undefined,
Object? bytesCompleted = _undefined,
Object? bytesMissing = _undefined,
Object? $__typename = _undefined,
}) =>
_then(Query$ListTorrents$torrents(
name: name == _undefined || name == null
? _instance.name
: (name as String),
infohash: infohash == _undefined || infohash == null
? _instance.infohash
: (infohash as String),
bytesCompleted: bytesCompleted == _undefined || bytesCompleted == null
? _instance.bytesCompleted
: (bytesCompleted as int),
bytesMissing: bytesMissing == _undefined || bytesMissing == null
? _instance.bytesMissing
: (bytesMissing as int),
$__typename: $__typename == _undefined || $__typename == null
? _instance.$__typename
: ($__typename as String),
));
}
class _CopyWithStubImpl$Query$ListTorrents$torrents<TRes>
implements CopyWith$Query$ListTorrents$torrents<TRes> {
_CopyWithStubImpl$Query$ListTorrents$torrents(this._res);
final TRes _res;
@override
call({
String? name,
String? infohash,
int? bytesCompleted,
int? bytesMissing,
String? $__typename,
}) =>
_res;
}