| 1 | import type { |
| 2 | BillingCreditGrant as StripeCreditGrant, |
| 3 | UpdateBillingCreditGrantError, |
| 4 | UpdateBillingCreditGrantRequest, |
| 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 { CreditGrant } from "./CreditGrant.ts"; |
| 10 | |
| 11 | export interface UpdateCreditGrantRequest extends Omit< |
| 12 | UpdateBillingCreditGrantRequest, |
| 13 | "id" |
| 14 | > {} |
| 15 | |
| 16 | /** |
| 17 | * Update a bound Stripe Credit Grant over HTTP. Mutable fields are |
| 18 | * `expires_at` and `metadata`. |
| 19 | * |
| 20 | * ### Updating a Credit Grant |
| 21 | * **Example:** Bind and update |
| 22 | * ```typescript |
| 23 | * const update = yield* Stripe.UpdateCreditGrant(grant); |
| 24 | * const live = yield* update({ expires_at: 4102444800 }); |
| 25 | * ``` |
| 26 | * |
| 27 | * @binding |
| 28 | * @product Billing |
| 29 | */ |
| 30 | export interface UpdateCreditGrant extends Binding.Service< |
| 31 | UpdateCreditGrant, |
| 32 | "Stripe.UpdateCreditGrant", |
| 33 | ( |
| 34 | grant: CreditGrant, |
| 35 | ) => Effect.Effect< |
| 36 | ( |
| 37 | request?: UpdateCreditGrantRequest, |
| 38 | ) => Effect.Effect< |
| 39 | StripeCreditGrant, |
| 40 | UpdateBillingCreditGrantError, |
| 41 | RuntimeContext |
| 42 | > |
| 43 | > |
| 44 | > {} |
| 45 | |
| 46 | export const UpdateCreditGrant = Binding.Service<UpdateCreditGrant>( |
| 47 | "Stripe.UpdateCreditGrant", |
| 48 | ); |