| 1 |
# -*- coding: utf-8 -*- |
| 2 |
# File generated from our OpenAPI spec |
| 3 |
from stripe._stripe_service import StripeService |
| 4 |
from stripe._util import sanitize_id |
| 5 |
from typing import Optional, cast |
| 6 |
from typing_extensions import TYPE_CHECKING |
| 7 |
|
| 8 |
if TYPE_CHECKING: |
| 9 |
from stripe._list_object import ListObject |
| 10 |
from stripe._request_options import RequestOptions |
| 11 |
from stripe.billing._meter_event_summary import MeterEventSummary |
| 12 |
from stripe.params.billing._meter_event_summary_list_params import ( |
| 13 |
MeterEventSummaryListParams, |
| 14 |
) |
| 15 |
|
| 16 |
|
| 17 |
class MeterEventSummaryService(StripeService): |
| 18 |
def list( |
| 19 |
self, |
| 20 |
id: str, |
| 21 |
params: "MeterEventSummaryListParams", |
| 22 |
options: Optional["RequestOptions"] = None, |
| 23 |
) -> "ListObject[MeterEventSummary]": |
| 24 |
""" |
| 25 |
Retrieve a list of billing meter event summaries. |
| 26 |
""" |
| 27 |
return cast( |
| 28 |
"ListObject[MeterEventSummary]", |
| 29 |
self._request( |
| 30 |
"get", |
| 31 |
"/v1/billing/meters/{id}/event_summaries".format( |
| 32 |
id=sanitize_id(id), |
| 33 |
), |
| 34 |
base_address="api", |
| 35 |
params=params, |
| 36 |
options=options, |
| 37 |
), |
| 38 |
) |
| 39 |
|
| 40 |
async def list_async( |
| 41 |
self, |
| 42 |
id: str, |
| 43 |
params: "MeterEventSummaryListParams", |
| 44 |
options: Optional["RequestOptions"] = None, |
| 45 |
) -> "ListObject[MeterEventSummary]": |
| 46 |
""" |
| 47 |
Retrieve a list of billing meter event summaries. |
| 48 |
""" |
| 49 |
return cast( |
| 50 |
"ListObject[MeterEventSummary]", |
| 51 |
await self._request_async( |
| 52 |
"get", |
| 53 |
"/v1/billing/meters/{id}/event_summaries".format( |
| 54 |
id=sanitize_id(id), |
| 55 |
), |
| 56 |
base_address="api", |
| 57 |
params=params, |
| 58 |
options=options, |
| 59 |
), |
| 60 |
) |