{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://storeshot.art/schemas/cli/v1/whoami.json",
  "title": "storeshot whoami --json",
  "type": "object",
  "properties": {
    "schemaVersion": {
      "const": 1
    },
    "command": {
      "const": "whoami"
    },
    "ok": {
      "type": "boolean"
    },
    "exitCode": {
      "type": "integer"
    },
    "data": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "user": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "displayName": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "email": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "id",
                "displayName",
                "email"
              ],
              "additionalProperties": false
            },
            "credential": {
              "type": "object",
              "properties": {
                "type": {
                  "enum": [
                    "user_token",
                    "api_key"
                  ]
                },
                "environment": {
                  "enum": [
                    "test",
                    "live"
                  ]
                },
                "scopes": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "keyId": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "keyName": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "keyPrefix": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "expiresAt": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "type",
                "environment",
                "scopes",
                "keyId",
                "keyName",
                "keyPrefix",
                "expiresAt"
              ],
              "additionalProperties": false
            },
            "keySource": {
              "enum": [
                "flag",
                "env",
                "stored"
              ]
            },
            "baseUrl": {
              "type": "string"
            },
            "credentialsFile": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "required": [
            "user",
            "credential",
            "keySource",
            "baseUrl",
            "credentialsFile"
          ],
          "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
}
