class documentation

Data converter for converting and encoding payloads to/from Python values.

This combines PayloadConverter which converts values with PayloadCodec which encodes bytes.

Method __post_init__ Undocumented
Async Method decode Decode payloads into values.
Async Method decode_failure Decode and convert failure.
Async Method decode_wrapper decode for the temporalio.api.common.v1.Payloads wrapper.
Async Method encode Encode values into payloads.
Async Method encode_failure Convert and encode failure.
Async Method encode_wrapper encode for the temporalio.api.common.v1.Payloads wrapper.
Method with_context Return an instance with context set on the component converters.
Class Variable default Singleton default data converter.
Class Variable failure_converter Failure converter created from the failure_converter_class.
Class Variable payload_codec Optional codec for encoding payload bytes.
Class Variable payload_converter Payload converter created from the payload_converter_class.
Class Variable payload_limits Settings for payload size limits.
Async Static Method _apply_to_failure_payloads Undocumented
Static Method _validate_limits Undocumented
Async Method _decode_memo Undocumented
Async Method _decode_memo_field Undocumented
Async Method _decode_payload Undocumented
Async Method _decode_payload_sequence Undocumented
Async Method _decode_payloads Undocumented
Async Method _encode_memo Undocumented
Async Method _encode_memo_existing Undocumented
Async Method _encode_payload Undocumented
Async Method _encode_payload_sequence Undocumented
Async Method _encode_payloads Undocumented
Method _validate_payload_limits Undocumented
Method _with_payload_error_limits Undocumented
Class Variable _payload_error_limits Server-reported limits for payloads.
Property _decode_payload_has_effect Undocumented
def __post_init__(self): (source)

Undocumented

async def decode(self, payloads: Sequence[temporalio.api.common.v1.Payload], type_hints: list[type] | None = None) -> list[Any]: (source)

Decode payloads into values.

First decodes payloads using codec then converts payloads to values.

Parameters
payloads:Sequence[temporalio.api.common.v1.Payload]Payloads to be decoded and converted.
type_hints:list[type] | NoneUndocumented
Returns
list[Any]Decoded and converted values.
async def decode_failure(self, failure: temporalio.api.failure.v1.Failure) -> BaseException: (source)

Decode and convert failure.

async def decode_wrapper(self, payloads: temporalio.api.common.v1.Payloads | None, type_hints: list[type] | None = None) -> list[Any]: (source)
async def encode(self, values: Sequence[Any]) -> list[temporalio.api.common.v1.Payload]: (source)

Encode values into payloads.

First converts values to payloads then encodes payloads using codec.

Parameters
values:Sequence[Any]Values to be converted and encoded.
Returns
list[temporalio.api.common.v1.Payload]Converted and encoded payloads. Note, this does not have to be the same number as values given, but must be at least one and cannot be more than was given.
async def encode_failure(self, exception: BaseException, failure: temporalio.api.failure.v1.Failure): (source)

Convert and encode failure.

async def encode_wrapper(self, values: Sequence[Any]) -> temporalio.api.common.v1.Payloads: (source)
def with_context(self, context: SerializationContext) -> Self: (source)

Return an instance with context set on the component converters.

Singleton default data converter.

failure_converter: FailureConverter = (source)

Failure converter created from the failure_converter_class.

payload_codec: PayloadCodec | None = (source)

Optional codec for encoding payload bytes.

payload_converter: PayloadConverter = (source)

Payload converter created from the payload_converter_class.

Settings for payload size limits.

Undocumented

def _validate_limits(payloads: Sequence[temporalio.api.common.v1.Payload], error_limit: int | None, error_message: str, warning_limit: int, warning_message: str): (source)

Undocumented

async def _decode_memo(self, source: temporalio.api.common.v1.Memo) -> Mapping[str, Any]: (source)

Undocumented

async def _decode_memo_field(self, source: temporalio.api.common.v1.Memo, key: str, default: Any, type_hint: type | None) -> dict[str, Any]: (source)

Undocumented

Undocumented

async def _decode_payload_sequence(self, payloads: Sequence[temporalio.api.common.v1.Payload]) -> list[temporalio.api.common.v1.Payload]: (source)

Undocumented

async def _decode_payloads(self, payloads: temporalio.api.common.v1.Payloads): (source)

Undocumented

async def _encode_memo(self, source: Mapping[str, Any]) -> temporalio.api.common.v1.Memo: (source)

Undocumented

async def _encode_memo_existing(self, source: Mapping[str, Any], memo: temporalio.api.common.v1.Memo): (source)

Undocumented

Undocumented

async def _encode_payload_sequence(self, payloads: Sequence[temporalio.api.common.v1.Payload]) -> list[temporalio.api.common.v1.Payload]: (source)

Undocumented

async def _encode_payloads(self, payloads: temporalio.api.common.v1.Payloads): (source)

Undocumented

def _validate_payload_limits(self, payloads: Sequence[temporalio.api.common.v1.Payload]): (source)

Undocumented

def _with_payload_error_limits(self, limits: _ServerPayloadErrorLimits | None) -> DataConverter: (source)

Undocumented

Server-reported limits for payloads.

_decode_payload_has_effect: bool = (source)

Undocumented