1import type * as s3control from "@distilled.cloud/aws/s3-control";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import 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 */
29export interface GetAccessPointPolicy extends Binding.Service<
30 GetAccessPointPolicy,
31 "AWS.S3Control.GetAccessPointPolicy",
32 (
33 accessPoint: AccessPoint,
34 ) => Effect.Effect<
35 () => Effect.Effect<
36 s3control.GetAccessPointPolicyResult,
37 s3control.GetAccessPointPolicyError
38 >
39 >
40> {}
41export const GetAccessPointPolicy = Binding.Service<GetAccessPointPolicy>(
42 "AWS.S3Control.GetAccessPointPolicy",
43);