1import type * as privateca from "@distilled.cloud/gcp/privateca_v1";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { RuntimeContext } from "../../RuntimeContext.ts";
5import type { CaPool } from "./CaPool.ts";
6
7export interface FetchCaCertsRequest {
8 /**
9 * Optional UUID used to make the fetch idempotent for at least 60
10 * minutes.
11 */
12 requestId?: string;
13}
14
15/**
16 * Runtime binding for Certificate Authority Service `caPools.fetchCaCerts`.
17 *
18 * Bind this operation to a {@link CaPool} in a Function/Action init phase.
19 * Provide {@link FetchCaCertsHttp}. Returns PEM CA certificate chains for
20 * authorities in the ENABLED, DISABLED, or STAGED states.
21 *
22 * ### Fetching CA Certificates
23 * **Example:** Fetch the pool's trust anchors
24 * ```typescript
25 * const fetchCaCerts = yield* GCP.PrivateCA.FetchCaCerts(pool);
26 * const { caCerts } = yield* fetchCaCerts();
27 * ```
28 *
29 * @binding
30 * @category PrivateCA
31 */
32export interface FetchCaCerts extends Binding.Service<
33 FetchCaCerts,
34 "GCP.PrivateCA.FetchCaCerts",
35 (
36 pool: CaPool,
37 ) => Effect.Effect<
38 (
39 request?: FetchCaCertsRequest,
40 ) => Effect.Effect<
41 privateca.FetchCaCertsResponse,
42 privateca.FetchCaCertsProjectsLocationsCaPoolsError,
43 RuntimeContext
44 >
45 >
46> {}
47
48export const FetchCaCerts = Binding.Service<FetchCaCerts>(
49 "GCP.PrivateCA.FetchCaCerts",
50);