2023-06-16 01:28:45 +00:00
|
|
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
|
|
|
|
|
|
part of 'backups_credential.dart';
|
|
|
|
|
|
|
|
// **************************************************************************
|
|
|
|
// TypeAdapterGenerator
|
|
|
|
// **************************************************************************
|
|
|
|
|
2023-06-19 20:56:00 +00:00
|
|
|
class BackupsCredentialAdapter extends TypeAdapter<BackupsCredential> {
|
2023-06-16 01:28:45 +00:00
|
|
|
@override
|
|
|
|
final int typeId = 4;
|
|
|
|
|
|
|
|
@override
|
2023-06-19 20:56:00 +00:00
|
|
|
BackupsCredential read(BinaryReader reader) {
|
2023-06-16 01:28:45 +00:00
|
|
|
final numOfFields = reader.readByte();
|
|
|
|
final fields = <int, dynamic>{
|
|
|
|
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
|
|
|
|
};
|
2023-06-19 20:56:00 +00:00
|
|
|
return BackupsCredential(
|
2023-06-16 01:28:45 +00:00
|
|
|
keyId: fields[0] as String,
|
|
|
|
applicationKey: fields[1] as String,
|
2023-06-19 20:56:00 +00:00
|
|
|
provider: fields[2] == null
|
2023-06-29 09:52:09 +00:00
|
|
|
? BackupsProviderType.backblaze
|
|
|
|
: fields[2] as BackupsProviderType,
|
2023-06-16 01:28:45 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
2023-06-19 20:56:00 +00:00
|
|
|
void write(BinaryWriter writer, BackupsCredential obj) {
|
2023-06-16 01:28:45 +00:00
|
|
|
writer
|
2023-06-19 20:56:00 +00:00
|
|
|
..writeByte(3)
|
2023-06-16 01:28:45 +00:00
|
|
|
..writeByte(0)
|
|
|
|
..write(obj.keyId)
|
|
|
|
..writeByte(1)
|
2023-06-19 20:56:00 +00:00
|
|
|
..write(obj.applicationKey)
|
|
|
|
..writeByte(2)
|
|
|
|
..write(obj.provider);
|
2023-06-16 01:28:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
int get hashCode => typeId.hashCode;
|
|
|
|
|
|
|
|
@override
|
|
|
|
bool operator ==(Object other) =>
|
|
|
|
identical(this, other) ||
|
2023-06-19 20:56:00 +00:00
|
|
|
other is BackupsCredentialAdapter &&
|
2023-06-16 01:28:45 +00:00
|
|
|
runtimeType == other.runtimeType &&
|
|
|
|
typeId == other.typeId;
|
|
|
|
}
|
|
|
|
|
2023-06-29 09:52:09 +00:00
|
|
|
class BackupsProviderTypeAdapter extends TypeAdapter<BackupsProviderType> {
|
2023-06-16 01:28:45 +00:00
|
|
|
@override
|
|
|
|
final int typeId = 103;
|
|
|
|
|
|
|
|
@override
|
2023-06-29 09:52:09 +00:00
|
|
|
BackupsProviderType read(BinaryReader reader) {
|
2023-06-16 01:28:45 +00:00
|
|
|
switch (reader.readByte()) {
|
|
|
|
case 0:
|
2023-06-29 09:52:09 +00:00
|
|
|
return BackupsProviderType.none;
|
2023-06-16 01:28:45 +00:00
|
|
|
case 1:
|
2023-06-29 09:52:09 +00:00
|
|
|
return BackupsProviderType.memory;
|
2023-06-16 01:28:45 +00:00
|
|
|
case 2:
|
2023-06-29 09:52:09 +00:00
|
|
|
return BackupsProviderType.file;
|
2023-06-16 01:28:45 +00:00
|
|
|
case 3:
|
2023-06-29 09:52:09 +00:00
|
|
|
return BackupsProviderType.backblaze;
|
2023-06-16 01:28:45 +00:00
|
|
|
default:
|
2023-06-29 09:52:09 +00:00
|
|
|
return BackupsProviderType.none;
|
2023-06-16 01:28:45 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
2023-06-29 09:52:09 +00:00
|
|
|
void write(BinaryWriter writer, BackupsProviderType obj) {
|
2023-06-16 01:28:45 +00:00
|
|
|
switch (obj) {
|
2023-06-29 09:52:09 +00:00
|
|
|
case BackupsProviderType.none:
|
2023-06-16 01:28:45 +00:00
|
|
|
writer.writeByte(0);
|
|
|
|
break;
|
2023-06-29 09:52:09 +00:00
|
|
|
case BackupsProviderType.memory:
|
2023-06-16 01:28:45 +00:00
|
|
|
writer.writeByte(1);
|
|
|
|
break;
|
2023-06-29 09:52:09 +00:00
|
|
|
case BackupsProviderType.file:
|
2023-06-16 01:28:45 +00:00
|
|
|
writer.writeByte(2);
|
|
|
|
break;
|
2023-06-29 09:52:09 +00:00
|
|
|
case BackupsProviderType.backblaze:
|
2023-06-16 01:28:45 +00:00
|
|
|
writer.writeByte(3);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
int get hashCode => typeId.hashCode;
|
|
|
|
|
|
|
|
@override
|
|
|
|
bool operator ==(Object other) =>
|
|
|
|
identical(this, other) ||
|
2023-06-29 09:52:09 +00:00
|
|
|
other is BackupsProviderTypeAdapter &&
|
2023-06-16 01:28:45 +00:00
|
|
|
runtimeType == other.runtimeType &&
|
|
|
|
typeId == other.typeId;
|
|
|
|
}
|