JsonApiUserResource
JSON:API formatted user resource. Represents a user resource in JSON:API format.
Fields
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
id | str | ✓ | PydanticUndefined | Unique resource identifier |
type | ForwardRef("Literal['users']") | ✗ | users | - |
attributes | ForwardRef('Dict[str, Any]') | ✓ | PydanticUndefined | User data attributes |
Usage Example
from credoai.models import JsonApiUserResource
# Create a new instance
model = JsonApiUserResource(
id="example_value", # Unique resource identifier
attributes=None, # User 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 = JsonApiUserResource(**data)
JSON Schema
{
"type": "object",
"title": "JsonApiUserResource",
"description": "JSON:API formatted user resource.
Represents a user resource in JSON:API format.",
"properties": {
"id": {
"type": "str",
"description": "Unique resource identifier"
},
"type": {
"type": "forwardref("literal['users']")"
},
"attributes": {
"type": "forwardref('dict[str, any]')",
"description": "User data attributes"
}
},
"required": ["id", "attributes"]
}