1import type {
2 Account as StripeAccount,
3 UpdateAccountError,
4 UpdateAccountRequest as DistilledUpdateAccountRequest,
5} from "@distilled.cloud/stripe/stripe";
6import type * as Effect from "effect/Effect";
7import * as Binding from "../Binding.ts";
8import type { RuntimeContext } from "../RuntimeContext.ts";
9import type { Account } from "./Account.ts";
10
11export interface UpdateAccountRequest extends Omit<
12 DistilledUpdateAccountRequest,
13 "account"
14> {}
15
16/**
17 * Update a bound Stripe Connect Account over HTTP.
18 *
19 * ### Updating an Account
20 * **Example:** Bind and update
21 * ```typescript
22 * const update = yield* Stripe.UpdateAccount(merchant);
23 * const live = yield* update({ email: "merchant@example.com" });
24 * ```
25 *
26 * @binding
27 * @product Account
28 */
29export interface UpdateAccount extends Binding.Service<
30 UpdateAccount,
31 "Stripe.UpdateAccount",
32 (
33 account: Account,
34 ) => Effect.Effect<
35 (
36 request?: UpdateAccountRequest,
37 ) => Effect.Effect<StripeAccount, UpdateAccountError, RuntimeContext>
38 >
39> {}
40
41export const UpdateAccount = Binding.Service<UpdateAccount>(
42 "Stripe.UpdateAccount",
43);