{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "properties": {
    "apiVersion": {
      "type": "string"
    },
    "kind": {
      "type": "string"
    },
    "metadata": {
      "type": "object"
    },
    "spec": {
      "properties": {
        "source": {
          "properties": {
            "persistentVolumeClaimName": {
              "type": "string",
              "x-kubernetes-validations": [
                {
                  "message": "persistentVolumeClaimName is immutable",
                  "rule": "self == oldSelf"
                }
              ]
            },
            "volumeSnapshotContentName": {
              "type": "string",
              "x-kubernetes-validations": [
                {
                  "message": "volumeSnapshotContentName is immutable",
                  "rule": "self == oldSelf"
                }
              ]
            }
          },
          "type": "object",
          "x-kubernetes-validations": [
            {
              "message": "persistentVolumeClaimName is required once set",
              "rule": "!has(oldSelf.persistentVolumeClaimName) || has(self.persistentVolumeClaimName)"
            },
            {
              "message": "volumeSnapshotContentName is required once set",
              "rule": "!has(oldSelf.volumeSnapshotContentName) || has(self.volumeSnapshotContentName)"
            },
            {
              "message": "exactly one of volumeSnapshotContentName and persistentVolumeClaimName must be set",
              "rule": "(has(self.volumeSnapshotContentName) && !has(self.persistentVolumeClaimName)) || (!has(self.volumeSnapshotContentName) && has(self.persistentVolumeClaimName))"
            }
          ]
        },
        "volumeSnapshotClassName": {
          "type": "string",
          "x-kubernetes-validations": [
            {
              "message": "volumeSnapshotClassName must not be the empty string when set",
              "rule": "size(self) > 0"
            }
          ]
        }
      },
      "required": [
        "source"
      ],
      "type": "object"
    },
    "status": {
      "properties": {
        "boundVolumeSnapshotContentName": {
          "type": "string"
        },
        "creationTime": {
          "format": "date-time",
          "type": "string"
        },
        "error": {
          "properties": {
            "message": {
              "type": "string"
            },
            "time": {
              "format": "date-time",
              "type": "string"
            }
          },
          "type": "object"
        },
        "readyToUse": {
          "type": "boolean"
        },
        "restoreSize": {
          "pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$",
          "type": "string",
          "x-kubernetes-int-or-string": true
        },
        "volumeGroupSnapshotName": {
          "type": "string"
        }
      },
      "type": "object"
    }
  },
  "required": [
    "spec"
  ],
  "type": "object"
}
