Skip to main content

JsonApiUseCaseResource

JSON:API formatted use case resource. Represents a use case resource in JSON:API format with type-safe attributes.

Fields

FieldTypeRequiredDefaultDescription
idstrPydanticUndefinedUnique resource identifier
typeForwardRef("Literal['use_cases']")use_cases-
attributesForwardRef("'UseCaseResponse'")PydanticUndefinedUse case data attributes

Usage Example

from credoai.models import JsonApiUseCaseResource

# Create a new instance
model = JsonApiUseCaseResource(
id="example_value", # Unique resource identifier
attributes=None, # Use case data attributes
)

# Convert to dictionary
model_dict = model.model_dump()
print(model_dict)

# Create from dictionary
data = {
"id": "example_value",
"attributes": None,
}
model_from_dict = JsonApiUseCaseResource(**data)

JSON Schema

{
"type": "object",
"title": "JsonApiUseCaseResource",
"description": "JSON:API formatted use case resource.
Represents a use case resource in JSON:API format with type-safe attributes.",
"properties": {
"id": {
"type": "str",
"description": "Unique resource identifier"
},
"type": {
"type": "forwardref("literal['use_cases']")"
},
"attributes": {
"type": "forwardref("'usecaseresponse'")",
"description": "Use case data attributes"
}
},
"required": ["id", "attributes"]
}