Skip to content

chore: rebuild project due to oas spec rename #266

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
May 10, 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
3 changes: 1 addition & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
lint:
name: lint
runs-on: ubuntu-latest
if: github.repository == 'orbcorp/orb-python'


steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -42,7 +42,6 @@ jobs:
test:
name: test
runs-on: ubuntu-latest
if: github.repository == 'orbcorp/orb-python'

steps:
- uses: actions/checkout@v4
Expand Down
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 90
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb-0b1c2d4534e85da8966d80448ccc6bf4db184f0d5642478af14ba4c9eeadafed.yml
configured_endpoints: 89
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-762f50aa6ea13f42e719339aa5cb31233984499720a7be832182357f949927a1.yml
5 changes: 2 additions & 3 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,6 @@ Methods:
- <code title="get /alerts">client.alerts.<a href="./src/orb/resources/alerts.py">list</a>(\*\*<a href="src/orb/types/alert_list_params.py">params</a>) -> <a href="./src/orb/types/alert.py">SyncPage[Alert]</a></code>
- <code title="post /alerts/customer_id/{customer_id}">client.alerts.<a href="./src/orb/resources/alerts.py">create_for_customer</a>(customer_id, \*\*<a href="src/orb/types/alert_create_for_customer_params.py">params</a>) -> <a href="./src/orb/types/alert.py">Alert</a></code>
- <code title="post /alerts/external_customer_id/{external_customer_id}">client.alerts.<a href="./src/orb/resources/alerts.py">create_for_external_customer</a>(external_customer_id, \*\*<a href="src/orb/types/alert_create_for_external_customer_params.py">params</a>) -> <a href="./src/orb/types/alert.py">Alert</a></code>
- <code title="post /alerts/plan_id/{plan_id}">client.alerts.<a href="./src/orb/resources/alerts.py">create_for_plan</a>(plan_id, \*\*<a href="src/orb/types/alert_create_for_plan_params.py">params</a>) -> <a href="./src/orb/types/alert.py">Alert</a></code>
- <code title="post /alerts/subscription_id/{subscription_id}">client.alerts.<a href="./src/orb/resources/alerts.py">create_for_subscription</a>(subscription_id, \*\*<a href="src/orb/types/alert_create_for_subscription_params.py">params</a>) -> <a href="./src/orb/types/alert.py">Alert</a></code>
- <code title="post /alerts/{alert_configuration_id}/disable">client.alerts.<a href="./src/orb/resources/alerts.py">disable</a>(alert_configuration_id, \*\*<a href="src/orb/types/alert_disable_params.py">params</a>) -> <a href="./src/orb/types/alert.py">Alert</a></code>
- <code title="post /alerts/{alert_configuration_id}/enable">client.alerts.<a href="./src/orb/resources/alerts.py">enable</a>(alert_configuration_id, \*\*<a href="src/orb/types/alert_enable_params.py">params</a>) -> <a href="./src/orb/types/alert.py">Alert</a></code>
- <code title="post /alerts/{alert_configuration_id}/disable">client.alerts.<a href="./src/orb/resources/alerts.py">disable</a>(alert_configuration_id) -> <a href="./src/orb/types/alert.py">Alert</a></code>
- <code title="post /alerts/{alert_configuration_id}/enable">client.alerts.<a href="./src/orb/resources/alerts.py">enable</a>(alert_configuration_id) -> <a href="./src/orb/types/alert.py">Alert</a></code>
201 changes: 0 additions & 201 deletions src/orb/resources/alerts.py

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions src/orb/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,11 @@
from .plan_create_params import PlanCreateParams as PlanCreateParams
from .plan_update_params import PlanUpdateParams as PlanUpdateParams
from .subscription_usage import SubscriptionUsage as SubscriptionUsage
from .alert_enable_params import AlertEnableParams as AlertEnableParams
from .event_ingest_params import EventIngestParams as EventIngestParams
from .event_search_params import EventSearchParams as EventSearchParams
from .event_update_params import EventUpdateParams as EventUpdateParams
from .invoice_list_params import InvoiceListParams as InvoiceListParams
from .price_create_params import PriceCreateParams as PriceCreateParams
from .alert_disable_params import AlertDisableParams as AlertDisableParams
from .coupon_create_params import CouponCreateParams as CouponCreateParams
from .customer_list_params import CustomerListParams as CustomerListParams
from .evaluate_price_group import EvaluatePriceGroup as EvaluatePriceGroup
Expand All @@ -57,7 +55,6 @@
from .subscription_cancel_params import SubscriptionCancelParams as SubscriptionCancelParams
from .subscription_create_params import SubscriptionCreateParams as SubscriptionCreateParams
from .subscription_update_params import SubscriptionUpdateParams as SubscriptionUpdateParams
from .alert_create_for_plan_params import AlertCreateForPlanParams as AlertCreateForPlanParams
from .invoice_fetch_upcoming_params import InvoiceFetchUpcomingParams as InvoiceFetchUpcomingParams
from .invoice_fetch_upcoming_response import InvoiceFetchUpcomingResponse as InvoiceFetchUpcomingResponse
from .invoice_line_item_create_params import InvoiceLineItemCreateParams as InvoiceLineItemCreateParams
Expand Down
34 changes: 0 additions & 34 deletions src/orb/types/alert_create_for_plan_params.py

This file was deleted.

13 changes: 0 additions & 13 deletions src/orb/types/alert_disable_params.py

This file was deleted.

13 changes: 0 additions & 13 deletions src/orb/types/alert_enable_params.py

This file was deleted.

9 changes: 0 additions & 9 deletions src/orb/types/alert_list_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,5 @@ class AlertListParams(TypedDict, total=False):
limit: int
"""The number of items to fetch. Defaults to 20."""

plan_id: Optional[str]
"""Fetch alerts scoped to this plan_id"""

plan_version: Optional[int]
"""
If provided alongside plan_id, only the alerts that are scoped to the specified
plan_version will be returned.
"""

subscription_id: Optional[str]
"""Fetch alerts scoped to this subscription_id"""
150 changes: 0 additions & 150 deletions tests/api_resources/test_alerts.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ def test_method_list_with_all_params(self, client: Orb) -> None:
customer_id="string",
external_customer_id="string",
limit=0,
plan_id="string",
plan_version=0,
subscription_id="string",
)
assert_matches_type(SyncPage[Alert], alert, path=["response"])
Expand Down Expand Up @@ -217,63 +215,6 @@ def test_path_params_create_for_external_customer(self, client: Orb) -> None:
type="string",
)

@parametrize
def test_method_create_for_plan(self, client: Orb) -> None:
alert = client.alerts.create_for_plan(
"string",
thresholds=[{"value": 0}, {"value": 0}, {"value": 0}],
type="string",
)
assert_matches_type(Alert, alert, path=["response"])

@parametrize
def test_method_create_for_plan_with_all_params(self, client: Orb) -> None:
alert = client.alerts.create_for_plan(
"string",
thresholds=[{"value": 0}, {"value": 0}, {"value": 0}],
type="string",
metric_id="string",
plan_version=0,
)
assert_matches_type(Alert, alert, path=["response"])

@parametrize
def test_raw_response_create_for_plan(self, client: Orb) -> None:
response = client.alerts.with_raw_response.create_for_plan(
"string",
thresholds=[{"value": 0}, {"value": 0}, {"value": 0}],
type="string",
)

assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
alert = response.parse()
assert_matches_type(Alert, alert, path=["response"])

@parametrize
def test_streaming_response_create_for_plan(self, client: Orb) -> None:
with client.alerts.with_streaming_response.create_for_plan(
"string",
thresholds=[{"value": 0}, {"value": 0}, {"value": 0}],
type="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"

alert = response.parse()
assert_matches_type(Alert, alert, path=["response"])

assert cast(Any, response.is_closed) is True

@parametrize
def test_path_params_create_for_plan(self, client: Orb) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `plan_id` but received ''"):
client.alerts.with_raw_response.create_for_plan(
"",
thresholds=[{"value": 0}, {"value": 0}, {"value": 0}],
type="string",
)

@parametrize
def test_method_create_for_subscription(self, client: Orb) -> None:
alert = client.alerts.create_for_subscription(
Expand Down Expand Up @@ -337,14 +278,6 @@ def test_method_disable(self, client: Orb) -> None:
)
assert_matches_type(Alert, alert, path=["response"])

@parametrize
def test_method_disable_with_all_params(self, client: Orb) -> None:
alert = client.alerts.disable(
"string",
subscription_id="string",
)
assert_matches_type(Alert, alert, path=["response"])

@parametrize
def test_raw_response_disable(self, client: Orb) -> None:
response = client.alerts.with_raw_response.disable(
Expand Down Expand Up @@ -385,14 +318,6 @@ def test_method_enable(self, client: Orb) -> None:
)
assert_matches_type(Alert, alert, path=["response"])

@parametrize
def test_method_enable_with_all_params(self, client: Orb) -> None:
alert = client.alerts.enable(
"string",
subscription_id="string",
)
assert_matches_type(Alert, alert, path=["response"])

@parametrize
def test_raw_response_enable(self, client: Orb) -> None:
response = client.alerts.with_raw_response.enable(
Expand Down Expand Up @@ -486,8 +411,6 @@ async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None
customer_id="string",
external_customer_id="string",
limit=0,
plan_id="string",
plan_version=0,
subscription_id="string",
)
assert_matches_type(AsyncPage[Alert], alert, path=["response"])
Expand Down Expand Up @@ -626,63 +549,6 @@ async def test_path_params_create_for_external_customer(self, async_client: Asyn
type="string",
)

@parametrize
async def test_method_create_for_plan(self, async_client: AsyncOrb) -> None:
alert = await async_client.alerts.create_for_plan(
"string",
thresholds=[{"value": 0}, {"value": 0}, {"value": 0}],
type="string",
)
assert_matches_type(Alert, alert, path=["response"])

@parametrize
async def test_method_create_for_plan_with_all_params(self, async_client: AsyncOrb) -> None:
alert = await async_client.alerts.create_for_plan(
"string",
thresholds=[{"value": 0}, {"value": 0}, {"value": 0}],
type="string",
metric_id="string",
plan_version=0,
)
assert_matches_type(Alert, alert, path=["response"])

@parametrize
async def test_raw_response_create_for_plan(self, async_client: AsyncOrb) -> None:
response = await async_client.alerts.with_raw_response.create_for_plan(
"string",
thresholds=[{"value": 0}, {"value": 0}, {"value": 0}],
type="string",
)

assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
alert = response.parse()
assert_matches_type(Alert, alert, path=["response"])

@parametrize
async def test_streaming_response_create_for_plan(self, async_client: AsyncOrb) -> None:
async with async_client.alerts.with_streaming_response.create_for_plan(
"string",
thresholds=[{"value": 0}, {"value": 0}, {"value": 0}],
type="string",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"

alert = await response.parse()
assert_matches_type(Alert, alert, path=["response"])

assert cast(Any, response.is_closed) is True

@parametrize
async def test_path_params_create_for_plan(self, async_client: AsyncOrb) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `plan_id` but received ''"):
await async_client.alerts.with_raw_response.create_for_plan(
"",
thresholds=[{"value": 0}, {"value": 0}, {"value": 0}],
type="string",
)

@parametrize
async def test_method_create_for_subscription(self, async_client: AsyncOrb) -> None:
alert = await async_client.alerts.create_for_subscription(
Expand Down Expand Up @@ -746,14 +612,6 @@ async def test_method_disable(self, async_client: AsyncOrb) -> None:
)
assert_matches_type(Alert, alert, path=["response"])

@parametrize
async def test_method_disable_with_all_params(self, async_client: AsyncOrb) -> None:
alert = await async_client.alerts.disable(
"string",
subscription_id="string",
)
assert_matches_type(Alert, alert, path=["response"])

@parametrize
async def test_raw_response_disable(self, async_client: AsyncOrb) -> None:
response = await async_client.alerts.with_raw_response.disable(
Expand Down Expand Up @@ -794,14 +652,6 @@ async def test_method_enable(self, async_client: AsyncOrb) -> None:
)
assert_matches_type(Alert, alert, path=["response"])

@parametrize
async def test_method_enable_with_all_params(self, async_client: AsyncOrb) -> None:
alert = await async_client.alerts.enable(
"string",
subscription_id="string",
)
assert_matches_type(Alert, alert, path=["response"])

@parametrize
async def test_raw_response_enable(self, async_client: AsyncOrb) -> None:
response = await async_client.alerts.with_raw_response.enable(
Expand Down