Skip to content
Open
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 @@
826bf48af8bcd391512daeaf283b8486347b14c8
607324895d7883d4a5f04f3c29c26faa09cd31d3
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v2253
v2254
2 changes: 2 additions & 0 deletions examples/event_notification_handler_endpoint.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# -*- coding: utf-8 -*-
# File copied from our code generator; changes here will be overwritten.
"""
event_notification_handler_endpoint.py - receive and process event notifications (AKA thin events) like "v1.billing.meter.error_report_triggered" using EventNotificationHandler.

Expand Down
2 changes: 2 additions & 0 deletions examples/event_notification_webhook_handler.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# -*- coding: utf-8 -*-
# File copied from our code generator; changes here will be overwritten.
"""
event_notification_webhook_handler.py - receive and process event notifications (AKA thin events) like the v1.billing.meter.error_report_triggered and v1.billing.meter.no_meter_found events.

Expand Down
2 changes: 2 additions & 0 deletions stripe/_event_notification_handler.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# -*- coding: utf-8 -*-
# File copied from our code generator; changes here will be overwritten.
from dataclasses import dataclass
from typing_extensions import TYPE_CHECKING

Expand Down
6 changes: 3 additions & 3 deletions stripe/_v2_services.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from stripe.v2._billing_service import BillingService
from stripe.v2._commerce_service import CommerceService
from stripe.v2._core_service import CoreService
from stripe.v2._datum_service import DatumService
from stripe.v2._data_service import DataService
from stripe.v2._extend_service import ExtendService
from stripe.v2._iam_service import IamService
from stripe.v2._money_management_service import MoneyManagementService
Expand All @@ -22,7 +22,7 @@
"billing": ["stripe.v2._billing_service", "BillingService"],
"commerce": ["stripe.v2._commerce_service", "CommerceService"],
"core": ["stripe.v2._core_service", "CoreService"],
"data": ["stripe.v2._datum_service", "DatumService"],
"data": ["stripe.v2._data_service", "DataService"],
"extend": ["stripe.v2._extend_service", "ExtendService"],
"iam": ["stripe.v2._iam_service", "IamService"],
"money_management": [
Expand All @@ -42,7 +42,7 @@ class V2Services(StripeService):
billing: "BillingService"
commerce: "CommerceService"
core: "CoreService"
data: "DatumService"
data: "DataService"
extend: "ExtendService"
iam: "IamService"
money_management: "MoneyManagementService"
Expand Down
2 changes: 2 additions & 0 deletions stripe/events/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# -*- coding: utf-8 -*-
# File copied from our code generator; changes here will be overwritten.
# -*- coding: utf-8 -*-

from typing_extensions import TYPE_CHECKING
from stripe.v2.core._event import (
Expand Down
4 changes: 2 additions & 2 deletions stripe/v2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from stripe.v2._billing_service import BillingService as BillingService
from stripe.v2._commerce_service import CommerceService as CommerceService
from stripe.v2._core_service import CoreService as CoreService
from stripe.v2._datum_service import DatumService as DatumService
from stripe.v2._data_service import DataService as DataService
from stripe.v2._deleted_object import DeletedObject as DeletedObject
from stripe.v2._extend_service import ExtendService as ExtendService
from stripe.v2._financial_address_credit_simulation import (
Expand Down Expand Up @@ -58,7 +58,7 @@
"BillingService": ("stripe.v2._billing_service", False),
"CommerceService": ("stripe.v2._commerce_service", False),
"CoreService": ("stripe.v2._core_service", False),
"DatumService": ("stripe.v2._datum_service", False),
"DataService": ("stripe.v2._data_service", False),
"DeletedObject": ("stripe.v2._deleted_object", False),
"ExtendService": ("stripe.v2._extend_service", False),
"FinancialAddressCreditSimulation": (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
}


class DatumService(StripeService):
class DataService(StripeService):
reporting: "ReportingService"

def __init__(self, requestor):
Expand Down
2 changes: 2 additions & 0 deletions stripe/v2/core/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# -*- coding: utf-8 -*-
# File copied from our code generator; changes here will be overwritten.
# -*- coding: utf-8 -*-

from typing_extensions import TYPE_CHECKING
from stripe.v2.core._event import (
Expand Down
10 changes: 6 additions & 4 deletions stripe/v2/core/_event.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# -*- coding: utf-8 -*-
# File copied from our code generator; changes here will be overwritten.
# -*- coding: utf-8 -*-

import json
from typing import Any, ClassVar, Dict, Optional, cast
Expand Down Expand Up @@ -190,25 +192,25 @@ def from_json(payload: str, client: "StripeClient") -> "EventNotification":
def __repr__(self) -> str:
return f"<EventNotification id={self.id} type={self.type} created={self.created} context={self.context} reason={self.reason}>"

def fetch_event(self) -> Event:
def fetch_event(self) -> "Event":
response = self._client.raw_request(
"get",
f"/v2/core/events/{self.id}",
stripe_context=self.context,
headers={"Stripe-Request-Trigger": f"event={self.id}"},
usage=["pushed_event_pull"],
)
return cast(Event, self._client.deserialize(response, api_mode="V2"))
return cast("Event", self._client.deserialize(response, api_mode="V2"))

async def fetch_event_async(self) -> Event:
async def fetch_event_async(self) -> "Event":
response = await self._client.raw_request_async(
"get",
f"/v2/core/events/{self.id}",
stripe_context=self.context,
headers={"Stripe-Request-Trigger": f"event={self.id}"},
usage=["pushed_event_pull", "pushed_event_pull_async"],
)
return cast(Event, self._client.deserialize(response, api_mode="V2"))
return cast("Event", self._client.deserialize(response, api_mode="V2"))


class UnknownEventNotification(EventNotification):
Expand Down
2 changes: 2 additions & 0 deletions tests/test_event_notification_handler.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# -*- coding: utf-8 -*-
# File copied from our code generator; changes here will be overwritten.
import json
import pytest
from typing import Optional
Expand Down
2 changes: 2 additions & 0 deletions tests/test_v2_event.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# -*- coding: utf-8 -*-
# File copied from our code generator; changes here will be overwritten.
import json
from typing import Callable
from typing_extensions import assert_type
Expand Down
Loading