toJson method

Map<String, Object> toJson()

Converts a ValidatingAdmissionPolicyBindingSpec instance to JSON data.

Implementation

Map<String, Object> toJson() {
  final jsonData = <String, Object>{};

  final tempMatchResources = matchResources;
  final tempParamRef = paramRef;
  final tempPolicyName = policyName;
  final tempValidationActions = validationActions;

  if (tempMatchResources != null) {
    jsonData['matchResources'] = tempMatchResources.toJson();
  }

  if (tempParamRef != null) {
    jsonData['paramRef'] = tempParamRef.toJson();
  }

  if (tempPolicyName != null) {
    jsonData['policyName'] = tempPolicyName;
  }

  if (tempValidationActions != null) {
    jsonData['validationActions'] = tempValidationActions;
  }

  return jsonData;
}