Risk Types
Types for risk types and risk scenarios.
RiskScenarioControlAdd
Schema for adding a control to a risk scenario.
Fields
| Field | Type | Required | Description |
|---|---|---|---|
key | str | ✓ | Key of the policy control to link |
Example
from credoai import RiskScenarioControlAdd
obj = RiskScenarioControlAdd(
key="example",
)
RiskScenarioResponse
Schema for a risk scenario (library) response.
Fields
| Field | Type | Required | Description |
|---|---|---|---|
id | str | ✓ | Unique identifier for the risk scenario |
name | str | ✓ | Name of the risk scenario |
description | Any | Description of the risk scenario | |
risk_type_ids | List[str] | Associated risk type IDs | |
author | str | Author of the risk scenario | |
domains | List[str] | Applicable domains | |
industries | List[str] | Applicable industries | |
regions | List[str] | Applicable regions | |
ownership_type | str | Ownership type (e.g., 'ootb', 'custom') | |
archived | Any | Whether the scenario is archived | |
deprecated | Any | Whether the scenario is deprecated |
Example
from credoai import RiskScenarioResponse
obj = RiskScenarioResponse(
id="example",
name="example",
)
RiskTypeCreate
Schema for creating a custom risk type.
Fields
| Field | Type | Required | Description |
|---|---|---|---|
name | str | ✓ | Name of the risk type |
description | str | Description of the risk type |
Example
from credoai import RiskTypeCreate
obj = RiskTypeCreate(
name="example",
)
RiskTypeResponse
Schema for a risk type response.
Fields
| Field | Type | Required | Description |
|---|---|---|---|
id | str | ✓ | Unique identifier for the risk type |
name | str | ✓ | Name of the risk type |
description | Any | Description of the risk type | |
custom | bool | Whether this is a custom (tenant-created) risk type | |
hidden | bool | Whether this risk type is hidden |
Example
from credoai import RiskTypeResponse
obj = RiskTypeResponse(
id="example",
name="example",
)
RiskTypeUpdate
Schema for updating a risk type.
For custom risk types: name and description can be updated. For OOTB risk types: only hidden can be updated.
Fields
| Field | Type | Required | Description |
|---|---|---|---|
name | Any | Name of the risk type | |
description | Any | Description of the risk type | |
hidden | Any | Whether the risk type is hidden |
Example
from credoai import RiskTypeUpdate
obj = RiskTypeUpdate(
)
RiskScenarioResponseWrapper
Response wrapper for RiskScenarioResponse with metadata and validation. Extends ClientResponse to provide type-safe access to RiskScenarioResponse data along with HTTP response metadata.
Fields
| Field | Type | Required | Description |
|---|---|---|---|
status_code | int | ✓ | HTTP response status code |
headers | ForwardRef('Dict[str, str]') | HTTP response headers | |
request_id | ForwardRef('Optional[str]') | Unique request identifier for tracing | |
data | ForwardRef('RiskScenarioResponse') | ✓ | Validated response data |
Example
from credoai import RiskScenarioResponseWrapper
obj = RiskScenarioResponseWrapper(
status_code=123,
data=None,
)
RiskTypeCreateRequest
Request wrapper for RiskTypeCreate with validation and JSON:API support. Combines the RiskTypeCreate data model with client request functionality, providing automatic validation and JSON:API format conversion for API requests.
Fields
| Field | Type | Required | Description |
|---|---|---|---|
name | str | ✓ | Name of the risk type |
description | ForwardRef('Optional[str]') | Description of the risk type. Example: '' |
Example
from credoai import RiskTypeCreateRequest
obj = RiskTypeCreateRequest(
name="example",
)
RiskTypeResponseWrapper
Response wrapper for RiskTypeResponse with metadata and validation. Extends ClientResponse to provide type-safe access to RiskTypeResponse data along with HTTP response metadata.
Fields
| Field | Type | Required | Description |
|---|---|---|---|
status_code | int | ✓ | HTTP response status code |
headers | ForwardRef('Dict[str, str]') | HTTP response headers | |
request_id | ForwardRef('Optional[str]') | Unique request identifier for tracing | |
data | ForwardRef('RiskTypeResponse') | ✓ | Validated response data |
Example
from credoai import RiskTypeResponseWrapper
obj = RiskTypeResponseWrapper(
status_code=123,
data=None,
)