toJson method
Converts a ValidatingAdmissionPolicySpec instance to JSON data.
Implementation
Map<String, Object> toJson() {
final jsonData = <String, Object>{};
final tempAuditAnnotations = auditAnnotations;
final tempFailurePolicy = failurePolicy;
final tempMatchConditions = matchConditions;
final tempMatchConstraints = matchConstraints;
final tempParamKind = paramKind;
final tempValidations = validations;
if (tempAuditAnnotations != null) {
jsonData['auditAnnotations'] =
tempAuditAnnotations.map((e) => e.toJson()).toList(growable: false);
}
if (tempFailurePolicy != null) {
jsonData['failurePolicy'] = tempFailurePolicy;
}
if (tempMatchConditions != null) {
jsonData['matchConditions'] =
tempMatchConditions.map((e) => e.toJson()).toList(growable: false);
}
if (tempMatchConstraints != null) {
jsonData['matchConstraints'] = tempMatchConstraints.toJson();
}
if (tempParamKind != null) {
jsonData['paramKind'] = tempParamKind.toJson();
}
if (tempValidations != null) {
jsonData['validations'] =
tempValidations.map((e) => e.toJson()).toList(growable: false);
}
return jsonData;
}