{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/ivans/json-schema/ivans-paginated-market-config-credential-list-schema.json",
  "title": "PaginatedMarketConfigCredentialList",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/ivans-market-configurations-api-openapi.yml#/components/schemas/PaginatedMarketConfigCredentialList",
  "type": "object",
  "properties": {
    "count": {
      "type": "integer"
    },
    "next": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri"
    },
    "previous": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri"
    },
    "results": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/MarketConfigCredential"
      }
    }
  },
  "$defs": {
    "MarketConfigCredential": {
      "type": "object",
      "properties": {
        "uuid": {
          "type": "string",
          "format": "uuid",
          "readOnly": true
        },
        "nickname": {
          "type": "string",
          "maxLength": 128
        },
        "username": {
          "type": "string",
          "maxLength": 128
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time",
          "readOnly": true
        },
        "lastModifiedBy": {
          "$ref": "#/$defs/SimpleUser"
        },
        "marketConfiguration": {
          "type": "string"
        },
        "user": {
          "$ref": "#/$defs/SimpleUser"
        },
        "accessStructures": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/StructureAccess"
          }
        },
        "lastUsedOn": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        }
      },
      "required": [
        "accessStructures",
        "lastModifiedBy",
        "marketConfiguration",
        "nickname",
        "updatedAt",
        "user",
        "username",
        "uuid"
      ]
    },
    "SimpleUser": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "readOnly": true
        },
        "integratorUserId": {
          "type": "string"
        },
        "name": {
          "type": "string",
          "readOnly": true
        },
        "externalId": {
          "type": "string",
          "description": "Unique identifier from external system. Used to identify agents.",
          "maxLength": 64
        }
      },
      "required": [
        "id",
        "integratorUserId",
        "name"
      ]
    },
    "StructureAccess": {
      "type": "object",
      "properties": {
        "agency": {
          "$ref": "#/$defs/StructureChild"
        },
        "branch": {
          "$ref": "#/$defs/StructureChild"
        },
        "department": {
          "$ref": "#/$defs/StructureChild"
        },
        "businessUnit": {
          "$ref": "#/$defs/StructureChild"
        }
      },
      "required": [
        "agency",
        "branch",
        "businessUnit",
        "department"
      ]
    },
    "StructureChild": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "code": {
          "type": "string"
        },
        "name": {
          "type": "string"
        }
      },
      "required": [
        "code",
        "id",
        "name"
      ]
    }
  }
}