| 1 | import * as cloudwatch from "@distilled.cloud/aws/cloudwatch"; |
| 2 | import * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | |
| 5 | export interface ListManagedInsightRulesRequest |
| 6 | extends cloudwatch.ListManagedInsightRulesInput {} |
| 7 | |
| 8 | /** |
| 9 | * Runtime binding for `cloudwatch:ListManagedInsightRules` — list the |
| 10 | * managed Contributor Insights rules available for a given AWS resource |
| 11 | * ARN. |
| 12 | * |
| 13 | * Provide `CloudWatch.ListManagedInsightRulesHttp` on the hosting Lambda |
| 14 | * Function to satisfy the requirement. |
| 15 | * ### Reading Insight Rules |
| 16 | * **Example:** List Managed Rules for a Resource |
| 17 | * ```typescript |
| 18 | * // init — grants cloudwatch:ListManagedInsightRules |
| 19 | * const listManagedInsightRules = yield* AWS.CloudWatch.ListManagedInsightRules(); |
| 20 | * |
| 21 | * // runtime — only specific AWS resource types support managed rules; |
| 22 | * // an unsupported ARN fails with the typed InvalidParameterValueException |
| 23 | * const result = yield* listManagedInsightRules({ |
| 24 | * ResourceARN: yield* table.tableArn, |
| 25 | * }); |
| 26 | * const rules = result.ManagedRules ?? []; |
| 27 | * ``` |
| 28 | * |
| 29 | * @binding |
| 30 | */ |
| 31 | export interface ListManagedInsightRules extends Binding.Service< |
| 32 | ListManagedInsightRules, |
| 33 | "AWS.CloudWatch.ListManagedInsightRules", |
| 34 | () => Effect.Effect< |
| 35 | ( |
| 36 | request?: ListManagedInsightRulesRequest, |
| 37 | ) => Effect.Effect< |
| 38 | cloudwatch.ListManagedInsightRulesOutput, |
| 39 | cloudwatch.ListManagedInsightRulesError |
| 40 | > |
| 41 | > |
| 42 | > {} |
| 43 | |
| 44 | export const ListManagedInsightRules = Binding.Service<ListManagedInsightRules>( |
| 45 | "AWS.CloudWatch.ListManagedInsightRules", |
| 46 | ); |