| 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 UngroupResources} — the group is injected from the binding. */ |
| 7 | export type UngroupResourcesRequest = Omit< |
| 8 | resourcegroups.UngroupResourcesInput, |
| 9 | "Group" |
| 10 | >; |
| 11 | |
| 12 | /** |
| 13 | * Runtime binding for `resource-groups:UngroupResources`. |
| 14 | * |
| 15 | * Removes the specified resources from the bound {@link Group} (the inverse |
| 16 | * of {@link GroupResources} — supported for the same application / |
| 17 | * host-management / capacity-reservation-pool group types). Ungrouping is |
| 18 | * asynchronous; track the reported `Pending` ARNs with |
| 19 | * {@link ListGroupingStatuses}. The group name is injected from the binding. |
| 20 | * Provide the implementation with |
| 21 | * `Effect.provide(AWS.ResourceGroups.UngroupResourcesHttp)`. |
| 22 | * ### Managing Group Membership |
| 23 | * **Example:** Remove A Resource From An Application Group |
| 24 | * ```typescript |
| 25 | * // init — bind the operation to the group |
| 26 | * const ungroupResources = yield* AWS.ResourceGroups.UngroupResources(group); |
| 27 | * |
| 28 | * // runtime |
| 29 | * const { Succeeded, Pending } = yield* ungroupResources({ |
| 30 | * ResourceArns: [resourceArn], |
| 31 | * }); |
| 32 | * ``` |
| 33 | * |
| 34 | * @binding |
| 35 | */ |
| 36 | export interface UngroupResources extends Binding.Service< |
| 37 | UngroupResources, |
| 38 | "AWS.ResourceGroups.UngroupResources", |
| 39 | ( |
| 40 | group: Group, |
| 41 | ) => Effect.Effect< |
| 42 | ( |
| 43 | request: UngroupResourcesRequest, |
| 44 | ) => Effect.Effect< |
| 45 | resourcegroups.UngroupResourcesOutput, |
| 46 | resourcegroups.UngroupResourcesError |
| 47 | > |
| 48 | > |
| 49 | > {} |
| 50 | export const UngroupResources = Binding.Service<UngroupResources>( |
| 51 | "AWS.ResourceGroups.UngroupResources", |
| 52 | ); |