ADT
psengine.entity_lists.entity_list
¶
EntityList
¶
Bases: RFBaseModel
Validate data received from /create
endpoint.
log
class-attribute
instance-attribute
¶
model_config
class-attribute
instance-attribute
¶
owner_organisation_details
class-attribute
instance-attribute
¶
owner_organisation_details: OwnerOrganisationDetails = (
Field(default_factory=OwnerOrganisationDetails)
)
__eq__
¶
__eq__(other: EntityList)
__hash__
¶
__str__
¶
Return the string representation of the list.
RETURNS | DESCRIPTION |
---|---|
str
|
List data with standard info and entities. |
Source code in psengine/entity_lists/entity_list.py
add
¶
add(
entity: Union[str, tuple[str, str]],
context: Optional[dict] = None,
) -> ListEntityOperationResponse
Add an entity to a list.
PARAMETER | DESCRIPTION |
---|---|
entity
|
ID or (name, type) tuple of the entity to add.
TYPE:
|
context
|
Context object for the entity.
TYPE:
|
Endpoint
list/{id}/entity/add
RAISES | DESCRIPTION |
---|---|
ValidationError
|
if any supplied parameter is of incorrect type. |
ListApiError
|
If connection error occurs. |
RETURNS | DESCRIPTION |
---|---|
ListEntityOperationResponse
|
Response from the |
Source code in psengine/entity_lists/entity_list.py
bulk_add
¶
Bulk add entities to a list.
Adds entities one at a time due to List API requirement. Logs progress every 10%.
PARAMETER | DESCRIPTION |
---|---|
entities
|
List of entity string IDs or (name, type) tuples to add.
TYPE:
|
Endpoint
list/{id}/entity/add
RAISES | DESCRIPTION |
---|---|
ValidationError
|
If any supplied parameter is of incorrect type. |
ValueError
|
If an invalid operation is supplied. |
ListApiError
|
If connection error occurs. |
RETURNS | DESCRIPTION |
---|---|
dict
|
Results JSON with 'added', 'unchanged', and 'error' keys containing lists of entities. |
Source code in psengine/entity_lists/entity_list.py
bulk_remove
¶
Bulk remove entities from a list.
Removes entities one at a time due to List API requirement. Logs progress every 10%.
PARAMETER | DESCRIPTION |
---|---|
entities
|
List of entity string IDs or (name, type) tuples to remove.
TYPE:
|
Endpoint
list/{id}/entity/remove
RAISES | DESCRIPTION |
---|---|
ValidationError
|
If any supplied parameter is of incorrect type. |
ValueError
|
If an invalid operation is supplied. |
ListApiError
|
If connection error occurs. |
RETURNS | DESCRIPTION |
---|---|
dict
|
Results JSON with 'removed', 'unchanged', and 'error' keys with the lists of entities. |
Source code in psengine/entity_lists/entity_list.py
entities
¶
entities() -> list[ListEntity]
Get entities for a list.
Endpoint
list/{id}/entities
RAISES | DESCRIPTION |
---|---|
ListApiError
|
If connection error occurs. |
RETURNS | DESCRIPTION |
---|---|
list[ListEntity]
|
Response from the |
Source code in psengine/entity_lists/entity_list.py
info
¶
info() -> ListInfoOut
Get info for a list.
Endpoint
list/{id}/info
RAISES | DESCRIPTION |
---|---|
ListApiError
|
If connection error occurs. |
RETURNS | DESCRIPTION |
---|---|
ListInfoOut
|
Response from the |
Source code in psengine/entity_lists/entity_list.py
json
¶
json(
by_alias: bool = True,
exclude_none: bool = True,
auto_exclude_unset: bool = True,
**kwargs,
)
JSON representation of models. It is inherited by every model.
PARAMETER | DESCRIPTION |
---|---|
by_alias
|
Alias flag:
TYPE:
|
exclude_none
|
Whether to exclude fields equal to None.
TYPE:
|
auto_exclude_unset
|
Whether to auto exclude values not set.
TYPE:
|
Source code in psengine/common_models.py
remove
¶
remove(
entity: Union[str, tuple[str, str]],
) -> ListEntityOperationResponse
Remove an entity from a list.
PARAMETER | DESCRIPTION |
---|---|
entity
|
ID or (name, type) tuple of the entity to remove.
TYPE:
|
Endpoint
list/{id}/entity/remove
RAISES | DESCRIPTION |
---|---|
ValidationError
|
if any supplied parameter is of incorrect type. |
ListApiError
|
If connection error occurs. |
RETURNS | DESCRIPTION |
---|---|
ListEntityOperationResponse
|
Response from the |
Source code in psengine/entity_lists/entity_list.py
status
¶
status() -> ListStatusOut
Get status information about list.
Endpoint
list/{id}/status
RAISES | DESCRIPTION |
---|---|
ListApiError
|
if connection error occurs |
RETURNS | DESCRIPTION |
---|---|
ListStatusOut
|
list/{id}/status response
TYPE:
|
Source code in psengine/entity_lists/entity_list.py
text_entries
¶
Get text entries for a list.
Endpoint
list/{id}/textEntries
RAISES | DESCRIPTION |
---|---|
ListApiError
|
If connection error occurs. |
RETURNS | DESCRIPTION |
---|---|
list[str]
|
Response from the |
Source code in psengine/entity_lists/entity_list.py
ListEntity
¶
Bases: RFBaseModel
Validate data received from /{listId}/entities
endpoint.
model_config
class-attribute
instance-attribute
¶
__eq__
¶
__eq__(other: ListEntity)
__gt__
¶
__gt__(other: ListEntity)
__hash__
¶
__str__
¶
json
¶
json(
by_alias: bool = True,
exclude_none: bool = True,
auto_exclude_unset: bool = True,
**kwargs,
)
JSON representation of models. It is inherited by every model.
PARAMETER | DESCRIPTION |
---|---|
by_alias
|
Alias flag:
TYPE:
|
exclude_none
|
Whether to exclude fields equal to None.
TYPE:
|
auto_exclude_unset
|
Whether to auto exclude values not set.
TYPE:
|
Source code in psengine/common_models.py
ListInfoOut
¶
Bases: RFBaseModel
Validate data received from /{listId}/info
endpoint.
model_config
class-attribute
instance-attribute
¶
owner_organisation_details
class-attribute
instance-attribute
¶
owner_organisation_details: OwnerOrganisationDetails = (
Field(default_factory=OwnerOrganisationDetails)
)
json
¶
json(
by_alias: bool = True,
exclude_none: bool = True,
auto_exclude_unset: bool = True,
**kwargs,
)
JSON representation of models. It is inherited by every model.
PARAMETER | DESCRIPTION |
---|---|
by_alias
|
Alias flag:
TYPE:
|
exclude_none
|
Whether to exclude fields equal to None.
TYPE:
|
auto_exclude_unset
|
Whether to auto exclude values not set.
TYPE:
|
Source code in psengine/common_models.py
ListStatusOut
¶
Bases: RFBaseModel
Validate data received from /{listId}/status
endpoint.
model_config
class-attribute
instance-attribute
¶
json
¶
json(
by_alias: bool = True,
exclude_none: bool = True,
auto_exclude_unset: bool = True,
**kwargs,
)
JSON representation of models. It is inherited by every model.
PARAMETER | DESCRIPTION |
---|---|
by_alias
|
Alias flag:
TYPE:
|
exclude_none
|
Whether to exclude fields equal to None.
TYPE:
|
auto_exclude_unset
|
Whether to auto exclude values not set.
TYPE:
|