1import type * as apikeys from "@distilled.cloud/gcp/apikeys_v2";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { RuntimeContext } from "../../RuntimeContext.ts";
5import type { Key } from "./Key.ts";
6
7/**
8 * Runtime binding for API Keys `keys.getKeyString`.
9 *
10 * Bind this operation to a {@link Key} in a Function/Action init phase.
11 * Provide {@link GetKeyStringHttp}. The key string is not included on
12 * `keys.get` — this is the only way to read it.
13 *
14 * ### Reading the Key String
15 * **Example:** Get the encrypted key string
16 * ```typescript
17 * const getKeyString = yield* GCP.ApiKeys.GetKeyString(maps);
18 * const { keyString } = yield* getKeyString();
19 * ```
20 *
21 * @binding
22 * @category ApiKeys
23 */
24export interface GetKeyString extends Binding.Service<
25 GetKeyString,
26 "GCP.ApiKeys.GetKeyString",
27 (
28 key: Key,
29 ) => Effect.Effect<
30 () => Effect.Effect<
31 apikeys.V2GetKeyStringResponse,
32 apikeys.GetKeyStringProjectsLocationsKeysError,
33 RuntimeContext
34 >
35 >
36> {}
37
38export const GetKeyString = Binding.Service<GetKeyString>(
39 "GCP.ApiKeys.GetKeyString",
40);