{
  "swagger": "2.0",
  "info": {
    "description": "Manage how your users and groups can access your Talend Cloud entities.",
    "version": "2021-03",
    "title": "Sharing",
    "contact": {
      "name": "Talend"
    }
  },
  "host": "api.eu.cloud.talend.com",
  "schemes": [
    "https"
  ],
  "paths": {
    "/sharing/sharingset/{entityType}/{entityId}": {
      "get": {
        "tags": [
          "SharingSet"
        ],
        "summary": "Get a sharingset for an entity",
        "description": "Use this method to retrieve a sharingset.\nA sharingset represents the full list of users and groups who have access to the specified entity.",
        "operationId": "getApiV1SharingsetEntitytypeEntityid",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "foreignEntityType",
            "in": "query",
            "required": false,
            "type": "string",
            "x-example": "api_test"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32",
            "description": "Limits the number of elements displayed in the sharingset.",
            "x-example": 100
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32",
            "x-example": 1000
          },
          {
            "name": "includeDeletedSharings",
            "in": "query",
            "required": false,
            "type": "boolean",
            "description": "True or false",
            "default": false
          },
          {
            "name": "foreignEntityId",
            "in": "query",
            "required": false,
            "type": "string",
            "x-example": "15de7eb2-6447-49a8-a404-a53ecd1f3473"
          },
          {
            "name": "X-CLIENT-VERSION",
            "in": "header",
            "required": false,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "Status 200",
            "schema": {
              "$ref": "#/definitions/SharingSetResponse"
            }
          },
          "400": {
            "description": "Bad request",
            "schema": {
              "$ref": "#/definitions/ErrorMessageBody"
            }
          },
          "401": {
            "description": "Not authenticated",
            "schema": {
              "$ref": "#/definitions/ErrorMessageBody"
            }
          },
          "403": {
            "description": "Not authorized",
            "schema": {
              "$ref": "#/definitions/ErrorMessageBody"
            }
          },
          "404": {
            "description": "Not found",
            "schema": {
              "$ref": "#/definitions/ErrorMessageBody"
            }
          },
          "500": {
            "description": "Internal Server Error",
            "schema": {
              "$ref": "#/definitions/ErrorMessageBody"
            }
          },
          "502": {
            "description": "Bad gateway",
            "schema": {
              "$ref": "#/definitions/ErrorMessageBody"
            }
          },
          "503": {
            "description": "Service unavailable",
            "schema": {
              "$ref": "#/definitions/ErrorMessageBody"
            }
          }
        }
      },
      "put": {
        "tags": [
          "SharingSet"
        ],
        "summary": "Update a sharingset for an entity",
        "description": "A sharingset represents the full list of users and groups who have access to the specified entity.\nUse this method to update the sharingset by defining who can access a given entity, and with which access level (viewer, editor, owner). This PUT operation allows you to replace the whole sharingset with the new information.",
        "operationId": "putApiV1SharingsetEntitytypeEntityid",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "X-CLIENT-VERSION",
            "in": "header",
            "required": false,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/PutSharingSetRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Status 200",
            "schema": {
              "$ref": "#/definitions/SharingSetKey"
            }
          },
          "400": {
            "description": "Bad request",
            "schema": {
              "$ref": "#/definitions/ErrorMessageBody"
            }
          },
          "401": {
            "description": "Not authenticated",
            "schema": {
              "$ref": "#/definitions/ErrorMessageBody"
            }
          },
          "403": {
            "description": "Not authorized",
            "schema": {
              "$ref": "#/definitions/ErrorMessageBody"
            }
          },
          "404": {
            "description": "Not found",
            "schema": {
              "$ref": "#/definitions/ErrorMessageBody"
            }
          },
          "500": {
            "description": "Internal Server Error",
            "schema": {
              "$ref": "#/definitions/ErrorMessageBody"
            }
          },
          "502": {
            "description": "Bad gateway",
            "schema": {
              "$ref": "#/definitions/ErrorMessageBody"
            }
          },
          "503": {
            "description": "Service unavailable",
            "schema": {
              "$ref": "#/definitions/ErrorMessageBody"
            }
          }
        }
      },
      "patch": {
        "tags": [
          "SharingSet"
        ],
        "summary": "Patch a sharingset for an entity",
        "description": "A sharingset represents the full list of users and groups who have access to the specified entity. Use this method to patch the sharingset and define who can access a given entity, and with which access level (viewer, editor, owner).\nUnlike the PUT operation that replaces the whole sharingset, the PATCH operation allows you to apply specific changes to the sharingset. A missing level stands for a removal command of a user or group sharing.",
        "operationId": "patchApiV1SharingsetEntitytypeEntityid",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "X-CLIENT-VERSION",
            "in": "header",
            "required": false,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/PatchSharingSetRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Status 200",
            "schema": {
              "$ref": "#/definitions/SharingSetKey"
            }
          },
          "400": {
            "description": "Bad request",
            "schema": {
              "$ref": "#/definitions/ErrorMessageBody"
            }
          },
          "401": {
            "description": "Not authenticated",
            "schema": {
              "$ref": "#/definitions/ErrorMessageBody"
            }
          },
          "403": {
            "description": "Not authorized",
            "schema": {
              "$ref": "#/definitions/ErrorMessageBody"
            }
          },
          "404": {
            "description": "Not found",
            "schema": {
              "$ref": "#/definitions/ErrorMessageBody"
            }
          },
          "500": {
            "description": "Internal Server Error",
            "schema": {
              "$ref": "#/definitions/ErrorMessageBody"
            }
          },
          "502": {
            "description": "Bad gateway",
            "schema": {
              "$ref": "#/definitions/ErrorMessageBody"
            }
          },
          "503": {
            "description": "Service unavailable",
            "schema": {
              "$ref": "#/definitions/ErrorMessageBody"
            }
          }
        }
      },
      "parameters": [
        {
          "name": "entityType",
          "in": "path",
          "required": true,
          "type": "string",
          "x-example": "preparation"
        },
        {
          "name": "entityId",
          "in": "path",
          "required": true,
          "type": "string",
          "description": "UUID",
          "x-example": "15de7eb2-6447-49a8-a404-a53ecd1f3473"
        }
      ]
    },
    "/sharing/sharings/levels/{entityType}": {
      "get": {
        "tags": [
          "Levels"
        ],
        "summary": "Get the access levels of an entity",
        "description": " An access level defines to what extent the user or the group will be able to interact with the entity. In Talend Cloud, the available levels are Viewer, Editor, and Owner. Depending on the level, a user will have read-only or write permissions for example.\nUse this method to retrieve the available access levels of the specified entity type.",
        "operationId": "getApiV1SharingsLevelsEntitytype",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "X-CLIENT-VERSION",
            "in": "header",
            "required": false,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "Status 200",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/LevelResponse"
              }
            }
          },
          "400": {
            "description": "Bad request",
            "schema": {
              "$ref": "#/definitions/ErrorMessageBody"
            }
          },
          "401": {
            "description": "Not authenticated",
            "schema": {
              "$ref": "#/definitions/ErrorMessageBody"
            }
          },
          "403": {
            "description": "Not authorized",
            "schema": {
              "$ref": "#/definitions/ErrorMessageBody"
            }
          },
          "404": {
            "description": "Not found",
            "schema": {
              "$ref": "#/definitions/ErrorMessageBody"
            }
          },
          "500": {
            "description": "Internal Server Error",
            "schema": {
              "$ref": "#/definitions/ErrorMessageBody"
            }
          },
          "502": {
            "description": "Bad gateway",
            "schema": {
              "$ref": "#/definitions/ErrorMessageBody"
            }
          },
          "503": {
            "description": "Service unavailable",
            "schema": {
              "$ref": "#/definitions/ErrorMessageBody"
            }
          }
        }
      },
      "parameters": [
        {
          "name": "entityType",
          "in": "path",
          "required": true,
          "type": "string",
          "x-example": "preparation"
        }
      ]
    },
    "/sharing/sharings/eligibles/{entityType}": {
      "get": {
        "tags": [
          "Eligibles"
        ],
        "summary": "Get eligible users/groups for sharing",
        "description": "Use this method to retrieve the list of users and groups with whom a specific entity type can be shared.\nThe list of available users and groups changes depending on which permissions they are assigned in Talend Management Console.",
        "operationId": "getApiV1SharingsEligiblesEntitytype",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "X-CLIENT-VERSION",
            "in": "header",
            "required": false,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "Status 200",
            "schema": {
              "$ref": "#/definitions/Eligibles"
            }
          },
          "400": {
            "description": "Bad request",
            "schema": {
              "$ref": "#/definitions/ErrorMessageBody"
            }
          },
          "401": {
            "description": "Not authenticated",
            "schema": {
              "$ref": "#/definitions/ErrorMessageBody"
            }
          },
          "403": {
            "description": "Not authorized",
            "schema": {
              "$ref": "#/definitions/ErrorMessageBody"
            }
          },
          "404": {
            "description": "Not found",
            "schema": {
              "$ref": "#/definitions/ErrorMessageBody"
            }
          },
          "500": {
            "description": "Internal Server Error",
            "schema": {
              "$ref": "#/definitions/ErrorMessageBody"
            }
          },
          "502": {
            "description": "Bad gateway",
            "schema": {
              "$ref": "#/definitions/ErrorMessageBody"
            }
          },
          "503": {
            "description": "Service unavailable",
            "schema": {
              "$ref": "#/definitions/ErrorMessageBody"
            }
          }
        }
      },
      "parameters": [
        {
          "name": "entityType",
          "in": "path",
          "required": true,
          "type": "string",
          "x-example": "preparation"
        }
      ]
    },
    "/sharing/sharings/{entityType}": {
      "get": {
        "tags": [
          "Sharings"
        ],
        "summary": "Get the entities that the current user has access to",
        "description": "Use this method to retrieve the list of all entities of a given type that the current user has access to.\nThis list of access also includes the access level and the UUID of the entity.",
        "operationId": "getApiV1SharingsEntitytype",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "includeMetadata",
            "in": "query",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "X-CLIENT-VERSION",
            "in": "header",
            "required": false,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "Status 200",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/SharingResponse"
              }
            }
          },
          "400": {
            "description": "Bad request",
            "schema": {
              "$ref": "#/definitions/ErrorMessageBody"
            }
          },
          "401": {
            "description": "Not authenticated",
            "schema": {
              "$ref": "#/definitions/ErrorMessageBody"
            }
          },
          "403": {
            "description": "Not authorized",
            "schema": {
              "$ref": "#/definitions/ErrorMessageBody"
            }
          },
          "404": {
            "description": "Not found",
            "schema": {
              "$ref": "#/definitions/ErrorMessageBody"
            }
          },
          "500": {
            "description": "Internal Server Error",
            "schema": {
              "$ref": "#/definitions/ErrorMessageBody"
            }
          },
          "502": {
            "description": "Bad gateway",
            "schema": {
              "$ref": "#/definitions/ErrorMessageBody"
            }
          },
          "503": {
            "description": "Service unavailable",
            "schema": {
              "$ref": "#/definitions/ErrorMessageBody"
            }
          }
        }
      },
      "parameters": [
        {
          "name": "entityType",
          "in": "path",
          "required": true,
          "type": "string",
          "x-example": "preparation"
        }
      ]
    },
    "/sharing/sharings/{entityType}/{entityId}": {
      "get": {
        "tags": [
          "Sharings"
        ],
        "summary": "Get users/groups' access information to an entity",
        "description": "Use this method to get the list of computed accesses by users or groups to a given entity.",
        "operationId": "getApiV1SharingsEntitytypeEntityid",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "includeMetadata",
            "in": "query",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "X-CLIENT-VERSION",
            "in": "header",
            "required": false,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "Status 200",
            "schema": {
              "$ref": "#/definitions/SharingResponse"
            }
          },
          "400": {
            "description": "Bad request",
            "schema": {
              "$ref": "#/definitions/ErrorMessageBody"
            }
          },
          "401": {
            "description": "Not authenticated",
            "schema": {
              "$ref": "#/definitions/ErrorMessageBody"
            }
          },
          "403": {
            "description": "Not authorized",
            "schema": {
              "$ref": "#/definitions/ErrorMessageBody"
            }
          },
          "404": {
            "description": "Not found",
            "schema": {
              "$ref": "#/definitions/ErrorMessageBody"
            }
          },
          "500": {
            "description": "Internal Server Error",
            "schema": {
              "$ref": "#/definitions/ErrorMessageBody"
            }
          },
          "502": {
            "description": "Bad gateway",
            "schema": {
              "$ref": "#/definitions/ErrorMessageBody"
            }
          },
          "503": {
            "description": "Service unavailable",
            "schema": {
              "$ref": "#/definitions/ErrorMessageBody"
            }
          }
        }
      },
      "parameters": [
        {
          "name": "entityType",
          "in": "path",
          "required": true,
          "type": "string",
          "x-example": "preparation"
        },
        {
          "name": "entityId",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ]
    },
    "/sharing/sharingset": {
      "patch": {
        "tags": [
          "SharingSet"
        ],
        "summary": "Patch a sharingset",
        "description": "A sharingset represents a list of users and groups.\nUse this method to patch a list of sharingsets. The PATCH operation allows you to apply specific changes to the sharingset without replacing it entirely.",
        "operationId": "patchApiV1Sharingset",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "X-CLIENT-VERSION",
            "in": "header",
            "required": false,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/BulkSharingSetRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Status 200",
            "schema": {
              "$ref": "#/definitions/SharingSetKey"
            }
          },
          "400": {
            "description": "Bad request",
            "schema": {
              "$ref": "#/definitions/ErrorMessageBody"
            }
          },
          "401": {
            "description": "Not authenticated",
            "schema": {
              "$ref": "#/definitions/ErrorMessageBody"
            }
          },
          "403": {
            "description": "Not authorized",
            "schema": {
              "$ref": "#/definitions/ErrorMessageBody"
            }
          },
          "404": {
            "description": "Not found",
            "schema": {
              "$ref": "#/definitions/ErrorMessageBody"
            }
          },
          "500": {
            "description": "Internal Server Error",
            "schema": {
              "$ref": "#/definitions/ErrorMessageBody"
            }
          },
          "502": {
            "description": "Bad gateway",
            "schema": {
              "$ref": "#/definitions/ErrorMessageBody"
            }
          },
          "503": {
            "description": "Service unavailable",
            "schema": {
              "$ref": "#/definitions/ErrorMessageBody"
            }
          }
        }
      }
    },
    "/sharing/sharings/{entityType}/{entityId}/entitlements": {
      "get": {
        "tags": [
          "Sharings"
        ],
        "summary": "Get the list of permissions for an entity",
        "description": "Use this method to rerieve a list of available permissions for a given entity.",
        "operationId": "getApiV1SharingsEntitytypeEntityidEntitlements",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "X-CLIENT-VERSION",
            "in": "header",
            "required": false,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "Status 200",
            "schema": {
              "$ref": "#/definitions/EntitlementsResponse"
            }
          },
          "400": {
            "description": "Bad request",
            "schema": {
              "$ref": "#/definitions/ErrorMessageBody"
            }
          },
          "401": {
            "description": "Not authenticated",
            "schema": {
              "$ref": "#/definitions/ErrorMessageBody"
            }
          },
          "403": {
            "description": "Not authorized",
            "schema": {
              "$ref": "#/definitions/ErrorMessageBody"
            }
          },
          "404": {
            "description": "Not found",
            "schema": {
              "$ref": "#/definitions/ErrorMessageBody"
            }
          },
          "500": {
            "description": "Internal Server Error",
            "schema": {
              "$ref": "#/definitions/ErrorMessageBody"
            }
          },
          "502": {
            "description": "Bad gateway",
            "schema": {
              "$ref": "#/definitions/ErrorMessageBody"
            }
          },
          "503": {
            "description": "Service unavailable",
            "schema": {
              "$ref": "#/definitions/ErrorMessageBody"
            }
          }
        }
      },
      "parameters": [
        {
          "name": "entityType",
          "in": "path",
          "required": true,
          "type": "string",
          "x-example": "preparation"
        },
        {
          "name": "entityId",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ]
    }
  },
  "definitions": {
    "ErrorMessageBody": {
      "type": "object",
      "required": [
        "error",
        "path",
        "status",
        "timestamp"
      ],
      "properties": {
        "timestamp": {
          "type": "integer",
          "format": "int64",
          "example": 1622618273418
        },
        "status": {
          "type": "integer",
          "format": "int32",
          "example": 400
        },
        "error": {
          "type": "string",
          "example": "Bad Request"
        },
        "exception": {
          "type": "string"
        },
        "message": {
          "type": "string",
          "example": "The request is invalid"
        },
        "path": {
          "type": "string",
          "example": "/sharing/sharings/levels/dataset"
        }
      },
      "description": "This object is returned in case of an error during an API call."
    },
    "LevelResponse": {
      "type": "object",
      "required": [
        "code",
        "label",
        "order"
      ],
      "properties": {
        "code": {
          "type": "string",
          "example": "WRITER"
        },
        "label": {
          "type": "string",
          "example": "Editor"
        },
        "order": {
          "type": "integer",
          "format": "int32",
          "example": 2
        }
      },
      "description": "Description of a level access for an entity."
    },
    "Eligibles": {
      "type": "object",
      "properties": {
        "users": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/User"
          }
        },
        "groups": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Group"
          }
        }
      },
      "description": "Description of a list of users and groups of users who are eligibles for the sharing of an entit."
    },
    "User": {
      "type": "object",
      "required": [
        "firstName",
        "lastName",
        "userId"
      ],
      "properties": {
        "userId": {
          "type": "string",
          "description": "UUID",
          "example": "15de7eb2-6447-49a8-a404-a53ecd1f3473"
        },
        "firstName": {
          "type": "string",
          "example": "John"
        },
        "lastName": {
          "type": "string",
          "example": "Frusciante"
        }
      },
      "description": "Basic description of an user, with its id, first name and last name."
    },
    "Group": {
      "type": "object",
      "required": [
        "groupId",
        "groupName"
      ],
      "properties": {
        "groupId": {
          "type": "string",
          "description": "UUID",
          "example": "15de7eb2-6447-49a8-a404-a53ecd1f3473"
        },
        "groupName": {
          "type": "string",
          "example": "IT department"
        }
      },
      "description": "Desription of group of users, with the group id and its name."
    },
    "SharingResponse": {
      "type": "object",
      "required": [
        "entityId",
        "entityType",
        "levelCode",
        "userId"
      ],
      "properties": {
        "entityType": {
          "type": "string",
          "example": "dataset"
        },
        "entityId": {
          "type": "string",
          "description": "UUID",
          "example": "15de7eb2-6447-49a8-a404-a53ecd1f3473"
        },
        "userId": {
          "type": "string",
          "description": "UUID",
          "example": "15de7eb2-6447-49a8-a404-a53ecd1f3473"
        },
        "levelCode": {
          "type": "string",
          "example": "1"
        },
        "entitlements": {
          "type": "array",
          "items": {
            "type": "string",
            "example": "DATASET_READ"
          }
        },
        "userOwners": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/UserSharingResponse"
          }
        },
        "groupOwners": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/GroupSharingResponse"
          }
        },
        "sharingSetCount": {
          "type": "integer",
          "format": "int32",
          "example": 123
        },
        "isSharedWithOthers": {
          "type": "boolean"
        }
      }
    },
    "UserSharingResponse": {
      "type": "object",
      "required": [
        "foreignEntity",
        "level",
        "userId"
      ],
      "properties": {
        "userId": {
          "type": "string",
          "description": "UUID",
          "example": "15de7eb2-6447-49a8-a404-a53ecd1f3473"
        },
        "level": {
          "$ref": "#/definitions/LevelResponse"
        },
        "firstName": {
          "type": "string",
          "example": "John"
        },
        "lastName": {
          "type": "string",
          "example": "Frusciante"
        },
        "foreignEntity": {
          "$ref": "#/definitions/ForeignEntity"
        },
        "deletedAt": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "ForeignEntity": {
      "type": "object",
      "required": [
        "entityId",
        "entityType"
      ],
      "properties": {
        "entityId": {
          "type": "string",
          "description": "UUID",
          "example": "15de7eb2-6447-49a8-a404-a53ecd1f3473"
        },
        "entityType": {
          "type": "string",
          "example": "dataset"
        }
      }
    },
    "GroupSharingResponse": {
      "type": "object",
      "required": [
        "foreignEntity",
        "groupId",
        "level"
      ],
      "properties": {
        "groupId": {
          "type": "string",
          "description": "UUID",
          "example": "15de7eb2-6447-49a8-a404-a53ecd1f3473"
        },
        "level": {
          "$ref": "#/definitions/LevelResponse"
        },
        "groupName": {
          "type": "string",
          "example": "IT department"
        },
        "foreignEntity": {
          "$ref": "#/definitions/ForeignEntity"
        },
        "deletedAt": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "EntitlementsResponse": {
      "type": "object",
      "required": [
        "entityId"
      ],
      "properties": {
        "entityId": {
          "type": "string",
          "description": "UUID",
          "example": "15de7eb2-6447-49a8-a404-a53ecd1f3473"
        },
        "entitlements": {
          "type": "array",
          "items": {
            "type": "string",
            "example": "DATASET_READ"
          }
        }
      }
    },
    "SharingSetResponse": {
      "type": "object",
      "properties": {
        "users": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/UserSharingResponse"
          }
        },
        "groups": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/GroupSharingResponse"
          }
        }
      }
    },
    "LevelRequest": {
      "type": "object",
      "required": [
        "code"
      ],
      "properties": {
        "code": {
          "type": "string",
          "example": "WRITER"
        }
      }
    },
    "SharingSetKey": {
      "type": "object",
      "required": [
        "entityId",
        "entityType"
      ],
      "properties": {
        "entityType": {
          "type": "string",
          "example": "dataset"
        },
        "entityId": {
          "type": "string",
          "description": "UUID",
          "example": "15de7eb2-6447-49a8-a404-a53ecd1f3473"
        }
      }
    },
    "PutSharingSetRequest": {
      "type": "object",
      "properties": {
        "users": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/PutUserSharingRequest"
          }
        },
        "groups": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/PutGroupSharingRequest"
          }
        }
      }
    },
    "PutUserSharingRequest": {
      "type": "object",
      "required": [
        "level",
        "userId"
      ],
      "properties": {
        "userId": {
          "type": "string",
          "description": "UUID",
          "example": "15de7eb2-6447-49a8-a404-a53ecd1f3473"
        },
        "level": {
          "$ref": "#/definitions/LevelRequest"
        },
        "firstName": {
          "type": "string",
          "example": "John"
        },
        "lastName": {
          "type": "string",
          "example": "Frusciante"
        },
        "foreignEntity": {
          "$ref": "#/definitions/ForeignEntity"
        }
      }
    },
    "PutGroupSharingRequest": {
      "type": "object",
      "required": [
        "groupId",
        "level"
      ],
      "properties": {
        "groupId": {
          "type": "string",
          "description": "UUID",
          "example": "15de7eb2-6447-49a8-a404-a53ecd1f3473"
        },
        "level": {
          "$ref": "#/definitions/LevelRequest"
        },
        "groupName": {
          "type": "string",
          "example": "IT department"
        },
        "foreignEntity": {
          "$ref": "#/definitions/ForeignEntity"
        }
      }
    },
    "PatchSharingSetRequest": {
      "type": "object",
      "properties": {
        "users": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/PatchUserSharingRequest"
          }
        },
        "groups": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/PatchGroupSharingRequest"
          }
        }
      }
    },
    "PatchUserSharingRequest": {
      "type": "object",
      "required": [
        "userId"
      ],
      "properties": {
        "userId": {
          "type": "string",
          "description": "UUID",
          "example": "15de7eb2-6447-49a8-a404-a53ecd1f3473"
        },
        "level": {
          "$ref": "#/definitions/LevelRequest"
        },
        "firstName": {
          "type": "string",
          "example": "John"
        },
        "lastName": {
          "type": "string",
          "example": "Frusciante"
        },
        "foreignEntity": {
          "$ref": "#/definitions/ForeignEntity"
        }
      }
    },
    "PatchGroupSharingRequest": {
      "type": "object",
      "required": [
        "groupId"
      ],
      "properties": {
        "groupId": {
          "type": "string",
          "description": "UUID",
          "example": "15de7eb2-6447-49a8-a404-a53ecd1f3473"
        },
        "level": {
          "$ref": "#/definitions/LevelRequest"
        },
        "groupName": {
          "type": "string",
          "example": "IT department"
        },
        "foreignEntity": {
          "$ref": "#/definitions/ForeignEntity"
        }
      }
    },
    "BulkSharingSetRequest": {
      "type": "object",
      "required": [
        "bulk"
      ],
      "properties": {
        "bulk": {
          "type": "array",
          "items": {
            "required": [
              "entityId",
              "entityType"
            ],
            "type": "object",
            "properties": {
              "entityId": {
                "type": "string",
                "description": "UUID",
                "example": "15de7eb2-6447-49a8-a404-a53ecd1f3473"
              },
              "entityType": {
                "type": "string",
                "example": "dataset"
              },
              "users": {
                "type": "array",
                "items": {
                  "$ref": "#/definitions/PatchUserSharingRequest"
                }
              },
              "groups": {
                "type": "array",
                "items": {
                  "$ref": "#/definitions/PatchGroupSharingRequest"
                }
              }
            }
          }
        }
      }
    }
  }
}