| 1 | import type * as greengrassv2 from "@distilled.cloud/aws/greengrassv2"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { ComponentVersion } from "./ComponentVersion.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Runtime binding for `greengrass:GetComponentVersionArtifact`. |
| 8 | * |
| 9 | * Mints a pre-signed download URL for one of the bound |
| 10 | * {@link ComponentVersion}'s artifacts (the same API core devices use to |
| 11 | * fetch artifacts during installation). The component version ARN is |
| 12 | * injected from the binding; the caller names the artifact. Provide the |
| 13 | * implementation with |
| 14 | * `Effect.provide(AWS.GreengrassV2.GetComponentVersionArtifactHttp)`. |
| 15 | * ### Reading Components |
| 16 | * **Example:** Mint An Artifact Download URL |
| 17 | * ```typescript |
| 18 | * // init — bind the operation to the component version |
| 19 | * const getArtifact = yield* AWS.GreengrassV2.GetComponentVersionArtifact(component); |
| 20 | * |
| 21 | * // runtime |
| 22 | * const { preSignedUrl } = yield* getArtifact({ artifactName: "installer.zip" }); |
| 23 | * ``` |
| 24 | * |
| 25 | * @binding |
| 26 | */ |
| 27 | export interface GetComponentVersionArtifact extends Binding.Service< |
| 28 | GetComponentVersionArtifact, |
| 29 | "AWS.GreengrassV2.GetComponentVersionArtifact", |
| 30 | ( |
| 31 | component: ComponentVersion, |
| 32 | ) => Effect.Effect< |
| 33 | ( |
| 34 | request: Omit<greengrassv2.GetComponentVersionArtifactRequest, "arn">, |
| 35 | ) => Effect.Effect< |
| 36 | greengrassv2.GetComponentVersionArtifactResponse, |
| 37 | greengrassv2.GetComponentVersionArtifactError |
| 38 | > |
| 39 | > |
| 40 | > {} |
| 41 | export const GetComponentVersionArtifact = |
| 42 | Binding.Service<GetComponentVersionArtifact>( |
| 43 | "AWS.GreengrassV2.GetComponentVersionArtifact", |
| 44 | ); |