{
  "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",
                "credentialsSecret"
              ],
              "type": "object",
              "additionalProperties": false
            },
            "lastTransition": {
              "format": "date-time",
              "type": "string"
            },
            "lastWriteAt": {
              "format": "date-time",
              "type": "string"
            },
            "latestRestorableTime": {
              "format": "date-time",
              "type": "string"
            },
            "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"
            },
            "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
        },
        "replset": {
          "type": "string"
        },
        "selective": {
          "properties": {
            "namespaces": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "withUsersAndRoles": {
              "type": "boolean"
            }
          },
          "type": "object",
          "additionalProperties": false
        },
        "storageName": {
          "type": "string"
        }
      },
      "type": "object",
      "additionalProperties": false
    },
    "status": {
      "properties": {
        "completed": {
          "format": "date-time",
          "type": "string"
        },
        "error": {
          "type": "string"
        },
        "lastTransition": {
          "format": "date-time",
          "type": "string"
        },
        "pbmName": {
          "type": "string"
        },
        "pitrTarget": {
          "type": "string"
        },
        "state": {
          "type": "string"
        }
      },
      "type": "object",
      "additionalProperties": false
    }
  },
  "type": "object"
}
