antimatter.builders.write_context#

Module Contents#

Classes#

WriteContextBuilder

Builder class for creating WriteContext objects.

WriteContextConfigurationBuilder

Builder class for creating WriteContextConfigInfo objects.

class antimatter.builders.write_context.WriteContextBuilder#

Builder class for creating WriteContext objects.

set_summary(summary: str) WriteContextBuilder#

Set the summary of the WriteContext.

Parameters:

summary – The summary to set.

Returns:

The WriteContextBuilder instance.

set_description(description: str) WriteContextBuilder#

Set the description of the WriteContext.

Parameters:

description – The description to set.

Returns:

The WriteContextBuilder instance.

add_hook(name: antimatter.constants.Hook | str, constraint: str = '>1.0.0', mode: antimatter.constants.WriteContextHookMode | str = WriteContextHookMode.Sync) WriteContextBuilder#

Add a hook to the WriteContext.

Parameters:
  • name – The name of the hook.

  • constraint – The constraint of the hook.

  • mode – The mode of the hook.

Returns:

The WriteContextBuilder instance.

set_key_reuse_ttl(seconds: int) WriteContextBuilder#

Set the recommended key reuse TTL, which instructs the client to reuse encryption keys (and associated capsule IDs) for up to this duration in seconds.

Parameters:

seconds – The TTL in seconds to set.

Returns:

The WriteContextBuilder instance.

build() antimatter_api.AddWriteContext#

Build the WriteContext.

Returns:

The built WriteContext.

class antimatter.builders.write_context.WriteContextConfigurationBuilder#

Builder class for creating WriteContextConfigInfo objects.

add_hook(name: antimatter.constants.Hook | str, constraint: str = '>1.0.0', mode: antimatter.constants.WriteContextHookMode | str = WriteContextHookMode.Sync) WriteContextConfigurationBuilder#

Add a hook to the WriteContextConfigurationBuilder.

Parameters:
  • name – The name of the hook.

  • constraint – The constraint of the hook.

  • mode – The mode of the hook.

Returns:

The WriteContextConfigurationBuilder instance.

set_key_reuse_ttl(seconds: int) WriteContextConfigurationBuilder#

Set the recommended key reuse TTL, which instructs the client to reuse encryption keys (and associated capsule IDs) for up to this duration in seconds.

Parameters:

seconds – The TTL in seconds to set.

Returns:

The WriteContextConfigurationBuilder instance.

build() antimatter_api.WriteContextConfigInfo#

Build the WriteContextConfigInfo.

Returns:

The built WriteContextConfigInfo.