{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/if/json-schema/if-user-invitation-list-response-schema.json",
  "title": "UserInvitationListResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/if-user-invitations-api-openapi.yml#/components/schemas/UserInvitationListResponse",
  "required": [
    "connect",
    "data",
    "metadata",
    "workflow"
  ],
  "type": "object",
  "properties": {
    "workflow": {
      "$ref": "#/$defs/UserInvitationListWorkflowContainer"
    },
    "data": {
      "$ref": "#/$defs/UserInvitationListDataContainer"
    },
    "connect": {
      "$ref": "#/$defs/UserInvitationListConnectContainer"
    },
    "metadata": {
      "$ref": "#/$defs/UserInvitationListMetadataContainer"
    }
  },
  "$defs": {
    "PageMetadata": {
      "required": [
        "number",
        "size",
        "totalElements",
        "totalPages"
      ],
      "type": "object",
      "properties": {
        "size": {
          "minimum": 0,
          "type": "integer",
          "description": "number of elements in this page",
          "format": "int32"
        },
        "number": {
          "minimum": 0,
          "type": "integer",
          "description": "index of page starting from 0",
          "format": "int32"
        },
        "totalElements": {
          "minimum": 0,
          "type": "integer",
          "description": "total number of elements in all of the pages",
          "format": "int64",
          "readOnly": true
        },
        "totalPages": {
          "minimum": 0,
          "type": "integer",
          "description": "number of total pages",
          "format": "int32",
          "readOnly": true
        }
      }
    },
    "UserClientRelationType": {
      "type": "string",
      "description": "user's relation with client",
      "enum": [
        "director",
        "shareholder",
        "director-and-shareholder",
        "authorized-person"
      ]
    },
    "UserInvitation": {
      "required": [
        "clientId",
        "id",
        "status",
        "userClientRelation"
      ],
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "readOnly": true
        },
        "clientId": {
          "type": "string",
          "format": "uuid"
        },
        "userClientRelation": {
          "$ref": "#/$defs/UserClientRelationType"
        },
        "status": {
          "$ref": "#/$defs/UserInvitationStatus"
        }
      }
    },
    "UserInvitationListConnectContainer": {
      "type": "object"
    },
    "UserInvitationListDataContainer": {
      "required": [
        "userInvitations"
      ],
      "type": "object",
      "properties": {
        "userInvitation": {
          "$ref": "#/$defs/UserInvitationListQueryInput"
        },
        "userInvitations": {
          "type": "array",
          "description": "collection of user invitations",
          "readOnly": true,
          "items": {
            "$ref": "#/$defs/UserInvitation"
          }
        }
      }
    },
    "UserInvitationListMetadataContainer": {
      "required": [
        "page"
      ],
      "type": "object",
      "properties": {
        "page": {
          "$ref": "#/$defs/PageMetadata"
        }
      }
    },
    "UserInvitationListQueryInput": {
      "type": "object",
      "properties": {
        "clientId": {
          "type": "string",
          "format": "uuid"
        },
        "userClientRelation": {
          "$ref": "#/$defs/UserClientRelationType"
        },
        "status": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/UserInvitationStatus"
          }
        }
      },
      "writeOnly": true
    },
    "UserInvitationListWorkflowContainer": {
      "type": "object"
    },
    "UserInvitationStatus": {
      "type": "string",
      "description": "status of invitation",
      "readOnly": true,
      "enum": [
        "accepted",
        "pending",
        "rejected",
        "cancelled"
      ]
    }
  }
}