{
  "properties": {
    "apiVersion": {
      "type": "string"
    },
    "kind": {
      "type": "string"
    },
    "metadata": {
      "type": "object"
    },
    "spec": {
      "properties": {
        "backupName": {
          "type": "string"
        },
        "backupSource": {
          "properties": {
            "azure": {
              "properties": {
                "container": {
                  "type": "string"
                },
                "credentialsSecret": {
                  "type": "string"
                },
                "endpointUrl": {
                  "type": "string"
                },
                "prefix": {
                  "type": "string"
                }
              },
              "required": [
                "credentialsSecret"
              ],
              "type": "object",
              "additionalProperties": false
            },
            "completed": {
              "format": "date-time",
              "type": "string"
            },
            "destination": {
              "type": "string"
            },
            "error": {
              "type": "string"
            },
            "filesystem": {
              "properties": {
                "path": {
                  "type": "string"
                }
              },
              "required": [
                "path"
              ],
              "type": "object",
              "additionalProperties": false
            },
            "gcs": {
              "properties": {
                "bucket": {
                  "type": "string"
                },
                "chunkSize": {
                  "type": "integer"
                },
                "credentialsSecret": {
                  "type": "string"
                },
                "prefix": {
                  "type": "string"
                },
                "retryer": {
                  "properties": {
                    "backoffInitial": {
                      "format": "int64",
                      "type": "integer"
                    },
                    "backoffMax": {
                      "format": "int64",
                      "type": "integer"
                    },
                    "backoffMultiplier": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "backoffInitial",
                    "backoffMax",
                    "backoffMultiplier"
                  ],
                  "type": "object",
                  "additionalProperties": false
                }
              },
              "required": [
                "bucket"
              ],
              "type": "object",
              "additionalProperties": false
            },
            "lastTransition": {
              "format": "date-time",
              "type": "string"
            },
            "lastWriteAt": {
              "format": "date-time",
              "type": "string"
            },
            "latestRestorableTime": {
              "format": "date-time",
              "type": "string"
            },
            "minio": {
              "properties": {
                "bucket": {
                  "type": "string"
                },
                "caBundle": {
                  "properties": {
                    "key": {
                      "type": "string"
                    },
                    "name": {
                      "default": "",
                      "type": "string"
                    },
                    "optional": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "key"
                  ],
                  "type": "object",
                  "x-kubernetes-map-type": "atomic",
                  "additionalProperties": false
                },
                "credentialsSecret": {
                  "type": "string"
                },
                "debugTrace": {
                  "type": "boolean"
                },
                "endpointUrl": {
                  "type": "string"
                },
                "forcePathStyle": {
                  "type": "boolean"
                },
                "insecureSkipTLSVerify": {
                  "type": "boolean"
                },
                "partSize": {
                  "format": "int64",
                  "type": "integer"
                },
                "prefix": {
                  "type": "string"
                },
                "region": {
                  "type": "string"
                },
                "retryer": {
                  "properties": {
                    "numMaxRetries": {
                      "type": "integer"
                    }
                  },
                  "required": [
                    "numMaxRetries"
                  ],
                  "type": "object",
                  "additionalProperties": false
                },
                "secure": {
                  "type": "boolean"
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "oci": {
              "properties": {
                "bucket": {
                  "type": "string"
                },
                "credentials": {
                  "properties": {
                    "secretName": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    }
                  },
                  "type": "object",
                  "x-kubernetes-validations": [
                    {
                      "message": "secretName must be set when credentials type is userPrincipal",
                      "rule": "!has(self.type) || self.type != 'userPrincipal' || (has(self.secretName) && self.secretName != '')"
                    }
                  ],
                  "additionalProperties": false
                },
                "maxObjSizeGB": {
                  "type": "number"
                },
                "namespace": {
                  "type": "string"
                },
                "prefix": {
                  "type": "string"
                },
                "region": {
                  "type": "string"
                },
                "retryer": {
                  "properties": {
                    "maxAttempts": {
                      "type": "integer"
                    },
                    "maxBackoff": {
                      "format": "int64",
                      "type": "integer"
                    }
                  },
                  "required": [
                    "maxAttempts",
                    "maxBackoff"
                  ],
                  "type": "object",
                  "additionalProperties": false
                },
                "serverSideEncryption": {
                  "properties": {
                    "kmsKeyID": {
                      "type": "string"
                    },
                    "secretName": {
                      "type": "string"
                    }
                  },
                  "type": "object",
                  "additionalProperties": false
                },
                "uploadConcurrency": {
                  "type": "integer"
                },
                "uploadPartSize": {
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "bucket",
                "credentials",
                "namespace",
                "region"
              ],
              "type": "object",
              "additionalProperties": false
            },
            "oss": {
              "properties": {
                "bucket": {
                  "type": "string"
                },
                "connectTimeout": {
                  "type": "string"
                },
                "credentialsSecret": {
                  "type": "string"
                },
                "endpointUrl": {
                  "type": "string"
                },
                "maxUploadParts": {
                  "format": "int32",
                  "type": "integer"
                },
                "prefix": {
                  "type": "string"
                },
                "region": {
                  "type": "string"
                },
                "retryer": {
                  "properties": {
                    "baseDelay": {
                      "type": "string"
                    },
                    "maxAttempts": {
                      "type": "integer"
                    },
                    "maxBackoff": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "baseDelay",
                    "maxAttempts",
                    "maxBackoff"
                  ],
                  "type": "object",
                  "additionalProperties": false
                },
                "serverSideEncryption": {
                  "properties": {
                    "encryptionAlgorithm": {
                      "type": "string"
                    },
                    "encryptionKeyId": {
                      "type": "string"
                    },
                    "encryptionMethod": {
                      "type": "string"
                    },
                    "secretName": {
                      "type": "string"
                    }
                  },
                  "type": "object",
                  "additionalProperties": false
                },
                "uploadPartSize": {
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "credentialsSecret"
              ],
              "type": "object",
              "additionalProperties": false
            },
            "pbmName": {
              "type": "string"
            },
            "pbmPod": {
              "type": "string"
            },
            "pbmPods": {
              "additionalProperties": {
                "type": "string"
              },
              "type": "object"
            },
            "replsetNames": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "s3": {
              "properties": {
                "bucket": {
                  "type": "string"
                },
                "credentialsSecret": {
                  "type": "string"
                },
                "debugLogLevels": {
                  "type": "string"
                },
                "endpointUrl": {
                  "type": "string"
                },
                "forcePathStyle": {
                  "type": "boolean"
                },
                "insecureSkipTLSVerify": {
                  "type": "boolean"
                },
                "maxUploadParts": {
                  "format": "int32",
                  "type": "integer"
                },
                "prefix": {
                  "type": "string"
                },
                "region": {
                  "type": "string"
                },
                "retryer": {
                  "properties": {
                    "maxRetryDelay": {
                      "type": "string"
                    },
                    "minRetryDelay": {
                      "type": "string"
                    },
                    "numMaxRetries": {
                      "type": "integer"
                    }
                  },
                  "type": "object",
                  "additionalProperties": false
                },
                "serverSideEncryption": {
                  "properties": {
                    "kmsKeyID": {
                      "type": "string"
                    },
                    "sseAlgorithm": {
                      "type": "string"
                    },
                    "sseCustomerAlgorithm": {
                      "type": "string"
                    },
                    "sseCustomerKey": {
                      "type": "string"
                    }
                  },
                  "type": "object",
                  "additionalProperties": false
                },
                "storageClass": {
                  "type": "string"
                },
                "uploadPartSize": {
                  "type": "integer"
                }
              },
              "required": [
                "bucket"
              ],
              "type": "object",
              "additionalProperties": false
            },
            "size": {
              "type": "string"
            },
            "snapshots": {
              "items": {
                "properties": {
                  "replsetName": {
                    "type": "string"
                  },
                  "snapshotName": {
                    "type": "string"
                  }
                },
                "type": "object",
                "additionalProperties": false
              },
              "type": "array"
            },
            "start": {
              "format": "date-time",
              "type": "string"
            },
            "state": {
              "type": "string"
            },
            "storageName": {
              "type": "string"
            },
            "type": {
              "type": "string"
            }
          },
          "type": "object",
          "additionalProperties": false
        },
        "clusterName": {
          "type": "string"
        },
        "pitr": {
          "properties": {
            "date": {
              "type": "string"
            },
            "type": {
              "type": "string"
            }
          },
          "type": "object",
          "x-kubernetes-validations": [
            {
              "message": "Time should be in format YYYY-MM-DD HH:MM:SS with valid ranges (MM: 01-12, DD: 01-31, HH: 00-23, MM/SS: 00-59)",
              "rule": "self.type != 'date' || (has(self.date) && self.date.matches('^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01]) ([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]$'))"
            },
            {
              "message": "Date should not be used when 'latest' type is used",
              "rule": "self.type != 'latest' || !has(self.date)"
            }
          ],
          "additionalProperties": false
        },
        "replsetRemapping": {
          "additionalProperties": {
            "type": "string"
          },
          "type": "object"
        },
        "selective": {
          "properties": {
            "namespaces": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "nsFrom": {
              "type": "string"
            },
            "nsTo": {
              "type": "string"
            },
            "withUsersAndRoles": {
              "type": "boolean"
            }
          },
          "type": "object",
          "x-kubernetes-validations": [
            {
              "message": "nsFrom and nsTo need to be set together",
              "rule": "(!has(self.nsFrom) && !has(self.nsTo)) || (has(self.nsFrom) && has(self.nsTo))"
            },
            {
              "message": "nsFrom and nsTo can't be the same",
              "rule": "(!has(self.nsFrom) && !has(self.nsTo)) || self.nsFrom != self.nsTo"
            }
          ],
          "additionalProperties": false
        },
        "storageName": {
          "type": "string"
        }
      },
      "type": "object",
      "additionalProperties": false
    },
    "status": {
      "properties": {
        "completed": {
          "format": "date-time",
          "type": "string"
        },
        "conditions": {
          "items": {
            "properties": {
              "lastTransitionTime": {
                "format": "date-time",
                "type": "string"
              },
              "message": {
                "maxLength": 32768,
                "type": "string"
              },
              "observedGeneration": {
                "format": "int64",
                "minimum": 0,
                "type": "integer"
              },
              "reason": {
                "maxLength": 1024,
                "minLength": 1,
                "pattern": "^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$",
                "type": "string"
              },
              "status": {
                "enum": [
                  "True",
                  "False",
                  "Unknown"
                ],
                "type": "string"
              },
              "type": {
                "maxLength": 316,
                "pattern": "^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$",
                "type": "string"
              }
            },
            "required": [
              "lastTransitionTime",
              "message",
              "reason",
              "status",
              "type"
            ],
            "type": "object",
            "additionalProperties": false
          },
          "type": "array"
        },
        "error": {
          "type": "string"
        },
        "lastTransition": {
          "format": "date-time",
          "type": "string"
        },
        "pbmName": {
          "type": "string"
        },
        "pitrTarget": {
          "type": "string"
        },
        "state": {
          "type": "string"
        }
      },
      "type": "object",
      "additionalProperties": false
    }
  },
  "type": "object"
}
