| 1 | import type * as resourcegroups from "@distilled.cloud/aws/resource-groups"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Group } from "./Group.ts"; |
| 5 | |
| 6 | /** Request for {@link ListGroupResources} — the group is injected from the binding. */ |
| 7 | export type ListGroupResourcesRequest = Omit< |
| 8 | resourcegroups.ListGroupResourcesInput, |
| 9 | "Group" | "GroupName" |
| 10 | >; |
| 11 | |
| 12 | /** |
| 13 | * Runtime binding for `resource-groups:ListGroupResources`. |
| 14 | * |
| 15 | * Enumerates the member resources of the bound {@link Group} — for a |
| 16 | * tag-based group the resources currently matching the query, for an |
| 17 | * application or configuration group the explicitly grouped members. The |
| 18 | * group name is injected from the binding; the grant also includes the |
| 19 | * `tag:GetResources` / CloudFormation read-through permissions the |
| 20 | * enumeration fans out to. Provide the implementation with |
| 21 | * `Effect.provide(AWS.ResourceGroups.ListGroupResourcesHttp)`. |
| 22 | * ### Enumerating Group Members |
| 23 | * **Example:** List A Group's Member ARNs |
| 24 | * ```typescript |
| 25 | * // init — bind the operation to the group |
| 26 | * const listGroupResources = yield* AWS.ResourceGroups.ListGroupResources(group); |
| 27 | * |
| 28 | * // runtime |
| 29 | * const { Resources } = yield* listGroupResources(); |
| 30 | * const arns = (Resources ?? []).map((r) => r.Identifier?.ResourceArn); |
| 31 | * ``` |
| 32 | * |
| 33 | * @binding |
| 34 | */ |
| 35 | export interface ListGroupResources extends Binding.Service< |
| 36 | ListGroupResources, |
| 37 | "AWS.ResourceGroups.ListGroupResources", |
| 38 | ( |
| 39 | group: Group, |
| 40 | ) => Effect.Effect< |
| 41 | ( |
| 42 | request?: ListGroupResourcesRequest, |
| 43 | ) => Effect.Effect< |
| 44 | resourcegroups.ListGroupResourcesOutput, |
| 45 | resourcegroups.ListGroupResourcesError |
| 46 | > |
| 47 | > |
| 48 | > {} |
| 49 | export const ListGroupResources = Binding.Service<ListGroupResources>( |
| 50 | "AWS.ResourceGroups.ListGroupResources", |
| 51 | ); |