| 1 | import type * as acm from "@distilled.cloud/aws/acm"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Certificate } from "./Certificate.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Runtime binding for `acm:DescribeCertificate`. |
| 8 | * |
| 9 | * Bind this operation to a {@link Certificate} to get a callable that reads |
| 10 | * the certificate's live metadata — status, domain validation state, renewal |
| 11 | * summary, expiry — from inside a function runtime. Useful for expiry |
| 12 | * monitors and issuance dashboards. Provide the implementation with |
| 13 | * `Effect.provide(AWS.ACM.DescribeCertificateHttp)`. |
| 14 | * ### Inspecting Certificates |
| 15 | * **Example:** Read a Certificate's Status and Expiry |
| 16 | * ```typescript |
| 17 | * // init — bind the operation to the certificate |
| 18 | * const describeCertificate = yield* AWS.ACM.DescribeCertificate(certificate); |
| 19 | * |
| 20 | * // runtime |
| 21 | * const { Certificate: detail } = yield* describeCertificate(); |
| 22 | * const status = detail?.Status; |
| 23 | * const notAfter = detail?.NotAfter; |
| 24 | * ``` |
| 25 | * |
| 26 | * @binding |
| 27 | */ |
| 28 | export interface DescribeCertificate extends Binding.Service< |
| 29 | DescribeCertificate, |
| 30 | "AWS.ACM.DescribeCertificate", |
| 31 | ( |
| 32 | certificate: Certificate, |
| 33 | ) => Effect.Effect< |
| 34 | () => Effect.Effect< |
| 35 | acm.DescribeCertificateResponse, |
| 36 | acm.DescribeCertificateError |
| 37 | > |
| 38 | > |
| 39 | > {} |
| 40 | |
| 41 | export const DescribeCertificate = Binding.Service<DescribeCertificate>( |
| 42 | "AWS.ACM.DescribeCertificate", |
| 43 | ); |