| 1 | import type { |
| 2 | FileLink as StripeFileLink, |
| 3 | UpdateFileLinkError, |
| 4 | UpdateFileLinkRequest as DistilledUpdateFileLinkRequest, |
| 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 { FileLink } from "./FileLink.ts"; |
| 10 | |
| 11 | export interface UpdateFileLinkRequest extends Omit< |
| 12 | DistilledUpdateFileLinkRequest, |
| 13 | "link" |
| 14 | > {} |
| 15 | |
| 16 | /** |
| 17 | * Update a bound Stripe File Link over HTTP. Expired links cannot be |
| 18 | * updated. |
| 19 | * |
| 20 | * ### Updating a File Link |
| 21 | * **Example:** Bind and expire |
| 22 | * ```typescript |
| 23 | * const update = yield* Stripe.UpdateFileLink(link); |
| 24 | * const live = yield* update({ expires_at: "now" }); |
| 25 | * ``` |
| 26 | * |
| 27 | * @binding |
| 28 | * @product Files |
| 29 | */ |
| 30 | export interface UpdateFileLink extends Binding.Service< |
| 31 | UpdateFileLink, |
| 32 | "Stripe.UpdateFileLink", |
| 33 | ( |
| 34 | fileLink: FileLink, |
| 35 | ) => Effect.Effect< |
| 36 | ( |
| 37 | request?: UpdateFileLinkRequest, |
| 38 | ) => Effect.Effect<StripeFileLink, UpdateFileLinkError, RuntimeContext> |
| 39 | > |
| 40 | > {} |
| 41 | |
| 42 | export const UpdateFileLink = Binding.Service<UpdateFileLink>( |
| 43 | "Stripe.UpdateFileLink", |
| 44 | ); |