{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://storeshot.art/schemas/cli/v1/generate.json",
  "title": "storeshot generate --json",
  "type": "object",
  "properties": {
    "schemaVersion": {
      "const": 1
    },
    "command": {
      "const": "generate"
    },
    "ok": {
      "type": "boolean"
    },
    "exitCode": {
      "type": "integer"
    },
    "data": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "environment": {
              "enum": [
                "test",
                "live"
              ]
            },
            "creditsCharged": {
              "type": "integer"
            },
            "creditsRefunded": {
              "type": "integer"
            },
            "waited": {
              "anyOf": [
                {
                  "type": "object",
                  "properties": {
                    "seconds": {
                      "type": "integer"
                    },
                    "timedOut": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "seconds",
                    "timedOut"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "null"
                }
              ]
            },
            "generations": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "input": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "uploadId": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "id": {
                    "type": "string"
                  },
                  "status": {
                    "enum": [
                      "queued",
                      "running",
                      "succeeded",
                      "failed",
                      "canceled"
                    ]
                  },
                  "environment": {
                    "enum": [
                      "test",
                      "live"
                    ]
                  },
                  "store": {
                    "enum": [
                      "app_store",
                      "google_play"
                    ]
                  },
                  "device": {
                    "type": "string"
                  },
                  "width": {
                    "type": "integer"
                  },
                  "height": {
                    "type": "integer"
                  },
                  "creditsCharged": {
                    "type": "integer"
                  },
                  "creditsRefunded": {
                    "type": "integer"
                  },
                  "error": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "input",
                  "uploadId",
                  "id",
                  "status",
                  "environment",
                  "store",
                  "device",
                  "width",
                  "height",
                  "creditsCharged",
                  "creditsRefunded",
                  "error"
                ],
                "additionalProperties": false
              }
            },
            "download": {
              "anyOf": [
                {
                  "type": "object",
                  "properties": {
                    "folder": {
                      "type": "string"
                    },
                    "files": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "path": {
                            "type": "string"
                          },
                          "relativePath": {
                            "type": "string"
                          },
                          "bytes": {
                            "type": "integer"
                          },
                          "sha256": {
                            "type": "string"
                          },
                          "store": {
                            "anyOf": [
                              {
                                "enum": [
                                  "app_store",
                                  "google_play"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "device": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "position": {
                            "anyOf": [
                              {
                                "type": "integer"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "path",
                          "relativePath",
                          "bytes",
                          "sha256",
                          "store",
                          "device",
                          "position"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "folder",
                    "files"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "required": [
            "environment",
            "creditsCharged",
            "creditsRefunded",
            "waited",
            "generations",
            "download"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    },
    "warnings": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "error": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "code": {
              "type": "string"
            },
            "message": {
              "type": "string"
            },
            "hint": {
              "type": "string"
            },
            "status": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ]
            },
            "requestId": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "docUrl": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "retryAfterSeconds": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ]
            },
            "details": {
              "type": "object"
            }
          },
          "required": [
            "code",
            "message",
            "hint",
            "status",
            "requestId",
            "docUrl",
            "retryAfterSeconds"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "schemaVersion",
    "command",
    "ok",
    "exitCode",
    "data",
    "warnings",
    "error"
  ],
  "additionalProperties": false
}
