2021-03-26 13:38:39 +00:00
|
|
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
|
|
|
|
|
|
part of 'hetzner_server_info.dart';
|
|
|
|
|
|
|
|
// **************************************************************************
|
|
|
|
// JsonSerializableGenerator
|
|
|
|
// **************************************************************************
|
|
|
|
|
2022-01-25 17:00:47 +00:00
|
|
|
HetznerServerInfo _$HetznerServerInfoFromJson(Map<String, dynamic> json) =>
|
|
|
|
HetznerServerInfo(
|
|
|
|
json['id'] as int,
|
|
|
|
json['name'] as String,
|
|
|
|
$enumDecode(_$ServerStatusEnumMap, json['status']),
|
|
|
|
DateTime.parse(json['created'] as String),
|
|
|
|
HetznerServerTypeInfo.fromJson(
|
|
|
|
json['server_type'] as Map<String, dynamic>),
|
|
|
|
HetznerServerInfo.locationFromJson(json['datacenter'] as Map),
|
2022-05-19 17:43:25 +00:00
|
|
|
HetznerPublicNetInfo.fromJson(json['public_net'] as Map<String, dynamic>),
|
2022-05-20 22:56:50 +00:00
|
|
|
(json['volumes'] as List<dynamic>).map((e) => e as int).toList(),
|
2021-03-26 13:38:39 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
const _$ServerStatusEnumMap = {
|
|
|
|
ServerStatus.running: 'running',
|
|
|
|
ServerStatus.initializing: 'initializing',
|
|
|
|
ServerStatus.starting: 'starting',
|
|
|
|
ServerStatus.stopping: 'stopping',
|
|
|
|
ServerStatus.off: 'off',
|
|
|
|
ServerStatus.deleting: 'deleting',
|
|
|
|
ServerStatus.migrating: 'migrating',
|
|
|
|
ServerStatus.rebuilding: 'rebuilding',
|
|
|
|
ServerStatus.unknown: 'unknown',
|
|
|
|
};
|
|
|
|
|
2022-05-19 17:43:25 +00:00
|
|
|
HetznerPublicNetInfo _$HetznerPublicNetInfoFromJson(
|
|
|
|
Map<String, dynamic> json) =>
|
|
|
|
HetznerPublicNetInfo(
|
2022-05-20 22:56:50 +00:00
|
|
|
HetznerIp4.fromJson(json['ipv4'] as Map<String, dynamic>),
|
2022-05-19 17:43:25 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
HetznerIp4 _$HetznerIp4FromJson(Map<String, dynamic> json) => HetznerIp4(
|
|
|
|
json['id'] as int,
|
|
|
|
json['ip'] as String,
|
|
|
|
json['blocked'] as bool,
|
|
|
|
json['dns_ptr'] as String,
|
|
|
|
);
|
|
|
|
|
2021-03-26 13:38:39 +00:00
|
|
|
HetznerServerTypeInfo _$HetznerServerTypeInfoFromJson(
|
2022-01-25 17:00:47 +00:00
|
|
|
Map<String, dynamic> json) =>
|
|
|
|
HetznerServerTypeInfo(
|
|
|
|
json['cores'] as int,
|
|
|
|
json['memory'] as num,
|
|
|
|
json['disk'] as int,
|
|
|
|
(json['prices'] as List<dynamic>)
|
|
|
|
.map((e) => HetznerPriceInfo.fromJson(e as Map<String, dynamic>))
|
|
|
|
.toList(),
|
|
|
|
);
|
2021-03-26 13:38:39 +00:00
|
|
|
|
2022-01-25 17:00:47 +00:00
|
|
|
HetznerPriceInfo _$HetznerPriceInfoFromJson(Map<String, dynamic> json) =>
|
|
|
|
HetznerPriceInfo(
|
|
|
|
HetznerPriceInfo.getPrice(json['price_hourly'] as Map),
|
|
|
|
HetznerPriceInfo.getPrice(json['price_monthly'] as Map),
|
|
|
|
);
|
2021-03-26 13:38:39 +00:00
|
|
|
|
2022-01-25 17:00:47 +00:00
|
|
|
HetznerLocation _$HetznerLocationFromJson(Map<String, dynamic> json) =>
|
|
|
|
HetznerLocation(
|
|
|
|
json['country'] as String,
|
|
|
|
json['city'] as String,
|
|
|
|
json['description'] as String,
|
|
|
|
json['network_zone'] as String,
|
|
|
|
);
|