Skip to main content

Protocol Documentation

Table of Contents

Top

angzarr/cloudevents.proto

CloudEvent

docs:start:cloud_event CloudEvent represents a single event for external consumption.

Client projectors create these by filtering/transforming internal events. Framework fills envelope fields (id, source, time) from Cover/EventPage if not explicitly set by the client.

The data field is a protobuf Any that framework converts to JSON via prost-reflect using the descriptor pool. Clients should pack a "public" proto message that omits sensitive fields.

FieldTypeLabelDescription
typestringEvent type (e.g., "com.example.order.created"). Default: proto type_url suffix from original event.
datagoogle.protobuf.AnyEvent payload as proto Any. Framework converts to JSON for CloudEvents output. Client should filter sensitive fields before packing.
extensionsCloudEvent.ExtensionsEntryrepeatedCustom extension attributes. Keys should follow CloudEvents naming (lowercase, no dots). Framework adds correlationid automatically if present in Cover.
idstringoptionalOptional overrides. Framework uses Cover/EventPage values if not set.

Default: {domain}:{root_id}:{sequence} | | source | string | optional | Default: angzarr/{domain} | | subject | string | optional | Default: aggregate root ID |

CloudEvent.ExtensionsEntry

FieldTypeLabelDescription
keystring
valuestring

CloudEventsResponse

CloudEventsResponse is returned by client projectors in Projection.projection.

Framework detects this type by checking projection.type_url and routes the events to configured sinks (HTTP webhook, Kafka).

Client may return 0 events (skip), 1 event (typical), or N events (fan-out scenarios like multi-tenant notifications).

FieldTypeLabelDescription
eventsCloudEventrepeated

Top

angzarr/command_handler.proto

BusinessResponse

Wrapper response for BusinessLogic.Handle

FieldTypeLabelDescription
eventsEventBookBusiness provides compensation events
revocationRevocationResponseBusiness requests framework action
notificationNotificationForward rejection notification upstream

CommandResponse

Response from entity - aggregate events + sync projector results

FieldTypeLabelDescription
eventsEventBookEvents from the target aggregate
projectionsProjectionrepeatedSynchronous projector results

FactInjectionResponse

docs:start:fact_injection Response from fact injection. Indicates whether facts were newly persisted or already existed (idempotent).

Request uses EventRequest with:

  • events: EventBook containing fact events (with FactSequence markers)
  • sync_mode: Controls sync processing (default: async)
  • route_to_handler: Whether to invoke command handler's handle_fact (default: true)

IMPORTANT: Set Cover.external_id for idempotency. The coordinator uses this to deduplicate fact injections - subsequent requests with the same external_id return the original events without re-persisting.

FieldTypeLabelDescription
eventsEventBookPersisted events with real sequence numbers
already_processedboolTrue if external_id was already seen (idempotent response)
projectionsProjectionrepeatedSynchronous projector results (if any)

ReplayRequest

Request to replay events and compute resulting state

FieldTypeLabelDescription
base_snapshotSnapshotStarting state (empty = initial state)
eventsEventPagerepeatedEvents to apply in order

ReplayResponse

Response with computed state after replay

FieldTypeLabelDescription
stategoogle.protobuf.AnyResulting state

RevocationResponse

client logic requests framework to handle revocation

FieldTypeLabelDescription
emit_system_revocationboolEmit SagaCompensationFailed event
send_to_dead_letter_queueboolSend to DLQ
escalateboolFlag for alerting/human intervention
abortboolStop saga chain, propagate error to caller
reasonstringContext/reason

SpeculateCommandHandlerRequest

Request for speculative command execution against temporal state.

FieldTypeLabelDescription
commandCommandBook
point_in_timeTemporalQuery

CommandHandlerCoordinatorService

CommandHandlerCoordinatorService: orchestrates command processing for domain aggregates

Method NameRequest TypeResponse TypeDescription
HandleCommandCommandRequestCommandResponseProcess command with optional sync mode (default: async fire-and-forget)
HandleEventEventRequestFactInjectionResponseInject fact events - external realities that cannot be rejected. Idempotent: subsequent requests with same external_id return original events. Use EventRequest.route_to_handler to control command handler invocation.
HandleSyncSpeculativeSpeculateCommandHandlerRequestCommandResponseSpeculative execution - execute against temporal state without persisting
HandleCompensationCommandRequestBusinessResponseCompensation flow - returns BusinessResponse for saga compensation handling. If business returns events, persists them. Caller handles revocation flags.

CommandHandlerService

CommandHandlerService: client logic that processes commands and emits events Business logic layer that implements command handling for a domain aggregate client logic doesn't care about sync - coordinator decides

Method NameRequest TypeResponse TypeDescription
HandleContextualCommandBusinessResponseProcess command and return business response (events or revocation request)
ReplayReplayRequestReplayResponseReplay events to compute state (for conflict detection) Optional: only needed if aggregate supports MERGE_COMMUTATIVE

Top

angzarr/meta.proto

DeleteEditionEvents

Delete all events for an edition+domain combination. Main timeline ('angzarr' or empty edition name) cannot be deleted.

FieldTypeLabelDescription
editionstringEdition name to delete from
domainstringDomain to delete from

EditionEventsDeleted

Response from edition event deletion.

FieldTypeLabelDescription
editionstring
domainstring
deleted_countuint32
deleted_atstring

Top

angzarr/process_manager.proto

ProcessManagerHandleRequest

Phase 2 request: full context for PM decision.

FieldTypeLabelDescription
triggerEventBookFull state of triggering domain.
process_stateEventBookCurrent process manager state (event-sourced).
destinationsEventBookrepeatedAdditional destinations fetched per Prepare response.

ProcessManagerHandleResponse

Phase 2 response: local events, then remote commands and facts. Execution order: process_events persisted first, then commands sent, then facts injected.

FieldTypeLabelDescription
process_eventsEventBookLocal: Events for the process manager's own domain (non-duplicative workflow state). These are persisted via AggregateCoordinator to the PM's domain.
commandsCommandBookrepeatedRemote: Commands to issue to other aggregates.
factsEventBookrepeatedRemote: Facts to inject to other aggregates. Each EventBook targets a specific aggregate via its Cover.

ProcessManagerPrepareRequest

Phase 1 request: PM declares additional destinations needed.

FieldTypeLabelDescription
triggerEventBookFull state of triggering domain (by correlation_id).
process_stateEventBookCurrent process manager state (by correlation_id). May be empty for new workflow.

ProcessManagerPrepareResponse

Phase 1 response: destinations to fetch before Handle.

FieldTypeLabelDescription
destinationsCoverrepeatedAdditional aggregates needed beyond trigger. Query by correlation_id. Minimize fetches - only declare what's actually needed.

SpeculatePmRequest

Request for speculative PM execution.

FieldTypeLabelDescription
requestProcessManagerHandleRequest

ProcessManagerCoordinatorService

ProcessManagerCoordinatorService: orchestrates PM execution

Method NameRequest TypeResponse TypeDescription
HandleSpeculativeSpeculatePmRequestProcessManagerHandleResponseSpeculative execution - returns commands and events without persisting

ProcessManagerService

ProcessManagerService: stateful coordinator for long-running workflows across multiple aggregates.

WARNING: Only use when saga + queries is insufficient. Consider:

  • Can a simple saga + destination queries solve this?
  • Is the "state" you want to track already derivable from existing aggregates?
  • Are you adding Process Manager because the workflow is genuinely complex?

Process Manager is warranted when:

  • Workflow state is NOT derivable from aggregates (PM owns unique state)
  • You need to query workflow status independently ("show all pending fulfillments")
  • Timeout/scheduling logic is complex enough to merit its own aggregate
  • You must react to events from MULTIPLE domains (saga recommends single domain)

Process Manager IS an aggregate with its own domain, events, and state. It reuses all aggregate infrastructure (EventStore, SnapshotStore, AggregateCoordinator).

Method NameRequest TypeResponse TypeDescription
PrepareProcessManagerPrepareRequestProcessManagerPrepareResponsePhase 1: Declare which additional destinations are needed beyond the trigger. PM automatically receives triggering event's domain state.
HandleProcessManagerHandleRequestProcessManagerHandleResponsePhase 2: Handle with trigger + process state + fetched destinations. Returns commands for other aggregates and events for the PM's own domain.

Top

angzarr/projector.proto

SpeculateProjectorRequest

Request for speculative projector execution.

FieldTypeLabelDescription
eventsEventBook

ProjectorCoordinatorService

ProjectorCoordinatorService: orchestrates projection processing

Method NameRequest TypeResponse TypeDescription
HandleSyncEventRequestProjectionSync processing - returns projection based on sync_mode
HandleEventBook.google.protobuf.EmptyAsync processing - fire and forget
HandleSpeculativeSpeculateProjectorRequestProjectionSpeculative processing - returns projection without side effects

ProjectorService

ProjectorService: client logic that projects events to read models client logic doesn't care about sync - coordinator decides

Method NameRequest TypeResponse TypeDescription
HandleEventBookProjectionAsync projection - projector should persist and return
HandleSpeculativeEventBookProjectionSpeculative processing - projector must avoid external side effects

Top

angzarr/query.proto

EventQueryService

EventQueryService: query interface for retrieving events

Method NameRequest TypeResponse TypeDescription
GetEventBookQueryEventBookGet a single EventBook (unary) - use for explicit queries with gRPC tooling
GetEventsQueryEventBook streamStream EventBooks matching query - use for bulk retrieval (SSE)
SynchronizeQuery streamEventBook streamBidirectional sync - not exposed via REST (use gRPC directly)
GetAggregateRoots.google.protobuf.EmptyAggregateRoot streamList all aggregate roots (SSE)

Top

angzarr/saga.proto

SagaCompensationFailed

System event when compensation fails/requested

FieldTypeLabelDescription
triggering_aggregateCover
triggering_event_sequenceuint32
saga_namestring
rejection_reasonstring
compensation_failure_reasonstring
rejected_commandCommandBook
occurred_atgoogle.protobuf.Timestamp

SagaExecuteRequest

FieldTypeLabelDescription
sourceEventBookSource events (same as prepare)
destinationsEventBookrepeatedFetched destination state

SagaPrepareRequest

Two-phase saga protocol messages

FieldTypeLabelDescription
sourceEventBookSource events that triggered the saga

SagaPrepareResponse

FieldTypeLabelDescription
destinationsCoverrepeatedDestination aggregates the saga needs to read

SagaResponse

Response from saga - commands for other aggregates

FieldTypeLabelDescription
commandsCommandBookrepeatedCommands to execute on other aggregates
eventsEventBookrepeatedEvents to publish directly

SagaRetryRequest

FieldTypeLabelDescription
sourceEventBook
destinationsEventBookrepeated
rejected_commandCommandBook
rejection_reasonstring
attemptuint32

SpeculateSagaRequest

Request for speculative saga execution.

FieldTypeLabelDescription
requestSagaExecuteRequest

SagaCoordinatorService

SagaCoordinatorService: orchestrates saga execution

Method NameRequest TypeResponse TypeDescription
ExecuteSagaExecuteRequestSagaResponseAsync processing - fire and forget
ExecuteSpeculativeSpeculateSagaRequestSagaResponseSpeculative execution - returns commands without side effects

SagaService

SagaService: client logic that coordinates across aggregates Two-phase protocol: Prepare (declare destinations) → Execute (with fetched state)

Method NameRequest TypeResponse TypeDescription
PrepareSagaPrepareRequestSagaPrepareResponsePhase 1: Saga declares which destination aggregates it needs
ExecuteSagaExecuteRequestSagaResponsePhase 2: Execute with source + fetched destination state

Top

angzarr/stream.proto

EventStreamService

docs:start:event_stream_service EventStreamService: streams events to registered subscribers

Method NameRequest TypeResponse TypeDescription
SubscribeEventStreamFilterEventBook streamSubscribe to events matching correlation ID (required) Returns INVALID_ARGUMENT if correlation_id is empty REST: Server-Sent Events (SSE) stream

Top

angzarr/types.proto

AggregateRoot

FieldTypeLabelDescription
domainstring
rootUUID

AngzarrDeadLetter

docs:start:dead_letter Dead letter queue entry for failed messages requiring manual intervention. Per-domain topics: angzarr.dlq.{domain}

FieldTypeLabelDescription
coverCoverRouting: domain, root, correlation_id
rejected_commandCommandBookCommand that failed
rejected_eventsEventBookEvents that failed (saga/projector failures)
rejection_reasonstringHuman-readable reason
sequence_mismatchSequenceMismatchDetailsSequence conflict details
event_processing_failedEventProcessingFailedDetailsHandler failure details
payload_retrieval_failedPayloadRetrievalFailedDetailsPayload store failure details
occurred_atgoogle.protobuf.Timestamp
metadataAngzarrDeadLetter.MetadataEntryrepeatedAdditional context
source_componentstringWhich component sent to DLQ
source_component_typestring"aggregate"

AngzarrDeadLetter.MetadataEntry

FieldTypeLabelDescription
keystring
valuestring

CommandBook

FieldTypeLabelDescription
coverCover
pagesCommandPagerepeated
saga_originSagaCommandOriginField 3 removed: correlation_id moved to Cover

Tracks origin for compensation flow |

CommandPage

FieldTypeLabelDescription
sequenceuint32Expected sequence number for this command's events. Must match the aggregate's current next sequence (i.e., events.len()). For new aggregates, use 0.
merge_strategyMergeStrategy
commandgoogle.protobuf.Any
externalPayloadReferenceClaim check: payload stored externally

CommandRequest

Request wrapper for command operations. Adds execution metadata (sync_mode) to CommandBook.

FieldTypeLabelDescription
commandCommandBook
sync_modeSyncMode

ComponentDescriptor

Component self-description.

FieldTypeLabelDescription
namestring
component_typestring
inputsTargetrepeatedDomains I subscribe to (event types I consume)

ContextualCommand

FieldTypeLabelDescription
eventsEventBookPassed from aggregate coordinator to aggregate, consists of everything needed to execute/evaluate the command
commandCommandBook

ContextualCommandRequest

Request wrapper for contextual command operations (internal use). Adds execution metadata (sync_mode) to ContextualCommand.

FieldTypeLabelDescription
commandContextualCommand
sync_modeSyncMode

Cover

docs:start:cover

FieldTypeLabelDescription
domainstring
rootUUID
correlation_idstringWorkflow correlation - flows through all commands/events
editionEditionEdition for diverged timelines; empty name = main timeline
external_idstringIdempotency key for fact events (e.g., Stripe payment ID, tracking number)

DomainDivergence

Explicit divergence point for a specific domain. Used when creating historical branches or coordinating saga writes across domains.

FieldTypeLabelDescription
domainstringDomain name
sequenceuint32Divergence sequence number

Edition

docs:start:edition Edition identifier with optional explicit divergence points.

Two modes:

  • Implicit (divergences empty): Divergence derived from first edition event's sequence
  • Explicit (divergences populated): Per-domain divergence points for historical branching, saga coordination, or speculative execution
FieldTypeLabelDescription
namestringEdition name, e.g., "v2"; empty = main timeline
divergencesDomainDivergencerepeatedOptional: explicit per-domain divergence points

EventBook

docs:start:event_book

FieldTypeLabelDescription
coverCover
snapshotSnapshotSnapshot state; sequence computed by framework on persist
pagesEventPagerepeated
next_sequenceuint32Field 4 removed: correlation_id moved to Cover Field 5 removed: snapshot_state unified into snapshot field

Computed on load, never stored: (last page seq OR snapshot seq if no pages) + 1 |

EventPage

docs:start:event_page

FieldTypeLabelDescription
sequenceuint32Normal: explicit position in event stream
factFactSequenceFact: coordinator assigns next sequence
created_atgoogle.protobuf.Timestamp
eventgoogle.protobuf.Any
externalPayloadReferenceClaim check: payload stored externally

EventProcessingFailedDetails

Event processing failure details for DLQ entries. Contains information about why a saga/projector failed to process events.

FieldTypeLabelDescription
errorstringError message from the handler
retry_countuint32Number of retry attempts before DLQ routing
is_transientboolWhether the failure is considered transient

EventRequest

Request wrapper for event operations (fact injection). Adds execution metadata (sync_mode, route_to_handler) to EventBook.

FieldTypeLabelDescription
eventsEventBook
sync_modeSyncMode
route_to_handlerboolFor fact injection: when true (default), invokes command handler's handle_fact for validation/error checking before persistence. Facts cannot be rejected, but the handler can validate data integrity and log warnings. When false, facts are persisted directly without handler involvement.

EventStreamFilter

docs:start:event_stream_filter Subscription filter for event streaming

FieldTypeLabelDescription
correlation_idstring

FactSequence

docs:start:fact_sequence Marker for fact events - external realities that must be recorded. Facts are events that already happened in the external world and cannot be rejected. The coordinator assigns the actual sequence number on receipt.

IMPORTANT: When using FactSequence, set Cover.external_id for idempotency. The coordinator uses Cover.external_id to deduplicate fact events. Cover.external_id propagates through the entire system for tracing.

FieldTypeLabelDescription
sourcestringOrigin system identifier (e.g., "stripe", "fedex", "scheduler")
descriptionstringHuman-readable description of why this is a fact (optional)

GetDescriptorRequest

Request for GetDescriptor RPC.

Notification

docs:start:notification Base notification message for transient system signals. Contains routing info via Cover but no persistence semantics. Type discrimination via payload.type_url (standard Any behavior).

FieldTypeLabelDescription
coverCoverRouting: domain, root, correlation_id
payloadgoogle.protobuf.AnyType-specific content (RejectionNotification, etc.)
sent_atgoogle.protobuf.TimestampWhen notification was created
metadataNotification.MetadataEntryrepeatedOptional key-value metadata

Notification.MetadataEntry

FieldTypeLabelDescription
keystring
valuestring

PayloadReference

Reference to externally stored payload (claim check pattern). Used when event/command payloads exceed message bus size limits.

FieldTypeLabelDescription
storage_typePayloadStorageType
uristringLocation URI: - file:///var/angzarr/payloads/{hash}.bin - gs://bucket/prefix/{hash}.bin - s3://bucket/prefix/{hash}.bin
content_hashbytesContent hash for integrity verification and deduplication (SHA-256)
original_sizeuint64Original serialized payload size in bytes
stored_atgoogle.protobuf.TimestampTimestamp when payload was stored (for TTL cleanup)

PayloadRetrievalFailedDetails

Payload retrieval failure details for DLQ entries. Contains information about why an externally stored payload couldn't be retrieved.

FieldTypeLabelDescription
storage_typePayloadStorageTypeStorage backend type
uristringURI of the payload that couldn't be retrieved
content_hashbytesContent hash for identification
original_sizeuint64Original payload size in bytes
errorstringError message from the retrieval attempt

Projection

FieldTypeLabelDescription
coverCover
projectorstring
sequenceuint32
projectiongoogle.protobuf.Any

Query

FieldTypeLabelDescription
coverCoverCover identifies the aggregate: domain + (root
rangeSequenceRange
sequencesSequenceSet
temporalTemporalQuery

RejectionNotification

docs:start:rejection_notification Notification payload for command rejection scenarios. Embedded in Notification.payload when a saga/PM command is rejected.

FieldTypeLabelDescription
rejected_commandCommandBookThe command that was rejected (full context)
rejection_reasonstringWhy: "insufficient_funds", "out_of_stock", etc.
issuer_namestringSaga/PM name that issued the command
issuer_typestring"saga"
source_aggregateCoverAggregate that originally triggered the flow
source_event_sequenceuint32Event sequence that triggered the saga/PM

SagaCommandOrigin

Track saga command origin for compensation flow

FieldTypeLabelDescription
saga_namestringName of the saga that issued the command
triggering_aggregateCoverDomain+root of aggregate that triggered the saga
triggering_event_sequenceuint32Sequence number of the triggering event

SequenceMismatchDetails

docs:start:dlq_details Sequence mismatch details for DLQ entries. Contains expected vs actual sequence for debugging and replay.

FieldTypeLabelDescription
expected_sequenceuint32What the command expected
actual_sequenceuint32What the aggregate was at
merge_strategyMergeStrategyStrategy that triggered DLQ routing

SequenceRange

Query types

FieldTypeLabelDescription
loweruint32
upperuint32optionalIf not set, query to latest

SequenceSet

FieldTypeLabelDescription
valuesuint32repeated

Snapshot

docs:start:aggregate_snapshot Snapshot of aggregate state at a given sequence number. State must be a protobuf Message to serialize into Any.

FieldTypeLabelDescription
sequenceuint32
stategoogle.protobuf.Any
retentionSnapshotRetentionControls cleanup behavior

Target

Describes what a component subscribes to. Topology edges derived from inputs: if A subscribes to domain X, edge X→A exists.

FieldTypeLabelDescription
domainstring

TemporalQuery

Temporal query: retrieve aggregate state at a point in history. Replays events from sequence 0 (no snapshots) to the specified point.

FieldTypeLabelDescription
as_of_timegoogle.protobuf.TimestampEvents with created_at <= this
as_of_sequenceuint32Events with sequence <= this

UUID

FieldTypeLabelDescription
valuebytes

MergeStrategy

docs:start:merge_strategy Controls how concurrent commands to the same aggregate are handled

NameNumberDescription
MERGE_COMMUTATIVE0Default: allow if state field mutations don't overlap
MERGE_STRICT1Reject if sequence mismatch (optimistic concurrency)
MERGE_AGGREGATE_HANDLES2Aggregate handles its own concurrency
MERGE_MANUAL3Send to DLQ for manual review on mismatch

PayloadStorageType

docs:start:payload_reference Storage backend type for externally stored payloads (claim check pattern).

NameNumberDescription
PAYLOAD_STORAGE_TYPE_UNSPECIFIED0
PAYLOAD_STORAGE_TYPE_FILESYSTEM1
PAYLOAD_STORAGE_TYPE_GCS2
PAYLOAD_STORAGE_TYPE_S33

SnapshotRetention

docs:start:snapshot_retention Controls snapshot retention during cleanup

NameNumberDescription
RETENTION_DEFAULT0Persist every 16 events, treated as TRANSIENT otherwise
RETENTION_PERSIST1Keep indefinitely (business milestone)
RETENTION_TRANSIENT2Delete when newer snapshot written

SyncMode

docs:start:sync_mode Controls synchronous processing behavior

NameNumberDescription
SYNC_MODE_UNSPECIFIED0Async: fire and forget (default)
SYNC_MODE_SIMPLE1Sync projectors only, no saga cascade
SYNC_MODE_CASCADE2Full sync: projectors + saga cascade (expensive)

Top

angzarr/upcaster.proto

UpcastRequest

FieldTypeLabelDescription
domainstring
eventsEventPagerepeated

UpcastResponse

FieldTypeLabelDescription
eventsEventPagerepeated

UpcasterService

UpcasterService: transforms old event versions to current versions Implemented by the client alongside AggregateService on the same gRPC server. Optionally can be deployed as a separate binary for testing or complex migrations.

Method NameRequest TypeResponse TypeDescription
UpcastUpcastRequestUpcastResponseTransform events to current version Returns events in same order, transformed where applicable

Top

examples/ai_sidecar.proto

ActionHistory

FieldTypeLabelDescription
player_rootbytes
actionActionType
amountint64
phaseBettingPhase

ActionRequest

FieldTypeLabelDescription
model_idstringGame state

Which model to use | | game_variant | GameVariant | | | | phase | BettingPhase | | | | hole_cards | Card | repeated | Cards | | community_cards | Card | repeated | | | pot_size | int64 | | Betting context | | stack_size | int64 | | | | amount_to_call | int64 | | | | min_raise | int64 | | | | max_raise | int64 | | | | position | int32 | | Position info

0 = button, increasing = earlier | | players_remaining | int32 | | | | players_to_act | int32 | | | | action_history | ActionHistory | repeated | Historical context (for recurrent models) | | opponents | OpponentStats | repeated | Opponent modeling (optional) |

ActionResponse

FieldTypeLabelDescription
recommended_actionActionType
amountint64For bet/raise
fold_probabilityfloatConfidence scores for each action (for analysis)
check_call_probabilityfloat
bet_raise_probabilityfloat
model_versionstringModel metadata
inference_time_msint64

BatchActionRequest

FieldTypeLabelDescription
requestsActionRequestrepeated

BatchActionResponse

FieldTypeLabelDescription
responsesActionResponserepeated

HealthRequest

HealthResponse

FieldTypeLabelDescription
healthybool
model_idstring
model_versionstring
uptime_secondsint64
requests_servedint64

OpponentStats

FieldTypeLabelDescription
player_rootbytes
positionint32
stackint64
vpipfloatVoluntarily put in pot %
pfrfloatPre-flop raise %
aggressionfloatBet/raise frequency
hands_playedint32

AiSidecar

Method NameRequest TypeResponse TypeDescription
GetActionActionRequestActionResponseGet recommended action from the AI model
HealthHealthRequestHealthResponseHealth check
GetActionsBatchBatchActionRequestBatchActionResponseBatch inference for training/simulation

Top

examples/hand.proto

ActionTaken

FieldTypeLabelDescription
player_rootbytes
actionActionType
amountint64
player_stackint64Absolute stack after action
pot_totalint64Absolute pot after action
amount_to_callint64Current call amount for next player
action_atgoogle.protobuf.Timestamp

AwardPot

FieldTypeLabelDescription
awardsPotAwardrepeated

BettingRoundComplete

FieldTypeLabelDescription
completed_phaseBettingPhase
pot_totalint64
stacksPlayerStackSnapshotrepeated
completed_atgoogle.protobuf.Timestamp

BlindPosted

FieldTypeLabelDescription
player_rootbytes
blind_typestring
amountint64
player_stackint64Absolute stack after posting
pot_totalint64Absolute pot after posting
posted_atgoogle.protobuf.Timestamp

CardsDealt

FieldTypeLabelDescription
table_rootbytes
hand_numberint64
game_variantGameVariant
player_cardsPlayerHoleCardsrepeated
dealer_positionint32
playersPlayerInHandrepeated
dealt_atgoogle.protobuf.Timestamp
remaining_deckCardrepeatedCards left after dealing hole cards

CardsMucked

FieldTypeLabelDescription
player_rootbytes
mucked_atgoogle.protobuf.Timestamp

CardsRevealed

FieldTypeLabelDescription
player_rootbytes
cardsCardrepeated
rankingHandRanking
revealed_atgoogle.protobuf.Timestamp

CommunityCardsDealt

FieldTypeLabelDescription
cardsCardrepeated
phaseBettingPhaseFLOP, TURN, or RIVER
all_community_cardsCardrepeatedFull board so far
dealt_atgoogle.protobuf.Timestamp

DealCards

FieldTypeLabelDescription
table_rootbytes
hand_numberint64
game_variantGameVariant
playersPlayerInHandrepeated
dealer_positionint32
small_blindint64
big_blindint64
deck_seedbytesFor deterministic shuffle (testing)

DealCommunityCards

FieldTypeLabelDescription
countint323 for flop, 1 for turn/river

DrawCompleted

FieldTypeLabelDescription
player_rootbytes
cards_discardedint32
cards_drawnint32
new_cardsCardrepeatedOnly visible to this player
drawn_atgoogle.protobuf.Timestamp

HandComplete

FieldTypeLabelDescription
table_rootbytes
hand_numberint64
winnersPotWinnerrepeated
final_stacksPlayerStackSnapshotrepeated
completed_atgoogle.protobuf.Timestamp

HandState

State (for snapshots)

FieldTypeLabelDescription
hand_idstring
table_rootbytes
hand_numberint64
game_variantGameVariant
remaining_deckCardrepeatedDeck state
playersPlayerHandStaterepeatedPlayer state
community_cardsCardrepeatedCommunity cards
current_phaseBettingPhaseBetting state
action_on_positionint32
current_betint64
min_raiseint64
potsPotrepeated
dealer_positionint32Positions
small_blind_positionint32
big_blind_positionint32
statusstring"dealing", "betting", "showdown", "complete"

PlayerAction

FieldTypeLabelDescription
player_rootbytes
actionActionType
amountint64For bet/raise/call

PlayerHandState

FieldTypeLabelDescription
player_rootbytes
positionint32
hole_cardsCardrepeated
stackint64
bet_this_roundint64
total_investedint64
has_actedbool
has_foldedbool
is_all_inbool

PlayerHoleCards

FieldTypeLabelDescription
player_rootbytes
cardsCardrepeated

PlayerInHand

FieldTypeLabelDescription
player_rootbytes
positionint32
stackint64

PlayerStackSnapshot

FieldTypeLabelDescription
player_rootbytes
stackint64
is_all_inbool
has_foldedbool

PlayerTimedOut

FieldTypeLabelDescription
player_rootbytes
default_actionActionTypeUsually FOLD or CHECK
timed_out_atgoogle.protobuf.Timestamp

PostBlind

FieldTypeLabelDescription
player_rootbytes
blind_typestring"small", "big", "ante"
amountint64

PotAward

FieldTypeLabelDescription
player_rootbytes
amountint64
pot_typestring

PotAwarded

FieldTypeLabelDescription
winnersPotWinnerrepeated
awarded_atgoogle.protobuf.Timestamp

PotWinner

FieldTypeLabelDescription
player_rootbytes
amountint64
pot_typestring
winning_handHandRanking

RequestDraw

FieldTypeLabelDescription
player_rootbytes
card_indicesint32repeatedWhich cards to discard (0-indexed)

RevealCards

FieldTypeLabelDescription
player_rootbytes
muckboolTrue to hide cards (fold at showdown)

ShowdownStarted

FieldTypeLabelDescription
players_to_showbytesrepeatedOrder of revelation
started_atgoogle.protobuf.Timestamp

Top

examples/player.proto

ActionRequested

Emitted when action is needed - AI players respond via sidecar

FieldTypeLabelDescription
hand_rootbytes
table_rootbytes
player_rootbytes
player_typePlayerType
amount_to_callint64
min_raiseint64
max_raiseint64
hole_cardsCardrepeated
community_cardsCardrepeated
pot_sizeint64
phaseBettingPhase
deadlinegoogle.protobuf.Timestamp

DepositFunds

FieldTypeLabelDescription
amountCurrency

FundsDeposited

FieldTypeLabelDescription
amountCurrency
new_balanceCurrencyAbsolute value after deposit
deposited_atgoogle.protobuf.Timestamp

FundsReleased

FieldTypeLabelDescription
amountCurrency
table_rootbytes
new_available_balanceCurrency
new_reserved_balanceCurrency
released_atgoogle.protobuf.Timestamp

FundsReserved

FieldTypeLabelDescription
amountCurrency
table_rootbytes
new_available_balanceCurrencyBankroll minus reserved
new_reserved_balanceCurrencyTotal reserved across tables
reserved_atgoogle.protobuf.Timestamp

FundsTransferred

FieldTypeLabelDescription
from_player_rootbytes
to_player_rootbytes
amountCurrency
hand_rootbytes
reasonstring
new_balanceCurrencyRecipient's new balance
transferred_atgoogle.protobuf.Timestamp

FundsWithdrawn

FieldTypeLabelDescription
amountCurrency
new_balanceCurrencyAbsolute value after withdrawal
withdrawn_atgoogle.protobuf.Timestamp

PlayerRegistered

FieldTypeLabelDescription
display_namestring
emailstring
player_typePlayerType
ai_model_idstring
registered_atgoogle.protobuf.Timestamp

PlayerReturningToPlay

Player has chosen to return to play at a table

FieldTypeLabelDescription
table_rootbytes
sat_in_atgoogle.protobuf.Timestamp

PlayerSittingOut

Player has chosen to sit out at a table

FieldTypeLabelDescription
table_rootbytes
sat_out_atgoogle.protobuf.Timestamp

PlayerState

State (for snapshots)

FieldTypeLabelDescription
player_idstring
display_namestring
emailstring
player_typePlayerType
ai_model_idstring
bankrollCurrency
reserved_fundsCurrency
table_reservationsPlayerState.TableReservationsEntryrepeatedtable_root_hex -> amount
statusstring"active", "suspended", etc.

PlayerState.TableReservationsEntry

FieldTypeLabelDescription
keystring
valueint64

RegisterPlayer

FieldTypeLabelDescription
display_namestring
emailstringUsed for root derivation
player_typePlayerTypeHUMAN or AI
ai_model_idstringFor AI players: which model to use

ReleaseFunds

Release reserved funds back to bankroll (leave table)

FieldTypeLabelDescription
table_rootbytes

RequestAction

Request action from player (triggers AI sidecar for AI players)

FieldTypeLabelDescription
hand_rootbytes
table_rootbytes
amount_to_callint64
min_raiseint64
max_raiseint64Player's remaining stack
hole_cardsCardrepeated
community_cardsCardrepeated
pot_sizeint64
phaseBettingPhase
timeout_secondsint32

ReserveFunds

Reserve funds when joining a table (buy-in)

FieldTypeLabelDescription
amountCurrency
table_rootbytesWhich table the funds are reserved for

SitIn

Player decides to return to play at a table

FieldTypeLabelDescription
table_rootbytes

SitOut

Player decides to sit out at a table (stop receiving hands)

FieldTypeLabelDescription
table_rootbytes

TransferFunds

Transfer funds from one player to another (pot award)

FieldTypeLabelDescription
from_player_rootbytesSource player (for reserved funds)
amountCurrency
hand_rootbytesWhich hand this transfer is for
reasonstring"pot_win", "side_pot_win", etc.

WithdrawFunds

FieldTypeLabelDescription
amountCurrency

Top

examples/poker_types.proto

Card

Card representation

FieldTypeLabelDescription
suitSuit
rankRank

Currency

Currency amount (in smallest unit, e.g., cents)

FieldTypeLabelDescription
amountint64
currency_codestring"USD", "EUR", "CHIPS"

HandRanking

Hand ranking result

FieldTypeLabelDescription
rank_typeHandRankType
kickersRankrepeatedFor tie-breaking
scoreint32Numeric score for comparison

Pot

Pot structure (for side pots)

FieldTypeLabelDescription
amountint64
eligible_playersbytesrepeatedPlayer roots eligible for this pot
pot_typestring"main" or "side_N"

Seat

Position at table

FieldTypeLabelDescription
positionint320-9 for 10-max table
player_rootbytesPlayer aggregate root
stackCurrencyCurrent stack at table
is_activeboolStill in current hand
is_sitting_outboolTemporarily away

ActionType

Player action type

NameNumberDescription
ACTION_UNSPECIFIED0
FOLD1
CHECK2
CALL3
BET4
RAISE5
ALL_IN6

BettingPhase

Betting round phase

NameNumberDescription
BETTING_PHASE_UNSPECIFIED0
PREFLOP1
FLOP2
TURN3
RIVER4
DRAW5For draw games
SHOWDOWN6

GameVariant

Game variant configuration

NameNumberDescription
GAME_VARIANT_UNSPECIFIED0
TEXAS_HOLDEM1
OMAHA2
FIVE_CARD_DRAW3
SEVEN_CARD_STUD4

HandRankType

NameNumberDescription
HAND_RANK_UNSPECIFIED0
HIGH_CARD1
PAIR2
TWO_PAIR3
THREE_OF_A_KIND4
STRAIGHT5
FLUSH6
FULL_HOUSE7
FOUR_OF_A_KIND8
STRAIGHT_FLUSH9
ROYAL_FLUSH10

PlayerType

Player type - abstraction for human vs AI

NameNumberDescription
PLAYER_TYPE_UNSPECIFIED0
HUMAN1
AI2

Rank

NameNumberDescription
RANK_UNSPECIFIED0
TWO2
THREE3
FOUR4
FIVE5
SIX6
SEVEN7
EIGHT8
NINE9
TEN10
JACK11
QUEEN12
KING13
ACE14

Suit

NameNumberDescription
SUIT_UNSPECIFIED0
CLUBS1
DIAMONDS2
HEARTS3
SPADES4

Top

examples/table.proto

AddChips

FieldTypeLabelDescription
player_rootbytes
amountint64

ChipsAdded

FieldTypeLabelDescription
player_rootbytes
amountint64
new_stackint64Absolute stack after add
added_atgoogle.protobuf.Timestamp

CreateTable

FieldTypeLabelDescription
table_namestring
game_variantGameVariant
small_blindint64
big_blindint64
min_buy_inint64
max_buy_inint64
max_playersint322-10
action_timeout_secondsint32

EndHand

FieldTypeLabelDescription
hand_rootbytes
resultsPotResultrepeated

HandEnded

FieldTypeLabelDescription
hand_rootbytes
resultsPotResultrepeated
stack_changesHandEnded.StackChangesEntryrepeatedplayer_root_hex -> delta
ended_atgoogle.protobuf.Timestamp

HandEnded.StackChangesEntry

FieldTypeLabelDescription
keystring
valueint64

HandStarted

FieldTypeLabelDescription
hand_rootbytesNew hand aggregate root
hand_numberint64
dealer_positionint32
small_blind_positionint32
big_blind_positionint32
active_playersSeatSnapshotrepeated
game_variantGameVariant
small_blindint64
big_blindint64
started_atgoogle.protobuf.Timestamp

JoinTable

FieldTypeLabelDescription
player_rootbytes
preferred_seatint32-1 for any available
buy_in_amountint64

LeaveTable

FieldTypeLabelDescription
player_rootbytes

PlayerJoined

FieldTypeLabelDescription
player_rootbytes
seat_positionint32
buy_in_amountint64
stackint64Absolute stack after buy-in
joined_atgoogle.protobuf.Timestamp

PlayerLeft

FieldTypeLabelDescription
player_rootbytes
seat_positionint32
chips_cashed_outint64
left_atgoogle.protobuf.Timestamp

PlayerSatIn

FieldTypeLabelDescription
player_rootbytes
sat_in_atgoogle.protobuf.Timestamp

PlayerSatOut

FieldTypeLabelDescription
player_rootbytes
sat_out_atgoogle.protobuf.Timestamp

PotResult

FieldTypeLabelDescription
winner_rootbytes
amountint64
pot_typestring"main" or "side_N"
winning_handHandRanking

SeatSnapshot

FieldTypeLabelDescription
positionint32
player_rootbytes
stackint64

StartHand

No parameters - uses current table state Dealer button advances automatically

TableCreated

FieldTypeLabelDescription
table_namestring
game_variantGameVariant
small_blindint64
big_blindint64
min_buy_inint64
max_buy_inint64
max_playersint32
action_timeout_secondsint32
created_atgoogle.protobuf.Timestamp

TableState

State (for snapshots)

FieldTypeLabelDescription
table_idstring
table_namestring
game_variantGameVariant
small_blindint64
big_blindint64
min_buy_inint64
max_buy_inint64
max_playersint32
action_timeout_secondsint32
seatsSeatrepeated
dealer_positionint32
hand_countint64
current_hand_rootbytes
statusstring"waiting", "in_hand", "paused"

Top

google/api/annotations.proto

File-level Extensions

ExtensionTypeBaseNumberDescription
httpHttpRule.google.protobuf.MethodOptions72295728See HttpRule.

Top

google/api/http.proto

CustomHttpPattern

A custom pattern is used for defining custom HTTP verb.

FieldTypeLabelDescription
kindstringThe name of this custom HTTP verb.
pathstringThe path matched by this custom verb.

Http

Defines the HTTP configuration for an API service. It contains a list of [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method to one or more HTTP REST API methods.

FieldTypeLabelDescription
rulesHttpRulerepeatedA list of HTTP configuration rules that apply to individual API methods.

NOTE: All service configuration rules follow "last one wins" order. | | fully_decode_reserved_expansion | bool | | When set to true, URL path parameters will be fully URI-decoded except in cases of single segment matches in reserved expansion, where "%2F" will be left encoded.

The default behavior is to not decode RFC 6570 reserved characters in multi segment matches. |

HttpRule

gRPC Transcoding

gRPC Transcoding is a feature for mapping between a gRPC method and one or more HTTP REST endpoints. It allows developers to build a single API service that supports both gRPC APIs and REST APIs. Many systems, including Google APIs, Cloud Endpoints, gRPC Gateway, and Envoy proxy support this feature and use it for large scale production services.

HttpRule defines the schema of the gRPC/REST mapping. The mapping specifies how different portions of the gRPC request message are mapped to the URL path, URL query parameters, and HTTP request body. It also controls how the gRPC response message is mapped to the HTTP response body. HttpRule is typically specified as an google.api.http annotation on the gRPC method.

Each mapping specifies a URL path template and an HTTP method. The path template may refer to one or more fields in the gRPC request message, as long as each field is a non-repeated field with a primitive (non-message) type. The path template controls how fields of the request message are mapped to the URL path.

Example:

service Messaging { rpc GetMessage(GetMessageRequest) returns (Message) { option (google.api.http) = { get: "/v1/{name=messages/*}" }; } } message GetMessageRequest { string name = 1; // Mapped to URL path. } message Message { string text = 1; // The resource content. }

This enables an HTTP REST to gRPC mapping as below:

  • HTTP: GET /v1/messages/123456
  • gRPC: GetMessage(name: &#34;messages/123456&#34;)

Any fields in the request message which are not bound by the path template automatically become HTTP query parameters if there is no HTTP request body. For example:

service Messaging { rpc GetMessage(GetMessageRequest) returns (Message) { option (google.api.http) = { get:"/v1/messages/{message_id}" }; } } message GetMessageRequest { message SubMessage { string subfield = 1; } string message_id = 1; // Mapped to URL path. int64 revision = 2; // Mapped to URL query parameter revision. SubMessage sub = 3; // Mapped to URL query parameter sub.subfield. }

This enables a HTTP JSON to RPC mapping as below:

  • HTTP: GET /v1/messages/123456?revision=2&amp;sub.subfield=foo
  • gRPC: GetMessage(message_id: &#34;123456&#34; revision: 2 sub: SubMessage(subfield: &#34;foo&#34;))

Note that fields which are mapped to URL query parameters must have a primitive type or a repeated primitive type or a non-repeated message type. In the case of a repeated type, the parameter can be repeated in the URL as ...?param=A&amp;param=B. In the case of a message type, each field of the message is mapped to a separate parameter, such as ...?foo.a=A&amp;foo.b=B&amp;foo.c=C.

For HTTP methods that allow a request body, the body field specifies the mapping. Consider a REST update method on the message resource collection:

service Messaging { rpc UpdateMessage(UpdateMessageRequest) returns (Message) { option (google.api.http) = { patch: "/v1/messages/{message_id}" body: "message" }; } } message UpdateMessageRequest { string message_id = 1; // mapped to the URL Message message = 2; // mapped to the body }

The following HTTP JSON to RPC mapping is enabled, where the representation of the JSON in the request body is determined by protos JSON encoding:

  • HTTP: PATCH /v1/messages/123456 \{ &#34;text&#34;: &#34;Hi!&#34; \}
  • gRPC: UpdateMessage(message_id: &#34;123456&#34; message \{ text: &#34;Hi!&#34; \})

The special name * can be used in the body mapping to define that every field not bound by the path template should be mapped to the request body. This enables the following alternative definition of the update method:

service Messaging { rpc UpdateMessage(Message) returns (Message) { option (google.api.http) = { patch: "/v1/messages/{message_id}" body: "*" }; } } message Message { string message_id = 1; string text = 2; }

The following HTTP JSON to RPC mapping is enabled:

  • HTTP: PATCH /v1/messages/123456 \{ &#34;text&#34;: &#34;Hi!&#34; \}
  • gRPC: UpdateMessage(message_id: &#34;123456&#34; text: &#34;Hi!&#34;)

Note that when using * in the body mapping, it is not possible to have HTTP parameters, as all fields not bound by the path end in the body. This makes this option more rarely used in practice when defining REST APIs. The common usage of * is in custom methods which don't use the URL at all for transferring data.

It is possible to define multiple HTTP methods for one RPC by using the additional_bindings option. Example:

service Messaging { rpc GetMessage(GetMessageRequest) returns (Message) { option (google.api.http) = { get: "/v1/messages/{message_id}" additional_bindings { get: "/v1/users/{user_id}/messages/{message_id}" } }; } } message GetMessageRequest { string message_id = 1; string user_id = 2; }

This enables the following two alternative HTTP JSON to RPC mappings:

  • HTTP: GET /v1/messages/123456

  • gRPC: GetMessage(message_id: &#34;123456&#34;)

  • HTTP: GET /v1/users/me/messages/123456

  • gRPC: GetMessage(user_id: &#34;me&#34; message_id: &#34;123456&#34;)

Rules for HTTP mapping

  1. Leaf request fields (recursive expansion nested messages in the request message) are classified into three categories:
    • Fields referred by the path template. They are passed via the URL path.
    • Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They are passed via the HTTP request body.
    • All other fields are passed via the URL query parameters, and the parameter name is the field path in the request message. A repeated field can be represented as multiple query parameters under the same name.
  2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL query parameter, all fields are passed via URL path and HTTP request body.
  3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP request body, all fields are passed via URL path and URL query parameters.

Path template syntax

Template = "/" Segments [ Verb ] ; Segments = Segment { "/" Segment } ; Segment = "*" | "**" | LITERAL | Variable ; Variable = "{" FieldPath [ "=" Segments ] "}" ; FieldPath = IDENT { "." IDENT } ; Verb = ":" LITERAL ;

The syntax * matches a single URL path segment. The syntax ** matches zero or more URL path segments, which must be the last part of the URL path except the Verb.

The syntax Variable matches part of the URL path as specified by its template. A variable template must not contain other variables. If a variable matches a single path segment, its template may be omitted, e.g. \{var\} is equivalent to \{var=*\}.

The syntax LITERAL matches literal text in the URL path. If the LITERAL contains any reserved character, such characters should be percent-encoded before the matching.

If a variable contains exactly one path segment, such as &#34;\{var\}&#34; or &#34;\{var=*\}&#34;, when such a variable is expanded into a URL path on the client side, all characters except [-_.~0-9a-zA-Z] are percent-encoded. The server side does the reverse decoding. Such variables show up in the Discovery Document as \{var\}.

If a variable contains multiple path segments, such as &#34;\{var=foo/*\}&#34; or &#34;\{var=**\}&#34;, when such a variable is expanded into a URL path on the client side, all characters except [-_.~/0-9a-zA-Z] are percent-encoded. The server side does the reverse decoding, except "%2F" and "%2f" are left unchanged. Such variables show up in the Discovery Document as \{&#43;var\}.

Using gRPC API Service Configuration

gRPC API Service Configuration (service config) is a configuration language for configuring a gRPC service to become a user-facing product. The service config is simply the YAML representation of the google.api.Service proto message.

As an alternative to annotating your proto file, you can configure gRPC transcoding in your service config YAML files. You do this by specifying a HttpRule that maps the gRPC method to a REST endpoint, achieving the same effect as the proto annotation. This can be particularly useful if you have a proto that is reused in multiple services. Note that any transcoding specified in the service config will override any matching transcoding configuration in the proto.

The following example selects a gRPC method and applies an HttpRule to it:

http: rules:

  • selector: example.v1.Messaging.GetMessage get: /v1/messages/{message_id}/{sub.subfield}

Special notes

When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the proto to JSON conversion must follow the proto3 specification.

While the single segment variable follows the semantics of RFC 6570 Section 3.2.2 Simple String Expansion, the multi segment variable does not follow RFC 6570 Section 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion does not expand special characters like ? and #, which would lead to invalid URLs. As the result, gRPC Transcoding uses a custom encoding for multi segment variables.

The path variables must not refer to any repeated or mapped field, because client libraries are not capable of handling such variable expansion.

The path variables must not capture the leading "/" character. The reason is that the most common use case "{var}" does not capture the leading "/" character. For consistency, all path variables must share the same behavior.

Repeated message fields must not be mapped to URL query parameters, because no client library can support such complicated mapping.

If an API needs to use a JSON array for request or response body, it can map the request or response body to a repeated field. However, some gRPC Transcoding implementations may not support this feature.

FieldTypeLabelDescription
selectorstringSelects a method to which this rule applies.

Refer to [selector][google.api.DocumentationRule.selector] for syntax details. | | get | string | | Maps to HTTP GET. Used for listing and getting information about resources. | | put | string | | Maps to HTTP PUT. Used for replacing a resource. | | post | string | | Maps to HTTP POST. Used for creating a resource or performing an action. | | delete | string | | Maps to HTTP DELETE. Used for deleting a resource. | | patch | string | | Maps to HTTP PATCH. Used for updating a resource. | | custom | CustomHttpPattern | | The custom pattern is used for specifying an HTTP method that is not included in the pattern field, such as HEAD, or "*" to leave the HTTP method unspecified for this rule. The wild-card rule is useful for services that provide content to Web (HTML) clients. | | body | string | | The name of the request field whose value is mapped to the HTTP request body, or * for mapping all request fields not captured by the path pattern to the HTTP body, or omitted for not having any HTTP request body.

NOTE: the referred field must be present at the top-level of the request message type. | | response_body | string | | Optional. The name of the response field whose value is mapped to the HTTP response body. When omitted, the entire response message will be used as the HTTP response body.

NOTE: The referred field must be present at the top-level of the response message type. | | additional_bindings | HttpRule | repeated | Additional HTTP bindings for the selector. Nested bindings must not contain an additional_bindings field themselves (that is, the nesting may only be one level deep). |

Top

io/cloudevents/v1/cloudevents.proto

CloudEvent

CloudEvent represents a single CloudEvent in protobuf format.

FieldTypeLabelDescription
idstringRequired Attributes
sourcestringURI-reference
spec_versionstring
typestring
attributesCloudEvent.AttributesEntryrepeatedOptional & Extension Attributes
binary_databytesBinary data
text_datastringText data
proto_datagoogle.protobuf.AnyProtobuf message

CloudEvent.AttributesEntry

FieldTypeLabelDescription
keystring
valueCloudEventAttributeValue

CloudEventAttributeValue

CloudEventAttributeValue supports the CloudEvents type system.

FieldTypeLabelDescription
ce_booleanbool
ce_integerint32
ce_stringstring
ce_bytesbytes
ce_uristring
ce_uri_refstring
ce_timestampgoogle.protobuf.Timestamp

CloudEventBatch

CloudEventBatch is a container for multiple CloudEvents.

FieldTypeLabelDescription
eventsCloudEventrepeated

Scalar Value Types

.proto TypeNotesC++JavaPythonGoC#PHPRuby
doubledoubledoublefloatfloat64doublefloatFloat
floatfloatfloatfloatfloat32floatfloatFloat
int32Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead.int32intintint32intintegerBignum or Fixnum (as required)
int64Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead.int64longint/longint64longinteger/stringBignum
uint32Uses variable-length encoding.uint32intint/longuint32uintintegerBignum or Fixnum (as required)
uint64Uses variable-length encoding.uint64longint/longuint64ulonginteger/stringBignum or Fixnum (as required)
sint32Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s.int32intintint32intintegerBignum or Fixnum (as required)
sint64Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s.int64longint/longint64longinteger/stringBignum
fixed32Always four bytes. More efficient than uint32 if values are often greater than 2^28.uint32intintuint32uintintegerBignum or Fixnum (as required)
fixed64Always eight bytes. More efficient than uint64 if values are often greater than 2^56.uint64longint/longuint64ulonginteger/stringBignum
sfixed32Always four bytes.int32intintint32intintegerBignum or Fixnum (as required)
sfixed64Always eight bytes.int64longint/longint64longinteger/stringBignum
boolboolbooleanbooleanboolboolbooleanTrueClass/FalseClass
stringA string must always contain UTF-8 encoded or 7-bit ASCII text.stringStringstr/unicodestringstringstringString (UTF-8)
bytesMay contain any arbitrary sequence of bytes.stringByteStringstr[]byteByteStringstringString (ASCII-8BIT)