2021-01-06 17:35:57 +00:00
|
|
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
|
|
|
2022-05-13 13:57:56 +00:00
|
|
|
part of 'server_domain.dart';
|
2021-01-06 17:35:57 +00:00
|
|
|
|
|
|
|
// **************************************************************************
|
|
|
|
// TypeAdapterGenerator
|
|
|
|
// **************************************************************************
|
|
|
|
|
2022-05-13 13:57:56 +00:00
|
|
|
class ServerDomainAdapter extends TypeAdapter<ServerDomain> {
|
2021-01-06 17:35:57 +00:00
|
|
|
@override
|
|
|
|
final int typeId = 3;
|
|
|
|
|
|
|
|
@override
|
2022-05-13 13:57:56 +00:00
|
|
|
ServerDomain 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 ServerDomain(
|
2021-03-26 13:38:39 +00:00
|
|
|
domainName: fields[0] as String,
|
|
|
|
zoneId: fields[1] as String,
|
2022-05-13 13:57:56 +00:00
|
|
|
provider:
|
|
|
|
fields[2] == null ? DnsProvider.Cloudflare : fields[2] as DnsProvider,
|
2021-01-06 17:35:57 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
2022-05-13 13:57:56 +00:00
|
|
|
void write(BinaryWriter writer, ServerDomain obj) {
|
2021-01-06 17:35:57 +00:00
|
|
|
writer
|
2022-05-13 13:57:56 +00:00
|
|
|
..writeByte(3)
|
2021-01-06 17:35:57 +00:00
|
|
|
..writeByte(0)
|
2021-01-21 07:35:38 +00:00
|
|
|
..write(obj.domainName)
|
2021-01-06 17:35:57 +00:00
|
|
|
..writeByte(1)
|
2022-05-13 13:57:56 +00:00
|
|
|
..write(obj.zoneId)
|
|
|
|
..writeByte(2)
|
|
|
|
..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-13 13:57:56 +00:00
|
|
|
other is ServerDomainAdapter &&
|
2021-01-06 17:35:57 +00:00
|
|
|
runtimeType == other.runtimeType &&
|
|
|
|
typeId == other.typeId;
|
|
|
|
}
|
2022-05-14 02:54:40 +00:00
|
|
|
|
|
|
|
class DnsProviderAdapter extends TypeAdapter<DnsProvider> {
|
|
|
|
@override
|
|
|
|
final int typeId = 100;
|
|
|
|
|
|
|
|
@override
|
|
|
|
DnsProvider read(BinaryReader reader) {
|
|
|
|
switch (reader.readByte()) {
|
|
|
|
case 0:
|
|
|
|
return DnsProvider.Unknown;
|
|
|
|
case 1:
|
|
|
|
return DnsProvider.Cloudflare;
|
|
|
|
default:
|
|
|
|
return DnsProvider.Unknown;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
void write(BinaryWriter writer, DnsProvider obj) {
|
|
|
|
switch (obj) {
|
|
|
|
case DnsProvider.Unknown:
|
|
|
|
writer.writeByte(0);
|
|
|
|
break;
|
|
|
|
case DnsProvider.Cloudflare:
|
|
|
|
writer.writeByte(1);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
int get hashCode => typeId.hashCode;
|
|
|
|
|
|
|
|
@override
|
|
|
|
bool operator ==(Object other) =>
|
|
|
|
identical(this, other) ||
|
|
|
|
other is DnsProviderAdapter &&
|
|
|
|
runtimeType == other.runtimeType &&
|
|
|
|
typeId == other.typeId;
|
|
|
|
}
|