Module mydata_did.patched_protocols.present_proof.v1_0.messages.presentation_proposal
A presentation proposal content message.
Expand source code
"""A presentation proposal content message."""
from marshmallow import EXCLUDE, fields
from aries_cloudagent.messaging.agent_message import AgentMessage, AgentMessageSchema
from ..message_types import PRESENTATION_PROPOSAL, PROTOCOL_PACKAGE
from .inner.presentation_preview import PresentationPreview, PresentationPreviewSchema
HANDLER_CLASS = (
f"{PROTOCOL_PACKAGE}.handlers."
"presentation_proposal_handler.PresentationProposalHandler"
)
class PresentationProposal(AgentMessage):
"""Class representing a presentation proposal."""
class Meta:
"""PresentationProposal metadata."""
handler_class = HANDLER_CLASS
schema_class = "PresentationProposalSchema"
message_type = PRESENTATION_PROPOSAL
def __init__(
self,
_id: str = None,
*,
comment: str = None,
presentation_proposal: PresentationPreview = None,
**kwargs,
):
"""
Initialize presentation proposal object.
Args:
comment: optional human-readable comment
presentation_proposal: proposed presentation preview
"""
super().__init__(_id, **kwargs)
self.comment = comment
self.presentation_proposal = presentation_proposal
class PresentationProposalSchema(AgentMessageSchema):
"""Presentation proposal schema."""
class Meta:
"""Presentation proposal schema metadata."""
model_class = PresentationProposal
unknown = EXCLUDE
comment = fields.Str(
description="Human-readable comment", required=False, allow_none=True
)
presentation_proposal = fields.Nested(PresentationPreviewSchema, required=True)
Classes
class PresentationProposal (*, comment: str = None, presentation_proposal: PresentationPreview = None, **kwargs)
-
Class representing a presentation proposal.
Initialize presentation proposal object.
Args
comment
- optional human-readable comment
presentation_proposal
- proposed presentation preview
Expand source code
class PresentationProposal(AgentMessage): """Class representing a presentation proposal.""" class Meta: """PresentationProposal metadata.""" handler_class = HANDLER_CLASS schema_class = "PresentationProposalSchema" message_type = PRESENTATION_PROPOSAL def __init__( self, _id: str = None, *, comment: str = None, presentation_proposal: PresentationPreview = None, **kwargs, ): """ Initialize presentation proposal object. Args: comment: optional human-readable comment presentation_proposal: proposed presentation preview """ super().__init__(_id, **kwargs) self.comment = comment self.presentation_proposal = presentation_proposal
Ancestors
- aries_cloudagent.messaging.agent_message.AgentMessage
- aries_cloudagent.messaging.models.base.BaseModel
- abc.ABC
Class variables
var Meta
-
PresentationProposal metadata.
class PresentationProposalSchema (*args, **kwargs)
-
Presentation proposal schema.
Initialize an instance of AgentMessageSchema.
Raises
TypeError
- If Meta.model_class has not been set
Expand source code
class PresentationProposalSchema(AgentMessageSchema): """Presentation proposal schema.""" class Meta: """Presentation proposal schema metadata.""" model_class = PresentationProposal unknown = EXCLUDE comment = fields.Str( description="Human-readable comment", required=False, allow_none=True ) presentation_proposal = fields.Nested(PresentationPreviewSchema, required=True)
Ancestors
- aries_cloudagent.messaging.agent_message.AgentMessageSchema
- aries_cloudagent.messaging.models.base.BaseModelSchema
- marshmallow.schema.Schema
- marshmallow.base.SchemaABC
Class variables
var Meta
-
Presentation proposal schema metadata.
var opts