MutatingWebhook.fromJson constructor
Creates a MutatingWebhook from JSON data.
Implementation
factory MutatingWebhook.fromJson(Map<String, dynamic> json) {
final tempAdmissionReviewVersionsJson = json['admissionReviewVersions'];
final tempClientConfigJson = json['clientConfig'];
final tempFailurePolicyJson = json['failurePolicy'];
final tempMatchConditionsJson = json['matchConditions'];
final tempMatchPolicyJson = json['matchPolicy'];
final tempNameJson = json['name'];
final tempNamespaceSelectorJson = json['namespaceSelector'];
final tempObjectSelectorJson = json['objectSelector'];
final tempReinvocationPolicyJson = json['reinvocationPolicy'];
final tempRulesJson = json['rules'];
final tempSideEffectsJson = json['sideEffects'];
final tempTimeoutSecondsJson = json['timeoutSeconds'];
final List<String> tempAdmissionReviewVersions =
List<String>.from(tempAdmissionReviewVersionsJson);
final WebhookClientConfig tempClientConfig =
WebhookClientConfig.fromJson(tempClientConfigJson);
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 String? tempMatchPolicy = tempMatchPolicyJson;
final String tempName = tempNameJson;
final LabelSelector? tempNamespaceSelector =
tempNamespaceSelectorJson != null
? LabelSelector.fromJson(tempNamespaceSelectorJson)
: null;
final LabelSelector? tempObjectSelector = tempObjectSelectorJson != null
? LabelSelector.fromJson(tempObjectSelectorJson)
: null;
final String? tempReinvocationPolicy = tempReinvocationPolicyJson;
final List<RuleWithOperations>? tempRules = tempRulesJson != null
? List<dynamic>.from(tempRulesJson)
.map(
(e) => RuleWithOperations.fromJson(
Map<String, dynamic>.from(e),
),
)
.toList()
: null;
final String tempSideEffects = tempSideEffectsJson;
final int? tempTimeoutSeconds = tempTimeoutSecondsJson;
return MutatingWebhook(
admissionReviewVersions: tempAdmissionReviewVersions,
clientConfig: tempClientConfig,
failurePolicy: tempFailurePolicy,
matchConditions: tempMatchConditions,
matchPolicy: tempMatchPolicy,
name: tempName,
namespaceSelector: tempNamespaceSelector,
objectSelector: tempObjectSelector,
reinvocationPolicy: tempReinvocationPolicy,
rules: tempRules,
sideEffects: tempSideEffects,
timeoutSeconds: tempTimeoutSeconds,
);
}