1import type * as licensemanager from "@distilled.cloud/aws/license-manager";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4
5/**
6 * Request for {@link CreateToken}.
7 */
8export interface CreateTokenRequest extends licensemanager.CreateTokenRequest {}
9
10/**
11 * Runtime binding for `license-manager:CreateToken` — mint a long-lived
12 * refresh token for a license. The token (a claims-based JWT, `Redacted`
13 * end-to-end) is distributed to license consumers, who exchange it for
14 * temporary credentials with `GetAccessToken` +
15 * `AssumeRoleWithWebIdentity`.
16 *
17 * Provide the implementation with
18 * `Effect.provide(AWS.LicenseManager.CreateTokenHttp)`.
19 * ### License Checkout Data Plane
20 * **Example:** Mint an Activation Token for a License
21 * ```typescript
22 * // init
23 * const createToken = yield* AWS.LicenseManager.CreateToken();
24 *
25 * // runtime — Token is Redacted; hand it to the consumer without logging it
26 * const { TokenId, Token } = yield* createToken({
27 * LicenseArn: licenseArn,
28 * ClientToken: crypto.randomUUID(),
29 * });
30 * ```
31 *
32 * @binding
33 */
34export interface CreateToken extends Binding.Service<
35 CreateToken,
36 "AWS.LicenseManager.CreateToken",
37 () => Effect.Effect<
38 (
39 request: CreateTokenRequest,
40 ) => Effect.Effect<
41 licensemanager.CreateTokenResponse,
42 licensemanager.CreateTokenError
43 >
44 >
45> {}
46export const CreateToken = Binding.Service<CreateToken>(
47 "AWS.LicenseManager.CreateToken",
48);