| 1 |
# -*- coding: utf-8 -*- |
| 2 |
# File generated from our OpenAPI spec |
| 3 |
from stripe._stripe_object import StripeObject |
| 4 |
from typing import ClassVar, Dict, Optional |
| 5 |
from typing_extensions import Literal |
| 6 |
|
| 7 |
|
| 8 |
class Plan(StripeObject): |
| 9 |
""" |
| 10 |
ReservePlans are used to automatically place holds on a merchant's funds until the plan expires. It takes a portion of each incoming Charge (including those resulting from a Transfer from a platform account). |
| 11 |
""" |
| 12 |
|
| 13 |
OBJECT_NAME: ClassVar[Literal["reserve.plan"]] = "reserve.plan" |
| 14 |
|
| 15 |
class FixedRelease(StripeObject): |
| 16 |
release_after: int |
| 17 |
""" |
| 18 |
The time after which all reserved funds are requested for release. |
| 19 |
""" |
| 20 |
scheduled_release: int |
| 21 |
""" |
| 22 |
The time at which reserved funds are scheduled for release, automatically set to midnight UTC of the day after `release_after`. |
| 23 |
""" |
| 24 |
|
| 25 |
class RollingRelease(StripeObject): |
| 26 |
days_after_charge: int |
| 27 |
""" |
| 28 |
The number of days to reserve funds before releasing. |
| 29 |
""" |
| 30 |
expires_on: Optional[int] |
| 31 |
""" |
| 32 |
The time at which the ReservePlan expires. |
| 33 |
""" |
| 34 |
|
| 35 |
created: int |
| 36 |
""" |
| 37 |
Time at which the object was created. Measured in seconds since the Unix epoch. |
| 38 |
""" |
| 39 |
created_by: Literal["application", "stripe"] |
| 40 |
""" |
| 41 |
Indicates which party created this ReservePlan. |
| 42 |
""" |
| 43 |
currency: Optional[str] |
| 44 |
""" |
| 45 |
Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). An unset currency indicates that the plan applies to all currencies. |
| 46 |
""" |
| 47 |
disabled_at: Optional[int] |
| 48 |
""" |
| 49 |
Time at which the ReservePlan was disabled. |
| 50 |
""" |
| 51 |
fixed_release: Optional[FixedRelease] |
| 52 |
id: str |
| 53 |
""" |
| 54 |
Unique identifier for the object. |
| 55 |
""" |
| 56 |
livemode: bool |
| 57 |
""" |
| 58 |
Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. |
| 59 |
""" |
| 60 |
metadata: Optional[Dict[str, str]] |
| 61 |
""" |
| 62 |
Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. |
| 63 |
""" |
| 64 |
object: Literal["reserve.plan"] |
| 65 |
""" |
| 66 |
String representing the object's type. Objects of the same type share the same value. |
| 67 |
""" |
| 68 |
percent: int |
| 69 |
""" |
| 70 |
The percent of each Charge to reserve. |
| 71 |
""" |
| 72 |
rolling_release: Optional[RollingRelease] |
| 73 |
status: Literal["active", "disabled", "expired"] |
| 74 |
""" |
| 75 |
The current status of the ReservePlan. The ReservePlan only affects charges if it is `active`. |
| 76 |
""" |
| 77 |
type: Literal["fixed_release", "rolling_release"] |
| 78 |
""" |
| 79 |
The type of the ReservePlan. |
| 80 |
""" |
| 81 |
_inner_class_types = { |
| 82 |
"fixed_release": FixedRelease, |
| 83 |
"rolling_release": RollingRelease, |
| 84 |
} |