| 1 | import type * as acmpca from "@distilled.cloud/aws/acm-pca"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { CertificateAuthority } from "./CertificateAuthority.ts"; |
| 5 | |
| 6 | export interface DescribeCertificateAuthorityAuditReportRequest extends Omit< |
| 7 | acmpca.DescribeCertificateAuthorityAuditReportRequest, |
| 8 | "CertificateAuthorityArn" |
| 9 | > {} |
| 10 | |
| 11 | /** |
| 12 | * Runtime binding for `acm-pca:DescribeCertificateAuthorityAuditReport`. |
| 13 | * |
| 14 | * Bind a {@link CertificateAuthority} inside a function runtime to check |
| 15 | * the status of an audit report started with |
| 16 | * {@link CreateCertificateAuthorityAuditReport} (reports are generated |
| 17 | * asynchronously into S3). Provide |
| 18 | * `ACMPCA.DescribeCertificateAuthorityAuditReportHttp` on the Function |
| 19 | * effect to implement the binding. |
| 20 | * |
| 21 | * ### Audit Reports |
| 22 | * **Example:** Poll an Audit Report Until It Succeeds |
| 23 | * ```typescript |
| 24 | * // init |
| 25 | * const describeAuditReport = |
| 26 | * yield* ACMPCA.DescribeCertificateAuthorityAuditReport(ca); |
| 27 | * |
| 28 | * // runtime |
| 29 | * const status = yield* describeAuditReport({ |
| 30 | * AuditReportId: report.AuditReportId!, |
| 31 | * }).pipe( |
| 32 | * Effect.repeat({ |
| 33 | * schedule: Schedule.spaced("2 seconds"), |
| 34 | * until: (r) => r.AuditReportStatus !== "CREATING", |
| 35 | * times: 10, |
| 36 | * }), |
| 37 | * ); |
| 38 | * ``` |
| 39 | * |
| 40 | * @binding |
| 41 | */ |
| 42 | export interface DescribeCertificateAuthorityAuditReport extends Binding.Service< |
| 43 | DescribeCertificateAuthorityAuditReport, |
| 44 | "AWS.ACMPCA.DescribeCertificateAuthorityAuditReport", |
| 45 | ( |
| 46 | certificateAuthority: CertificateAuthority, |
| 47 | ) => Effect.Effect< |
| 48 | ( |
| 49 | request: DescribeCertificateAuthorityAuditReportRequest, |
| 50 | ) => Effect.Effect< |
| 51 | acmpca.DescribeCertificateAuthorityAuditReportResponse, |
| 52 | acmpca.DescribeCertificateAuthorityAuditReportError |
| 53 | > |
| 54 | > |
| 55 | > {} |
| 56 | |
| 57 | export const DescribeCertificateAuthorityAuditReport = |
| 58 | Binding.Service<DescribeCertificateAuthorityAuditReport>( |
| 59 | "AWS.ACMPCA.DescribeCertificateAuthorityAuditReport", |
| 60 | ); |