Skip to main content

JsonApiUserResource

JSON:API formatted user resource. Represents a user resource in JSON:API format.

Fields

FieldTypeRequiredDefaultDescription
idstrPydanticUndefinedUnique resource identifier
typeForwardRef("Literal['users']")users-
attributesForwardRef('Dict[str, Any]')PydanticUndefinedUser 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"]
}