PubsubGrpc.Schema (PubsubGrpc v0.4.2)
View SourceSchema management for Google Cloud Pub/Sub.
Provides functions for managing Pub/Sub schemas, which define the structure and format of messages. Supports Protocol Buffer and Avro formats.
Summary
Functions
Validates a message against an existing schema by name.
Validates a message against an inline schema definition.
Functions
@spec create_schema(String.t(), String.t(), :protocol_buffer | :avro, String.t()) :: {:ok, Google.Pubsub.V1.Schema.t()} | {:error, PubsubGrpc.Error.t()}
@spec delete_schema(String.t(), String.t()) :: :ok | {:error, PubsubGrpc.Error.t()}
@spec get_schema(String.t(), String.t(), keyword()) :: {:ok, Google.Pubsub.V1.Schema.t()} | {:error, PubsubGrpc.Error.t()}
@spec list_schemas( String.t(), keyword() ) :: {:ok, %{schemas: list(), next_page_token: String.t()}} | {:error, PubsubGrpc.Error.t()}
@spec validate_message(String.t(), String.t(), binary(), :json | :binary) :: {:ok, Google.Pubsub.V1.ValidateMessageResponse.t()} | {:error, PubsubGrpc.Error.t()}
Validates a message against an existing schema by name.
Parameters
schema_name- Schema ID or full resource namemessage- Message bytes to validateencoding-:jsonor:binary
@spec validate_message_with_schema( String.t(), :protocol_buffer | :avro, String.t(), binary(), :json | :binary ) :: {:ok, Google.Pubsub.V1.ValidateMessageResponse.t()} | {:error, PubsubGrpc.Error.t()}
Validates a message against an inline schema definition.
Parameters
type-:protocol_bufferor:avrodefinition- Schema definition stringmessage- Message bytes to validateencoding-:jsonor:binary
@spec validate_schema(String.t(), :protocol_buffer | :avro, String.t()) :: {:ok, Google.Pubsub.V1.ValidateSchemaResponse.t()} | {:error, PubsubGrpc.Error.t()}