import type * as SD from "@distilled.cloud/aws/servicediscovery";
import * as Binding from "alchemy/Binding";
import type * as Effect from "effect/Effect";
import type { Service } from "./Service.ts";
/**
* `UpdateInstanceCustomHealthStatus` request with `ServiceId` injected from
* the bound {@link Service}.
*/
export interface UpdateInstanceCustomHealthStatusRequest extends Omit<
SD.UpdateInstanceCustomHealthStatusRequest,
"ServiceId"
> {}
/**
* Runtime binding for `servicediscovery:UpdateInstanceCustomHealthStatus` —
* pushes an instance's health status (`HEALTHY` / `UNHEALTHY`) for a
* service configured with `healthCheckCustomConfig`. This is the push-based
* health mechanism: the workload reports its own health instead of being
* probed by Route 53. Provide the implementation with
* `Effect.provide(AWS.CloudMap.UpdateInstanceCustomHealthStatusHttp)`.
* ### Instance Health
* **Example:** Report the Instance Healthy
* ```typescript
* const updateInstanceCustomHealthStatus =
* yield* AWS.CloudMap.UpdateInstanceCustomHealthStatus(service);
*
* yield* updateInstanceCustomHealthStatus({
* InstanceId: "worker-1",
* Status: "HEALTHY",
* });
* ```
*
* @binding
*/
export interface UpdateInstanceCustomHealthStatus extends Binding.Service<
UpdateInstanceCustomHealthStatus,
"AWS.CloudMap.UpdateInstanceCustomHealthStatus",
<S extends Service>(
service: S,
) => Effect.Effect<
(
request: UpdateInstanceCustomHealthStatusRequest,
) => Effect.Effect<
SD.UpdateInstanceCustomHealthStatusResponse,
SD.UpdateInstanceCustomHealthStatusError
>
>
> {}
export const UpdateInstanceCustomHealthStatus = Binding.Service<UpdateInstanceCustomHealthStatus>(
"AWS.CloudMap.UpdateInstanceCustomHealthStatus",
);