@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, 04:45 UTC

main
ts 42 lines 1.48 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 GetSamplingRulesRequest extends xray.GetSamplingRulesRequest {}
6
7 /**
8 * Retrieve all X-Ray sampling rules — the first half of the sampling
9 * protocol used by custom samplers (poll rules, then report statistics
10 * via `GetSamplingTargets`).
11 *
12 * Bind the operation in the function's init phase to get a runtime callable;
13 * provide the implementation with `Effect.provide(XRay.GetSamplingRulesHttp)`.
14 * The action is account-scoped: X-Ray does not support resource-level
15 * permissions for `xray:GetSamplingRules`, so the binding grants it on `*`.
16 * ### Sampling
17 * **Example:** Poll the active sampling rules
18 * ```typescript
19 * import * as XRay from "@alchemy.run/aws/XRay";
20 *
21 * // init — grants xray:GetSamplingRules
22 * const getSamplingRules = yield* XRay.GetSamplingRules();
23 *
24 * // runtime
25 * const rules = yield* getSamplingRules();
26 * const names = (rules.SamplingRuleRecords ?? []).map(
27 * (record) => record.SamplingRule?.RuleName,
28 * );
29 * ```
30 *
31 * @binding
32 */
33 export interface GetSamplingRules extends Binding.Service<
34 GetSamplingRules,
35 "AWS.XRay.GetSamplingRules",
36 () => Effect.Effect<
37 (
38 request?: GetSamplingRulesRequest,
39 ) => Effect.Effect<xray.GetSamplingRulesResult, xray.GetSamplingRulesError>
40 >
41 > {}
42 export const GetSamplingRules = Binding.Service<GetSamplingRules>("AWS.XRay.GetSamplingRules");