antimatter.builders.read_context#

Module Contents#

Classes#

ReadContextBuilder

A builder class for constructing a ReadContext object.

class antimatter.builders.read_context.ReadContextBuilder#

A builder class for constructing a ReadContext object.

set_summary(summary: str) ReadContextBuilder#

Sets the summary of the ReadContext.

Parameters:

summary – The summary to set.

Returns:

The instance of the builder.

set_description(description: str) ReadContextBuilder#

Sets the description of the ReadContext.

Parameters:

description – The description to set.

Returns:

The instance of the builder.

add_required_hook(name: antimatter.constants.Hook | str, constraint: str = '>1.0.0', write_context: str = None) ReadContextBuilder#

Adds a required hook to the ReadContext.

Parameters:
  • name – The name of the hook.

  • constraint – The constraint of the hook.

  • write_context – The write context for the hook

Returns:

The instance of the builder.

add_read_parameter(key: str, required: bool, description: str) ReadContextBuilder#

Adds a read parameter to the ReadContext.

Parameters:
  • key – The key of the parameter.

  • required – Whether the parameter is required.

  • description – The description of the parameter.

Returns:

The instance of the builder.

set_key_cache_ttl(ttl: int) ReadContextBuilder#

Sets the recommended TTL for client-side CapsuleOpenResponses associated with this ReadContext.

Parameters:

ttl – The TTL to set.

Returns:

The instance of the builder.

set_disable_read_logging() ReadContextBuilder#

Instructs the client that read logging associated with this ReadContext can be skipped, which speeds up access to capsules.

Returns:

This instance of the builder.

build() antimatter_api.AddReadContext#

Builds the ReadContext and returns it.

Returns:

The built ReadContext.