fromJson static method
Returns a new ReplaceTenantPackageBody instance and imports its values from
value if it's a Map, null otherwise.
Implementation
// ignore: prefer_constructors_over_static_methods
static ReplaceTenantPackageBody? fromJson(dynamic value) {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
assert(json.containsKey(r'name'), 'Required key "ReplaceTenantPackageBody[name]" is missing from JSON.');
assert(json[r'name'] != null, 'Required key "ReplaceTenantPackageBody[name]" has a null value in JSON.');
assert(json.containsKey(r'monthlyCostUSD'), 'Required key "ReplaceTenantPackageBody[monthlyCostUSD]" is missing from JSON.');
assert(json[r'monthlyCostUSD'] != null, 'Required key "ReplaceTenantPackageBody[monthlyCostUSD]" has a null value in JSON.');
assert(json.containsKey(r'yearlyCostUSD'), 'Required key "ReplaceTenantPackageBody[yearlyCostUSD]" is missing from JSON.');
assert(json[r'yearlyCostUSD'] != null, 'Required key "ReplaceTenantPackageBody[yearlyCostUSD]" has a null value in JSON.');
assert(json.containsKey(r'maxMonthlyPageLoads'), 'Required key "ReplaceTenantPackageBody[maxMonthlyPageLoads]" is missing from JSON.');
assert(json[r'maxMonthlyPageLoads'] != null, 'Required key "ReplaceTenantPackageBody[maxMonthlyPageLoads]" has a null value in JSON.');
assert(json.containsKey(r'maxMonthlyAPICredits'), 'Required key "ReplaceTenantPackageBody[maxMonthlyAPICredits]" is missing from JSON.');
assert(json[r'maxMonthlyAPICredits'] != null, 'Required key "ReplaceTenantPackageBody[maxMonthlyAPICredits]" has a null value in JSON.');
assert(json.containsKey(r'maxMonthlyComments'), 'Required key "ReplaceTenantPackageBody[maxMonthlyComments]" is missing from JSON.');
assert(json[r'maxMonthlyComments'] != null, 'Required key "ReplaceTenantPackageBody[maxMonthlyComments]" has a null value in JSON.');
assert(json.containsKey(r'maxConcurrentUsers'), 'Required key "ReplaceTenantPackageBody[maxConcurrentUsers]" is missing from JSON.');
assert(json[r'maxConcurrentUsers'] != null, 'Required key "ReplaceTenantPackageBody[maxConcurrentUsers]" has a null value in JSON.');
assert(json.containsKey(r'maxTenantUsers'), 'Required key "ReplaceTenantPackageBody[maxTenantUsers]" is missing from JSON.');
assert(json[r'maxTenantUsers'] != null, 'Required key "ReplaceTenantPackageBody[maxTenantUsers]" has a null value in JSON.');
assert(json.containsKey(r'maxSSOUsers'), 'Required key "ReplaceTenantPackageBody[maxSSOUsers]" is missing from JSON.');
assert(json[r'maxSSOUsers'] != null, 'Required key "ReplaceTenantPackageBody[maxSSOUsers]" has a null value in JSON.');
assert(json.containsKey(r'maxModerators'), 'Required key "ReplaceTenantPackageBody[maxModerators]" is missing from JSON.');
assert(json[r'maxModerators'] != null, 'Required key "ReplaceTenantPackageBody[maxModerators]" has a null value in JSON.');
assert(json.containsKey(r'maxDomains'), 'Required key "ReplaceTenantPackageBody[maxDomains]" is missing from JSON.');
assert(json[r'maxDomains'] != null, 'Required key "ReplaceTenantPackageBody[maxDomains]" has a null value in JSON.');
assert(json.containsKey(r'hasDebranding'), 'Required key "ReplaceTenantPackageBody[hasDebranding]" is missing from JSON.');
assert(json[r'hasDebranding'] != null, 'Required key "ReplaceTenantPackageBody[hasDebranding]" has a null value in JSON.');
assert(json.containsKey(r'forWhoText'), 'Required key "ReplaceTenantPackageBody[forWhoText]" is missing from JSON.');
assert(json[r'forWhoText'] != null, 'Required key "ReplaceTenantPackageBody[forWhoText]" has a null value in JSON.');
assert(json.containsKey(r'featureTaglines'), 'Required key "ReplaceTenantPackageBody[featureTaglines]" is missing from JSON.');
assert(json[r'featureTaglines'] != null, 'Required key "ReplaceTenantPackageBody[featureTaglines]" has a null value in JSON.');
assert(json.containsKey(r'hasFlexPricing'), 'Required key "ReplaceTenantPackageBody[hasFlexPricing]" is missing from JSON.');
assert(json[r'hasFlexPricing'] != null, 'Required key "ReplaceTenantPackageBody[hasFlexPricing]" has a null value in JSON.');
return true;
}());
return ReplaceTenantPackageBody(
name: mapValueOfType<String>(json, r'name')!,
monthlyCostUSD: mapValueOfType<double>(json, r'monthlyCostUSD')!,
yearlyCostUSD: mapValueOfType<double>(json, r'yearlyCostUSD')!,
maxMonthlyPageLoads: mapValueOfType<double>(json, r'maxMonthlyPageLoads')!,
maxMonthlyAPICredits: mapValueOfType<double>(json, r'maxMonthlyAPICredits')!,
maxMonthlyComments: mapValueOfType<double>(json, r'maxMonthlyComments')!,
maxConcurrentUsers: mapValueOfType<double>(json, r'maxConcurrentUsers')!,
maxTenantUsers: mapValueOfType<double>(json, r'maxTenantUsers')!,
maxSSOUsers: mapValueOfType<double>(json, r'maxSSOUsers')!,
maxModerators: mapValueOfType<double>(json, r'maxModerators')!,
maxDomains: mapValueOfType<double>(json, r'maxDomains')!,
maxCustomCollectionSize: mapValueOfType<double>(json, r'maxCustomCollectionSize'),
hasDebranding: mapValueOfType<bool>(json, r'hasDebranding')!,
forWhoText: mapValueOfType<String>(json, r'forWhoText')!,
featureTaglines: json[r'featureTaglines'] is Iterable
? (json[r'featureTaglines'] as Iterable).cast<String>().toList(growable: false)
: const [],
hasFlexPricing: mapValueOfType<bool>(json, r'hasFlexPricing')!,
flexPageLoadCostCents: mapValueOfType<double>(json, r'flexPageLoadCostCents'),
flexPageLoadUnit: mapValueOfType<double>(json, r'flexPageLoadUnit'),
flexCommentCostCents: mapValueOfType<double>(json, r'flexCommentCostCents'),
flexCommentUnit: mapValueOfType<double>(json, r'flexCommentUnit'),
flexSSOUserCostCents: mapValueOfType<double>(json, r'flexSSOUserCostCents'),
flexSSOUserUnit: mapValueOfType<double>(json, r'flexSSOUserUnit'),
flexAPICreditCostCents: mapValueOfType<double>(json, r'flexAPICreditCostCents'),
flexAPICreditUnit: mapValueOfType<double>(json, r'flexAPICreditUnit'),
flexModeratorCostCents: mapValueOfType<double>(json, r'flexModeratorCostCents'),
flexModeratorUnit: mapValueOfType<double>(json, r'flexModeratorUnit'),
flexAdminCostCents: mapValueOfType<double>(json, r'flexAdminCostCents'),
flexAdminUnit: mapValueOfType<double>(json, r'flexAdminUnit'),
flexDomainCostCents: mapValueOfType<double>(json, r'flexDomainCostCents'),
flexDomainUnit: mapValueOfType<double>(json, r'flexDomainUnit'),
flexMinimumCostCents: mapValueOfType<double>(json, r'flexMinimumCostCents'),
);
}
return null;
}