toJson method
Converts a ValidatingWebhook instance to JSON data.
Implementation
Map<String, Object> toJson() {
final jsonData = <String, Object>{};
final tempAdmissionReviewVersions = admissionReviewVersions;
final tempClientConfig = clientConfig;
final tempFailurePolicy = failurePolicy;
final tempMatchConditions = matchConditions;
final tempMatchPolicy = matchPolicy;
final tempName = name;
final tempNamespaceSelector = namespaceSelector;
final tempObjectSelector = objectSelector;
final tempRules = rules;
final tempSideEffects = sideEffects;
final tempTimeoutSeconds = timeoutSeconds;
jsonData['admissionReviewVersions'] = tempAdmissionReviewVersions;
jsonData['clientConfig'] = tempClientConfig.toJson();
if (tempFailurePolicy != null) {
jsonData['failurePolicy'] = tempFailurePolicy;
}
if (tempMatchConditions != null) {
jsonData['matchConditions'] =
tempMatchConditions.map((e) => e.toJson()).toList(growable: false);
}
if (tempMatchPolicy != null) {
jsonData['matchPolicy'] = tempMatchPolicy;
}
jsonData['name'] = tempName;
if (tempNamespaceSelector != null) {
jsonData['namespaceSelector'] = tempNamespaceSelector.toJson();
}
if (tempObjectSelector != null) {
jsonData['objectSelector'] = tempObjectSelector.toJson();
}
if (tempRules != null) {
jsonData['rules'] =
tempRules.map((e) => e.toJson()).toList(growable: false);
}
jsonData['sideEffects'] = tempSideEffects;
if (tempTimeoutSeconds != null) {
jsonData['timeoutSeconds'] = tempTimeoutSeconds;
}
return jsonData;
}