diff options
| author | David Brownman <109395161+xavdid-stripe@users.noreply.github.com> | 2025-09-29 10:13:38 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-29 10:13:38 -0700 |
| commit | 86d486093e4274b541ae5aa31593bc88be0d7601 (patch) | |
| tree | db76b5cf1c879b368d3696a04a9faa5d99784350 | |
| parent | 5a5a1fb778922399a60b331eef1968c96d064411 (diff) | |
move v2.event to v2.core.event (#1602)
| -rw-r--r-- | examples/event_notification_webhook_handler.py | 8 | ||||
| -rw-r--r-- | stripe/_object_classes.py | 4 | ||||
| -rw-r--r-- | stripe/_stripe_client.py | 2 | ||||
| -rw-r--r-- | stripe/events/__init__.py | 8 | ||||
| -rw-r--r-- | stripe/events/_v1_billing_meter_error_report_triggered_event.py | 2 | ||||
| -rw-r--r-- | stripe/events/_v1_billing_meter_no_meter_found_event.py | 2 | ||||
| -rw-r--r-- | stripe/events/_v2_core_event_destination_ping_event.py | 4 | ||||
| -rw-r--r-- | stripe/v2/__init__.py | 9 | ||||
| -rw-r--r-- | stripe/v2/core/__init__.py | 15 | ||||
| -rw-r--r-- | stripe/v2/core/_event.py (renamed from stripe/v2/_event.py) | 0 | ||||
| -rw-r--r-- | stripe/v2/core/_event_destination.py (renamed from stripe/v2/_event_destination.py) | 0 | ||||
| -rw-r--r-- | stripe/v2/core/_event_destination_service.py | 4 | ||||
| -rw-r--r-- | stripe/v2/core/_event_service.py | 2 | ||||
| -rw-r--r-- | tests/test_stripe_client.py | 2 | ||||
| -rw-r--r-- | tests/test_stripe_context.py | 2 | ||||
| -rw-r--r-- | tests/test_v2_event.py | 2 |
16 files changed, 42 insertions, 24 deletions
diff --git a/examples/event_notification_webhook_handler.py b/examples/event_notification_webhook_handler.py index 3e5ffc86..e877de19 100644 --- a/examples/event_notification_webhook_handler.py +++ b/examples/event_notification_webhook_handler.py @@ -13,6 +13,14 @@ In this example, we: import os from stripe import StripeClient +from stripe import Event +from stripe.v2.core import Event as V2Event, EventNotification +from stripe.events import ( + V2CoreEventDestinationPingEventNotification, + V1BillingMeterErrorReportTriggeredEvent, + UnknownEventNotification, + ALL_EVENT_NOTIFICATIONS, +) from flask import Flask, request, jsonify diff --git a/stripe/_object_classes.py b/stripe/_object_classes.py index 7a915c6e..a2a4e4ab 100644 --- a/stripe/_object_classes.py +++ b/stripe/_object_classes.py @@ -153,7 +153,7 @@ V2_OBJECT_CLASSES = { stripe.v2.billing.MeterEvent.OBJECT_NAME: stripe.v2.billing.MeterEvent, stripe.v2.billing.MeterEventAdjustment.OBJECT_NAME: stripe.v2.billing.MeterEventAdjustment, stripe.v2.billing.MeterEventSession.OBJECT_NAME: stripe.v2.billing.MeterEventSession, - stripe.v2.Event.OBJECT_NAME: stripe.v2.Event, - stripe.v2.EventDestination.OBJECT_NAME: stripe.v2.EventDestination, + stripe.v2.core.Event.OBJECT_NAME: stripe.v2.core.Event, + stripe.v2.core.EventDestination.OBJECT_NAME: stripe.v2.core.EventDestination, # V2 Object classes: The end of the section generated from our OpenAPI spec } diff --git a/stripe/_stripe_client.py b/stripe/_stripe_client.py index 11e0ee6b..ae3c8e1a 100644 --- a/stripe/_stripe_client.py +++ b/stripe/_stripe_client.py @@ -27,7 +27,7 @@ from stripe._stripe_response import StripeResponse from stripe._util import _convert_to_stripe_object, get_api_mode, deprecated # noqa: F401 from stripe._webhook import Webhook, WebhookSignature from stripe._event import Event -from stripe.v2._event import EventNotification +from stripe.v2.core._event import EventNotification from typing import Any, Dict, Optional, Union, cast from typing_extensions import TYPE_CHECKING diff --git a/stripe/events/__init__.py b/stripe/events/__init__.py index caaad836..7288f57d 100644 --- a/stripe/events/__init__.py +++ b/stripe/events/__init__.py @@ -1,5 +1,10 @@ # -*- coding: utf-8 -*- -# File generated from our OpenAPI spec + +from stripe.v2.core._event import ( + UnknownEventNotification as UnknownEventNotification, +) + +# The beginning of the section generated from our OpenAPI spec from stripe.events._event_classes import ( ALL_EVENT_NOTIFICATIONS as ALL_EVENT_NOTIFICATIONS, ) @@ -15,3 +20,4 @@ from stripe.events._v2_core_event_destination_ping_event import ( V2CoreEventDestinationPingEvent as V2CoreEventDestinationPingEvent, V2CoreEventDestinationPingEventNotification as V2CoreEventDestinationPingEventNotification, ) +# The end of the section generated from our OpenAPI spec diff --git a/stripe/events/_v1_billing_meter_error_report_triggered_event.py b/stripe/events/_v1_billing_meter_error_report_triggered_event.py index 11d8e138..80ec324b 100644 --- a/stripe/events/_v1_billing_meter_error_report_triggered_event.py +++ b/stripe/events/_v1_billing_meter_error_report_triggered_event.py @@ -7,7 +7,7 @@ from stripe._stripe_object import StripeObject from stripe._stripe_response import StripeResponse from stripe._util import get_api_mode from stripe.billing._meter import Meter -from stripe.v2._event import Event, EventNotification, RelatedObject +from stripe.v2.core._event import Event, EventNotification, RelatedObject from typing import Any, Dict, List, Optional, cast from typing_extensions import Literal, override diff --git a/stripe/events/_v1_billing_meter_no_meter_found_event.py b/stripe/events/_v1_billing_meter_no_meter_found_event.py index d45cab99..9a55b013 100644 --- a/stripe/events/_v1_billing_meter_no_meter_found_event.py +++ b/stripe/events/_v1_billing_meter_no_meter_found_event.py @@ -4,7 +4,7 @@ from stripe._api_mode import ApiMode from stripe._api_requestor import _APIRequestor from stripe._stripe_object import StripeObject from stripe._stripe_response import StripeResponse -from stripe.v2._event import Event, EventNotification +from stripe.v2.core._event import Event, EventNotification from typing import Any, Dict, List, Optional, cast from typing_extensions import Literal, override diff --git a/stripe/events/_v2_core_event_destination_ping_event.py b/stripe/events/_v2_core_event_destination_ping_event.py index 343e30ad..06562051 100644 --- a/stripe/events/_v2_core_event_destination_ping_event.py +++ b/stripe/events/_v2_core_event_destination_ping_event.py @@ -3,8 +3,8 @@ from stripe._stripe_client import StripeClient from stripe._stripe_object import StripeObject from stripe._util import get_api_mode -from stripe.v2._event import Event, EventNotification, RelatedObject -from stripe.v2._event_destination import EventDestination +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from stripe.v2.core._event_destination import EventDestination from typing import Any, Dict, cast from typing_extensions import Literal, override diff --git a/stripe/v2/__init__.py b/stripe/v2/__init__.py index 8e1532fb..2d8710f5 100644 --- a/stripe/v2/__init__.py +++ b/stripe/v2/__init__.py @@ -1,12 +1,5 @@ from stripe.v2._list_object import ListObject as ListObject from stripe.v2._amount import Amount as Amount, AmountParam as AmountParam -from stripe.v2._event import ( - EventNotification as EventNotification, - UnknownEventNotification as UnknownEventNotification, - RelatedObject as RelatedObject, - Reason as Reason, - ReasonRequest as ReasonRequest, -) # The beginning of the section generated from our OpenAPI spec @@ -14,6 +7,4 @@ from stripe.v2 import billing as billing, core as core from stripe.v2._billing_service import BillingService as BillingService from stripe.v2._core_service import CoreService as CoreService from stripe.v2._deleted_object import DeletedObject as DeletedObject -from stripe.v2._event import Event as Event -from stripe.v2._event_destination import EventDestination as EventDestination # The end of the section generated from our OpenAPI spec diff --git a/stripe/v2/core/__init__.py b/stripe/v2/core/__init__.py index 14173e71..b38d3772 100644 --- a/stripe/v2/core/__init__.py +++ b/stripe/v2/core/__init__.py @@ -1,6 +1,19 @@ # -*- coding: utf-8 -*- -# File generated from our OpenAPI spec + +from stripe.v2.core._event import ( + EventNotification as EventNotification, + RelatedObject as RelatedObject, + Reason as Reason, + ReasonRequest as ReasonRequest, +) + +# The beginning of the section generated from our OpenAPI spec +from stripe.v2.core._event import Event as Event +from stripe.v2.core._event_destination import ( + EventDestination as EventDestination, +) from stripe.v2.core._event_destination_service import ( EventDestinationService as EventDestinationService, ) from stripe.v2.core._event_service import EventService as EventService +# The end of the section generated from our OpenAPI spec diff --git a/stripe/v2/_event.py b/stripe/v2/core/_event.py index d7afe5ca..d7afe5ca 100644 --- a/stripe/v2/_event.py +++ b/stripe/v2/core/_event.py diff --git a/stripe/v2/_event_destination.py b/stripe/v2/core/_event_destination.py index 02d4ca17..02d4ca17 100644 --- a/stripe/v2/_event_destination.py +++ b/stripe/v2/core/_event_destination.py diff --git a/stripe/v2/core/_event_destination_service.py b/stripe/v2/core/_event_destination_service.py index b165189e..a526f110 100644 --- a/stripe/v2/core/_event_destination_service.py +++ b/stripe/v2/core/_event_destination_service.py @@ -4,9 +4,9 @@ from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from stripe.v2._deleted_object import DeletedObject -from stripe.v2._event import Event -from stripe.v2._event_destination import EventDestination from stripe.v2._list_object import ListObject +from stripe.v2.core._event import Event +from stripe.v2.core._event_destination import EventDestination from typing import Dict, List, Optional, cast from typing_extensions import Literal, NotRequired, TypedDict diff --git a/stripe/v2/core/_event_service.py b/stripe/v2/core/_event_service.py index 91bce187..eb4520a5 100644 --- a/stripe/v2/core/_event_service.py +++ b/stripe/v2/core/_event_service.py @@ -3,8 +3,8 @@ from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id -from stripe.v2._event import Event from stripe.v2._list_object import ListObject +from stripe.v2.core._event import Event from typing import Optional, cast from typing_extensions import NotRequired, TypedDict diff --git a/tests/test_stripe_client.py b/tests/test_stripe_client.py index 16a5d53b..e06082e7 100644 --- a/tests/test_stripe_client.py +++ b/tests/test_stripe_client.py @@ -2,7 +2,7 @@ from __future__ import absolute_import, division, print_function import stripe import pytest -from stripe.v2._event import Event +from stripe.v2.core._event import Event from stripe._http_client import new_default_http_client from stripe.events._v1_billing_meter_error_report_triggered_event import ( V1BillingMeterErrorReportTriggeredEvent, diff --git a/tests/test_stripe_context.py b/tests/test_stripe_context.py index 54396137..a06d16dd 100644 --- a/tests/test_stripe_context.py +++ b/tests/test_stripe_context.py @@ -3,7 +3,7 @@ from stripe import StripeContext from stripe import _api_requestor from stripe._request_options import RequestOptions, merge_options from stripe._requestor_options import RequestorOptions -from stripe.v2._event import EventNotification +from stripe.v2.core._event import EventNotification from unittest.mock import Mock import pytest diff --git a/tests/test_v2_event.py b/tests/test_v2_event.py index ea9b0b9b..46ddedfe 100644 --- a/tests/test_v2_event.py +++ b/tests/test_v2_event.py @@ -14,7 +14,7 @@ from stripe.events._v1_billing_meter_error_report_triggered_event import ( V1BillingMeterErrorReportTriggeredEventNotification, V1BillingMeterErrorReportTriggeredEvent, ) -from stripe.v2._event import UnknownEventNotification +from stripe.v2.core._event import UnknownEventNotification from stripe.events._event_classes import ALL_EVENT_NOTIFICATIONS from tests.test_webhook import DUMMY_WEBHOOK_SECRET, generate_header |
