Package app.ductape.sdk.products.builder
Class ProductBuilder
java.lang.Object
app.ductape.sdk.products.builder.ProductBuilder
@Beta(since="0.1.0",
reason="Fluent DSL surface evolving to cover full TS productsBuilder.")
public final class ProductBuilder
extends Object
Sprint 3 — Fluent
ProductBuilder entry point. Mirrors the TypeScript SDK's
ProductsService fluent DSL but expressed as Java step-typed chains.
Usage:
ProductBuilder builder = ductape.products().builder("my-product");
builder
.app("payments-app")
.withAccessTag("billing")
.withAction("charge", action -> action.withMethod("POST").withPath("/charge"))
.register();
builder
.database("primary")
.withTrigger("on-user-create", t -> t.withTable("users").withEvent("INSERT"))
.withMigration("v1", m -> m.withDescription("initial schema"))
.register();
Map<String, Object> definition = builder.build();
Chains are mutator-style: every withXxx returns this to support fluent
accumulation. The terminal register() call performs the network round-trip via the
underlying ProductsService; the snapshot build() call on this root yields the
full immutable definition map for tests / diffs / JSON snapshots.
This class is currently Beta — its surface is locked by the
ProductBuilderParityTest but signature evolution may occur until 1.0.0.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionApps chain — top-level definition for a third-party app, including access tags, actions, notifications, and storages.Broker chain — topics + consumers + idempotency.build()Database chain — triggers + migrations + actions + schema.Fallback chain — define + register.Graph chain — actions + schema.healthcheck(String tag) Healthcheck chain — define + register.Model chain — define + register.products()Quota chain — define + register.Secret chain — define + register.Vector chain — actions + embeddings.
-
Constructor Details
-
ProductBuilder
-
-
Method Details
-
products
- Returns:
- the underlying
ProductsServicedelegate.
-
productTag
- Returns:
- the product tag this builder is bound to.
-
app
Apps chain — top-level definition for a third-party app, including access tags, actions, notifications, and storages. -
database
Database chain — triggers + migrations + actions + schema. -
graph
Graph chain — actions + schema. -
vector
Vector chain — actions + embeddings. -
broker
Broker chain — topics + consumers + idempotency. -
healthcheck
Healthcheck chain — define + register. -
quota
Quota chain — define + register. -
fallback
Fallback chain — define + register. -
secret
Secret chain — define + register. -
model
Model chain — define + register. -
executable
-
build
- Returns:
- the accumulated immutable product definition.
-