{
  "swagger": "2.0",
  "info": {
    "description": "Create and alter the role mappings, to assign automatically Talend roles to your SSO users.",
    "version": "2021-03",
    "title": "SSO Role Mapping",
    "contact": {}
  },
  "host": "api.eu.cloud.talend.com",
  "schemes": [
    "https"
  ],
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json"
  ],
  "paths": {
    "/security/role-mappings": {
      "get": {
        "summary": "Get all role mappings",
        "description": "Return the list of all role mappings for your tenant.",
        "produces": [
          "application/json"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Status 200",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/RoleMapping"
              }
            },
            "examples": {
              "application/json": "[\n   {\n      \"name\":\"role_1\",\n      \"roles\":[\n         \"talend_role_1\",\n         \"talend_role_2\",\n         \"talend_role_3\"\n      ]\n   },\n   {\n      \"name\":\"role_2\",\n      \"roles\":[\n         \"talend_role_4\",\n         \"talend_role_5\"\n      ]\n   }\n]"
            }
          },
          "401": {
            "description": "The system failed to authenticate the user. Either the Authorization header was missing or the provided token was incorrect."
          },
          "403": {
            "description": "The system failed to authorize the user. The provided token was recognized but did not have the rights to perform the action. Contact your security administrator to get the appropriate rights."
          },
          "429": {
            "description": "Too many requests were sent. Check the X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset headers."
          },
          "500": {
            "description": "The server encountered an unexpected condition that prevented it from fulfilling the request."
          }
        }
      },
      "post": {
        "summary": "Create or replace all the role mappings",
        "description": "Create or replace all the role mappings for your tenant.",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Status 200",
            "schema": {
              "$ref": "#/definitions/RoleMapping"
            },
            "examples": {
              "application/json": "[\n   {\n      \"name\":\"role_1\",\n      \"roles\":[\n         \"talend_role_1\",\n         \"talend_role_2\",\n         \"talend_role_3\"\n      ]\n   },\n   {\n      \"name\":\"role_2\",\n      \"roles\":[\n         \"talend_role_4\",\n         \"talend_role_5\"\n      ]\n   }\n]"
            }
          },
          "400": {
            "description": "Invalid request body. The message varies depending on the cause of the bad request. For example, the cause could be a malformed body or parameter."
          },
          "401": {
            "description": "The system failed to authenticate the user. Either the Authorization header was missing or the provided token was incorrect."
          },
          "403": {
            "description": "The system failed to authorize the user. The provided token was recognized but did not have the rights to perform the action. Contact your security administrator to get the appropriate rights."
          },
          "429": {
            "description": "Too many requests were sent. Check the X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset headers."
          },
          "500": {
            "description": "The server encountered an unexpected condition that prevented it from fulfilling the request."
          }
        }
      },
      "delete": {
        "summary": "Delete all the role mappings",
        "description": "Delete all the role mappings for your tenant.\n\nThis action will disable the role mapping feature for your tenant.",
        "parameters": [],
        "responses": {
          "204": {
            "description": "Status 204"
          },
          "401": {
            "description": "The system failed to authenticate the user. Either the Authorization header was missing or the provided token was incorrect."
          },
          "403": {
            "description": "The system failed to authorize the user. The provided token was recognized but did not have the rights to perform the action. Contact your security administrator to get the appropriate rights."
          },
          "429": {
            "description": "Too many requests were sent. Check the X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset headers."
          },
          "500": {
            "description": "The server encountered an unexpected condition that prevented it from fulfilling the request."
          }
        }
      }
    },
    "/security/role-mappings/{customerRoleName}": {
      "get": {
        "summary": "Get a specific role mapping",
        "description": "Get a specific role mapping for your tenant.",
        "produces": [
          "application/json"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Status 200",
            "schema": {
              "$ref": "#/definitions/RoleMapping"
            },
            "examples": {
              "application/json": "{\n  \"name\":\"role_1\",\n  \"roles\":[\n    \"talend_role_1\",\n    \"talend_role_2\",\n    \"talend_role_3\"\n  ]\n}"
            }
          },
          "401": {
            "description": "The system failed to authenticate the user. Either the Authorization header was missing or the provided token was incorrect."
          },
          "403": {
            "description": "The system failed to authorize the user. The provided token was recognized but did not have the rights to perform the action. Contact your security administrator to get the appropriate rights."
          },
          "404": {
            "description": "Resource not found."
          },
          "429": {
            "description": "Too many requests were sent. Check the X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset headers."
          },
          "500": {
            "description": "The server encountered an unexpected condition that prevented it from fulfilling the request."
          }
        }
      },
      "delete": {
        "summary": "Delete a specific role mapping",
        "description": "Delete a specific role mappings for your tenant.",
        "parameters": [],
        "responses": {
          "204": {
            "description": "Status 204"
          },
          "401": {
            "description": "The system failed to authenticate the user. Either the Authorization header was missing or the provided token was incorrect."
          },
          "403": {
            "description": "The system failed to authorize the user. The provided token was recognized but did not have the rights to perform the action. Contact your security administrator to get the appropriate rights."
          },
          "404": {
            "description": "Resource not found."
          },
          "429": {
            "description": "Too many requests were sent. Check the X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset headers."
          },
          "500": {
            "description": "The server encountered an unexpected condition that prevented it from fulfilling the request."
          }
        }
      },
      "parameters": [
        {
          "name": "customerRoleName",
          "in": "path",
          "required": true,
          "type": "string",
          "description": "Customer role name",
          "x-example": "role_1"
        }
      ]
    }
  },
  "definitions": {
    "RoleMapping": {
      "type": "object",
      "required": [
        "name",
        "roles"
      ],
      "properties": {
        "name": {
          "type": "string",
          "description": "Customer role name"
        },
        "roles": {
          "type": "array",
          "description": "Talend roles name",
          "items": {
            "type": "string"
          }
        }
      },
      "example": "{\n  \"name\":\"role_1\",\n  \"roles\":[\n    \"talend_role_1\",\n    \"talend_role_2\",\n    \"talend_role_3\"\n  ]\n}"
    }
  }
}