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:
|
2022-05-24 18:55:39 +00:00
|
|
|
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:
|
2022-05-24 18:55:39 +00:00
|
|
|
return DnsProvider.unknown;
|
2022-05-14 02:54:40 +00:00
|
|
|
case 1:
|
2022-05-24 18:55:39 +00:00
|
|
|
return DnsProvider.cloudflare;
|
2023-01-05 09:16:30 +00:00
|
|
|
case 2:
|
|
|
|
return DnsProvider.digitalOcean;
|
2022-05-14 02:54:40 +00:00
|
|
|
default:
|
2022-05-24 18:55:39 +00:00
|
|
|
return DnsProvider.unknown;
|
2022-05-14 02:54:40 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
void write(BinaryWriter writer, DnsProvider obj) {
|
|
|
|
switch (obj) {
|
2022-05-24 18:55:39 +00:00
|
|
|
case DnsProvider.unknown:
|
2022-05-14 02:54:40 +00:00
|
|
|
writer.writeByte(0);
|
|
|
|
break;
|
2022-05-24 18:55:39 +00:00
|
|
|
case DnsProvider.cloudflare:
|
2022-05-14 02:54:40 +00:00
|
|
|
writer.writeByte(1);
|
|
|
|
break;
|
2023-01-05 09:16:30 +00:00
|
|
|
case DnsProvider.digitalOcean:
|
|
|
|
writer.writeByte(2);
|
|
|
|
break;
|
2022-05-14 02:54:40 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
int get hashCode => typeId.hashCode;
|
|
|
|
|
|
|
|
@override
|
|
|
|
bool operator ==(Object other) =>
|
|
|
|
identical(this, other) ||
|
|
|
|
other is DnsProviderAdapter &&
|
|
|
|
runtimeType == other.runtimeType &&
|
|
|
|
typeId == other.typeId;
|
|
|
|
}
|