1import type * as qbusiness from "@distilled.cloud/aws/qbusiness";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { Application } from "./Application.ts";
5
6/**
7 * `GetPolicy` request with `applicationId` injected from the bound application.
8 */
9export interface GetPolicyRequest extends Omit<
10 qbusiness.GetPolicyRequest,
11 "applicationId"
12> {}
13
14/**
15 * Runtime binding for the `GetPolicy` operation (IAM action
16 * `qbusiness:GetPolicy`), scoped to one {@link Application}.
17 *
18 * Reads the application's resource-based permission policy (the
19 * statements ISV data accessors were granted).
20 * Provide the implementation with
21 * `Effect.provide(AWS.QBusiness.GetPolicyHttp)`.
22 *
23 * ### Cross-Account Permissions
24 * **Example:** Read the Application Policy
25 * ```typescript
26 * const getPolicy = yield* AWS.QBusiness.GetPolicy(app);
27 *
28 * const { policy } = yield* getPolicy();
29 * ```
30 *
31 * @binding
32 */
33export interface GetPolicy extends Binding.Service<
34 GetPolicy,
35 "AWS.QBusiness.GetPolicy",
36 (
37 application: Application,
38 ) => Effect.Effect<
39 (
40 request?: GetPolicyRequest,
41 ) => Effect.Effect<qbusiness.GetPolicyResponse, qbusiness.GetPolicyError>
42 >
43> {}
44export const GetPolicy = Binding.Service<GetPolicy>("AWS.QBusiness.GetPolicy");