| 1 | import type * as mi from "@distilled.cloud/aws/iot-managed-integrations"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { ManagedThing } from "./ManagedThing.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Runtime binding for the `GetManagedThingCertificate` operation (IAM |
| 8 | * action `iotmanagedintegrations:GetManagedThingCertificate`), scoped to |
| 9 | * one {@link ManagedThing}. |
| 10 | * |
| 11 | * Reads the (public) certificate PEM the bound device authenticates with — |
| 12 | * useful for fleet audit and certificate-rotation tooling. Provide the |
| 13 | * implementation with |
| 14 | * `Effect.provide(AWS.IoTManagedIntegrations.GetManagedThingCertificateHttp)`. |
| 15 | * |
| 16 | * ### Reading Device State |
| 17 | * **Example:** Fetch the Device Certificate |
| 18 | * ```typescript |
| 19 | * const getCertificate = |
| 20 | * yield* IoTManagedIntegrations.GetManagedThingCertificate(thing); |
| 21 | * |
| 22 | * const { CertificatePem } = yield* getCertificate(); |
| 23 | * ``` |
| 24 | * |
| 25 | * @binding |
| 26 | */ |
| 27 | export interface GetManagedThingCertificate extends Binding.Service< |
| 28 | GetManagedThingCertificate, |
| 29 | "AWS.IoTManagedIntegrations.GetManagedThingCertificate", |
| 30 | ( |
| 31 | thing: ManagedThing, |
| 32 | ) => Effect.Effect< |
| 33 | () => Effect.Effect< |
| 34 | mi.GetManagedThingCertificateResponse, |
| 35 | mi.GetManagedThingCertificateError |
| 36 | > |
| 37 | > |
| 38 | > {} |
| 39 | export const GetManagedThingCertificate = |
| 40 | Binding.Service<GetManagedThingCertificate>( |
| 41 | "AWS.IoTManagedIntegrations.GetManagedThingCertificate", |
| 42 | ); |