{
  "$id": "https://firefox-ci-tc.services.mozilla.com/schemas/queue/v1/post-artifact-response.json#",
  "$schema": "https://firefox-ci-tc.services.mozilla.com/schemas/common/metaschema.json#",
  "description": "Response to a request for posting an artifact.\nNote that the `storageType` property is referenced in the request as well.\n",
  "oneOf": [
    {
      "additionalProperties": false,
      "description": "Response to a request for a signed PUT URL that will allow you to\nupload an artifact to an S3 bucket managed by the queue.\n",
      "properties": {
        "contentType": {
          "description": "Artifact mime-type, must be specified as header when uploading with\nthe signed `putUrl`.\n",
          "maxLength": 255,
          "type": "string"
        },
        "expires": {
          "description": "Date-time after which the signed `putUrl` no longer works\n",
          "format": "date-time",
          "type": "string"
        },
        "putUrl": {
          "description": "URL to which a `PUT` request can be made to upload the artifact\nrequested. Note, the `Content-Length` must be specified correctly,\nand the `ContentType` header must be set the value specified below.\n",
          "format": "uri",
          "type": "string"
        },
        "storageType": {
          "description": "Artifact storage type, in this case `'s3'`\n",
          "enum": [
            "s3"
          ],
          "type": "string"
        }
      },
      "required": [
        "storageType",
        "putUrl",
        "expires",
        "contentType"
      ],
      "title": "S3 Artifact Response",
      "type": "object"
    },
    {
      "additionalProperties": false,
      "description": "Information supporting uploading an object to the object service.  This\nconsists of an object name and uploadId, together with credentials\nallowing an upload of the designated object to the service.  The\nresulting credentials are valid for 24 hours or until the artifact\nexpires, whichever is shorter, allowing ample time for any method\nnegotiation, retries, and so on.  The caller should call\n`object.createUpload` with the given credentials, and perform the upload.\nNote that the `uploadId`, `projectId`, and `expires` given to\n`createUpload` must match those in this response.  The caller should call\n`object.finishUpload` when the upload is finished, at which point the\nobject is immutable and the credentials are no longer useful.\n",
      "properties": {
        "credentials": {
          "$ref": "object-credentials.json#"
        },
        "expires": {
          "description": "Expiration time for the artifact.\n",
          "format": "date-time",
          "type": "string"
        },
        "name": {
          "description": "Name of the object on the object service.\n",
          "pattern": "^[\\x20-\\x7e]+$",
          "type": "string"
        },
        "projectId": {
          "description": "Project identifier.\n",
          "maxLength": 500,
          "minLength": 1,
          "pattern": "^([a-zA-Z0-9._/-]*)$",
          "title": "Project Identifier",
          "type": "string"
        },
        "storageType": {
          "description": "Artifact storage type, in this case `'object'`\n",
          "enum": [
            "object"
          ],
          "type": "string"
        },
        "uploadId": {
          "description": "Unique identifier for this upload.   Once an object is created with an uploadId,\nuploads of the same object with different uploadIds will be rejected.  Callers\nshould pass a randomly-generated slugid here.",
          "pattern": "^[A-Za-z0-9_-]{8}[Q-T][A-Za-z0-9_-][CGKOSWaeimquy26-][A-Za-z0-9_-]{10}[AQgw]$",
          "title": "Upload ID",
          "type": "string"
        }
      },
      "required": [
        "storageType",
        "name",
        "projectId",
        "uploadId",
        "credentials",
        "expires"
      ],
      "title": "Object Artifact Response",
      "type": "object"
    },
    {
      "additionalProperties": false,
      "description": "Response to a request for the queue to redirect to a URL for a given\nartifact.\n",
      "properties": {
        "storageType": {
          "description": "Artifact storage type, in this case `reference`\n",
          "enum": [
            "reference"
          ],
          "type": "string"
        }
      },
      "required": [
        "storageType"
      ],
      "title": "Redirect Artifact Response",
      "type": "object"
    },
    {
      "additionalProperties": false,
      "description": "Response for an artifact with `storageType` `link`.\n",
      "properties": {
        "storageType": {
          "description": "Artifact storage type, in this case `link`\n",
          "enum": [
            "link"
          ],
          "type": "string"
        }
      },
      "required": [
        "storageType"
      ],
      "title": "Link Artifact Response",
      "type": "object"
    },
    {
      "additionalProperties": false,
      "description": "Response to a request for the queue to reply `424` (Failed Dependency)\nwith `reason` and `message` to any `GET` request for this artifact.\n",
      "properties": {
        "storageType": {
          "description": "Artifact storage type, in this case `error`\n",
          "enum": [
            "error"
          ],
          "type": "string"
        }
      },
      "required": [
        "storageType"
      ],
      "title": "Error Artifact Response",
      "type": "object"
    }
  ],
  "title": "Post Artifact Response"
}