1import type * as transfer from "@distilled.cloud/aws/transfer";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { Server } from "./Server.ts";
5
6/**
7 * Runtime binding for `transfer:StopServer`.
8 *
9 * Takes the bound {@link Server} from `ONLINE` to `OFFLINE` so it stops
10 * accepting file transfers — the `ServerId` is injected from the binding.
11 * Server and user configuration are unaffected. Note stopping does NOT
12 * pause billing; only deleting the server does. The call is asynchronous:
13 * the server passes through `STOPPING`; observe progress with
14 * {@link DescribeServer}. Stopping a server that is not `ONLINE` fails with
15 * the typed `InvalidRequestException`. Provide the implementation with
16 * `Effect.provide(AWS.Transfer.StopServerHttp)`.
17 * ### Controlling Server Availability
18 * **Example:** Take the Server Offline
19 * ```typescript
20 * // init — bind the operation to the server
21 * const stopServer = yield* AWS.Transfer.StopServer(server);
22 *
23 * // runtime
24 * yield* stopServer();
25 * ```
26 *
27 * @binding
28 */
29export interface StopServer extends Binding.Service<
30 StopServer,
31 "AWS.Transfer.StopServer",
32 (
33 server: Server,
34 ) => Effect.Effect<
35 (
36 request?: Omit<transfer.StopServerRequest, "ServerId">,
37 ) => Effect.Effect<transfer.StopServerResponse, transfer.StopServerError>
38 >
39> {}
40export const StopServer = Binding.Service<StopServer>(
41 "AWS.Transfer.StopServer",
42);