| 1 | import type * as licensemanager from "@distilled.cloud/aws/license-manager"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | |
| 5 | /** |
| 6 | * Request for {@link CreateGrant}. |
| 7 | */ |
| 8 | export interface CreateGrantRequest extends licensemanager.CreateGrantRequest {} |
| 9 | |
| 10 | /** |
| 11 | * Runtime binding for `license-manager:CreateGrant` — share a seller-issued |
| 12 | * license's entitlements with an Amazon Web Services account, organization, |
| 13 | * or organizational unit. The distribution half of an ISV fulfillment |
| 14 | * backend: after minting a license with `CreateLicense`, grant it to the |
| 15 | * customer's account. |
| 16 | * |
| 17 | * Provide the implementation with |
| 18 | * `Effect.provide(AWS.LicenseManager.CreateGrantHttp)`. |
| 19 | * ### Managing Grants |
| 20 | * **Example:** Grant a License to a Customer Account |
| 21 | * ```typescript |
| 22 | * // init |
| 23 | * const createGrant = yield* AWS.LicenseManager.CreateGrant(); |
| 24 | * |
| 25 | * // runtime |
| 26 | * const { GrantArn } = yield* createGrant({ |
| 27 | * GrantName: "customer-grant", |
| 28 | * LicenseArn: licenseArn, |
| 29 | * HomeRegion: region, |
| 30 | * Principals: [`arn:aws:iam::${customerAccountId}:root`], |
| 31 | * AllowedOperations: ["CheckoutLicense", "CheckInLicense", "ExtendConsumptionLicense", "ListPurchasedLicenses"], |
| 32 | * ClientToken: crypto.randomUUID(), |
| 33 | * }); |
| 34 | * ``` |
| 35 | * |
| 36 | * @binding |
| 37 | */ |
| 38 | export interface CreateGrant extends Binding.Service< |
| 39 | CreateGrant, |
| 40 | "AWS.LicenseManager.CreateGrant", |
| 41 | () => Effect.Effect< |
| 42 | ( |
| 43 | request: CreateGrantRequest, |
| 44 | ) => Effect.Effect< |
| 45 | licensemanager.CreateGrantResponse, |
| 46 | licensemanager.CreateGrantError |
| 47 | > |
| 48 | > |
| 49 | > {} |
| 50 | export const CreateGrant = Binding.Service<CreateGrant>( |
| 51 | "AWS.LicenseManager.CreateGrant", |
| 52 | ); |