Use Case Types
Types for creating, updating, and representing use cases.
UseCaseControlCompliance
Compliance information for a use case control.
Fields
| Field | Type | Required | Description |
|---|---|---|---|
id | str | ✓ | - |
key | Any | - | |
status | Any | - |
Example
from credoai import UseCaseControlCompliance
obj = UseCaseControlCompliance(
id="example",
)
UseCaseControlResponse
Schema for a control attached to a use case.
Fields
| Field | Type | Required | Description |
|---|---|---|---|
id | str | ✓ | - |
use_case_id | str | ✓ | - |
control_key | str | ✓ | - |
policy_pack_key | Any | - | |
control_version | int | ✓ | - |
status | Any | - | |
due_date | Any | - | |
timezone | Any | - | |
compliances | List[UseCaseControlCompliance] | - | |
inserted_at | Any | - | |
updated_at | Any | - |
Example
from credoai import UseCaseControlResponse
obj = UseCaseControlResponse(
id="example",
use_case_id="example",
control_key="example",
control_version=123,
)
UseCaseControlUpdate
Schema for updating a use case control.
Fields
| Field | Type | Required | Description |
|---|---|---|---|
due_date | Any | - | |
timezone | Any | - | |
user_ids | Any | - | |
team_ids | Any | - |
Example
from credoai import UseCaseControlUpdate
obj = UseCaseControlUpdate(
)
UseCaseCreate
Schema for creating a use case.
Fields
| Field | Type | Required | Description |
|---|---|---|---|
name | str | ✓ | - |
description | str | - | |
questionnaire_ids | List[str] | - | |
custom_fields | List[UseCaseCustomField] | - | |
questions | List[QuestionEvidenceCreate] | - | |
source | Any | - | |
user | str | - | |
owner | Any | - |
Example
from credoai import UseCaseCreate
obj = UseCaseCreate(
name="example",
)
UseCaseCustomField
Schema for a use case custom field.
Fields
| Field | Type | Required | Description |
|---|---|---|---|
custom_field_id | str | ✓ | - |
value | Any | ✓ | - |
Example
from credoai import UseCaseCustomField
obj = UseCaseCustomField(
custom_field_id="example",
value=None,
)
UseCaseResponse
Schema for a use case response.
Fields
| Field | Type | Required | Description |
|---|---|---|---|
id | str | ✓ | - |
name | str | ✓ | - |
description | Any | - | |
questionnaire_ids | List[str] | ✓ | - |
creator_id | Any | - | |
workflow_stage_id | Any | - | |
workflow_stage_step | Any | - |
Example
from credoai import UseCaseResponse
obj = UseCaseResponse(
id="example",
name="example",
questionnaire_ids=None,
)
UseCaseRiskScenarioCreate
Schema for creating a use case risk scenario.
Either risk_scenario_id (to link from library) or name (for ad-hoc) should be provided.
Fields
| Field | Type | Required | Description |
|---|---|---|---|
risk_scenario_id | Any | ID of a library risk scenario to link from | |
name | Any | Name for an ad-hoc risk scenario | |
description | Any | Description of the risk scenario | |
risk_type_ids | List[str] | Associated risk type IDs | |
inherent_risk_likelihood | Any | Inherent risk likelihood (1-5) | |
inherent_risk_impact | Any | Inherent risk impact (1-5) |
Example
from credoai import UseCaseRiskScenarioCreate
obj = UseCaseRiskScenarioCreate(
)
UseCaseRiskScenarioResponse
Schema for a use case risk scenario response.
Fields
| Field | Type | Required | Description |
|---|---|---|---|
id | str | ✓ | Unique identifier |
use_case_id | str | ✓ | Parent use case ID |
risk_scenario_id | Any | Linked library risk scenario ID | |
name | str | ✓ | Name of the risk scenario |
description | str | Description of the risk scenario | |
risk_type_ids | List[str] | Associated risk type IDs | |
inherent_risk_likelihood | Any | Inherent risk likelihood (1-5) | |
inherent_risk_impact | Any | Inherent risk impact (1-5) | |
residual_risk_likelihood | Any | Residual risk likelihood (1-5) | |
residual_risk_impact | Any | Residual risk impact (1-5) | |
inherent_risk | str | Computed inherent risk level (unknown | |
residual_risk | str | Computed residual risk level (unknown | |
control_keys | List[str] | Keys of linked policy controls |
Example
from credoai import UseCaseRiskScenarioResponse
obj = UseCaseRiskScenarioResponse(
id="example",
use_case_id="example",
name="example",
)
UseCaseRiskScenarioUpdate
Schema for updating a use case risk scenario.
Fields
| Field | Type | Required | Description |
|---|---|---|---|
name | Any | Name of the risk scenario | |
description | Any | Description of the risk scenario | |
risk_type_ids | Any | Associated risk type IDs | |
inherent_risk_likelihood | Any | Inherent risk likelihood (1-5) | |
inherent_risk_impact | Any | Inherent risk impact (1-5) | |
residual_risk_likelihood | Any | Residual risk likelihood (1-5) | |
residual_risk_impact | Any | Residual risk impact (1-5) |
Example
from credoai import UseCaseRiskScenarioUpdate
obj = UseCaseRiskScenarioUpdate(
)
UseCaseUpdate
Schema for updating a use case.
Fields
| Field | Type | Required | Description |
|---|---|---|---|
name | Any | - | |
description | Any | - | |
custom_fields | List[UseCaseCustomField] | - | |
questions | List[QuestionEvidenceUpdate] | - | |
source | Any | - | |
user | Any | - |
Example
from credoai import UseCaseUpdate
obj = UseCaseUpdate(
)
UseCaseWorkflowResponse
Schema for use case workflow status response.
Fields
| Field | Type | Required | Description |
|---|---|---|---|
use_case_id | str | ✓ | - |
workflow_stage_id | Any | - | |
workflow_stage_step | Any | - | |
workflow_stage | Any | - |
Example
from credoai import UseCaseWorkflowResponse
obj = UseCaseWorkflowResponse(
use_case_id="example",
)
UseCaseWorkflowUpdate
Schema for updating a use case's workflow stage and step.
Fields
| Field | Type | Required | Description |
|---|---|---|---|
workflow_stage_id | str | ✓ | ID of the workflow stage to move the use case to |
workflow_stage_step | Any | Step within the workflow stage |
Example
from credoai import UseCaseWorkflowUpdate
obj = UseCaseWorkflowUpdate(
workflow_stage_id="example",
)
UseCaseControlResponseWrapper
Response wrapper for UseCaseControlResponse with metadata and validation. Extends ClientResponse to provide type-safe access to UseCaseControlResponse 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('UseCaseControlResponse') | ✓ | Validated response data |
Example
from credoai import UseCaseControlResponseWrapper
obj = UseCaseControlResponseWrapper(
status_code=123,
data=None,
)
UseCaseCreateRequest
Request wrapper for UseCaseCreate with validation and JSON:API support. Combines the UseCaseCreate data model with client request functionality, providing automatic validation and JSON:API format conversion for API requests.
Fields
| Field | Type | Required | Description |
|---|---|---|---|
name | str | ✓ | - |
description | ForwardRef('Optional[str]') | Example: '' | |
questionnaire_ids | ForwardRef('Optional[List[str]]') | - | |
custom_fields | ForwardRef("Optional['List[UseCaseCustomField]']") | - | |
questions | ForwardRef("Optional['List[QuestionEvidenceCreate]']") | - | |
source | ForwardRef('Optional[Any]') | - | |
user | ForwardRef('Optional[str]') | Example: '' | |
owner | ForwardRef('Optional[Any]') | - |
Example
from credoai import UseCaseCreateRequest
obj = UseCaseCreateRequest(
name="example",
)
UseCaseResponseWrapper
Response wrapper for UseCaseResponse with metadata and validation. Extends ClientResponse to provide type-safe access to UseCaseResponse 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('UseCaseResponse') | ✓ | Validated response data |
Example
from credoai import UseCaseResponseWrapper
obj = UseCaseResponseWrapper(
status_code=123,
data=None,
)
UseCaseRiskScenarioCreateRequest
Request wrapper for UseCaseRiskScenarioCreate with validation and JSON:API support. Combines the UseCaseRiskScenarioCreate data model with client request functionality, providing automatic validation and JSON:API format conversion for API requests.
Fields
| Field | Type | Required | Description |
|---|---|---|---|
risk_scenario_id | ForwardRef('Optional[Any]') | ID of a library risk scenario to link from | |
name | ForwardRef('Optional[Any]') | Name for an ad-hoc risk scenario | |
description | ForwardRef('Optional[Any]') | Description of the risk scenario | |
risk_type_ids | ForwardRef('Optional[List[str]]') | Associated risk type IDs | |
inherent_risk_likelihood | ForwardRef('Optional[Any]') | Inherent risk likelihood (1-5) | |
inherent_risk_impact | ForwardRef('Optional[Any]') | Inherent risk impact (1-5) |
Example
from credoai import UseCaseRiskScenarioCreateRequest
obj = UseCaseRiskScenarioCreateRequest(
)
UseCaseRiskScenarioResponseWrapper
Response wrapper for UseCaseRiskScenarioResponse with metadata and validation. Extends ClientResponse to provide type-safe access to UseCaseRiskScenarioResponse 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('UseCaseRiskScenarioResponse') | ✓ | Validated response data |
Example
from credoai import UseCaseRiskScenarioResponseWrapper
obj = UseCaseRiskScenarioResponseWrapper(
status_code=123,
data=None,
)
UseCaseWorkflowResponseWrapper
Response wrapper for UseCaseWorkflowResponse with metadata and validation. Extends ClientResponse to provide type-safe access to UseCaseWorkflowResponse 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('UseCaseWorkflowResponse') | ✓ | Validated response data |
Example
from credoai import UseCaseWorkflowResponseWrapper
obj = UseCaseWorkflowResponseWrapper(
status_code=123,
data=None,
)