aea.mail.base
Mail module abstract base classes.
URI Objects
URI following RFC3986.
__
init__
Initialize the URI.
Must follow: https://tools.ietf.org/html/rfc3986.html
Arguments:
uri_raw
: the raw form uri
scheme
Get the scheme.
netloc
Get the netloc.
path
Get the path.
params
Get the params.
query
Get the query.
fragment
Get the fragment.
username
Get the username.
password
Get the password.
host
Get the host.
port
Get the port.
__
str__
Get string representation.
__
eq__
Compare with another object.
EnvelopeContext Objects
Contains context information of an envelope.
__
init__
Initialize the envelope context.
Arguments:
connection_id
: the connection id used for routing the outgoing envelope in the multiplexer.uri
: the URI sent with the envelope.
uri
Get the URI.
connection_
id
Get the connection id to route the envelope.
connection_
id
Set the 'via' connection id.
__
str__
Get the string representation.
__
eq__
Compare with another object.
AEAConnectionError Objects
Exception class for connection errors.
Empty Objects
Exception for when the inbox is empty.
EnvelopeSerializer Objects
Abstract class to specify the serialization layer for the envelope.
encode
Encode the envelope.
Arguments:
envelope
: the envelope to encode
Returns:
the encoded envelope
decode
Decode the envelope.
Arguments:
envelope_bytes
: the encoded envelope
Returns:
the envelope
ProtobufEnvelopeSerializer Objects
Envelope serializer using Protobuf.
encode
Encode the envelope.
Arguments:
envelope
: the envelope to encode
Returns:
the encoded envelope
decode
Decode the envelope.
The default serializer doesn't decode the message field.
Arguments:
envelope_bytes
: the encoded envelope
Returns:
the envelope
Envelope Objects
The top level message class for agent to agent communication.
__
init__
| __init__(to: Address, sender: Address, message: Union[Message, bytes], context: Optional[EnvelopeContext] = None, protocol_specification_id: Optional[PublicId] = None) -> None
Initialize a Message object.
Arguments:
to
: the address of the receiver.sender
: the address of the sender.message
: the protocol-specific message.context
: the optional envelope context.protocol_specification_id
: the protocol specification id (wire id).
to
Get address of receiver.
to
Set address of receiver.
sender
Get address of sender.
sender
Set address of sender.
protocol_
specification_
id
Get protocol_specification_id.
message
Get the protocol-specific message.
message
Set the protocol-specific message.
message_
bytes
Get the protocol-specific message.
context
Get the envelope context.
to_
as_
public_
id
Get to as public id.
is_
sender_
public_
id
Check if sender is a public id.
is_
to_
public_
id
Check if to is a public id.
is_
component_
to_
component_
message
Whether or not the message contained is component to component.
__
eq__
Compare with another object.
encode
Encode the envelope.
Arguments:
serializer
: the serializer that implements the encoding procedure.
Returns:
the encoded envelope.
decode
| @classmethod
| decode(cls, envelope_bytes: bytes, serializer: Optional[EnvelopeSerializer] = None) -> "Envelope"
Decode the envelope.
Arguments:
envelope_bytes
: the bytes to be decoded.serializer
: the serializer that implements the decoding procedure.
Returns:
the decoded envelope.
__
str__
Get the string representation of an envelope.