bloombox / bloombox.client / Bloombox

Bloombox

class Bloombox (source)

Specifies a unified Bloombox API client, that is capable of calling methods on any service exposed by the Bloombox Cloud Platform. This is accomplished by integrating with lower-level gRPC-based APIs. Under the hood, Protobuf is used over HTTP2. Services are lazy-loaded and maintain a live connection with a reasonable keepalive (10 minutes).

At the time of writing, supported services include:

Types

APIEnvironment

enum class APIEnvironment

Describes available API environments. In some cases, you may want to test systems against bleeding-edge or beta versions of Bloombox services. Use 'STAGING' to test against the beta environment. 'SANDBOX' is reserved for internal use only and refuses non-internal traffic. Note that this value describes the data namespace in use for a given API client, not the systems the traffic is sent to.

APIRegion

enum class APIRegion

Describes available API regions. In some cases, library users may want to force-direct (or at least prefer) a particular API hosting region. Available options are "USW1" (hosted in Oregon, USA) or "USC1" (hosted in South Carolina, USA).

ClientTarget

enum class ClientTarget

Specifies client target settings understood by the Java/Kotlin client. In some cases, you may want to test systems against bleeding-edge or beta versions of Bloombox services. This enum directs traffic to one service cluster or another, note that it does not affect the active data namespace (unless 'SANDBOX' is used, in which 'SANDBOX' is enforced for the API environment value).

Settings

data class Settings

Specifies client settings that can be passed in to modify RPC behavior.

Constructors

<init>

Bloombox(settings: Settings, target: ClientTarget = ClientTarget.PRODUCTION)

Specifies a unified Bloombox API client, that is capable of calling methods on any service exposed by the Bloombox Cloud Platform. This is accomplished by integrating with lower-level gRPC-based APIs. Under the hood, Protobuf is used over HTTP2. Services are lazy-loaded and maintain a live connection with a reasonable keepalive (10 minutes).

Functions

close

fun close(soft: Boolean = true, block: Boolean = true, timeout: Duration? = null): Unit

Close all client connections. For each service that has been initialized within the lifetime of this API client, sever any active connections and evict any related resources from memory.

menu

fun menu(): MenuClient

Menu client. Offers RPC access to retrieve and update product catalog data. Menus may be retrieved in full, or section-by-section. By default, items that are "invisible" (i.e. out-of-stock or no longer carried) are withheld from the response.

shop

fun shop(): ShopClient

Shop client. Offers the ability to submit or query orders, verify or enroll users, check shop status and zipcode delivery eligibility, and so on. Powered by digital storefront features of the Bloombox platform, and integrates with the embedded web store.

telemetry

fun telemetry(): TelemetryClient

Telemetry client. Offers RPC access to telemetry data ingest services. Events may be sent to the Telemetry Cloud API so they may be later correlated with standard telemetry during analysis and reporting. Partners may also elect to send their own analytics data for ad-hoc reporting.