1import type * as devopsguru from "@distilled.cloud/aws/devops-guru";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4
5/**
6 * Runtime binding for `devops-guru:SearchInsights`.
7 *
8 * Searches the account's insights within a start-time range, filtered by severity, status, service, or resource collection. The service
9 * requires both `FromTime` and `ToTime` on the range.
10 * Provide the implementation with
11 * `Effect.provide(AWS.DevOpsGuru.SearchInsightsHttp)`.
12 * ### Inspecting Insights
13 * **Example:** Search Insights by Severity
14 * ```typescript
15 * // init — account-level binding, no resource argument
16 * const searchInsights = yield* AWS.DevOpsGuru.SearchInsights();
17 *
18 * // runtime
19 * const { ReactiveInsights } = yield* searchInsights({
20 * Type: "REACTIVE",
21 * StartTimeRange: {
22 * FromTime: new Date(Date.now() - 24 * 3600_000),
23 * ToTime: new Date(),
24 * },
25 * Filters: { Severities: ["HIGH"] },
26 * });
27 * yield* Effect.log(`high severity: ${ReactiveInsights?.length}`);
28 * ```
29 *
30 * @binding
31 */
32export interface SearchInsights extends Binding.Service<
33 SearchInsights,
34 "AWS.DevOpsGuru.SearchInsights",
35 () => Effect.Effect<
36 (
37 request: devopsguru.SearchInsightsRequest,
38 ) => Effect.Effect<
39 devopsguru.SearchInsightsResponse,
40 devopsguru.SearchInsightsError
41 >
42 >
43> {}
44export const SearchInsights = Binding.Service<SearchInsights>(
45 "AWS.DevOpsGuru.SearchInsights",
46);