Skip to main content

KeyValueStoreClient

Subclient for manipulating a single key-value store.

Hierarchy

Index

Methods

__init__

  • __init__(*, memory_storage_client, id, name, created_at, accessed_at, modified_at): None
  • Parameters

    • optionalkeyword-onlymemory_storage_client: MemoryStorageClient
    • optionalkeyword-onlyid: str | None = None
    • optionalkeyword-onlyname: str | None = None
    • optionalkeyword-onlycreated_at: datetime | None = None
    • optionalkeyword-onlyaccessed_at: datetime | None = None
    • optionalkeyword-onlymodified_at: datetime | None = None

    Returns None

delete

  • async delete(): None
  • Permanently delete the key-value store managed by this client.


    Returns None

delete_persisted_record

  • async delete_persisted_record(*, record): None
  • Delete the specified record from the key-value store.


    Parameters

    Returns None

delete_record

  • async delete_record(*, key): None
  • Delete the specified record from the key-value store.


    Parameters

    • optionalkeyword-onlykey: str

      The key of the record which to delete.

    Returns None

get

get_public_url

  • async get_public_url(*, key): str
  • Get the public URL for the given key.


    Parameters

    • optionalkeyword-onlykey: str

      Key of the record for which URL is required.

    Returns str

get_record

  • Retrieve the given record from the key-value store.


    Parameters

    • optionalkeyword-onlykey: str

      Key of the record to retrieve.

    Returns KeyValueStoreRecord | None

get_record_as_bytes

  • Retrieve the given record from the key-value store, without parsing it.


    Parameters

    • optionalkeyword-onlykey: str

      Key of the record to retrieve.

    Returns KeyValueStoreRecord[bytes] | None

list_keys

  • List the keys in the key-value store.


    Parameters

    • optionalkeyword-onlylimit: int = 1000

      Number of keys to be returned. Maximum value is 1000.

    • optionalkeyword-onlyexclusive_start_key: str | None = None

      All keys up to this one (including) are skipped from the result.

    Returns KeyValueStoreListKeysPage

persist_record

  • async persist_record(*, record): None
  • Persist the specified record to the key-value store.


    Parameters

    Returns None

set_record

  • async set_record(*, key, value, content_type): None
  • Set a value to the given record in the key-value store.


    Parameters

    • optionalkeyword-onlykey: str

      The key of the record to save the value to.

    • optionalkeyword-onlyvalue: Any

      The value to save into the record.

    • optionalkeyword-onlycontent_type: str | None = None

      The content type of the saved value.

    Returns None

stream_record

  • Retrieve the given record from the key-value store, as a stream.


    Parameters

    • optionalkeyword-onlykey: str

      Key of the record to retrieve.

    Returns AsyncContextManager[KeyValueStoreRecord[Response] | None]

update

  • Update the key-value store metadata.


    Parameters

    • optionalkeyword-onlyname: str | None = None

      New new name for the key-value store.

    Returns KeyValueStoreMetadata

update_timestamps

  • async update_timestamps(*, has_been_modified): None
  • Update the timestamps of the key-value store.


    Parameters

    • optionalkeyword-onlyhas_been_modified: bool

    Returns None

Properties

resource_directory

resource_directory: str

Get the resource directory for the client.

resource_info

resource_info: KeyValueStoreMetadata

Get the resource info for the key-value store client.