Skip to content

create ¤

Classes:

CreateBuilderImpl dataclass ¤

CreateBuilderImpl(
    *, endpoint: str, ledger: str, data: JsonObject | JsonArray | None = None, context: dict[str, Any] | None = None
)

Bases: WithContextMixin['CreateBuilderImpl'], WithInsertMixin[CreateReadyToCommitImpl], CreateBuilder

Implementation of a create operation builder.

CreateReadyToCommitImpl dataclass ¤

CreateReadyToCommitImpl(
    *, endpoint: str, ledger: str, data: JsonObject | JsonArray | None, context: dict[str, Any] | None = None
)

Bases: RequestMixin, WithContextMixin['CreateReadyToCommitImpl'], WithInsertMixin['CreateReadyToCommitImpl'], CommitableMixin['CreateReadyToCommitImpl'], CreateReadyToCommit

Implementation of a create operation ready to be committed.

Methods:

  • acommit

    Executes the transaction asynchronously.

  • build_request_payload

    Build the request payload for the create operation.

  • commit

    Executes the transaction synchronously.

  • get_url

    Get the endpoint URL for the create operation.

  • with_context

    Updates the operation's context with new data.

  • with_insert

    Updates the operation with new data to be inserted.

acommit async ¤

acommit() -> FlureeResponse

Executes the transaction asynchronously.

Raises:

  • RequestError

    If the HTTP request fails.

  • TypeError

    If the type parameter cannot be resolved.

build_request_payload ¤

build_request_payload() -> dict[str, Any]

Build the request payload for the create operation.

commit ¤

commit() -> FlureeResponse

Executes the transaction synchronously.

Raises:

  • RequestError

    If the HTTP request fails.

  • TypeError

    If the type parameter cannot be resolved.

get_url ¤

get_url() -> str

Get the endpoint URL for the create operation.

with_context ¤

with_context(context: dict[str, Any]) -> T

Updates the operation's context with new data.

Raises:

  • TypeError

    If the type parameter cannot be resolved.

with_insert ¤

with_insert(data: JsonObject | JsonArray) -> T

Updates the operation with new data to be inserted.

Raises:

  • TypeError

    If the type parameter cannot be resolved.