296 lines
11 KiB
Dart
296 lines
11 KiB
Dart
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|||
|
|
// coverage:ignore-file
|
||
|
|
// ignore_for_file: type=lint
|
||
|
|
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||
|
|
|
||
|
|
part of 'remote_node.dart';
|
||
|
|
|
||
|
|
// **************************************************************************
|
||
|
|
// FreezedGenerator
|
||
|
|
// **************************************************************************
|
||
|
|
|
||
|
|
// dart format off
|
||
|
|
T _$identity<T>(T value) => value;
|
||
|
|
|
||
|
|
/// @nodoc
|
||
|
|
mixin _$RemoteNode {
|
||
|
|
|
||
|
|
String get id; String get name; String get url; String get status; String? get description; List<String> get tags;@JsonKey(name: 'last_seen') DateTime? get lastSeen;
|
||
|
|
/// Create a copy of RemoteNode
|
||
|
|
/// with the given fields replaced by the non-null parameter values.
|
||
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||
|
|
@pragma('vm:prefer-inline')
|
||
|
|
$RemoteNodeCopyWith<RemoteNode> get copyWith => _$RemoteNodeCopyWithImpl<RemoteNode>(this as RemoteNode, _$identity);
|
||
|
|
|
||
|
|
/// Serializes this RemoteNode to a JSON map.
|
||
|
|
Map<String, dynamic> toJson();
|
||
|
|
|
||
|
|
|
||
|
|
@override
|
||
|
|
bool operator ==(Object other) {
|
||
|
|
return identical(this, other) || (other.runtimeType == runtimeType&&other is RemoteNode&&(identical(other.id, id) || other.id == id)&&(identical(other.name, name) || other.name == name)&&(identical(other.url, url) || other.url == url)&&(identical(other.status, status) || other.status == status)&&(identical(other.description, description) || other.description == description)&&const DeepCollectionEquality().equals(other.tags, tags)&&(identical(other.lastSeen, lastSeen) || other.lastSeen == lastSeen));
|
||
|
|
}
|
||
|
|
|
||
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||
|
|
@override
|
||
|
|
int get hashCode => Object.hash(runtimeType,id,name,url,status,description,const DeepCollectionEquality().hash(tags),lastSeen);
|
||
|
|
|
||
|
|
@override
|
||
|
|
String toString() {
|
||
|
|
return 'RemoteNode(id: $id, name: $name, url: $url, status: $status, description: $description, tags: $tags, lastSeen: $lastSeen)';
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
/// @nodoc
|
||
|
|
abstract mixin class $RemoteNodeCopyWith<$Res> {
|
||
|
|
factory $RemoteNodeCopyWith(RemoteNode value, $Res Function(RemoteNode) _then) = _$RemoteNodeCopyWithImpl;
|
||
|
|
@useResult
|
||
|
|
$Res call({
|
||
|
|
String id, String name, String url, String status, String? description, List<String> tags,@JsonKey(name: 'last_seen') DateTime? lastSeen
|
||
|
|
});
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
}
|
||
|
|
/// @nodoc
|
||
|
|
class _$RemoteNodeCopyWithImpl<$Res>
|
||
|
|
implements $RemoteNodeCopyWith<$Res> {
|
||
|
|
_$RemoteNodeCopyWithImpl(this._self, this._then);
|
||
|
|
|
||
|
|
final RemoteNode _self;
|
||
|
|
final $Res Function(RemoteNode) _then;
|
||
|
|
|
||
|
|
/// Create a copy of RemoteNode
|
||
|
|
/// with the given fields replaced by the non-null parameter values.
|
||
|
|
@pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? name = null,Object? url = null,Object? status = null,Object? description = freezed,Object? tags = null,Object? lastSeen = freezed,}) {
|
||
|
|
return _then(_self.copyWith(
|
||
|
|
id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
|
||
|
|
as String,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable
|
||
|
|
as String,url: null == url ? _self.url : url // ignore: cast_nullable_to_non_nullable
|
||
|
|
as String,status: null == status ? _self.status : status // ignore: cast_nullable_to_non_nullable
|
||
|
|
as String,description: freezed == description ? _self.description : description // ignore: cast_nullable_to_non_nullable
|
||
|
|
as String?,tags: null == tags ? _self.tags : tags // ignore: cast_nullable_to_non_nullable
|
||
|
|
as List<String>,lastSeen: freezed == lastSeen ? _self.lastSeen : lastSeen // ignore: cast_nullable_to_non_nullable
|
||
|
|
as DateTime?,
|
||
|
|
));
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
/// Adds pattern-matching-related methods to [RemoteNode].
|
||
|
|
extension RemoteNodePatterns on RemoteNode {
|
||
|
|
/// A variant of `map` that fallback to returning `orElse`.
|
||
|
|
///
|
||
|
|
/// It is equivalent to doing:
|
||
|
|
/// ```dart
|
||
|
|
/// switch (sealedClass) {
|
||
|
|
/// case final Subclass value:
|
||
|
|
/// return ...;
|
||
|
|
/// case _:
|
||
|
|
/// return orElse();
|
||
|
|
/// }
|
||
|
|
/// ```
|
||
|
|
|
||
|
|
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _RemoteNode value)? $default,{required TResult orElse(),}){
|
||
|
|
final _that = this;
|
||
|
|
switch (_that) {
|
||
|
|
case _RemoteNode() when $default != null:
|
||
|
|
return $default(_that);case _:
|
||
|
|
return orElse();
|
||
|
|
|
||
|
|
}
|
||
|
|
}
|
||
|
|
/// A `switch`-like method, using callbacks.
|
||
|
|
///
|
||
|
|
/// Callbacks receives the raw object, upcasted.
|
||
|
|
/// It is equivalent to doing:
|
||
|
|
/// ```dart
|
||
|
|
/// switch (sealedClass) {
|
||
|
|
/// case final Subclass value:
|
||
|
|
/// return ...;
|
||
|
|
/// case final Subclass2 value:
|
||
|
|
/// return ...;
|
||
|
|
/// }
|
||
|
|
/// ```
|
||
|
|
|
||
|
|
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _RemoteNode value) $default,){
|
||
|
|
final _that = this;
|
||
|
|
switch (_that) {
|
||
|
|
case _RemoteNode():
|
||
|
|
return $default(_that);}
|
||
|
|
}
|
||
|
|
/// A variant of `map` that fallback to returning `null`.
|
||
|
|
///
|
||
|
|
/// It is equivalent to doing:
|
||
|
|
/// ```dart
|
||
|
|
/// switch (sealedClass) {
|
||
|
|
/// case final Subclass value:
|
||
|
|
/// return ...;
|
||
|
|
/// case _:
|
||
|
|
/// return null;
|
||
|
|
/// }
|
||
|
|
/// ```
|
||
|
|
|
||
|
|
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _RemoteNode value)? $default,){
|
||
|
|
final _that = this;
|
||
|
|
switch (_that) {
|
||
|
|
case _RemoteNode() when $default != null:
|
||
|
|
return $default(_that);case _:
|
||
|
|
return null;
|
||
|
|
|
||
|
|
}
|
||
|
|
}
|
||
|
|
/// A variant of `when` that fallback to an `orElse` callback.
|
||
|
|
///
|
||
|
|
/// It is equivalent to doing:
|
||
|
|
/// ```dart
|
||
|
|
/// switch (sealedClass) {
|
||
|
|
/// case Subclass(:final field):
|
||
|
|
/// return ...;
|
||
|
|
/// case _:
|
||
|
|
/// return orElse();
|
||
|
|
/// }
|
||
|
|
/// ```
|
||
|
|
|
||
|
|
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String id, String name, String url, String status, String? description, List<String> tags, @JsonKey(name: 'last_seen') DateTime? lastSeen)? $default,{required TResult orElse(),}) {final _that = this;
|
||
|
|
switch (_that) {
|
||
|
|
case _RemoteNode() when $default != null:
|
||
|
|
return $default(_that.id,_that.name,_that.url,_that.status,_that.description,_that.tags,_that.lastSeen);case _:
|
||
|
|
return orElse();
|
||
|
|
|
||
|
|
}
|
||
|
|
}
|
||
|
|
/// A `switch`-like method, using callbacks.
|
||
|
|
///
|
||
|
|
/// As opposed to `map`, this offers destructuring.
|
||
|
|
/// It is equivalent to doing:
|
||
|
|
/// ```dart
|
||
|
|
/// switch (sealedClass) {
|
||
|
|
/// case Subclass(:final field):
|
||
|
|
/// return ...;
|
||
|
|
/// case Subclass2(:final field2):
|
||
|
|
/// return ...;
|
||
|
|
/// }
|
||
|
|
/// ```
|
||
|
|
|
||
|
|
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String id, String name, String url, String status, String? description, List<String> tags, @JsonKey(name: 'last_seen') DateTime? lastSeen) $default,) {final _that = this;
|
||
|
|
switch (_that) {
|
||
|
|
case _RemoteNode():
|
||
|
|
return $default(_that.id,_that.name,_that.url,_that.status,_that.description,_that.tags,_that.lastSeen);}
|
||
|
|
}
|
||
|
|
/// A variant of `when` that fallback to returning `null`
|
||
|
|
///
|
||
|
|
/// It is equivalent to doing:
|
||
|
|
/// ```dart
|
||
|
|
/// switch (sealedClass) {
|
||
|
|
/// case Subclass(:final field):
|
||
|
|
/// return ...;
|
||
|
|
/// case _:
|
||
|
|
/// return null;
|
||
|
|
/// }
|
||
|
|
/// ```
|
||
|
|
|
||
|
|
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String id, String name, String url, String status, String? description, List<String> tags, @JsonKey(name: 'last_seen') DateTime? lastSeen)? $default,) {final _that = this;
|
||
|
|
switch (_that) {
|
||
|
|
case _RemoteNode() when $default != null:
|
||
|
|
return $default(_that.id,_that.name,_that.url,_that.status,_that.description,_that.tags,_that.lastSeen);case _:
|
||
|
|
return null;
|
||
|
|
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
/// @nodoc
|
||
|
|
@JsonSerializable()
|
||
|
|
|
||
|
|
class _RemoteNode implements RemoteNode {
|
||
|
|
const _RemoteNode({this.id = '', required this.name, required this.url, this.status = '', this.description, final List<String> tags = const <String>[], @JsonKey(name: 'last_seen') this.lastSeen}): _tags = tags;
|
||
|
|
factory _RemoteNode.fromJson(Map<String, dynamic> json) => _$RemoteNodeFromJson(json);
|
||
|
|
|
||
|
|
@override@JsonKey() final String id;
|
||
|
|
@override final String name;
|
||
|
|
@override final String url;
|
||
|
|
@override@JsonKey() final String status;
|
||
|
|
@override final String? description;
|
||
|
|
final List<String> _tags;
|
||
|
|
@override@JsonKey() List<String> get tags {
|
||
|
|
if (_tags is EqualUnmodifiableListView) return _tags;
|
||
|
|
// ignore: implicit_dynamic_type
|
||
|
|
return EqualUnmodifiableListView(_tags);
|
||
|
|
}
|
||
|
|
|
||
|
|
@override@JsonKey(name: 'last_seen') final DateTime? lastSeen;
|
||
|
|
|
||
|
|
/// Create a copy of RemoteNode
|
||
|
|
/// with the given fields replaced by the non-null parameter values.
|
||
|
|
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||
|
|
@pragma('vm:prefer-inline')
|
||
|
|
_$RemoteNodeCopyWith<_RemoteNode> get copyWith => __$RemoteNodeCopyWithImpl<_RemoteNode>(this, _$identity);
|
||
|
|
|
||
|
|
@override
|
||
|
|
Map<String, dynamic> toJson() {
|
||
|
|
return _$RemoteNodeToJson(this, );
|
||
|
|
}
|
||
|
|
|
||
|
|
@override
|
||
|
|
bool operator ==(Object other) {
|
||
|
|
return identical(this, other) || (other.runtimeType == runtimeType&&other is _RemoteNode&&(identical(other.id, id) || other.id == id)&&(identical(other.name, name) || other.name == name)&&(identical(other.url, url) || other.url == url)&&(identical(other.status, status) || other.status == status)&&(identical(other.description, description) || other.description == description)&&const DeepCollectionEquality().equals(other._tags, _tags)&&(identical(other.lastSeen, lastSeen) || other.lastSeen == lastSeen));
|
||
|
|
}
|
||
|
|
|
||
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||
|
|
@override
|
||
|
|
int get hashCode => Object.hash(runtimeType,id,name,url,status,description,const DeepCollectionEquality().hash(_tags),lastSeen);
|
||
|
|
|
||
|
|
@override
|
||
|
|
String toString() {
|
||
|
|
return 'RemoteNode(id: $id, name: $name, url: $url, status: $status, description: $description, tags: $tags, lastSeen: $lastSeen)';
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
/// @nodoc
|
||
|
|
abstract mixin class _$RemoteNodeCopyWith<$Res> implements $RemoteNodeCopyWith<$Res> {
|
||
|
|
factory _$RemoteNodeCopyWith(_RemoteNode value, $Res Function(_RemoteNode) _then) = __$RemoteNodeCopyWithImpl;
|
||
|
|
@override @useResult
|
||
|
|
$Res call({
|
||
|
|
String id, String name, String url, String status, String? description, List<String> tags,@JsonKey(name: 'last_seen') DateTime? lastSeen
|
||
|
|
});
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
}
|
||
|
|
/// @nodoc
|
||
|
|
class __$RemoteNodeCopyWithImpl<$Res>
|
||
|
|
implements _$RemoteNodeCopyWith<$Res> {
|
||
|
|
__$RemoteNodeCopyWithImpl(this._self, this._then);
|
||
|
|
|
||
|
|
final _RemoteNode _self;
|
||
|
|
final $Res Function(_RemoteNode) _then;
|
||
|
|
|
||
|
|
/// Create a copy of RemoteNode
|
||
|
|
/// with the given fields replaced by the non-null parameter values.
|
||
|
|
@override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? name = null,Object? url = null,Object? status = null,Object? description = freezed,Object? tags = null,Object? lastSeen = freezed,}) {
|
||
|
|
return _then(_RemoteNode(
|
||
|
|
id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
|
||
|
|
as String,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable
|
||
|
|
as String,url: null == url ? _self.url : url // ignore: cast_nullable_to_non_nullable
|
||
|
|
as String,status: null == status ? _self.status : status // ignore: cast_nullable_to_non_nullable
|
||
|
|
as String,description: freezed == description ? _self.description : description // ignore: cast_nullable_to_non_nullable
|
||
|
|
as String?,tags: null == tags ? _self._tags : tags // ignore: cast_nullable_to_non_nullable
|
||
|
|
as List<String>,lastSeen: freezed == lastSeen ? _self.lastSeen : lastSeen // ignore: cast_nullable_to_non_nullable
|
||
|
|
as DateTime?,
|
||
|
|
));
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
// dart format on
|