Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CODEGEN_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5abe0e44caedb3474ee672265284096ec89e0fa3
4b8685a69ee5061fca67cc7e3fd69c8e6890b24e
12 changes: 12 additions & 0 deletions stripe/events/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,10 @@
V2CoreAccountIncludingDefaultsUpdatedEvent as V2CoreAccountIncludingDefaultsUpdatedEvent,
V2CoreAccountIncludingDefaultsUpdatedEventNotification as V2CoreAccountIncludingDefaultsUpdatedEventNotification,
)
from stripe.events._v2_core_account_including_future_requirements_updated_event import (
V2CoreAccountIncludingFutureRequirementsUpdatedEvent as V2CoreAccountIncludingFutureRequirementsUpdatedEvent,
V2CoreAccountIncludingFutureRequirementsUpdatedEventNotification as V2CoreAccountIncludingFutureRequirementsUpdatedEventNotification,
)
from stripe.events._v2_core_account_including_identity_updated_event import (
V2CoreAccountIncludingIdentityUpdatedEvent as V2CoreAccountIncludingIdentityUpdatedEvent,
V2CoreAccountIncludingIdentityUpdatedEventNotification as V2CoreAccountIncludingIdentityUpdatedEventNotification,
Expand Down Expand Up @@ -1045,6 +1049,14 @@
"stripe.events._v2_core_account_including_defaults_updated_event",
False,
),
"V2CoreAccountIncludingFutureRequirementsUpdatedEvent": (
"stripe.events._v2_core_account_including_future_requirements_updated_event",
False,
),
"V2CoreAccountIncludingFutureRequirementsUpdatedEventNotification": (
"stripe.events._v2_core_account_including_future_requirements_updated_event",
False,
),
"V2CoreAccountIncludingIdentityUpdatedEvent": (
"stripe.events._v2_core_account_including_identity_updated_event",
False,
Expand Down
12 changes: 12 additions & 0 deletions stripe/events/_event_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@
from stripe.events._v2_core_account_including_defaults_updated_event import (
V2CoreAccountIncludingDefaultsUpdatedEventNotification,
)
from stripe.events._v2_core_account_including_future_requirements_updated_event import (
V2CoreAccountIncludingFutureRequirementsUpdatedEventNotification,
)
from stripe.events._v2_core_account_including_identity_updated_event import (
V2CoreAccountIncludingIdentityUpdatedEventNotification,
)
Expand Down Expand Up @@ -677,6 +680,10 @@
"stripe.events._v2_core_account_including_defaults_updated_event",
"V2CoreAccountIncludingDefaultsUpdatedEvent",
),
"v2.core.account[future_requirements].updated": (
"stripe.events._v2_core_account_including_future_requirements_updated_event",
"V2CoreAccountIncludingFutureRequirementsUpdatedEvent",
),
"v2.core.account[identity].updated": (
"stripe.events._v2_core_account_including_identity_updated_event",
"V2CoreAccountIncludingIdentityUpdatedEvent",
Expand Down Expand Up @@ -1304,6 +1311,10 @@ def get_v2_event_class(type_: str):
"stripe.events._v2_core_account_including_defaults_updated_event",
"V2CoreAccountIncludingDefaultsUpdatedEventNotification",
),
"v2.core.account[future_requirements].updated": (
"stripe.events._v2_core_account_including_future_requirements_updated_event",
"V2CoreAccountIncludingFutureRequirementsUpdatedEventNotification",
),
"v2.core.account[identity].updated": (
"stripe.events._v2_core_account_including_identity_updated_event",
"V2CoreAccountIncludingIdentityUpdatedEventNotification",
Expand Down Expand Up @@ -1775,6 +1786,7 @@ def get_v2_event_notification_class(type_: str):
"V2CoreAccountIncludingConfigurationStorerCapabilityStatusUpdatedEventNotification",
"V2CoreAccountIncludingConfigurationStorerUpdatedEventNotification",
"V2CoreAccountIncludingDefaultsUpdatedEventNotification",
"V2CoreAccountIncludingFutureRequirementsUpdatedEventNotification",
"V2CoreAccountIncludingIdentityUpdatedEventNotification",
"V2CoreAccountIncludingRequirementsUpdatedEventNotification",
"V2CoreAccountLinkReturnedEventNotification",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
# -*- coding: utf-8 -*-
# File generated from our OpenAPI spec
from stripe._stripe_object import StripeObject
from stripe._util import get_api_mode
from stripe.v2.core._event import Event, EventNotification, RelatedObject
from typing import Any, Dict, cast
from typing_extensions import Literal, TYPE_CHECKING, override

if TYPE_CHECKING:
from stripe._stripe_client import StripeClient
from stripe.v2.core._account import Account


class V2CoreAccountIncludingFutureRequirementsUpdatedEventNotification(
EventNotification,
):
LOOKUP_TYPE = "v2.core.account[future_requirements].updated"
type: Literal["v2.core.account[future_requirements].updated"]
related_object: RelatedObject

def __init__(
self, parsed_body: Dict[str, Any], client: "StripeClient"
) -> None:
super().__init__(
parsed_body,
client,
)
self.related_object = RelatedObject(parsed_body["related_object"])

@override
def fetch_event(
self,
) -> "V2CoreAccountIncludingFutureRequirementsUpdatedEvent":
return cast(
"V2CoreAccountIncludingFutureRequirementsUpdatedEvent",
super().fetch_event(),
)

def fetch_related_object(self) -> "Account":
response = self._client.raw_request(
"get",
self.related_object.url,
stripe_context=self.context,
usage=["fetch_related_object"],
)
return cast(
"Account",
self._client.deserialize(
response,
api_mode=get_api_mode(self.related_object.url),
),
)

@override
async def fetch_event_async(
self,
) -> "V2CoreAccountIncludingFutureRequirementsUpdatedEvent":
return cast(
"V2CoreAccountIncludingFutureRequirementsUpdatedEvent",
await super().fetch_event_async(),
)

async def fetch_related_object_async(self) -> "Account":
response = await self._client.raw_request_async(
"get",
self.related_object.url,
stripe_context=self.context,
usage=["fetch_related_object"],
)
return cast(
"Account",
self._client.deserialize(
response,
api_mode=get_api_mode(self.related_object.url),
),
)


class V2CoreAccountIncludingFutureRequirementsUpdatedEvent(Event):
LOOKUP_TYPE = "v2.core.account[future_requirements].updated"
type: Literal["v2.core.account[future_requirements].updated"]

class RelatedObject(StripeObject):
id: str
"""
Unique identifier for the object relevant to the event.
"""
type: str
"""
Type of the object relevant to the event.
"""
url: str
"""
URL to retrieve the resource.
"""

related_object: RelatedObject
"""
Object containing the reference to API resource relevant to the event
"""

def fetch_related_object(self) -> "Account":
"""
Retrieves the related object from the API. Makes an API request on every call.
"""
return cast(
"Account",
self._requestor.request(
"get",
self.related_object.url,
base_address="api",
options={"stripe_context": self.context},
),
)
5 changes: 5 additions & 0 deletions stripe/params/v2/money_management/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
OutboundPaymentCreateParams as OutboundPaymentCreateParams,
OutboundPaymentCreateParamsAmount as OutboundPaymentCreateParamsAmount,
OutboundPaymentCreateParamsDeliveryOptions as OutboundPaymentCreateParamsDeliveryOptions,
OutboundPaymentCreateParamsDeliveryOptionsPaperCheck as OutboundPaymentCreateParamsDeliveryOptionsPaperCheck,
OutboundPaymentCreateParamsFrom as OutboundPaymentCreateParamsFrom,
OutboundPaymentCreateParamsRecipientNotification as OutboundPaymentCreateParamsRecipientNotification,
OutboundPaymentCreateParamsTo as OutboundPaymentCreateParamsTo,
Expand Down Expand Up @@ -299,6 +300,10 @@
"stripe.params.v2.money_management._outbound_payment_create_params",
False,
),
"OutboundPaymentCreateParamsDeliveryOptionsPaperCheck": (
"stripe.params.v2.money_management._outbound_payment_create_params",
False,
),
"OutboundPaymentCreateParamsFrom": (
"stripe.params.v2.money_management._outbound_payment_create_params",
False,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,34 @@ class OutboundPaymentCreateParamsAmount(TypedDict):


class OutboundPaymentCreateParamsDeliveryOptions(TypedDict):
speed: NotRequired[Literal["instant", "next_business_day", "standard"]]
"""
Open Enum. Speed of the payout.
"""
bank_account: NotRequired[Literal["automatic", "local", "wire"]]
"""
Open Enum. Method for bank account.
"""
speed: NotRequired[Literal["instant", "next_business_day", "standard"]]
paper_check: NotRequired[
"OutboundPaymentCreateParamsDeliveryOptionsPaperCheck"
]
"""
Open Enum. Speed of the payout.
Delivery options for paper check.
"""


class OutboundPaymentCreateParamsDeliveryOptionsPaperCheck(TypedDict):
memo: NotRequired[str]
"""
Memo printed on the memo field of the check.
"""
shipping_speed: NotRequired[Literal["priority", "standard"]]
"""
Open Enum. Shipping speed of the paper check. Defaults to standard.
"""
signature: str
"""
Signature for the paper check.
"""


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ class OutboundPaymentQuoteCreateParamsAmount(TypedDict):


class OutboundPaymentQuoteCreateParamsDeliveryOptions(TypedDict):
bank_account: NotRequired[Literal["automatic", "local", "wire"]]
"""
Open Enum. Method for bank account.
"""
speed: NotRequired[Literal["instant", "next_business_day", "standard"]]
"""
Open Enum. Speed of the payout.
"""
bank_account: NotRequired[Literal["automatic", "local", "wire"]]
"""
Open Enum. Method for bank account.
"""


class OutboundPaymentQuoteCreateParamsFrom(TypedDict):
Expand Down
20 changes: 10 additions & 10 deletions stripe/v2/iam/_api_key_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def create(
options: Optional["RequestOptions"] = None,
) -> "ApiKey":
"""
Create an API key.
Create an API key. To create a secret key in livemode, a public key for encryption must be provided.
"""
return cast(
"ApiKey",
Expand All @@ -83,7 +83,7 @@ async def create_async(
options: Optional["RequestOptions"] = None,
) -> "ApiKey":
"""
Create an API key.
Create an API key. To create a secret key in livemode, a public key for encryption must be provided.
"""
return cast(
"ApiKey",
Expand All @@ -103,7 +103,7 @@ def retrieve(
options: Optional["RequestOptions"] = None,
) -> "ApiKey":
"""
Retrieve an API key.
Retrieve an API key. For livemode secret keys, secret tokens are only returned on creation, and never returned here.
"""
return cast(
"ApiKey",
Expand All @@ -123,7 +123,7 @@ async def retrieve_async(
options: Optional["RequestOptions"] = None,
) -> "ApiKey":
"""
Retrieve an API key.
Retrieve an API key. For livemode secret keys, secret tokens are only returned on creation, and never returned here.
"""
return cast(
"ApiKey",
Expand All @@ -143,7 +143,7 @@ def update(
options: Optional["RequestOptions"] = None,
) -> "ApiKey":
"""
Update an API key.
Update an API key. Only parameters that are specified in the request will be updated.
"""
return cast(
"ApiKey",
Expand All @@ -163,7 +163,7 @@ async def update_async(
options: Optional["RequestOptions"] = None,
) -> "ApiKey":
"""
Update an API key.
Update an API key. Only parameters that are specified in the request will be updated.
"""
return cast(
"ApiKey",
Expand All @@ -183,7 +183,7 @@ def expire(
options: Optional["RequestOptions"] = None,
) -> "ApiKey":
"""
Expire an API key.
Expire an API key. The specified key becomes invalid immediately.
"""
return cast(
"ApiKey",
Expand All @@ -203,7 +203,7 @@ async def expire_async(
options: Optional["RequestOptions"] = None,
) -> "ApiKey":
"""
Expire an API key.
Expire an API key. The specified key becomes invalid immediately.
"""
return cast(
"ApiKey",
Expand All @@ -223,7 +223,7 @@ def rotate(
options: Optional["RequestOptions"] = None,
) -> "ApiKey":
"""
Rotate an API key.
Rotate an API key. A new key with the same properties is created and returned. The existing key is expired immediately, unless an expiry time is specified.
"""
return cast(
"ApiKey",
Expand All @@ -243,7 +243,7 @@ async def rotate_async(
options: Optional["RequestOptions"] = None,
) -> "ApiKey":
"""
Rotate an API key.
Rotate an API key. A new key with the same properties is created and returned. The existing key is expired immediately, unless an expiry time is specified.
"""
return cast(
"ApiKey",
Expand Down
Loading