| 1 | import type * as codeconnections from "@distilled.cloud/aws/codeconnections"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | |
| 5 | /** |
| 6 | * Request for {@link ListHosts}. |
| 7 | */ |
| 8 | export interface ListHostsRequest extends codeconnections.ListHostsInput {} |
| 9 | |
| 10 | /** |
| 11 | * Runtime binding for `codeconnections:ListHosts`. |
| 12 | * |
| 13 | * An account-level operation (no host argument) that enumerates the |
| 14 | * account's hosts — the self-managed provider endpoints (GitHub Enterprise |
| 15 | * Server, GitLab self-managed) that connections attach to. Useful for |
| 16 | * governance sweeps that audit which provider endpoints are registered. |
| 17 | * Provide the implementation with |
| 18 | * `Effect.provide(AWS.CodeConnections.ListHostsHttp)`. |
| 19 | * ### Inspecting a Host |
| 20 | * **Example:** List the Account's Hosts |
| 21 | * ```typescript |
| 22 | * // init — account-level binding takes no resource |
| 23 | * const listHosts = yield* AWS.CodeConnections.ListHosts(); |
| 24 | * |
| 25 | * // runtime |
| 26 | * const result = yield* listHosts(); |
| 27 | * const urls = (result.Hosts ?? []).map((h) => h.ProviderEndpoint); |
| 28 | * ``` |
| 29 | * |
| 30 | * @binding |
| 31 | */ |
| 32 | export interface ListHosts extends Binding.Service< |
| 33 | ListHosts, |
| 34 | "AWS.CodeConnections.ListHosts", |
| 35 | () => Effect.Effect< |
| 36 | ( |
| 37 | request?: ListHostsRequest, |
| 38 | ) => Effect.Effect< |
| 39 | codeconnections.ListHostsOutput, |
| 40 | codeconnections.ListHostsError |
| 41 | > |
| 42 | > |
| 43 | > {} |
| 44 | |
| 45 | export const ListHosts = Binding.Service<ListHosts>( |
| 46 | "AWS.CodeConnections.ListHosts", |
| 47 | ); |