@devries-cameron20 / t3code Mirror · read-only
Fork 0

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

main
ts 60 lines 1.95 KB
Raw
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 GetAssetPropertyValueHistory}. The bound asset's id is
8 * injected automatically.
9 */
10 export interface GetAssetPropertyValueHistoryRequest extends Omit<
11 sitewise.GetAssetPropertyValueHistoryRequest,
12 "assetId"
13 > {}
14
15 /**
16 * Runtime binding for `iotsitewise:GetAssetPropertyValueHistory` — read the
17 * historical timestamp-quality-values of one property of the bound asset
18 * over a time range from a deployed Lambda or Task.
19 *
20 * ### Reading Value History
21 * Provide the `GetAssetPropertyValueHistoryHttp` implementation layer on
22 * the Function effect, bind the asset in the init phase, then call the
23 * returned client at runtime. Page through large ranges with `nextToken`.
24 *
25 * **Example:** Read the Last Hour of Values
26 * ```typescript
27 * // init
28 * const getHistory = yield* AWS.IoTSiteWise.GetAssetPropertyValueHistory(asset);
29 *
30 * // runtime
31 * const now = yield* Effect.sync(() => new Date());
32 * const { assetPropertyValueHistory } = yield* getHistory({
33 * propertyId,
34 * startDate: new Date(now.getTime() - 3_600_000),
35 * endDate: now,
36 * timeOrdering: "DESCENDING",
37 * });
38 * // on the Function effect:
39 * // .pipe(Effect.provide(AWS.IoTSiteWise.GetAssetPropertyValueHistoryHttp))
40 * ```
41 *
42 * @binding
43 */
44 export interface GetAssetPropertyValueHistory extends Binding.Service<
45 GetAssetPropertyValueHistory,
46 "AWS.IoTSiteWise.GetAssetPropertyValueHistory",
47 (
48 asset: Asset,
49 ) => Effect.Effect<
50 (
51 request: GetAssetPropertyValueHistoryRequest,
52 ) => Effect.Effect<
53 sitewise.GetAssetPropertyValueHistoryResponse,
54 sitewise.GetAssetPropertyValueHistoryError
55 >
56 >
57 > {}
58 export const GetAssetPropertyValueHistory = Binding.Service<GetAssetPropertyValueHistory>(
59 "AWS.IoTSiteWise.GetAssetPropertyValueHistory",
60 );