Skip to content

Commit 3588964

Browse files
chore(internal): updated imports (#463)
1 parent a56d5b5 commit 3588964

File tree

1 file changed

+128
-120
lines changed

1 file changed

+128
-120
lines changed

src/orb/_client.py

+128-120
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import httpx
1010

11-
from . import resources, _exceptions
11+
from . import _exceptions
1212
from ._qs import Querystring
1313
from ._types import (
1414
NOT_GIVEN,
@@ -25,42 +25,48 @@
2525
get_async_library,
2626
)
2727
from ._version import __version__
28+
from .resources import (
29+
items,
30+
alerts,
31+
metrics,
32+
invoices,
33+
webhooks,
34+
top_level,
35+
credit_notes,
36+
subscriptions,
37+
invoice_line_items,
38+
)
2839
from ._streaming import Stream as Stream, AsyncStream as AsyncStream
2940
from ._exceptions import OrbError, APIStatusError
3041
from ._base_client import (
3142
DEFAULT_MAX_RETRIES,
3243
SyncAPIClient,
3344
AsyncAPIClient,
3445
)
46+
from .resources.plans import plans
47+
from .resources.events import events
48+
from .resources.prices import prices
49+
from .resources.coupons import coupons
50+
from .resources.customers import customers
3551

36-
__all__ = [
37-
"Timeout",
38-
"Transport",
39-
"ProxiesTypes",
40-
"RequestOptions",
41-
"resources",
42-
"Orb",
43-
"AsyncOrb",
44-
"Client",
45-
"AsyncClient",
46-
]
52+
__all__ = ["Timeout", "Transport", "ProxiesTypes", "RequestOptions", "Orb", "AsyncOrb", "Client", "AsyncClient"]
4753

4854

4955
class Orb(SyncAPIClient):
50-
top_level: resources.TopLevel
51-
coupons: resources.Coupons
52-
credit_notes: resources.CreditNotes
53-
customers: resources.Customers
54-
events: resources.Events
55-
invoice_line_items: resources.InvoiceLineItems
56-
invoices: resources.Invoices
57-
items: resources.Items
58-
metrics: resources.Metrics
59-
plans: resources.Plans
60-
prices: resources.Prices
61-
subscriptions: resources.Subscriptions
62-
webhooks: resources.Webhooks
63-
alerts: resources.Alerts
56+
top_level: top_level.TopLevel
57+
coupons: coupons.Coupons
58+
credit_notes: credit_notes.CreditNotes
59+
customers: customers.Customers
60+
events: events.Events
61+
invoice_line_items: invoice_line_items.InvoiceLineItems
62+
invoices: invoices.Invoices
63+
items: items.Items
64+
metrics: metrics.Metrics
65+
plans: plans.Plans
66+
prices: prices.Prices
67+
subscriptions: subscriptions.Subscriptions
68+
webhooks: webhooks.Webhooks
69+
alerts: alerts.Alerts
6470
with_raw_response: OrbWithRawResponse
6571
with_streaming_response: OrbWithStreamedResponse
6672

@@ -128,20 +134,20 @@ def __init__(
128134

129135
self._idempotency_header = "Idempotency-Key"
130136

131-
self.top_level = resources.TopLevel(self)
132-
self.coupons = resources.Coupons(self)
133-
self.credit_notes = resources.CreditNotes(self)
134-
self.customers = resources.Customers(self)
135-
self.events = resources.Events(self)
136-
self.invoice_line_items = resources.InvoiceLineItems(self)
137-
self.invoices = resources.Invoices(self)
138-
self.items = resources.Items(self)
139-
self.metrics = resources.Metrics(self)
140-
self.plans = resources.Plans(self)
141-
self.prices = resources.Prices(self)
142-
self.subscriptions = resources.Subscriptions(self)
143-
self.webhooks = resources.Webhooks(self)
144-
self.alerts = resources.Alerts(self)
137+
self.top_level = top_level.TopLevel(self)
138+
self.coupons = coupons.Coupons(self)
139+
self.credit_notes = credit_notes.CreditNotes(self)
140+
self.customers = customers.Customers(self)
141+
self.events = events.Events(self)
142+
self.invoice_line_items = invoice_line_items.InvoiceLineItems(self)
143+
self.invoices = invoices.Invoices(self)
144+
self.items = items.Items(self)
145+
self.metrics = metrics.Metrics(self)
146+
self.plans = plans.Plans(self)
147+
self.prices = prices.Prices(self)
148+
self.subscriptions = subscriptions.Subscriptions(self)
149+
self.webhooks = webhooks.Webhooks(self)
150+
self.alerts = alerts.Alerts(self)
145151
self.with_raw_response = OrbWithRawResponse(self)
146152
self.with_streaming_response = OrbWithStreamedResponse(self)
147153

@@ -301,20 +307,20 @@ def _make_status_error(
301307

302308

303309
class AsyncOrb(AsyncAPIClient):
304-
top_level: resources.AsyncTopLevel
305-
coupons: resources.AsyncCoupons
306-
credit_notes: resources.AsyncCreditNotes
307-
customers: resources.AsyncCustomers
308-
events: resources.AsyncEvents
309-
invoice_line_items: resources.AsyncInvoiceLineItems
310-
invoices: resources.AsyncInvoices
311-
items: resources.AsyncItems
312-
metrics: resources.AsyncMetrics
313-
plans: resources.AsyncPlans
314-
prices: resources.AsyncPrices
315-
subscriptions: resources.AsyncSubscriptions
316-
webhooks: resources.AsyncWebhooks
317-
alerts: resources.AsyncAlerts
310+
top_level: top_level.AsyncTopLevel
311+
coupons: coupons.AsyncCoupons
312+
credit_notes: credit_notes.AsyncCreditNotes
313+
customers: customers.AsyncCustomers
314+
events: events.AsyncEvents
315+
invoice_line_items: invoice_line_items.AsyncInvoiceLineItems
316+
invoices: invoices.AsyncInvoices
317+
items: items.AsyncItems
318+
metrics: metrics.AsyncMetrics
319+
plans: plans.AsyncPlans
320+
prices: prices.AsyncPrices
321+
subscriptions: subscriptions.AsyncSubscriptions
322+
webhooks: webhooks.AsyncWebhooks
323+
alerts: alerts.AsyncAlerts
318324
with_raw_response: AsyncOrbWithRawResponse
319325
with_streaming_response: AsyncOrbWithStreamedResponse
320326

@@ -382,20 +388,20 @@ def __init__(
382388

383389
self._idempotency_header = "Idempotency-Key"
384390

385-
self.top_level = resources.AsyncTopLevel(self)
386-
self.coupons = resources.AsyncCoupons(self)
387-
self.credit_notes = resources.AsyncCreditNotes(self)
388-
self.customers = resources.AsyncCustomers(self)
389-
self.events = resources.AsyncEvents(self)
390-
self.invoice_line_items = resources.AsyncInvoiceLineItems(self)
391-
self.invoices = resources.AsyncInvoices(self)
392-
self.items = resources.AsyncItems(self)
393-
self.metrics = resources.AsyncMetrics(self)
394-
self.plans = resources.AsyncPlans(self)
395-
self.prices = resources.AsyncPrices(self)
396-
self.subscriptions = resources.AsyncSubscriptions(self)
397-
self.webhooks = resources.AsyncWebhooks(self)
398-
self.alerts = resources.AsyncAlerts(self)
391+
self.top_level = top_level.AsyncTopLevel(self)
392+
self.coupons = coupons.AsyncCoupons(self)
393+
self.credit_notes = credit_notes.AsyncCreditNotes(self)
394+
self.customers = customers.AsyncCustomers(self)
395+
self.events = events.AsyncEvents(self)
396+
self.invoice_line_items = invoice_line_items.AsyncInvoiceLineItems(self)
397+
self.invoices = invoices.AsyncInvoices(self)
398+
self.items = items.AsyncItems(self)
399+
self.metrics = metrics.AsyncMetrics(self)
400+
self.plans = plans.AsyncPlans(self)
401+
self.prices = prices.AsyncPrices(self)
402+
self.subscriptions = subscriptions.AsyncSubscriptions(self)
403+
self.webhooks = webhooks.AsyncWebhooks(self)
404+
self.alerts = alerts.AsyncAlerts(self)
399405
self.with_raw_response = AsyncOrbWithRawResponse(self)
400406
self.with_streaming_response = AsyncOrbWithStreamedResponse(self)
401407

@@ -556,70 +562,72 @@ def _make_status_error(
556562

557563
class OrbWithRawResponse:
558564
def __init__(self, client: Orb) -> None:
559-
self.top_level = resources.TopLevelWithRawResponse(client.top_level)
560-
self.coupons = resources.CouponsWithRawResponse(client.coupons)
561-
self.credit_notes = resources.CreditNotesWithRawResponse(client.credit_notes)
562-
self.customers = resources.CustomersWithRawResponse(client.customers)
563-
self.events = resources.EventsWithRawResponse(client.events)
564-
self.invoice_line_items = resources.InvoiceLineItemsWithRawResponse(client.invoice_line_items)
565-
self.invoices = resources.InvoicesWithRawResponse(client.invoices)
566-
self.items = resources.ItemsWithRawResponse(client.items)
567-
self.metrics = resources.MetricsWithRawResponse(client.metrics)
568-
self.plans = resources.PlansWithRawResponse(client.plans)
569-
self.prices = resources.PricesWithRawResponse(client.prices)
570-
self.subscriptions = resources.SubscriptionsWithRawResponse(client.subscriptions)
571-
self.alerts = resources.AlertsWithRawResponse(client.alerts)
565+
self.top_level = top_level.TopLevelWithRawResponse(client.top_level)
566+
self.coupons = coupons.CouponsWithRawResponse(client.coupons)
567+
self.credit_notes = credit_notes.CreditNotesWithRawResponse(client.credit_notes)
568+
self.customers = customers.CustomersWithRawResponse(client.customers)
569+
self.events = events.EventsWithRawResponse(client.events)
570+
self.invoice_line_items = invoice_line_items.InvoiceLineItemsWithRawResponse(client.invoice_line_items)
571+
self.invoices = invoices.InvoicesWithRawResponse(client.invoices)
572+
self.items = items.ItemsWithRawResponse(client.items)
573+
self.metrics = metrics.MetricsWithRawResponse(client.metrics)
574+
self.plans = plans.PlansWithRawResponse(client.plans)
575+
self.prices = prices.PricesWithRawResponse(client.prices)
576+
self.subscriptions = subscriptions.SubscriptionsWithRawResponse(client.subscriptions)
577+
self.alerts = alerts.AlertsWithRawResponse(client.alerts)
572578

573579

574580
class AsyncOrbWithRawResponse:
575581
def __init__(self, client: AsyncOrb) -> None:
576-
self.top_level = resources.AsyncTopLevelWithRawResponse(client.top_level)
577-
self.coupons = resources.AsyncCouponsWithRawResponse(client.coupons)
578-
self.credit_notes = resources.AsyncCreditNotesWithRawResponse(client.credit_notes)
579-
self.customers = resources.AsyncCustomersWithRawResponse(client.customers)
580-
self.events = resources.AsyncEventsWithRawResponse(client.events)
581-
self.invoice_line_items = resources.AsyncInvoiceLineItemsWithRawResponse(client.invoice_line_items)
582-
self.invoices = resources.AsyncInvoicesWithRawResponse(client.invoices)
583-
self.items = resources.AsyncItemsWithRawResponse(client.items)
584-
self.metrics = resources.AsyncMetricsWithRawResponse(client.metrics)
585-
self.plans = resources.AsyncPlansWithRawResponse(client.plans)
586-
self.prices = resources.AsyncPricesWithRawResponse(client.prices)
587-
self.subscriptions = resources.AsyncSubscriptionsWithRawResponse(client.subscriptions)
588-
self.alerts = resources.AsyncAlertsWithRawResponse(client.alerts)
582+
self.top_level = top_level.AsyncTopLevelWithRawResponse(client.top_level)
583+
self.coupons = coupons.AsyncCouponsWithRawResponse(client.coupons)
584+
self.credit_notes = credit_notes.AsyncCreditNotesWithRawResponse(client.credit_notes)
585+
self.customers = customers.AsyncCustomersWithRawResponse(client.customers)
586+
self.events = events.AsyncEventsWithRawResponse(client.events)
587+
self.invoice_line_items = invoice_line_items.AsyncInvoiceLineItemsWithRawResponse(client.invoice_line_items)
588+
self.invoices = invoices.AsyncInvoicesWithRawResponse(client.invoices)
589+
self.items = items.AsyncItemsWithRawResponse(client.items)
590+
self.metrics = metrics.AsyncMetricsWithRawResponse(client.metrics)
591+
self.plans = plans.AsyncPlansWithRawResponse(client.plans)
592+
self.prices = prices.AsyncPricesWithRawResponse(client.prices)
593+
self.subscriptions = subscriptions.AsyncSubscriptionsWithRawResponse(client.subscriptions)
594+
self.alerts = alerts.AsyncAlertsWithRawResponse(client.alerts)
589595

590596

591597
class OrbWithStreamedResponse:
592598
def __init__(self, client: Orb) -> None:
593-
self.top_level = resources.TopLevelWithStreamingResponse(client.top_level)
594-
self.coupons = resources.CouponsWithStreamingResponse(client.coupons)
595-
self.credit_notes = resources.CreditNotesWithStreamingResponse(client.credit_notes)
596-
self.customers = resources.CustomersWithStreamingResponse(client.customers)
597-
self.events = resources.EventsWithStreamingResponse(client.events)
598-
self.invoice_line_items = resources.InvoiceLineItemsWithStreamingResponse(client.invoice_line_items)
599-
self.invoices = resources.InvoicesWithStreamingResponse(client.invoices)
600-
self.items = resources.ItemsWithStreamingResponse(client.items)
601-
self.metrics = resources.MetricsWithStreamingResponse(client.metrics)
602-
self.plans = resources.PlansWithStreamingResponse(client.plans)
603-
self.prices = resources.PricesWithStreamingResponse(client.prices)
604-
self.subscriptions = resources.SubscriptionsWithStreamingResponse(client.subscriptions)
605-
self.alerts = resources.AlertsWithStreamingResponse(client.alerts)
599+
self.top_level = top_level.TopLevelWithStreamingResponse(client.top_level)
600+
self.coupons = coupons.CouponsWithStreamingResponse(client.coupons)
601+
self.credit_notes = credit_notes.CreditNotesWithStreamingResponse(client.credit_notes)
602+
self.customers = customers.CustomersWithStreamingResponse(client.customers)
603+
self.events = events.EventsWithStreamingResponse(client.events)
604+
self.invoice_line_items = invoice_line_items.InvoiceLineItemsWithStreamingResponse(client.invoice_line_items)
605+
self.invoices = invoices.InvoicesWithStreamingResponse(client.invoices)
606+
self.items = items.ItemsWithStreamingResponse(client.items)
607+
self.metrics = metrics.MetricsWithStreamingResponse(client.metrics)
608+
self.plans = plans.PlansWithStreamingResponse(client.plans)
609+
self.prices = prices.PricesWithStreamingResponse(client.prices)
610+
self.subscriptions = subscriptions.SubscriptionsWithStreamingResponse(client.subscriptions)
611+
self.alerts = alerts.AlertsWithStreamingResponse(client.alerts)
606612

607613

608614
class AsyncOrbWithStreamedResponse:
609615
def __init__(self, client: AsyncOrb) -> None:
610-
self.top_level = resources.AsyncTopLevelWithStreamingResponse(client.top_level)
611-
self.coupons = resources.AsyncCouponsWithStreamingResponse(client.coupons)
612-
self.credit_notes = resources.AsyncCreditNotesWithStreamingResponse(client.credit_notes)
613-
self.customers = resources.AsyncCustomersWithStreamingResponse(client.customers)
614-
self.events = resources.AsyncEventsWithStreamingResponse(client.events)
615-
self.invoice_line_items = resources.AsyncInvoiceLineItemsWithStreamingResponse(client.invoice_line_items)
616-
self.invoices = resources.AsyncInvoicesWithStreamingResponse(client.invoices)
617-
self.items = resources.AsyncItemsWithStreamingResponse(client.items)
618-
self.metrics = resources.AsyncMetricsWithStreamingResponse(client.metrics)
619-
self.plans = resources.AsyncPlansWithStreamingResponse(client.plans)
620-
self.prices = resources.AsyncPricesWithStreamingResponse(client.prices)
621-
self.subscriptions = resources.AsyncSubscriptionsWithStreamingResponse(client.subscriptions)
622-
self.alerts = resources.AsyncAlertsWithStreamingResponse(client.alerts)
616+
self.top_level = top_level.AsyncTopLevelWithStreamingResponse(client.top_level)
617+
self.coupons = coupons.AsyncCouponsWithStreamingResponse(client.coupons)
618+
self.credit_notes = credit_notes.AsyncCreditNotesWithStreamingResponse(client.credit_notes)
619+
self.customers = customers.AsyncCustomersWithStreamingResponse(client.customers)
620+
self.events = events.AsyncEventsWithStreamingResponse(client.events)
621+
self.invoice_line_items = invoice_line_items.AsyncInvoiceLineItemsWithStreamingResponse(
622+
client.invoice_line_items
623+
)
624+
self.invoices = invoices.AsyncInvoicesWithStreamingResponse(client.invoices)
625+
self.items = items.AsyncItemsWithStreamingResponse(client.items)
626+
self.metrics = metrics.AsyncMetricsWithStreamingResponse(client.metrics)
627+
self.plans = plans.AsyncPlansWithStreamingResponse(client.plans)
628+
self.prices = prices.AsyncPricesWithStreamingResponse(client.prices)
629+
self.subscriptions = subscriptions.AsyncSubscriptionsWithStreamingResponse(client.subscriptions)
630+
self.alerts = alerts.AsyncAlertsWithStreamingResponse(client.alerts)
623631

624632

625633
Client = Orb

0 commit comments

Comments
 (0)