cattle_grid.model
cattle_grid.model
ActivityMessage
Bases: WithActor
Message that contains an Activity. Activity is used as the name for the ‘data object’ being exchanged, as is common in the Fediverse
Parameters:
Name | Type | Description | Default |
---|---|---|---|
actor
|
str
|
actor_id of the actor that received the message |
required |
data
|
Dict[str, Any]
|
The activity |
required |
Source code in cattle_grid/model/__init__.py
FetchMessage
SharedInboxMessage
Bases: BaseModel
Message that contains an Activity. In difference to the ActivityMessage this message does not have an actor, and thus its recipients will be determined by cattle_grid.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data
|
Dict[str, Any]
|
|
required |
Source code in cattle_grid/model/__init__.py
account
Objects used for the account exchange
ActorInformation
CreateActorRequest
Bases: BaseModel
Request to create an actor
Parameters:
Name | Type | Description | Default |
---|---|---|---|
base_url
|
str
|
Base url for the actor, the actor URI will be of the form |
required |
name
|
str | None
|
Internal name of the actor |
None
|
preferred_username
|
str | None
|
Add a preferred username. This name will be used in acct:username@domain and supplied to webfinger. Here domain is determine from baseUrl. |
None
|
profile
|
Dict[str, Any]
|
New profile object for the actor. |
{}
|
automatically_accept_followers
|
bool | None
|
Enables setting actors to automatically accept follow requests |
None
|
Source code in cattle_grid/model/account.py
ErrorMessage
EventInformation
Bases: WithActor
Send on outgoing or incoming events
Parameters:
Name | Type | Description | Default |
---|---|---|---|
actor
|
str
|
The actor performing the action |
required |
event_type
|
EventType
|
Type of event incoming means that the contained data was not generated on the actors behalf. outgoing means that the data is being send out by the actor. |
required |
data
|
Dict[str, Any]
|
The data that was exchanged. We note that this data was processed by the transformers. |
required |
Source code in cattle_grid/model/account.py
EventType
FetchMessage
FetchResponse
InformationResponse
Bases: BaseModel
Response for the information request
Parameters:
Name | Type | Description | Default |
---|---|---|---|
account_name
|
str
|
Name of the account |
required |
actors
|
List[ActorInformation]
|
Actors of the account on the server |
required |
base_urls
|
List[str]
|
The base urls of the server |
required |
backend
|
NameAndVersion
|
Name and version of the backend |
required |
protocol
|
NameAndVersion
|
Name and version of the protocol being used |
required |
method_information
|
List[MethodInformationModel]
|
Built-in mutable sequence. If no argument is given, the constructor creates a new empty list. The argument must be an iterable if specified. |
<dynamic>
|
Source code in cattle_grid/model/account.py
NameAndVersion
TriggerMessage
common
exchange
DeleteActorMessage
RenameActorAction
Bases: UpdateAction
Update the internal name of the actor
Parameters:
Name | Type | Description | Default |
---|---|---|---|
action
|
UpdateActionType
|
|
required |
name
|
str
|
The new name of the actor |
required |
Source code in cattle_grid/model/exchange.py
UpdateAction
Bases: BaseModel
Action to update an actor
Parameters:
Name | Type | Description | Default |
---|---|---|---|
action
|
UpdateActionType
|
|
required |
Source code in cattle_grid/model/exchange.py
UpdateActionType
Bases: StrEnum
Available actions for updating the actor
Source code in cattle_grid/model/exchange.py
add_identifier
class-attribute
instance-attribute
add_identifier = auto()
Adds a new identifier. The identifier is assumed to already exist.
create_identifier
class-attribute
instance-attribute
create_identifier = auto()
Creates a new identifier. Must be on a domain controlled by cattle_grid and enabled in the account
remove_identifier
class-attribute
instance-attribute
remove_identifier = auto()
Removes an identifier
remove_property_value
class-attribute
instance-attribute
remove_property_value = auto()
Removes a property value
update_identifier
class-attribute
instance-attribute
update_identifier = auto()
Updates an identifer
update_property_value
class-attribute
instance-attribute
update_property_value = auto()
Adds or updates a property value of the actor
UpdateActorMessage
Bases: WithActor
Allows one to update the actor object
Parameters:
Name | Type | Description | Default |
---|---|---|---|
actor
|
str
|
actor_id of the actor that received the message |
required |
profile
|
Dict[str, Any] | None
|
New profile object for the actor. The fields. |
None
|
autoFollow
|
bool | None
|
Enables setting actors to automatically accept follow requests |
None
|
actions
|
List[UpdateAction]
|
Actions to be taken when updating the profile |
<dynamic>
|
Source code in cattle_grid/model/exchange.py
UpdateIdentifierAction
Bases: UpdateAction
Used to update an identifier of the actor
Parameters:
Name | Type | Description | Default |
---|---|---|---|
action
|
UpdateActionType
|
|
required |
identifier
|
str
|
The identifier |
required |
primary
|
bool
|
Set the identifier as the primary one, if the identifier corresponds to an acct-uri this will update the primary identifier |
False
|
Source code in cattle_grid/model/exchange.py
UpdatePropertyValueAction
Bases: UpdateAction
Update a property value of the actor
Parameters:
Name | Type | Description | Default |
---|---|---|---|
action
|
UpdateActionType
|
|
required |
key
|
str
|
The key of the property value to be created, updated, or deleted |
required |
value
|
str | None
|
The value of the property value |
None
|
Source code in cattle_grid/model/exchange.py
extension
AddMethodInformationMessage
Bases: BaseModel
Message to add method information through the exchange
Parameters:
Name | Type | Description | Default |
---|---|---|---|
method_information
|
list[MethodInformationModel]
|
List of method information |
required |
Source code in cattle_grid/model/extension.py
MethodInformationModel
Bases: BaseModel
cattle_grid allows to define methods on the exchange through extensions. This class contains a description of them
Parameters:
Name | Type | Description | Default |
---|---|---|---|
routing_key
|
str
|
Name of the method |
required |
module
|
str
|
Module the extension was imported from. This is cattle_grid for build-in methods |
required |
description
|
str | None
|
Description of the method |
None
|
Source code in cattle_grid/model/extension.py
lookup
LookupMethod
module-attribute
Alias for the Lookup Method
Lookup
Bases: BaseModel
Lookup of something from the Fediverse
Parameters:
Name | Type | Description | Default |
---|---|---|---|
uri
|
str
|
|
required |
actor
|
str
|
|
required |
result
|
dict | None
|
|
None
|
Source code in cattle_grid/model/lookup.py
actor
class-attribute
instance-attribute
The actor performing the lookup
messages
CreateActorMessage
Bases: BaseModel
Parameters:
Name | Type | Description | Default |
---|---|---|---|
baseUrl
|
str
|
base url used to create the user on. Can contain a path |
required |
preferredUsername
|
str | None
|
Add a preferred username. This name will be used in acct:username@domain and supplied to webfinger. Here domain is determine from baseUrl. |
None
|
profile
|
Dict[str, Any]
|
New profile object for the actor. The fields. |
{}
|
autoFollow
|
bool
|
Enables setting actors to automatically accept follow requests |
False
|