The best way to control Claude Code, Codex and more from any computer or phone

main
ts 51 lines 1.78 KB
Raw
1 import type * as licensemanager from "@distilled.cloud/aws/license-manager";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4
5 /**
6 * Request for {@link CheckoutLicense}.
7 */
8 export interface CheckoutLicenseRequest extends licensemanager.CheckoutLicenseRequest {}
9
10 /**
11 * Runtime binding for `license-manager:CheckoutLicense` — check out
12 * entitlements from a seller-issued license for the calling application.
13 * The returned `LicenseConsumptionToken` is used to check in or extend the
14 * consumption; `PROVISIONAL` checkouts expire and must be extended with
15 * {@link ExtendLicenseConsumption}.
16 *
17 * Provide the implementation with
18 * `Effect.provide(AWS.LicenseManager.CheckoutLicenseHttp)`.
19 * ### License Checkout Data Plane
20 * **Example:** Check Out an Entitlement
21 * ```typescript
22 * // init — account-level binding takes no resource
23 * const checkoutLicense = yield* AWS.LicenseManager.CheckoutLicense();
24 *
25 * // runtime
26 * const checkout = yield* checkoutLicense({
27 * ProductSKU: "my-product-sku",
28 * CheckoutType: "PROVISIONAL",
29 * KeyFingerprint: keyFingerprint,
30 * Entitlements: [{ Name: "seats", Value: "1", Unit: "Count" }],
31 * ClientToken: crypto.randomUUID(),
32 * });
33 * const token = checkout.LicenseConsumptionToken;
34 * // on the Function effect:
35 * // .pipe(Effect.provide(AWS.LicenseManager.CheckoutLicenseHttp))
36 * ```
37 *
38 * @binding
39 */
40 export interface CheckoutLicense extends Binding.Service<
41 CheckoutLicense,
42 "AWS.LicenseManager.CheckoutLicense",
43 () => Effect.Effect<
44 (
45 request: CheckoutLicenseRequest,
46 ) => Effect.Effect<licensemanager.CheckoutLicenseResponse, licensemanager.CheckoutLicenseError>
47 >
48 > {}
49 export const CheckoutLicense = Binding.Service<CheckoutLicense>(
50 "AWS.LicenseManager.CheckoutLicense",
51 );