| 1 | import type { |
| 2 | ExternalAccount as StripeExternalAccount, |
| 3 | GetAccountExternalAccountError, |
| 4 | GetAccountExternalAccountRequest, |
| 5 | } from "@distilled.cloud/stripe/stripe"; |
| 6 | import type * as Effect from "effect/Effect"; |
| 7 | import * as Binding from "../Binding.ts"; |
| 8 | import type { RuntimeContext } from "../RuntimeContext.ts"; |
| 9 | import type { AccountExternalAccount } from "./AccountExternalAccount.ts"; |
| 10 | |
| 11 | export interface RetrieveAccountExternalAccountRequest extends Omit< |
| 12 | GetAccountExternalAccountRequest, |
| 13 | "id" | "account" |
| 14 | > {} |
| 15 | |
| 16 | /** |
| 17 | * Retrieve a bound Stripe Account External Account over HTTP. |
| 18 | * |
| 19 | * ### Reading an External Account |
| 20 | * **Example:** Bind and retrieve |
| 21 | * ```typescript |
| 22 | * const retrieve = yield* Stripe.RetrieveAccountExternalAccount(payout); |
| 23 | * const live = yield* retrieve(); |
| 24 | * ``` |
| 25 | * |
| 26 | * @binding |
| 27 | * @product Account |
| 28 | */ |
| 29 | export interface RetrieveAccountExternalAccount extends Binding.Service< |
| 30 | RetrieveAccountExternalAccount, |
| 31 | "Stripe.RetrieveAccountExternalAccount", |
| 32 | ( |
| 33 | externalAccount: AccountExternalAccount, |
| 34 | ) => Effect.Effect< |
| 35 | ( |
| 36 | request?: RetrieveAccountExternalAccountRequest, |
| 37 | ) => Effect.Effect< |
| 38 | StripeExternalAccount, |
| 39 | GetAccountExternalAccountError, |
| 40 | RuntimeContext |
| 41 | > |
| 42 | > |
| 43 | > {} |
| 44 | |
| 45 | export const RetrieveAccountExternalAccount = |
| 46 | Binding.Service<RetrieveAccountExternalAccount>( |
| 47 | "Stripe.RetrieveAccountExternalAccount", |
| 48 | ); |