Skip to main content

client.record

RecordClient Objects​

class RecordClient()

Provides functionality for creating records using various data sources and to interact with the Bloock Record service.

__init__​

def __init__(config_data=None) -> None

Creates a new RecordClient with the provided configuration.

from_record​

def from_record(record: Record) -> RecordBuilder

Creates a RecordBuilder from an existing record.

from_loader​

def from_loader(loader: Loader) -> RecordBuilder

Creates a RecordBuilder from a data loader.

from_string​

def from_string(string: str) -> RecordBuilder

Creates a RecordBuilder from a string payload.

from_hex​

def from_hex(hex: str) -> RecordBuilder

Creates a RecordBuilder from a hexadecimal string payload.

from_json​

def from_json(json: str) -> RecordBuilder

Creates a RecordBuilder from a JSON string payload.

from_file​

def from_file(file: bytes) -> RecordBuilder

Creates a RecordBuilder from a byte slice representing a file.

from_bytes​

def from_bytes(b: bytes) -> RecordBuilder

Creates a RecordBuilder from a byte slice payload.

RecordBuilder Objects​

class RecordBuilder()

Assists in constructing records with various configurations.

__init__​

def __init__(payload,
payload_type: RecordTypes.ValueType,
config_data: ConfigData,
signer: authenticity_entities.Signer | None = None,
encrypter: encryption_entities.Encrypter | None = None,
decrypter: encryption_entities.Decrypter | None = None) -> None

Creates a new RecordBuilder with default configuration.

with_signer​

def with_signer(signer: Signer) -> RecordBuilder

Sets the signer for the RecordBuilder.

with_encrypter​

def with_encrypter(encrypter: Encrypter) -> RecordBuilder

Sets the encrypter for the RecordBuilder.

with_decrypter​

def with_decrypter(decrypter: Encrypter) -> RecordBuilder

Sets the decrypter for the RecordBuilder.

build​

def build() -> Record

Constructs a record based on the RecordBuilder's configuration.

get_details​

def get_details() -> RecordDetails

Gets details about other Bloock services (Integrity, Authenticity, Encryption, Availability) configured in the RecordBuilder.