@devries-cameron20 / t3code Mirror · read-only
Fork 0

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

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 06:00 UTC

main
ts 46 lines 1.58 KB
Raw
1 import type * as acm from "@distilled.cloud/aws/acm";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4 import type { Certificate } from "./Certificate.ts";
5
6 /**
7 * Runtime binding for `acm:GetCertificate`.
8 *
9 * Bind this operation to a {@link Certificate} to get a callable that
10 * retrieves the issued certificate body and its certificate chain (both
11 * PEM-encoded). The certificate must be issued — a certificate that is still
12 * pending validation fails with the typed `RequestInProgressException`.
13 * Provide the implementation with `Effect.provide(AWS.ACM.GetCertificateHttp)`.
14 * ### Reading Certificates
15 * **Example:** Fetch the PEM Certificate Chain
16 * ```typescript
17 * // init — bind the operation to the certificate
18 * const getCertificate = yield* AWS.ACM.GetCertificate(certificate);
19 *
20 * // runtime
21 * const result = yield* getCertificate();
22 * const pem = result.Certificate;
23 * const chain = result.CertificateChain;
24 * ```
25 *
26 * **Example:** Handle a Certificate That Is Not Issued Yet
27 * ```typescript
28 * const pem = yield* getCertificate().pipe(
29 * Effect.map((result) => result.Certificate),
30 * Effect.catchTag("RequestInProgressException", () =>
31 * Effect.succeed(undefined),
32 * ),
33 * );
34 * ```
35 *
36 * @binding
37 */
38 export interface GetCertificate extends Binding.Service<
39 GetCertificate,
40 "AWS.ACM.GetCertificate",
41 (
42 certificate: Certificate,
43 ) => Effect.Effect<() => Effect.Effect<acm.GetCertificateResponse, acm.GetCertificateError>>
44 > {}
45
46 export const GetCertificate = Binding.Service<GetCertificate>("AWS.ACM.GetCertificate");