The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 06:00 UTC
| 1 | import type * as sitewise from "@distilled.cloud/aws/iotsitewise"; |
| 2 | import * as Binding from "alchemy/Binding"; |
| 3 | import type * as Effect from "effect/Effect"; |
| 4 | import type { Asset } from "./Asset.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Request for {@link DescribeAsset}. The bound asset's id is injected |
| 8 | * automatically. |
| 9 | */ |
| 10 | export interface DescribeAssetRequest extends Omit<sitewise.DescribeAssetRequest, "assetId"> {} |
| 11 | |
| 12 | /** |
| 13 | * Runtime binding for `iotsitewise:DescribeAsset` — read the bound asset's |
| 14 | * full description (including its properties with their service-assigned |
| 15 | * ids and names) from a deployed Lambda or Task. Use it to resolve a |
| 16 | * property's id by name before reading or ingesting values. |
| 17 | * |
| 18 | * ### Describing the Bound Asset |
| 19 | * Provide the `DescribeAssetHttp` implementation layer on the Function |
| 20 | * effect, bind the asset in the init phase, then call the returned client |
| 21 | * at runtime. |
| 22 | * |
| 23 | * **Example:** Resolve a Property Id by Name |
| 24 | * ```typescript |
| 25 | * // init |
| 26 | * const describeAsset = yield* AWS.IoTSiteWise.DescribeAsset(asset); |
| 27 | * |
| 28 | * // runtime |
| 29 | * const described = yield* describeAsset(); |
| 30 | * const propertyId = described.assetProperties.find( |
| 31 | * (p) => p.name === "Temperature", |
| 32 | * )?.id; |
| 33 | * // on the Function effect: |
| 34 | * // .pipe(Effect.provide(AWS.IoTSiteWise.DescribeAssetHttp)) |
| 35 | * ``` |
| 36 | * |
| 37 | * @binding |
| 38 | */ |
| 39 | export interface DescribeAsset extends Binding.Service< |
| 40 | DescribeAsset, |
| 41 | "AWS.IoTSiteWise.DescribeAsset", |
| 42 | ( |
| 43 | asset: Asset, |
| 44 | ) => Effect.Effect< |
| 45 | ( |
| 46 | request?: DescribeAssetRequest, |
| 47 | ) => Effect.Effect<sitewise.DescribeAssetResponse, sitewise.DescribeAssetError> |
| 48 | > |
| 49 | > {} |
| 50 | export const DescribeAsset = Binding.Service<DescribeAsset>("AWS.IoTSiteWise.DescribeAsset"); |