{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/dbt-se/json-schema/dbt-se-get-session-response-body-schema.json",
  "title": "GetSessionResponseBody",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/dbt-se-banking-api-openapi.yml#/components/schemas/GetSessionResponseBody",
  "oneOf": [
    {
      "$ref": "#/$defs/GetSessionResponseBodyPendingInternal"
    },
    {
      "$ref": "#/$defs/GetSessionResponseBodyPendingExternal"
    },
    {
      "$ref": "#/$defs/GetSessionResponseBodyPendingFailed"
    },
    {
      "$ref": "#/$defs/GetSessionResponseBodyPendingConnected"
    },
    {
      "$ref": "#/$defs/GetSessionResponseBodyPendingCompleted"
    }
  ],
  "$defs": {
    "GetSessionResponseBodyPendingCompleted": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "enum": [
            "completed"
          ]
        }
      },
      "required": [
        "id",
        "status"
      ],
      "description": "The user has selected which account is the payout account"
    },
    "GetSessionResponseBodyPendingConnected": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "enum": [
            "connected"
          ]
        }
      },
      "required": [
        "id",
        "status"
      ],
      "description": "We have received data"
    },
    "GetSessionResponseBodyPendingExternal": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "enum": [
            "pending-external"
          ]
        },
        "externalUrl": {
          "type": "string",
          "format": "uri"
        }
      },
      "required": [
        "id",
        "status",
        "externalUrl"
      ],
      "description": "We're waiting on an external process"
    },
    "GetSessionResponseBodyPendingFailed": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "enum": [
            "failed"
          ]
        },
        "failureReason": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "cancelled-by-user",
            "invalid-credentials",
            "invalid-request",
            "unknown",
            null
          ]
        }
      },
      "required": [
        "id",
        "status",
        "failureReason"
      ],
      "description": "We failed to connect"
    },
    "GetSessionResponseBodyPendingInternal": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "enum": [
            "pending-internal"
          ]
        }
      },
      "required": [
        "id",
        "status"
      ],
      "description": "We're waiting on an internal process"
    }
  }
}