{
  "name": "CreateDeployment",
  "plane": "control",
  "terraformEligible": false,
  "protocol": {
    "kind": "cloudJson",
    "target": "CloudSites.CreateDeployment",
    "service": "sites"
  },
  "requestBody": "typed",
  "responseBody": "typed",
  "requestSchema": {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "additionalProperties": false,
    "definitions": {
      "CsrfMode": {
        "enum": [
          "SAME_ORIGIN",
          "ORIGIN_ALLOWLIST",
          "DISABLED"
        ],
        "type": "string"
      },
      "CsrfPolicy": {
        "additionalProperties": false,
        "properties": {
          "allowedOrigins": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "mode": {
            "allOf": [
              {
                "$ref": "#/definitions/CsrfMode"
              }
            ],
            "default": "SAME_ORIGIN"
          }
        },
        "type": "object"
      },
      "DeploymentManifest": {
        "description": "Canonical SiteBundle shape accepted by CreateDeployment. Extra adapter metadata is allowed so framework adapters can evolve without forking the control-plane wire; asset/origin contracts stay typed.",
        "properties": {
          "adapterId": {
            "type": [
              "string",
              "null"
            ]
          },
          "adapterVersion": {
            "type": [
              "string",
              "null"
            ]
          },
          "apiOrigin": {
            "description": "Optional same-origin API upstream for the edge Worker (e.g. tenant gateway).",
            "type": [
              "string",
              "null"
            ]
          },
          "assets": {
            "items": {
              "$ref": "#/definitions/ManifestAsset"
            },
            "type": "array"
          },
          "cleanUrls": {
            "default": false,
            "type": "boolean"
          },
          "compatibilityDate": {
            "type": [
              "string",
              "null"
            ]
          },
          "compatibilityFlags": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "contentDigest": {
            "type": [
              "string",
              "null"
            ]
          },
          "dynamicRedirects": {
            "items": {
              "$ref": "#/definitions/RedirectRule"
            },
            "type": "array"
          },
          "formRoutes": {
            "items": {
              "$ref": "#/definitions/FormRoute"
            },
            "type": "array"
          },
          "frameworkId": {
            "type": [
              "string",
              "null"
            ]
          },
          "frameworkVersion": {
            "type": [
              "string",
              "null"
            ]
          },
          "headers": {
            "items": {
              "$ref": "#/definitions/HeaderRule"
            },
            "type": "array"
          },
          "notFoundDocument": {
            "type": [
              "string",
              "null"
            ]
          },
          "originBindings": {
            "items": {
              "$ref": "#/definitions/OriginBinding"
            },
            "type": "array"
          },
          "redirects": {
            "items": {
              "$ref": "#/definitions/RedirectRule"
            },
            "type": "array"
          },
          "rewrites": {
            "items": true,
            "type": "array"
          },
          "schemaVersion": {
            "format": "uint32",
            "minimum": 0.0,
            "type": [
              "integer",
              "null"
            ]
          },
          "spaFallback": {
            "default": false,
            "type": "boolean"
          },
          "workerBundle": {
            "anyOf": [
              {
                "$ref": "#/definitions/WorkerBundle"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "assets"
        ],
        "type": "object"
      },
      "FormRoute": {
        "additionalProperties": false,
        "properties": {
          "apiId": {
            "type": "string"
          },
          "contentTypes": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "csrf": {
            "allOf": [
              {
                "$ref": "#/definitions/CsrfPolicy"
              }
            ],
            "default": {
              "mode": "SAME_ORIGIN"
            }
          },
          "integrationId": {
            "type": "string"
          },
          "logicalId": {
            "type": "string"
          },
          "maxBodyBytes": {
            "default": 1048576,
            "format": "uint64",
            "minimum": 0.0,
            "type": "integer"
          },
          "path": {
            "type": "string"
          },
          "rateLimitClass": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "apiId",
          "integrationId",
          "logicalId",
          "path"
        ],
        "type": "object"
      },
      "HeaderRule": {
        "additionalProperties": false,
        "properties": {
          "headers": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "path": {
            "type": "string"
          }
        },
        "required": [
          "headers",
          "path"
        ],
        "type": "object"
      },
      "HttpMethod": {
        "enum": [
          "GET",
          "POST",
          "PUT",
          "PATCH",
          "DELETE",
          "HEAD",
          "OPTIONS"
        ],
        "type": "string"
      },
      "ManifestAsset": {
        "properties": {
          "byteLength": {
            "format": "uint64",
            "minimum": 0.0,
            "type": "integer"
          },
          "cacheClass": {
            "type": [
              "string",
              "null"
            ]
          },
          "contentDigest": {
            "type": "string"
          },
          "contentType": {
            "type": [
              "string",
              "null"
            ]
          },
          "key": {
            "type": "string"
          }
        },
        "required": [
          "byteLength",
          "contentDigest",
          "key"
        ],
        "type": "object"
      },
      "OriginBinding": {
        "additionalProperties": false,
        "properties": {
          "apiId": {
            "type": "string"
          },
          "integrationId": {
            "type": "string"
          },
          "logicalId": {
            "type": "string"
          },
          "methods": {
            "items": {
              "$ref": "#/definitions/HttpMethod"
            },
            "type": "array"
          },
          "path": {
            "type": "string"
          }
        },
        "required": [
          "apiId",
          "integrationId",
          "logicalId",
          "methods",
          "path"
        ],
        "type": "object"
      },
      "RedirectRule": {
        "additionalProperties": false,
        "properties": {
          "from": {
            "type": "string"
          },
          "status": {
            "default": 301,
            "format": "uint16",
            "minimum": 0.0,
            "type": "integer"
          },
          "to": {
            "type": "string"
          }
        },
        "required": [
          "from",
          "to"
        ],
        "type": "object"
      },
      "WorkerBundle": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "$ref": "#/definitions/WorkerBundleDescribed"
          }
        ]
      },
      "WorkerBundleDescribed": {
        "properties": {
          "byteLength": {
            "format": "uint64",
            "minimum": 0.0,
            "type": [
              "integer",
              "null"
            ]
          },
          "entry": {
            "type": "string"
          }
        },
        "required": [
          "entry"
        ],
        "type": "object"
      }
    },
    "properties": {
      "adapterId": {
        "default": null,
        "type": [
          "string",
          "null"
        ]
      },
      "clientToken": {
        "default": null,
        "type": [
          "string",
          "null"
        ]
      },
      "contentDigest": {
        "type": "string"
      },
      "frameworkId": {
        "default": null,
        "type": [
          "string",
          "null"
        ]
      },
      "manifest": {
        "$ref": "#/definitions/DeploymentManifest"
      },
      "siteId": {
        "type": "string"
      }
    },
    "required": [
      "contentDigest",
      "manifest",
      "siteId"
    ],
    "title": "CreateDeploymentRequest",
    "type": "object"
  },
  "responseSchema": {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "definitions": {
      "DeploymentPutUrl": {
        "properties": {
          "contentDigest": {
            "type": "string"
          },
          "headers": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "key": {
            "type": "string"
          },
          "url": {
            "type": "string"
          }
        },
        "required": [
          "contentDigest",
          "headers",
          "key",
          "url"
        ],
        "type": "object"
      },
      "DeploymentStatus": {
        "enum": [
          "UPLOADING",
          "READY",
          "FAILED",
          "DELETED"
        ],
        "type": "string"
      },
      "DeploymentUploadSession": {
        "properties": {
          "expiresAt": {
            "type": "string"
          },
          "putUrls": {
            "items": {
              "$ref": "#/definitions/DeploymentPutUrl"
            },
            "type": "array"
          },
          "uploadId": {
            "type": "string"
          }
        },
        "required": [
          "expiresAt",
          "uploadId"
        ],
        "type": "object"
      }
    },
    "properties": {
      "adapterId": {
        "type": [
          "string",
          "null"
        ]
      },
      "contentDigest": {
        "type": "string"
      },
      "deploymentId": {
        "type": "string"
      },
      "detail": {
        "type": [
          "string",
          "null"
        ]
      },
      "frameworkId": {
        "type": [
          "string",
          "null"
        ]
      },
      "previewHostname": {
        "type": [
          "string",
          "null"
        ]
      },
      "siteId": {
        "type": "string"
      },
      "status": {
        "$ref": "#/definitions/DeploymentStatus"
      },
      "upload": {
        "anyOf": [
          {
            "$ref": "#/definitions/DeploymentUploadSession"
          },
          {
            "type": "null"
          }
        ]
      }
    },
    "required": [
      "contentDigest",
      "deploymentId",
      "siteId",
      "status"
    ],
    "title": "DeploymentDescription",
    "type": "object"
  }
}
