WarmHubClient
Class: warmhub.WarmHubClient
WarmHubClient(*, api_url: str | Unset = UNSET, http_client: httpx.Client | Unset = UNSET, access_token: AccessTokenProvider | Unset = UNSET, auth: AuthProvider | Unset = UNSET, function_logs: str | Unset = UNSET, client: Mapping[str, str] | ClientIdentity | Unset = UNSET, client_flags: Sequence[str] | Unset = UNSET, **unknown_options: NoReturn)Synchronous WarmHub client.
The client owns an httpx connection pool, so it is closable:
with WarmHubClient(access_token=token) as client: ...
client = WarmHubClient(access_token=token) # also validclient.close()An httpx.Client passed as http_client= belongs to the caller and is
never closed by the SDK.
Unlike the async client, this one accepts only synchronous token
providers. An awaitable provider raises a named TypeError pointing at
AsyncWarmHubClient rather than blocking a thread on someone else’s
event loop.
Methods
Section titled “Methods”from_env
Section titled “from_env”from_env(*, api_url: str | Unset = UNSET, http_client: httpx.Client | Unset = UNSET, access_token: AccessTokenProvider | Unset = UNSET, auth: AuthProvider | Unset = UNSET, function_logs: str | Unset = UNSET, client: Mapping[str, str] | ClientIdentity | Unset = UNSET, client_flags: Sequence[str] | Unset = UNSET, **unknown_options: NoReturn)Construct from WH_TOKEN and WARMHUB_API_URL.
Explicit keyword arguments win over the environment. The default constructor reads neither variable.
with_access_token
Section titled “with_access_token”with_access_token(access_token: AccessTokenProvider)A second client authenticating as access_token, on THIS pool.
The synchronous twin of
AsyncWarmHubClient.with_access_token, including the
pool-ownership contract: the derived client borrows this client’s
httpx pool rather than opening a second one, so
derived.owns_transport is False, derived.close() leaves the
pool open, and a derived client outliving the owner it borrowed from
raises the closed-client RuntimeError.
function_logs is deliberately not carried across; the clone reverts
to the default mode, matching the reference.
repository
Section titled “repository”repository(locator: str)Bind a repository handle to locator.
Accepts the slug the UI shows and the wref a previous read returned:
sensors = client.repository("acme/sensors")sensors = client.repository("wh:acme/sensors/Reading/probe-1")Anything else raises ValueError naming the input and both accepted
forms. Deliberately not a WarmHubError: no request was made, so a
caller’s except WarmHubError around a network call must not swallow
what is a typo in a literal.
close()Close the connection pool, if this client opened it.
Properties and attributes
Section titled “Properties and attributes”subscription
Section titled “subscription”subscription = SyncSubscriptionNamespace(self._transport)Documentation is not yet available.
api_url
Section titled “api_url”api_urlDocumentation is not yet available.
transport
Section titled “transport”transportDocumentation is not yet available.
client_identity
Section titled “client_identity”client_identityDocumentation is not yet available.
client_flags
Section titled “client_flags”client_flagsNormalized client_flags, stamped on every request.
function_log_mode
Section titled “function_log_mode”function_log_modeDocumentation is not yet available.
owns_transport
Section titled “owns_transport”owns_transportFalse when the caller injected an httpx.Client.
is_closed
Section titled “is_closed”is_closedDocumentation is not yet available.
access
Section titled “access”accessDocumentation is not yet available.
action
Section titled “action”actionDocumentation is not yet available.
authDocumentation is not yet available.
collection
Section titled “collection”collectionDocumentation is not yet available.
commit
Section titled “commit”commitDocumentation is not yet available.
component
Section titled “component”componentDocumentation is not yet available.
credential
Section titled “credential”credentialDocumentation is not yet available.
diagnostics
Section titled “diagnostics”diagnosticsDocumentation is not yet available.
homepage
Section titled “homepage”homepageDocumentation is not yet available.
orgDocumentation is not yet available.
repoDocumentation is not yet available.
shapeDocumentation is not yet available.
stream
Section titled “stream”streamDocumentation is not yet available.
thingDocumentation is not yet available.
tokenDocumentation is not yet available.
viewDocumentation is not yet available.