// Generated by @novaclaw/httpapi-codegen. Do not edit.
import { Effect, Schema } from "effect"
import { Sse } from "effect/unstable/encoding"
import { HttpClientError } from "effect/unstable/http"
import { HttpApiClient, HttpApiEndpoint, HttpApiGroup } from "effect/unstable/httpapi"
import { ClientError } from "./client-error"

const Endpoint0Success = Schema.String

export const Group2 = HttpApiGroup.make("system", { topLevel: true }).add(
  HttpApiEndpoint.make("GET")("status", "/status", { success: Endpoint0Success }),
)

type RawGroup = HttpApiClient.Client<typeof Group2>

const Endpoint0DeclaredError = Schema.Never
const mapEndpoint0Error = (error: unknown) =>
  HttpClientError.isHttpClientError(error) || Schema.isSchemaError(error) || Sse.Retry.is(error)
    ? new ClientError({ cause: error })
    : Schema.is(Endpoint0DeclaredError)(error)
      ? error
      : new ClientError({ cause: error })
const Endpoint0 = (raw: RawGroup) => () => raw["status"]({}).pipe(Effect.mapError(mapEndpoint0Error))

export const adaptGroup2 = (raw: RawGroup) => ({ status: Endpoint0(raw) })
