| 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 | import type { LicenseConfiguration } from "./LicenseConfiguration.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Runtime binding for `license-manager:GetLicenseConfiguration` — read the |
| 8 | * bound license configuration's live state (counting type, license count, |
| 9 | * consumed count, rules, status) from a deployed Lambda or Task. |
| 10 | * |
| 11 | * Provide the implementation with |
| 12 | * `Effect.provide(AWS.LicenseManager.GetLicenseConfigurationHttp)`. |
| 13 | * ### Reading License Configurations |
| 14 | * **Example:** Read the Bound Configuration's Consumption |
| 15 | * ```typescript |
| 16 | * // init |
| 17 | * const getConfiguration = |
| 18 | * yield* AWS.LicenseManager.GetLicenseConfiguration(licenses); |
| 19 | * |
| 20 | * // runtime |
| 21 | * const config = yield* getConfiguration(); |
| 22 | * const remaining = |
| 23 | * (config.LicenseCount ?? 0) - (config.ConsumedLicenses ?? 0); |
| 24 | * // on the Function effect: |
| 25 | * // .pipe(Effect.provide(AWS.LicenseManager.GetLicenseConfigurationHttp)) |
| 26 | * ``` |
| 27 | * |
| 28 | * @binding |
| 29 | */ |
| 30 | export interface GetLicenseConfiguration extends Binding.Service< |
| 31 | GetLicenseConfiguration, |
| 32 | "AWS.LicenseManager.GetLicenseConfiguration", |
| 33 | ( |
| 34 | configuration: LicenseConfiguration, |
| 35 | ) => Effect.Effect< |
| 36 | () => Effect.Effect< |
| 37 | licensemanager.GetLicenseConfigurationResponse, |
| 38 | licensemanager.GetLicenseConfigurationError |
| 39 | > |
| 40 | > |
| 41 | > {} |
| 42 | export const GetLicenseConfiguration = Binding.Service<GetLicenseConfiguration>( |
| 43 | "AWS.LicenseManager.GetLicenseConfiguration", |
| 44 | ); |