ADT
psengine.entity_lists.entity_list
¶
EntityList
¶
Bases: ListInfoOut
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: str | tuple[str, str],
context: dict | None = 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
entities_with_tags
¶
entities_with_tags() -> list[ListEntityWithTags]
Get entities for a list, together with their list-specific tags.
Tags are not free-text. They are a fixed set of 57 predefined values, so arbitrary tag strings cannot be expected. See https://docs.recordedfuture.com/reference/lists-available-tags for the full list of valid tags, their display names, and their API values.
tags is only populated for lists whose type has tagging enabled server-side (currently
Third-Parties Watch Lists). A list of any other type returns its entities with an empty
tags list rather than an error, so an empty tags does not indicate a failure. A list
whose type supports tagging but which has not yet been migrated server-side responds 400
instead.
Endpoint
list/{id}/entitiesWithTags
| RAISES | DESCRIPTION |
|---|---|
ListApiError
|
If connection error occurs. The API responds 400 if the list's type supports tagging but the list has not been migrated to support tags, and 404 if the list does not exist. |
| RETURNS | DESCRIPTION |
|---|---|
list[ListEntityWithTags]
|
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: 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
update_entity_tags
¶
update_entity_tags(
entity: str | tuple[str, str], tags: list[str]
) -> ReplaceEntityTagsOut
Replace all tags on an entity in a list.
This replaces rather than appends: tags becomes the entity's complete tag set,
and passing an empty list clears every tag from it.
Tags are not free-text. They are a fixed set of 57 predefined values - pass them as
plain strings or as ListTagName members. Invalid names are rejected by the API with a
400. See https://docs.recordedfuture.com/reference/lists-available-tags for the full
list.
Tagging is only enabled for lists whose type supports it (currently Third-Parties Watch Lists); other list types respond 403.
If entity is a (name, type) tuple that cannot be resolved, the returned
operation is an EntityNotResolvedOperation rather than an exception, matching
add and remove.
| PARAMETER | DESCRIPTION |
|---|---|
entity
|
ID or (name, type) tuple of the entity to tag.
TYPE:
|
tags
|
Complete set of tags to apply. Replaces every tag already on the entity.
TYPE:
|
Endpoint
list/{id}/entity/tags
| RAISES | DESCRIPTION |
|---|---|
ValidationError
|
if any supplied parameter is of incorrect type. |
ListApiError
|
If connection error occurs. The API responds 400 for an invalid tag name, entity, or list, 403 if tag updates are not enabled for the list type, and 404 if the entity is not on the list. |
| RETURNS | DESCRIPTION |
|---|---|
ReplaceEntityTagsOut
|
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
ListEntityWithTags
¶
Bases: ListEntity
Validate data received from /{listId}/entitiesWithTags endpoint.
Identical to ListEntity, with the addition of the list-specific tags assigned to the
entity. Tags are predefined and only populated for lists whose type has tagging enabled -
see ListEntityTag.
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:
|