The best way to control Claude Code, Codex and more from any computer or phone

main
ts 51 lines 1.72 KB
Raw
1 import type * as xray from "@distilled.cloud/aws/xray";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4
5 export interface GetSamplingTargetsRequest extends xray.GetSamplingTargetsRequest {}
6
7 /**
8 * Report sampling statistics and receive updated sampling quotas — the
9 * second half of the sampling protocol implemented by X-Ray SDK samplers.
10 *
11 * Bind the operation in the function's init phase to get a runtime callable;
12 * provide the implementation with `Effect.provide(XRay.GetSamplingTargetsHttp)`.
13 * The action is account-scoped: X-Ray does not support resource-level
14 * permissions for `xray:GetSamplingTargets`, so the binding grants it on `*`.
15 * ### Sampling
16 * **Example:** Refresh sampling quotas
17 * ```typescript
18 * import * as XRay from "@alchemy.run/aws/XRay";
19 *
20 * // init — grants xray:GetSamplingTargets
21 * const getSamplingTargets = yield* XRay.GetSamplingTargets();
22 *
23 * // runtime — report what this client sampled and receive new quotas
24 * const targets = yield* getSamplingTargets({
25 * SamplingStatisticsDocuments: [
26 * {
27 * RuleName: "my-rule",
28 * ClientID: "0123456789abcdef01234567",
29 * Timestamp: new Date(),
30 * RequestCount: 100,
31 * SampledCount: 5,
32 * },
33 * ],
34 * });
35 * const documents = targets.SamplingTargetDocuments ?? [];
36 * ```
37 *
38 * @binding
39 */
40 export interface GetSamplingTargets extends Binding.Service<
41 GetSamplingTargets,
42 "AWS.XRay.GetSamplingTargets",
43 () => Effect.Effect<
44 (
45 request: GetSamplingTargetsRequest,
46 ) => Effect.Effect<xray.GetSamplingTargetsResult, xray.GetSamplingTargetsError>
47 >
48 > {}
49 export const GetSamplingTargets = Binding.Service<GetSamplingTargets>(
50 "AWS.XRay.GetSamplingTargets",
51 );