Class AdapterProtocolJson

Namespace
MirrorPulse.Adapter.Sdk
Assembly
MirrorPulse.Adapter.Sdk.dll

Wire names are stable and independent of language-specific DTO names.

public static class AdapterProtocolJson
Inheritance
AdapterProtocolJson
Inherited Members

Methods

Decode<T>(ReadOnlySpan<byte>)

public static T Decode<T>(ReadOnlySpan<byte> bytes)

Parameters

bytes ReadOnlySpan<byte>

Returns

T

Type Parameters

T

Encode<T>(T)

public static byte[] Encode<T>(T value)

Parameters

value T

Returns

byte[]

Type Parameters

T

ReadAddress(JsonElement, int, string?)

Reading a v1 address is allowed only with an explicit single-root binding.

public static AdapterFileAddress ReadAddress(JsonElement payload, int protocolVersion, string? legacyRootKey = null)

Parameters

payload JsonElement
protocolVersion int
legacyRootKey string

Returns

AdapterFileAddress

ToElement<T>(T)

public static JsonElement ToElement<T>(T value)

Parameters

value T

Returns

JsonElement

Type Parameters

T

ValidateMutation(AdapterOperationRequest, bool)

Validates the operation ID, address shapes, required destination and revision length.

public static void ValidateMutation(AdapterOperationRequest request, bool requiresDestination)

Parameters

request AdapterOperationRequest
requiresDestination bool

Remarks

The Worker must separately authorize the roots and enforce the requested conditions before any backend effect.