| 1 | import type * as servicedirectory from "@distilled.cloud/gcp/servicedirectory_v1"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { RuntimeContext } from "../../RuntimeContext.ts"; |
| 5 | import type { Service } from "./Service.ts"; |
| 6 | |
| 7 | export interface ResolveRequest extends Omit< |
| 8 | servicedirectory.ResolveProjectsLocationsNamespacesServicesRequest, |
| 9 | "name" |
| 10 | > {} |
| 11 | |
| 12 | /** |
| 13 | * Runtime binding for Service Directory `services.resolve`. |
| 14 | * |
| 15 | * Looks up a {@link Service} and its endpoints. Bind this operation in a |
| 16 | * Function/Action init phase. Provide {@link ResolveHttp}. |
| 17 | * |
| 18 | * ### Resolving a Service |
| 19 | * **Example:** Resolve endpoints |
| 20 | * ```typescript |
| 21 | * const resolve = yield* GCP.ServiceDirectory.Resolve(api); |
| 22 | * const { service } = yield* resolve(); |
| 23 | * ``` |
| 24 | * |
| 25 | * **Example:** Filter endpoints |
| 26 | * ```typescript |
| 27 | * const { service } = yield* resolve({ |
| 28 | * body: { endpointFilter: "port>8080", maxEndpoints: 10 }, |
| 29 | * }); |
| 30 | * ``` |
| 31 | * |
| 32 | * @binding |
| 33 | * @category ServiceDirectory |
| 34 | */ |
| 35 | export interface Resolve extends Binding.Service< |
| 36 | Resolve, |
| 37 | "GCP.ServiceDirectory.Resolve", |
| 38 | ( |
| 39 | service: Service, |
| 40 | ) => Effect.Effect< |
| 41 | ( |
| 42 | request?: ResolveRequest, |
| 43 | ) => Effect.Effect< |
| 44 | servicedirectory.ResolveServiceResponse, |
| 45 | servicedirectory.ResolveProjectsLocationsNamespacesServicesError, |
| 46 | RuntimeContext |
| 47 | > |
| 48 | > |
| 49 | > {} |
| 50 | |
| 51 | export const Resolve = Binding.Service<Resolve>("GCP.ServiceDirectory.Resolve"); |