{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/talend/json-schema/talend-sharing-response-schema.json",
  "title": "SharingResponse",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/talend-sharings-api-openapi.yml#/components/schemas/SharingResponse",
  "type": "object",
  "required": [
    "entityId",
    "entityType",
    "levelCode",
    "userId"
  ],
  "properties": {
    "entityType": {
      "type": "string"
    },
    "entityId": {
      "type": "string",
      "description": "UUID"
    },
    "userId": {
      "type": "string",
      "description": "UUID"
    },
    "levelCode": {
      "type": "string"
    },
    "entitlements": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "userOwners": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/UserSharingResponse"
      }
    },
    "groupOwners": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/GroupSharingResponse"
      }
    },
    "sharingSetCount": {
      "type": "integer",
      "format": "int32"
    },
    "isSharedWithOthers": {
      "type": "boolean"
    }
  },
  "$defs": {
    "ForeignEntity": {
      "type": "object",
      "required": [
        "entityId",
        "entityType"
      ],
      "properties": {
        "entityId": {
          "type": "string",
          "description": "UUID"
        },
        "entityType": {
          "type": "string"
        }
      }
    },
    "GroupSharingResponse": {
      "type": "object",
      "required": [
        "foreignEntity",
        "groupId",
        "level"
      ],
      "properties": {
        "groupId": {
          "type": "string",
          "description": "UUID"
        },
        "level": {
          "$ref": "#/$defs/LevelResponse"
        },
        "groupName": {
          "type": "string"
        },
        "foreignEntity": {
          "$ref": "#/$defs/ForeignEntity"
        },
        "deletedAt": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "LevelResponse": {
      "type": "object",
      "required": [
        "code",
        "label",
        "order"
      ],
      "description": "Description of a level access for an entity.",
      "properties": {
        "code": {
          "type": "string"
        },
        "label": {
          "type": "string"
        },
        "order": {
          "type": "integer",
          "format": "int32"
        }
      }
    },
    "UserSharingResponse": {
      "type": "object",
      "required": [
        "foreignEntity",
        "level",
        "userId"
      ],
      "properties": {
        "userId": {
          "type": "string",
          "description": "UUID"
        },
        "level": {
          "$ref": "#/$defs/LevelResponse"
        },
        "firstName": {
          "type": "string"
        },
        "lastName": {
          "type": "string"
        },
        "foreignEntity": {
          "$ref": "#/$defs/ForeignEntity"
        },
        "deletedAt": {
          "type": "string",
          "format": "date-time"
        }
      }
    }
  }
}