| 1 | import type * as appregistry from "@distilled.cloud/aws/service-catalog-appregistry"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Application } from "./Application.ts"; |
| 5 | |
| 6 | /** `GetAssociatedResource` request with `application` injected from the bound {@link Application}. */ |
| 7 | export interface GetAssociatedResourceRequest extends Omit< |
| 8 | appregistry.GetAssociatedResourceRequest, |
| 9 | "application" |
| 10 | > {} |
| 11 | |
| 12 | /** |
| 13 | * Runtime binding for `servicecatalog:GetAssociatedResource`. |
| 14 | * |
| 15 | * Reads one resource associated with the bound application, including its |
| 16 | * application-tag sync status. Provide the implementation with |
| 17 | * `Effect.provide(AWS.AppRegistry.GetAssociatedResourceHttp)`. |
| 18 | * ### Reading Associated Resources |
| 19 | * **Example:** Get an Associated CloudFormation Stack |
| 20 | * ```typescript |
| 21 | * // init — bind the operation to the application |
| 22 | * const getAssociatedResource = |
| 23 | * yield* AWS.AppRegistry.GetAssociatedResource(app); |
| 24 | * |
| 25 | * // runtime |
| 26 | * const result = yield* getAssociatedResource({ |
| 27 | * resourceType: "CFN_STACK", |
| 28 | * resource: "my-stack", |
| 29 | * }); |
| 30 | * console.log(result.resource?.arn); |
| 31 | * ``` |
| 32 | * |
| 33 | * @binding |
| 34 | */ |
| 35 | export interface GetAssociatedResource extends Binding.Service< |
| 36 | GetAssociatedResource, |
| 37 | "AWS.AppRegistry.GetAssociatedResource", |
| 38 | ( |
| 39 | application: Application, |
| 40 | ) => Effect.Effect< |
| 41 | ( |
| 42 | request: GetAssociatedResourceRequest, |
| 43 | ) => Effect.Effect< |
| 44 | appregistry.GetAssociatedResourceResponse, |
| 45 | appregistry.GetAssociatedResourceError |
| 46 | > |
| 47 | > |
| 48 | > {} |
| 49 | |
| 50 | export const GetAssociatedResource = Binding.Service<GetAssociatedResource>( |
| 51 | "AWS.AppRegistry.GetAssociatedResource", |
| 52 | ); |