fix: Change sizeByte field to size for HetznerVolume

This commit is contained in:
NaiJi 2023-06-09 05:11:42 -03:00
parent 9d62d3af8e
commit 55f62f1200
3 changed files with 7 additions and 7 deletions

View file

@ -141,13 +141,13 @@ class HetznerLocation {
class HetznerVolume {
HetznerVolume(
this.id,
this.sizeByte,
this.size,
this.serverId,
this.name,
this.linuxDevice,
);
final int id;
final int sizeByte;
final int size;
final int? serverId;
final String name;

View file

@ -131,7 +131,7 @@ Map<String, dynamic> _$HetznerLocationToJson(HetznerLocation instance) =>
HetznerVolume _$HetznerVolumeFromJson(Map<String, dynamic> json) =>
HetznerVolume(
json['id'] as int,
json['sizeByte'] as int,
json['size'] as int,
json['serverId'] as int?,
json['name'] as String,
json['linux_device'] as String?,
@ -140,7 +140,7 @@ HetznerVolume _$HetznerVolumeFromJson(Map<String, dynamic> json) =>
Map<String, dynamic> _$HetznerVolumeToJson(HetznerVolume instance) =>
<String, dynamic>{
'id': instance.id,
'sizeByte': instance.sizeByte,
'size': instance.size,
'serverId': instance.serverId,
'name': instance.name,
'linux_device': instance.linuxDevice,

View file

@ -532,7 +532,7 @@ class HetznerServerProvider extends ServerProvider {
volume: ServerVolume(
id: volume.id,
name: volume.name,
sizeByte: volume.sizeByte * 1024 * 1024 * 1024,
sizeByte: volume.size * 1024 * 1024 * 1024,
serverId: volume.serverId,
linuxDevice: volume.linuxDevice,
),
@ -676,7 +676,7 @@ class HetznerServerProvider extends ServerProvider {
volume = ServerVolume(
id: result.data!.id,
name: result.data!.name,
sizeByte: result.data!.sizeByte * 1024 * 1024 * 1024,
sizeByte: result.data!.size * 1024 * 1024 * 1024,
serverId: result.data!.serverId,
linuxDevice: result.data!.linuxDevice,
);
@ -717,7 +717,7 @@ class HetznerServerProvider extends ServerProvider {
try {
for (final rawVolume in result.data) {
final int volumeId = rawVolume.id;
final int volumeSize = rawVolume.sizeByte * 1024 * 1024 * 1024;
final int volumeSize = rawVolume.size * 1024 * 1024 * 1024;
final volumeServer = rawVolume.serverId;
final String volumeName = rawVolume.name;
final volumeDevice = rawVolume.linuxDevice;