6060 seti ,
6161 fqdns ,
6262 media ,
63+ oauth ,
6364 balance ,
6465 regions ,
6566 comments ,
7475 ota_updates ,
7576 short_codes ,
7677 audit_events ,
78+ oauth_grants ,
7779 requirements ,
7880 channel_zones ,
7981 number_lookup ,
8082 number_orders ,
83+ oauth_clients ,
8184 usage_reports ,
8285 billing_groups ,
8386 detail_records ,
178181from .resources .faxes import faxes
179182from .resources .rooms import rooms
180183from .resources .texml import texml
184+ from .resources .client import client
185+ from .resources .legacy import legacy
181186from .resources .queues import queues
182187from .resources .actions import actions
183188from .resources .payment import payment
217222
218223
219224class Telnyx (SyncAPIClient ):
225+ legacy : legacy .LegacyResource
226+ oauth : oauth .OAuthResource
227+ oauth_clients : oauth_clients .OAuthClientsResource
228+ oauth_grants : oauth_grants .OAuthGrantsResource
220229 webhooks : webhooks .WebhooksResource
221230 access_ip_address : access_ip_address .AccessIPAddressResource
222231 access_ip_ranges : access_ip_ranges .AccessIPRangesResource
@@ -366,6 +375,7 @@ class Telnyx(SyncAPIClient):
366375 wireless_blocklist_values : wireless_blocklist_values .WirelessBlocklistValuesResource
367376 wireless_blocklists : wireless_blocklists .WirelessBlocklistsResource
368377 partner_campaigns : partner_campaigns .PartnerCampaignsResource
378+ client : client .ClientResource
369379 with_raw_response : TelnyxWithRawResponse
370380 with_streaming_response : TelnyxWithStreamedResponse
371381
@@ -409,6 +419,7 @@ def __init__(
409419
410420 if base_url is None :
411421 base_url = os .environ .get ("TELNYX_BASE_URL" )
422+ self ._base_url_overridden = base_url is not None
412423 if base_url is None :
413424 base_url = f"https://api.telnyx.com/v2"
414425
@@ -423,6 +434,10 @@ def __init__(
423434 _strict_response_validation = _strict_response_validation ,
424435 )
425436
437+ self .legacy = legacy .LegacyResource (self )
438+ self .oauth = oauth .OAuthResource (self )
439+ self .oauth_clients = oauth_clients .OAuthClientsResource (self )
440+ self .oauth_grants = oauth_grants .OAuthGrantsResource (self )
426441 self .webhooks = webhooks .WebhooksResource (self )
427442 self .access_ip_address = access_ip_address .AccessIPAddressResource (self )
428443 self .access_ip_ranges = access_ip_ranges .AccessIPRangesResource (self )
@@ -578,6 +593,7 @@ def __init__(
578593 self .wireless_blocklist_values = wireless_blocklist_values .WirelessBlocklistValuesResource (self )
579594 self .wireless_blocklists = wireless_blocklists .WirelessBlocklistsResource (self )
580595 self .partner_campaigns = partner_campaigns .PartnerCampaignsResource (self )
596+ self .client = client .ClientResource (self )
581597 self .with_raw_response = TelnyxWithRawResponse (self )
582598 self .with_streaming_response = TelnyxWithStreamedResponse (self )
583599
@@ -637,7 +653,7 @@ def copy(
637653 params = set_default_query
638654
639655 http_client = http_client or self ._client
640- return self .__class__ (
656+ client = self .__class__ (
641657 api_key = api_key or self .api_key ,
642658 base_url = base_url or self .base_url ,
643659 timeout = self .timeout if isinstance (timeout , NotGiven ) else timeout ,
@@ -647,6 +663,8 @@ def copy(
647663 default_query = params ,
648664 ** _extra_kwargs ,
649665 )
666+ client ._base_url_overridden = self ._base_url_overridden or base_url is not None
667+ return client
650668
651669 # Alias for `copy` for nicer inline usage, e.g.
652670 # client.with_options(timeout=10).foo.create(...)
@@ -990,6 +1008,10 @@ def _make_status_error(
9901008
9911009
9921010class AsyncTelnyx (AsyncAPIClient ):
1011+ legacy : legacy .AsyncLegacyResource
1012+ oauth : oauth .AsyncOAuthResource
1013+ oauth_clients : oauth_clients .AsyncOAuthClientsResource
1014+ oauth_grants : oauth_grants .AsyncOAuthGrantsResource
9931015 webhooks : webhooks .AsyncWebhooksResource
9941016 access_ip_address : access_ip_address .AsyncAccessIPAddressResource
9951017 access_ip_ranges : access_ip_ranges .AsyncAccessIPRangesResource
@@ -1139,6 +1161,7 @@ class AsyncTelnyx(AsyncAPIClient):
11391161 wireless_blocklist_values : wireless_blocklist_values .AsyncWirelessBlocklistValuesResource
11401162 wireless_blocklists : wireless_blocklists .AsyncWirelessBlocklistsResource
11411163 partner_campaigns : partner_campaigns .AsyncPartnerCampaignsResource
1164+ client : client .AsyncClientResource
11421165 with_raw_response : AsyncTelnyxWithRawResponse
11431166 with_streaming_response : AsyncTelnyxWithStreamedResponse
11441167
@@ -1182,6 +1205,7 @@ def __init__(
11821205
11831206 if base_url is None :
11841207 base_url = os .environ .get ("TELNYX_BASE_URL" )
1208+ self ._base_url_overridden = base_url is not None
11851209 if base_url is None :
11861210 base_url = f"https://api.telnyx.com/v2"
11871211
@@ -1196,6 +1220,10 @@ def __init__(
11961220 _strict_response_validation = _strict_response_validation ,
11971221 )
11981222
1223+ self .legacy = legacy .AsyncLegacyResource (self )
1224+ self .oauth = oauth .AsyncOAuthResource (self )
1225+ self .oauth_clients = oauth_clients .AsyncOAuthClientsResource (self )
1226+ self .oauth_grants = oauth_grants .AsyncOAuthGrantsResource (self )
11991227 self .webhooks = webhooks .AsyncWebhooksResource (self )
12001228 self .access_ip_address = access_ip_address .AsyncAccessIPAddressResource (self )
12011229 self .access_ip_ranges = access_ip_ranges .AsyncAccessIPRangesResource (self )
@@ -1357,6 +1385,7 @@ def __init__(
13571385 self .wireless_blocklist_values = wireless_blocklist_values .AsyncWirelessBlocklistValuesResource (self )
13581386 self .wireless_blocklists = wireless_blocklists .AsyncWirelessBlocklistsResource (self )
13591387 self .partner_campaigns = partner_campaigns .AsyncPartnerCampaignsResource (self )
1388+ self .client = client .AsyncClientResource (self )
13601389 self .with_raw_response = AsyncTelnyxWithRawResponse (self )
13611390 self .with_streaming_response = AsyncTelnyxWithStreamedResponse (self )
13621391
@@ -1416,7 +1445,7 @@ def copy(
14161445 params = set_default_query
14171446
14181447 http_client = http_client or self ._client
1419- return self .__class__ (
1448+ client = self .__class__ (
14201449 api_key = api_key or self .api_key ,
14211450 base_url = base_url or self .base_url ,
14221451 timeout = self .timeout if isinstance (timeout , NotGiven ) else timeout ,
@@ -1426,6 +1455,8 @@ def copy(
14261455 default_query = params ,
14271456 ** _extra_kwargs ,
14281457 )
1458+ client ._base_url_overridden = self ._base_url_overridden or base_url is not None
1459+ return client
14291460
14301461 # Alias for `copy` for nicer inline usage, e.g.
14311462 # client.with_options(timeout=10).foo.create(...)
@@ -1776,6 +1807,10 @@ def _make_status_error(
17761807
17771808class TelnyxWithRawResponse :
17781809 def __init__ (self , client : Telnyx ) -> None :
1810+ self .legacy = legacy .LegacyResourceWithRawResponse (client .legacy )
1811+ self .oauth = oauth .OAuthResourceWithRawResponse (client .oauth )
1812+ self .oauth_clients = oauth_clients .OAuthClientsResourceWithRawResponse (client .oauth_clients )
1813+ self .oauth_grants = oauth_grants .OAuthGrantsResourceWithRawResponse (client .oauth_grants )
17791814 self .access_ip_address = access_ip_address .AccessIPAddressResourceWithRawResponse (client .access_ip_address )
17801815 self .access_ip_ranges = access_ip_ranges .AccessIPRangesResourceWithRawResponse (client .access_ip_ranges )
17811816 self .actions = actions .ActionsResourceWithRawResponse (client .actions )
@@ -2050,6 +2085,7 @@ def __init__(self, client: Telnyx) -> None:
20502085 client .wireless_blocklists
20512086 )
20522087 self .partner_campaigns = partner_campaigns .PartnerCampaignsResourceWithRawResponse (client .partner_campaigns )
2088+ self .client = client .ClientResourceWithRawResponse (client .client )
20532089
20542090 self .create_bucket = to_raw_response_wrapper (
20552091 client .create_bucket ,
@@ -2080,6 +2116,10 @@ def __init__(self, client: Telnyx) -> None:
20802116
20812117class AsyncTelnyxWithRawResponse :
20822118 def __init__ (self , client : AsyncTelnyx ) -> None :
2119+ self .legacy = legacy .AsyncLegacyResourceWithRawResponse (client .legacy )
2120+ self .oauth = oauth .AsyncOAuthResourceWithRawResponse (client .oauth )
2121+ self .oauth_clients = oauth_clients .AsyncOAuthClientsResourceWithRawResponse (client .oauth_clients )
2122+ self .oauth_grants = oauth_grants .AsyncOAuthGrantsResourceWithRawResponse (client .oauth_grants )
20832123 self .access_ip_address = access_ip_address .AsyncAccessIPAddressResourceWithRawResponse (client .access_ip_address )
20842124 self .access_ip_ranges = access_ip_ranges .AsyncAccessIPRangesResourceWithRawResponse (client .access_ip_ranges )
20852125 self .actions = actions .AsyncActionsResourceWithRawResponse (client .actions )
@@ -2394,6 +2434,7 @@ def __init__(self, client: AsyncTelnyx) -> None:
23942434 self .partner_campaigns = partner_campaigns .AsyncPartnerCampaignsResourceWithRawResponse (
23952435 client .partner_campaigns
23962436 )
2437+ self .client = client .AsyncClientResourceWithRawResponse (client .client )
23972438
23982439 self .create_bucket = async_to_raw_response_wrapper (
23992440 client .create_bucket ,
@@ -2424,6 +2465,10 @@ def __init__(self, client: AsyncTelnyx) -> None:
24242465
24252466class TelnyxWithStreamedResponse :
24262467 def __init__ (self , client : Telnyx ) -> None :
2468+ self .legacy = legacy .LegacyResourceWithStreamingResponse (client .legacy )
2469+ self .oauth = oauth .OAuthResourceWithStreamingResponse (client .oauth )
2470+ self .oauth_clients = oauth_clients .OAuthClientsResourceWithStreamingResponse (client .oauth_clients )
2471+ self .oauth_grants = oauth_grants .OAuthGrantsResourceWithStreamingResponse (client .oauth_grants )
24272472 self .access_ip_address = access_ip_address .AccessIPAddressResourceWithStreamingResponse (
24282473 client .access_ip_address
24292474 )
@@ -2744,6 +2789,7 @@ def __init__(self, client: Telnyx) -> None:
27442789 self .partner_campaigns = partner_campaigns .PartnerCampaignsResourceWithStreamingResponse (
27452790 client .partner_campaigns
27462791 )
2792+ self .client = client .ClientResourceWithStreamingResponse (client .client )
27472793
27482794 self .create_bucket = to_streamed_response_wrapper (
27492795 client .create_bucket ,
@@ -2774,6 +2820,10 @@ def __init__(self, client: Telnyx) -> None:
27742820
27752821class AsyncTelnyxWithStreamedResponse :
27762822 def __init__ (self , client : AsyncTelnyx ) -> None :
2823+ self .legacy = legacy .AsyncLegacyResourceWithStreamingResponse (client .legacy )
2824+ self .oauth = oauth .AsyncOAuthResourceWithStreamingResponse (client .oauth )
2825+ self .oauth_clients = oauth_clients .AsyncOAuthClientsResourceWithStreamingResponse (client .oauth_clients )
2826+ self .oauth_grants = oauth_grants .AsyncOAuthGrantsResourceWithStreamingResponse (client .oauth_grants )
27772827 self .access_ip_address = access_ip_address .AsyncAccessIPAddressResourceWithStreamingResponse (
27782828 client .access_ip_address
27792829 )
@@ -3136,6 +3186,7 @@ def __init__(self, client: AsyncTelnyx) -> None:
31363186 self .partner_campaigns = partner_campaigns .AsyncPartnerCampaignsResourceWithStreamingResponse (
31373187 client .partner_campaigns
31383188 )
3189+ self .client = client .AsyncClientResourceWithStreamingResponse (client .client )
31393190
31403191 self .create_bucket = async_to_streamed_response_wrapper (
31413192 client .create_bucket ,
0 commit comments