2021-01-06 17:35:57 +00:00
|
|
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
|
|
|
|
|
|
part of 'server_details.dart';
|
|
|
|
|
|
|
|
// **************************************************************************
|
|
|
|
// TypeAdapterGenerator
|
|
|
|
// **************************************************************************
|
|
|
|
|
2022-05-14 02:54:40 +00:00
|
|
|
class ServerHostingDetailsAdapter extends TypeAdapter<ServerHostingDetails> {
|
2021-01-06 17:35:57 +00:00
|
|
|
@override
|
|
|
|
final int typeId = 2;
|
|
|
|
|
|
|
|
@override
|
2022-05-13 13:57:56 +00:00
|
|
|
ServerHostingDetails read(BinaryReader reader) {
|
2021-01-06 17:35:57 +00:00
|
|
|
final numOfFields = reader.readByte();
|
|
|
|
final fields = <int, dynamic>{
|
|
|
|
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
|
|
|
|
};
|
2022-05-13 13:57:56 +00:00
|
|
|
return ServerHostingDetails(
|
2021-03-30 17:38:40 +00:00
|
|
|
ip4: fields[0] as String,
|
|
|
|
id: fields[1] as int,
|
2021-03-15 15:39:44 +00:00
|
|
|
createTime: fields[3] as DateTime?,
|
2022-05-14 02:54:40 +00:00
|
|
|
volume: fields[4] as ServerVolume,
|
2021-11-18 19:10:40 +00:00
|
|
|
apiToken: fields[5] as String,
|
2022-05-14 02:54:40 +00:00
|
|
|
provider: fields[6] == null
|
|
|
|
? ServerProvider.Hetzner
|
|
|
|
: fields[6] as ServerProvider,
|
2021-03-15 15:39:44 +00:00
|
|
|
startTime: fields[2] as DateTime?,
|
2021-01-06 17:35:57 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
2022-05-13 13:57:56 +00:00
|
|
|
void write(BinaryWriter writer, ServerHostingDetails obj) {
|
2021-01-06 17:35:57 +00:00
|
|
|
writer
|
2022-05-14 02:54:40 +00:00
|
|
|
..writeByte(7)
|
2021-01-06 17:35:57 +00:00
|
|
|
..writeByte(0)
|
|
|
|
..write(obj.ip4)
|
|
|
|
..writeByte(1)
|
|
|
|
..write(obj.id)
|
2021-01-19 12:05:40 +00:00
|
|
|
..writeByte(3)
|
2021-02-03 20:26:38 +00:00
|
|
|
..write(obj.createTime)
|
|
|
|
..writeByte(2)
|
2021-03-30 17:38:40 +00:00
|
|
|
..write(obj.startTime)
|
|
|
|
..writeByte(4)
|
2022-05-14 02:54:40 +00:00
|
|
|
..write(obj.volume)
|
2021-11-18 19:10:40 +00:00
|
|
|
..writeByte(5)
|
2022-05-14 02:54:40 +00:00
|
|
|
..write(obj.apiToken)
|
|
|
|
..writeByte(6)
|
|
|
|
..write(obj.provider);
|
2021-01-06 17:35:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
int get hashCode => typeId.hashCode;
|
|
|
|
|
|
|
|
@override
|
|
|
|
bool operator ==(Object other) =>
|
|
|
|
identical(this, other) ||
|
2022-05-14 02:54:40 +00:00
|
|
|
other is ServerHostingDetailsAdapter &&
|
2021-01-06 17:35:57 +00:00
|
|
|
runtimeType == other.runtimeType &&
|
|
|
|
typeId == other.typeId;
|
|
|
|
}
|
2021-03-30 17:38:40 +00:00
|
|
|
|
2022-05-14 02:54:40 +00:00
|
|
|
class ServerVolumeAdapter extends TypeAdapter<ServerVolume> {
|
2021-03-30 17:38:40 +00:00
|
|
|
@override
|
|
|
|
final int typeId = 5;
|
|
|
|
|
|
|
|
@override
|
2022-05-13 13:57:56 +00:00
|
|
|
ServerVolume read(BinaryReader reader) {
|
2021-03-30 17:38:40 +00:00
|
|
|
final numOfFields = reader.readByte();
|
|
|
|
final fields = <int, dynamic>{
|
|
|
|
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
|
|
|
|
};
|
2022-05-13 13:57:56 +00:00
|
|
|
return ServerVolume(
|
2021-03-30 17:38:40 +00:00
|
|
|
id: fields[1] as int,
|
|
|
|
name: fields[2] as String,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
2022-05-13 13:57:56 +00:00
|
|
|
void write(BinaryWriter writer, ServerVolume obj) {
|
2021-03-30 17:38:40 +00:00
|
|
|
writer
|
|
|
|
..writeByte(2)
|
|
|
|
..writeByte(1)
|
|
|
|
..write(obj.id)
|
|
|
|
..writeByte(2)
|
|
|
|
..write(obj.name);
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
int get hashCode => typeId.hashCode;
|
|
|
|
|
|
|
|
@override
|
|
|
|
bool operator ==(Object other) =>
|
|
|
|
identical(this, other) ||
|
2022-05-14 02:54:40 +00:00
|
|
|
other is ServerVolumeAdapter &&
|
|
|
|
runtimeType == other.runtimeType &&
|
|
|
|
typeId == other.typeId;
|
|
|
|
}
|
|
|
|
|
|
|
|
class ServerProviderAdapter extends TypeAdapter<ServerProvider> {
|
|
|
|
@override
|
|
|
|
final int typeId = 101;
|
|
|
|
|
|
|
|
@override
|
|
|
|
ServerProvider read(BinaryReader reader) {
|
|
|
|
switch (reader.readByte()) {
|
|
|
|
case 0:
|
|
|
|
return ServerProvider.Unknown;
|
|
|
|
case 1:
|
|
|
|
return ServerProvider.Hetzner;
|
|
|
|
default:
|
|
|
|
return ServerProvider.Unknown;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
void write(BinaryWriter writer, ServerProvider obj) {
|
|
|
|
switch (obj) {
|
|
|
|
case ServerProvider.Unknown:
|
|
|
|
writer.writeByte(0);
|
|
|
|
break;
|
|
|
|
case ServerProvider.Hetzner:
|
|
|
|
writer.writeByte(1);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
int get hashCode => typeId.hashCode;
|
|
|
|
|
|
|
|
@override
|
|
|
|
bool operator ==(Object other) =>
|
|
|
|
identical(this, other) ||
|
|
|
|
other is ServerProviderAdapter &&
|
2021-03-30 17:38:40 +00:00
|
|
|
runtimeType == other.runtimeType &&
|
|
|
|
typeId == other.typeId;
|
|
|
|
}
|