LicenseCode.fromJson constructor
LicenseCode.fromJson(
- Object? j
Implementation
factory LicenseCode.fromJson(Object? j) {
final json = j as Map<String, Object?>;
return LicenseCode(
allowedReplacementLicenses: switch (json['allowedReplacementLicenses']) {
null => [],
List<Object?> $1 => [for (final i in $1) decodeString(i)],
_ => throw const FormatException(
'"allowedReplacementLicenses" is not a list',
),
},
appendableToDisk: switch (json['appendableToDisk']) {
null => null,
Object $1 => decodeBool($1),
},
creationTimestamp: switch (json['creationTimestamp']) {
null => null,
Object $1 => decodeString($1),
},
description: switch (json['description']) {
null => null,
Object $1 => decodeString($1),
},
id: switch (json['id']) {
null => null,
Object $1 => decodeUint64($1),
},
incompatibleLicenses: switch (json['incompatibleLicenses']) {
null => [],
List<Object?> $1 => [for (final i in $1) decodeString(i)],
_ => throw const FormatException(
'"incompatibleLicenses" is not a list',
),
},
kind: switch (json['kind']) {
null => null,
Object $1 => decodeString($1),
},
licenseAlias: switch (json['licenseAlias']) {
null => [],
List<Object?> $1 => [
for (final i in $1) LicenseCodeLicenseAlias.fromJson(i),
],
_ => throw const FormatException('"licenseAlias" is not a list'),
},
minimumRetention: switch (json['minimumRetention']) {
null => null,
Object $1 => Duration.fromJson($1),
},
multiTenantOnly: switch (json['multiTenantOnly']) {
null => null,
Object $1 => decodeBool($1),
},
name: switch (json['name']) {
null => null,
Object $1 => decodeString($1),
},
osLicense: switch (json['osLicense']) {
null => null,
Object $1 => decodeBool($1),
},
removableFromDisk: switch (json['removableFromDisk']) {
null => null,
Object $1 => decodeBool($1),
},
requiredCoattachedLicenses: switch (json['requiredCoattachedLicenses']) {
null => [],
List<Object?> $1 => [for (final i in $1) decodeString(i)],
_ => throw const FormatException(
'"requiredCoattachedLicenses" is not a list',
),
},
selfLink: switch (json['selfLink']) {
null => null,
Object $1 => decodeString($1),
},
soleTenantOnly: switch (json['soleTenantOnly']) {
null => null,
Object $1 => decodeBool($1),
},
state: switch (json['state']) {
null => null,
Object $1 => decodeString($1),
},
transferable: switch (json['transferable']) {
null => null,
Object $1 => decodeBool($1),
},
updateTimestamp: switch (json['updateTimestamp']) {
null => null,
Object $1 => decodeString($1),
},
);
}