ValidatingAdmissionPolicySpec.fromJson constructor
Creates a ValidatingAdmissionPolicySpec from JSON data.
Implementation
factory ValidatingAdmissionPolicySpec.fromJson(Map<String, dynamic> json) {
final tempAuditAnnotationsJson = json['auditAnnotations'];
final tempFailurePolicyJson = json['failurePolicy'];
final tempMatchConditionsJson = json['matchConditions'];
final tempMatchConstraintsJson = json['matchConstraints'];
final tempParamKindJson = json['paramKind'];
final tempValidationsJson = json['validations'];
final List<AuditAnnotation>? tempAuditAnnotations =
tempAuditAnnotationsJson != null
? List<dynamic>.from(tempAuditAnnotationsJson)
.map(
(e) => AuditAnnotation.fromJson(
Map<String, dynamic>.from(e),
),
)
.toList()
: null;
final String? tempFailurePolicy = tempFailurePolicyJson;
final List<MatchCondition>? tempMatchConditions =
tempMatchConditionsJson != null
? List<dynamic>.from(tempMatchConditionsJson)
.map(
(e) => MatchCondition.fromJson(
Map<String, dynamic>.from(e),
),
)
.toList()
: null;
final MatchResources? tempMatchConstraints =
tempMatchConstraintsJson != null
? MatchResources.fromJson(tempMatchConstraintsJson)
: null;
final ParamKind? tempParamKind = tempParamKindJson != null
? ParamKind.fromJson(tempParamKindJson)
: null;
final List<Validation>? tempValidations = tempValidationsJson != null
? List<dynamic>.from(tempValidationsJson)
.map(
(e) => Validation.fromJson(
Map<String, dynamic>.from(e),
),
)
.toList()
: null;
return ValidatingAdmissionPolicySpec(
auditAnnotations: tempAuditAnnotations,
failurePolicy: tempFailurePolicy,
matchConditions: tempMatchConditions,
matchConstraints: tempMatchConstraints,
paramKind: tempParamKind,
validations: tempValidations,
);
}