forked from loafle/openapi-generator-original
* [dart-dio+time_machine] Add missing import, serializer
* [dart-dio] Remove bad import from `http` package
* [dart-dio] Use raw strings for those that contain variable name.
This should eliminate potential issue with variables like `$ref`.
* [dart-dio] Use `_path` instead of `path` to avoid potential conflict with op params.
See 1bec0b47b1/Kubernetes.json
, there are a few with `{path}` param.
* [dart-dio+time_machine] Use `OffsetXxx` classes for date time values
289 lines
8.1 KiB
Dart
289 lines
8.1 KiB
Dart
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
|
|
part of 'user.dart';
|
|
|
|
// **************************************************************************
|
|
// BuiltValueGenerator
|
|
// **************************************************************************
|
|
|
|
Serializer<User> _$userSerializer = new _$UserSerializer();
|
|
|
|
class _$UserSerializer implements StructuredSerializer<User> {
|
|
@override
|
|
final Iterable<Type> types = const [User, _$User];
|
|
@override
|
|
final String wireName = 'User';
|
|
|
|
@override
|
|
Iterable<Object> serialize(Serializers serializers, User object,
|
|
{FullType specifiedType = FullType.unspecified}) {
|
|
final result = <Object>[];
|
|
if (object.id != null) {
|
|
result
|
|
..add('id')
|
|
..add(serializers.serialize(object.id,
|
|
specifiedType: const FullType(int)));
|
|
}
|
|
if (object.username != null) {
|
|
result
|
|
..add('username')
|
|
..add(serializers.serialize(object.username,
|
|
specifiedType: const FullType(String)));
|
|
}
|
|
if (object.firstName != null) {
|
|
result
|
|
..add('firstName')
|
|
..add(serializers.serialize(object.firstName,
|
|
specifiedType: const FullType(String)));
|
|
}
|
|
if (object.lastName != null) {
|
|
result
|
|
..add('lastName')
|
|
..add(serializers.serialize(object.lastName,
|
|
specifiedType: const FullType(String)));
|
|
}
|
|
if (object.email != null) {
|
|
result
|
|
..add('email')
|
|
..add(serializers.serialize(object.email,
|
|
specifiedType: const FullType(String)));
|
|
}
|
|
if (object.password != null) {
|
|
result
|
|
..add('password')
|
|
..add(serializers.serialize(object.password,
|
|
specifiedType: const FullType(String)));
|
|
}
|
|
if (object.phone != null) {
|
|
result
|
|
..add('phone')
|
|
..add(serializers.serialize(object.phone,
|
|
specifiedType: const FullType(String)));
|
|
}
|
|
if (object.userStatus != null) {
|
|
result
|
|
..add('userStatus')
|
|
..add(serializers.serialize(object.userStatus,
|
|
specifiedType: const FullType(int)));
|
|
}
|
|
return result;
|
|
}
|
|
|
|
@override
|
|
User deserialize(Serializers serializers, Iterable<Object> serialized,
|
|
{FullType specifiedType = FullType.unspecified}) {
|
|
final result = new UserBuilder();
|
|
|
|
final iterator = serialized.iterator;
|
|
while (iterator.moveNext()) {
|
|
final key = iterator.current as String;
|
|
iterator.moveNext();
|
|
final dynamic value = iterator.current;
|
|
switch (key) {
|
|
case 'id':
|
|
result.id = serializers.deserialize(value,
|
|
specifiedType: const FullType(int)) as int;
|
|
break;
|
|
case 'username':
|
|
result.username = serializers.deserialize(value,
|
|
specifiedType: const FullType(String)) as String;
|
|
break;
|
|
case 'firstName':
|
|
result.firstName = serializers.deserialize(value,
|
|
specifiedType: const FullType(String)) as String;
|
|
break;
|
|
case 'lastName':
|
|
result.lastName = serializers.deserialize(value,
|
|
specifiedType: const FullType(String)) as String;
|
|
break;
|
|
case 'email':
|
|
result.email = serializers.deserialize(value,
|
|
specifiedType: const FullType(String)) as String;
|
|
break;
|
|
case 'password':
|
|
result.password = serializers.deserialize(value,
|
|
specifiedType: const FullType(String)) as String;
|
|
break;
|
|
case 'phone':
|
|
result.phone = serializers.deserialize(value,
|
|
specifiedType: const FullType(String)) as String;
|
|
break;
|
|
case 'userStatus':
|
|
result.userStatus = serializers.deserialize(value,
|
|
specifiedType: const FullType(int)) as int;
|
|
break;
|
|
}
|
|
}
|
|
|
|
return result.build();
|
|
}
|
|
}
|
|
|
|
class _$User extends User {
|
|
@override
|
|
final int id;
|
|
@override
|
|
final String username;
|
|
@override
|
|
final String firstName;
|
|
@override
|
|
final String lastName;
|
|
@override
|
|
final String email;
|
|
@override
|
|
final String password;
|
|
@override
|
|
final String phone;
|
|
@override
|
|
final int userStatus;
|
|
|
|
factory _$User([void Function(UserBuilder) updates]) =>
|
|
(new UserBuilder()..update(updates)).build();
|
|
|
|
_$User._(
|
|
{this.id,
|
|
this.username,
|
|
this.firstName,
|
|
this.lastName,
|
|
this.email,
|
|
this.password,
|
|
this.phone,
|
|
this.userStatus})
|
|
: super._();
|
|
|
|
@override
|
|
User rebuild(void Function(UserBuilder) updates) =>
|
|
(toBuilder()..update(updates)).build();
|
|
|
|
@override
|
|
UserBuilder toBuilder() => new UserBuilder()..replace(this);
|
|
|
|
@override
|
|
bool operator ==(Object other) {
|
|
if (identical(other, this)) return true;
|
|
return other is User &&
|
|
id == other.id &&
|
|
username == other.username &&
|
|
firstName == other.firstName &&
|
|
lastName == other.lastName &&
|
|
email == other.email &&
|
|
password == other.password &&
|
|
phone == other.phone &&
|
|
userStatus == other.userStatus;
|
|
}
|
|
|
|
@override
|
|
int get hashCode {
|
|
return $jf($jc(
|
|
$jc(
|
|
$jc(
|
|
$jc(
|
|
$jc(
|
|
$jc($jc($jc(0, id.hashCode), username.hashCode),
|
|
firstName.hashCode),
|
|
lastName.hashCode),
|
|
email.hashCode),
|
|
password.hashCode),
|
|
phone.hashCode),
|
|
userStatus.hashCode));
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (newBuiltValueToStringHelper('User')
|
|
..add('id', id)
|
|
..add('username', username)
|
|
..add('firstName', firstName)
|
|
..add('lastName', lastName)
|
|
..add('email', email)
|
|
..add('password', password)
|
|
..add('phone', phone)
|
|
..add('userStatus', userStatus))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class UserBuilder implements Builder<User, UserBuilder> {
|
|
_$User _$v;
|
|
|
|
int _id;
|
|
int get id => _$this._id;
|
|
set id(int id) => _$this._id = id;
|
|
|
|
String _username;
|
|
String get username => _$this._username;
|
|
set username(String username) => _$this._username = username;
|
|
|
|
String _firstName;
|
|
String get firstName => _$this._firstName;
|
|
set firstName(String firstName) => _$this._firstName = firstName;
|
|
|
|
String _lastName;
|
|
String get lastName => _$this._lastName;
|
|
set lastName(String lastName) => _$this._lastName = lastName;
|
|
|
|
String _email;
|
|
String get email => _$this._email;
|
|
set email(String email) => _$this._email = email;
|
|
|
|
String _password;
|
|
String get password => _$this._password;
|
|
set password(String password) => _$this._password = password;
|
|
|
|
String _phone;
|
|
String get phone => _$this._phone;
|
|
set phone(String phone) => _$this._phone = phone;
|
|
|
|
int _userStatus;
|
|
int get userStatus => _$this._userStatus;
|
|
set userStatus(int userStatus) => _$this._userStatus = userStatus;
|
|
|
|
UserBuilder();
|
|
|
|
UserBuilder get _$this {
|
|
if (_$v != null) {
|
|
_id = _$v.id;
|
|
_username = _$v.username;
|
|
_firstName = _$v.firstName;
|
|
_lastName = _$v.lastName;
|
|
_email = _$v.email;
|
|
_password = _$v.password;
|
|
_phone = _$v.phone;
|
|
_userStatus = _$v.userStatus;
|
|
_$v = null;
|
|
}
|
|
return this;
|
|
}
|
|
|
|
@override
|
|
void replace(User other) {
|
|
if (other == null) {
|
|
throw new ArgumentError.notNull('other');
|
|
}
|
|
_$v = other as _$User;
|
|
}
|
|
|
|
@override
|
|
void update(void Function(UserBuilder) updates) {
|
|
if (updates != null) updates(this);
|
|
}
|
|
|
|
@override
|
|
_$User build() {
|
|
final _$result = _$v ??
|
|
new _$User._(
|
|
id: id,
|
|
username: username,
|
|
firstName: firstName,
|
|
lastName: lastName,
|
|
email: email,
|
|
password: password,
|
|
phone: phone,
|
|
userStatus: userStatus);
|
|
replace(_$result);
|
|
return _$result;
|
|
}
|
|
}
|
|
|
|
// ignore_for_file: always_put_control_body_on_new_line,always_specify_types,annotate_overrides,avoid_annotating_with_dynamic,avoid_as,avoid_catches_without_on_clauses,avoid_returning_this,lines_longer_than_80_chars,omit_local_variable_types,prefer_expression_function_bodies,sort_constructors_first,test_types_in_equals,unnecessary_const,unnecessary_new
|