Skip to main content

Risk Types

Types for risk types and risk scenarios.

RiskScenarioControlAdd

Schema for adding a control to a risk scenario.

Fields

FieldTypeRequiredDescription
keystrKey of the policy control to link

Example

from credoai import RiskScenarioControlAdd

obj = RiskScenarioControlAdd(
key="example",
)

RiskScenarioResponse

Schema for a risk scenario (library) response.

Fields

FieldTypeRequiredDescription
idstrUnique identifier for the risk scenario
namestrName of the risk scenario
descriptionAnyDescription of the risk scenario
risk_type_idsList[str]Associated risk type IDs
authorstrAuthor of the risk scenario
domainsList[str]Applicable domains
industriesList[str]Applicable industries
regionsList[str]Applicable regions
ownership_typestrOwnership type (e.g., 'ootb', 'custom')
archivedAnyWhether the scenario is archived
deprecatedAnyWhether the scenario is deprecated

Example

from credoai import RiskScenarioResponse

obj = RiskScenarioResponse(
id="example",
name="example",
)

RiskTypeCreate

Schema for creating a custom risk type.

Fields

FieldTypeRequiredDescription
namestrName of the risk type
descriptionstrDescription of the risk type

Example

from credoai import RiskTypeCreate

obj = RiskTypeCreate(
name="example",
)

RiskTypeResponse

Schema for a risk type response.

Fields

FieldTypeRequiredDescription
idstrUnique identifier for the risk type
namestrName of the risk type
descriptionAnyDescription of the risk type
customboolWhether this is a custom (tenant-created) risk type
hiddenboolWhether 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

FieldTypeRequiredDescription
nameAnyName of the risk type
descriptionAnyDescription of the risk type
hiddenAnyWhether 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

FieldTypeRequiredDescription
status_codeintHTTP response status code
headersForwardRef('Dict[str, str]')HTTP response headers
request_idForwardRef('Optional[str]')Unique request identifier for tracing
dataForwardRef('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

FieldTypeRequiredDescription
namestrName of the risk type
descriptionForwardRef('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

FieldTypeRequiredDescription
status_codeintHTTP response status code
headersForwardRef('Dict[str, str]')HTTP response headers
request_idForwardRef('Optional[str]')Unique request identifier for tracing
dataForwardRef('RiskTypeResponse')Validated response data

Example

from credoai import RiskTypeResponseWrapper

obj = RiskTypeResponseWrapper(
status_code=123,
data=None,
)