fromJson static method
Returns a new UpdateTenantBody instance and imports its values from
value if it's a Map, null otherwise.
Implementation
// ignore: prefer_constructors_over_static_methods
static UpdateTenantBody? 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(() {
return true;
}());
return UpdateTenantBody(
name: mapValueOfType<String>(json, r'name'),
email: mapValueOfType<String>(json, r'email'),
signUpDate: mapValueOfType<double>(json, r'signUpDate'),
packageId: mapValueOfType<String>(json, r'packageId'),
paymentFrequency: mapValueOfType<double>(json, r'paymentFrequency'),
billingInfoValid: mapValueOfType<bool>(json, r'billingInfoValid'),
billingHandledExternally: mapValueOfType<bool>(json, r'billingHandledExternally'),
createdBy: mapValueOfType<String>(json, r'createdBy'),
isSetup: mapValueOfType<bool>(json, r'isSetup'),
domainConfiguration: APIDomainConfiguration.listFromJson(json[r'domainConfiguration']),
billingInfo: BillingInfo.fromJson(json[r'billingInfo']),
stripeCustomerId: mapValueOfType<String>(json, r'stripeCustomerId'),
stripeSubscriptionId: mapValueOfType<String>(json, r'stripeSubscriptionId'),
stripePlanId: mapValueOfType<String>(json, r'stripePlanId'),
enableProfanityFilter: mapValueOfType<bool>(json, r'enableProfanityFilter'),
enableSpamFilter: mapValueOfType<bool>(json, r'enableSpamFilter'),
removeUnverifiedComments: mapValueOfType<bool>(json, r'removeUnverifiedComments'),
unverifiedCommentsTTLms: mapValueOfType<double>(json, r'unverifiedCommentsTTLms'),
commentsRequireApproval: mapValueOfType<bool>(json, r'commentsRequireApproval'),
autoApproveCommentOnVerification: mapValueOfType<bool>(json, r'autoApproveCommentOnVerification'),
sendProfaneToSpam: mapValueOfType<bool>(json, r'sendProfaneToSpam'),
deAnonIpAddr: mapValueOfType<double>(json, r'deAnonIpAddr'),
meta: mapCastOfType<String, String>(json, r'meta') ?? const {},
managedByTenantId: mapValueOfType<String>(json, r'managedByTenantId'),
);
}
return null;
}