@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, 04:45 UTC

main
ts 40 lines 1.33 KB
Raw
1 import type * as s3control from "@distilled.cloud/aws/s3-control";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4 import type { AccessPoint } from "./AccessPoint.ts";
5
6 /**
7 * Runtime binding for `s3:GetAccessPointPolicy`.
8 *
9 * Reads the resource policy attached to the bound {@link AccessPoint}. An
10 * access point without a policy fails with the typed
11 * `NoSuchAccessPointPolicy` tag. Provide the implementation with
12 * `Effect.provide(AWS.S3Control.GetAccessPointPolicyHttp)`.
13 * ### Observing an Access Point
14 * **Example:** Read the Access Point's Policy
15 * ```typescript
16 * // init — bind the operation to the access point
17 * const getPolicy = yield* AWS.S3Control.GetAccessPointPolicy(accessPoint);
18 *
19 * // runtime
20 * const policy = yield* getPolicy().pipe(
21 * Effect.catchTag("NoSuchAccessPointPolicy", () =>
22 * Effect.succeed({ Policy: undefined }),
23 * ),
24 * );
25 * ```
26 *
27 * @binding
28 */
29 export interface GetAccessPointPolicy extends Binding.Service<
30 GetAccessPointPolicy,
31 "AWS.S3Control.GetAccessPointPolicy",
32 (
33 accessPoint: AccessPoint,
34 ) => Effect.Effect<
35 () => Effect.Effect<s3control.GetAccessPointPolicyResult, s3control.GetAccessPointPolicyError>
36 >
37 > {}
38 export const GetAccessPointPolicy = Binding.Service<GetAccessPointPolicy>(
39 "AWS.S3Control.GetAccessPointPolicy",
40 );