cattle_grid.model
cattle_grid.model
ActivityMessage
Bases: BaseModel
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
|
|
required |
data
|
Dict[str, Any]
|
|
required |
Source code in cattle_grid/model/__init__.py
actor
instance-attribute
actor_id of the actor that received the message
data
instance-attribute
Activity.
FetchMessage
Bases: BaseModel
Used to request an ActivityPub object to be retrieved
Parameters:
Name | Type | Description | Default |
---|---|---|---|
actor
|
str
|
|
required |
uri
|
str
|
|
required |
Source code in cattle_grid/model/__init__.py
actor
instance-attribute
actor_id of the actor that received the message
uri
instance-attribute
URI of the object being retrieved
account
Objects used for the account exchange
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 |
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 |
---|---|---|---|
actors
|
List[str]
|
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[MethodInformation]
|
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
exchange
DeleteActorMessage
UpdateAction
Bases: BaseModel
Action to update an actor
Parameters:
Name | Type | Description | Default |
---|---|---|---|
action
|
UpdateActionType
|
|
required |
Source code in cattle_grid/model/exchange.py
UpdateActorMessage
Bases: BaseModel
Allows one to update the actor object
Parameters:
Name | Type | Description | Default |
---|---|---|---|
actor
|
str
|
The URI of the actor being updated. Must be managed by cattle_grid |
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
|
|
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
extension
MethodInformation
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 = Callable[[Lookup], Awaitable[Lookup]]
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 = Field(examples=['http://abel.example/actor'])
class-attribute
instance-attribute
The actor performing the lookup
result = Field(None, examples=[{'id': 'http://actor.example', 'type': 'Person', 'name': 'Jane Doe'}])
class-attribute
instance-attribute
The result of the lookup, None if no result yet, the result will be returned once the lookup is finished
uri = Field(examples=['http://actor.example', 'acct:user@actor.example'])
class-attribute
instance-attribute
The uri being looked up
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
|