| 1 | import type * as transfer from "@distilled.cloud/aws/transfer"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Server } from "./Server.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Runtime binding for `transfer:StartServer`. |
| 8 | * |
| 9 | * Brings a stopped {@link Server} from `OFFLINE` back to `ONLINE` so it can |
| 10 | * accept file transfers again — the `ServerId` is injected from the binding. |
| 11 | * Paired with {@link StopServer} this enables runtime schedules that park |
| 12 | * the endpoint outside business hours. The call is asynchronous: the server |
| 13 | * passes through `STARTING`; observe progress with {@link DescribeServer}. |
| 14 | * Starting a server that is not `OFFLINE` fails with the typed |
| 15 | * `InvalidRequestException`. Provide the implementation with |
| 16 | * `Effect.provide(AWS.Transfer.StartServerHttp)`. |
| 17 | * ### Controlling Server Availability |
| 18 | * **Example:** Bring the Server Online |
| 19 | * ```typescript |
| 20 | * // init — bind the operation to the server |
| 21 | * const startServer = yield* AWS.Transfer.StartServer(server); |
| 22 | * |
| 23 | * // runtime |
| 24 | * yield* startServer(); |
| 25 | * ``` |
| 26 | * |
| 27 | * @binding |
| 28 | */ |
| 29 | export interface StartServer extends Binding.Service< |
| 30 | StartServer, |
| 31 | "AWS.Transfer.StartServer", |
| 32 | ( |
| 33 | server: Server, |
| 34 | ) => Effect.Effect< |
| 35 | ( |
| 36 | request?: Omit<transfer.StartServerRequest, "ServerId">, |
| 37 | ) => Effect.Effect<transfer.StartServerResponse, transfer.StartServerError> |
| 38 | > |
| 39 | > {} |
| 40 | export const StartServer = Binding.Service<StartServer>( |
| 41 | "AWS.Transfer.StartServer", |
| 42 | ); |