Skip to content

Operation

faststream.specification.asyncapi.v3_0_0.schema.operations.Operation #

Bases: BaseModel

A class to represent an operation.

ATTRIBUTE DESCRIPTION
operation_id

ID of the operation

summary

summary of the operation

description

description of the operation

bindings

bindings of the operation

message

message of the operation

security

security details of the operation

tags

tags associated with the operation

action instance-attribute #

action

channel instance-attribute #

channel

summary class-attribute instance-attribute #

summary = None

description class-attribute instance-attribute #

description = None

bindings class-attribute instance-attribute #

bindings = None

messages class-attribute instance-attribute #

messages = Field(default_factory=list)

security class-attribute instance-attribute #

security = None

tags class-attribute instance-attribute #

tags = None

model_config class-attribute instance-attribute #

model_config = {'extra': 'allow'}

Config #

extra class-attribute instance-attribute #

extra = 'allow'

from_sub classmethod #

from_sub(messages, channel, operation)
Source code in faststream/specification/asyncapi/v3_0_0/schema/operations.py
@classmethod
def from_sub(
    cls,
    messages: list[Reference],
    channel: Reference,
    operation: OperationSpec,
) -> Self:
    return cls(
        action=Action.RECEIVE,
        messages=messages,
        channel=channel,
        bindings=OperationBinding.from_sub(operation.bindings),
        summary=None,
        description=None,
        security=None,
        tags=None,
    )

from_pub classmethod #

from_pub(messages, channel, operation)
Source code in faststream/specification/asyncapi/v3_0_0/schema/operations.py
@classmethod
def from_pub(
    cls,
    messages: list[Reference],
    channel: Reference,
    operation: OperationSpec,
) -> Self:
    return cls(
        action=Action.SEND,
        messages=messages,
        channel=channel,
        bindings=OperationBinding.from_pub(operation.bindings),
        summary=None,
        description=None,
        security=None,
        tags=None,
    )