1import type * as mediaconnect from "@distilled.cloud/aws/mediaconnect";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { Flow } from "./Flow.ts";
5
6/**
7 * Runtime binding for `mediaconnect:GrantFlowEntitlements`.
8 *
9 * Grants entitlements on the bound {@link Flow} so other AWS accounts can
10 * subscribe to its content — e.g. a self-service affiliate portal that
11 * provisions access for a new subscriber account on demand. Granting more
12 * entitlements than the flow allows fails with the typed
13 * `GrantFlowEntitlements420Exception` tag. The flow ARN is injected from
14 * the binding. Provide the implementation with
15 * `Effect.provide(AWS.MediaConnect.GrantFlowEntitlementsHttp)`.
16 * ### Managing Entitlements
17 * **Example:** Grant a Subscriber Access to the Flow
18 * ```typescript
19 * // init — bind the operation to the flow
20 * const grantEntitlements = yield* AWS.MediaConnect.GrantFlowEntitlements(flow);
21 *
22 * // runtime
23 * const { Entitlements } = yield* grantEntitlements({
24 * Entitlements: [
25 * { Name: "affiliate-west", Subscribers: ["111122223333"] },
26 * ],
27 * });
28 * ```
29 *
30 * @binding
31 */
32export interface GrantFlowEntitlements extends Binding.Service<
33 GrantFlowEntitlements,
34 "AWS.MediaConnect.GrantFlowEntitlements",
35 (
36 flow: Flow,
37 ) => Effect.Effect<
38 (
39 request: Omit<mediaconnect.GrantFlowEntitlementsRequest, "FlowArn">,
40 ) => Effect.Effect<
41 mediaconnect.GrantFlowEntitlementsResponse,
42 mediaconnect.GrantFlowEntitlementsError
43 >
44 >
45> {}
46export const GrantFlowEntitlements = Binding.Service<GrantFlowEntitlements>(
47 "AWS.MediaConnect.GrantFlowEntitlements",
48);