@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 54 lines 1.61 KB
Raw
1 import type * as binaryauthorization from "@distilled.cloud/gcp/binaryauthorization_v1";
2 import * as Binding from "alchemy/Binding";
3 import type { RuntimeContext } from "alchemy/RuntimeContext";
4 import type * as Effect from "effect/Effect";
5 import type { PlatformsPolicy } from "./PlatformsPolicy.ts";
6
7 export interface EvaluateGkePolicyRequest extends Omit<
8 binaryauthorization.EvaluateGkePolicyRequest,
9 never
10 > {}
11
12 /**
13 * Runtime binding for Binary Authorization
14 * `platforms.gke.policies.evaluate`.
15 *
16 * Bind this operation to a {@link PlatformsPolicy} in a Function/Action
17 * init phase. Provide {@link EvaluateGkePolicyHttp}.
18 *
19 * ### Evaluating a GKE Policy
20 * **Example:** Evaluate a Pod against the bound policy
21 * ```typescript
22 * const evaluate = yield* GCP.BinaryAuthorization.EvaluateGkePolicy(policy);
23 * const result = yield* evaluate({
24 * resource: {
25 * apiVersion: "v1",
26 * kind: "Pod",
27 * metadata: { name: "web", namespace: "default" },
28 * spec: { containers: [{ name: "nginx", image: "nginx" }] },
29 * },
30 * });
31 * ```
32 *
33 * @binding
34 * @category BinaryAuthorization
35 */
36 export interface EvaluateGkePolicy extends Binding.Service<
37 EvaluateGkePolicy,
38 "GCP.BinaryAuthorization.EvaluateGkePolicy",
39 (
40 policy: PlatformsPolicy,
41 ) => Effect.Effect<
42 (
43 request: EvaluateGkePolicyRequest,
44 ) => Effect.Effect<
45 binaryauthorization.EvaluateGkePolicyResponse,
46 binaryauthorization.EvaluateProjectsPlatformsGkePoliciesError,
47 RuntimeContext
48 >
49 >
50 > {}
51
52 export const EvaluateGkePolicy = Binding.Service<EvaluateGkePolicy>(
53 "GCP.BinaryAuthorization.EvaluateGkePolicy",
54 );