Skip to content

feat(api): OpenAPI spec update via Stainless API #346

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 15, 2024
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 .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 91
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-ad49a3b6fc150ac83a43f43b0b416847bbc36f3b9cb036d61e012ae8b0288c55.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-303379b9db577b964d46fe908e8226e95c60435b11ddd8685bf2fa99c57f4320.yml
16 changes: 16 additions & 0 deletions src/orb/resources/customers/costs.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def list(
self,
customer_id: str,
*,
currency: Optional[str] | NotGiven = NOT_GIVEN,
timeframe_end: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
timeframe_start: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
view_mode: Optional[Literal["periodic", "cumulative"]] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -185,6 +186,8 @@ def list(
`grouping_value` and `secondary_grouping_value` available.

Args:
currency: The currency or custom pricing unit to use.

timeframe_end: Costs returned are exclusive of `timeframe_end`.

timeframe_start: Costs returned are inclusive of `timeframe_start`.
Expand Down Expand Up @@ -213,6 +216,7 @@ def list(
timeout=timeout,
query=maybe_transform(
{
"currency": currency,
"timeframe_end": timeframe_end,
"timeframe_start": timeframe_start,
"view_mode": view_mode,
Expand All @@ -227,6 +231,7 @@ def list_by_external_id(
self,
external_customer_id: str,
*,
currency: Optional[str] | NotGiven = NOT_GIVEN,
timeframe_end: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
timeframe_start: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
view_mode: Optional[Literal["periodic", "cumulative"]] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -374,6 +379,8 @@ def list_by_external_id(
`grouping_value` and `secondary_grouping_value` available.

Args:
currency: The currency or custom pricing unit to use.

timeframe_end: Costs returned are exclusive of `timeframe_end`.

timeframe_start: Costs returned are inclusive of `timeframe_start`.
Expand Down Expand Up @@ -404,6 +411,7 @@ def list_by_external_id(
timeout=timeout,
query=maybe_transform(
{
"currency": currency,
"timeframe_end": timeframe_end,
"timeframe_start": timeframe_start,
"view_mode": view_mode,
Expand All @@ -428,6 +436,7 @@ async def list(
self,
customer_id: str,
*,
currency: Optional[str] | NotGiven = NOT_GIVEN,
timeframe_end: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
timeframe_start: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
view_mode: Optional[Literal["periodic", "cumulative"]] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -575,6 +584,8 @@ async def list(
`grouping_value` and `secondary_grouping_value` available.

Args:
currency: The currency or custom pricing unit to use.

timeframe_end: Costs returned are exclusive of `timeframe_end`.

timeframe_start: Costs returned are inclusive of `timeframe_start`.
Expand Down Expand Up @@ -603,6 +614,7 @@ async def list(
timeout=timeout,
query=await async_maybe_transform(
{
"currency": currency,
"timeframe_end": timeframe_end,
"timeframe_start": timeframe_start,
"view_mode": view_mode,
Expand All @@ -617,6 +629,7 @@ async def list_by_external_id(
self,
external_customer_id: str,
*,
currency: Optional[str] | NotGiven = NOT_GIVEN,
timeframe_end: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
timeframe_start: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
view_mode: Optional[Literal["periodic", "cumulative"]] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -764,6 +777,8 @@ async def list_by_external_id(
`grouping_value` and `secondary_grouping_value` available.

Args:
currency: The currency or custom pricing unit to use.

timeframe_end: Costs returned are exclusive of `timeframe_end`.

timeframe_start: Costs returned are inclusive of `timeframe_start`.
Expand Down Expand Up @@ -794,6 +809,7 @@ async def list_by_external_id(
timeout=timeout,
query=await async_maybe_transform(
{
"currency": currency,
"timeframe_end": timeframe_end,
"timeframe_start": timeframe_start,
"view_mode": view_mode,
Expand Down
8 changes: 8 additions & 0 deletions src/orb/resources/subscriptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -832,6 +832,7 @@ def fetch_costs(
self,
subscription_id: str,
*,
currency: Optional[str] | NotGiven = NOT_GIVEN,
timeframe_end: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
timeframe_start: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
view_mode: Optional[Literal["periodic", "cumulative"]] | NotGiven = NOT_GIVEN,
Expand All @@ -855,6 +856,8 @@ def fetch_costs(
same day).

Args:
currency: The currency or custom pricing unit to use.

timeframe_end: Costs returned are exclusive of `timeframe_end`.

timeframe_start: Costs returned are inclusive of `timeframe_start`.
Expand Down Expand Up @@ -883,6 +886,7 @@ def fetch_costs(
timeout=timeout,
query=maybe_transform(
{
"currency": currency,
"timeframe_end": timeframe_end,
"timeframe_start": timeframe_start,
"view_mode": view_mode,
Expand Down Expand Up @@ -2557,6 +2561,7 @@ async def fetch_costs(
self,
subscription_id: str,
*,
currency: Optional[str] | NotGiven = NOT_GIVEN,
timeframe_end: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
timeframe_start: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
view_mode: Optional[Literal["periodic", "cumulative"]] | NotGiven = NOT_GIVEN,
Expand All @@ -2580,6 +2585,8 @@ async def fetch_costs(
same day).

Args:
currency: The currency or custom pricing unit to use.

timeframe_end: Costs returned are exclusive of `timeframe_end`.

timeframe_start: Costs returned are inclusive of `timeframe_start`.
Expand Down Expand Up @@ -2608,6 +2615,7 @@ async def fetch_costs(
timeout=timeout,
query=await async_maybe_transform(
{
"currency": currency,
"timeframe_end": timeframe_end,
"timeframe_start": timeframe_start,
"view_mode": view_mode,
Expand Down
3 changes: 3 additions & 0 deletions src/orb/types/customers/cost_list_by_external_id_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@


class CostListByExternalIDParams(TypedDict, total=False):
currency: Optional[str]
"""The currency or custom pricing unit to use."""

timeframe_end: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]
"""Costs returned are exclusive of `timeframe_end`."""

Expand Down
3 changes: 3 additions & 0 deletions src/orb/types/customers/cost_list_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@


class CostListParams(TypedDict, total=False):
currency: Optional[str]
"""The currency or custom pricing unit to use."""

timeframe_end: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]
"""Costs returned are exclusive of `timeframe_end`."""

Expand Down
3 changes: 3 additions & 0 deletions src/orb/types/subscription_fetch_costs_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@


class SubscriptionFetchCostsParams(TypedDict, total=False):
currency: Optional[str]
"""The currency or custom pricing unit to use."""

timeframe_end: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]
"""Costs returned are exclusive of `timeframe_end`."""

Expand Down
4 changes: 4 additions & 0 deletions tests/api_resources/customers/test_costs.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def test_method_list(self, client: Orb) -> None:
def test_method_list_with_all_params(self, client: Orb) -> None:
cost = client.customers.costs.list(
customer_id="customer_id",
currency="currency",
timeframe_end=parse_datetime("2022-03-01T05:00:00Z"),
timeframe_start=parse_datetime("2022-02-01T05:00:00Z"),
view_mode="periodic",
Expand Down Expand Up @@ -80,6 +81,7 @@ def test_method_list_by_external_id(self, client: Orb) -> None:
def test_method_list_by_external_id_with_all_params(self, client: Orb) -> None:
cost = client.customers.costs.list_by_external_id(
external_customer_id="external_customer_id",
currency="currency",
timeframe_end=parse_datetime("2022-03-01T05:00:00Z"),
timeframe_start=parse_datetime("2022-02-01T05:00:00Z"),
view_mode="periodic",
Expand Down Expand Up @@ -132,6 +134,7 @@ async def test_method_list(self, async_client: AsyncOrb) -> None:
async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None:
cost = await async_client.customers.costs.list(
customer_id="customer_id",
currency="currency",
timeframe_end=parse_datetime("2022-03-01T05:00:00Z"),
timeframe_start=parse_datetime("2022-02-01T05:00:00Z"),
view_mode="periodic",
Expand Down Expand Up @@ -180,6 +183,7 @@ async def test_method_list_by_external_id(self, async_client: AsyncOrb) -> None:
async def test_method_list_by_external_id_with_all_params(self, async_client: AsyncOrb) -> None:
cost = await async_client.customers.costs.list_by_external_id(
external_customer_id="external_customer_id",
currency="currency",
timeframe_end=parse_datetime("2022-03-01T05:00:00Z"),
timeframe_start=parse_datetime("2022-02-01T05:00:00Z"),
view_mode="periodic",
Expand Down
2 changes: 2 additions & 0 deletions tests/api_resources/test_subscriptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ def test_method_fetch_costs(self, client: Orb) -> None:
def test_method_fetch_costs_with_all_params(self, client: Orb) -> None:
subscription = client.subscriptions.fetch_costs(
subscription_id="subscription_id",
currency="currency",
timeframe_end=parse_datetime("2022-03-01T05:00:00Z"),
timeframe_start=parse_datetime("2022-02-01T05:00:00Z"),
view_mode="periodic",
Expand Down Expand Up @@ -1436,6 +1437,7 @@ async def test_method_fetch_costs(self, async_client: AsyncOrb) -> None:
async def test_method_fetch_costs_with_all_params(self, async_client: AsyncOrb) -> None:
subscription = await async_client.subscriptions.fetch_costs(
subscription_id="subscription_id",
currency="currency",
timeframe_end=parse_datetime("2022-03-01T05:00:00Z"),
timeframe_start=parse_datetime("2022-02-01T05:00:00Z"),
view_mode="periodic",
Expand Down