242 lines
7.5 KiB
Dart
242 lines
7.5 KiB
Dart
// coverage:ignore-file
|
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
// 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 'auth_user.dart';
|
|
|
|
// **************************************************************************
|
|
// FreezedGenerator
|
|
// **************************************************************************
|
|
|
|
T _$identity<T>(T value) => value;
|
|
|
|
final _privateConstructorUsedError = UnsupportedError(
|
|
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
|
|
|
AuthUser _$AuthUserFromJson(Map<String, dynamic> json) {
|
|
return _AuthUser.fromJson(json);
|
|
}
|
|
|
|
/// @nodoc
|
|
mixin _$AuthUser {
|
|
int get id => throw _privateConstructorUsedError;
|
|
String? get username =>
|
|
throw _privateConstructorUsedError; // API doesn't return username
|
|
String get email => throw _privateConstructorUsedError;
|
|
String get name => throw _privateConstructorUsedError;
|
|
String get role => throw _privateConstructorUsedError;
|
|
|
|
/// Serializes this AuthUser to a JSON map.
|
|
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
|
|
|
/// Create a copy of AuthUser
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
$AuthUserCopyWith<AuthUser> get copyWith =>
|
|
throw _privateConstructorUsedError;
|
|
}
|
|
|
|
/// @nodoc
|
|
abstract class $AuthUserCopyWith<$Res> {
|
|
factory $AuthUserCopyWith(AuthUser value, $Res Function(AuthUser) then) =
|
|
_$AuthUserCopyWithImpl<$Res, AuthUser>;
|
|
@useResult
|
|
$Res call({int id, String? username, String email, String name, String role});
|
|
}
|
|
|
|
/// @nodoc
|
|
class _$AuthUserCopyWithImpl<$Res, $Val extends AuthUser>
|
|
implements $AuthUserCopyWith<$Res> {
|
|
_$AuthUserCopyWithImpl(this._value, this._then);
|
|
|
|
// ignore: unused_field
|
|
final $Val _value;
|
|
// ignore: unused_field
|
|
final $Res Function($Val) _then;
|
|
|
|
/// Create a copy of AuthUser
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@pragma('vm:prefer-inline')
|
|
@override
|
|
$Res call({
|
|
Object? id = null,
|
|
Object? username = freezed,
|
|
Object? email = null,
|
|
Object? name = null,
|
|
Object? role = null,
|
|
}) {
|
|
return _then(_value.copyWith(
|
|
id: null == id
|
|
? _value.id
|
|
: id // ignore: cast_nullable_to_non_nullable
|
|
as int,
|
|
username: freezed == username
|
|
? _value.username
|
|
: username // ignore: cast_nullable_to_non_nullable
|
|
as String?,
|
|
email: null == email
|
|
? _value.email
|
|
: email // ignore: cast_nullable_to_non_nullable
|
|
as String,
|
|
name: null == name
|
|
? _value.name
|
|
: name // ignore: cast_nullable_to_non_nullable
|
|
as String,
|
|
role: null == role
|
|
? _value.role
|
|
: role // ignore: cast_nullable_to_non_nullable
|
|
as String,
|
|
) as $Val);
|
|
}
|
|
}
|
|
|
|
/// @nodoc
|
|
abstract class _$$AuthUserImplCopyWith<$Res>
|
|
implements $AuthUserCopyWith<$Res> {
|
|
factory _$$AuthUserImplCopyWith(
|
|
_$AuthUserImpl value, $Res Function(_$AuthUserImpl) then) =
|
|
__$$AuthUserImplCopyWithImpl<$Res>;
|
|
@override
|
|
@useResult
|
|
$Res call({int id, String? username, String email, String name, String role});
|
|
}
|
|
|
|
/// @nodoc
|
|
class __$$AuthUserImplCopyWithImpl<$Res>
|
|
extends _$AuthUserCopyWithImpl<$Res, _$AuthUserImpl>
|
|
implements _$$AuthUserImplCopyWith<$Res> {
|
|
__$$AuthUserImplCopyWithImpl(
|
|
_$AuthUserImpl _value, $Res Function(_$AuthUserImpl) _then)
|
|
: super(_value, _then);
|
|
|
|
/// Create a copy of AuthUser
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@pragma('vm:prefer-inline')
|
|
@override
|
|
$Res call({
|
|
Object? id = null,
|
|
Object? username = freezed,
|
|
Object? email = null,
|
|
Object? name = null,
|
|
Object? role = null,
|
|
}) {
|
|
return _then(_$AuthUserImpl(
|
|
id: null == id
|
|
? _value.id
|
|
: id // ignore: cast_nullable_to_non_nullable
|
|
as int,
|
|
username: freezed == username
|
|
? _value.username
|
|
: username // ignore: cast_nullable_to_non_nullable
|
|
as String?,
|
|
email: null == email
|
|
? _value.email
|
|
: email // ignore: cast_nullable_to_non_nullable
|
|
as String,
|
|
name: null == name
|
|
? _value.name
|
|
: name // ignore: cast_nullable_to_non_nullable
|
|
as String,
|
|
role: null == role
|
|
? _value.role
|
|
: role // ignore: cast_nullable_to_non_nullable
|
|
as String,
|
|
));
|
|
}
|
|
}
|
|
|
|
/// @nodoc
|
|
@JsonSerializable()
|
|
class _$AuthUserImpl implements _AuthUser {
|
|
const _$AuthUserImpl(
|
|
{required this.id,
|
|
this.username,
|
|
required this.email,
|
|
required this.name,
|
|
this.role = 'admin'});
|
|
|
|
factory _$AuthUserImpl.fromJson(Map<String, dynamic> json) =>
|
|
_$$AuthUserImplFromJson(json);
|
|
|
|
@override
|
|
final int id;
|
|
@override
|
|
final String? username;
|
|
// API doesn't return username
|
|
@override
|
|
final String email;
|
|
@override
|
|
final String name;
|
|
@override
|
|
@JsonKey()
|
|
final String role;
|
|
|
|
@override
|
|
String toString() {
|
|
return 'AuthUser(id: $id, username: $username, email: $email, name: $name, role: $role)';
|
|
}
|
|
|
|
@override
|
|
bool operator ==(Object other) {
|
|
return identical(this, other) ||
|
|
(other.runtimeType == runtimeType &&
|
|
other is _$AuthUserImpl &&
|
|
(identical(other.id, id) || other.id == id) &&
|
|
(identical(other.username, username) ||
|
|
other.username == username) &&
|
|
(identical(other.email, email) || other.email == email) &&
|
|
(identical(other.name, name) || other.name == name) &&
|
|
(identical(other.role, role) || other.role == role));
|
|
}
|
|
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
@override
|
|
int get hashCode => Object.hash(runtimeType, id, username, email, name, role);
|
|
|
|
/// Create a copy of AuthUser
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
@override
|
|
@pragma('vm:prefer-inline')
|
|
_$$AuthUserImplCopyWith<_$AuthUserImpl> get copyWith =>
|
|
__$$AuthUserImplCopyWithImpl<_$AuthUserImpl>(this, _$identity);
|
|
|
|
@override
|
|
Map<String, dynamic> toJson() {
|
|
return _$$AuthUserImplToJson(
|
|
this,
|
|
);
|
|
}
|
|
}
|
|
|
|
abstract class _AuthUser implements AuthUser {
|
|
const factory _AuthUser(
|
|
{required final int id,
|
|
final String? username,
|
|
required final String email,
|
|
required final String name,
|
|
final String role}) = _$AuthUserImpl;
|
|
|
|
factory _AuthUser.fromJson(Map<String, dynamic> json) =
|
|
_$AuthUserImpl.fromJson;
|
|
|
|
@override
|
|
int get id;
|
|
@override
|
|
String? get username; // API doesn't return username
|
|
@override
|
|
String get email;
|
|
@override
|
|
String get name;
|
|
@override
|
|
String get role;
|
|
|
|
/// Create a copy of AuthUser
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@override
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
_$$AuthUserImplCopyWith<_$AuthUserImpl> get copyWith =>
|
|
throw _privateConstructorUsedError;
|
|
}
|