1import type {
2 Customer as StripeCustomer,
3 UpdateCustomerError,
4 UpdateCustomerRequest as DistilledUpdateCustomerRequest,
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 { Customer } from "./Customer.ts";
10
11export interface UpdateCustomerRequest extends Omit<
12 DistilledUpdateCustomerRequest,
13 "customer"
14> {}
15
16/**
17 * Update a bound Stripe Customer over HTTP.
18 *
19 * ### Updating a Customer
20 * **Example:** Bind and update
21 * ```typescript
22 * const update = yield* Stripe.UpdateCustomer(alice);
23 * const live = yield* update({ name: "Alice Example" });
24 * ```
25 *
26 * @binding
27 * @product Customer
28 */
29export interface UpdateCustomer extends Binding.Service<
30 UpdateCustomer,
31 "Stripe.UpdateCustomer",
32 (
33 customer: Customer,
34 ) => Effect.Effect<
35 (
36 request?: UpdateCustomerRequest,
37 ) => Effect.Effect<StripeCustomer, UpdateCustomerError, RuntimeContext>
38 >
39> {}
40
41export const UpdateCustomer = Binding.Service<UpdateCustomer>(
42 "Stripe.UpdateCustomer",
43);