├── .gitignore ├── Jenkinsfile ├── Jenkinsfile2 ├── LICENSE.txt ├── MANIFEST.in ├── README.md ├── authomize └── rest_api_client │ ├── __init__.py │ ├── client │ ├── __init__.py │ ├── base_client.py │ ├── client.py │ ├── connectors_client.py │ └── platform_client.py │ ├── configuration │ ├── __init__.py │ └── authomize_api_configuration.py │ ├── generated │ ├── __init__.py │ ├── connectors_rest_api │ │ ├── __init__.py │ │ └── schemas.py │ └── external_rest_api │ │ ├── __init__.py │ │ └── schemas.py │ ├── openapi │ ├── __init__.py │ ├── connectors_rest_api │ │ ├── __init__.py │ │ └── openapi.json │ └── external_rest_api │ │ ├── __init__.py │ │ └── openapi.json │ └── py.typed ├── mypy.ini ├── pipeline_config.groovy ├── requirements.txt ├── setup.cfg ├── setup.py └── tests ├── __init__.py └── test_import.py /.gitignore: -------------------------------------------------------------------------------- 1 | # IDEs 2 | .idea 3 | .vscode/ 4 | 5 | # Authomize-core configuration 6 | **/config/local.* 7 | **/config/*.local.* 8 | 9 | # Byte-compiled / optimized / DLL files 10 | __pycache__/ 11 | *.py[cod] 12 | *$py.class 13 | 14 | # C extension 15 | *.so 16 | 17 | # Distribution / packaging 18 | .Python 19 | build/ 20 | develop-eggs/ 21 | dist/ 22 | downloads/ 23 | eggs/ 24 | .eggs/ 25 | lib/ 26 | lib64/ 27 | parts/ 28 | sdist/ 29 | var/ 30 | wheels/ 31 | pip-wheel-metadata/ 32 | share/python-wheels/ 33 | *.egg-info/ 34 | .installed.cfg 35 | *.egg 36 | MANIFEST 37 | 38 | # Unit test / coverage reports 39 | htmlcov/ 40 | .tox/ 41 | .nox/ 42 | .coverage 43 | .coverage.* 44 | .cache 45 | nosetests.xml 46 | coverage.xml 47 | *.cover 48 | *.py,cover 49 | .hypothesis/ 50 | .pytest_cache/ 51 | 52 | # pyenv 53 | .python-version 54 | 55 | # Environments 56 | .env 57 | .venv 58 | env/ 59 | venv/ 60 | ENV/ 61 | 62 | # mypy 63 | .mypy_cache/ 64 | .dmypy.json 65 | dmypy.json 66 | -------------------------------------------------------------------------------- /Jenkinsfile: -------------------------------------------------------------------------------- 1 | on_pull_request { 2 | run_linters() 3 | run_tests() 4 | } 5 | 6 | on_change to: master, { 7 | build_push_pypi_python_package() 8 | } 9 | -------------------------------------------------------------------------------- /Jenkinsfile2: -------------------------------------------------------------------------------- 1 | authomizeBuild([ 2 | language: 'python', 3 | buildPythonPackage: true, 4 | publicPackage: true 5 | ]) 6 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Authomize inc. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include *.md setup.py 2 | recursive-include authomize/rest_api_client *.py *.yaml *.json 3 | exclude authomize/rest_api_client/config/local.* 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Authomize REST API Client 2 | An automatically generated python client for the Authomize API. 3 | 4 | ## Usage 5 | 6 | ```python 7 | import os 8 | 9 | from authomize.rest_api_client import Client 10 | from authomize.rest_api_client.generated.connectors_rest_api.schemas import ( 11 | NewUserRequestSchema, 12 | NewUsersListRequestSchema, 13 | ) 14 | 15 | # Create a client using your Authomize secret Token 16 | client = Client(auth_token=os.environ['AUTHOMIZE_TOKEN']) 17 | # Using an existing connector 18 | app_id = os.environ['AUTHOMIZE_APP_ID'] 19 | # Sanity test for Login 20 | me = client.me() 21 | # Insert some typed items 22 | client.create_users( 23 | app_id, 24 | NewUsersListRequestSchema( 25 | data=[ 26 | NewUserRequestSchema(uniqueId='i0', name='John Smith', email='john.smith@example.com') 27 | ] 28 | ), 29 | ) 30 | ``` 31 | 32 | ## Installing 33 | 34 | From PyPI: 35 | 36 | ``` 37 | pip install authomize-rest-api-client 38 | ``` 39 | 40 | ## Making changes to this repository 41 | 42 | For code automatically generated from openapi.json using [datamodel-code-generator](https://github.com/koxudaxi/datamodel-code-generator) 43 | ``` 44 | pip install -e .[codegen] 45 | ``` 46 | Fetching openapi.json and updating schema. 47 | 48 | for connectors-rest-api: 49 | ``` 50 | curl --socks5-hostname 127.0.0.1:1337 http://connectors-rest-api.application.svc:8080/openapi-extended.json | jq --indent 2 . > authomize/rest_api_client/openapi/connectors_rest_api/openapi.json 51 | ``` 52 | ``` 53 | datamodel-codegen --use-default-kwarg --input authomize/rest_api_client/openapi/connectors_rest_api/openapi.json --output authomize/rest_api_client/generated/connectors_rest_api/schemas.py 54 | ``` 55 | 56 | for external-rest-api: 57 | ``` 58 | curl https://apidev.authomize.com/openapi-platform.json | jq --indent 2 . > authomize/rest_api_client/openapi/external_rest_api/openapi.json 59 | ``` 60 | ``` 61 | datamodel-codegen --use-default-kwarg --encoding=utf-8 --input authomize/rest_api_client/openapi/external_rest_api/openapi.json --output authomize/rest_api_client/generated/external_rest_api/schemas.py 62 | ``` 63 | -------------------------------------------------------------------------------- /authomize/rest_api_client/__init__.py: -------------------------------------------------------------------------------- 1 | from authomize.rest_api_client.client import Client 2 | from authomize.rest_api_client.generated.connectors_rest_api.schemas import ( 3 | AccessDescription, 4 | AccessTypes, 5 | AssetDescription, 6 | AssetsInheritance, 7 | AssetTypes, 8 | IdentitiesInheritance, 9 | IdentityDescription, 10 | IdentityTypes, 11 | ItemsBundleSchema, 12 | ServiceDescription, 13 | UserStatus, 14 | ) 15 | 16 | __all__ = [ 17 | 'Client', 18 | 'ItemsBundleSchema', 19 | 'IdentityDescription', 20 | 'AssetDescription', 21 | 'IdentitiesInheritance', 22 | 'AssetsInheritance', 23 | 'AccessDescription', 24 | 'AccessTypes', 25 | 'UserStatus', 26 | 'IdentityTypes', 27 | 'AssetTypes', 28 | ] 29 | -------------------------------------------------------------------------------- /authomize/rest_api_client/client/__init__.py: -------------------------------------------------------------------------------- 1 | from authomize.rest_api_client.client.client import Client 2 | 3 | __all__ = ['Client'] 4 | -------------------------------------------------------------------------------- /authomize/rest_api_client/client/base_client.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | import requests 4 | from requests import Response 5 | 6 | AUTHOMIZE_API_URL = 'https://api.authomize.com' 7 | 8 | 9 | class ClientError(Exception): 10 | def __init__(self, message): 11 | self.message = message 12 | 13 | 14 | class BaseClient: 15 | def __init__(self, auth_token: str, base_url: str = AUTHOMIZE_API_URL): 16 | self.auth_token = auth_token 17 | self.base_url = base_url 18 | self.session = requests.Session() 19 | self.session.headers.update({'Authorization': self.authorization_header}) 20 | 21 | @property 22 | def authorization_header(self) -> str: 23 | raise NotImplementedError() 24 | 25 | @staticmethod 26 | def _handle_response(response: Response): 27 | if response.ok: 28 | return BaseClient._handle_ok_response(response) 29 | try: 30 | response_json = response.json() 31 | detail = response_json.get('detail') 32 | if 400 <= response.status_code < 500: 33 | response.reason = response.text 34 | except Exception: 35 | detail = None 36 | if detail: 37 | raise ClientError(str(detail)) 38 | response.raise_for_status() 39 | 40 | @staticmethod 41 | def _handle_ok_response(response: Response) -> dict: 42 | if content_type := response.headers.get('content-type'): 43 | if content_type.startswith('application/json'): 44 | return response.json() 45 | 46 | raise ClientError( 47 | message={ 48 | 'status_code': response.status_code, 49 | 'url': response.url, 50 | 'message': 'Unexpected response from API', 51 | 'raw': response.content, 52 | }, 53 | ) 54 | 55 | def http_get(self, url, params=None): 56 | url = self.base_url + url 57 | response = self.session.get(url, params=params) 58 | return self._handle_response(response) 59 | 60 | def http_post(self, url: str, body: Optional[str] = None): 61 | url = self.base_url + url 62 | response = self.session.post( 63 | url, 64 | headers={'Content-Type': 'application/json'}, 65 | data=body, 66 | ) 67 | return self._handle_response(response) 68 | 69 | def http_patch(self, url: str, body: Optional[str] = None): 70 | url = self.base_url + url 71 | response = self.session.patch( 72 | url, 73 | headers={'Content-Type': 'application/json'}, 74 | data=body, 75 | ) 76 | return self._handle_response(response) 77 | 78 | def http_delete(self, url: str, params=None): 79 | url = self.base_url + url 80 | response = self.session.delete(url, params=params) 81 | return self._handle_response(response) 82 | -------------------------------------------------------------------------------- /authomize/rest_api_client/client/client.py: -------------------------------------------------------------------------------- 1 | from datetime import datetime 2 | from typing import Optional 3 | 4 | from apiclient_pydantic import serialize_all_methods, serialize_response 5 | 6 | from authomize.rest_api_client.client.base_client import AUTHOMIZE_API_URL 7 | from authomize.rest_api_client.client.connectors_client import ConnectorsClient 8 | from authomize.rest_api_client.client.platform_client import PlatformClient 9 | from authomize.rest_api_client.generated.connectors_rest_api.schemas import ( 10 | AddCampaignMembershipsListRequestSchema, 11 | AddCampaignMembershipsResponseSchema, 12 | AddCampaignPermissionsListRequestSchema, 13 | AddCampaignPermissionsResponseSchema, 14 | BundleTransactionSchema, 15 | ItemsBundleSchema, 16 | NewAccountsAssociationResponseSchema, 17 | NewAccountsAssociationsListRequestSchema, 18 | NewAssetsInheritanceListRequestSchema, 19 | NewAssetsInheritanceResponseSchema, 20 | NewAssetsListRequestSchema, 21 | NewAssetsResponseSchema, 22 | NewGitRepoListRequestSchema, 23 | NewGitRepoResponseSchema, 24 | NewGroupingResponseSchema, 25 | NewGroupingsAssociationResponseSchema, 26 | NewGroupingsAssociationsListRequestSchema, 27 | NewGroupingsListRequestSchema, 28 | NewIdentitiesListRequestSchema, 29 | NewIdentityResponseSchema, 30 | NewPermissionsListRequestSchema, 31 | NewPermissionsResponseSchema, 32 | NewPrivilegeGrantsResponseSchema, 33 | NewPrivilegesGrantsListRequestSchema, 34 | NewPrivilegesListRequestSchema, 35 | NewPrivilegesResponseSchema, 36 | NewUserResponseSchema, 37 | NewUsersListRequestSchema, 38 | RestApiConnectorListSchema, 39 | SearchAccountsAssociationsListResponseSchema, 40 | SearchAssetsInheritanceListResponseSchema, 41 | SearchAssetsListResponseSchema, 42 | SearchGroupingResponseSchema, 43 | SearchGroupingsAssociationsListResponseSchema, 44 | SearchIdentitiesListResponseSchema, 45 | SearchPermissionResponseSchema, 46 | SearchPrivilegeGrantsListResponseSchema, 47 | SearchPrivilegesListResponseSchema, 48 | SearchUsersListResponseSchema, 49 | SubmitResponse, 50 | UpdateAppSchema, 51 | ) 52 | from authomize.rest_api_client.generated.external_rest_api.schemas import ( 53 | CampaignExpansion, 54 | CreateCampaignRequestSchema, 55 | CreateCampaignResponseSchema, 56 | IncidentExpansion, 57 | IsAliveResponse, 58 | MeResponse, 59 | ) 60 | 61 | 62 | @serialize_all_methods(decorator=serialize_response) 63 | class Client: 64 | def __init__( 65 | self, 66 | *args, 67 | auth_token: str, 68 | base_url: str = AUTHOMIZE_API_URL, 69 | **kwargs, 70 | ): 71 | self.auth_token = auth_token 72 | self.base_url = base_url 73 | self.connectors_client = ConnectorsClient( 74 | *args, 75 | auth_token=auth_token, 76 | base_url=base_url, 77 | **kwargs, 78 | ) 79 | self.platform_client = PlatformClient( 80 | *args, 81 | auth_token=auth_token, 82 | base_url=base_url, 83 | **kwargs, 84 | ) 85 | 86 | def is_alive(self) -> IsAliveResponse: 87 | return self.platform_client.is_alive() 88 | 89 | def me(self) -> MeResponse: 90 | return self.platform_client.me() 91 | 92 | def list_connectors( 93 | self, 94 | params=None, 95 | ) -> RestApiConnectorListSchema: 96 | return self.connectors_client.list_connectors( 97 | params=params, 98 | ) 99 | 100 | def create_transaction( 101 | self, 102 | connector_id: str, 103 | ) -> BundleTransactionSchema: 104 | return self.connectors_client.create_transaction( 105 | connector_id=connector_id, 106 | ) 107 | 108 | def retrieve_transaction( 109 | self, 110 | connector_id: str, 111 | transaction_id: str, 112 | ) -> BundleTransactionSchema: 113 | return self.connectors_client.retrieve_transaction( 114 | connector_id=connector_id, 115 | transaction_id=transaction_id, 116 | ) 117 | 118 | def apply_transaction( 119 | self, 120 | connector_id: str, 121 | transaction_id: str, 122 | ) -> BundleTransactionSchema: 123 | return self.connectors_client.apply_transaction( 124 | connector_id=connector_id, 125 | transaction_id=transaction_id, 126 | ) 127 | 128 | def extend_transaction_items( 129 | self, 130 | connector_id: str, 131 | transaction_id: str, 132 | items: ItemsBundleSchema, 133 | ) -> SubmitResponse: 134 | return self.connectors_client.extend_transaction_items( 135 | connector_id=connector_id, 136 | transaction_id=transaction_id, 137 | items=items, 138 | ) 139 | 140 | def delete_app_data( 141 | self, 142 | app_id: str, 143 | modified_before: Optional[datetime] = None, 144 | execution_id: Optional[str] = None, 145 | ) -> SubmitResponse: 146 | return self.connectors_client.delete_app_data( 147 | app_id=app_id, 148 | modified_before=modified_before, 149 | execution_id=execution_id, 150 | ) 151 | 152 | def update_app_data( 153 | self, 154 | app_id: str, 155 | body: UpdateAppSchema, 156 | ) -> SubmitResponse: 157 | return self.connectors_client.update_app_data( 158 | app_id=app_id, 159 | body=body, 160 | ) 161 | 162 | def search_users( 163 | self, 164 | app_id: str, 165 | start_date: Optional[datetime] = None, 166 | ) -> SearchUsersListResponseSchema: 167 | return self.connectors_client.search_users( 168 | app_id=app_id, 169 | start_date=start_date, 170 | ) 171 | 172 | def create_users( 173 | self, 174 | app_id: str, 175 | body: NewUsersListRequestSchema, 176 | ) -> NewUserResponseSchema: 177 | return self.connectors_client.create_users( 178 | app_id=app_id, 179 | body=body, 180 | ) 181 | 182 | def search_groupings( 183 | self, 184 | app_id: str, 185 | start_date: Optional[datetime] = None, 186 | ) -> SearchGroupingResponseSchema: 187 | return self.connectors_client.search_groupings( 188 | app_id=app_id, 189 | start_date=start_date, 190 | ) 191 | 192 | def create_groupings( 193 | self, 194 | app_id: str, 195 | body: NewGroupingsListRequestSchema, 196 | ) -> NewGroupingResponseSchema: 197 | return self.connectors_client.create_groupings( 198 | app_id=app_id, 199 | body=body, 200 | ) 201 | 202 | def search_permissions( 203 | self, 204 | app_id: str, 205 | start_date: Optional[datetime] = None, 206 | ) -> SearchPermissionResponseSchema: 207 | return self.connectors_client.search_permissions( 208 | app_id=app_id, 209 | start_date=start_date, 210 | ) 211 | 212 | def create_permissions( 213 | self, 214 | app_id: str, 215 | body: NewPermissionsListRequestSchema, 216 | ) -> NewPermissionsResponseSchema: 217 | return self.connectors_client.create_permissions( 218 | app_id=app_id, 219 | body=body, 220 | ) 221 | 222 | def search_privileges( 223 | self, 224 | app_id: str, 225 | start_date: Optional[datetime] = None, 226 | ) -> SearchPrivilegesListResponseSchema: 227 | return self.connectors_client.search_privileges( 228 | app_id=app_id, 229 | start_date=start_date, 230 | ) 231 | 232 | def create_privileges( 233 | self, 234 | app_id: str, 235 | body: NewPrivilegesListRequestSchema, 236 | ) -> NewPrivilegesResponseSchema: 237 | return self.connectors_client.create_privileges( 238 | app_id=app_id, 239 | body=body, 240 | ) 241 | 242 | def search_privileges_grants( 243 | self, 244 | app_id: str, 245 | start_date: Optional[datetime] = None, 246 | ) -> SearchPrivilegeGrantsListResponseSchema: 247 | return self.connectors_client.search_privileges_grants( 248 | app_id=app_id, 249 | start_date=start_date, 250 | ) 251 | 252 | def create_privileges_grants( 253 | self, 254 | app_id: str, 255 | body: NewPrivilegesGrantsListRequestSchema, 256 | ) -> NewPrivilegeGrantsResponseSchema: 257 | return self.connectors_client.create_privileges_grants( 258 | app_id=app_id, 259 | body=body, 260 | ) 261 | 262 | def search_accounts_association( 263 | self, 264 | app_id: str, 265 | start_date: Optional[datetime] = None, 266 | ) -> SearchAccountsAssociationsListResponseSchema: 267 | return self.connectors_client.search_accounts_association( 268 | app_id=app_id, 269 | start_date=start_date, 270 | ) 271 | 272 | def create_accounts_association( 273 | self, 274 | app_id: str, 275 | body: NewAccountsAssociationsListRequestSchema, 276 | ) -> NewAccountsAssociationResponseSchema: 277 | return self.connectors_client.create_accounts_association( 278 | app_id=app_id, 279 | body=body, 280 | ) 281 | 282 | def search_groupings_association( 283 | self, 284 | app_id: str, 285 | start_date: Optional[datetime] = None, 286 | ) -> SearchGroupingsAssociationsListResponseSchema: 287 | return self.connectors_client.search_groupings_association( 288 | app_id=app_id, 289 | start_date=start_date, 290 | ) 291 | 292 | def create_groupings_association( 293 | self, 294 | app_id: str, 295 | body: NewGroupingsAssociationsListRequestSchema, 296 | ) -> NewGroupingsAssociationResponseSchema: 297 | return self.connectors_client.create_groupings_association( 298 | app_id=app_id, 299 | body=body, 300 | ) 301 | 302 | def search_assets( 303 | self, 304 | app_id: str, 305 | start_date: Optional[datetime] = None, 306 | ) -> SearchAssetsListResponseSchema: 307 | return self.connectors_client.search_assets( 308 | app_id=app_id, 309 | start_date=start_date, 310 | ) 311 | 312 | def create_assets( 313 | self, 314 | app_id: str, 315 | body: NewAssetsListRequestSchema, 316 | ) -> NewAssetsResponseSchema: 317 | return self.connectors_client.create_assets( 318 | app_id=app_id, 319 | body=body, 320 | ) 321 | 322 | def create_git_repo( 323 | self, 324 | app_id: str, 325 | body: NewGitRepoListRequestSchema, 326 | ) -> NewGitRepoResponseSchema: 327 | return self.connectors_client.create_git_repo( 328 | app_id=app_id, 329 | body=body, 330 | ) 331 | 332 | def search_assets_inheritance( 333 | self, 334 | app_id: str, 335 | start_date: Optional[datetime] = None, 336 | ) -> SearchAssetsInheritanceListResponseSchema: 337 | return self.connectors_client.search_assets_inheritance( 338 | app_id=app_id, 339 | start_date=start_date, 340 | ) 341 | 342 | def create_assets_inheritance( 343 | self, 344 | app_id: str, 345 | body: NewAssetsInheritanceListRequestSchema, 346 | ) -> NewAssetsInheritanceResponseSchema: 347 | return self.connectors_client.create_assets_inheritance( 348 | app_id=app_id, 349 | body=body, 350 | ) 351 | 352 | def search_identities( 353 | self, 354 | app_id: str, 355 | start_date: Optional[datetime] = None, 356 | ) -> SearchIdentitiesListResponseSchema: 357 | return self.connectors_client.search_identities( 358 | app_id=app_id, 359 | start_date=start_date, 360 | ) 361 | 362 | def create_identities( 363 | self, 364 | app_id: str, 365 | body: NewIdentitiesListRequestSchema, 366 | ) -> NewIdentityResponseSchema: 367 | return self.connectors_client.create_identities( 368 | app_id=app_id, 369 | body=body, 370 | ) 371 | 372 | def retrieve_incident( 373 | self, 374 | incident_id: str, 375 | expand: Optional[list[IncidentExpansion]] = None, 376 | ): 377 | return self.platform_client.retrieve_incident( 378 | incident_id=incident_id, 379 | expand=expand, 380 | ) 381 | 382 | def add_campaign_permissions( 383 | self, 384 | app_id: str, 385 | campaign_id: str, 386 | body: AddCampaignPermissionsListRequestSchema, 387 | ) -> AddCampaignPermissionsResponseSchema: 388 | return self.connectors_client.add_campaign_permissions( 389 | app_id=app_id, 390 | campaign_id=campaign_id, 391 | body=body, 392 | ) 393 | 394 | def add_campaign_memberships( 395 | self, 396 | app_id: str, 397 | campaign_id: str, 398 | body: AddCampaignMembershipsListRequestSchema, 399 | ) -> AddCampaignMembershipsResponseSchema: 400 | return self.connectors_client.add_campaign_memberships( 401 | app_id=app_id, 402 | campaign_id=campaign_id, 403 | body=body, 404 | ) 405 | 406 | def create_campaign( 407 | self, 408 | body: CreateCampaignRequestSchema, 409 | ) -> CreateCampaignResponseSchema: 410 | return self.platform_client.create_campaign(body) 411 | 412 | def retrieve_campaign( 413 | self, 414 | campaign_id: str, 415 | expand: Optional[list[CampaignExpansion]] = None, 416 | ): 417 | return self.platform_client.retrieve_campaign( 418 | campaign_id=campaign_id, 419 | expand=expand, 420 | ) 421 | -------------------------------------------------------------------------------- /authomize/rest_api_client/client/connectors_client.py: -------------------------------------------------------------------------------- 1 | import json 2 | from datetime import datetime 3 | from typing import Optional 4 | 5 | from pydantic.json import pydantic_encoder 6 | 7 | from authomize.rest_api_client.client.base_client import BaseClient 8 | from authomize.rest_api_client.generated.connectors_rest_api.schemas import ( 9 | AddCampaignMembershipsListRequestSchema, 10 | AddCampaignMembershipsResponseSchema, 11 | AddCampaignPermissionsListRequestSchema, 12 | AddCampaignPermissionsResponseSchema, 13 | BundleTransactionSchema, 14 | ItemsBundleSchema, 15 | NewAccountsAssociationResponseSchema, 16 | NewAccountsAssociationsListRequestSchema, 17 | NewAssetsInheritanceListRequestSchema, 18 | NewAssetsInheritanceResponseSchema, 19 | NewAssetsListRequestSchema, 20 | NewAssetsResponseSchema, 21 | NewGitRepoListRequestSchema, 22 | NewGitRepoResponseSchema, 23 | NewGroupingResponseSchema, 24 | NewGroupingsAssociationResponseSchema, 25 | NewGroupingsAssociationsListRequestSchema, 26 | NewGroupingsListRequestSchema, 27 | NewIdentitiesListRequestSchema, 28 | NewIdentityResponseSchema, 29 | NewPermissionsListRequestSchema, 30 | NewPermissionsResponseSchema, 31 | NewPrivilegeGrantsResponseSchema, 32 | NewPrivilegesGrantsListRequestSchema, 33 | NewPrivilegesListRequestSchema, 34 | NewPrivilegesResponseSchema, 35 | NewUserResponseSchema, 36 | NewUsersListRequestSchema, 37 | RestApiConnectorListSchema, 38 | SearchAccountsAssociationsListResponseSchema, 39 | SearchAssetsInheritanceListResponseSchema, 40 | SearchAssetsListResponseSchema, 41 | SearchGroupingResponseSchema, 42 | SearchGroupingsAssociationsListResponseSchema, 43 | SearchIdentitiesListResponseSchema, 44 | SearchPermissionResponseSchema, 45 | SearchPrivilegeGrantsListResponseSchema, 46 | SearchPrivilegesListResponseSchema, 47 | SearchUsersListResponseSchema, 48 | SubmitResponse, 49 | UpdateAppSchema, 50 | ) 51 | 52 | 53 | class ConnectorsClient(BaseClient): 54 | def __init__(self, *args, **kwargs): 55 | super().__init__(*args, **kwargs) 56 | 57 | @property 58 | def authorization_header(self) -> str: 59 | return self.auth_token 60 | 61 | def list_connectors( 62 | self, 63 | params=None, 64 | ) -> RestApiConnectorListSchema: 65 | return self.http_get('/v1/connectors', params=params) 66 | 67 | def create_transaction( 68 | self, 69 | connector_id: str, 70 | ) -> BundleTransactionSchema: 71 | if not connector_id: 72 | raise ValueError('Missing connector_id') 73 | return self.http_post(f'/v1/connectors/{connector_id}/transactions') 74 | 75 | def retrieve_transaction( 76 | self, 77 | connector_id: str, 78 | transaction_id: str, 79 | ) -> BundleTransactionSchema: 80 | if not connector_id: 81 | raise ValueError('Missing connector_id') 82 | if not transaction_id: 83 | raise ValueError('Missing transaction_id') 84 | return self.http_get(f'/v1/connectors/{connector_id}/transactions/{transaction_id}') 85 | 86 | def apply_transaction( 87 | self, 88 | connector_id: str, 89 | transaction_id: str, 90 | ) -> BundleTransactionSchema: 91 | if not connector_id: 92 | raise ValueError('Missing connector_id') 93 | if not transaction_id: 94 | raise ValueError('Missing transaction_id') 95 | return self.http_post(f'/v1/connectors/{connector_id}/transactions/{transaction_id}/apply') 96 | 97 | def extend_transaction_items( 98 | self, 99 | connector_id: str, 100 | transaction_id: str, 101 | items: ItemsBundleSchema, 102 | ) -> SubmitResponse: 103 | if not connector_id: 104 | raise ValueError('Missing connector_id') 105 | if not transaction_id: 106 | raise ValueError('Missing transaction_id') 107 | return self.http_post( 108 | f'/v1/connectors/{connector_id}/transactions/{transaction_id}/items', 109 | body=items.json(), 110 | ) 111 | 112 | def delete_app_data( 113 | self, 114 | app_id: str, 115 | modified_before: Optional[datetime] = None, 116 | execution_id: Optional[str] = None, 117 | ) -> SubmitResponse: 118 | """ 119 | delete app data inserted before `modifiedBefore` 120 | 121 | Parameters 122 | ---------- 123 | app_id: str 124 | The Application ID 125 | modified_before: datetime 126 | timestamp to delete before 127 | execution_id: Optional string 128 | deprecated 129 | """ 130 | if not app_id: 131 | raise ValueError('Missing app_id') 132 | params = {} 133 | if modified_before: 134 | params['modifiedBefore'] = str(modified_before) 135 | return self.http_delete(url=f"/v2/apps/{app_id}/data", params=params) 136 | 137 | def update_app_data( 138 | self, 139 | app_id: str, 140 | body: UpdateAppSchema, 141 | ) -> SubmitResponse: 142 | if not app_id: 143 | raise ValueError('Missing app_id') 144 | return self.http_patch( 145 | url=f"/v2/apps/{app_id}", 146 | body=json.dumps(body, default=pydantic_encoder), 147 | ) 148 | 149 | def search_users( 150 | self, 151 | app_id: str, 152 | start_date: Optional[datetime] = None, 153 | ) -> SearchUsersListResponseSchema: 154 | if not app_id: 155 | raise ValueError('Missing app_id') 156 | params = dict( 157 | start_date=start_date, 158 | ) 159 | return self.http_get( 160 | url=f'/v2/apps/{app_id}/accounts/users', 161 | params={ 162 | **params, 163 | }, 164 | ) 165 | 166 | def create_users( 167 | self, 168 | app_id: str, 169 | body: NewUsersListRequestSchema, 170 | ) -> NewUserResponseSchema: 171 | if not app_id: 172 | raise ValueError('Missing app_id') 173 | return self.http_post( 174 | url=f'/v2/apps/{app_id}/accounts/users', 175 | body=json.dumps( 176 | body, 177 | default=pydantic_encoder, 178 | ), 179 | ) 180 | 181 | def search_groupings( 182 | self, 183 | app_id: str, 184 | start_date: Optional[datetime] = None, 185 | ) -> SearchGroupingResponseSchema: 186 | if not app_id: 187 | raise ValueError('Missing app_id') 188 | params = dict( 189 | start_date=start_date, 190 | ) 191 | return self.http_get( 192 | url=f'/v2/apps/{app_id}/access/grouping', 193 | params={ 194 | **params, 195 | }, 196 | ) 197 | 198 | def create_groupings( 199 | self, 200 | app_id: str, 201 | body: NewGroupingsListRequestSchema, 202 | ) -> NewGroupingResponseSchema: 203 | if not app_id: 204 | raise ValueError('Missing app_id') 205 | return self.http_post( 206 | url=f'/v2/apps/{app_id}/access/grouping', 207 | body=json.dumps( 208 | body, 209 | default=pydantic_encoder, 210 | ), 211 | ) 212 | 213 | def search_permissions( 214 | self, 215 | app_id: str, 216 | start_date: Optional[datetime] = None, 217 | ) -> SearchPermissionResponseSchema: 218 | if not app_id: 219 | raise ValueError('Missing app_id') 220 | params = dict( 221 | start_date=start_date, 222 | ) 223 | return self.http_get( 224 | url=f'/v2/apps/{app_id}/access/permissions', 225 | params={ 226 | **params, 227 | }, 228 | ) 229 | 230 | def create_permissions( 231 | self, 232 | app_id: str, 233 | body: NewPermissionsListRequestSchema, 234 | ) -> NewPermissionsResponseSchema: 235 | if not app_id: 236 | raise ValueError('Missing app_id') 237 | return self.http_post( 238 | url=f'/v2/apps/{app_id}/access/permissions', 239 | body=json.dumps( 240 | body, 241 | default=pydantic_encoder, 242 | ), 243 | ) 244 | 245 | def search_privileges( 246 | self, 247 | app_id: str, 248 | start_date: Optional[datetime] = None, 249 | ) -> SearchPrivilegesListResponseSchema: 250 | if not app_id: 251 | raise ValueError('Missing app_id') 252 | params = dict( 253 | start_date=start_date, 254 | ) 255 | return self.http_get( 256 | url=f'/v2/apps/{app_id}/privileges', 257 | params={ 258 | **params, 259 | }, 260 | ) 261 | 262 | def create_privileges( 263 | self, 264 | app_id: str, 265 | body: NewPrivilegesListRequestSchema, 266 | ) -> NewPrivilegesResponseSchema: 267 | if not app_id: 268 | raise ValueError('Missing app_id') 269 | return self.http_post( 270 | url=f'/v2/apps/{app_id}/privileges', 271 | body=json.dumps( 272 | body, 273 | default=pydantic_encoder, 274 | ), 275 | ) 276 | 277 | def search_privileges_grants( 278 | self, 279 | app_id: str, 280 | start_date: Optional[datetime] = None, 281 | ) -> SearchPrivilegeGrantsListResponseSchema: 282 | if not app_id: 283 | raise ValueError('Missing app_id') 284 | params = dict( 285 | start_date=start_date, 286 | ) 287 | return self.http_get( 288 | url=f'/v2/apps/{app_id}/privileges/grants', 289 | params={ 290 | **params, 291 | }, 292 | ) 293 | 294 | def create_privileges_grants( 295 | self, 296 | app_id: str, 297 | body: NewPrivilegesGrantsListRequestSchema, 298 | ) -> NewPrivilegeGrantsResponseSchema: 299 | if not app_id: 300 | raise ValueError('Missing app_id') 301 | return self.http_post( 302 | url=f'/v2/apps/{app_id}/privileges/grants', 303 | body=json.dumps( 304 | body, 305 | default=pydantic_encoder, 306 | ), 307 | ) 308 | 309 | def search_accounts_association( 310 | self, 311 | app_id: str, 312 | start_date: Optional[datetime] = None, 313 | ) -> SearchAccountsAssociationsListResponseSchema: 314 | if not app_id: 315 | raise ValueError('Missing app_id') 316 | params = dict( 317 | start_date=start_date, 318 | ) 319 | return self.http_get( 320 | url=f'/v2/apps/{app_id}/association/accounts', 321 | params={ 322 | **params, 323 | }, 324 | ) 325 | 326 | def create_accounts_association( 327 | self, 328 | app_id: str, 329 | body: NewAccountsAssociationsListRequestSchema, 330 | ) -> NewAccountsAssociationResponseSchema: 331 | if not app_id: 332 | raise ValueError('Missing app_id') 333 | return self.http_post( 334 | url=f'/v2/apps/{app_id}/association/accounts', 335 | body=json.dumps( 336 | body, 337 | default=pydantic_encoder, 338 | ), 339 | ) 340 | 341 | def search_groupings_association( 342 | self, 343 | app_id: str, 344 | start_date: Optional[datetime] = None, 345 | ) -> SearchGroupingsAssociationsListResponseSchema: 346 | if not app_id: 347 | raise ValueError('Missing app_id') 348 | params = dict( 349 | start_date=start_date, 350 | ) 351 | return self.http_get( 352 | url=f'/v2/apps/{app_id}/association/groupings', 353 | params={ 354 | **params, 355 | }, 356 | ) 357 | 358 | def create_groupings_association( 359 | self, 360 | app_id: str, 361 | body: NewGroupingsAssociationsListRequestSchema, 362 | ) -> NewGroupingsAssociationResponseSchema: 363 | if not app_id: 364 | raise ValueError('Missing app_id') 365 | return self.http_post( 366 | url=f'/v2/apps/{app_id}/association/groupings', 367 | body=json.dumps( 368 | body, 369 | default=pydantic_encoder, 370 | ), 371 | ) 372 | 373 | def search_assets( 374 | self, 375 | app_id: str, 376 | start_date: Optional[datetime] = None, 377 | ) -> SearchAssetsListResponseSchema: 378 | if not app_id: 379 | raise ValueError('Missing app_id') 380 | params = dict( 381 | start_date=start_date, 382 | ) 383 | return self.http_get( 384 | url=f'/v2/apps/{app_id}/assets', 385 | params={ 386 | **params, 387 | }, 388 | ) 389 | 390 | def create_assets( 391 | self, 392 | app_id: str, 393 | body: NewAssetsListRequestSchema, 394 | ) -> NewAssetsResponseSchema: 395 | if not app_id: 396 | raise ValueError('Missing app_id') 397 | return self.http_post( 398 | url=f'/v2/apps/{app_id}/assets', 399 | body=json.dumps( 400 | body, 401 | default=pydantic_encoder, 402 | ), 403 | ) 404 | 405 | def create_git_repo( 406 | self, 407 | app_id: str, 408 | body: NewGitRepoListRequestSchema, 409 | ) -> NewGitRepoResponseSchema: 410 | if not app_id: 411 | raise ValueError('Missing app_id') 412 | return self.http_post( 413 | url=f'/v2/apps/{app_id}/assets/git-repository', 414 | body=json.dumps( 415 | body, 416 | default=pydantic_encoder, 417 | ), 418 | ) 419 | 420 | def search_assets_inheritance( 421 | self, 422 | app_id: str, 423 | start_date: Optional[datetime] = None, 424 | ) -> SearchAssetsInheritanceListResponseSchema: 425 | if not app_id: 426 | raise ValueError('Missing app_id') 427 | params = dict( 428 | start_date=start_date, 429 | ) 430 | return self.http_get( 431 | url=f'/v2/apps/{app_id}/assets/inheritance', 432 | params={ 433 | **params, 434 | }, 435 | ) 436 | 437 | def create_assets_inheritance( 438 | self, 439 | app_id: str, 440 | body: NewAssetsInheritanceListRequestSchema, 441 | ) -> NewAssetsInheritanceResponseSchema: 442 | if not app_id: 443 | raise ValueError('Missing app_id') 444 | return self.http_post( 445 | url=f'/v2/apps/{app_id}/assets/inheritance', 446 | body=json.dumps( 447 | body, 448 | default=pydantic_encoder, 449 | ), 450 | ) 451 | 452 | def search_identities( 453 | self, 454 | app_id: str, 455 | start_date: Optional[datetime] = None, 456 | ) -> SearchIdentitiesListResponseSchema: 457 | if not app_id: 458 | raise ValueError('Missing app_id') 459 | params = dict( 460 | start_date=start_date, 461 | ) 462 | return self.http_get( 463 | url=f'/v2/apps/{app_id}/identities', 464 | params={ 465 | **params, 466 | }, 467 | ) 468 | 469 | def create_identities( 470 | self, 471 | app_id: str, 472 | body: NewIdentitiesListRequestSchema, 473 | ) -> NewIdentityResponseSchema: 474 | if not app_id: 475 | raise ValueError('Missing app_id') 476 | return self.http_post( 477 | url=f'/v2/apps/{app_id}/identities', 478 | body=json.dumps( 479 | body, 480 | default=pydantic_encoder, 481 | ), 482 | ) 483 | 484 | def add_campaign_permissions( 485 | self, 486 | app_id: str, 487 | campaign_id: str, 488 | body: AddCampaignPermissionsListRequestSchema, 489 | ) -> AddCampaignPermissionsResponseSchema: 490 | if not (app_id or campaign_id): 491 | raise ValueError('Missing campaign_id/app_id') 492 | return self.http_post( 493 | url=f"/v2/apps/{app_id}/campaigns/{campaign_id}/permissions", 494 | body=json.dumps( 495 | body, 496 | default=pydantic_encoder, 497 | ), 498 | ) 499 | 500 | def add_campaign_memberships( 501 | self, 502 | app_id: str, 503 | campaign_id: str, 504 | body: AddCampaignMembershipsListRequestSchema, 505 | ) -> AddCampaignMembershipsResponseSchema: 506 | if not (app_id or campaign_id): 507 | raise ValueError('Missing campaign_id/app_id') 508 | return self.http_post( 509 | url=f"/v2/apps/{app_id}/campaigns/{campaign_id}/memberships", 510 | body=json.dumps( 511 | body, 512 | default=pydantic_encoder, 513 | ), 514 | ) 515 | -------------------------------------------------------------------------------- /authomize/rest_api_client/client/platform_client.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from authomize.rest_api_client.client.base_client import BaseClient 4 | from authomize.rest_api_client.generated.external_rest_api.schemas import ( 5 | CampaignExpansion, 6 | CreateCampaignRequestSchema, 7 | CreateCampaignResponseSchema, 8 | IncidentExpansion, 9 | IsAliveResponse, 10 | MeResponse, 11 | NonPaginatedResponseSchemaCampaignSchema, 12 | NonPaginatedResponseSchemaIncidentSchema, 13 | ) 14 | 15 | 16 | class PlatformClient(BaseClient): 17 | def __init__(self, *args, **kwargs): 18 | super().__init__(*args, **kwargs) 19 | 20 | @property 21 | def authorization_header(self) -> str: 22 | return f'Bearer {self.auth_token}' 23 | 24 | def is_alive(self) -> IsAliveResponse: 25 | return self.http_get('/is_alive') 26 | 27 | def me(self) -> MeResponse: 28 | return self.http_get('/me') 29 | 30 | def retrieve_incident( 31 | self, 32 | incident_id: str, 33 | expand: Optional[list[IncidentExpansion]] = None, 34 | ) -> NonPaginatedResponseSchemaIncidentSchema: 35 | if not incident_id: 36 | raise ValueError('Missing incident_id') 37 | params = None 38 | if expand: 39 | params = dict( 40 | expand=expand, 41 | ) 42 | return self.http_get(f'/v2/incidents/{incident_id}', params=params) 43 | 44 | def create_campaign( 45 | self, 46 | body: CreateCampaignRequestSchema, 47 | ) -> CreateCampaignResponseSchema: 48 | return self.http_post( 49 | '/v2/campaigns', 50 | body=body.json(), 51 | ) 52 | 53 | def retrieve_campaign( 54 | self, campaign_id: str, expand: Optional[list[CampaignExpansion]] = None 55 | ) -> NonPaginatedResponseSchemaCampaignSchema: 56 | if not campaign_id: 57 | raise ValueError('Missing campaign_id') 58 | params = None 59 | if expand: 60 | params = dict( 61 | expand=expand, 62 | ) 63 | return self.http_get(f'/v2/campaigns/{campaign_id}', params=params) 64 | -------------------------------------------------------------------------------- /authomize/rest_api_client/configuration/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/authomize/connectors-rest-api-client/3fa115d39887c00e688ce387ad5f15f77f3ffccc/authomize/rest_api_client/configuration/__init__.py -------------------------------------------------------------------------------- /authomize/rest_api_client/configuration/authomize_api_configuration.py: -------------------------------------------------------------------------------- 1 | """Configuration for connecting to authomize api""" 2 | from pydantic import BaseSettings, Field 3 | 4 | 5 | class AuthomizeApiConfiguration(BaseSettings): 6 | """ 7 | Configuration for connecting to authomize api. 8 | """ 9 | 10 | auth_token: str = Field(..., env="AUTHOMIZE_API_TOKEN") 11 | api_url: str = Field(..., env="AUTHOMIZE_REST_API_URL") 12 | -------------------------------------------------------------------------------- /authomize/rest_api_client/generated/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/authomize/connectors-rest-api-client/3fa115d39887c00e688ce387ad5f15f77f3ffccc/authomize/rest_api_client/generated/__init__.py -------------------------------------------------------------------------------- /authomize/rest_api_client/generated/connectors_rest_api/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/authomize/connectors-rest-api-client/3fa115d39887c00e688ce387ad5f15f77f3ffccc/authomize/rest_api_client/generated/connectors_rest_api/__init__.py -------------------------------------------------------------------------------- /authomize/rest_api_client/generated/connectors_rest_api/schemas.py: -------------------------------------------------------------------------------- 1 | # generated by datamodel-codegen: 2 | # filename: openapi.json 3 | # timestamp: 2024-01-21T07:28:07+00:00 4 | 5 | from __future__ import annotations 6 | 7 | from datetime import datetime 8 | from enum import Enum 9 | from typing import Any, Dict, List, Optional 10 | 11 | from pydantic import BaseModel, Field, constr 12 | 13 | 14 | class AccessTypes(Enum): 15 | Unknown = 'Unknown' 16 | All = 'All' 17 | Owner = 'Owner' 18 | Login = 'Login' 19 | Read = 'Read' 20 | ReadMetadata = 'ReadMetadata' 21 | Write = 'Write' 22 | Create = 'Create' 23 | Delete = 'Delete' 24 | Execute = 'Execute' 25 | Enable = 'Enable' 26 | Assign = 'Assign' 27 | Restore = 'Restore' 28 | Import = 'Import' 29 | Export = 'Export' 30 | Get = 'Get' 31 | Set = 'Set' 32 | Update = 'Update' 33 | Cancel = 'Cancel' 34 | Use = 'Use' 35 | AllowUse = 'AllowUse' 36 | List = 'List' 37 | Administrative = 'Administrative' 38 | Delegate = 'Delegate' 39 | Join = 'Join' 40 | Invite = 'Invite' 41 | Leave = 'Leave' 42 | Share = 'Share' 43 | 44 | 45 | class AccountsAssociationSchema(BaseModel): 46 | sourceId: constr(min_length=1) = Field( 47 | ..., description='Source account ID **Mandatory**\n', title='Sourceid' 48 | ) 49 | targetId: constr(min_length=1) = Field( 50 | ..., 51 | description='Target grouping ID to associate with **Mandatory**.\n', 52 | title='Targetid', 53 | ) 54 | 55 | 56 | class AddCampaignMembershipsResponseSchema(BaseModel): 57 | acceptedTimestamp: Optional[datetime] = Field( 58 | default=None, 59 | description='**The accepted time of the request**', 60 | title='Acceptedtimestamp', 61 | ) 62 | requestId: str = Field(..., description='**Request id**', title='Requestid') 63 | numberOfAcceptedEntities: int = Field( 64 | ..., 65 | description='**The number of entities that pass validation and uploaded**', 66 | title='Numberofacceptedentities', 67 | ) 68 | data: Optional[Any] = Field(default={}, description='Response data.', title='Data') 69 | isInventoryPopulated: Optional[bool] = Field( 70 | default=False, 71 | description='Is inventory populated', 72 | title='Isinventorypopulated', 73 | ) 74 | isCampaignPopulated: Optional[bool] = Field( 75 | default=False, description='Is campaign populated', title='Iscampaignpopulated' 76 | ) 77 | 78 | 79 | class AddCampaignPermissionsResponseSchema(BaseModel): 80 | acceptedTimestamp: Optional[datetime] = Field( 81 | default=None, 82 | description='**The accepted time of the request**', 83 | title='Acceptedtimestamp', 84 | ) 85 | requestId: str = Field(..., description='**Request id**', title='Requestid') 86 | numberOfAcceptedEntities: int = Field( 87 | ..., 88 | description='**The number of entities that pass validation and uploaded**', 89 | title='Numberofacceptedentities', 90 | ) 91 | data: Optional[Any] = Field(default={}, description='Response data.', title='Data') 92 | isInventoryPopulated: Optional[bool] = Field( 93 | default=False, 94 | description='Is inventory populated', 95 | title='Isinventorypopulated', 96 | ) 97 | isCampaignPopulated: Optional[bool] = Field( 98 | default=False, description='Is campaign populated', title='Iscampaignpopulated' 99 | ) 100 | 101 | 102 | class AppSchema(BaseModel): 103 | id: str = Field(..., title='Id') 104 | createdAt: datetime = Field(..., title='Createdat') 105 | modifiedAt: datetime = Field(..., title='Modifiedat') 106 | integrationName: Optional[str] = Field(default=None, title='Integrationname') 107 | 108 | 109 | class AssetInheritanceSchema(BaseModel): 110 | sourceId: constr(min_length=1) = Field( 111 | ..., description='ID of the source asset. **Mandatory**\n', title='Sourceid' 112 | ) 113 | targetId: constr(min_length=1) = Field( 114 | ..., 115 | description='The ID of the iherited asset (or assets). **Mandatory**\n', 116 | title='Targetid', 117 | ) 118 | 119 | 120 | class AssetType(Enum): 121 | Application = 'Application' 122 | Database = 'Database' 123 | Drive = 'Drive' 124 | File = 'File' 125 | Folder = 'Folder' 126 | GitRepository = 'GitRepository' 127 | Integration = 'Integration' 128 | Project = 'Project' 129 | Site = 'Site' 130 | Table = 'Table' 131 | Ticket = 'Ticket' 132 | VirtualMachine = 'VirtualMachine' 133 | Secret = 'Secret' 134 | Other = 'Other' 135 | 136 | 137 | class AssetTypes(Enum): 138 | Resource = 'Resource' 139 | File = 'File' 140 | Folder = 'Folder' 141 | Drive = 'Drive' 142 | Site = 'Site' 143 | Application = 'Application' 144 | Integration = 'Integration' 145 | Package = 'Package' 146 | Project = 'Project' 147 | Cluster = 'Cluster' 148 | Dataset = 'Dataset' 149 | Subscription = 'Subscription' 150 | Table = 'Table' 151 | TableRecord = 'TableRecord' 152 | Disk = 'Disk' 153 | Image = 'Image' 154 | Instance = 'Instance' 155 | Snapshot = 'Snapshot' 156 | Service = 'Service' 157 | Topic = 'Topic' 158 | Bucket = 'Bucket' 159 | BillingAccount = 'BillingAccount' 160 | Device = 'Device' 161 | Calendar = 'Calendar' 162 | Policy = 'Policy' 163 | GitRepository = 'GitRepository' 164 | Network = 'Network' 165 | Vpc = 'Vpc' 166 | NetworkInterface = 'NetworkInterface' 167 | VirtualMachine = 'VirtualMachine' 168 | NetworkSecurityGroup = 'NetworkSecurityGroup' 169 | Ticket = 'Ticket' 170 | NetworkSubnet = 'NetworkSubnet' 171 | NetworkAcl = 'NetworkAcl' 172 | RouteTable = 'RouteTable' 173 | NetworkAddress = 'NetworkAddress' 174 | Secret = 'Secret' 175 | Storage = 'Storage' 176 | Workspace = 'Workspace' 177 | SharedLink = 'SharedLink' 178 | Collection = 'Collection' 179 | Resource_ApplicationPrincipal = 'Resource_ApplicationPrincipal' 180 | Resource_Workload = 'Resource_Workload' 181 | Database = 'Database' 182 | ServerlessFunction = 'ServerlessFunction' 183 | ServerlessApplication = 'ServerlessApplication' 184 | Gateway = 'Gateway' 185 | ImageRepository = 'ImageRepository' 186 | Resource_BusinessAccount = 'Resource_BusinessAccount' 187 | LoadBalancer = 'LoadBalancer' 188 | Listener = 'Listener' 189 | 190 | 191 | class AssetsInheritance(BaseModel): 192 | fromId: str = Field(..., title='Fromid') 193 | toId: str = Field(..., title='Toid') 194 | 195 | 196 | class AvailableConnectorId(Enum): 197 | restApiImport = 'restApiImport' 198 | 199 | 200 | class CampaignAssetSchema(BaseModel): 201 | uniqueId: constr(min_length=1) = Field( 202 | ..., description='Asset ID. **Mandatory, must be unique.**\n', title='Uniqueid' 203 | ) 204 | originId: Optional[constr(min_length=1)] = Field( 205 | default=None, 206 | description="The asset ID in the source system.\nAs opposed to `uniqueId`, it's not mandatory and can be non-unique\n", 207 | title='Originid', 208 | ) 209 | name: constr(min_length=1) = Field( 210 | ..., 211 | description='The name of the asset. The default is the Asset ID. **Mandatory**\n', 212 | title='Name', 213 | ) 214 | type: Optional[AssetType] = Field( 215 | default='Other', 216 | description='The asset types that are supported by Authomize **Mandatory**\n\nPermitted values:\n\n •\t`Application` (federation) \n •\t`Database`\n •\t`Drive`\n •\t`File`\n •\t`Folder`\n •\t`GitRepository`\n •\t`Integration`\n •\t`Project`\n •\t`Site`\n •\t`Table`\n •\t`Ticket`\n •\t`VirtualMachine`\n •\t`Other`\n\nIf the asset type does not exist use `Other`.\n', 217 | ) 218 | alternativeName: Optional[str] = Field( 219 | default=None, 220 | description='Any alternative name for the resource, or any other representation of the resource, if it exists.\nThe default is `null`.\n', 221 | title='Alternativename', 222 | ) 223 | originType: Optional[str] = Field( 224 | default=None, 225 | description='The asset type in the source system.\nThe default is the canonical type (if not mentioned).\n', 226 | title='Origintype', 227 | ) 228 | createdAt: Optional[datetime] = Field( 229 | default=None, 230 | description='The date (in ISO 8601 format) that the asset was created.\nThe default is `null`.\n', 231 | title='Createdat', 232 | ) 233 | lastUsedAt: Optional[datetime] = Field( 234 | default=None, 235 | description='The date (in ISO 8601 format) of the last time that the asset was in use.\nThe default is `null`.\n', 236 | title='Lastusedat', 237 | ) 238 | description: Optional[str] = Field( 239 | default=None, 240 | description='A description of the asset (up to 512 characters).\n', 241 | title='Description', 242 | ) 243 | href: Optional[str] = Field( 244 | default=None, 245 | description='A link to the asset in the source system.\n', 246 | title='Href', 247 | ) 248 | tags: Optional[List[constr(min_length=1)]] = Field( 249 | default=None, description='Tags associated with the asset.\n', title='Tags' 250 | ) 251 | 252 | 253 | class CampaignGroupingSchema(BaseModel): 254 | originId: Optional[constr(min_length=1)] = Field( 255 | default=None, 256 | description="The groupping ID in the source system.\nAs opposed to `uniqueId`, it's not mandatory and can be non-unique\n", 257 | title='Originid', 258 | ) 259 | name: constr(min_length=1) = Field( 260 | ..., 261 | description='The name of the grouping. The default is the ID field. **Mandatory**\n', 262 | title='Name', 263 | ) 264 | alternativeName: Optional[constr(max_length=256)] = Field( 265 | default=None, description='Alias of the grouping.', title='Alternativename' 266 | ) 267 | tags: Optional[List[constr(min_length=1)]] = Field( 268 | default=None, description='Tags on the access grouping.\n', title='Tags' 269 | ) 270 | id: constr(min_length=1) = Field( 271 | ..., description='\nGrouping ID. **Mandatory, must be unique.**\n', title='Id' 272 | ) 273 | 274 | 275 | class CampaignReviewerSchema(BaseModel): 276 | email: str = Field(..., description="User's work email address.\n", title='Email') 277 | firstName: Optional[str] = Field( 278 | default=None, description="User's first name\n", title='Firstname' 279 | ) 280 | lastName: Optional[str] = Field( 281 | default=None, description="The user's last name.\n", title='Lastname' 282 | ) 283 | 284 | 285 | class ConnectorStatus(Enum): 286 | initializing = 'initializing' 287 | validating = 'validating' 288 | failure = 'failure' 289 | enabled = 'enabled' 290 | installable = 'installable' 291 | archived = 'archived' 292 | disabled = 'disabled' 293 | deleted = 'deleted' 294 | 295 | 296 | class CustomProperties(BaseModel): 297 | key: str = Field(..., description='Name of the parameter', title='Key') 298 | value: constr(max_length=64) = Field( 299 | ..., description='Value of the Parameter', title='Value' 300 | ) 301 | 302 | 303 | class ExportResponse(BaseModel): 304 | exportId: str = Field(..., title='Exportid') 305 | exportUrl: str = Field(..., title='Exporturl') 306 | 307 | 308 | class GroupingType(Enum): 309 | Group = 'Group' 310 | VirtualGroup = 'VirtualGroup' 311 | 312 | 313 | class GroupingsAssociationSchema(BaseModel): 314 | sourceId: constr(min_length=1) = Field( 315 | ..., description='Grouping source ID **Mandatory**\n', title='Sourceid' 316 | ) 317 | targetId: constr(min_length=1) = Field( 318 | ..., 319 | description='Grouping Target ID **Mandatory**. The grouping to associate with.\n', 320 | title='Targetid', 321 | ) 322 | 323 | 324 | class IdentitiesInheritance(BaseModel): 325 | fromId: str = Field(..., title='Fromid') 326 | toId: str = Field(..., title='Toid') 327 | 328 | 329 | class IdentitySubTypes(Enum): 330 | ServiceAccount = 'ServiceAccount' 331 | Workload = 'Workload' 332 | ApplicationPrincipal = 'ApplicationPrincipal' 333 | 334 | 335 | class IdentityTypes(Enum): 336 | Identity = 'Identity' 337 | Person = 'Person' 338 | User = 'User' 339 | Group = 'Group' 340 | EntitlementProxy = 'EntitlementProxy' 341 | AccessKey = 'AccessKey' 342 | ServiceAccount = 'ServiceAccount' 343 | Alias = 'Alias' 344 | Domain = 'Domain' 345 | Organization = 'Organization' 346 | BusinessAccount = 'BusinessAccount' 347 | TaskPerformer = 'TaskPerformer' 348 | 349 | 350 | class IsAliveResponse(BaseModel): 351 | isAlive: bool = Field(..., description='**isAlive**', title='Isalive') 352 | 353 | 354 | class MeResponse(BaseModel): 355 | version: str = Field(..., description='**version**', title='Version') 356 | id: str = Field(..., description='**id**', title='Id') 357 | tenant: str = Field(..., description='**tenant**', title='Tenant') 358 | 359 | 360 | class NewAccountsAssociationRequestSchema(BaseModel): 361 | sourceId: constr(min_length=1) = Field( 362 | ..., description='Source account ID **Mandatory**\n', title='Sourceid' 363 | ) 364 | targetId: constr(min_length=1) = Field( 365 | ..., 366 | description='Target grouping ID to associate with **Mandatory**.\n', 367 | title='Targetid', 368 | ) 369 | 370 | 371 | class NewAccountsAssociationResponseDataSchema(BaseModel): 372 | validSourceIds: List[str] = Field( 373 | ..., description='List of **valid** source account ids.', title='Validsourceids' 374 | ) 375 | validTargetIds: List[str] = Field( 376 | ..., 377 | description='List of **valid** target grouping ids.', 378 | title='Validtargetids', 379 | ) 380 | invalidSourceIds: List[str] = Field( 381 | ..., 382 | description='List of **invalid** source account ids.', 383 | title='Invalidsourceids', 384 | ) 385 | invalidTargetIds: List[str] = Field( 386 | ..., 387 | description='List of **invalid** target grouping ids.', 388 | title='Invalidtargetids', 389 | ) 390 | 391 | 392 | class NewAccountsAssociationResponseSchema(BaseModel): 393 | acceptedTimestamp: Optional[datetime] = Field( 394 | default=None, 395 | description='**The accepted time of the request**', 396 | title='Acceptedtimestamp', 397 | ) 398 | requestId: str = Field(..., description='**Request id**', title='Requestid') 399 | numberOfAcceptedEntities: int = Field( 400 | ..., 401 | description='**The number of entities that pass validation and uploaded**', 402 | title='Numberofacceptedentities', 403 | ) 404 | data: Optional[NewAccountsAssociationResponseDataSchema] = Field( 405 | default={}, description='Response data.', title='Data' 406 | ) 407 | 408 | 409 | class NewAccountsAssociationsListRequestSchema(BaseModel): 410 | data: List[NewAccountsAssociationRequestSchema] = Field( 411 | ..., 412 | description='New Accounts Associations', 413 | max_items=10000, 414 | min_items=1, 415 | title='Data', 416 | ) 417 | 418 | 419 | class NewAppSchema(BaseModel): 420 | integrationName: Optional[str] = Field(default=None, title='Integrationname') 421 | 422 | 423 | class NewAssetInheritanceRequestSchema(BaseModel): 424 | sourceId: constr(min_length=1) = Field( 425 | ..., description='ID of the source asset. **Mandatory**\n', title='Sourceid' 426 | ) 427 | targetId: constr(min_length=1) = Field( 428 | ..., 429 | description='The ID of the iherited asset (or assets). **Mandatory**\n', 430 | title='Targetid', 431 | ) 432 | 433 | 434 | class NewAssetRequestSchema(BaseModel): 435 | uniqueId: constr(min_length=1) = Field( 436 | ..., description='Asset ID. **Mandatory, must be unique.**\n', title='Uniqueid' 437 | ) 438 | originId: Optional[constr(min_length=1)] = Field( 439 | default=None, 440 | description="The asset ID in the source system.\nAs opposed to `uniqueId`, it's not mandatory and can be non-unique\n", 441 | title='Originid', 442 | ) 443 | name: constr(min_length=1) = Field( 444 | ..., 445 | description='The name of the asset. The default is the Asset ID. **Mandatory**\n', 446 | title='Name', 447 | ) 448 | type: Optional[AssetType] = Field( 449 | default='Other', 450 | description='The asset types that are supported by Authomize **Mandatory**\n\nPermitted values:\n\n •\t`Application` (federation) \n •\t`Database`\n •\t`Drive`\n •\t`File`\n •\t`Folder`\n •\t`GitRepository`\n •\t`Integration`\n •\t`Project`\n •\t`Site`\n •\t`Table`\n •\t`Ticket`\n •\t`VirtualMachine`\n •\t`Other`\n\nIf the asset type does not exist use `Other`.\n', 451 | ) 452 | alternativeName: Optional[str] = Field( 453 | default=None, 454 | description='Any alternative name for the resource, or any other representation of the resource, if it exists.\nThe default is `null`.\n', 455 | title='Alternativename', 456 | ) 457 | originType: Optional[str] = Field( 458 | default=None, 459 | description='The asset type in the source system.\nThe default is the canonical type (if not mentioned).\n', 460 | title='Origintype', 461 | ) 462 | createdAt: Optional[datetime] = Field( 463 | default=None, 464 | description='The date (in ISO 8601 format) that the asset was created.\nThe default is `null`.\n', 465 | title='Createdat', 466 | ) 467 | lastUsedAt: Optional[datetime] = Field( 468 | default=None, 469 | description='The date (in ISO 8601 format) of the last time that the asset was in use.\nThe default is `null`.\n', 470 | title='Lastusedat', 471 | ) 472 | description: Optional[str] = Field( 473 | default=None, 474 | description='A description of the asset (up to 512 characters).\n', 475 | title='Description', 476 | ) 477 | href: Optional[str] = Field( 478 | default=None, 479 | description='A link to the asset in the source system.\n', 480 | title='Href', 481 | ) 482 | tags: Optional[List[constr(min_length=1)]] = Field( 483 | default=None, description='Tags associated with the asset.\n', title='Tags' 484 | ) 485 | owner: Optional[str] = Field( 486 | default=None, description='The owner ID', title='Owner' 487 | ) 488 | customProperties: Optional[List[CustomProperties]] = Field( 489 | default=[], description='custom connector parameters', title='Customproperties' 490 | ) 491 | 492 | 493 | class NewAssetsInheritanceListRequestSchema(BaseModel): 494 | data: List[NewAssetInheritanceRequestSchema] = Field( 495 | ..., 496 | description='New Assets Inheritance', 497 | max_items=10000, 498 | min_items=1, 499 | title='Data', 500 | ) 501 | 502 | 503 | class NewAssetsInheritanceResponseDataSchema(BaseModel): 504 | validSourceIds: List[str] = Field( 505 | ..., description='List of **valid** source assets ids.', title='Validsourceids' 506 | ) 507 | validTargetIds: List[str] = Field( 508 | ..., description='List of **valid** target assets ids.', title='Validtargetids' 509 | ) 510 | invalidSourceIds: List[str] = Field( 511 | ..., 512 | description='List of **invalid** source assets ids.', 513 | title='Invalidsourceids', 514 | ) 515 | invalidTargetIds: List[str] = Field( 516 | ..., 517 | description='List of **invalid** target assets ids.', 518 | title='Invalidtargetids', 519 | ) 520 | 521 | 522 | class NewAssetsInheritanceResponseSchema(BaseModel): 523 | acceptedTimestamp: Optional[datetime] = Field( 524 | default=None, 525 | description='**The accepted time of the request**', 526 | title='Acceptedtimestamp', 527 | ) 528 | requestId: str = Field(..., description='**Request id**', title='Requestid') 529 | numberOfAcceptedEntities: int = Field( 530 | ..., 531 | description='**The number of entities that pass validation and uploaded**', 532 | title='Numberofacceptedentities', 533 | ) 534 | data: Optional[NewAssetsInheritanceResponseDataSchema] = Field( 535 | default={}, description='Response data.', title='Data' 536 | ) 537 | 538 | 539 | class NewAssetsListRequestSchema(BaseModel): 540 | data: List[NewAssetRequestSchema] = Field( 541 | ..., description='New Assets', max_items=10000, min_items=1, title='Data' 542 | ) 543 | 544 | 545 | class NewAssetsResponseSchema(BaseModel): 546 | acceptedTimestamp: Optional[datetime] = Field( 547 | default=None, 548 | description='**The accepted time of the request**', 549 | title='Acceptedtimestamp', 550 | ) 551 | requestId: str = Field(..., description='**Request id**', title='Requestid') 552 | numberOfAcceptedEntities: int = Field( 553 | ..., 554 | description='**The number of entities that pass validation and uploaded**', 555 | title='Numberofacceptedentities', 556 | ) 557 | data: Optional[Any] = Field(default={}, description='Response data.', title='Data') 558 | validOwnerIds: List[str] = Field( 559 | ..., description='List of **valid** owner (user) ids.', title='Validownerids' 560 | ) 561 | invalidOwnerIds: List[str] = Field( 562 | ..., 563 | description='List of **invalid** owner (user) ids.', 564 | title='Invalidownerids', 565 | ) 566 | 567 | 568 | class Type(Enum): 569 | GitRepository = 'GitRepository' 570 | 571 | 572 | class NewGitRepoRequestSchema(BaseModel): 573 | uniqueId: constr(min_length=1) = Field( 574 | ..., description='Asset ID. **Mandatory, must be unique.**\n', title='Uniqueid' 575 | ) 576 | originId: Optional[constr(min_length=1)] = Field( 577 | default=None, 578 | description="The asset ID in the source system.\nAs opposed to `uniqueId`, it's not mandatory and can be non-unique\n", 579 | title='Originid', 580 | ) 581 | name: constr(min_length=1) = Field( 582 | ..., 583 | description='The name of the asset. The default is the Asset ID. **Mandatory**\n', 584 | title='Name', 585 | ) 586 | type: Optional[Type] = Field(default='GitRepository', title='Type') 587 | alternativeName: Optional[str] = Field( 588 | default=None, 589 | description='Any alternative name for the resource, or any other representation of the resource, if it exists.\nThe default is `null`.\n', 590 | title='Alternativename', 591 | ) 592 | originType: Optional[str] = Field( 593 | default=None, 594 | description='The asset type in the source system.\nThe default is the canonical type (if not mentioned).\n', 595 | title='Origintype', 596 | ) 597 | createdAt: Optional[datetime] = Field( 598 | default=None, 599 | description='The date (in ISO 8601 format) that the asset was created.\nThe default is `null`.\n', 600 | title='Createdat', 601 | ) 602 | lastUsedAt: Optional[datetime] = Field( 603 | default=None, 604 | description='The date (in ISO 8601 format) of the last time that the asset was in use.\nThe default is `null`.\n', 605 | title='Lastusedat', 606 | ) 607 | description: Optional[str] = Field( 608 | default=None, 609 | description='A description of the asset (up to 512 characters).\n', 610 | title='Description', 611 | ) 612 | href: Optional[str] = Field( 613 | default=None, 614 | description='A link to the asset in the source system.\n', 615 | title='Href', 616 | ) 617 | tags: Optional[List[constr(min_length=1)]] = Field( 618 | default=None, description='Tags associated with the asset.\n', title='Tags' 619 | ) 620 | owner: Optional[str] = Field( 621 | default=None, description='The owner ID', title='Owner' 622 | ) 623 | customProperties: Optional[List[CustomProperties]] = Field( 624 | default=[], description='custom connector parameters', title='Customproperties' 625 | ) 626 | isPrivate: Optional[bool] = Field( 627 | default=False, description='Is Repo Private', title='Isprivate' 628 | ) 629 | isArchived: Optional[bool] = Field( 630 | default=False, description='Is Repo Archived', title='Isarchived' 631 | ) 632 | hasProtectionRules: Optional[bool] = Field( 633 | default=False, 634 | description='Does the Repo have protection rules', 635 | title='Hasprotectionrules', 636 | ) 637 | mainBranchProtectionRules: Optional[List[str]] = Field( 638 | default=[], 639 | description='Protection Rules for main branch', 640 | title='Mainbranchprotectionrules', 641 | ) 642 | developBranchProtectionRules: Optional[List[str]] = Field( 643 | default=[], 644 | description='Protection Rules for develop branch', 645 | title='Developbranchprotectionrules', 646 | ) 647 | vulnerabilityAlertsEnabled: Optional[bool] = Field( 648 | default=False, 649 | description='Are alerts for vulnerability enabled or not', 650 | title='Vulnerabilityalertsenabled', 651 | ) 652 | 653 | 654 | class NewGitRepoResponseSchema(BaseModel): 655 | acceptedTimestamp: Optional[datetime] = Field( 656 | default=None, 657 | description='**The accepted time of the request**', 658 | title='Acceptedtimestamp', 659 | ) 660 | requestId: str = Field(..., description='**Request id**', title='Requestid') 661 | numberOfAcceptedEntities: int = Field( 662 | ..., 663 | description='**The number of entities that pass validation and uploaded**', 664 | title='Numberofacceptedentities', 665 | ) 666 | data: Optional[Any] = Field(default={}, description='Response data.', title='Data') 667 | validOwnerIds: List[str] = Field( 668 | ..., description='List of **valid** owner (user) ids.', title='Validownerids' 669 | ) 670 | invalidOwnerIds: List[str] = Field( 671 | ..., 672 | description='List of **invalid** owner (user) ids.', 673 | title='Invalidownerids', 674 | ) 675 | 676 | 677 | class NewGroupingRequestSchema(BaseModel): 678 | uniqueId: constr(min_length=1) = Field( 679 | ..., 680 | description='\nGrouping ID. **Mandatory, must be unique.**\n', 681 | title='Uniqueid', 682 | ) 683 | originId: Optional[constr(min_length=1)] = Field( 684 | default=None, 685 | description="The groupping ID in the source system.\nAs opposed to `uniqueId`, it's not mandatory and can be non-unique\n", 686 | title='Originid', 687 | ) 688 | name: constr(min_length=1) = Field( 689 | ..., 690 | description='The name of the grouping. The default is the ID field. **Mandatory**\n', 691 | title='Name', 692 | ) 693 | originType: Optional[str] = Field( 694 | default=None, 695 | description='The name of the type of grouping in the source system. The default is `Group`. Example: Group/Alias/AWS Role\n', 696 | title='Origintype', 697 | ) 698 | type: Optional[GroupingType] = Field( 699 | default='Group', 700 | description='Allowed values are `Group` and `VirtualGroup`.\n\nThe default is `Group`.\n\n`VirtualGroup` are mapped to the Authomize access explorer graph and are not present in other places in the user interface nor are they counted as a group.\n', 701 | ) 702 | isRole: Optional[bool] = Field( 703 | default=False, 704 | description='If `Role`, the grouping represents a role in the source application and the name of the role is the grouping `name`.\n\nThe default is `False`.\n', 705 | title='Isrole', 706 | ) 707 | anyoneCanJoinOrLeave: Optional[bool] = Field( 708 | default=False, 709 | description="Must be either `ture` or `false`.\nWhen set to `true` users can give themselves membership in this grouping without the grouping's managers' or owners' permission. \nExamples include public groups (M365), Google Groups with specific flags, ...\nValid only when `groupingType = Group`\n", 710 | title='Anyonecanjoinorleave', 711 | ) 712 | owner: Optional[str] = Field( 713 | default=None, 714 | description='The uniqueId of the user who is the "owner" (or manager) of the group.\n', 715 | title='Owner', 716 | ) 717 | tags: Optional[List[constr(min_length=1)]] = Field( 718 | default=None, description='Tags on the access grouping.\n', title='Tags' 719 | ) 720 | alternativeName: Optional[constr(max_length=256)] = Field( 721 | default=None, description='Alias of the grouping.', title='Alternativename' 722 | ) 723 | customProperties: Optional[List[CustomProperties]] = Field( 724 | default=[], description='custom connector parameters', title='Customproperties' 725 | ) 726 | 727 | 728 | class NewGroupingResponseSchema(BaseModel): 729 | acceptedTimestamp: Optional[datetime] = Field( 730 | default=None, 731 | description='**The accepted time of the request**', 732 | title='Acceptedtimestamp', 733 | ) 734 | requestId: str = Field(..., description='**Request id**', title='Requestid') 735 | numberOfAcceptedEntities: int = Field( 736 | ..., 737 | description='**The number of entities that pass validation and uploaded**', 738 | title='Numberofacceptedentities', 739 | ) 740 | data: Optional[Any] = Field(default={}, description='Response data.', title='Data') 741 | validOwnerIds: List[str] = Field( 742 | ..., description='List of **valid** owner (user) ids.', title='Validownerids' 743 | ) 744 | invalidOwnerIds: List[str] = Field( 745 | ..., 746 | description='List of **invalid** owner (user) ids.', 747 | title='Invalidownerids', 748 | ) 749 | 750 | 751 | class NewGroupingsAssociationRequestSchema(BaseModel): 752 | sourceId: constr(min_length=1) = Field( 753 | ..., description='Grouping source ID **Mandatory**\n', title='Sourceid' 754 | ) 755 | targetId: constr(min_length=1) = Field( 756 | ..., 757 | description='Grouping Target ID **Mandatory**. The grouping to associate with.\n', 758 | title='Targetid', 759 | ) 760 | 761 | 762 | class NewGroupingsAssociationResponseDataSchema(BaseModel): 763 | validSourceIds: List[str] = Field( 764 | ..., 765 | description='List of **valid** source grouping ids.', 766 | title='Validsourceids', 767 | ) 768 | validTargetIds: List[str] = Field( 769 | ..., 770 | description='List of **valid** target grouping ids.', 771 | title='Validtargetids', 772 | ) 773 | invalidSourceIds: List[str] = Field( 774 | ..., 775 | description='List of **invalid** source grouping ids.', 776 | title='Invalidsourceids', 777 | ) 778 | invalidTargetIds: List[str] = Field( 779 | ..., 780 | description='List of **invalid** target grouping ids.', 781 | title='Invalidtargetids', 782 | ) 783 | 784 | 785 | class NewGroupingsAssociationResponseSchema(BaseModel): 786 | acceptedTimestamp: Optional[datetime] = Field( 787 | default=None, 788 | description='**The accepted time of the request**', 789 | title='Acceptedtimestamp', 790 | ) 791 | requestId: str = Field(..., description='**Request id**', title='Requestid') 792 | numberOfAcceptedEntities: int = Field( 793 | ..., 794 | description='**The number of entities that pass validation and uploaded**', 795 | title='Numberofacceptedentities', 796 | ) 797 | data: Optional[NewGroupingsAssociationResponseDataSchema] = Field( 798 | default={}, description='Response data.', title='Data' 799 | ) 800 | 801 | 802 | class NewGroupingsAssociationsListRequestSchema(BaseModel): 803 | data: List[NewGroupingsAssociationRequestSchema] = Field( 804 | ..., 805 | description='New Groupings Associations', 806 | max_items=10000, 807 | min_items=1, 808 | title='Data', 809 | ) 810 | 811 | 812 | class NewGroupingsListRequestSchema(BaseModel): 813 | data: List[NewGroupingRequestSchema] = Field( 814 | ..., description='New Groupings', max_items=10000, min_items=1, title='Data' 815 | ) 816 | 817 | 818 | class NewIdentityResponseSchema(BaseModel): 819 | acceptedTimestamp: Optional[datetime] = Field( 820 | default=None, 821 | description='**The accepted time of the request**', 822 | title='Acceptedtimestamp', 823 | ) 824 | requestId: str = Field(..., description='**Request id**', title='Requestid') 825 | numberOfAcceptedEntities: int = Field( 826 | ..., 827 | description='**The number of entities that pass validation and uploaded**', 828 | title='Numberofacceptedentities', 829 | ) 830 | data: Optional[Any] = Field(default={}, description='Response data.', title='Data') 831 | 832 | 833 | class NewPermissionsResponseDataSchema(BaseModel): 834 | validUserIds: List[str] = Field( 835 | ..., description='List of **valid** user ids.', title='Validuserids' 836 | ) 837 | validGroupingIds: List[str] = Field( 838 | ..., description='List of **valid** grouping ids.', title='Validgroupingids' 839 | ) 840 | validAssetIds: List[str] = Field( 841 | ..., description='List of **valid** asset ids.', title='Validassetids' 842 | ) 843 | validPrivilegeIds: List[str] = Field( 844 | ..., description='List of **valid** privilege ids.', title='Validprivilegeids' 845 | ) 846 | invalidUserIds: List[str] = Field( 847 | ..., description='List of **invalid** user ids.', title='Invaliduserids' 848 | ) 849 | invalidGroupingIds: List[str] = Field( 850 | ..., description='List of **invalid** grouping ids.', title='Invalidgroupingids' 851 | ) 852 | invalidAssetIds: List[str] = Field( 853 | ..., description='List of **invalid** asset ids.', title='Invalidassetids' 854 | ) 855 | invalidPrivilegeIds: List[str] = Field( 856 | ..., 857 | description='List of **invalid** privilege ids.', 858 | title='Invalidprivilegeids', 859 | ) 860 | 861 | 862 | class NewPermissionsResponseSchema(BaseModel): 863 | acceptedTimestamp: Optional[datetime] = Field( 864 | default=None, 865 | description='**The accepted time of the request**', 866 | title='Acceptedtimestamp', 867 | ) 868 | requestId: str = Field(..., description='**Request id**', title='Requestid') 869 | numberOfAcceptedEntities: int = Field( 870 | ..., 871 | description='**The number of entities that pass validation and uploaded**', 872 | title='Numberofacceptedentities', 873 | ) 874 | data: Optional[NewPermissionsResponseDataSchema] = Field( 875 | default={}, description='Response data.', title='Data' 876 | ) 877 | 878 | 879 | class NewPrivilegeGrantsRequestSchema(BaseModel): 880 | sourceId: constr(min_length=1) = Field( 881 | ..., description='ID of the source privilege. **Mandatory**\n', title='Sourceid' 882 | ) 883 | targetId: constr(min_length=1) = Field( 884 | ..., 885 | description='ID of the granted privilege. **Mandatory**\n', 886 | title='Targetid', 887 | ) 888 | 889 | 890 | class NewPrivilegeGrantsResponseDataSchema(BaseModel): 891 | validSourceIds: List[str] = Field( 892 | ..., 893 | description='List of **valid** source privilege ids.', 894 | title='Validsourceids', 895 | ) 896 | validTargetIds: List[str] = Field( 897 | ..., 898 | description='List of **valid** target privilege ids.', 899 | title='Validtargetids', 900 | ) 901 | invalidSourceIds: List[str] = Field( 902 | ..., 903 | description='List of **invalid** source privilege ids.', 904 | title='Invalidsourceids', 905 | ) 906 | invalidTargetIds: List[str] = Field( 907 | ..., 908 | description='List of **invalid** target privilege ids.', 909 | title='Invalidtargetids', 910 | ) 911 | 912 | 913 | class NewPrivilegeGrantsResponseSchema(BaseModel): 914 | acceptedTimestamp: Optional[datetime] = Field( 915 | default=None, 916 | description='**The accepted time of the request**', 917 | title='Acceptedtimestamp', 918 | ) 919 | requestId: str = Field(..., description='**Request id**', title='Requestid') 920 | numberOfAcceptedEntities: int = Field( 921 | ..., 922 | description='**The number of entities that pass validation and uploaded**', 923 | title='Numberofacceptedentities', 924 | ) 925 | data: Optional[NewPrivilegeGrantsResponseDataSchema] = Field( 926 | default={}, description='Response data.', title='Data' 927 | ) 928 | 929 | 930 | class NewPrivilegeType(Enum): 931 | Administrative = 'Administrative' 932 | Data_Create = 'Data Create' 933 | Metadata_Create = 'Metadata Create' 934 | Data_Read = 'Data Read' 935 | Metadata_Read = 'Metadata Read' 936 | Data_Write = 'Data Write' 937 | Metadata_Write = 'Metadata Write' 938 | Data_Update = 'Data Update' 939 | Metadata_Update = 'Metadata Update' 940 | Data_Delete = 'Data Delete' 941 | Metadata_Delete = 'Metadata Delete' 942 | 943 | 944 | class NewPrivilegesGrantsListRequestSchema(BaseModel): 945 | data: List[NewPrivilegeGrantsRequestSchema] = Field( 946 | ..., 947 | description='New Privileges Grants', 948 | max_items=10000, 949 | min_items=1, 950 | title='Data', 951 | ) 952 | 953 | 954 | class NewPrivilegesResponseSchema(BaseModel): 955 | acceptedTimestamp: Optional[datetime] = Field( 956 | default=None, 957 | description='**The accepted time of the request**', 958 | title='Acceptedtimestamp', 959 | ) 960 | requestId: str = Field(..., description='**Request id**', title='Requestid') 961 | numberOfAcceptedEntities: int = Field( 962 | ..., 963 | description='**The number of entities that pass validation and uploaded**', 964 | title='Numberofacceptedentities', 965 | ) 966 | data: Optional[Any] = Field(default={}, description='Response data.', title='Data') 967 | 968 | 969 | class NewRestApiConnectorSchema(BaseModel): 970 | config: Optional[Dict[str, Any]] = Field(default=None, title='Config') 971 | serviceId: constr(min_length=1) = Field(..., title='Serviceid') 972 | 973 | 974 | class NewServiceAccountResponseSchema(BaseModel): 975 | acceptedTimestamp: Optional[datetime] = Field( 976 | default=None, 977 | description='**The accepted time of the request**', 978 | title='Acceptedtimestamp', 979 | ) 980 | requestId: str = Field(..., description='**Request id**', title='Requestid') 981 | numberOfAcceptedEntities: int = Field( 982 | ..., 983 | description='**The number of entities that pass validation and uploaded**', 984 | title='Numberofacceptedentities', 985 | ) 986 | data: Optional[Any] = Field(default={}, description='Response data.', title='Data') 987 | 988 | 989 | class NewUserResponseSchema(BaseModel): 990 | acceptedTimestamp: Optional[datetime] = Field( 991 | default=None, 992 | description='**The accepted time of the request**', 993 | title='Acceptedtimestamp', 994 | ) 995 | requestId: str = Field(..., description='**Request id**', title='Requestid') 996 | numberOfAcceptedEntities: int = Field( 997 | ..., 998 | description='**The number of entities that pass validation and uploaded**', 999 | title='Numberofacceptedentities', 1000 | ) 1001 | data: Optional[Any] = Field(default={}, description='Response data.', title='Data') 1002 | 1003 | 1004 | class Pagination(BaseModel): 1005 | limit: Optional[int] = Field(default=-1, title='Limit') 1006 | skip: Optional[int] = Field(default=0, title='Skip') 1007 | total: Optional[int] = Field(default=-1, title='Total') 1008 | hasMore: Optional[bool] = Field(default=None, title='Hasmore') 1009 | 1010 | 1011 | class PermissionSourceType(Enum): 1012 | User = 'User' 1013 | Grouping = 'Grouping' 1014 | 1015 | 1016 | class PrivilegeGrantSchema(BaseModel): 1017 | sourceId: constr(min_length=1) = Field( 1018 | ..., description='ID of the source privilege. **Mandatory**\n', title='Sourceid' 1019 | ) 1020 | targetId: constr(min_length=1) = Field( 1021 | ..., 1022 | description='ID of the granted privilege. **Mandatory**\n', 1023 | title='Targetid', 1024 | ) 1025 | 1026 | 1027 | class PrivilegeType(Enum): 1028 | Administrative = 'Administrative' 1029 | Unknown = 'Unknown' 1030 | Read = 'Read' 1031 | ReadMetadata = 'ReadMetadata' 1032 | Write = 'Write' 1033 | Create = 'Create' 1034 | Delete = 'Delete' 1035 | Execute = 'Execute' 1036 | Enable = 'Enable' 1037 | Assign = 'Assign' 1038 | Restore = 'Restore' 1039 | Import = 'Import' 1040 | Export = 'Export' 1041 | Update = 'Update' 1042 | Cancel = 'Cancel' 1043 | Use = 'Use' 1044 | Delegate = 'Delegate' 1045 | Join = 'Join' 1046 | Invite = 'Invite' 1047 | Share = 'Share' 1048 | 1049 | 1050 | class RequestSubmitResponse(BaseModel): 1051 | acceptedTimestamp: Optional[datetime] = Field( 1052 | default=None, 1053 | description='**The accepted time of the request**', 1054 | title='Acceptedtimestamp', 1055 | ) 1056 | requestId: str = Field(..., description='**Request id**', title='Requestid') 1057 | 1058 | 1059 | class RestApiConnectorSchema(BaseModel): 1060 | config: Optional[Dict[str, Any]] = Field(default=None, title='Config') 1061 | serviceId: Optional[str] = Field(default='', title='Serviceid') 1062 | id: str = Field(..., title='Id') 1063 | createdAt: Optional[datetime] = Field(default=None, title='Createdat') 1064 | lastSyncedAt: Optional[str] = Field(default=None, title='Lastsyncedat') 1065 | lastError: Optional[str] = Field(default=None, title='Lasterror') 1066 | modifiedAt: Optional[datetime] = Field(default=None, title='Modifiedat') 1067 | status: Optional[ConnectorStatus] = 'disabled' 1068 | serviceType: str = Field(..., title='Servicetype') 1069 | availableConnectorId: Optional[AvailableConnectorId] = 'restApiImport' 1070 | actorType: Optional[str] = Field(default=None, title='Actortype') 1071 | actorId: Optional[str] = Field(default=None, title='Actorid') 1072 | 1073 | 1074 | class SearchAccountsAssociationsListResponseSchema(BaseModel): 1075 | data: List[AccountsAssociationSchema] = Field( 1076 | ..., description='Accounts Associations', title='Data' 1077 | ) 1078 | 1079 | 1080 | class SearchAssetsInheritanceListResponseSchema(BaseModel): 1081 | data: List[AssetInheritanceSchema] = Field( 1082 | ..., description='Assets Inheritance', title='Data' 1083 | ) 1084 | 1085 | 1086 | class SearchGroupingsAssociationsListResponseSchema(BaseModel): 1087 | data: List[GroupingsAssociationSchema] = Field( 1088 | ..., description='Groupings Associations', title='Data' 1089 | ) 1090 | 1091 | 1092 | class SearchPrivilegeGrantsListResponseSchema(BaseModel): 1093 | data: List[PrivilegeGrantSchema] = Field( 1094 | ..., description='Privilege Grants', title='Data' 1095 | ) 1096 | 1097 | 1098 | class ServiceAccountType(Enum): 1099 | ServiceAccount = 'ServiceAccount' 1100 | UserAccountAsServiceAccount = 'UserAccountAsServiceAccount' 1101 | CloudWorkload = 'CloudWorkload' 1102 | ApplicationPrincipal = 'ApplicationPrincipal' 1103 | 1104 | 1105 | class ServiceDescription(BaseModel): 1106 | name: str = Field(..., title='Name') 1107 | icon: Optional[str] = Field(default=None, title='Icon') 1108 | 1109 | 1110 | class SubmitResponse(BaseModel): 1111 | acceptedTimestamp: Optional[datetime] = Field( 1112 | default=None, 1113 | description='**The accepted time of the request**', 1114 | title='Acceptedtimestamp', 1115 | ) 1116 | 1117 | 1118 | class TransactionStateType(Enum): 1119 | Applying = 'Applying' 1120 | Complete = 'Complete' 1121 | Failed = 'Failed' 1122 | Ingest = 'Ingest' 1123 | IngestChunk = 'IngestChunk' 1124 | PostProcess = 'PostProcess' 1125 | Queue = 'Queue' 1126 | 1127 | 1128 | class UpdateAppSchema(BaseModel): 1129 | name: Optional[str] = Field( 1130 | default=None, description='The name of the Application.\n', title='Name' 1131 | ) 1132 | 1133 | 1134 | class UpdateAssetRequestSchema(BaseModel): 1135 | uniqueId: constr(min_length=1) = Field( 1136 | ..., description='Asset ID. **Mandatory, must be unique.**\n', title='Uniqueid' 1137 | ) 1138 | originId: Optional[constr(min_length=1)] = Field( 1139 | default=None, 1140 | description="The asset ID in the source system.\nAs opposed to `uniqueId`, it's not mandatory and can be non-unique\n", 1141 | title='Originid', 1142 | ) 1143 | name: constr(min_length=1) = Field( 1144 | ..., 1145 | description='The name of the asset. The default is the Asset ID. **Mandatory**\n', 1146 | title='Name', 1147 | ) 1148 | type: Optional[AssetType] = Field( 1149 | default='Other', 1150 | description='The asset types that are supported by Authomize **Mandatory**\n\nPermitted values:\n\n •\t`Application` (federation) \n •\t`Database`\n •\t`Drive`\n •\t`File`\n •\t`Folder`\n •\t`GitRepository`\n •\t`Integration`\n •\t`Project`\n •\t`Site`\n •\t`Table`\n •\t`Ticket`\n •\t`VirtualMachine`\n •\t`Other`\n\nIf the asset type does not exist use `Other`.\n', 1151 | ) 1152 | alternativeName: Optional[str] = Field( 1153 | default=None, 1154 | description='Any alternative name for the resource, or any other representation of the resource, if it exists.\nThe default is `null`.\n', 1155 | title='Alternativename', 1156 | ) 1157 | originType: Optional[str] = Field( 1158 | default=None, 1159 | description='The asset type in the source system.\nThe default is the canonical type (if not mentioned).\n', 1160 | title='Origintype', 1161 | ) 1162 | createdAt: Optional[datetime] = Field( 1163 | default=None, 1164 | description='The date (in ISO 8601 format) that the asset was created.\nThe default is `null`.\n', 1165 | title='Createdat', 1166 | ) 1167 | lastUsedAt: Optional[datetime] = Field( 1168 | default=None, 1169 | description='The date (in ISO 8601 format) of the last time that the asset was in use.\nThe default is `null`.\n', 1170 | title='Lastusedat', 1171 | ) 1172 | description: Optional[str] = Field( 1173 | default=None, 1174 | description='A description of the asset (up to 512 characters).\n', 1175 | title='Description', 1176 | ) 1177 | href: Optional[str] = Field( 1178 | default=None, 1179 | description='A link to the asset in the source system.\n', 1180 | title='Href', 1181 | ) 1182 | tags: Optional[List[constr(min_length=1)]] = Field( 1183 | default=None, description='Tags associated with the asset.\n', title='Tags' 1184 | ) 1185 | owner: Optional[str] = Field( 1186 | default=None, description='The owner ID', title='Owner' 1187 | ) 1188 | customProperties: Optional[List[CustomProperties]] = Field( 1189 | default=[], description='custom connector parameters', title='Customproperties' 1190 | ) 1191 | 1192 | 1193 | class UpdateAssetsListRequestSchema(BaseModel): 1194 | data: List[UpdateAssetRequestSchema] = Field( 1195 | ..., description='Update Assets', max_items=10000, min_items=1, title='Data' 1196 | ) 1197 | 1198 | 1199 | class UpdateGroupingsRequestSchema(BaseModel): 1200 | uniqueId: constr(min_length=1) = Field( 1201 | ..., 1202 | description='\nGrouping ID. **Mandatory, must be unique.**\n', 1203 | title='Uniqueid', 1204 | ) 1205 | originId: Optional[constr(min_length=1)] = Field( 1206 | default=None, 1207 | description="The groupping ID in the source system.\nAs opposed to `uniqueId`, it's not mandatory and can be non-unique\n", 1208 | title='Originid', 1209 | ) 1210 | name: constr(min_length=1) = Field( 1211 | ..., 1212 | description='The name of the grouping. The default is the ID field. **Mandatory**\n', 1213 | title='Name', 1214 | ) 1215 | originType: Optional[str] = Field( 1216 | default=None, 1217 | description='The name of the type of grouping in the source system. The default is `Group`. Example: Group/Alias/AWS Role\n', 1218 | title='Origintype', 1219 | ) 1220 | type: Optional[GroupingType] = Field( 1221 | default='Group', 1222 | description='Allowed values are `Group` and `VirtualGroup`.\n\nThe default is `Group`.\n\n`VirtualGroup` are mapped to the Authomize access explorer graph and are not present in other places in the user interface nor are they counted as a group.\n', 1223 | ) 1224 | isRole: Optional[bool] = Field( 1225 | default=False, 1226 | description='If `Role`, the grouping represents a role in the source application and the name of the role is the grouping `name`.\n\nThe default is `False`.\n', 1227 | title='Isrole', 1228 | ) 1229 | anyoneCanJoinOrLeave: Optional[bool] = Field( 1230 | default=False, 1231 | description="Must be either `ture` or `false`.\nWhen set to `true` users can give themselves membership in this grouping without the grouping's managers' or owners' permission. \nExamples include public groups (M365), Google Groups with specific flags, ...\nValid only when `groupingType = Group`\n", 1232 | title='Anyonecanjoinorleave', 1233 | ) 1234 | owner: Optional[str] = Field( 1235 | default=None, 1236 | description='The uniqueId of the user who is the "owner" (or manager) of the group.\n', 1237 | title='Owner', 1238 | ) 1239 | tags: Optional[List[constr(min_length=1)]] = Field( 1240 | default=None, description='Tags on the access grouping.\n', title='Tags' 1241 | ) 1242 | alternativeName: Optional[constr(max_length=256)] = Field( 1243 | default=None, description='Alias of the grouping.', title='Alternativename' 1244 | ) 1245 | customProperties: Optional[List[CustomProperties]] = Field( 1246 | default=[], description='custom connector parameters', title='Customproperties' 1247 | ) 1248 | 1249 | 1250 | class UpdateGroupingsResponseSchema(BaseModel): 1251 | acceptedTimestamp: Optional[datetime] = Field( 1252 | default=None, 1253 | description='**The accepted time of the request**', 1254 | title='Acceptedtimestamp', 1255 | ) 1256 | requestId: str = Field(..., description='**Request id**', title='Requestid') 1257 | numberOfAcceptedEntities: int = Field( 1258 | ..., 1259 | description='**The number of entities that pass validation and uploaded**', 1260 | title='Numberofacceptedentities', 1261 | ) 1262 | data: Optional[Any] = Field(default={}, description='Response data.', title='Data') 1263 | 1264 | 1265 | class UpdatePrivilegeRequestSchema(BaseModel): 1266 | uniqueId: constr(min_length=1) = Field( 1267 | ..., 1268 | description='Privilege ID.\n\nIf not defined, set as originName. **Mandatory, must be unique.**\n', 1269 | title='Uniqueid', 1270 | ) 1271 | originId: Optional[constr(min_length=1)] = Field( 1272 | default=None, 1273 | description="The privilege ID in the source system.\nAs opposed to `uniqueId`, it's not mandatory and can be non-unique\n", 1274 | title='Originid', 1275 | ) 1276 | type: Optional[PrivilegeType] = Field( 1277 | default=None, 1278 | description='This Field is depreciated. Please use privilegeType Field instead.\n\nThe "canonical" privilege types that are supported by Authomize off-the-shelf:\n\nPermitted values: \n •\t`Administrative`\n •\t`Login`\n •\t`Data Read`\n •\t`Metadata Read`\n •\t`Data Write`\n •\t`Metadata Write`\n •\t`Data Create`\n •\t`Metadata Create`\n •\t`Data Delete`\n •\t`Metadata Delete`\n\n', 1279 | ) 1280 | originName: Optional[str] = Field( 1281 | default=None, 1282 | description='The privilege name in the source system.', 1283 | title='Originname', 1284 | ) 1285 | 1286 | 1287 | class UpdatePrivilegesListRequestSchema(BaseModel): 1288 | data: List[UpdatePrivilegeRequestSchema] = Field( 1289 | ..., description='Update Privileges', max_items=10000, min_items=1, title='Data' 1290 | ) 1291 | 1292 | 1293 | class UserStatus(Enum): 1294 | Staged = 'Staged' 1295 | Enabled = 'Enabled' 1296 | Disabled = 'Disabled' 1297 | Suspended = 'Suspended' 1298 | Deleted = 'Deleted' 1299 | Unknown = 'Unknown' 1300 | 1301 | 1302 | class ValidationError(BaseModel): 1303 | loc: List[str] = Field(..., title='Location') 1304 | msg: str = Field(..., title='Message') 1305 | type: str = Field(..., title='Error Type') 1306 | 1307 | 1308 | class AccessDescription(BaseModel): 1309 | fromIdentityId: str = Field(..., title='Fromidentityid') 1310 | toAssetId: Optional[str] = Field(default=None, title='Toassetid') 1311 | accessType: AccessTypes 1312 | accessName: Optional[str] = Field(default=None, title='Accessname') 1313 | 1314 | 1315 | class AppListSchema(BaseModel): 1316 | pagination: Pagination 1317 | data: List[AppSchema] = Field(..., title='Data') 1318 | 1319 | 1320 | class AssetDescription(BaseModel): 1321 | id: str = Field(..., title='Id') 1322 | name: str = Field(..., title='Name') 1323 | customName: Optional[str] = Field(default=None, title='Customname') 1324 | type: AssetTypes 1325 | description: Optional[str] = Field(default=None, title='Description') 1326 | logoUrl: Optional[str] = Field(default=None, title='Logourl') 1327 | href: Optional[str] = Field(default=None, title='Href') 1328 | createdAt: Optional[datetime] = Field(default=None, title='Createdat') 1329 | isAuxiliary: Optional[bool] = Field(default=None, title='Isauxiliary') 1330 | service: Optional[str] = Field(default=None, title='Service') 1331 | isFederated: Optional[bool] = Field(default=None, title='Isfederated') 1332 | 1333 | 1334 | class AssetSchema(BaseModel): 1335 | uniqueId: constr(min_length=1) = Field( 1336 | ..., description='Asset ID. **Mandatory, must be unique.**\n', title='Uniqueid' 1337 | ) 1338 | originId: Optional[constr(min_length=1)] = Field( 1339 | default=None, 1340 | description="The asset ID in the source system.\nAs opposed to `uniqueId`, it's not mandatory and can be non-unique\n", 1341 | title='Originid', 1342 | ) 1343 | name: constr(min_length=1) = Field( 1344 | ..., 1345 | description='The name of the asset. The default is the Asset ID. **Mandatory**\n', 1346 | title='Name', 1347 | ) 1348 | type: Optional[AssetType] = Field( 1349 | default='Other', 1350 | description='The asset types that are supported by Authomize **Mandatory**\n\nPermitted values:\n\n •\t`Application` (federation) \n •\t`Database`\n •\t`Drive`\n •\t`File`\n •\t`Folder`\n •\t`GitRepository`\n •\t`Integration`\n •\t`Project`\n •\t`Site`\n •\t`Table`\n •\t`Ticket`\n •\t`VirtualMachine`\n •\t`Other`\n\nIf the asset type does not exist use `Other`.\n', 1351 | ) 1352 | alternativeName: Optional[str] = Field( 1353 | default=None, 1354 | description='Any alternative name for the resource, or any other representation of the resource, if it exists.\nThe default is `null`.\n', 1355 | title='Alternativename', 1356 | ) 1357 | originType: Optional[str] = Field( 1358 | default=None, 1359 | description='The asset type in the source system.\nThe default is the canonical type (if not mentioned).\n', 1360 | title='Origintype', 1361 | ) 1362 | createdAt: Optional[datetime] = Field( 1363 | default=None, 1364 | description='The date (in ISO 8601 format) that the asset was created.\nThe default is `null`.\n', 1365 | title='Createdat', 1366 | ) 1367 | lastUsedAt: Optional[datetime] = Field( 1368 | default=None, 1369 | description='The date (in ISO 8601 format) of the last time that the asset was in use.\nThe default is `null`.\n', 1370 | title='Lastusedat', 1371 | ) 1372 | description: Optional[str] = Field( 1373 | default=None, 1374 | description='A description of the asset (up to 512 characters).\n', 1375 | title='Description', 1376 | ) 1377 | href: Optional[str] = Field( 1378 | default=None, 1379 | description='A link to the asset in the source system.\n', 1380 | title='Href', 1381 | ) 1382 | tags: Optional[List[constr(min_length=1)]] = Field( 1383 | default=None, description='Tags associated with the asset.\n', title='Tags' 1384 | ) 1385 | owner: Optional[str] = Field( 1386 | default=None, description='The owner ID', title='Owner' 1387 | ) 1388 | customProperties: Optional[List[CustomProperties]] = Field( 1389 | default=[], description='custom connector parameters', title='Customproperties' 1390 | ) 1391 | 1392 | 1393 | class BundleTransactionSchema(BaseModel): 1394 | connectorId: str = Field(..., title='Connectorid') 1395 | transactionCreatedAt: Optional[datetime] = Field( 1396 | default=None, title='Transactioncreatedat' 1397 | ) 1398 | warnings: Optional[List[str]] = Field(default=None, title='Warnings') 1399 | validations: Optional[Dict[str, Any]] = Field(default=None, title='Validations') 1400 | id: str = Field(..., title='Id') 1401 | state: TransactionStateType 1402 | 1403 | 1404 | class CampaignAccountSchema(BaseModel): 1405 | originId: Optional[constr(min_length=1)] = Field( 1406 | default=None, 1407 | description="The user ID in the source system.\nAs opposed to `uniqueId`, it's not mandatory and can be non-unique\n", 1408 | title='Originid', 1409 | ) 1410 | name: Optional[str] = Field(default=None, description='Username\n', title='Name') 1411 | email: Optional[str] = Field( 1412 | default=None, description="User's email address.", title='Email' 1413 | ) 1414 | firstName: Optional[str] = Field( 1415 | default=None, description="User's first name\n", title='Firstname' 1416 | ) 1417 | lastName: Optional[str] = Field( 1418 | default=None, description="The user's last name.\n", title='Lastname' 1419 | ) 1420 | status: Optional[UserStatus] = Field( 1421 | default=None, 1422 | description='User status must be: `Deleted`, `Disabled`, `Enabled`, `Staged`, `Suspended`, or `Unknown`.\n', 1423 | ) 1424 | department: Optional[str] = Field( 1425 | default=None, 1426 | description="The user's department in the organization.\n", 1427 | title='Department', 1428 | ) 1429 | title: Optional[str] = Field( 1430 | default=None, description="The user's job title.\n", title='Title' 1431 | ) 1432 | description: Optional[str] = Field( 1433 | default=None, 1434 | description='Additional description of the user.\n', 1435 | title='Description', 1436 | ) 1437 | isExternal: Optional[bool] = Field( 1438 | default=False, 1439 | description='Account is external to Authomize.\nMust be either `true` or `false`.\n', 1440 | title='Isexternal', 1441 | ) 1442 | hasMFA: Optional[bool] = Field( 1443 | default=None, 1444 | description='Has Multi-Factor Authentication enabled.\nMust be either `true` or `false`.\n', 1445 | title='Hasmfa', 1446 | ) 1447 | lastLoginAt: Optional[datetime] = Field( 1448 | default=None, 1449 | description='The last login date in ISO 8601 format.\n', 1450 | title='Lastloginat', 1451 | ) 1452 | tags: Optional[List[constr(min_length=1)]] = Field( 1453 | default=None, 1454 | description='One or more tags on the user account.\n', 1455 | title='Tags', 1456 | ) 1457 | uniqueId: constr(min_length=1) = Field( 1458 | ..., 1459 | description="User's Account ID. **Mandatory, must be unique.**\n", 1460 | title='Uniqueid', 1461 | ) 1462 | 1463 | 1464 | class CampaignPrivilegeSchema(BaseModel): 1465 | originId: Optional[constr(min_length=1)] = Field( 1466 | default=None, 1467 | description="The privilege ID in the source system.\nAs opposed to `uniqueId`, it's not mandatory and can be non-unique\n", 1468 | title='Originid', 1469 | ) 1470 | privilegeType: Optional[NewPrivilegeType] = Field( 1471 | default=None, 1472 | description='The "canonical" privilege types that are supported by Authomize off-the-shelf:\n\nPermitted values: \n •\t`Administrative`\n •\t`Data Read`\n •\t`Metadata Read`\n •\t`Data Write`\n •\t`Metadata Write`\n •\t`Data Create`\n •\t`Metadata Create`\n •\t`Data Delete`\n •\t`Metadata Delete`\n', 1473 | ) 1474 | originName: str = Field( 1475 | ..., description='The privilege name in the source system.', title='Originname' 1476 | ) 1477 | uniqueId: constr(min_length=1) = Field( 1478 | ..., 1479 | description='Privilege ID.\n\nIf not defined, set as originName. **Mandatory, must be unique.**\n', 1480 | title='Uniqueid', 1481 | ) 1482 | 1483 | 1484 | class GroupingSchema(BaseModel): 1485 | uniqueId: constr(min_length=1) = Field( 1486 | ..., 1487 | description='\nGrouping ID. **Mandatory, must be unique.**\n', 1488 | title='Uniqueid', 1489 | ) 1490 | originId: Optional[constr(min_length=1)] = Field( 1491 | default=None, 1492 | description="The groupping ID in the source system.\nAs opposed to `uniqueId`, it's not mandatory and can be non-unique\n", 1493 | title='Originid', 1494 | ) 1495 | name: constr(min_length=1) = Field( 1496 | ..., 1497 | description='The name of the grouping. The default is the ID field. **Mandatory**\n', 1498 | title='Name', 1499 | ) 1500 | originType: Optional[str] = Field( 1501 | default=None, 1502 | description='The name of the type of grouping in the source system. The default is `Group`. Example: Group/Alias/AWS Role\n', 1503 | title='Origintype', 1504 | ) 1505 | type: Optional[GroupingType] = Field( 1506 | default='Group', 1507 | description='Allowed values are `Group` and `VirtualGroup`.\n\nThe default is `Group`.\n\n`VirtualGroup` are mapped to the Authomize access explorer graph and are not present in other places in the user interface nor are they counted as a group.\n', 1508 | ) 1509 | isRole: Optional[bool] = Field( 1510 | default=False, 1511 | description='If `Role`, the grouping represents a role in the source application and the name of the role is the grouping `name`.\n\nThe default is `False`.\n', 1512 | title='Isrole', 1513 | ) 1514 | anyoneCanJoinOrLeave: Optional[bool] = Field( 1515 | default=False, 1516 | description="Must be either `ture` or `false`.\nWhen set to `true` users can give themselves membership in this grouping without the grouping's managers' or owners' permission. \nExamples include public groups (M365), Google Groups with specific flags, ...\nValid only when `groupingType = Group`\n", 1517 | title='Anyonecanjoinorleave', 1518 | ) 1519 | owner: Optional[str] = Field( 1520 | default=None, 1521 | description='The uniqueId of the user who is the "owner" (or manager) of the group.\n', 1522 | title='Owner', 1523 | ) 1524 | tags: Optional[List[constr(min_length=1)]] = Field( 1525 | default=None, description='Tags on the access grouping.\n', title='Tags' 1526 | ) 1527 | alternativeName: Optional[constr(max_length=256)] = Field( 1528 | default=None, description='Alias of the grouping.', title='Alternativename' 1529 | ) 1530 | customProperties: Optional[List[CustomProperties]] = Field( 1531 | default=[], description='custom connector parameters', title='Customproperties' 1532 | ) 1533 | 1534 | 1535 | class HTTPValidationError(BaseModel): 1536 | detail: Optional[List[ValidationError]] = Field(default=None, title='Detail') 1537 | 1538 | 1539 | class IdentityDescription(BaseModel): 1540 | id: str = Field(..., title='Id') 1541 | name: Optional[str] = Field(default=None, title='Name') 1542 | type: IdentityTypes 1543 | subType: Optional[IdentitySubTypes] = None 1544 | userType: Optional[str] = Field(default=None, title='Usertype') 1545 | email: Optional[str] = Field(default=None, title='Email') 1546 | manager: Optional[str] = Field(default=None, title='Manager') 1547 | title: Optional[str] = Field(default=None, title='Title') 1548 | department: Optional[str] = Field(default=None, title='Department') 1549 | description: Optional[str] = Field(default=None, title='Description') 1550 | href: Optional[str] = Field(default=None, title='Href') 1551 | createdAt: Optional[datetime] = Field(default=None, title='Createdat') 1552 | terminationDate: Optional[datetime] = Field(default=None, title='Terminationdate') 1553 | isExternal: Optional[bool] = Field(default=None, title='Isexternal') 1554 | isAuxiliary: Optional[bool] = Field(default=None, title='Isauxiliary') 1555 | hasTwoFactorAuthenticationEnabled: Optional[bool] = Field( 1556 | default=None, title='Hastwofactorauthenticationenabled' 1557 | ) 1558 | firstName: Optional[str] = Field(default=None, title='Firstname') 1559 | lastName: Optional[str] = Field(default=None, title='Lastname') 1560 | userName: Optional[str] = Field(default=None, title='Username') 1561 | status: Optional[UserStatus] = None 1562 | service: Optional[str] = Field(default=None, title='Service') 1563 | lastLoginAt: Optional[datetime] = Field(default=None, title='Lastloginat') 1564 | anyoneCanJoinOrLeave: Optional[bool] = Field( 1565 | default=None, title='Anyonecanjoinorleave' 1566 | ) 1567 | tags: Optional[List[str]] = Field(default=None, title='Tags') 1568 | city: Optional[str] = Field(default=None, title='City') 1569 | country: Optional[str] = Field(default=None, title='Country') 1570 | division: Optional[str] = Field(default=None, title='Division') 1571 | employeeNumber: Optional[str] = Field(default=None, title='Employeenumber') 1572 | personalEmail: Optional[str] = Field(default=None, title='Personalemail') 1573 | hireDate: Optional[datetime] = Field(default=None, title='Hiredate') 1574 | 1575 | 1576 | class IdentitySchema(BaseModel): 1577 | uniqueId: constr(min_length=1) = Field( 1578 | ..., description='Identity ID **Mandatory**\n', title='Uniqueid' 1579 | ) 1580 | originId: Optional[constr(min_length=1)] = Field( 1581 | default=None, 1582 | description="The identity ID in the source system.\nAs opposed to `uniqueId`, it's not mandatory and can be non-unique\n", 1583 | title='Originid', 1584 | ) 1585 | name: Optional[str] = Field(default=None, description='Username', title='Name') 1586 | email: Optional[str] = Field( 1587 | default=None, description="User's work email address.\n", title='Email' 1588 | ) 1589 | personalEmail: Optional[str] = Field( 1590 | default=None, 1591 | description="User's personal email address.\n", 1592 | title='Personalemail', 1593 | ) 1594 | firstName: Optional[str] = Field( 1595 | default=None, description="User's first name\n", title='Firstname' 1596 | ) 1597 | lastName: Optional[str] = Field( 1598 | default=None, description="The user's last name.\n", title='Lastname' 1599 | ) 1600 | employeeNumber: Optional[str] = Field( 1601 | default=None, description='Employee number', title='Employeenumber' 1602 | ) 1603 | status: Optional[UserStatus] = Field( 1604 | default=None, 1605 | description='The user status must be one of the following: `Deleted`, `Disabled`, `Enabled`, `Staged` or `Suspended`.\n', 1606 | ) 1607 | country: Optional[str] = Field(default=None, description='Country', title='Country') 1608 | city: Optional[str] = Field(default=None, description='City', title='City') 1609 | department: Optional[str] = Field( 1610 | default=None, 1611 | description="The identity's department in the organization.\n", 1612 | title='Department', 1613 | ) 1614 | division: Optional[str] = Field( 1615 | default=None, 1616 | description="The identity's division in their organization.\n", 1617 | title='Division', 1618 | ) 1619 | title: Optional[str] = Field( 1620 | default=None, description="The user's job title.\n", title='Title' 1621 | ) 1622 | managerId: Optional[str] = Field( 1623 | default=None, description="The manager identity's ID.\n", title='Managerid' 1624 | ) 1625 | hireAt: Optional[datetime] = Field( 1626 | default=None, 1627 | description="The user's first day of work (in ISO 8601 format).\n", 1628 | title='Hireat', 1629 | ) 1630 | terminationAt: Optional[datetime] = Field( 1631 | default=None, 1632 | description="The user's last day of work (in ISO 8601 format).\n", 1633 | title='Terminationat', 1634 | ) 1635 | description: Optional[str] = Field( 1636 | default=None, 1637 | description='Additional description of the identity.\n', 1638 | title='Description', 1639 | ) 1640 | tags: Optional[List[constr(min_length=1)]] = Field( 1641 | default=None, 1642 | description='One or more tags on the user account.\n', 1643 | title='Tags', 1644 | ) 1645 | 1646 | 1647 | class ItemsBundleSchema(BaseModel): 1648 | services: Optional[List[ServiceDescription]] = Field(default=None, title='Services') 1649 | identities: Optional[List[IdentityDescription]] = Field( 1650 | default=None, title='Identities' 1651 | ) 1652 | assets: Optional[List[AssetDescription]] = Field(default=None, title='Assets') 1653 | inheritanceIdentities: Optional[List[IdentitiesInheritance]] = Field( 1654 | default=None, title='Inheritanceidentities' 1655 | ) 1656 | inheritanceAssets: Optional[List[AssetsInheritance]] = Field( 1657 | default=None, title='Inheritanceassets' 1658 | ) 1659 | access: Optional[List[AccessDescription]] = Field(default=None, title='Access') 1660 | 1661 | 1662 | class NewGitRepoListRequestSchema(BaseModel): 1663 | data: List[NewGitRepoRequestSchema] = Field( 1664 | ..., description='New Git Repos', max_items=10000, min_items=1, title='Data' 1665 | ) 1666 | 1667 | 1668 | class NewIdentityRequestSchema(BaseModel): 1669 | uniqueId: constr(min_length=1) = Field( 1670 | ..., description='Identity ID **Mandatory**\n', title='Uniqueid' 1671 | ) 1672 | originId: Optional[constr(min_length=1)] = Field( 1673 | default=None, 1674 | description="The identity ID in the source system.\nAs opposed to `uniqueId`, it's not mandatory and can be non-unique\n", 1675 | title='Originid', 1676 | ) 1677 | name: Optional[str] = Field(default=None, description='Username', title='Name') 1678 | email: Optional[str] = Field( 1679 | default=None, description="User's work email address.\n", title='Email' 1680 | ) 1681 | personalEmail: Optional[str] = Field( 1682 | default=None, 1683 | description="User's personal email address.\n", 1684 | title='Personalemail', 1685 | ) 1686 | firstName: Optional[str] = Field( 1687 | default=None, description="User's first name\n", title='Firstname' 1688 | ) 1689 | lastName: Optional[str] = Field( 1690 | default=None, description="The user's last name.\n", title='Lastname' 1691 | ) 1692 | employeeNumber: Optional[str] = Field( 1693 | default=None, description='Employee number', title='Employeenumber' 1694 | ) 1695 | status: Optional[UserStatus] = Field( 1696 | default=None, 1697 | description='The user status must be one of the following: `Deleted`, `Disabled`, `Enabled`, `Staged` or `Suspended`.\n', 1698 | ) 1699 | country: Optional[str] = Field(default=None, description='Country', title='Country') 1700 | city: Optional[str] = Field(default=None, description='City', title='City') 1701 | department: Optional[str] = Field( 1702 | default=None, 1703 | description="The identity's department in the organization.\n", 1704 | title='Department', 1705 | ) 1706 | division: Optional[str] = Field( 1707 | default=None, 1708 | description="The identity's division in their organization.\n", 1709 | title='Division', 1710 | ) 1711 | title: Optional[str] = Field( 1712 | default=None, description="The user's job title.\n", title='Title' 1713 | ) 1714 | managerId: Optional[str] = Field( 1715 | default=None, description="The manager identity's ID.\n", title='Managerid' 1716 | ) 1717 | hireAt: Optional[datetime] = Field( 1718 | default=None, 1719 | description="The user's first day of work (in ISO 8601 format).\n", 1720 | title='Hireat', 1721 | ) 1722 | terminationAt: Optional[datetime] = Field( 1723 | default=None, 1724 | description="The user's last day of work (in ISO 8601 format).\n", 1725 | title='Terminationat', 1726 | ) 1727 | description: Optional[str] = Field( 1728 | default=None, 1729 | description='Additional description of the identity.\n', 1730 | title='Description', 1731 | ) 1732 | tags: Optional[List[constr(min_length=1)]] = Field( 1733 | default=None, 1734 | description='One or more tags on the user account.\n', 1735 | title='Tags', 1736 | ) 1737 | 1738 | 1739 | class NewPermissionRequestSchema(BaseModel): 1740 | sourceUniqueId: constr(min_length=1) = Field( 1741 | ..., 1742 | description="The unique ID of the permission's source. Must be either `userId` or `groupingId`. **Mandatory**.\n", 1743 | title='Sourceuniqueid', 1744 | ) 1745 | sourceType: PermissionSourceType = Field( 1746 | ..., 1747 | description="The type of the permission's source. **Mandatory**.\n\nSet `sourceType` to either:\n\n- User `uniqueId`.\n- Grouping `uniqueId`.", 1748 | ) 1749 | privilegeId: constr(min_length=1) = Field( 1750 | ..., 1751 | description='The ID of the privilege, allows access to assets. **Mandatory**.\n', 1752 | title='Privilegeid', 1753 | ) 1754 | assetId: Optional[str] = Field( 1755 | default=None, 1756 | description='The ID of the asset.\n\nWhen `null`, this is a global permission on the entire application (not just locally).', 1757 | title='Assetid', 1758 | ) 1759 | isRole: Optional[bool] = Field( 1760 | default=False, 1761 | description='If `true`, the permissions represent the role in the source application.\nThe default is `false`.\n', 1762 | title='Isrole', 1763 | ) 1764 | tags: Optional[List[constr(min_length=1)]] = Field( 1765 | default=None, description='Tags on access permissions.\n', title='Tags' 1766 | ) 1767 | escalationPathPossible: Optional[bool] = Field( 1768 | default=False, 1769 | description="If `true`, it's possible to perform a privilege escalation using the permission. \nexample: User has Read access to a secret containing credentials of another user. This allows \nprivilege escalation.\nopposite example: User has Read metadata permission to a secret containing credentials of another user. This *Does NOT* allows \nprivilege escalation.\n\n", 1770 | title='Escalationpathpossible', 1771 | ) 1772 | 1773 | 1774 | class NewPermissionsListRequestSchema(BaseModel): 1775 | data: List[NewPermissionRequestSchema] = Field( 1776 | ..., description='New Permissions', max_items=10000, min_items=1, title='Data' 1777 | ) 1778 | 1779 | 1780 | class NewPrivilegeRequestSchema(BaseModel): 1781 | originId: Optional[constr(min_length=1)] = Field( 1782 | default=None, 1783 | description="The privilege ID in the source system.\nAs opposed to `uniqueId`, it's not mandatory and can be non-unique\n", 1784 | title='Originid', 1785 | ) 1786 | privilegeType: Optional[NewPrivilegeType] = Field( 1787 | default=None, 1788 | description='The "canonical" privilege types that are supported by Authomize off-the-shelf:\n\nPermitted values: \n •\t`Administrative`\n •\t`Data Read`\n •\t`Metadata Read`\n •\t`Data Write`\n •\t`Metadata Write`\n •\t`Data Create`\n •\t`Metadata Create`\n •\t`Data Delete`\n •\t`Metadata Delete`\n', 1789 | ) 1790 | originName: str = Field( 1791 | ..., description='The privilege name in the source system.', title='Originname' 1792 | ) 1793 | uniqueId: constr(min_length=1) = Field( 1794 | ..., 1795 | description='Privilege ID.\n\nIf not defined, set as originName. **Mandatory, must be unique.**\n', 1796 | title='Uniqueid', 1797 | ) 1798 | type: Optional[PrivilegeType] = Field( 1799 | default=None, 1800 | description='This Field is depreciated. Please use privilegeType Field instead.\n\nThe "canonical" privilege types that are supported by Authomize off-the-shelf:\n\nPermitted values: \n •\t`Administrative`\n •\t`Login`\n •\t`Data Read`\n •\t`Metadata Read`\n •\t`Data Write`\n •\t`Metadata Write`\n •\t`Data Create`\n •\t`Metadata Create`\n •\t`Data Delete`\n •\t`Metadata Delete`\n\n', 1801 | ) 1802 | 1803 | 1804 | class NewPrivilegesListRequestSchema(BaseModel): 1805 | data: List[NewPrivilegeRequestSchema] = Field( 1806 | ..., description='New Privileges', max_items=10000, min_items=1, title='Data' 1807 | ) 1808 | 1809 | 1810 | class NewServiceAccountRequestSchema(BaseModel): 1811 | uniqueId: constr(min_length=1) = Field( 1812 | ..., 1813 | description='Unique Service Account ID. **Mandatory, must be unique.**\n', 1814 | title='Uniqueid', 1815 | ) 1816 | originId: Optional[constr(min_length=1)] = Field( 1817 | default=None, 1818 | description='ID of the Service Account in Source System', 1819 | title='Originid', 1820 | ) 1821 | type: Optional[ServiceAccountType] = Field( 1822 | default=None, description='Type of Service Account' 1823 | ) 1824 | name: Optional[constr(min_length=1)] = Field( 1825 | default=None, description='Name of the service account', title='Name' 1826 | ) 1827 | alternativeName: Optional[str] = Field( 1828 | default=None, 1829 | description='Alias of the service account', 1830 | title='Alternativename', 1831 | ) 1832 | status: Optional[UserStatus] = Field( 1833 | default=None, 1834 | description='Service Account status must be: `Deleted`, `Disabled`, `Enabled`, `Staged`, `Suspended`, or `Unknown`.\n', 1835 | ) 1836 | owner: Optional[str] = Field( 1837 | default=None, description='Unique ID of the owner user', title='Owner' 1838 | ) 1839 | description: Optional[str] = Field( 1840 | default=None, 1841 | description='Description of the service account', 1842 | title='Description', 1843 | ) 1844 | lastLoginAt: Optional[datetime] = Field( 1845 | default=None, 1846 | description='Last login date for service account', 1847 | title='Lastloginat', 1848 | ) 1849 | lastActivityDate: Optional[datetime] = Field( 1850 | default=None, 1851 | description='Date when service account was last active', 1852 | title='Lastactivitydate', 1853 | ) 1854 | credentialsUpdateDate: Optional[datetime] = Field( 1855 | default=None, 1856 | description="Date when the service account's credentials were updated", 1857 | title='Credentialsupdatedate', 1858 | ) 1859 | tags: Optional[List[constr(min_length=1)]] = Field( 1860 | default=None, 1861 | description='One or more tags on the service account.\n', 1862 | title='Tags', 1863 | ) 1864 | 1865 | 1866 | class NewUserRequestSchema(BaseModel): 1867 | originId: Optional[constr(min_length=1)] = Field( 1868 | default=None, 1869 | description="The user ID in the source system.\nAs opposed to `uniqueId`, it's not mandatory and can be non-unique\n", 1870 | title='Originid', 1871 | ) 1872 | name: Optional[str] = Field(default=None, description='Username\n', title='Name') 1873 | email: Optional[str] = Field( 1874 | default=None, description="User's email address.", title='Email' 1875 | ) 1876 | firstName: Optional[str] = Field( 1877 | default=None, description="User's first name\n", title='Firstname' 1878 | ) 1879 | lastName: Optional[str] = Field( 1880 | default=None, description="The user's last name.\n", title='Lastname' 1881 | ) 1882 | status: Optional[UserStatus] = Field( 1883 | default=None, 1884 | description='User status must be: `Deleted`, `Disabled`, `Enabled`, `Staged`, `Suspended`, or `Unknown`.\n', 1885 | ) 1886 | department: Optional[str] = Field( 1887 | default=None, 1888 | description="The user's department in the organization.\n", 1889 | title='Department', 1890 | ) 1891 | title: Optional[str] = Field( 1892 | default=None, description="The user's job title.\n", title='Title' 1893 | ) 1894 | description: Optional[str] = Field( 1895 | default=None, 1896 | description='Additional description of the user.\n', 1897 | title='Description', 1898 | ) 1899 | isExternal: Optional[bool] = Field( 1900 | default=False, 1901 | description='Account is external to Authomize.\nMust be either `true` or `false`.\n', 1902 | title='Isexternal', 1903 | ) 1904 | hasMFA: Optional[bool] = Field( 1905 | default=None, 1906 | description='Has Multi-Factor Authentication enabled.\nMust be either `true` or `false`.\n', 1907 | title='Hasmfa', 1908 | ) 1909 | lastLoginAt: Optional[datetime] = Field( 1910 | default=None, 1911 | description='The last login date in ISO 8601 format.\n', 1912 | title='Lastloginat', 1913 | ) 1914 | tags: Optional[List[constr(min_length=1)]] = Field( 1915 | default=None, 1916 | description='One or more tags on the user account.\n', 1917 | title='Tags', 1918 | ) 1919 | uniqueId: constr(min_length=1) = Field( 1920 | ..., 1921 | description="User's Account ID. **Mandatory, must be unique.**\n", 1922 | title='Uniqueid', 1923 | ) 1924 | customProperties: Optional[List[CustomProperties]] = Field( 1925 | default=[], description='custom connector parameters', title='Customproperties' 1926 | ) 1927 | 1928 | 1929 | class NewUsersListRequestSchema(BaseModel): 1930 | data: List[NewUserRequestSchema] = Field( 1931 | ..., description='New Users', max_items=10000, min_items=1, title='Data' 1932 | ) 1933 | 1934 | 1935 | class PermissionSchema(BaseModel): 1936 | sourceUniqueId: constr(min_length=1) = Field( 1937 | ..., 1938 | description="The unique ID of the permission's source. Must be either `userId` or `groupingId`. **Mandatory**.\n", 1939 | title='Sourceuniqueid', 1940 | ) 1941 | sourceType: PermissionSourceType = Field( 1942 | ..., 1943 | description="The type of the permission's source. **Mandatory**.\n\nSet `sourceType` to either:\n\n- User `uniqueId`.\n- Grouping `uniqueId`.", 1944 | ) 1945 | privilegeId: constr(min_length=1) = Field( 1946 | ..., 1947 | description='The ID of the privilege, allows access to assets. **Mandatory**.\n', 1948 | title='Privilegeid', 1949 | ) 1950 | assetId: Optional[str] = Field( 1951 | default=None, 1952 | description='The ID of the asset.\n\nWhen `null`, this is a global permission on the entire application (not just locally).', 1953 | title='Assetid', 1954 | ) 1955 | isRole: Optional[bool] = Field( 1956 | default=False, 1957 | description='If `true`, the permissions represent the role in the source application.\nThe default is `false`.\n', 1958 | title='Isrole', 1959 | ) 1960 | tags: Optional[List[constr(min_length=1)]] = Field( 1961 | default=None, description='Tags on access permissions.\n', title='Tags' 1962 | ) 1963 | escalationPathPossible: Optional[bool] = Field( 1964 | default=False, 1965 | description="If `true`, it's possible to perform a privilege escalation using the permission. \nexample: User has Read access to a secret containing credentials of another user. This allows \nprivilege escalation.\nopposite example: User has Read metadata permission to a secret containing credentials of another user. This *Does NOT* allows \nprivilege escalation.\n\n", 1966 | title='Escalationpathpossible', 1967 | ) 1968 | 1969 | 1970 | class PrivilegeSchema(BaseModel): 1971 | originId: Optional[constr(min_length=1)] = Field( 1972 | default=None, 1973 | description="The privilege ID in the source system.\nAs opposed to `uniqueId`, it's not mandatory and can be non-unique\n", 1974 | title='Originid', 1975 | ) 1976 | privilegeType: Optional[NewPrivilegeType] = Field( 1977 | default=None, 1978 | description='The "canonical" privilege types that are supported by Authomize off-the-shelf:\n\nPermitted values: \n •\t`Administrative`\n •\t`Data Read`\n •\t`Metadata Read`\n •\t`Data Write`\n •\t`Metadata Write`\n •\t`Data Create`\n •\t`Metadata Create`\n •\t`Data Delete`\n •\t`Metadata Delete`\n', 1979 | ) 1980 | originName: str = Field( 1981 | ..., description='The privilege name in the source system.', title='Originname' 1982 | ) 1983 | uniqueId: constr(min_length=1) = Field( 1984 | ..., 1985 | description='Privilege ID.\n\nIf not defined, set as originName. **Mandatory, must be unique.**\n', 1986 | title='Uniqueid', 1987 | ) 1988 | type: Optional[PrivilegeType] = Field( 1989 | default=None, 1990 | description='This Field is depreciated. Please use privilegeType Field instead.\n\nThe "canonical" privilege types that are supported by Authomize off-the-shelf:\n\nPermitted values: \n •\t`Administrative`\n •\t`Login`\n •\t`Data Read`\n •\t`Metadata Read`\n •\t`Data Write`\n •\t`Metadata Write`\n •\t`Data Create`\n •\t`Metadata Create`\n •\t`Data Delete`\n •\t`Metadata Delete`\n\n', 1991 | ) 1992 | 1993 | 1994 | class RequestsBundleSchema(BaseModel): 1995 | delete_app_data: Optional[bool] = Field( 1996 | default=False, 1997 | description='The Delete Application Data API is used to delete app data by `{appId}`.', 1998 | title='Delete App Data', 1999 | ) 2000 | createdAt: Optional[datetime] = Field(default=None, title='Createdat') 2001 | deleteModifiedAt: Optional[datetime] = Field(default=None, title='Deletemodifiedat') 2002 | new_users: Optional[List[NewUserRequestSchema]] = Field( 2003 | default=None, 2004 | description='The Create Users APIs sets up App users(by App ID).', 2005 | title='New Users', 2006 | ) 2007 | new_groupings: Optional[List[NewGroupingRequestSchema]] = Field( 2008 | default=None, 2009 | description='The Create Groupings API is used to create groups that have access to a particular app.', 2010 | title='New Groupings', 2011 | ) 2012 | new_permissions: Optional[List[NewPermissionRequestSchema]] = Field( 2013 | default=None, 2014 | description='The Create Permissions API is used to create a set of privileges, assigned to a specific target.\nA permission (also referred to as an "entitlement") is a set of privileges, assigned to a specific target. \nExamples include: file permissions, file shares, GCP entitlements, the actual policies assigning access to roles in AWS, and inline policies.\n', 2015 | title='New Permissions', 2016 | ) 2017 | new_privileges: Optional[List[NewPrivilegeRequestSchema]] = Field( 2018 | default=None, 2019 | description='The Create Privileges API is used to define privileges that can be associated with assets.\nFor example, Read privileges on a file.\nHere you can define the type of privileges and associate it to assets in the Permission API.\n', 2020 | title='New Privileges', 2021 | ) 2022 | new_privileges_grants: Optional[List[NewPrivilegeGrantsRequestSchema]] = Field( 2023 | default=None, 2024 | description='The Create Privileges Grants API enables you to establish inheritance between privileges, so that a single privilege contains a set of other privileges. \nFor example, an Administrative privilege that contains read and write privileges.', 2025 | title='New Privileges Grants', 2026 | ) 2027 | new_accounts_association: Optional[List[NewAccountsAssociationRequestSchema]] = ( 2028 | Field( 2029 | default=None, 2030 | description='The Create Accounts Association API creates account associations between user accounts and groups.', 2031 | title='New Accounts Association', 2032 | ) 2033 | ) 2034 | new_groupings_association: Optional[List[NewGroupingsAssociationRequestSchema]] = ( 2035 | Field( 2036 | default=None, 2037 | description='The Create Groupings Association API creates associations between groups and other groups.\n', 2038 | title='New Groupings Association', 2039 | ) 2040 | ) 2041 | new_assets: Optional[List[NewAssetRequestSchema]] = Field( 2042 | default=None, 2043 | description='The Create Assets API creates assets (including asset data).', 2044 | title='New Assets', 2045 | ) 2046 | new_git_repos: Optional[List[NewGitRepoRequestSchema]] = Field( 2047 | default=None, 2048 | description='Creates a Git Repository Asset', 2049 | title='New Git Repos', 2050 | ) 2051 | new_assets_inheritance: Optional[List[NewAssetInheritanceRequestSchema]] = Field( 2052 | default=None, 2053 | description='The Create Assets Inheritence API enables you to create a connection between different assets (for example, a folder that contains multiple files).\n', 2054 | title='New Assets Inheritance', 2055 | ) 2056 | new_identities: Optional[List[NewIdentityRequestSchema]] = Field( 2057 | default=None, 2058 | description='The Create Identities API is used to create identities. \nThe data of the identity from this API is considered "the source of truth" and overrides the identity data from other systems.\n', 2059 | title='New Identities', 2060 | ) 2061 | new_service_accounts: Optional[List[NewServiceAccountRequestSchema]] = Field( 2062 | default=None, title='New Service Accounts' 2063 | ) 2064 | app: Optional[NewAssetRequestSchema] = Field( 2065 | default=None, 2066 | description='The Update Application Data API is used to update app data on `{appId}`.\n', 2067 | title='App', 2068 | ) 2069 | 2070 | 2071 | class RestApiConnectorListSchema(BaseModel): 2072 | pagination: Pagination 2073 | data: List[RestApiConnectorSchema] = Field(..., title='Data') 2074 | 2075 | 2076 | class SearchAssetsListResponseSchema(BaseModel): 2077 | data: List[AssetSchema] = Field(..., description='Assets', title='Data') 2078 | 2079 | 2080 | class SearchGroupingResponseSchema(BaseModel): 2081 | data: List[GroupingSchema] = Field(..., description='Groupings', title='Data') 2082 | 2083 | 2084 | class SearchIdentitiesListResponseSchema(BaseModel): 2085 | data: List[IdentitySchema] = Field(..., description='Identities', title='Data') 2086 | 2087 | 2088 | class SearchPermissionResponseSchema(BaseModel): 2089 | data: List[PermissionSchema] = Field(..., description='Permissions', title='Data') 2090 | 2091 | 2092 | class SearchPrivilegesListResponseSchema(BaseModel): 2093 | data: List[PrivilegeSchema] = Field(..., description='Privileges', title='Data') 2094 | 2095 | 2096 | class ServiceAccountSchema(BaseModel): 2097 | uniqueId: constr(min_length=1) = Field( 2098 | ..., 2099 | description='Unique Service Account ID. **Mandatory, must be unique.**\n', 2100 | title='Uniqueid', 2101 | ) 2102 | originId: Optional[constr(min_length=1)] = Field( 2103 | default=None, 2104 | description='ID of the Service Account in Source System', 2105 | title='Originid', 2106 | ) 2107 | type: Optional[ServiceAccountType] = Field( 2108 | default=None, description='Type of Service Account' 2109 | ) 2110 | name: Optional[constr(min_length=1)] = Field( 2111 | default=None, description='Name of the service account', title='Name' 2112 | ) 2113 | alternativeName: Optional[str] = Field( 2114 | default=None, 2115 | description='Alias of the service account', 2116 | title='Alternativename', 2117 | ) 2118 | status: Optional[UserStatus] = Field( 2119 | default=None, 2120 | description='Service Account status must be: `Deleted`, `Disabled`, `Enabled`, `Staged`, `Suspended`, or `Unknown`.\n', 2121 | ) 2122 | owner: Optional[str] = Field( 2123 | default=None, description='Unique ID of the owner user', title='Owner' 2124 | ) 2125 | description: Optional[str] = Field( 2126 | default=None, 2127 | description='Description of the service account', 2128 | title='Description', 2129 | ) 2130 | lastLoginAt: Optional[datetime] = Field( 2131 | default=None, 2132 | description='Last login date for service account', 2133 | title='Lastloginat', 2134 | ) 2135 | lastActivityDate: Optional[datetime] = Field( 2136 | default=None, 2137 | description='Date when service account was last active', 2138 | title='Lastactivitydate', 2139 | ) 2140 | credentialsUpdateDate: Optional[datetime] = Field( 2141 | default=None, 2142 | description="Date when the service account's credentials were updated", 2143 | title='Credentialsupdatedate', 2144 | ) 2145 | tags: Optional[List[constr(min_length=1)]] = Field( 2146 | default=None, 2147 | description='One or more tags on the service account.\n', 2148 | title='Tags', 2149 | ) 2150 | 2151 | 2152 | class TransactionPaginatedSearchSchema(BaseModel): 2153 | data: List[BundleTransactionSchema] = Field(..., title='Data') 2154 | pagination: Pagination 2155 | 2156 | 2157 | class UpdateGroupingsListRequestSchema(BaseModel): 2158 | data: List[UpdateGroupingsRequestSchema] = Field( 2159 | ..., 2160 | description='List of update user requests.\n', 2161 | max_items=10000, 2162 | min_items=1, 2163 | title='Data', 2164 | ) 2165 | 2166 | 2167 | class UpdateIdentityRequestSchema(BaseModel): 2168 | uniqueId: constr(min_length=1) = Field( 2169 | ..., description='Identity ID **Mandatory**\n', title='Uniqueid' 2170 | ) 2171 | originId: Optional[constr(min_length=1)] = Field( 2172 | default=None, 2173 | description="The identity ID in the source system.\nAs opposed to `uniqueId`, it's not mandatory and can be non-unique\n", 2174 | title='Originid', 2175 | ) 2176 | name: Optional[str] = Field(default=None, description='Username', title='Name') 2177 | email: Optional[str] = Field( 2178 | default=None, description="User's work email address.\n", title='Email' 2179 | ) 2180 | personalEmail: Optional[str] = Field( 2181 | default=None, 2182 | description="User's personal email address.\n", 2183 | title='Personalemail', 2184 | ) 2185 | firstName: Optional[str] = Field( 2186 | default=None, description="User's first name\n", title='Firstname' 2187 | ) 2188 | lastName: Optional[str] = Field( 2189 | default=None, description="The user's last name.\n", title='Lastname' 2190 | ) 2191 | employeeNumber: Optional[str] = Field( 2192 | default=None, description='Employee number', title='Employeenumber' 2193 | ) 2194 | status: Optional[UserStatus] = Field( 2195 | default=None, 2196 | description='The user status must be one of the following: `Deleted`, `Disabled`, `Enabled`, `Staged` or `Suspended`.\n', 2197 | ) 2198 | country: Optional[str] = Field(default=None, description='Country', title='Country') 2199 | city: Optional[str] = Field(default=None, description='City', title='City') 2200 | department: Optional[str] = Field( 2201 | default=None, 2202 | description="The identity's department in the organization.\n", 2203 | title='Department', 2204 | ) 2205 | division: Optional[str] = Field( 2206 | default=None, 2207 | description="The identity's division in their organization.\n", 2208 | title='Division', 2209 | ) 2210 | title: Optional[str] = Field( 2211 | default=None, description="The user's job title.\n", title='Title' 2212 | ) 2213 | managerId: Optional[str] = Field( 2214 | default=None, description="The manager identity's ID.\n", title='Managerid' 2215 | ) 2216 | hireAt: Optional[datetime] = Field( 2217 | default=None, 2218 | description="The user's first day of work (in ISO 8601 format).\n", 2219 | title='Hireat', 2220 | ) 2221 | terminationAt: Optional[datetime] = Field( 2222 | default=None, 2223 | description="The user's last day of work (in ISO 8601 format).\n", 2224 | title='Terminationat', 2225 | ) 2226 | description: Optional[str] = Field( 2227 | default=None, 2228 | description='Additional description of the identity.\n', 2229 | title='Description', 2230 | ) 2231 | tags: Optional[List[constr(min_length=1)]] = Field( 2232 | default=None, 2233 | description='One or more tags on the user account.\n', 2234 | title='Tags', 2235 | ) 2236 | 2237 | 2238 | class UpdateServiceAccountRequestSchema(BaseModel): 2239 | uniqueId: constr(min_length=1) = Field( 2240 | ..., 2241 | description='Unique Service Account ID. **Mandatory, must be unique.**\n', 2242 | title='Uniqueid', 2243 | ) 2244 | originId: Optional[constr(min_length=1)] = Field( 2245 | default=None, 2246 | description='ID of the Service Account in Source System', 2247 | title='Originid', 2248 | ) 2249 | type: Optional[ServiceAccountType] = Field( 2250 | default=None, description='Type of Service Account' 2251 | ) 2252 | name: Optional[constr(min_length=1)] = Field( 2253 | default=None, description='Name of the service account', title='Name' 2254 | ) 2255 | alternativeName: Optional[str] = Field( 2256 | default=None, 2257 | description='Alias of the service account', 2258 | title='Alternativename', 2259 | ) 2260 | status: Optional[UserStatus] = Field( 2261 | default=None, 2262 | description='Service Account status must be: `Deleted`, `Disabled`, `Enabled`, `Staged`, `Suspended`, or `Unknown`.\n', 2263 | ) 2264 | owner: Optional[str] = Field( 2265 | default=None, description='Unique ID of the owner user', title='Owner' 2266 | ) 2267 | description: Optional[str] = Field( 2268 | default=None, 2269 | description='Description of the service account', 2270 | title='Description', 2271 | ) 2272 | lastLoginAt: Optional[datetime] = Field( 2273 | default=None, 2274 | description='Last login date for service account', 2275 | title='Lastloginat', 2276 | ) 2277 | lastActivityDate: Optional[datetime] = Field( 2278 | default=None, 2279 | description='Date when service account was last active', 2280 | title='Lastactivitydate', 2281 | ) 2282 | credentialsUpdateDate: Optional[datetime] = Field( 2283 | default=None, 2284 | description="Date when the service account's credentials were updated", 2285 | title='Credentialsupdatedate', 2286 | ) 2287 | tags: Optional[List[constr(min_length=1)]] = Field( 2288 | default=None, 2289 | description='One or more tags on the service account.\n', 2290 | title='Tags', 2291 | ) 2292 | 2293 | 2294 | class UpdateUserRequestSchema(BaseModel): 2295 | originId: Optional[constr(min_length=1)] = Field( 2296 | default=None, 2297 | description="The user ID in the source system.\nAs opposed to `uniqueId`, it's not mandatory and can be non-unique\n", 2298 | title='Originid', 2299 | ) 2300 | name: Optional[str] = Field(default=None, description='Username\n', title='Name') 2301 | email: Optional[str] = Field( 2302 | default=None, description="User's email address.", title='Email' 2303 | ) 2304 | firstName: Optional[str] = Field( 2305 | default=None, description="User's first name\n", title='Firstname' 2306 | ) 2307 | lastName: Optional[str] = Field( 2308 | default=None, description="The user's last name.\n", title='Lastname' 2309 | ) 2310 | status: Optional[UserStatus] = Field( 2311 | default=None, 2312 | description='User status must be: `Deleted`, `Disabled`, `Enabled`, `Staged`, `Suspended`, or `Unknown`.\n', 2313 | ) 2314 | department: Optional[str] = Field( 2315 | default=None, 2316 | description="The user's department in the organization.\n", 2317 | title='Department', 2318 | ) 2319 | title: Optional[str] = Field( 2320 | default=None, description="The user's job title.\n", title='Title' 2321 | ) 2322 | description: Optional[str] = Field( 2323 | default=None, 2324 | description='Additional description of the user.\n', 2325 | title='Description', 2326 | ) 2327 | isExternal: Optional[bool] = Field( 2328 | default=False, 2329 | description='Account is external to Authomize.\nMust be either `true` or `false`.\n', 2330 | title='Isexternal', 2331 | ) 2332 | hasMFA: Optional[bool] = Field( 2333 | default=None, 2334 | description='Has Multi-Factor Authentication enabled.\nMust be either `true` or `false`.\n', 2335 | title='Hasmfa', 2336 | ) 2337 | lastLoginAt: Optional[datetime] = Field( 2338 | default=None, 2339 | description='The last login date in ISO 8601 format.\n', 2340 | title='Lastloginat', 2341 | ) 2342 | tags: Optional[List[constr(min_length=1)]] = Field( 2343 | default=None, 2344 | description='One or more tags on the user account.\n', 2345 | title='Tags', 2346 | ) 2347 | uniqueId: constr(min_length=1) = Field( 2348 | ..., 2349 | description="User's Account ID. **Mandatory, must be unique.**\n", 2350 | title='Uniqueid', 2351 | ) 2352 | customProperties: Optional[List[CustomProperties]] = Field( 2353 | default=[], description='custom connector parameters', title='Customproperties' 2354 | ) 2355 | 2356 | 2357 | class UserSchema(BaseModel): 2358 | originId: Optional[constr(min_length=1)] = Field( 2359 | default=None, 2360 | description="The user ID in the source system.\nAs opposed to `uniqueId`, it's not mandatory and can be non-unique\n", 2361 | title='Originid', 2362 | ) 2363 | name: Optional[str] = Field(default=None, description='Username\n', title='Name') 2364 | email: Optional[str] = Field( 2365 | default=None, description="User's email address.", title='Email' 2366 | ) 2367 | firstName: Optional[str] = Field( 2368 | default=None, description="User's first name\n", title='Firstname' 2369 | ) 2370 | lastName: Optional[str] = Field( 2371 | default=None, description="The user's last name.\n", title='Lastname' 2372 | ) 2373 | status: Optional[UserStatus] = Field( 2374 | default=None, 2375 | description='User status must be: `Deleted`, `Disabled`, `Enabled`, `Staged`, `Suspended`, or `Unknown`.\n', 2376 | ) 2377 | department: Optional[str] = Field( 2378 | default=None, 2379 | description="The user's department in the organization.\n", 2380 | title='Department', 2381 | ) 2382 | title: Optional[str] = Field( 2383 | default=None, description="The user's job title.\n", title='Title' 2384 | ) 2385 | description: Optional[str] = Field( 2386 | default=None, 2387 | description='Additional description of the user.\n', 2388 | title='Description', 2389 | ) 2390 | isExternal: Optional[bool] = Field( 2391 | default=False, 2392 | description='Account is external to Authomize.\nMust be either `true` or `false`.\n', 2393 | title='Isexternal', 2394 | ) 2395 | hasMFA: Optional[bool] = Field( 2396 | default=None, 2397 | description='Has Multi-Factor Authentication enabled.\nMust be either `true` or `false`.\n', 2398 | title='Hasmfa', 2399 | ) 2400 | lastLoginAt: Optional[datetime] = Field( 2401 | default=None, 2402 | description='The last login date in ISO 8601 format.\n', 2403 | title='Lastloginat', 2404 | ) 2405 | tags: Optional[List[constr(min_length=1)]] = Field( 2406 | default=None, 2407 | description='One or more tags on the user account.\n', 2408 | title='Tags', 2409 | ) 2410 | uniqueId: constr(min_length=1) = Field( 2411 | ..., 2412 | description="User's Account ID. **Mandatory, must be unique.**\n", 2413 | title='Uniqueid', 2414 | ) 2415 | customProperties: Optional[List[CustomProperties]] = Field( 2416 | default=[], description='custom connector parameters', title='Customproperties' 2417 | ) 2418 | 2419 | 2420 | class AddCampaignMembershipsRequestSchema(BaseModel): 2421 | account: CampaignAccountSchema = Field( 2422 | ..., description='Account to be reviewed.', title='Account' 2423 | ) 2424 | reviewer: CampaignReviewerSchema = Field( 2425 | ..., description='Reviewer.', title='Reviewer' 2426 | ) 2427 | group: CampaignGroupingSchema = Field( 2428 | ..., description='The group to be reviewed.', title='Group' 2429 | ) 2430 | 2431 | 2432 | class AddCampaignPermissionsRequestSchema(BaseModel): 2433 | account: CampaignAccountSchema = Field( 2434 | ..., description='Account to be reviewed.', title='Account' 2435 | ) 2436 | reviewer: CampaignReviewerSchema = Field( 2437 | ..., description='Reviewer.', title='Reviewer' 2438 | ) 2439 | privilege: CampaignPrivilegeSchema = Field( 2440 | ..., description='Privilege to be reviewed.', title='Privilege' 2441 | ) 2442 | asset: CampaignAssetSchema = Field( 2443 | ..., description='Asset to be reviewed.', title='Asset' 2444 | ) 2445 | 2446 | 2447 | class IngestionDataBundleSchema(BaseModel): 2448 | new_users: Optional[List[NewUserRequestSchema]] = Field( 2449 | default=None, 2450 | description='The Create Users APIs sets up App users(by App ID).', 2451 | title='New Users', 2452 | ) 2453 | new_groupings: Optional[List[NewGroupingRequestSchema]] = Field( 2454 | default=None, 2455 | description='The Create Groupings API is used to create groups that have access to a particular app.', 2456 | title='New Groupings', 2457 | ) 2458 | new_permissions: Optional[List[NewPermissionRequestSchema]] = Field( 2459 | default=None, 2460 | description='The Create Permissions API is used to create a set of privileges, assigned to a specific target.\nA permission (also referred to as an "entitlement") is a set of privileges, assigned to a specific target. \nExamples include: file permissions, file shares, GCP entitlements, the actual policies assigning access to roles in AWS, and inline policies.\n', 2461 | title='New Permissions', 2462 | ) 2463 | new_privileges: Optional[List[NewPrivilegeRequestSchema]] = Field( 2464 | default=None, 2465 | description='The Create Privileges API is used to define privileges that can be associated with assets.\nFor example, Read privileges on a file.\nHere you can define the type of privileges and associate it to assets in the Permission API.\n', 2466 | title='New Privileges', 2467 | ) 2468 | new_privileges_grants: Optional[List[NewPrivilegeGrantsRequestSchema]] = Field( 2469 | default=None, 2470 | description='The Create Privileges Grants API enables you to establish inheritance between privileges, so that a single privilege contains a set of other privileges. \nFor example, an Administrative privilege that contains read and write privileges.', 2471 | title='New Privileges Grants', 2472 | ) 2473 | new_accounts_association: Optional[List[NewAccountsAssociationRequestSchema]] = ( 2474 | Field( 2475 | default=None, 2476 | description='The Create Accounts Association API creates account associations between user accounts and groups.', 2477 | title='New Accounts Association', 2478 | ) 2479 | ) 2480 | new_groupings_association: Optional[List[NewGroupingsAssociationRequestSchema]] = ( 2481 | Field( 2482 | default=None, 2483 | description='The Create Groupings Association API creates associations between groups and other groups.\n', 2484 | title='New Groupings Association', 2485 | ) 2486 | ) 2487 | new_assets: Optional[List[NewAssetRequestSchema]] = Field( 2488 | default=None, 2489 | description='The Create Assets API creates assets (including asset data).', 2490 | title='New Assets', 2491 | ) 2492 | new_git_repos: Optional[List[NewGitRepoRequestSchema]] = Field( 2493 | default=None, 2494 | description='Creates a Git Repository Asset', 2495 | title='New Git Repos', 2496 | ) 2497 | new_assets_inheritance: Optional[List[NewAssetInheritanceRequestSchema]] = Field( 2498 | default=None, 2499 | description='The Create Assets Inheritence API enables you to create a connection between different assets (for example, a folder that contains multiple files).\n', 2500 | title='New Assets Inheritance', 2501 | ) 2502 | new_identities: Optional[List[NewIdentityRequestSchema]] = Field( 2503 | default=None, 2504 | description='The Create Identities API is used to create identities. \nThe data of the identity from this API is considered "the source of truth" and overrides the identity data from other systems.\n', 2505 | title='New Identities', 2506 | ) 2507 | new_service_accounts: Optional[List[NewServiceAccountRequestSchema]] = Field( 2508 | default=None, title='New Service Accounts' 2509 | ) 2510 | app: Optional[NewAssetRequestSchema] = Field( 2511 | default=None, 2512 | description='The Update Application Data API is used to update app data on `{appId}`.\n', 2513 | title='App', 2514 | ) 2515 | 2516 | 2517 | class NewIdentitiesListRequestSchema(BaseModel): 2518 | data: List[NewIdentityRequestSchema] = Field( 2519 | ..., description='New Identities', max_items=10000, min_items=1, title='Data' 2520 | ) 2521 | 2522 | 2523 | class NewServiceAccountListRequestSchema(BaseModel): 2524 | data: List[NewServiceAccountRequestSchema] = Field( 2525 | ..., 2526 | description='Create Service Accounts', 2527 | max_items=10000, 2528 | min_items=1, 2529 | title='Data', 2530 | ) 2531 | 2532 | 2533 | class SearchServiceAccountListResponseSchema(BaseModel): 2534 | data: List[ServiceAccountSchema] = Field( 2535 | ..., description='List of service accounts', title='Data' 2536 | ) 2537 | 2538 | 2539 | class SearchUsersListResponseSchema(BaseModel): 2540 | data: List[UserSchema] = Field(..., description='Users', title='Data') 2541 | 2542 | 2543 | class UpdateIdentitiesListRequestSchema(BaseModel): 2544 | data: List[UpdateIdentityRequestSchema] = Field( 2545 | ..., 2546 | description='List of update identity requests.\n', 2547 | max_items=10000, 2548 | min_items=1, 2549 | title='Data', 2550 | ) 2551 | 2552 | 2553 | class UpdateServiceAccountListRequestSchema(BaseModel): 2554 | data: List[UpdateServiceAccountRequestSchema] = Field( 2555 | ..., 2556 | description='List of Service Accounts to be updated [Must contain at least `uniqueId`]', 2557 | max_items=10000, 2558 | min_items=1, 2559 | title='Data', 2560 | ) 2561 | 2562 | 2563 | class UpdateUserListRequestSchema(BaseModel): 2564 | data: List[UpdateUserRequestSchema] = Field( 2565 | ..., 2566 | description='List of update user requests.\n', 2567 | max_items=10000, 2568 | min_items=1, 2569 | title='Data', 2570 | ) 2571 | 2572 | 2573 | class AddCampaignMembershipsListRequestSchema(BaseModel): 2574 | data: List[AddCampaignMembershipsRequestSchema] = Field( 2575 | ..., 2576 | description='New Campaign Memberships.', 2577 | max_items=1000, 2578 | min_items=1, 2579 | title='Data', 2580 | ) 2581 | validateOnly: Optional[bool] = Field( 2582 | default=False, 2583 | description='Validate the request without uploading the data into the system.', 2584 | title='Validateonly', 2585 | ) 2586 | 2587 | 2588 | class AddCampaignPermissionsListRequestSchema(BaseModel): 2589 | data: List[AddCampaignPermissionsRequestSchema] = Field( 2590 | ..., 2591 | description='New Campaign Permissions.', 2592 | max_items=1000, 2593 | min_items=1, 2594 | title='Data', 2595 | ) 2596 | validateOnly: Optional[bool] = Field( 2597 | default=False, 2598 | description='Validate the request without uploading the data into the system.', 2599 | title='Validateonly', 2600 | ) 2601 | 2602 | 2603 | class AllSchemasResponseSchema(BaseModel): 2604 | v1_bundle_schema: Optional[ItemsBundleSchema] = None 2605 | v2_bundle_schema: Optional[RequestsBundleSchema] = None 2606 | v2_data_only_schema: Optional[IngestionDataBundleSchema] = None 2607 | -------------------------------------------------------------------------------- /authomize/rest_api_client/generated/external_rest_api/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/authomize/connectors-rest-api-client/3fa115d39887c00e688ce387ad5f15f77f3ffccc/authomize/rest_api_client/generated/external_rest_api/__init__.py -------------------------------------------------------------------------------- /authomize/rest_api_client/generated/external_rest_api/schemas.py: -------------------------------------------------------------------------------- 1 | # generated by datamodel-codegen: 2 | # filename: openapi.json 3 | # timestamp: 2023-10-24T14:33:37+00:00 4 | 5 | from __future__ import annotations 6 | 7 | from datetime import datetime 8 | from enum import Enum 9 | from typing import List, Optional, Union 10 | 11 | from pydantic import BaseModel, Extra, Field, conint, constr 12 | 13 | 14 | class AccountExpansion(Enum): 15 | identity = 'identity' 16 | sourceApp = 'sourceApp' 17 | tags = 'tags' 18 | riskScores = 'riskScores' 19 | 20 | 21 | class AccountRiskScore(BaseModel): 22 | blastRadiusRiskScore: Optional[int] = Field( 23 | default=None, 24 | description='Blast Radius Risk Score', 25 | title='Blastradiusriskscore', 26 | ) 27 | takeoverRiskScore: Optional[int] = Field( 28 | default=None, description='Takeover Risk Score', title='Takeoverriskscore' 29 | ) 30 | overallRiskScore: Optional[int] = Field( 31 | default=None, description='Overall Risk Score', title='Overallriskscore' 32 | ) 33 | 34 | 35 | class AccountSourceAppIdFilter(BaseModel): 36 | class Config: 37 | extra = Extra.forbid 38 | 39 | field_eq: Optional[str] = Field( 40 | default=None, alias='$eq', description='Equals To', title='$Eq' 41 | ) 42 | 43 | 44 | class AddIncidentCommentRequestSchema(BaseModel): 45 | class Config: 46 | extra = Extra.forbid 47 | 48 | content: constr(max_length=1025) = Field( 49 | ..., description='Content of comment.', title='Content' 50 | ) 51 | 52 | 53 | class AicpaTsc2017Standard(Enum): 54 | CC1_1 = 'CC1.1' 55 | CC6_3 = 'CC6.3' 56 | CC5_1 = 'CC5.1' 57 | CC5_3 = 'CC5.3' 58 | CC6_1 = 'CC6.1' 59 | CC6_2 = 'CC6.2' 60 | CC6_7 = 'CC6.7' 61 | CC6_6 = 'CC6.6' 62 | CC3_2 = 'CC3.2' 63 | CC3_3 = 'CC3.3' 64 | CC3_4 = 'CC3.4' 65 | 66 | 67 | class AlertCategoryType(Enum): 68 | Change_Management = 'Change Management' 69 | Misconfiguration = 'Misconfiguration' 70 | Exposure = 'Exposure' 71 | Privileged_Access = 'Privileged Access' 72 | Suspicious_Behavior = 'Suspicious Behavior' 73 | Least_Privilege = 'Least Privilege' 74 | Custom = 'Custom' 75 | IAM_Infrastructure_Security = 'IAM Infrastructure Security' 76 | Account_Takeover_Protection = 'Account Takeover Protection' 77 | Stale_Access = 'Stale Access' 78 | Initial_Access = 'Initial Access' 79 | Over_privileges = 'Over-privileges' 80 | Privilege_Escalation = 'Privilege Escalation' 81 | Lateral_Movement = 'Lateral Movement' 82 | Detection = 'Detection' 83 | Persistence = 'Persistence' 84 | Evasion = 'Evasion' 85 | Account_Takeover = 'Account Takeover' 86 | Account_Impersonation__PE__LM_ = 'Account Impersonation (PE, LM)' 87 | 88 | 89 | class AppIdFilter(BaseModel): 90 | class Config: 91 | extra = Extra.forbid 92 | 93 | field_eq: Optional[str] = Field( 94 | default=None, alias='$eq', description='Equals To', title='$Eq' 95 | ) 96 | 97 | 98 | class AssetExpansion(Enum): 99 | sourceApp = 'sourceApp' 100 | tags = 'tags' 101 | 102 | 103 | class AssetIdFilter(BaseModel): 104 | class Config: 105 | extra = Extra.forbid 106 | 107 | field_in: Optional[List[str]] = Field( 108 | default=[], alias='$in', description='In', title='$In' 109 | ) 110 | 111 | 112 | class AttackTacticType(Enum): 113 | Collection = 'Collection' 114 | Credential_Access = 'Credential Access' 115 | Defense_Evasion = 'Defense Evasion' 116 | Discovery = 'Discovery' 117 | Exfiltration = 'Exfiltration' 118 | Impact = 'Impact' 119 | Initial_Access = 'Initial Access' 120 | Lateral_Movement = 'Lateral Movement' 121 | Persistence = 'Persistence' 122 | Privilege_Escalation = 'Privilege Escalation' 123 | 124 | 125 | class CampaignExpansion(Enum): 126 | owner = 'owner' 127 | 128 | 129 | class CampaignStatus(Enum): 130 | draft = 'draft' 131 | initializing = 'initializing' 132 | running = 'running' 133 | completed = 'completed' 134 | failed = 'failed' 135 | empty = 'empty' 136 | overdue = 'overdue' 137 | 138 | 139 | class CampaignStatusFilter(BaseModel): 140 | class Config: 141 | extra = Extra.forbid 142 | 143 | field_in: Optional[List[CampaignStatus]] = Field( 144 | default=[], alias='$in', description='In' 145 | ) 146 | 147 | 148 | class CampaignsPermissionDistinctIdentitySchema(BaseModel): 149 | id: str = Field(..., description='Distinct identity ID.', title='Id') 150 | name: Optional[str] = Field( 151 | default=None, description='Name of the distinct identity.', title='Name' 152 | ) 153 | title: Optional[str] = Field( 154 | default=None, description='Distinct identity title.', title='Title' 155 | ) 156 | department: Optional[str] = Field( 157 | default=None, 158 | description='Department of the distinct identity.', 159 | title='Department', 160 | ) 161 | 162 | 163 | class CampaignsPermissionSourceAppSchema(BaseModel): 164 | id: str = Field(..., description='Source app ID.', title='Id') 165 | name: Optional[str] = Field( 166 | default=None, description='Source app name.', title='Name' 167 | ) 168 | sourceAppType: Optional[str] = Field( 169 | default=None, description='Source app type.', title='Sourceapptype' 170 | ) 171 | 172 | 173 | class CampaignsPermissionTagSchema(BaseModel): 174 | id: str = Field(..., description='Tag ID.', title='Id') 175 | name: Optional[str] = Field( 176 | default=None, description='Name of the tag.', title='Name' 177 | ) 178 | 179 | 180 | class Ccm301Standard(Enum): 181 | AIS_04 = 'AIS-04' 182 | IAM_01 = 'IAM-01' 183 | IAM_02 = 'IAM-02' 184 | IAM_03 = 'IAM-03' 185 | IAM_04 = 'IAM-04' 186 | IAM_05 = 'IAM-05' 187 | IAM_06 = 'IAM-06' 188 | IAM_07 = 'IAM-07' 189 | IAM_08 = 'IAM-08' 190 | IAM_09 = 'IAM-09' 191 | IAM_10 = 'IAM-10' 192 | IAM_11 = 'IAM-11' 193 | IAM_12 = 'IAM-12' 194 | IAM_13 = 'IAM-13' 195 | GRM_06 = 'GRM-06' 196 | IVS_06 = 'IVS-06' 197 | IVS_08 = 'IVS-08' 198 | DSI_04 = 'DSI-04' 199 | 200 | 201 | class Ccm402Standard(Enum): 202 | IAM_01 = 'IAM-01' 203 | IAM_02 = 'IAM-02' 204 | IAM_03 = 'IAM-03' 205 | IAM_04 = 'IAM-04' 206 | IAM_05 = 'IAM-05' 207 | IAM_06 = 'IAM-06' 208 | IAM_07 = 'IAM-07' 209 | IAM_08 = 'IAM-08' 210 | IAM_09 = 'IAM-09' 211 | IAM_10 = 'IAM-10' 212 | IAM_11 = 'IAM-11' 213 | IAM_12 = 'IAM-12' 214 | IAM_13 = 'IAM-13' 215 | IAM_14 = 'IAM-14' 216 | IAM_15 = 'IAM-15' 217 | IAM_16 = 'IAM-16' 218 | IVS_03 = 'IVS-03' 219 | IVS_04 = 'IVS-04' 220 | DSP_07 = 'DSP-07' 221 | DSP_08 = 'DSP-08' 222 | DSP_10 = 'DSP-10' 223 | AIS_03 = 'AIS-03' 224 | DSP_17 = 'DSP-17' 225 | DSP_01 = 'DSP-01' 226 | HRS_05 = 'HRS-05' 227 | 228 | 229 | class CisV8Standard(Enum): 230 | field_3_1 = '3.1' 231 | field_3_3 = '3.3' 232 | field_6_8 = '6.8' 233 | field_5_4 = '5.4' 234 | field_12_7 = '12.7' 235 | field_6_5 = '6.5' 236 | field_6_2 = '6.2' 237 | field_5_3 = '5.3' 238 | field_12_2 = '12.2' 239 | field_6_1 = '6.1' 240 | field_5_1 = '5.1' 241 | field_4_11 = '4.11' 242 | field_13_4 = '13.4' 243 | field_13_9 = '13.9' 244 | field_13_10 = '13.10' 245 | 246 | 247 | class Cisv8(BaseModel): 248 | values: List[CisV8Standard] = Field(..., description='Values') 249 | id: Optional[str] = Field(default='cisv8', description='UniqueID', title='Id') 250 | name: Optional[str] = Field(default='CIS v.8', description='Name', title='Name') 251 | 252 | 253 | class CommentSchema(BaseModel): 254 | class Config: 255 | extra = Extra.forbid 256 | 257 | id: str = Field(..., description='Unique ID of comment.', title='Id') 258 | content: constr(max_length=1025) = Field( 259 | ..., description='Content of comment.', title='Content' 260 | ) 261 | 262 | 263 | class CreateCampaignRequestSchema(BaseModel): 264 | name: str = Field(..., description='Name', title='Name') 265 | startDate: datetime = Field(..., description='Start date', title='Startdate') 266 | endDate: datetime = Field(..., description='End date', title='Enddate') 267 | fallbackReviewerUserId: Optional[str] = Field( 268 | default=None, 269 | description='Default: `UserId` connected to the current API-Token. \n Fallback reviewer user ID.', 270 | title='Fallbackrevieweruserid', 271 | ) 272 | 273 | 274 | class CreateCampaignResponseSchema(BaseModel): 275 | id: str = Field(..., description='Id', title='Id') 276 | name: str = Field(..., description='Name', title='Name') 277 | startDate: datetime = Field(..., description='Start date', title='Startdate') 278 | endDate: datetime = Field(..., description='End date', title='Enddate') 279 | fallbackReviewerUserId: Optional[str] = Field( 280 | default=None, 281 | description='Default: `UserId` connected to the current API-Token. \n Fallback reviewer user ID.', 282 | title='Fallbackrevieweruserid', 283 | ) 284 | status: Optional[CampaignStatus] = Field( 285 | default='initializing', description='status', title='status' 286 | ) 287 | isDeleted: Optional[bool] = Field( 288 | default=False, description='Is deleted', title='Isdeleted' 289 | ) 290 | createdAt: Optional[datetime] = Field( 291 | default=None, description='Created at', title='Createdat' 292 | ) 293 | 294 | 295 | class DateFilterAllowedValues(Enum): 296 | Yesterday = 'Yesterday' 297 | Last_Week = 'Last Week' 298 | Last_Month = 'Last Month' 299 | Last_3_Months = 'Last 3 Months' 300 | Last_6_Months = 'Last 6 Months' 301 | Last_Year = 'Last Year' 302 | 303 | 304 | class EmailFilter(BaseModel): 305 | class Config: 306 | extra = Extra.forbid 307 | 308 | field_in: Optional[List[str]] = Field( 309 | default=[], alias='$in', description='In', title='$In' 310 | ) 311 | 312 | 313 | class EntitlementSelections(Enum): 314 | keep = 'keep' 315 | revoke = 'revoke' 316 | change = 'change' 317 | 318 | 319 | class EventStatusType(Enum): 320 | Open = 'Open' 321 | InProgress = 'InProgress' 322 | WaitingForInput = 'WaitingForInput' 323 | Closed = 'Closed' 324 | 325 | 326 | class FieldName(Enum): 327 | name = 'name' 328 | status = 'status' 329 | startDate = 'startDate' 330 | endDate = 'endDate' 331 | createdAt = 'createdAt' 332 | reviewerType = 'reviewerType' 333 | templateName = 'templateName' 334 | 335 | 336 | class GroupExpansion(Enum): 337 | sourceApp = 'sourceApp' 338 | tags = 'tags' 339 | 340 | 341 | class GroupMembership(BaseModel): 342 | actorName: Optional[str] = Field( 343 | default=None, description='Name of the member.', title='Actorname' 344 | ) 345 | actorType: Optional[str] = Field( 346 | default=None, description='Type of the member', title='Actortype' 347 | ) 348 | actorAuthomizeId: Optional[str] = Field( 349 | default=None, 350 | description='Authomizer ID of the member.', 351 | title='Actorauthomizeid', 352 | ) 353 | actorOriginId: Optional[str] = Field( 354 | default=None, description='Origin ID of the member~', title='Actororiginid' 355 | ) 356 | 357 | 358 | class HiredAtFilter(BaseModel): 359 | class Config: 360 | extra = Extra.forbid 361 | 362 | field_eq: Optional[DateFilterAllowedValues] = Field( 363 | default=None, alias='$eq', description='Equals To' 364 | ) 365 | 366 | 367 | class IdFilter(BaseModel): 368 | class Config: 369 | extra = Extra.forbid 370 | 371 | field_in: Optional[List[str]] = Field( 372 | default=[], alias='$in', description='In', title='$In' 373 | ) 374 | 375 | 376 | class IdentityExpansion(Enum): 377 | account = 'account' 378 | tags = 'tags' 379 | 380 | 381 | class IdentityRiskScore(BaseModel): 382 | takeoverRiskScore: Optional[int] = Field( 383 | default=None, description='Takeover Risk Score', title='Takeoverriskscore' 384 | ) 385 | blastRadiusRiskScore: Optional[int] = Field( 386 | default=None, 387 | description='Blast Radius Risk Score', 388 | title='Blastradiusriskscore', 389 | ) 390 | overallRiskScore: Optional[int] = Field( 391 | default=None, description='Summary Risk Score', title='Overallriskscore' 392 | ) 393 | 394 | 395 | class IncidentExpansion(Enum): 396 | policy = 'policy' 397 | assignee = 'assignee' 398 | 399 | 400 | class IncidentsCreatedAtFilter(BaseModel): 401 | class Config: 402 | extra = Extra.forbid 403 | 404 | field_lte: Optional[datetime] = Field( 405 | default=None, alias='$lte', description='Less Than Or Equals To', title='$Lte' 406 | ) 407 | field_gte: Optional[datetime] = Field( 408 | default=None, 409 | alias='$gte', 410 | description='Greater Than Or Equals To', 411 | title='$Gte', 412 | ) 413 | field_lt: Optional[datetime] = Field( 414 | default=None, alias='$lt', description='Less Than', title='$Lt' 415 | ) 416 | field_gt: Optional[datetime] = Field( 417 | default=None, alias='$gt', description='Greater Than', title='$Gt' 418 | ) 419 | 420 | 421 | class IncidentsIsResolvedFilter(BaseModel): 422 | class Config: 423 | extra = Extra.forbid 424 | 425 | field_eq: Optional[bool] = Field( 426 | default=None, alias='$eq', description='Equals To', title='$Eq' 427 | ) 428 | 429 | 430 | class IncidentsPolicyIdFilter(BaseModel): 431 | class Config: 432 | extra = Extra.forbid 433 | 434 | field_eq: Optional[str] = Field( 435 | default=None, alias='$eq', description='Equals To', title='$Eq' 436 | ) 437 | 438 | 439 | class IncidentsPolicyTempalteIdFilter(BaseModel): 440 | class Config: 441 | extra = Extra.forbid 442 | 443 | field_eq: Optional[str] = Field( 444 | default=None, alias='$eq', description='Equals To', title='$Eq' 445 | ) 446 | 447 | 448 | class IncidentsStatusFilter(BaseModel): 449 | class Config: 450 | extra = Extra.forbid 451 | 452 | field_in: Optional[List[EventStatusType]] = Field( 453 | default=[], alias='$in', description='In' 454 | ) 455 | 456 | 457 | class IncidentsUpdatedAtFilter(BaseModel): 458 | class Config: 459 | extra = Extra.forbid 460 | 461 | field_lte: Optional[datetime] = Field( 462 | default=None, alias='$lte', description='Less Than Or Equals To', title='$Lte' 463 | ) 464 | field_gte: Optional[datetime] = Field( 465 | default=None, 466 | alias='$gte', 467 | description='Greater Than Or Equals To', 468 | title='$Gte', 469 | ) 470 | field_lt: Optional[datetime] = Field( 471 | default=None, alias='$lt', description='Less Than', title='$Lt' 472 | ) 473 | field_gt: Optional[datetime] = Field( 474 | default=None, alias='$gt', description='Greater Than', title='$Gt' 475 | ) 476 | 477 | 478 | class InventoryObjects(Enum): 479 | identity = 'identity' 480 | account = 'account' 481 | asset = 'asset' 482 | privilege = 'privilege' 483 | other = 'other' 484 | 485 | 486 | class IsAliveResponse(BaseModel): 487 | isAlive: bool = Field(..., description='**isAlive**', title='Isalive') 488 | 489 | 490 | class IsExternalFilter(BaseModel): 491 | class Config: 492 | extra = Extra.forbid 493 | 494 | field_eq: Optional[bool] = Field( 495 | default=None, alias='$eq', description='Equals To', title='$Eq' 496 | ) 497 | 498 | 499 | class IsMFAEnabledFilter(BaseModel): 500 | class Config: 501 | extra = Extra.forbid 502 | 503 | field_eq: Optional[bool] = Field( 504 | default=None, alias='$eq', description='Equals To', title='$Eq' 505 | ) 506 | 507 | 508 | class IsoIec27001Standard(Enum): 509 | A_6_1_2 = 'A.6.1.2' 510 | A_8_1_1 = 'A.8.1.1' 511 | A_8_1_3 = 'A.8.1.3' 512 | A_8_3_3 = 'A.8.3.3' 513 | A_9_1_1 = 'A.9.1.1' 514 | A_9_2_1 = 'A.9.2.1' 515 | A_9_2_3 = 'A.9.2.3' 516 | A_9_2_6 = 'A.9.2.6' 517 | A_9_4_1 = 'A.9.4.1' 518 | A_9_1_2 = 'A.9.1.2' 519 | A_9_4_2 = 'A.9.4.2' 520 | A_9_2_2 = 'A.9.2.2' 521 | A_13_2_1 = 'A.13.2.1' 522 | A_9_4_3 = 'A.9.4.3' 523 | A_7_2_2 = 'A.7.2.2' 524 | A_9_4_5 = 'A.9.4.5' 525 | A_8_2_3 = 'A.8.2.3' 526 | A_7_3_1 = 'A.7.3.1' 527 | A_8_1_4 = 'A.8.1.4' 528 | 529 | 530 | class LastLoginAtFilter(BaseModel): 531 | class Config: 532 | extra = Extra.forbid 533 | 534 | field_eq: Optional[DateFilterAllowedValues] = Field( 535 | default=None, alias='$eq', description='Equals To' 536 | ) 537 | 538 | 539 | class MeResponse(BaseModel): 540 | version: Optional[str] = Field( 541 | default='4.5.0', description='**version**', title='Version' 542 | ) 543 | id: str = Field(..., description='**id**', title='Id') 544 | tenant: str = Field(..., description='**tenant**', title='Tenant') 545 | 546 | 547 | class NonPaginatedResponseSchemaCommentSchema(BaseModel): 548 | class Config: 549 | extra = Extra.forbid 550 | 551 | data: Union[CommentSchema, List[CommentSchema]] = Field( 552 | ..., description='Actual Data', title='Data' 553 | ) 554 | 555 | 556 | class OkResponse(BaseModel): 557 | ok: Optional[bool] = Field(default=True, description='OK\n', title='Ok') 558 | 559 | 560 | class OriginIdFilter(BaseModel): 561 | class Config: 562 | extra = Extra.forbid 563 | 564 | field_in: Optional[List[str]] = Field( 565 | default=[], alias='$in', description='In', title='$In' 566 | ) 567 | 568 | 569 | class PaginationRequestSchema(BaseModel): 570 | class Config: 571 | extra = Extra.forbid 572 | 573 | limit: Optional[int] = Field( 574 | default=None, 575 | description='Limit the number of identities per page', 576 | title='Limit', 577 | ) 578 | nextPage: Optional[str] = Field( 579 | default=None, description='Token denoting start of next page', title='NextPage' 580 | ) 581 | 582 | 583 | class PaginationResponseSchema(BaseModel): 584 | limit: Optional[int] = Field( 585 | default=20, description='Limit the number of identities per page', title='Limit' 586 | ) 587 | hasMore: Optional[bool] = Field( 588 | default=None, 589 | description='Indicates that more data is available', 590 | title='HasMore', 591 | ) 592 | nextPage: Optional[str] = Field( 593 | default=None, description='Token denoting start of next page', title='NextPage' 594 | ) 595 | 596 | 597 | class PermissionsExpansion(Enum): 598 | reviewer_user = 'reviewer.user' 599 | 600 | 601 | class PolicySchema(BaseModel): 602 | id: str = Field(..., description='Unique id of policy.', title='Id') 603 | name: str = Field(..., description='Name of policy.', title='Name') 604 | templateId: str = Field(..., description='Template ID', title='Templateid') 605 | 606 | 607 | class ReviewStatus(Enum): 608 | pending = 'pending' 609 | completed = 'completed' 610 | reviewing = 'reviewing' 611 | notified = 'notified' 612 | inactive = 'inactive' 613 | 614 | 615 | class ReviewerExpansion(Enum): 616 | user = 'user' 617 | 618 | 619 | class RiskFactorIn(BaseModel): 620 | score: conint(ge=0, le=100) = Field( 621 | ..., 622 | description='The risk score can be an integer between 0 and 100.', 623 | title='Score', 624 | ) 625 | title: str = Field( 626 | ..., 627 | description='The title of the risk factor that should be displayed on the UI.\n', 628 | title='Title', 629 | ) 630 | description: str = Field( 631 | ..., description='Description of the risk score parameter.', title='Description' 632 | ) 633 | modifiedAt: Optional[datetime] = Field( 634 | default=None, 635 | description='Automatically set modification time. Automatically generated.\n', 636 | title='Modifiedat', 637 | ) 638 | 639 | 640 | class RiskSeverity(Enum): 641 | Critical = 'Critical' 642 | High = 'High' 643 | Medium = 'Medium' 644 | Low = 'Low' 645 | 646 | 647 | class SearchAccountsIdFilter(BaseModel): 648 | class Config: 649 | extra = Extra.forbid 650 | 651 | field_in: Optional[List[str]] = Field( 652 | default=[], alias='$in', description='In', title='$In' 653 | ) 654 | 655 | 656 | class SearchAccountsOriginIdFilter(BaseModel): 657 | class Config: 658 | extra = Extra.forbid 659 | 660 | field_in: Optional[List[str]] = Field( 661 | default=[], alias='$in', description='In', title='$In' 662 | ) 663 | 664 | 665 | class SearchAccountsSortFields(Enum): 666 | account_name = 'account.name' 667 | 668 | 669 | class SearchAssetsSortFields(Enum): 670 | asset_name = 'asset.name' 671 | 672 | 673 | class SearchGroupsAppIdFilter(BaseModel): 674 | class Config: 675 | extra = Extra.forbid 676 | 677 | field_eq: Optional[str] = Field( 678 | default=None, alias='$eq', description='Equals To', title='$Eq' 679 | ) 680 | 681 | 682 | class SearchGroupsIdFilter(BaseModel): 683 | class Config: 684 | extra = Extra.forbid 685 | 686 | field_in: Optional[List[str]] = Field( 687 | default=[], alias='$in', description='In', title='$In' 688 | ) 689 | 690 | 691 | class SearchGroupsOriginIdFilter(BaseModel): 692 | class Config: 693 | extra = Extra.forbid 694 | 695 | field_in: Optional[List[str]] = Field( 696 | default=[], alias='$in', description='In', title='$In' 697 | ) 698 | 699 | 700 | class SearchGroupsSortFields(Enum): 701 | group_name = 'group.name' 702 | 703 | 704 | class SearchGroupsUniqueIdFilter(BaseModel): 705 | class Config: 706 | extra = Extra.forbid 707 | 708 | field_in: Optional[List[str]] = Field( 709 | default=[], alias='$in', description='In', title='$In' 710 | ) 711 | 712 | 713 | class SearchIdentitiesSortFields(Enum): 714 | identity_name = 'identity.name' 715 | 716 | 717 | class SearchIncidentsSortFields(Enum): 718 | createdAt = 'createdAt' 719 | updatedAt = 'updatedAt' 720 | severity = 'severity' 721 | status = 'status' 722 | 723 | 724 | class SearchSourceAppsResponseSchema(BaseModel): 725 | authomizeId: str = Field( 726 | ..., description='Authomize ID of source application', title='Authomizeid' 727 | ) 728 | uniqueId: str = Field( 729 | ..., 730 | description='The unique ID of the asset (as provided by the connector)', 731 | title='Uniqueid', 732 | ) 733 | name: Optional[str] = Field( 734 | default=None, 735 | description='Name of the asset (for example, application, virtual machine, file, etc.)', 736 | title='Name', 737 | ) 738 | 739 | 740 | class Selection(Enum): 741 | keep = 'keep' 742 | revoke = 'revoke' 743 | change = 'change' 744 | null = 'null' 745 | 746 | 747 | class SeverityType(Enum): 748 | Low = 'Low' 749 | Medium = 'Medium' 750 | High = 'High' 751 | Critical = 'Critical' 752 | 753 | 754 | class SortOrder(Enum): 755 | ASC = 'ASC' 756 | DESC = 'DESC' 757 | 758 | 759 | class SortSchemaFieldName(BaseModel): 760 | class Config: 761 | extra = Extra.forbid 762 | 763 | fieldName: FieldName = Field( 764 | ..., description='Sort the results by field name', title='FieldName' 765 | ) 766 | order: Optional[SortOrder] = Field( 767 | default='ASC', 768 | description='Sort by ascending or descending order (ascending is the default)', 769 | title='Order', 770 | ) 771 | 772 | 773 | class SortSchemaSearchAccountsSortFields(BaseModel): 774 | class Config: 775 | extra = Extra.forbid 776 | 777 | fieldName: SearchAccountsSortFields = Field( 778 | ..., description='Sort the results by field name', title='FieldName' 779 | ) 780 | order: Optional[SortOrder] = Field( 781 | default='ASC', 782 | description='Sort by ascending or descending order (ascending is the default)', 783 | title='Order', 784 | ) 785 | 786 | 787 | class SortSchemaSearchAssetsSortFields(BaseModel): 788 | class Config: 789 | extra = Extra.forbid 790 | 791 | fieldName: SearchAssetsSortFields = Field( 792 | ..., description='Sort the results by field name', title='FieldName' 793 | ) 794 | order: Optional[SortOrder] = Field( 795 | default='ASC', 796 | description='Sort by ascending or descending order (ascending is the default)', 797 | title='Order', 798 | ) 799 | 800 | 801 | class SortSchemaSearchGroupsSortFields(BaseModel): 802 | class Config: 803 | extra = Extra.forbid 804 | 805 | fieldName: SearchGroupsSortFields = Field( 806 | ..., description='Sort the results by field name', title='FieldName' 807 | ) 808 | order: Optional[SortOrder] = Field( 809 | default='ASC', 810 | description='Sort by ascending or descending order (ascending is the default)', 811 | title='Order', 812 | ) 813 | 814 | 815 | class SortSchemaSearchIdentitiesSortFields(BaseModel): 816 | class Config: 817 | extra = Extra.forbid 818 | 819 | fieldName: SearchIdentitiesSortFields = Field( 820 | ..., description='Sort the results by field name', title='FieldName' 821 | ) 822 | order: Optional[SortOrder] = Field( 823 | default='ASC', 824 | description='Sort by ascending or descending order (ascending is the default)', 825 | title='Order', 826 | ) 827 | 828 | 829 | class SortSchemaSearchIncidentsSortFields(BaseModel): 830 | class Config: 831 | extra = Extra.forbid 832 | 833 | fieldName: SearchIncidentsSortFields = Field( 834 | ..., description='Sort the results by field name', title='FieldName' 835 | ) 836 | order: Optional[SortOrder] = Field( 837 | default='ASC', 838 | description='Sort by ascending or descending order (ascending is the default)', 839 | title='Order', 840 | ) 841 | 842 | 843 | class SourceAppSchema(BaseModel): 844 | id: str = Field(..., description='Authomize ID of source application', title='Id') 845 | name: str = Field( 846 | ..., 847 | description='Name of the asset (for example, application, virtual machine, file, etc.)', 848 | title='Name', 849 | ) 850 | 851 | 852 | class TagSchema(BaseModel): 853 | id: str = Field(..., description='Authomize ID for the Tag', title='Id') 854 | name: str = Field(..., description='Name of the tag', title='Name') 855 | description: Optional[str] = Field( 856 | default=None, description='Description of the tag', title='Description' 857 | ) 858 | 859 | 860 | class TakeoverRiskFilter(BaseModel): 861 | class Config: 862 | extra = Extra.forbid 863 | 864 | field_in: Optional[List[str]] = Field( 865 | default=[], alias='$in', description='In', title='$In' 866 | ) 867 | 868 | 869 | class TerminatedAtFilter(BaseModel): 870 | class Config: 871 | extra = Extra.forbid 872 | 873 | field_eq: Optional[DateFilterAllowedValues] = Field( 874 | default=None, alias='$eq', description='Equals To' 875 | ) 876 | 877 | 878 | class UniqueIdFilter(BaseModel): 879 | class Config: 880 | extra = Extra.forbid 881 | 882 | field_in: Optional[List[str]] = Field( 883 | default=[], alias='$in', description='In', title='$In' 884 | ) 885 | 886 | 887 | class UpdateIncidentRequestSchema(BaseModel): 888 | class Config: 889 | extra = Extra.forbid 890 | 891 | assigneeId: Optional[str] = Field( 892 | default=None, 893 | description='ID of the entity assigned to this incident.', 894 | title='Assigneeid', 895 | ) 896 | status: Optional[EventStatusType] = Field( 897 | default=None, 898 | description='The status of the incident (Open, InProgress, WaitingForInput, or Closed).', 899 | ) 900 | severity: Optional[SeverityType] = Field( 901 | default=None, 902 | description='The severity of the incident (Low, Medium, High or Critical).', 903 | ) 904 | 905 | 906 | class UserSchema(BaseModel): 907 | id: str = Field(..., description='Unique ID', title='Id') 908 | name: Optional[str] = Field(default=None, description='Name', title='Name') 909 | firstName: Optional[str] = Field( 910 | default=None, description='First Name', title='Firstname' 911 | ) 912 | lastName: Optional[str] = Field( 913 | default=None, description='Last Name', title='Lastname' 914 | ) 915 | email: Optional[str] = Field(default=None, description='Email', title='Email') 916 | 917 | 918 | class UserStatus(Enum): 919 | Deleted = 'Deleted' 920 | Disabled = 'Disabled' 921 | Enabled = 'Enabled' 922 | Staged = 'Staged' 923 | Suspended = 'Suspended' 924 | Unknown = 'Unknown' 925 | 926 | 927 | class ValidationError(BaseModel): 928 | loc: List[str] = Field(..., title='Location') 929 | msg: str = Field(..., title='Message') 930 | type: str = Field(..., title='Error Type') 931 | 932 | 933 | class AicpaTsc2017(BaseModel): 934 | values: List[AicpaTsc2017Standard] = Field(..., description='Values') 935 | id: Optional[str] = Field( 936 | default='aicpaTsc2017', description='UniqueID', title='Id' 937 | ) 938 | name: Optional[str] = Field( 939 | default='SOC 2 (TSC 2017)', description='Name', title='Name' 940 | ) 941 | 942 | 943 | class AssetSchema(BaseModel): 944 | authomizeId: str = Field( 945 | ..., description='Authomize ID of source application', title='Authomizeid' 946 | ) 947 | name: Optional[str] = Field( 948 | default=None, 949 | description='Name of the asset (for example, application, virtual machine, file, etc.)', 950 | title='Name', 951 | ) 952 | type: Optional[str] = Field(default=None, description='Type of asset', title='Type') 953 | originType: Optional[str] = Field( 954 | default=None, 955 | description='The type of asset on the source system', 956 | title='Origintype', 957 | ) 958 | sourceApp: Optional[SourceAppSchema] = Field( 959 | default=None, 960 | description='The source application of the asset', 961 | title='Sourceapp', 962 | ) 963 | createdAt: Optional[datetime] = Field( 964 | default=None, 965 | description='The date (in ISO 8601 format) that the asset was created\n', 966 | title='Createdat', 967 | ) 968 | lastUsedAt: Optional[str] = Field( 969 | default=None, 970 | description='The date (in ISO 8601 format) of the last time that the asset was in use.', 971 | title='Lastusedat', 972 | ) 973 | href: Optional[str] = Field( 974 | default=None, 975 | description='A link to the asset in the source application', 976 | title='Href', 977 | ) 978 | uniqueId: Optional[str] = Field( 979 | default=None, 980 | description='The unique ID of the asset (as provided by the connector)', 981 | title='Uniqueid', 982 | ) 983 | originId: Optional[str] = Field( 984 | default=None, 985 | description='The ID of the asset on the source system', 986 | title='Originid', 987 | ) 988 | description: Optional[str] = Field( 989 | default=None, description='A description of the asset', title='Description' 990 | ) 991 | tags: Optional[List[TagSchema]] = Field( 992 | default=[], description='List of tags associated with the asset', title='Tags' 993 | ) 994 | incidentsCount: Optional[int] = Field( 995 | default=None, 996 | description='Number of associated incidents', 997 | title='Incidentscount', 998 | ) 999 | 1000 | 1001 | class BlastRadiusRiskFilter(BaseModel): 1002 | class Config: 1003 | extra = Extra.forbid 1004 | 1005 | field_in: Optional[List[RiskSeverity]] = Field( 1006 | default=[], alias='$in', description='In' 1007 | ) 1008 | 1009 | 1010 | class CampaignPermissionDecisionFilter(BaseModel): 1011 | class Config: 1012 | extra = Extra.forbid 1013 | 1014 | field_in: Optional[List[Selection]] = Field( 1015 | default=[], alias='$in', description='In' 1016 | ) 1017 | 1018 | 1019 | class CampaignPermissionsSearchFilterBody(BaseModel): 1020 | class Config: 1021 | extra = Extra.forbid 1022 | 1023 | decision: Optional[CampaignPermissionDecisionFilter] = Field( 1024 | default=None, 1025 | description='Reviewer decisions (keep, revoke, change or null).\n', 1026 | title='Decision', 1027 | ) 1028 | 1029 | 1030 | class CampaignSchema(BaseModel): 1031 | id: str = Field(..., description='Unique ID of campaign', title='Id') 1032 | name: str = Field(..., description='Name of the campaign', title='Name') 1033 | status: CampaignStatus = Field(..., description='The campaign status') 1034 | startDate: datetime = Field( 1035 | ..., description='Date when the campaign starts', title='Startdate' 1036 | ) 1037 | endDate: datetime = Field( 1038 | ..., description='Date when campaign ends', title='Enddate' 1039 | ) 1040 | createdAt: datetime = Field( 1041 | ..., description='Time of creation of campaign', title='Createdat' 1042 | ) 1043 | ownerUserId: str = Field( 1044 | ..., description='User ID of the campaign owner', title='Owneruserid' 1045 | ) 1046 | owner: Optional[UserSchema] = Field( 1047 | default=None, description='User Schema of the campaign owner', title='Owner' 1048 | ) 1049 | 1050 | 1051 | class CampaignSearchFilterBody(BaseModel): 1052 | class Config: 1053 | extra = Extra.forbid 1054 | 1055 | status: Optional[CampaignStatusFilter] = Field( 1056 | default=None, 1057 | description='Enum: "draft" "initializing" "running" "completed" "failed" "empty" "overdue"\n', 1058 | title='Status', 1059 | ) 1060 | 1061 | 1062 | class CampaignsPermissionAccountSchema(BaseModel): 1063 | id: str = Field(..., description='Account ID.', title='Id') 1064 | name: Optional[str] = Field( 1065 | default=None, description='Name of the account.', title='Name' 1066 | ) 1067 | uniqueId: Optional[str] = Field( 1068 | default=None, description='Account ID (unique).', title='Uniqueid' 1069 | ) 1070 | isExternal: Optional[bool] = Field( 1071 | default=None, 1072 | description='Whether the account is external or not.', 1073 | title='Isexternal', 1074 | ) 1075 | type: Optional[str] = Field(default=None, description='Account type.', title='Type') 1076 | email: Optional[str] = Field( 1077 | default=None, description='Email of the account.', title='Email' 1078 | ) 1079 | status: Optional[str] = Field( 1080 | default=None, description='Account status.', title='Status' 1081 | ) 1082 | distinctIdentity: Optional[CampaignsPermissionDistinctIdentitySchema] = Field( 1083 | default=None, 1084 | description='Distinct identity of the account.', 1085 | title='Distinctidentity', 1086 | ) 1087 | sourceApp: Optional[CampaignsPermissionSourceAppSchema] = Field( 1088 | default=None, description='Source app of the account.', title='Sourceapp' 1089 | ) 1090 | tags: Optional[List[CampaignsPermissionTagSchema]] = Field( 1091 | default=[], description='Account tags.', title='Tags' 1092 | ) 1093 | 1094 | 1095 | class CampaignsPermissionAssetSchema(BaseModel): 1096 | id: str = Field(..., description='Asset ID.', title='Id') 1097 | type: Optional[str] = Field(default=None, description='Asset type.', title='Type') 1098 | externalType: Optional[str] = Field( 1099 | default=None, description='External type of the asset.', title='Externaltype' 1100 | ) 1101 | name: Optional[str] = Field( 1102 | default=None, description='Name of the asset.', title='Name' 1103 | ) 1104 | sourceApp: Optional[CampaignsPermissionSourceAppSchema] = Field( 1105 | default=None, description='Source app of the asset.', title='Sourceapp' 1106 | ) 1107 | tags: Optional[List[CampaignsPermissionTagSchema]] = Field( 1108 | default=[], description='Asset tags.', title='Tags' 1109 | ) 1110 | 1111 | 1112 | class CampaignsPermissionGroupSchema(BaseModel): 1113 | id: str = Field(..., description='Group ID.', title='Id') 1114 | name: Optional[str] = Field(default=None, description='Group name.', title='Name') 1115 | sourceApp: Optional[CampaignsPermissionSourceAppSchema] = Field( 1116 | default=None, description='Source app of the group.', title='Sourceapp' 1117 | ) 1118 | tags: Optional[List[CampaignsPermissionTagSchema]] = Field( 1119 | default=[], description='Group tags.', title='Tags' 1120 | ) 1121 | 1122 | 1123 | class CampaignsPermissionPrivilegeSchema(BaseModel): 1124 | id: str = Field(..., description='Privilege Id.', title='Id') 1125 | originType: Optional[str] = Field( 1126 | default=None, description='Origin type of the privilege.', title='Origintype' 1127 | ) 1128 | type: Optional[str] = Field( 1129 | default=None, description='Privilege type.', title='Type' 1130 | ) 1131 | sourceApp: Optional[CampaignsPermissionSourceAppSchema] = Field( 1132 | default=None, description='Source app of the privilege.', title='Sourceapp' 1133 | ) 1134 | tags: Optional[List[CampaignsPermissionTagSchema]] = Field( 1135 | default=[], description='Privilege tags.', title='Tags' 1136 | ) 1137 | 1138 | 1139 | class Ccm301(BaseModel): 1140 | values: List[Ccm301Standard] = Field(..., description='Values') 1141 | id: Optional[str] = Field(default='ccm301', description='UniqueID', title='Id') 1142 | name: Optional[str] = Field( 1143 | default='CSA STAR (CCM 3.0.1)', description='Name', title='Name' 1144 | ) 1145 | 1146 | 1147 | class Ccm402(BaseModel): 1148 | values: List[Ccm402Standard] = Field(..., description='Values') 1149 | id: Optional[str] = Field(default='ccm402', description='UniqueID', title='Id') 1150 | name: Optional[str] = Field( 1151 | default='CSA STAR (CCM 4.0.2)', description='Name', title='Name' 1152 | ) 1153 | 1154 | 1155 | class GroupSchema(BaseModel): 1156 | authomizeId: str = Field( 1157 | ..., description='Authomize ID of the Group.', title='Authomizeid' 1158 | ) 1159 | name: Optional[str] = Field( 1160 | default=None, description='Name of the Group.', title='Name' 1161 | ) 1162 | type: Optional[str] = Field( 1163 | default=None, description='Type of the group.', title='Type' 1164 | ) 1165 | incidentsCount: Optional[int] = Field( 1166 | default=None, 1167 | description='Number of incidents associated with the group.', 1168 | title='Incidentscount', 1169 | ) 1170 | tags: Optional[List[TagSchema]] = Field( 1171 | default=[], description='List of tags associated with the group', title='Tags' 1172 | ) 1173 | members: Optional[List[GroupMembership]] = Field( 1174 | default=[], 1175 | description='Entities that have direct access to the group.', 1176 | title='Members', 1177 | ) 1178 | sourceApp: Optional[SourceAppSchema] = Field( 1179 | default=None, description='Authomize ID of the Group.', title='Sourceapp' 1180 | ) 1181 | ownerId: Optional[str] = Field( 1182 | default=None, description='Authomize ID of the Group Owner.', title='Ownerid' 1183 | ) 1184 | originId: Optional[str] = Field( 1185 | default=None, 1186 | description='The ID of the group on the source system', 1187 | title='Originid', 1188 | ) 1189 | uniqueId: Optional[str] = Field( 1190 | default=None, 1191 | description='The unique ID of the group (as provided by the connector)', 1192 | title='Uniqueid', 1193 | ) 1194 | createdAt: Optional[str] = Field( 1195 | default=None, description='Date when group was created.', title='Createdat' 1196 | ) 1197 | originType: Optional[str] = Field( 1198 | default=None, 1199 | description='Type of the group in source system.', 1200 | title='Origintype', 1201 | ) 1202 | 1203 | 1204 | class HTTPValidationError(BaseModel): 1205 | detail: Optional[List[ValidationError]] = Field(default=None, title='Detail') 1206 | 1207 | 1208 | class IdentitiesBlastRadiusRiskFilter(BaseModel): 1209 | class Config: 1210 | extra = Extra.forbid 1211 | 1212 | field_in: Optional[List[RiskSeverity]] = Field( 1213 | default=[], alias='$in', description='In' 1214 | ) 1215 | 1216 | 1217 | class IdentitiesOverallRisk(BaseModel): 1218 | class Config: 1219 | extra = Extra.forbid 1220 | 1221 | field_in: Optional[List[RiskSeverity]] = Field( 1222 | default=[], alias='$in', description='In' 1223 | ) 1224 | 1225 | 1226 | class IdentitiesTakeoverRiskFilter(BaseModel): 1227 | class Config: 1228 | extra = Extra.forbid 1229 | 1230 | field_in: Optional[List[RiskSeverity]] = Field( 1231 | default=[], alias='$in', description='In' 1232 | ) 1233 | 1234 | 1235 | class IncidentEntitiesSchema(BaseModel): 1236 | id: str = Field(..., description='Unique id of entity.', title='Id') 1237 | name: Optional[str] = Field( 1238 | default=None, description='Name of entity.', title='Name' 1239 | ) 1240 | object: Union[InventoryObjects, str] = Field( 1241 | ..., description='Identity | Account | Asset', title='Object' 1242 | ) 1243 | email: Optional[str] = Field(default=None, description='Email', title='Email') 1244 | originId: Optional[str] = Field( 1245 | default=None, description='Origin ID', title='Originid' 1246 | ) 1247 | originType: Optional[str] = Field( 1248 | default=None, description='Origin Type', title='Origintype' 1249 | ) 1250 | riskScore: Optional[IdentityRiskScore] = Field( 1251 | default=None, description='Risk Scores', title='Riskscore' 1252 | ) 1253 | sourceApp: Optional[SourceAppSchema] = Field( 1254 | default=None, description='Applications', title='Sourceapp' 1255 | ) 1256 | 1257 | 1258 | class IncidentsSeverityFilter(BaseModel): 1259 | class Config: 1260 | extra = Extra.forbid 1261 | 1262 | field_in: Optional[List[SeverityType]] = Field( 1263 | default=[], alias='$in', description='In' 1264 | ) 1265 | 1266 | 1267 | class IsoIec27001(BaseModel): 1268 | values: List[IsoIec27001Standard] = Field(..., description='Values') 1269 | id: Optional[str] = Field(default='isoIec27001', description='UniqueID', title='Id') 1270 | name: Optional[str] = Field( 1271 | default='ISO/IEC 27001', description='Name', title='Name' 1272 | ) 1273 | 1274 | 1275 | class NonPaginatedResponseSchemaCampaignSchema(BaseModel): 1276 | class Config: 1277 | extra = Extra.forbid 1278 | 1279 | data: Union[CampaignSchema, List[CampaignSchema]] = Field( 1280 | ..., description='Actual Data', title='Data' 1281 | ) 1282 | 1283 | 1284 | class NonPaginatedResponseSchemaSearchSourceAppsResponseSchema(BaseModel): 1285 | class Config: 1286 | extra = Extra.forbid 1287 | 1288 | data: Union[ 1289 | SearchSourceAppsResponseSchema, List[SearchSourceAppsResponseSchema] 1290 | ] = Field(..., description='Actual Data', title='Data') 1291 | 1292 | 1293 | class PaginatedResponseSchemaAssetSchema(BaseModel): 1294 | class Config: 1295 | extra = Extra.forbid 1296 | 1297 | pagination: Optional[PaginationResponseSchema] = Field( 1298 | default=None, description='Pagination Metadata', title='Pagination' 1299 | ) 1300 | data: List[AssetSchema] = Field( 1301 | ..., description='List of Actual Data', title='Data' 1302 | ) 1303 | 1304 | 1305 | class PaginatedResponseSchemaCampaignSchema(BaseModel): 1306 | class Config: 1307 | extra = Extra.forbid 1308 | 1309 | pagination: Optional[PaginationResponseSchema] = Field( 1310 | default=None, description='Pagination Metadata', title='Pagination' 1311 | ) 1312 | data: List[CampaignSchema] = Field( 1313 | ..., description='List of Actual Data', title='Data' 1314 | ) 1315 | 1316 | 1317 | class PaginatedResponseSchemaGroupSchema(BaseModel): 1318 | class Config: 1319 | extra = Extra.forbid 1320 | 1321 | pagination: Optional[PaginationResponseSchema] = Field( 1322 | default=None, description='Pagination Metadata', title='Pagination' 1323 | ) 1324 | data: List[GroupSchema] = Field( 1325 | ..., description='List of Actual Data', title='Data' 1326 | ) 1327 | 1328 | 1329 | class RawIdentitySchema(BaseModel): 1330 | authomizeId: str = Field(..., description='Unique ID', title='Authomizeid') 1331 | name: Optional[str] = Field( 1332 | default=None, description='Name of the identity', title='Name' 1333 | ) 1334 | title: Optional[str] = Field( 1335 | default=None, description='Title of the identity', title='Title' 1336 | ) 1337 | department: Optional[str] = Field( 1338 | default=None, 1339 | description='The department in which the identity works', 1340 | title='Department', 1341 | ) 1342 | accountIds: Optional[List[str]] = Field( 1343 | default=[], 1344 | description='The account IDs associated with the identity', 1345 | title='Accountids', 1346 | ) 1347 | email: Optional[str] = Field( 1348 | default=None, description='The email of the identity', title='Email' 1349 | ) 1350 | tags: Optional[List[TagSchema]] = Field( 1351 | default=[], description='The tags provided for the identity', title='Tags' 1352 | ) 1353 | terminatedAt: Optional[str] = Field( 1354 | default=None, description='Time of termination', title='Terminatedat' 1355 | ) 1356 | hiredAt: Optional[str] = Field( 1357 | default=None, description='Hired At', title='Hiredat' 1358 | ) 1359 | incidentsCount: Optional[int] = Field( 1360 | default=None, 1361 | description='Number of associated incidents', 1362 | title='Incidentscount', 1363 | ) 1364 | 1365 | 1366 | class ReviewerSchema(BaseModel): 1367 | id: str = Field(..., description='Unique ID', title='Id') 1368 | reviewStatus: Union[ReviewStatus, str] = Field( 1369 | ..., description='Review Status', title='Reviewstatus' 1370 | ) 1371 | user: Optional[UserSchema] = Field( 1372 | default=None, description='User Schema of the reviewer', title='User' 1373 | ) 1374 | 1375 | 1376 | class SearchAccountsFilterBody(BaseModel): 1377 | class Config: 1378 | extra = Extra.forbid 1379 | 1380 | originId: Optional[SearchAccountsOriginIdFilter] = Field( 1381 | default=None, 1382 | description='Find accounts by their ID in the source system', 1383 | title='Originid', 1384 | ) 1385 | authomizeId: Optional[SearchAccountsIdFilter] = Field( 1386 | default=None, 1387 | description='Find accounts by their Authomize ID', 1388 | title='Authomizeid', 1389 | ) 1390 | blastRadiusRisk: Optional[BlastRadiusRiskFilter] = Field( 1391 | default=None, 1392 | description='The blast radius present the impact of an account to be taken over, based on the access and type of access the account have.', 1393 | title='Blastradiusrisk', 1394 | ) 1395 | isExternal: Optional[IsExternalFilter] = Field( 1396 | default=None, 1397 | description='Is the account external or internal.', 1398 | title='Isexternal', 1399 | ) 1400 | isMfaEnabled: Optional[IsMFAEnabledFilter] = Field( 1401 | default=None, description='Is MFA enabled or disabled.', title='Ismfaenabled' 1402 | ) 1403 | lastLoginAt: Optional[LastLoginAtFilter] = Field( 1404 | default=None, 1405 | description='Date of the last login in a specific application.', 1406 | title='Lastloginat', 1407 | ) 1408 | sourceAppId: Optional[AccountSourceAppIdFilter] = Field( 1409 | default=None, 1410 | description='The ID of the source application.', 1411 | title='Sourceappid', 1412 | ) 1413 | takeoverRisk: Optional[TakeoverRiskFilter] = Field( 1414 | default=None, 1415 | description='The account takeover risk presents the probability that an account will be taken over by an external identity.', 1416 | title='Takeoverrisk', 1417 | ) 1418 | 1419 | 1420 | class SearchAccountsRequestSchema(BaseModel): 1421 | class Config: 1422 | extra = Extra.forbid 1423 | 1424 | pagination: Optional[PaginationRequestSchema] = Field( 1425 | default=None, description='Pagination metadata', title='Pagination' 1426 | ) 1427 | expand: Optional[List[AccountExpansion]] = Field( 1428 | default=None, description='Expand Fields' 1429 | ) 1430 | sort: Optional[List[SortSchemaSearchAccountsSortFields]] = Field( 1431 | default=None, 1432 | description='Sort the results by account fields in ascending or descending order', 1433 | title='Sort', 1434 | ) 1435 | filter: Optional[SearchAccountsFilterBody] = Field( 1436 | default=None, description='Search Accounts Filter', title='Filter' 1437 | ) 1438 | 1439 | 1440 | class SearchAssetsFilterBody(BaseModel): 1441 | class Config: 1442 | extra = Extra.forbid 1443 | 1444 | originId: Optional[OriginIdFilter] = Field( 1445 | default=None, 1446 | description='Find assets by their ID in the source system', 1447 | title='Originid', 1448 | ) 1449 | appId: Optional[AppIdFilter] = Field( 1450 | default=None, description='Find assets by their app ID', title='Appid' 1451 | ) 1452 | uniqueId: Optional[UniqueIdFilter] = Field( 1453 | default=None, description='Find assets by their unique ID', title='Uniqueid' 1454 | ) 1455 | authomizeId: Optional[AssetIdFilter] = Field( 1456 | default=None, 1457 | description='Find assets by their Authomize ID', 1458 | title='Authomizeid', 1459 | ) 1460 | 1461 | 1462 | class SearchAssetsRequestSchema(BaseModel): 1463 | class Config: 1464 | extra = Extra.forbid 1465 | 1466 | sort: Optional[List[SortSchemaSearchAssetsSortFields]] = Field( 1467 | default=None, 1468 | description="Sort the results by asset's name in ascending or descending order", 1469 | title='Sort', 1470 | ) 1471 | pagination: Optional[PaginationRequestSchema] = Field( 1472 | default=None, description='Pagination metadata', title='Pagination' 1473 | ) 1474 | expand: Optional[List[AssetExpansion]] = Field( 1475 | default=None, description='Expand fields (to show additional information)' 1476 | ) 1477 | filter: Optional[SearchAssetsFilterBody] = Field( 1478 | default=None, description='Search Assets Filter', title='Filter' 1479 | ) 1480 | 1481 | 1482 | class SearchCampaignPermissionsRequestSchema(BaseModel): 1483 | class Config: 1484 | extra = Extra.forbid 1485 | 1486 | pagination: Optional[PaginationRequestSchema] = Field( 1487 | default=None, description='Pagination metadata', title='Pagination' 1488 | ) 1489 | filter: Optional[CampaignPermissionsSearchFilterBody] = Field( 1490 | default=None, description='Filter by the reviewer decisions. \n', title='Filter' 1491 | ) 1492 | expand: Optional[List[PermissionsExpansion]] = Field( 1493 | default=None, description='Fields to expand.\n' 1494 | ) 1495 | 1496 | 1497 | class SearchCampaignsRequestSchema(BaseModel): 1498 | class Config: 1499 | extra = Extra.forbid 1500 | 1501 | filter: Optional[CampaignSearchFilterBody] = Field( 1502 | default=None, description='Status filter', title='Filter' 1503 | ) 1504 | expand: Optional[List[CampaignExpansion]] = Field( 1505 | default=None, description='Expand Fields' 1506 | ) 1507 | pagination: Optional[PaginationRequestSchema] = Field( 1508 | default=None, description='Pagination metadata', title='Pagination' 1509 | ) 1510 | sort: Optional[List[SortSchemaFieldName]] = Field( 1511 | default=None, 1512 | description='Sort the results by campaign fields in ascending or descending order', 1513 | title='Sort', 1514 | ) 1515 | 1516 | 1517 | class SearchGroupsFilterBody(BaseModel): 1518 | class Config: 1519 | extra = Extra.forbid 1520 | 1521 | uniqueId: Optional[SearchGroupsUniqueIdFilter] = Field( 1522 | default=None, description='Find groups by their unique ID', title='Uniqueid' 1523 | ) 1524 | originId: Optional[SearchGroupsOriginIdFilter] = Field( 1525 | default=None, 1526 | description='Find groups by their ID in the source system', 1527 | title='Originid', 1528 | ) 1529 | appId: Optional[SearchGroupsAppIdFilter] = Field( 1530 | default=None, description='Find groups by their app ID', title='Appid' 1531 | ) 1532 | authomizeId: Optional[SearchGroupsIdFilter] = Field( 1533 | default=None, 1534 | description='Find groups by their Authomize ID', 1535 | title='Authomizeid', 1536 | ) 1537 | 1538 | 1539 | class SearchGroupsRequestSchema(BaseModel): 1540 | class Config: 1541 | extra = Extra.forbid 1542 | 1543 | sort: Optional[List[SortSchemaSearchGroupsSortFields]] = Field( 1544 | default=None, 1545 | description="Sort the results by group's name in ascending or descending order", 1546 | title='Sort', 1547 | ) 1548 | pagination: Optional[PaginationRequestSchema] = Field( 1549 | default=None, description='Pagination metadata', title='Pagination' 1550 | ) 1551 | expand: Optional[List[GroupExpansion]] = Field( 1552 | default=None, description='Expand fields (to show additional information)' 1553 | ) 1554 | filter: Optional[SearchGroupsFilterBody] = Field( 1555 | default=None, description='Search Groups Filter', title='Filter' 1556 | ) 1557 | 1558 | 1559 | class SearchIdentitiesFilterBody(BaseModel): 1560 | class Config: 1561 | extra = Extra.forbid 1562 | 1563 | email: Optional[EmailFilter] = Field( 1564 | default=None, 1565 | description='Find identities by their email address', 1566 | title='Email', 1567 | ) 1568 | authomizeId: Optional[IdFilter] = Field( 1569 | default=None, 1570 | description='Find identities by their Authomize ID', 1571 | title='Authomizeid', 1572 | ) 1573 | blastRadiusRisk: Optional[IdentitiesBlastRadiusRiskFilter] = Field( 1574 | default=None, 1575 | description='The blast radius present the impact of the identity to be taken over, based on the access and type of access the account have.', 1576 | title='Blastradiusrisk', 1577 | ) 1578 | takeoverRisk: Optional[IdentitiesTakeoverRiskFilter] = Field( 1579 | default=None, 1580 | description='The account takeover risk presents the probability that the identity to be taken over by an external identity.', 1581 | title='Takeoverrisk', 1582 | ) 1583 | overallRisk: Optional[IdentitiesOverallRisk] = Field( 1584 | default=None, 1585 | description='The overall risk score of the identity, based on the blast radius and account take over risk.', 1586 | title='Overallrisk', 1587 | ) 1588 | hiredAt: Optional[HiredAtFilter] = Field( 1589 | default=None, description='Date of hired.', title='Hiredat' 1590 | ) 1591 | terminatedAt: Optional[TerminatedAtFilter] = Field( 1592 | default=None, description='Date of termination.', title='Terminatedat' 1593 | ) 1594 | 1595 | 1596 | class SearchIdentitiesRequestSchema(BaseModel): 1597 | class Config: 1598 | extra = Extra.forbid 1599 | 1600 | sort: Optional[List[SortSchemaSearchIdentitiesSortFields]] = Field( 1601 | default=None, 1602 | description='Sort the results by identity name in ascending or descending order', 1603 | title='Sort', 1604 | ) 1605 | pagination: Optional[PaginationRequestSchema] = Field( 1606 | default=None, description='Pagination metadata', title='Pagination' 1607 | ) 1608 | expand: Optional[List[IdentityExpansion]] = Field( 1609 | default=None, 1610 | description='Expand the account or tag fields to get additional data on related accounts or related tags', 1611 | ) 1612 | filter: Optional[SearchIdentitiesFilterBody] = Field( 1613 | default=None, description='Search filter options', title='Filter' 1614 | ) 1615 | 1616 | 1617 | class SearchIncidentsFilter(BaseModel): 1618 | class Config: 1619 | extra = Extra.forbid 1620 | 1621 | createdAt: Optional[IncidentsCreatedAtFilter] = Field( 1622 | default=None, description='Created At date', title='Createdat' 1623 | ) 1624 | updatedAt: Optional[IncidentsUpdatedAtFilter] = Field( 1625 | default=None, description='Updated At date', title='Updatedat' 1626 | ) 1627 | severity: Optional[IncidentsSeverityFilter] = Field( 1628 | default=None, description='Severity', title='Severity' 1629 | ) 1630 | status: Optional[IncidentsStatusFilter] = Field( 1631 | default=None, description='Status', title='Status' 1632 | ) 1633 | policyId: Optional[IncidentsPolicyIdFilter] = Field( 1634 | default=None, description='Policy Id ', title='Policyid' 1635 | ) 1636 | policyTemplateId: Optional[IncidentsPolicyTempalteIdFilter] = Field( 1637 | default=None, description='Policy Template ID', title='Policytemplateid' 1638 | ) 1639 | isResolved: Optional[IncidentsIsResolvedFilter] = Field( 1640 | default=None, description='Is resolved?', title='Isresolved' 1641 | ) 1642 | 1643 | 1644 | class SearchIncidentsRequestSchema(BaseModel): 1645 | class Config: 1646 | extra = Extra.forbid 1647 | 1648 | filter: Optional[SearchIncidentsFilter] = Field( 1649 | default=None, description='Filter', title='Filter' 1650 | ) 1651 | expand: Optional[List[IncidentExpansion]] = Field( 1652 | default=None, description='Expend' 1653 | ) 1654 | sort: Optional[List[SortSchemaSearchIncidentsSortFields]] = Field( 1655 | default=None, 1656 | description='Sort the results by incident fields in ascending or descending order', 1657 | title='Sort', 1658 | ) 1659 | pagination: Optional[PaginationRequestSchema] = Field( 1660 | default=None, description='Pagination metadata', title='Pagination' 1661 | ) 1662 | 1663 | 1664 | class AccountSchema(BaseModel): 1665 | authomizeId: str = Field( 1666 | ..., description='Authomize ID of the account', title='Authomizeid' 1667 | ) 1668 | originId: Optional[str] = Field( 1669 | default=None, 1670 | description='The identifier of the account from the source system.', 1671 | title='Originid', 1672 | ) 1673 | uniqueId: Optional[str] = Field( 1674 | default=None, 1675 | description='Unique ID is an identifier coming from the connector that is unique across all accounts coming from that connector', 1676 | title='Uniqueid', 1677 | ) 1678 | name: Optional[str] = Field( 1679 | default=None, description='Name of account', title='Name' 1680 | ) 1681 | type: str = Field(..., description='Type of account', title='Type') 1682 | isExternal: bool = Field( 1683 | ..., description='Is account external (Yes or No)', title='Isexternal' 1684 | ) 1685 | email: Optional[str] = Field( 1686 | default=None, description='Email address of account', title='Email' 1687 | ) 1688 | identity: Optional[RawIdentitySchema] = Field( 1689 | default=None, description='Associated Identity', title='Identity' 1690 | ) 1691 | sourceApp: Optional[SourceAppSchema] = Field( 1692 | default=None, description='Associated source app ', title='Sourceapp' 1693 | ) 1694 | firstName: Optional[str] = Field( 1695 | default=None, description='First name of account', title='Firstname' 1696 | ) 1697 | lastName: Optional[str] = Field( 1698 | default=None, description='Last name of account', title='Lastname' 1699 | ) 1700 | isAdmin: Optional[bool] = Field( 1701 | default=None, 1702 | description='Is the account an admin account (Yes or No)', 1703 | title='Isadmin', 1704 | ) 1705 | status: Optional[UserStatus] = Field(default=None, description='The account status') 1706 | description: Optional[str] = Field( 1707 | default=None, description='The account description', title='Description' 1708 | ) 1709 | hasMfa: Optional[bool] = Field( 1710 | default=None, 1711 | description='Does the account have MFA enabled (Yes or No)', 1712 | title='Hasmfa', 1713 | ) 1714 | lastLoginAt: Optional[str] = Field( 1715 | default=None, description='Account Last Logged date', title='Lastloginat' 1716 | ) 1717 | tags: Optional[List[TagSchema]] = Field( 1718 | default=[], description='Tags associated with the account.', title='Tags' 1719 | ) 1720 | riskScore: Optional[AccountRiskScore] = Field( 1721 | default=None, description='Risk Scores for the Account.', title='Riskscore' 1722 | ) 1723 | 1724 | 1725 | class AddIdentityRisksRequestSchema(BaseModel): 1726 | class Config: 1727 | extra = Extra.forbid 1728 | 1729 | filter: Optional[SearchIdentitiesFilterBody] = Field( 1730 | default=None, description='Search filter options', title='Filter' 1731 | ) 1732 | risks: List[RiskFactorIn] = Field( 1733 | ..., description='List of risks to add to the identity', title='Risks' 1734 | ) 1735 | 1736 | 1737 | class CampaignsPermissionSchema(BaseModel): 1738 | campaignId: str = Field(..., description='Campaign ID.\n', title='Campaignid') 1739 | campaignName: str = Field(..., description='Campaign name.\n', title='Campaignname') 1740 | reviewer: Optional[ReviewerSchema] = Field( 1741 | default=None, description='Details of the reviewer.\n', title='Reviewer' 1742 | ) 1743 | selection: Optional[EntitlementSelections] = Field( 1744 | default=None, description='Reviewer decisions (keep, revoke, change or null).\n' 1745 | ) 1746 | reason: Optional[str] = Field( 1747 | default=None, 1748 | description='Reviewer decision for keeping or revoking or requesting permission change for the reviewed access. \n', 1749 | title='Reason', 1750 | ) 1751 | account: Optional[CampaignsPermissionAccountSchema] = Field( 1752 | default=None, 1753 | description='Account that their access was reviewed. \n', 1754 | title='Account', 1755 | ) 1756 | asset: Optional[CampaignsPermissionAssetSchema] = Field( 1757 | default=None, 1758 | description='Asset that the access to was reviewed.', 1759 | title='Asset', 1760 | ) 1761 | group: Optional[CampaignsPermissionGroupSchema] = Field( 1762 | default=None, 1763 | description='Group that the access to was reviewed.', 1764 | title='Group', 1765 | ) 1766 | privilege: Optional[CampaignsPermissionPrivilegeSchema] = Field( 1767 | default=None, description='Privilege that was reviewed. \n', title='Privilege' 1768 | ) 1769 | 1770 | 1771 | class IdentitySchema(BaseModel): 1772 | authomizeId: str = Field(..., description='Unique ID', title='Authomizeid') 1773 | name: Optional[str] = Field( 1774 | default=None, description='Name of the identity', title='Name' 1775 | ) 1776 | title: Optional[str] = Field( 1777 | default=None, description='Title of the identity', title='Title' 1778 | ) 1779 | department: Optional[str] = Field( 1780 | default=None, 1781 | description='The department in which the identity works', 1782 | title='Department', 1783 | ) 1784 | accountIds: Optional[List[str]] = Field( 1785 | default=[], 1786 | description='The account IDs associated with the identity', 1787 | title='Accountids', 1788 | ) 1789 | email: Optional[str] = Field( 1790 | default=None, description='The email of the identity', title='Email' 1791 | ) 1792 | tags: Optional[List[TagSchema]] = Field( 1793 | default=[], description='The tags provided for the identity', title='Tags' 1794 | ) 1795 | terminatedAt: Optional[str] = Field( 1796 | default=None, description='Time of termination', title='Terminatedat' 1797 | ) 1798 | hiredAt: Optional[str] = Field( 1799 | default=None, description='Hired At', title='Hiredat' 1800 | ) 1801 | incidentsCount: Optional[int] = Field( 1802 | default=None, 1803 | description='Number of associated incidents', 1804 | title='Incidentscount', 1805 | ) 1806 | accounts: Optional[List[AccountSchema]] = Field( 1807 | default=[], 1808 | description='List of associated user or service accounts', 1809 | title='Accounts', 1810 | ) 1811 | riskScore: Optional[IdentityRiskScore] = Field( 1812 | default=None, description='Risk Scores', title='Riskscore' 1813 | ) 1814 | 1815 | 1816 | class IncidentSchema(BaseModel): 1817 | id: str = Field(..., description='Unique id', title='Id') 1818 | createdAt: Optional[datetime] = Field( 1819 | default=None, 1820 | description='The date the incident was first reported.', 1821 | title='Createdat', 1822 | ) 1823 | updatedAt: Optional[datetime] = Field( 1824 | default=None, 1825 | description='The date the incident was last updated.', 1826 | title='Updatedat', 1827 | ) 1828 | entities: Optional[List[IncidentEntitiesSchema]] = Field( 1829 | default=[], description='Entity', title='Entities' 1830 | ) 1831 | apps: Optional[List[SourceAppSchema]] = Field( 1832 | default=[], description='Applications', title='Apps' 1833 | ) 1834 | category: Optional[AlertCategoryType] = Field(default=None, description='Category') 1835 | tactics: Optional[List[AttackTacticType]] = Field(default=[], description='Tactics') 1836 | compliance: Optional[ 1837 | List[Union[IsoIec27001, AicpaTsc2017, Ccm402, Ccm301, Cisv8]] 1838 | ] = Field(default=[], description='Compliance', title='Compliance') 1839 | techniques: Optional[List[str]] = Field( 1840 | default=[], description='Techniques', title='Techniques' 1841 | ) 1842 | status: Optional[EventStatusType] = Field( 1843 | default=None, 1844 | description='The status of the incident (Open, In Progress, Waiting for Input, or Closed)', 1845 | ) 1846 | severity: SeverityType = Field( 1847 | ..., description='The severity of the incident (Low, Medium, High or Critical).' 1848 | ) 1849 | policyId: str = Field(..., description='Unique id of policy.', title='Policyid') 1850 | policy: Optional[PolicySchema] = Field( 1851 | default=None, description='Policy', title='Policy' 1852 | ) 1853 | assigneeId: Optional[str] = Field( 1854 | default=None, description='Unique id of assignee.', title='Assigneeid' 1855 | ) 1856 | assignee: Optional[UserSchema] = Field( 1857 | default=None, description='Assignee', title='Assignee' 1858 | ) 1859 | recommendation: Optional[str] = Field( 1860 | default=None, description='Recommendation', title='Recommendation' 1861 | ) 1862 | description: Optional[str] = Field( 1863 | default=None, description='Description', title='Description' 1864 | ) 1865 | isResolved: bool = Field(..., description='Is Resolved?', title='Isresolved') 1866 | url: str = Field(..., description='URL', title='Url') 1867 | 1868 | 1869 | class NonPaginatedResponseSchemaIncidentSchema(BaseModel): 1870 | class Config: 1871 | extra = Extra.forbid 1872 | 1873 | data: Union[IncidentSchema, List[IncidentSchema]] = Field( 1874 | ..., description='Actual Data', title='Data' 1875 | ) 1876 | 1877 | 1878 | class NonPaginatedResponseSchemaReviewerSchema(BaseModel): 1879 | class Config: 1880 | extra = Extra.forbid 1881 | 1882 | data: Union[ReviewerSchema, List[ReviewerSchema]] = Field( 1883 | ..., description='Actual Data', title='Data' 1884 | ) 1885 | 1886 | 1887 | class PaginatedResponseSchemaAccountSchema(BaseModel): 1888 | class Config: 1889 | extra = Extra.forbid 1890 | 1891 | pagination: Optional[PaginationResponseSchema] = Field( 1892 | default=None, description='Pagination Metadata', title='Pagination' 1893 | ) 1894 | data: List[AccountSchema] = Field( 1895 | ..., description='List of Actual Data', title='Data' 1896 | ) 1897 | 1898 | 1899 | class PaginatedResponseSchemaCampaignsPermissionSchema(BaseModel): 1900 | class Config: 1901 | extra = Extra.forbid 1902 | 1903 | pagination: Optional[PaginationResponseSchema] = Field( 1904 | default=None, description='Pagination Metadata', title='Pagination' 1905 | ) 1906 | data: List[CampaignsPermissionSchema] = Field( 1907 | ..., description='List of Actual Data', title='Data' 1908 | ) 1909 | 1910 | 1911 | class PaginatedResponseSchemaIdentitySchema(BaseModel): 1912 | class Config: 1913 | extra = Extra.forbid 1914 | 1915 | pagination: Optional[PaginationResponseSchema] = Field( 1916 | default=None, description='Pagination Metadata', title='Pagination' 1917 | ) 1918 | data: List[IdentitySchema] = Field( 1919 | ..., description='List of Actual Data', title='Data' 1920 | ) 1921 | 1922 | 1923 | class PaginatedResponseSchemaIncidentSchema(BaseModel): 1924 | class Config: 1925 | extra = Extra.forbid 1926 | 1927 | pagination: Optional[PaginationResponseSchema] = Field( 1928 | default=None, description='Pagination Metadata', title='Pagination' 1929 | ) 1930 | data: List[IncidentSchema] = Field( 1931 | ..., description='List of Actual Data', title='Data' 1932 | ) 1933 | 1934 | 1935 | class RemoveIdentityRisksRequestSchema(BaseModel): 1936 | class Config: 1937 | extra = Extra.forbid 1938 | 1939 | filter: Optional[SearchIdentitiesFilterBody] = Field( 1940 | default=None, description='Search filter options', title='Filter' 1941 | ) 1942 | since: datetime = Field( 1943 | ..., 1944 | description='Delete the risk score data lastly updated before the given date.', 1945 | title='Since', 1946 | ) 1947 | -------------------------------------------------------------------------------- /authomize/rest_api_client/openapi/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/authomize/connectors-rest-api-client/3fa115d39887c00e688ce387ad5f15f77f3ffccc/authomize/rest_api_client/openapi/__init__.py -------------------------------------------------------------------------------- /authomize/rest_api_client/openapi/connectors_rest_api/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/authomize/connectors-rest-api-client/3fa115d39887c00e688ce387ad5f15f77f3ffccc/authomize/rest_api_client/openapi/connectors_rest_api/__init__.py -------------------------------------------------------------------------------- /authomize/rest_api_client/openapi/external_rest_api/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/authomize/connectors-rest-api-client/3fa115d39887c00e688ce387ad5f15f77f3ffccc/authomize/rest_api_client/openapi/external_rest_api/__init__.py -------------------------------------------------------------------------------- /authomize/rest_api_client/py.typed: -------------------------------------------------------------------------------- 1 | # Marker file for PEP 561. -------------------------------------------------------------------------------- /mypy.ini: -------------------------------------------------------------------------------- 1 | [mypy] 2 | exclude = (setup.py|authomize/rest_api_client/generated/*|venv) 3 | explicit_package_bases = True 4 | namespace_packages = True 5 | # behave the same as mypyd 6 | local_partial_types = True 7 | 8 | [mypy-requests.packages.urllib3] 9 | ignore_missing_imports = True 10 | 11 | [mypy-requests] 12 | ignore_missing_imports = True 13 | 14 | [mypy-apiclient_pydantic] 15 | ignore_missing_imports = True 16 | 17 | [mypy-authomize.rest_api_client.generated.*] 18 | ignore_errors = True 19 | -------------------------------------------------------------------------------- /pipeline_config.groovy: -------------------------------------------------------------------------------- 1 | libraries { 2 | python 3 | gemfury 4 | } 5 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | api-client==1.3.1 2 | api-client-pydantic==1.2.2 3 | attrs==22.2.0 4 | certifi==2022.12.7 5 | charset-normalizer==3.0.1 6 | coverage==5.5 7 | flake8==4.0.1 8 | flake8-isort==4.2.0 9 | idna==3.4 10 | iniconfig==2.0.0 11 | isort==5.11.4 12 | mccabe==0.6.1 13 | mypy==0.991 14 | mypy-extensions==0.4.3 15 | packaging==23.0 16 | pluggy==1.0.0 17 | py==1.11.0 18 | pycodestyle==2.8.0 19 | pydantic==1.10.4 20 | pyflakes==2.4.0 21 | PyHamcrest==2.0.4 22 | pytest==6.2.5 23 | pytest-html==2.1.1 24 | pytest-metadata==2.0.4 25 | requests==2.31.0 26 | tenacity==8.1.0 27 | toml==0.10.2 28 | types-requests==2.28.11.7 29 | types-urllib3==1.26.25.4 30 | typing_extensions==4.4.0 31 | urllib3==1.26.14 32 | -------------------------------------------------------------------------------- /setup.cfg: -------------------------------------------------------------------------------- 1 | [flake8] 2 | max-line-length = 100 3 | per-file-ignores = 4 | */__init__.py:F401 5 | *.py:D400 6 | ./authomize/rest_api_client/generated/*:E501,C812 7 | filename = ./authomize/*.py, ./tests/*.py 8 | 9 | [isort] 10 | line_length=100 11 | multi_line_output=3 12 | include_trailing_comma=True 13 | force_grid_wrap=0 14 | use_parentheses=True 15 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import find_namespace_packages, setup 2 | 3 | if __name__ == '__main__': 4 | setup( 5 | version='4.6.9', 6 | name='authomize-rest-api-client', 7 | author='Authomize inc.', 8 | license='MIT', 9 | author_email='info@authomize.com', 10 | description='Authomize REST API Python Client', 11 | packages=find_namespace_packages(include=['authomize.*']), 12 | package_data={ 13 | 'authomize.rest_api_client': [ 14 | 'openapi/connectors_rest_api/*.json', 15 | 'openapi/external_rest_api/*.json', 16 | 'py.typed', 17 | ], 18 | }, 19 | install_requires=[ 20 | 'requests~=2.31', 21 | 'api-client-pydantic~=1.2', 22 | ], 23 | extras_require={ 24 | 'test': [ 25 | 'coverage~=5.2', 26 | 'flake8~=4.0', 27 | 'flake8-isort~=4.0', 28 | 'mypy~=0.910', 29 | 'pyhamcrest~=2.0', 30 | 'pytest~=7.2', 31 | 'types-requests', 32 | ], 33 | 'codegen': [ 34 | 'datamodel-code-generator~=0.11', 35 | ], 36 | }, 37 | ) 38 | -------------------------------------------------------------------------------- /tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/authomize/connectors-rest-api-client/3fa115d39887c00e688ce387ad5f15f77f3ffccc/tests/__init__.py -------------------------------------------------------------------------------- /tests/test_import.py: -------------------------------------------------------------------------------- 1 | """Make sure we have single test""" 2 | from authomize.rest_api_client import Client 3 | 4 | 5 | def test_import(): 6 | """Test import""" 7 | client = Client(auth_token='invalid') 8 | assert client.base_url is not None 9 | --------------------------------------------------------------------------------