From 7c2b90a44bc11d18bf7ac2da83137294587e4ca7 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Thu, 15 Feb 2024 19:22:32 +0000 Subject: [PATCH] feat: OpenAPI spec update via Stainless API --- .stats.yml | 2 +- api.md | 201 ----- src/cloudflare/_client.py | 16 - src/cloudflare/resources/__init__.py | 28 - .../resources/addresses/__init__.py | 61 -- .../addresses/address_maps/__init__.py | 61 -- .../addresses/address_maps/accounts.py | 324 -------- .../addresses/address_maps/address_maps.py | 755 ------------------ .../resources/addresses/address_maps/ips.py | 316 -------- .../resources/addresses/address_maps/zones.py | 316 -------- .../resources/addresses/addresses.py | 147 ---- .../addresses/loa_documents/__init__.py | 33 - .../addresses/loa_documents/downloads.py | 162 ---- .../addresses/loa_documents/loa_documents.py | 214 ----- .../resources/addresses/prefixes/__init__.py | 47 -- .../addresses/prefixes/bgps/__init__.py | 33 - .../resources/addresses/prefixes/bgps/bgps.py | 80 -- .../addresses/prefixes/bgps/statuses.py | 311 -------- .../addresses/prefixes/delegations.py | 426 ---------- .../resources/addresses/prefixes/prefixes.py | 686 ---------------- .../resources/addressing/__init__.py | 47 -- .../resources/addressing/addressing.py | 113 --- .../resources/addressing/prefixes/__init__.py | 47 -- .../addressing/prefixes/bgp_prefixes.py | 416 ---------- .../resources/addressing/prefixes/bindings.py | 549 ------------- .../resources/addressing/prefixes/prefixes.py | 112 --- .../resources/addressing/services.py | 164 ---- src/cloudflare/resources/pcaps/pcaps.py | 12 +- src/cloudflare/resources/purge_caches.py | 8 +- src/cloudflare/types/addresses/__init__.py | 27 - .../addresses/address_map_create_params.py | 23 - .../addresses/address_map_create_response.py | 81 -- .../addresses/address_map_delete_response.py | 7 - .../addresses/address_map_get_response.py | 81 -- .../addresses/address_map_list_response.py | 54 -- .../addresses/address_map_update_params.py | 35 - .../addresses/address_map_update_response.py | 51 -- .../types/addresses/address_maps/__init__.py | 7 - .../address_maps/account_delete_response.py | 7 - .../address_maps/account_update_response.py | 7 - .../address_maps/ip_delete_response.py | 7 - .../address_maps/ip_update_response.py | 7 - .../address_maps/zone_delete_response.py | 7 - .../address_maps/zone_update_response.py | 7 - ...ent_prefixes_upload_loa_document_params.py | 12 - ...t_prefixes_upload_loa_document_response.py | 12 - .../types/addresses/prefix_delete_response.py | 7 - .../types/addresses/prefix_get_response.py | 59 -- ...s_management_prefixes_add_prefix_params.py | 19 - ...management_prefixes_add_prefix_response.py | 59 -- ...agement_prefixes_list_prefixes_response.py | 65 -- .../types/addresses/prefix_update_params.py | 15 - .../types/addresses/prefix_update_response.py | 59 -- .../types/addresses/prefixes/__init__.py | 11 - .../types/addresses/prefixes/bgps/__init__.py | 10 - ...ement_get_advertisement_status_response.py | 19 - ...fix_dynamic_advertisement_status_params.py | 15 - ...x_dynamic_advertisement_status_response.py | 19 - .../prefixes/delegation_delete_response.py | 12 - ...egation_create_prefix_delegation_params.py | 18 - ...ation_create_prefix_delegation_response.py | 26 - ...gation_list_prefix_delegations_response.py | 34 - src/cloudflare/types/addressing/__init__.py | 2 - .../types/addressing/prefixes/__init__.py | 10 - .../prefixes/bgp_prefix_get_response.py | 67 -- .../prefixes/bgp_prefix_list_response.py | 75 -- .../prefixes/bgp_prefix_update_params.py | 21 - .../prefixes/bgp_prefix_update_response.py | 67 -- .../prefixes/binding_create_params.py | 18 - .../prefixes/binding_create_response.py | 33 - .../prefixes/binding_delete_response.py | 7 - .../prefixes/binding_get_response.py | 33 - .../prefixes/binding_list_response.py | 36 - .../types/addressing/service_list_response.py | 18 - ...it_logs_get_account_audit_logs_response.py | 18 +- src/cloudflare/types/pcap_get_response.py | 22 +- ...p_collection_create_pcap_request_params.py | 22 +- ...collection_create_pcap_request_response.py | 22 +- ...n_list_packet_capture_requests_response.py | 24 +- .../types/purge_cach_zone_purge_params.py | 24 +- ...audit_logs_get_user_audit_logs_response.py | 18 +- .../addresses/address_maps/test_accounts.py | 286 ------- .../addresses/address_maps/test_ips.py | 286 ------- .../addresses/address_maps/test_zones.py | 286 ------- .../addresses/loa_documents/test_downloads.py | 129 --- .../addresses/prefixes/bgps/test_statuses.py | 311 -------- .../addresses/prefixes/test_delegations.py | 454 ----------- .../addresses/test_address_maps.py | 564 ------------- .../addresses/test_loa_documents.py | 136 ---- .../api_resources/addresses/test_prefixes.py | 554 ------------- .../addressing/prefixes/test_bgp_prefixes.py | 408 ---------- .../addressing/prefixes/test_bindings.py | 513 ------------ .../api_resources/addressing/test_services.py | 106 --- 93 files changed, 86 insertions(+), 11050 deletions(-) delete mode 100644 src/cloudflare/resources/addresses/__init__.py delete mode 100644 src/cloudflare/resources/addresses/address_maps/__init__.py delete mode 100644 src/cloudflare/resources/addresses/address_maps/accounts.py delete mode 100644 src/cloudflare/resources/addresses/address_maps/address_maps.py delete mode 100644 src/cloudflare/resources/addresses/address_maps/ips.py delete mode 100644 src/cloudflare/resources/addresses/address_maps/zones.py delete mode 100644 src/cloudflare/resources/addresses/addresses.py delete mode 100644 src/cloudflare/resources/addresses/loa_documents/__init__.py delete mode 100644 src/cloudflare/resources/addresses/loa_documents/downloads.py delete mode 100644 src/cloudflare/resources/addresses/loa_documents/loa_documents.py delete mode 100644 src/cloudflare/resources/addresses/prefixes/__init__.py delete mode 100644 src/cloudflare/resources/addresses/prefixes/bgps/__init__.py delete mode 100644 src/cloudflare/resources/addresses/prefixes/bgps/bgps.py delete mode 100644 src/cloudflare/resources/addresses/prefixes/bgps/statuses.py delete mode 100644 src/cloudflare/resources/addresses/prefixes/delegations.py delete mode 100644 src/cloudflare/resources/addresses/prefixes/prefixes.py delete mode 100644 src/cloudflare/resources/addressing/__init__.py delete mode 100644 src/cloudflare/resources/addressing/addressing.py delete mode 100644 src/cloudflare/resources/addressing/prefixes/__init__.py delete mode 100644 src/cloudflare/resources/addressing/prefixes/bgp_prefixes.py delete mode 100644 src/cloudflare/resources/addressing/prefixes/bindings.py delete mode 100644 src/cloudflare/resources/addressing/prefixes/prefixes.py delete mode 100644 src/cloudflare/resources/addressing/services.py delete mode 100644 src/cloudflare/types/addresses/address_map_create_params.py delete mode 100644 src/cloudflare/types/addresses/address_map_create_response.py delete mode 100644 src/cloudflare/types/addresses/address_map_delete_response.py delete mode 100644 src/cloudflare/types/addresses/address_map_get_response.py delete mode 100644 src/cloudflare/types/addresses/address_map_list_response.py delete mode 100644 src/cloudflare/types/addresses/address_map_update_params.py delete mode 100644 src/cloudflare/types/addresses/address_map_update_response.py delete mode 100644 src/cloudflare/types/addresses/address_maps/account_delete_response.py delete mode 100644 src/cloudflare/types/addresses/address_maps/account_update_response.py delete mode 100644 src/cloudflare/types/addresses/address_maps/ip_delete_response.py delete mode 100644 src/cloudflare/types/addresses/address_maps/ip_update_response.py delete mode 100644 src/cloudflare/types/addresses/address_maps/zone_delete_response.py delete mode 100644 src/cloudflare/types/addresses/address_maps/zone_update_response.py delete mode 100644 src/cloudflare/types/addresses/loa_document_ip_address_management_prefixes_upload_loa_document_params.py delete mode 100644 src/cloudflare/types/addresses/loa_document_ip_address_management_prefixes_upload_loa_document_response.py delete mode 100644 src/cloudflare/types/addresses/prefix_delete_response.py delete mode 100644 src/cloudflare/types/addresses/prefix_get_response.py delete mode 100644 src/cloudflare/types/addresses/prefix_ip_address_management_prefixes_add_prefix_params.py delete mode 100644 src/cloudflare/types/addresses/prefix_ip_address_management_prefixes_add_prefix_response.py delete mode 100644 src/cloudflare/types/addresses/prefix_ip_address_management_prefixes_list_prefixes_response.py delete mode 100644 src/cloudflare/types/addresses/prefix_update_params.py delete mode 100644 src/cloudflare/types/addresses/prefix_update_response.py delete mode 100644 src/cloudflare/types/addresses/prefixes/bgps/status_ip_address_management_dynamic_advertisement_get_advertisement_status_response.py delete mode 100644 src/cloudflare/types/addresses/prefixes/bgps/status_ip_address_management_dynamic_advertisement_update_prefix_dynamic_advertisement_status_params.py delete mode 100644 src/cloudflare/types/addresses/prefixes/bgps/status_ip_address_management_dynamic_advertisement_update_prefix_dynamic_advertisement_status_response.py delete mode 100644 src/cloudflare/types/addresses/prefixes/delegation_delete_response.py delete mode 100644 src/cloudflare/types/addresses/prefixes/delegation_ip_address_management_prefix_delegation_create_prefix_delegation_params.py delete mode 100644 src/cloudflare/types/addresses/prefixes/delegation_ip_address_management_prefix_delegation_create_prefix_delegation_response.py delete mode 100644 src/cloudflare/types/addresses/prefixes/delegation_ip_address_management_prefix_delegation_list_prefix_delegations_response.py delete mode 100644 src/cloudflare/types/addressing/prefixes/bgp_prefix_get_response.py delete mode 100644 src/cloudflare/types/addressing/prefixes/bgp_prefix_list_response.py delete mode 100644 src/cloudflare/types/addressing/prefixes/bgp_prefix_update_params.py delete mode 100644 src/cloudflare/types/addressing/prefixes/bgp_prefix_update_response.py delete mode 100644 src/cloudflare/types/addressing/prefixes/binding_create_params.py delete mode 100644 src/cloudflare/types/addressing/prefixes/binding_create_response.py delete mode 100644 src/cloudflare/types/addressing/prefixes/binding_delete_response.py delete mode 100644 src/cloudflare/types/addressing/prefixes/binding_get_response.py delete mode 100644 src/cloudflare/types/addressing/prefixes/binding_list_response.py delete mode 100644 src/cloudflare/types/addressing/service_list_response.py delete mode 100644 tests/api_resources/addresses/address_maps/test_accounts.py delete mode 100644 tests/api_resources/addresses/address_maps/test_ips.py delete mode 100644 tests/api_resources/addresses/address_maps/test_zones.py delete mode 100644 tests/api_resources/addresses/loa_documents/test_downloads.py delete mode 100644 tests/api_resources/addresses/prefixes/bgps/test_statuses.py delete mode 100644 tests/api_resources/addresses/prefixes/test_delegations.py delete mode 100644 tests/api_resources/addresses/test_address_maps.py delete mode 100644 tests/api_resources/addresses/test_loa_documents.py delete mode 100644 tests/api_resources/addresses/test_prefixes.py delete mode 100644 tests/api_resources/addressing/prefixes/test_bgp_prefixes.py delete mode 100644 tests/api_resources/addressing/prefixes/test_bindings.py delete mode 100644 tests/api_resources/addressing/test_services.py diff --git a/.stats.yml b/.stats.yml index fa35e9ca377..3c3374c30eb 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1 +1 @@ -configured_endpoints: 1163 +configured_endpoints: 1132 diff --git a/api.md b/api.md index caedda58ceb..5fc138013f8 100644 --- a/api.md +++ b/api.md @@ -3996,153 +3996,6 @@ Methods: - client.spectrums.apps.spectrum_applications_create_spectrum_application_using_a_name_for_the_origin(zone, \*\*params) -> Optional - client.spectrums.apps.spectrum_applications_list_spectrum_applications(zone, \*\*params) -> Optional -# Addresses - -## AddressMaps - -Types: - -```python -from cloudflare.types.addresses import ( - AddressMapCreateResponse, - AddressMapUpdateResponse, - AddressMapListResponse, - AddressMapDeleteResponse, - AddressMapGetResponse, -) -``` - -Methods: - -- client.addresses.address_maps.create(account_identifier, \*\*params) -> AddressMapCreateResponse -- client.addresses.address_maps.update(address_map_identifier, \*, account_identifier, \*\*params) -> AddressMapUpdateResponse -- client.addresses.address_maps.list(account_identifier) -> Optional -- client.addresses.address_maps.delete(address_map_identifier, \*, account_identifier) -> Optional -- client.addresses.address_maps.get(address_map_identifier, \*, account_identifier) -> AddressMapGetResponse - -### Accounts - -Types: - -```python -from cloudflare.types.addresses.address_maps import AccountUpdateResponse, AccountDeleteResponse -``` - -Methods: - -- client.addresses.address_maps.accounts.update(account_identifier, \*, account_identifier1, address_map_identifier) -> Optional -- client.addresses.address_maps.accounts.delete(account_identifier, \*, account_identifier1, address_map_identifier) -> Optional - -### IPs - -Types: - -```python -from cloudflare.types.addresses.address_maps import IPUpdateResponse, IPDeleteResponse -``` - -Methods: - -- client.addresses.address_maps.ips.update(ip_address, \*, account_identifier, address_map_identifier) -> Optional -- client.addresses.address_maps.ips.delete(ip_address, \*, account_identifier, address_map_identifier) -> Optional - -### Zones - -Types: - -```python -from cloudflare.types.addresses.address_maps import ZoneUpdateResponse, ZoneDeleteResponse -``` - -Methods: - -- client.addresses.address_maps.zones.update(zone_identifier, \*, account_identifier, address_map_identifier) -> Optional -- client.addresses.address_maps.zones.delete(zone_identifier, \*, account_identifier, address_map_identifier) -> Optional - -## LoaDocuments - -Types: - -```python -from cloudflare.types.addresses import ( - LoaDocumentIPAddressManagementPrefixesUploadLoaDocumentResponse, -) -``` - -Methods: - -- client.addresses.loa_documents.ip_address_management_prefixes_upload_loa_document(account_identifier, \*\*params) -> LoaDocumentIPAddressManagementPrefixesUploadLoaDocumentResponse - -### Downloads - -Types: - -```python -from cloudflare.types.addresses.loa_documents import DownloadListResponse -``` - -Methods: - -- client.addresses.loa_documents.downloads.list(loa_document_identifier, \*, account_identifier) -> object - -## Prefixes - -Types: - -```python -from cloudflare.types.addresses import ( - PrefixUpdateResponse, - PrefixDeleteResponse, - PrefixGetResponse, - PrefixIPAddressManagementPrefixesAddPrefixResponse, - PrefixIPAddressManagementPrefixesListPrefixesResponse, -) -``` - -Methods: - -- client.addresses.prefixes.update(prefix_identifier, \*, account_identifier, \*\*params) -> PrefixUpdateResponse -- client.addresses.prefixes.delete(prefix_identifier, \*, account_identifier) -> Optional -- client.addresses.prefixes.get(prefix_identifier, \*, account_identifier) -> PrefixGetResponse -- client.addresses.prefixes.ip_address_management_prefixes_add_prefix(account_identifier, \*\*params) -> PrefixIPAddressManagementPrefixesAddPrefixResponse -- client.addresses.prefixes.ip_address_management_prefixes_list_prefixes(account_identifier) -> Optional - -### BGPs - -#### Statuses - -Types: - -```python -from cloudflare.types.addresses.prefixes.bgps import ( - StatusIPAddressManagementDynamicAdvertisementGetAdvertisementStatusResponse, - StatusIPAddressManagementDynamicAdvertisementUpdatePrefixDynamicAdvertisementStatusResponse, -) -``` - -Methods: - -- client.addresses.prefixes.bgps.statuses.ip_address_management_dynamic_advertisement_get_advertisement_status(prefix_identifier, \*, account_identifier) -> StatusIPAddressManagementDynamicAdvertisementGetAdvertisementStatusResponse -- client.addresses.prefixes.bgps.statuses.ip_address_management_dynamic_advertisement_update_prefix_dynamic_advertisement_status(prefix_identifier, \*, account_identifier, \*\*params) -> StatusIPAddressManagementDynamicAdvertisementUpdatePrefixDynamicAdvertisementStatusResponse - -### Delegations - -Types: - -```python -from cloudflare.types.addresses.prefixes import ( - DelegationDeleteResponse, - DelegationIPAddressManagementPrefixDelegationCreatePrefixDelegationResponse, - DelegationIPAddressManagementPrefixDelegationListPrefixDelegationsResponse, -) -``` - -Methods: - -- client.addresses.prefixes.delegations.delete(delegation_identifier, \*, account_identifier, prefix_identifier) -> DelegationDeleteResponse -- client.addresses.prefixes.delegations.ip_address_management_prefix_delegation_create_prefix_delegation(prefix_identifier, \*, account_identifier, \*\*params) -> DelegationIPAddressManagementPrefixDelegationCreatePrefixDelegationResponse -- client.addresses.prefixes.delegations.ip_address_management_prefix_delegation_list_prefix_delegations(prefix_identifier, \*, account_identifier) -> Optional - # AuditLogs Types: @@ -6462,60 +6315,6 @@ Methods: - client.zerotrust.connectivity_settings.update(account_id, \*\*params) -> ConnectivitySettingUpdateResponse - client.zerotrust.connectivity_settings.get(account_id) -> ConnectivitySettingGetResponse -# Addressing - -## Prefixes - -### BGPPrefixes - -Types: - -```python -from cloudflare.types.addressing.prefixes import ( - BGPPrefixUpdateResponse, - BGPPrefixListResponse, - BGPPrefixGetResponse, -) -``` - -Methods: - -- client.addressing.prefixes.bgp_prefixes.update(bgp_prefix_identifier, \*, account_identifier, prefix_identifier, \*\*params) -> BGPPrefixUpdateResponse -- client.addressing.prefixes.bgp_prefixes.list(prefix_identifier, \*, account_identifier) -> Optional -- client.addressing.prefixes.bgp_prefixes.get(bgp_prefix_identifier, \*, account_identifier, prefix_identifier) -> BGPPrefixGetResponse - -### Bindings - -Types: - -```python -from cloudflare.types.addressing.prefixes import ( - BindingCreateResponse, - BindingListResponse, - BindingDeleteResponse, - BindingGetResponse, -) -``` - -Methods: - -- client.addressing.prefixes.bindings.create(prefix_identifier, \*, account_identifier, \*\*params) -> BindingCreateResponse -- client.addressing.prefixes.bindings.list(prefix_identifier, \*, account_identifier) -> BindingListResponse -- client.addressing.prefixes.bindings.delete(binding_identifier, \*, account_identifier, prefix_identifier) -> BindingDeleteResponse -- client.addressing.prefixes.bindings.get(binding_identifier, \*, account_identifier, prefix_identifier) -> BindingGetResponse - -## Services - -Types: - -```python -from cloudflare.types.addressing import ServiceListResponse -``` - -Methods: - -- client.addressing.services.list(account_identifier) -> ServiceListResponse - # Challenges ## Widgets diff --git a/src/cloudflare/_client.py b/src/cloudflare/_client.py index 8c48b2c0dad..28e69f8b97c 100644 --- a/src/cloudflare/_client.py +++ b/src/cloudflare/_client.py @@ -94,7 +94,6 @@ class Cloudflare(SyncAPIClient): rulesets: resources.Rulesets url_normalizations: resources.URLNormalizations spectrums: resources.Spectrums - addresses: resources.Addresses audit_logs: resources.AuditLogs billings: resources.Billings brand_protections: resources.BrandProtections @@ -131,7 +130,6 @@ class Cloudflare(SyncAPIClient): worker_domains: resources.WorkerDomains worker_scripts: resources.WorkerScripts zerotrust: resources.Zerotrust - addressing: resources.Addressing challenges: resources.Challenges hyperdrive: resources.Hyperdrive intel: resources.Intel @@ -291,7 +289,6 @@ def __init__( self.rulesets = resources.Rulesets(self) self.url_normalizations = resources.URLNormalizations(self) self.spectrums = resources.Spectrums(self) - self.addresses = resources.Addresses(self) self.audit_logs = resources.AuditLogs(self) self.billings = resources.Billings(self) self.brand_protections = resources.BrandProtections(self) @@ -328,7 +325,6 @@ def __init__( self.worker_domains = resources.WorkerDomains(self) self.worker_scripts = resources.WorkerScripts(self) self.zerotrust = resources.Zerotrust(self) - self.addressing = resources.Addressing(self) self.challenges = resources.Challenges(self) self.hyperdrive = resources.Hyperdrive(self) self.intel = resources.Intel(self) @@ -542,7 +538,6 @@ class AsyncCloudflare(AsyncAPIClient): rulesets: resources.AsyncRulesets url_normalizations: resources.AsyncURLNormalizations spectrums: resources.AsyncSpectrums - addresses: resources.AsyncAddresses audit_logs: resources.AsyncAuditLogs billings: resources.AsyncBillings brand_protections: resources.AsyncBrandProtections @@ -579,7 +574,6 @@ class AsyncCloudflare(AsyncAPIClient): worker_domains: resources.AsyncWorkerDomains worker_scripts: resources.AsyncWorkerScripts zerotrust: resources.AsyncZerotrust - addressing: resources.AsyncAddressing challenges: resources.AsyncChallenges hyperdrive: resources.AsyncHyperdrive intel: resources.AsyncIntel @@ -739,7 +733,6 @@ def __init__( self.rulesets = resources.AsyncRulesets(self) self.url_normalizations = resources.AsyncURLNormalizations(self) self.spectrums = resources.AsyncSpectrums(self) - self.addresses = resources.AsyncAddresses(self) self.audit_logs = resources.AsyncAuditLogs(self) self.billings = resources.AsyncBillings(self) self.brand_protections = resources.AsyncBrandProtections(self) @@ -776,7 +769,6 @@ def __init__( self.worker_domains = resources.AsyncWorkerDomains(self) self.worker_scripts = resources.AsyncWorkerScripts(self) self.zerotrust = resources.AsyncZerotrust(self) - self.addressing = resources.AsyncAddressing(self) self.challenges = resources.AsyncChallenges(self) self.hyperdrive = resources.AsyncHyperdrive(self) self.intel = resources.AsyncIntel(self) @@ -991,7 +983,6 @@ def __init__(self, client: Cloudflare) -> None: self.rulesets = resources.RulesetsWithRawResponse(client.rulesets) self.url_normalizations = resources.URLNormalizationsWithRawResponse(client.url_normalizations) self.spectrums = resources.SpectrumsWithRawResponse(client.spectrums) - self.addresses = resources.AddressesWithRawResponse(client.addresses) self.audit_logs = resources.AuditLogsWithRawResponse(client.audit_logs) self.billings = resources.BillingsWithRawResponse(client.billings) self.brand_protections = resources.BrandProtectionsWithRawResponse(client.brand_protections) @@ -1028,7 +1019,6 @@ def __init__(self, client: Cloudflare) -> None: self.worker_domains = resources.WorkerDomainsWithRawResponse(client.worker_domains) self.worker_scripts = resources.WorkerScriptsWithRawResponse(client.worker_scripts) self.zerotrust = resources.ZerotrustWithRawResponse(client.zerotrust) - self.addressing = resources.AddressingWithRawResponse(client.addressing) self.challenges = resources.ChallengesWithRawResponse(client.challenges) self.hyperdrive = resources.HyperdriveWithRawResponse(client.hyperdrive) self.intel = resources.IntelWithRawResponse(client.intel) @@ -1107,7 +1097,6 @@ def __init__(self, client: AsyncCloudflare) -> None: self.rulesets = resources.AsyncRulesetsWithRawResponse(client.rulesets) self.url_normalizations = resources.AsyncURLNormalizationsWithRawResponse(client.url_normalizations) self.spectrums = resources.AsyncSpectrumsWithRawResponse(client.spectrums) - self.addresses = resources.AsyncAddressesWithRawResponse(client.addresses) self.audit_logs = resources.AsyncAuditLogsWithRawResponse(client.audit_logs) self.billings = resources.AsyncBillingsWithRawResponse(client.billings) self.brand_protections = resources.AsyncBrandProtectionsWithRawResponse(client.brand_protections) @@ -1144,7 +1133,6 @@ def __init__(self, client: AsyncCloudflare) -> None: self.worker_domains = resources.AsyncWorkerDomainsWithRawResponse(client.worker_domains) self.worker_scripts = resources.AsyncWorkerScriptsWithRawResponse(client.worker_scripts) self.zerotrust = resources.AsyncZerotrustWithRawResponse(client.zerotrust) - self.addressing = resources.AsyncAddressingWithRawResponse(client.addressing) self.challenges = resources.AsyncChallengesWithRawResponse(client.challenges) self.hyperdrive = resources.AsyncHyperdriveWithRawResponse(client.hyperdrive) self.intel = resources.AsyncIntelWithRawResponse(client.intel) @@ -1223,7 +1211,6 @@ def __init__(self, client: Cloudflare) -> None: self.rulesets = resources.RulesetsWithStreamingResponse(client.rulesets) self.url_normalizations = resources.URLNormalizationsWithStreamingResponse(client.url_normalizations) self.spectrums = resources.SpectrumsWithStreamingResponse(client.spectrums) - self.addresses = resources.AddressesWithStreamingResponse(client.addresses) self.audit_logs = resources.AuditLogsWithStreamingResponse(client.audit_logs) self.billings = resources.BillingsWithStreamingResponse(client.billings) self.brand_protections = resources.BrandProtectionsWithStreamingResponse(client.brand_protections) @@ -1260,7 +1247,6 @@ def __init__(self, client: Cloudflare) -> None: self.worker_domains = resources.WorkerDomainsWithStreamingResponse(client.worker_domains) self.worker_scripts = resources.WorkerScriptsWithStreamingResponse(client.worker_scripts) self.zerotrust = resources.ZerotrustWithStreamingResponse(client.zerotrust) - self.addressing = resources.AddressingWithStreamingResponse(client.addressing) self.challenges = resources.ChallengesWithStreamingResponse(client.challenges) self.hyperdrive = resources.HyperdriveWithStreamingResponse(client.hyperdrive) self.intel = resources.IntelWithStreamingResponse(client.intel) @@ -1341,7 +1327,6 @@ def __init__(self, client: AsyncCloudflare) -> None: self.rulesets = resources.AsyncRulesetsWithStreamingResponse(client.rulesets) self.url_normalizations = resources.AsyncURLNormalizationsWithStreamingResponse(client.url_normalizations) self.spectrums = resources.AsyncSpectrumsWithStreamingResponse(client.spectrums) - self.addresses = resources.AsyncAddressesWithStreamingResponse(client.addresses) self.audit_logs = resources.AsyncAuditLogsWithStreamingResponse(client.audit_logs) self.billings = resources.AsyncBillingsWithStreamingResponse(client.billings) self.brand_protections = resources.AsyncBrandProtectionsWithStreamingResponse(client.brand_protections) @@ -1380,7 +1365,6 @@ def __init__(self, client: AsyncCloudflare) -> None: self.worker_domains = resources.AsyncWorkerDomainsWithStreamingResponse(client.worker_domains) self.worker_scripts = resources.AsyncWorkerScriptsWithStreamingResponse(client.worker_scripts) self.zerotrust = resources.AsyncZerotrustWithStreamingResponse(client.zerotrust) - self.addressing = resources.AsyncAddressingWithStreamingResponse(client.addressing) self.challenges = resources.AsyncChallengesWithStreamingResponse(client.challenges) self.hyperdrive = resources.AsyncHyperdriveWithStreamingResponse(client.hyperdrive) self.intel = resources.AsyncIntelWithStreamingResponse(client.intel) diff --git a/src/cloudflare/resources/__init__.py b/src/cloudflare/resources/__init__.py index 250e7edad71..bc7015efaa5 100644 --- a/src/cloudflare/resources/__init__.py +++ b/src/cloudflare/resources/__init__.py @@ -392,14 +392,6 @@ TeamnetsWithStreamingResponse, AsyncTeamnetsWithStreamingResponse, ) -from .addresses import ( - Addresses, - AsyncAddresses, - AddressesWithRawResponse, - AsyncAddressesWithRawResponse, - AddressesWithStreamingResponse, - AsyncAddressesWithStreamingResponse, -) from .analytics import ( Analytics, AsyncAnalytics, @@ -480,14 +472,6 @@ ZerotrustWithStreamingResponse, AsyncZerotrustWithStreamingResponse, ) -from .addressing import ( - Addressing, - AsyncAddressing, - AddressingWithRawResponse, - AsyncAddressingWithRawResponse, - AddressingWithStreamingResponse, - AsyncAddressingWithStreamingResponse, -) from .audit_logs import ( AuditLogs, AsyncAuditLogs, @@ -1154,12 +1138,6 @@ "AsyncSpectrumsWithRawResponse", "SpectrumsWithStreamingResponse", "AsyncSpectrumsWithStreamingResponse", - "Addresses", - "AsyncAddresses", - "AddressesWithRawResponse", - "AsyncAddressesWithRawResponse", - "AddressesWithStreamingResponse", - "AsyncAddressesWithStreamingResponse", "AuditLogs", "AsyncAuditLogs", "AuditLogsWithRawResponse", @@ -1376,12 +1354,6 @@ "AsyncZerotrustWithRawResponse", "ZerotrustWithStreamingResponse", "AsyncZerotrustWithStreamingResponse", - "Addressing", - "AsyncAddressing", - "AddressingWithRawResponse", - "AsyncAddressingWithRawResponse", - "AddressingWithStreamingResponse", - "AsyncAddressingWithStreamingResponse", "Challenges", "AsyncChallenges", "ChallengesWithRawResponse", diff --git a/src/cloudflare/resources/addresses/__init__.py b/src/cloudflare/resources/addresses/__init__.py deleted file mode 100644 index 264dd4b6289..00000000000 --- a/src/cloudflare/resources/addresses/__init__.py +++ /dev/null @@ -1,61 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from .prefixes import ( - Prefixes, - AsyncPrefixes, - PrefixesWithRawResponse, - AsyncPrefixesWithRawResponse, - PrefixesWithStreamingResponse, - AsyncPrefixesWithStreamingResponse, -) -from .addresses import ( - Addresses, - AsyncAddresses, - AddressesWithRawResponse, - AsyncAddressesWithRawResponse, - AddressesWithStreamingResponse, - AsyncAddressesWithStreamingResponse, -) -from .address_maps import ( - AddressMaps, - AsyncAddressMaps, - AddressMapsWithRawResponse, - AsyncAddressMapsWithRawResponse, - AddressMapsWithStreamingResponse, - AsyncAddressMapsWithStreamingResponse, -) -from .loa_documents import ( - LoaDocuments, - AsyncLoaDocuments, - LoaDocumentsWithRawResponse, - AsyncLoaDocumentsWithRawResponse, - LoaDocumentsWithStreamingResponse, - AsyncLoaDocumentsWithStreamingResponse, -) - -__all__ = [ - "AddressMaps", - "AsyncAddressMaps", - "AddressMapsWithRawResponse", - "AsyncAddressMapsWithRawResponse", - "AddressMapsWithStreamingResponse", - "AsyncAddressMapsWithStreamingResponse", - "LoaDocuments", - "AsyncLoaDocuments", - "LoaDocumentsWithRawResponse", - "AsyncLoaDocumentsWithRawResponse", - "LoaDocumentsWithStreamingResponse", - "AsyncLoaDocumentsWithStreamingResponse", - "Prefixes", - "AsyncPrefixes", - "PrefixesWithRawResponse", - "AsyncPrefixesWithRawResponse", - "PrefixesWithStreamingResponse", - "AsyncPrefixesWithStreamingResponse", - "Addresses", - "AsyncAddresses", - "AddressesWithRawResponse", - "AsyncAddressesWithRawResponse", - "AddressesWithStreamingResponse", - "AsyncAddressesWithStreamingResponse", -] diff --git a/src/cloudflare/resources/addresses/address_maps/__init__.py b/src/cloudflare/resources/addresses/address_maps/__init__.py deleted file mode 100644 index eeeb97955d0..00000000000 --- a/src/cloudflare/resources/addresses/address_maps/__init__.py +++ /dev/null @@ -1,61 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from .ips import ( - IPs, - AsyncIPs, - IPsWithRawResponse, - AsyncIPsWithRawResponse, - IPsWithStreamingResponse, - AsyncIPsWithStreamingResponse, -) -from .zones import ( - Zones, - AsyncZones, - ZonesWithRawResponse, - AsyncZonesWithRawResponse, - ZonesWithStreamingResponse, - AsyncZonesWithStreamingResponse, -) -from .accounts import ( - Accounts, - AsyncAccounts, - AccountsWithRawResponse, - AsyncAccountsWithRawResponse, - AccountsWithStreamingResponse, - AsyncAccountsWithStreamingResponse, -) -from .address_maps import ( - AddressMaps, - AsyncAddressMaps, - AddressMapsWithRawResponse, - AsyncAddressMapsWithRawResponse, - AddressMapsWithStreamingResponse, - AsyncAddressMapsWithStreamingResponse, -) - -__all__ = [ - "Accounts", - "AsyncAccounts", - "AccountsWithRawResponse", - "AsyncAccountsWithRawResponse", - "AccountsWithStreamingResponse", - "AsyncAccountsWithStreamingResponse", - "IPs", - "AsyncIPs", - "IPsWithRawResponse", - "AsyncIPsWithRawResponse", - "IPsWithStreamingResponse", - "AsyncIPsWithStreamingResponse", - "Zones", - "AsyncZones", - "ZonesWithRawResponse", - "AsyncZonesWithRawResponse", - "ZonesWithStreamingResponse", - "AsyncZonesWithStreamingResponse", - "AddressMaps", - "AsyncAddressMaps", - "AddressMapsWithRawResponse", - "AsyncAddressMapsWithRawResponse", - "AddressMapsWithStreamingResponse", - "AsyncAddressMapsWithStreamingResponse", -] diff --git a/src/cloudflare/resources/addresses/address_maps/accounts.py b/src/cloudflare/resources/addresses/address_maps/accounts.py deleted file mode 100644 index be74295d005..00000000000 --- a/src/cloudflare/resources/addresses/address_maps/accounts.py +++ /dev/null @@ -1,324 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from __future__ import annotations - -from typing import Any, Optional, cast - -import httpx - -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ...._compat import cached_property -from ...._resource import SyncAPIResource, AsyncAPIResource -from ...._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ...._wrappers import ResultWrapper -from ...._base_client import ( - make_request_options, -) -from ....types.addresses.address_maps import AccountDeleteResponse, AccountUpdateResponse - -__all__ = ["Accounts", "AsyncAccounts"] - - -class Accounts(SyncAPIResource): - @cached_property - def with_raw_response(self) -> AccountsWithRawResponse: - return AccountsWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AccountsWithStreamingResponse: - return AccountsWithStreamingResponse(self) - - def update( - self, - account_identifier: str, - *, - account_identifier1: str, - address_map_identifier: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[AccountUpdateResponse]: - """ - Add an account as a member of a particular address map. - - Args: - account_identifier1: Identifier - - address_map_identifier: Identifier - - account_identifier: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_identifier1: - raise ValueError( - f"Expected a non-empty value for `account_identifier1` but received {account_identifier1!r}" - ) - if not address_map_identifier: - raise ValueError( - f"Expected a non-empty value for `address_map_identifier` but received {address_map_identifier!r}" - ) - if not account_identifier: - raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") - return cast( - Optional[AccountUpdateResponse], - self._put( - f"/accounts/{account_identifier1}/addressing/address_maps/{address_map_identifier}/accounts/{account_identifier}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[AccountUpdateResponse] - ), # Union types cannot be passed in as arguments in the type system - ), - ) - - def delete( - self, - account_identifier: str, - *, - account_identifier1: str, - address_map_identifier: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[AccountDeleteResponse]: - """ - Remove an account as a member of a particular address map. - - Args: - account_identifier1: Identifier - - address_map_identifier: Identifier - - account_identifier: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_identifier1: - raise ValueError( - f"Expected a non-empty value for `account_identifier1` but received {account_identifier1!r}" - ) - if not address_map_identifier: - raise ValueError( - f"Expected a non-empty value for `address_map_identifier` but received {address_map_identifier!r}" - ) - if not account_identifier: - raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") - return cast( - Optional[AccountDeleteResponse], - self._delete( - f"/accounts/{account_identifier1}/addressing/address_maps/{address_map_identifier}/accounts/{account_identifier}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[AccountDeleteResponse] - ), # Union types cannot be passed in as arguments in the type system - ), - ) - - -class AsyncAccounts(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncAccountsWithRawResponse: - return AsyncAccountsWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncAccountsWithStreamingResponse: - return AsyncAccountsWithStreamingResponse(self) - - async def update( - self, - account_identifier: str, - *, - account_identifier1: str, - address_map_identifier: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[AccountUpdateResponse]: - """ - Add an account as a member of a particular address map. - - Args: - account_identifier1: Identifier - - address_map_identifier: Identifier - - account_identifier: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_identifier1: - raise ValueError( - f"Expected a non-empty value for `account_identifier1` but received {account_identifier1!r}" - ) - if not address_map_identifier: - raise ValueError( - f"Expected a non-empty value for `address_map_identifier` but received {address_map_identifier!r}" - ) - if not account_identifier: - raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") - return cast( - Optional[AccountUpdateResponse], - await self._put( - f"/accounts/{account_identifier1}/addressing/address_maps/{address_map_identifier}/accounts/{account_identifier}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[AccountUpdateResponse] - ), # Union types cannot be passed in as arguments in the type system - ), - ) - - async def delete( - self, - account_identifier: str, - *, - account_identifier1: str, - address_map_identifier: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[AccountDeleteResponse]: - """ - Remove an account as a member of a particular address map. - - Args: - account_identifier1: Identifier - - address_map_identifier: Identifier - - account_identifier: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_identifier1: - raise ValueError( - f"Expected a non-empty value for `account_identifier1` but received {account_identifier1!r}" - ) - if not address_map_identifier: - raise ValueError( - f"Expected a non-empty value for `address_map_identifier` but received {address_map_identifier!r}" - ) - if not account_identifier: - raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") - return cast( - Optional[AccountDeleteResponse], - await self._delete( - f"/accounts/{account_identifier1}/addressing/address_maps/{address_map_identifier}/accounts/{account_identifier}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[AccountDeleteResponse] - ), # Union types cannot be passed in as arguments in the type system - ), - ) - - -class AccountsWithRawResponse: - def __init__(self, accounts: Accounts) -> None: - self._accounts = accounts - - self.update = to_raw_response_wrapper( - accounts.update, - ) - self.delete = to_raw_response_wrapper( - accounts.delete, - ) - - -class AsyncAccountsWithRawResponse: - def __init__(self, accounts: AsyncAccounts) -> None: - self._accounts = accounts - - self.update = async_to_raw_response_wrapper( - accounts.update, - ) - self.delete = async_to_raw_response_wrapper( - accounts.delete, - ) - - -class AccountsWithStreamingResponse: - def __init__(self, accounts: Accounts) -> None: - self._accounts = accounts - - self.update = to_streamed_response_wrapper( - accounts.update, - ) - self.delete = to_streamed_response_wrapper( - accounts.delete, - ) - - -class AsyncAccountsWithStreamingResponse: - def __init__(self, accounts: AsyncAccounts) -> None: - self._accounts = accounts - - self.update = async_to_streamed_response_wrapper( - accounts.update, - ) - self.delete = async_to_streamed_response_wrapper( - accounts.delete, - ) diff --git a/src/cloudflare/resources/addresses/address_maps/address_maps.py b/src/cloudflare/resources/addresses/address_maps/address_maps.py deleted file mode 100644 index bd342715c02..00000000000 --- a/src/cloudflare/resources/addresses/address_maps/address_maps.py +++ /dev/null @@ -1,755 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from __future__ import annotations - -from typing import Any, Type, Optional, cast - -import httpx - -from .ips import ( - IPs, - AsyncIPs, - IPsWithRawResponse, - AsyncIPsWithRawResponse, - IPsWithStreamingResponse, - AsyncIPsWithStreamingResponse, -) -from .zones import ( - Zones, - AsyncZones, - ZonesWithRawResponse, - AsyncZonesWithRawResponse, - ZonesWithStreamingResponse, - AsyncZonesWithStreamingResponse, -) -from .accounts import ( - Accounts, - AsyncAccounts, - AccountsWithRawResponse, - AsyncAccountsWithRawResponse, - AccountsWithStreamingResponse, - AsyncAccountsWithStreamingResponse, -) -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ...._utils import maybe_transform -from ...._compat import cached_property -from ...._resource import SyncAPIResource, AsyncAPIResource -from ...._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ...._wrappers import ResultWrapper -from ...._base_client import ( - make_request_options, -) -from ....types.addresses import ( - AddressMapGetResponse, - AddressMapListResponse, - AddressMapCreateResponse, - AddressMapDeleteResponse, - AddressMapUpdateResponse, - address_map_create_params, - address_map_update_params, -) - -__all__ = ["AddressMaps", "AsyncAddressMaps"] - - -class AddressMaps(SyncAPIResource): - @cached_property - def accounts(self) -> Accounts: - return Accounts(self._client) - - @cached_property - def ips(self) -> IPs: - return IPs(self._client) - - @cached_property - def zones(self) -> Zones: - return Zones(self._client) - - @cached_property - def with_raw_response(self) -> AddressMapsWithRawResponse: - return AddressMapsWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AddressMapsWithStreamingResponse: - return AddressMapsWithStreamingResponse(self) - - def create( - self, - account_identifier: str, - *, - description: Optional[str] | NotGiven = NOT_GIVEN, - enabled: Optional[bool] | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AddressMapCreateResponse: - """ - Create a new address map under the account. - - Args: - account_identifier: Identifier - - description: An optional description field which may be used to describe the types of IPs or - zones on the map. - - enabled: Whether the Address Map is enabled or not. Cloudflare's DNS will not respond - with IP addresses on an Address Map until the map is enabled. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_identifier: - raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") - return self._post( - f"/accounts/{account_identifier}/addressing/address_maps", - body=maybe_transform( - { - "description": description, - "enabled": enabled, - }, - address_map_create_params.AddressMapCreateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast(Type[AddressMapCreateResponse], ResultWrapper[AddressMapCreateResponse]), - ) - - def update( - self, - address_map_identifier: str, - *, - account_identifier: str, - default_sni: Optional[str] | NotGiven = NOT_GIVEN, - description: Optional[str] | NotGiven = NOT_GIVEN, - enabled: Optional[bool] | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AddressMapUpdateResponse: - """ - Modify properties of an address map owned by the account. - - Args: - account_identifier: Identifier - - address_map_identifier: Identifier - - default_sni: If you have legacy TLS clients which do not send the TLS server name indicator, - then you can specify one default SNI on the map. If Cloudflare receives a TLS - handshake from a client without an SNI, it will respond with the default SNI on - those IPs. The default SNI can be any valid zone or subdomain owned by the - account. - - description: An optional description field which may be used to describe the types of IPs or - zones on the map. - - enabled: Whether the Address Map is enabled or not. Cloudflare's DNS will not respond - with IP addresses on an Address Map until the map is enabled. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_identifier: - raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") - if not address_map_identifier: - raise ValueError( - f"Expected a non-empty value for `address_map_identifier` but received {address_map_identifier!r}" - ) - return self._patch( - f"/accounts/{account_identifier}/addressing/address_maps/{address_map_identifier}", - body=maybe_transform( - { - "default_sni": default_sni, - "description": description, - "enabled": enabled, - }, - address_map_update_params.AddressMapUpdateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast(Type[AddressMapUpdateResponse], ResultWrapper[AddressMapUpdateResponse]), - ) - - def list( - self, - account_identifier: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[AddressMapListResponse]: - """ - List all address maps owned by the account. - - Args: - account_identifier: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_identifier: - raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") - return self._get( - f"/accounts/{account_identifier}/addressing/address_maps", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast(Type[Optional[AddressMapListResponse]], ResultWrapper[AddressMapListResponse]), - ) - - def delete( - self, - address_map_identifier: str, - *, - account_identifier: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[AddressMapDeleteResponse]: - """Delete a particular address map owned by the account. - - An Address Map must be - disabled before it can be deleted. - - Args: - account_identifier: Identifier - - address_map_identifier: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_identifier: - raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") - if not address_map_identifier: - raise ValueError( - f"Expected a non-empty value for `address_map_identifier` but received {address_map_identifier!r}" - ) - return cast( - Optional[AddressMapDeleteResponse], - self._delete( - f"/accounts/{account_identifier}/addressing/address_maps/{address_map_identifier}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[AddressMapDeleteResponse] - ), # Union types cannot be passed in as arguments in the type system - ), - ) - - def get( - self, - address_map_identifier: str, - *, - account_identifier: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AddressMapGetResponse: - """ - Show a particular address map owned by the account. - - Args: - account_identifier: Identifier - - address_map_identifier: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_identifier: - raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") - if not address_map_identifier: - raise ValueError( - f"Expected a non-empty value for `address_map_identifier` but received {address_map_identifier!r}" - ) - return self._get( - f"/accounts/{account_identifier}/addressing/address_maps/{address_map_identifier}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast(Type[AddressMapGetResponse], ResultWrapper[AddressMapGetResponse]), - ) - - -class AsyncAddressMaps(AsyncAPIResource): - @cached_property - def accounts(self) -> AsyncAccounts: - return AsyncAccounts(self._client) - - @cached_property - def ips(self) -> AsyncIPs: - return AsyncIPs(self._client) - - @cached_property - def zones(self) -> AsyncZones: - return AsyncZones(self._client) - - @cached_property - def with_raw_response(self) -> AsyncAddressMapsWithRawResponse: - return AsyncAddressMapsWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncAddressMapsWithStreamingResponse: - return AsyncAddressMapsWithStreamingResponse(self) - - async def create( - self, - account_identifier: str, - *, - description: Optional[str] | NotGiven = NOT_GIVEN, - enabled: Optional[bool] | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AddressMapCreateResponse: - """ - Create a new address map under the account. - - Args: - account_identifier: Identifier - - description: An optional description field which may be used to describe the types of IPs or - zones on the map. - - enabled: Whether the Address Map is enabled or not. Cloudflare's DNS will not respond - with IP addresses on an Address Map until the map is enabled. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_identifier: - raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") - return await self._post( - f"/accounts/{account_identifier}/addressing/address_maps", - body=maybe_transform( - { - "description": description, - "enabled": enabled, - }, - address_map_create_params.AddressMapCreateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast(Type[AddressMapCreateResponse], ResultWrapper[AddressMapCreateResponse]), - ) - - async def update( - self, - address_map_identifier: str, - *, - account_identifier: str, - default_sni: Optional[str] | NotGiven = NOT_GIVEN, - description: Optional[str] | NotGiven = NOT_GIVEN, - enabled: Optional[bool] | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AddressMapUpdateResponse: - """ - Modify properties of an address map owned by the account. - - Args: - account_identifier: Identifier - - address_map_identifier: Identifier - - default_sni: If you have legacy TLS clients which do not send the TLS server name indicator, - then you can specify one default SNI on the map. If Cloudflare receives a TLS - handshake from a client without an SNI, it will respond with the default SNI on - those IPs. The default SNI can be any valid zone or subdomain owned by the - account. - - description: An optional description field which may be used to describe the types of IPs or - zones on the map. - - enabled: Whether the Address Map is enabled or not. Cloudflare's DNS will not respond - with IP addresses on an Address Map until the map is enabled. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_identifier: - raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") - if not address_map_identifier: - raise ValueError( - f"Expected a non-empty value for `address_map_identifier` but received {address_map_identifier!r}" - ) - return await self._patch( - f"/accounts/{account_identifier}/addressing/address_maps/{address_map_identifier}", - body=maybe_transform( - { - "default_sni": default_sni, - "description": description, - "enabled": enabled, - }, - address_map_update_params.AddressMapUpdateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast(Type[AddressMapUpdateResponse], ResultWrapper[AddressMapUpdateResponse]), - ) - - async def list( - self, - account_identifier: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[AddressMapListResponse]: - """ - List all address maps owned by the account. - - Args: - account_identifier: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_identifier: - raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") - return await self._get( - f"/accounts/{account_identifier}/addressing/address_maps", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast(Type[Optional[AddressMapListResponse]], ResultWrapper[AddressMapListResponse]), - ) - - async def delete( - self, - address_map_identifier: str, - *, - account_identifier: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[AddressMapDeleteResponse]: - """Delete a particular address map owned by the account. - - An Address Map must be - disabled before it can be deleted. - - Args: - account_identifier: Identifier - - address_map_identifier: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_identifier: - raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") - if not address_map_identifier: - raise ValueError( - f"Expected a non-empty value for `address_map_identifier` but received {address_map_identifier!r}" - ) - return cast( - Optional[AddressMapDeleteResponse], - await self._delete( - f"/accounts/{account_identifier}/addressing/address_maps/{address_map_identifier}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[AddressMapDeleteResponse] - ), # Union types cannot be passed in as arguments in the type system - ), - ) - - async def get( - self, - address_map_identifier: str, - *, - account_identifier: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AddressMapGetResponse: - """ - Show a particular address map owned by the account. - - Args: - account_identifier: Identifier - - address_map_identifier: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_identifier: - raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") - if not address_map_identifier: - raise ValueError( - f"Expected a non-empty value for `address_map_identifier` but received {address_map_identifier!r}" - ) - return await self._get( - f"/accounts/{account_identifier}/addressing/address_maps/{address_map_identifier}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast(Type[AddressMapGetResponse], ResultWrapper[AddressMapGetResponse]), - ) - - -class AddressMapsWithRawResponse: - def __init__(self, address_maps: AddressMaps) -> None: - self._address_maps = address_maps - - self.create = to_raw_response_wrapper( - address_maps.create, - ) - self.update = to_raw_response_wrapper( - address_maps.update, - ) - self.list = to_raw_response_wrapper( - address_maps.list, - ) - self.delete = to_raw_response_wrapper( - address_maps.delete, - ) - self.get = to_raw_response_wrapper( - address_maps.get, - ) - - @cached_property - def accounts(self) -> AccountsWithRawResponse: - return AccountsWithRawResponse(self._address_maps.accounts) - - @cached_property - def ips(self) -> IPsWithRawResponse: - return IPsWithRawResponse(self._address_maps.ips) - - @cached_property - def zones(self) -> ZonesWithRawResponse: - return ZonesWithRawResponse(self._address_maps.zones) - - -class AsyncAddressMapsWithRawResponse: - def __init__(self, address_maps: AsyncAddressMaps) -> None: - self._address_maps = address_maps - - self.create = async_to_raw_response_wrapper( - address_maps.create, - ) - self.update = async_to_raw_response_wrapper( - address_maps.update, - ) - self.list = async_to_raw_response_wrapper( - address_maps.list, - ) - self.delete = async_to_raw_response_wrapper( - address_maps.delete, - ) - self.get = async_to_raw_response_wrapper( - address_maps.get, - ) - - @cached_property - def accounts(self) -> AsyncAccountsWithRawResponse: - return AsyncAccountsWithRawResponse(self._address_maps.accounts) - - @cached_property - def ips(self) -> AsyncIPsWithRawResponse: - return AsyncIPsWithRawResponse(self._address_maps.ips) - - @cached_property - def zones(self) -> AsyncZonesWithRawResponse: - return AsyncZonesWithRawResponse(self._address_maps.zones) - - -class AddressMapsWithStreamingResponse: - def __init__(self, address_maps: AddressMaps) -> None: - self._address_maps = address_maps - - self.create = to_streamed_response_wrapper( - address_maps.create, - ) - self.update = to_streamed_response_wrapper( - address_maps.update, - ) - self.list = to_streamed_response_wrapper( - address_maps.list, - ) - self.delete = to_streamed_response_wrapper( - address_maps.delete, - ) - self.get = to_streamed_response_wrapper( - address_maps.get, - ) - - @cached_property - def accounts(self) -> AccountsWithStreamingResponse: - return AccountsWithStreamingResponse(self._address_maps.accounts) - - @cached_property - def ips(self) -> IPsWithStreamingResponse: - return IPsWithStreamingResponse(self._address_maps.ips) - - @cached_property - def zones(self) -> ZonesWithStreamingResponse: - return ZonesWithStreamingResponse(self._address_maps.zones) - - -class AsyncAddressMapsWithStreamingResponse: - def __init__(self, address_maps: AsyncAddressMaps) -> None: - self._address_maps = address_maps - - self.create = async_to_streamed_response_wrapper( - address_maps.create, - ) - self.update = async_to_streamed_response_wrapper( - address_maps.update, - ) - self.list = async_to_streamed_response_wrapper( - address_maps.list, - ) - self.delete = async_to_streamed_response_wrapper( - address_maps.delete, - ) - self.get = async_to_streamed_response_wrapper( - address_maps.get, - ) - - @cached_property - def accounts(self) -> AsyncAccountsWithStreamingResponse: - return AsyncAccountsWithStreamingResponse(self._address_maps.accounts) - - @cached_property - def ips(self) -> AsyncIPsWithStreamingResponse: - return AsyncIPsWithStreamingResponse(self._address_maps.ips) - - @cached_property - def zones(self) -> AsyncZonesWithStreamingResponse: - return AsyncZonesWithStreamingResponse(self._address_maps.zones) diff --git a/src/cloudflare/resources/addresses/address_maps/ips.py b/src/cloudflare/resources/addresses/address_maps/ips.py deleted file mode 100644 index f149b3609f4..00000000000 --- a/src/cloudflare/resources/addresses/address_maps/ips.py +++ /dev/null @@ -1,316 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from __future__ import annotations - -from typing import Any, Optional, cast - -import httpx - -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ...._compat import cached_property -from ...._resource import SyncAPIResource, AsyncAPIResource -from ...._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ...._wrappers import ResultWrapper -from ...._base_client import ( - make_request_options, -) -from ....types.addresses.address_maps import IPDeleteResponse, IPUpdateResponse - -__all__ = ["IPs", "AsyncIPs"] - - -class IPs(SyncAPIResource): - @cached_property - def with_raw_response(self) -> IPsWithRawResponse: - return IPsWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> IPsWithStreamingResponse: - return IPsWithStreamingResponse(self) - - def update( - self, - ip_address: str, - *, - account_identifier: str, - address_map_identifier: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[IPUpdateResponse]: - """ - Add an IP from a prefix owned by the account to a particular address map. - - Args: - account_identifier: Identifier - - address_map_identifier: Identifier - - ip_address: An IPv4 or IPv6 address. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_identifier: - raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") - if not address_map_identifier: - raise ValueError( - f"Expected a non-empty value for `address_map_identifier` but received {address_map_identifier!r}" - ) - if not ip_address: - raise ValueError(f"Expected a non-empty value for `ip_address` but received {ip_address!r}") - return cast( - Optional[IPUpdateResponse], - self._put( - f"/accounts/{account_identifier}/addressing/address_maps/{address_map_identifier}/ips/{ip_address}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[IPUpdateResponse] - ), # Union types cannot be passed in as arguments in the type system - ), - ) - - def delete( - self, - ip_address: str, - *, - account_identifier: str, - address_map_identifier: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[IPDeleteResponse]: - """ - Remove an IP from a particular address map. - - Args: - account_identifier: Identifier - - address_map_identifier: Identifier - - ip_address: An IPv4 or IPv6 address. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_identifier: - raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") - if not address_map_identifier: - raise ValueError( - f"Expected a non-empty value for `address_map_identifier` but received {address_map_identifier!r}" - ) - if not ip_address: - raise ValueError(f"Expected a non-empty value for `ip_address` but received {ip_address!r}") - return cast( - Optional[IPDeleteResponse], - self._delete( - f"/accounts/{account_identifier}/addressing/address_maps/{address_map_identifier}/ips/{ip_address}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[IPDeleteResponse] - ), # Union types cannot be passed in as arguments in the type system - ), - ) - - -class AsyncIPs(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncIPsWithRawResponse: - return AsyncIPsWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncIPsWithStreamingResponse: - return AsyncIPsWithStreamingResponse(self) - - async def update( - self, - ip_address: str, - *, - account_identifier: str, - address_map_identifier: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[IPUpdateResponse]: - """ - Add an IP from a prefix owned by the account to a particular address map. - - Args: - account_identifier: Identifier - - address_map_identifier: Identifier - - ip_address: An IPv4 or IPv6 address. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_identifier: - raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") - if not address_map_identifier: - raise ValueError( - f"Expected a non-empty value for `address_map_identifier` but received {address_map_identifier!r}" - ) - if not ip_address: - raise ValueError(f"Expected a non-empty value for `ip_address` but received {ip_address!r}") - return cast( - Optional[IPUpdateResponse], - await self._put( - f"/accounts/{account_identifier}/addressing/address_maps/{address_map_identifier}/ips/{ip_address}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[IPUpdateResponse] - ), # Union types cannot be passed in as arguments in the type system - ), - ) - - async def delete( - self, - ip_address: str, - *, - account_identifier: str, - address_map_identifier: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[IPDeleteResponse]: - """ - Remove an IP from a particular address map. - - Args: - account_identifier: Identifier - - address_map_identifier: Identifier - - ip_address: An IPv4 or IPv6 address. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_identifier: - raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") - if not address_map_identifier: - raise ValueError( - f"Expected a non-empty value for `address_map_identifier` but received {address_map_identifier!r}" - ) - if not ip_address: - raise ValueError(f"Expected a non-empty value for `ip_address` but received {ip_address!r}") - return cast( - Optional[IPDeleteResponse], - await self._delete( - f"/accounts/{account_identifier}/addressing/address_maps/{address_map_identifier}/ips/{ip_address}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[IPDeleteResponse] - ), # Union types cannot be passed in as arguments in the type system - ), - ) - - -class IPsWithRawResponse: - def __init__(self, ips: IPs) -> None: - self._ips = ips - - self.update = to_raw_response_wrapper( - ips.update, - ) - self.delete = to_raw_response_wrapper( - ips.delete, - ) - - -class AsyncIPsWithRawResponse: - def __init__(self, ips: AsyncIPs) -> None: - self._ips = ips - - self.update = async_to_raw_response_wrapper( - ips.update, - ) - self.delete = async_to_raw_response_wrapper( - ips.delete, - ) - - -class IPsWithStreamingResponse: - def __init__(self, ips: IPs) -> None: - self._ips = ips - - self.update = to_streamed_response_wrapper( - ips.update, - ) - self.delete = to_streamed_response_wrapper( - ips.delete, - ) - - -class AsyncIPsWithStreamingResponse: - def __init__(self, ips: AsyncIPs) -> None: - self._ips = ips - - self.update = async_to_streamed_response_wrapper( - ips.update, - ) - self.delete = async_to_streamed_response_wrapper( - ips.delete, - ) diff --git a/src/cloudflare/resources/addresses/address_maps/zones.py b/src/cloudflare/resources/addresses/address_maps/zones.py deleted file mode 100644 index 745251e662c..00000000000 --- a/src/cloudflare/resources/addresses/address_maps/zones.py +++ /dev/null @@ -1,316 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from __future__ import annotations - -from typing import Any, Optional, cast - -import httpx - -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ...._compat import cached_property -from ...._resource import SyncAPIResource, AsyncAPIResource -from ...._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ...._wrappers import ResultWrapper -from ...._base_client import ( - make_request_options, -) -from ....types.addresses.address_maps import ZoneDeleteResponse, ZoneUpdateResponse - -__all__ = ["Zones", "AsyncZones"] - - -class Zones(SyncAPIResource): - @cached_property - def with_raw_response(self) -> ZonesWithRawResponse: - return ZonesWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> ZonesWithStreamingResponse: - return ZonesWithStreamingResponse(self) - - def update( - self, - zone_identifier: str, - *, - account_identifier: str, - address_map_identifier: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ZoneUpdateResponse]: - """ - Add a zone as a member of a particular address map. - - Args: - account_identifier: Identifier - - address_map_identifier: Identifier - - zone_identifier: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_identifier: - raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") - if not address_map_identifier: - raise ValueError( - f"Expected a non-empty value for `address_map_identifier` but received {address_map_identifier!r}" - ) - if not zone_identifier: - raise ValueError(f"Expected a non-empty value for `zone_identifier` but received {zone_identifier!r}") - return cast( - Optional[ZoneUpdateResponse], - self._put( - f"/accounts/{account_identifier}/addressing/address_maps/{address_map_identifier}/zones/{zone_identifier}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[ZoneUpdateResponse] - ), # Union types cannot be passed in as arguments in the type system - ), - ) - - def delete( - self, - zone_identifier: str, - *, - account_identifier: str, - address_map_identifier: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ZoneDeleteResponse]: - """ - Remove a zone as a member of a particular address map. - - Args: - account_identifier: Identifier - - address_map_identifier: Identifier - - zone_identifier: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_identifier: - raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") - if not address_map_identifier: - raise ValueError( - f"Expected a non-empty value for `address_map_identifier` but received {address_map_identifier!r}" - ) - if not zone_identifier: - raise ValueError(f"Expected a non-empty value for `zone_identifier` but received {zone_identifier!r}") - return cast( - Optional[ZoneDeleteResponse], - self._delete( - f"/accounts/{account_identifier}/addressing/address_maps/{address_map_identifier}/zones/{zone_identifier}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[ZoneDeleteResponse] - ), # Union types cannot be passed in as arguments in the type system - ), - ) - - -class AsyncZones(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncZonesWithRawResponse: - return AsyncZonesWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncZonesWithStreamingResponse: - return AsyncZonesWithStreamingResponse(self) - - async def update( - self, - zone_identifier: str, - *, - account_identifier: str, - address_map_identifier: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ZoneUpdateResponse]: - """ - Add a zone as a member of a particular address map. - - Args: - account_identifier: Identifier - - address_map_identifier: Identifier - - zone_identifier: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_identifier: - raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") - if not address_map_identifier: - raise ValueError( - f"Expected a non-empty value for `address_map_identifier` but received {address_map_identifier!r}" - ) - if not zone_identifier: - raise ValueError(f"Expected a non-empty value for `zone_identifier` but received {zone_identifier!r}") - return cast( - Optional[ZoneUpdateResponse], - await self._put( - f"/accounts/{account_identifier}/addressing/address_maps/{address_map_identifier}/zones/{zone_identifier}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[ZoneUpdateResponse] - ), # Union types cannot be passed in as arguments in the type system - ), - ) - - async def delete( - self, - zone_identifier: str, - *, - account_identifier: str, - address_map_identifier: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ZoneDeleteResponse]: - """ - Remove a zone as a member of a particular address map. - - Args: - account_identifier: Identifier - - address_map_identifier: Identifier - - zone_identifier: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_identifier: - raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") - if not address_map_identifier: - raise ValueError( - f"Expected a non-empty value for `address_map_identifier` but received {address_map_identifier!r}" - ) - if not zone_identifier: - raise ValueError(f"Expected a non-empty value for `zone_identifier` but received {zone_identifier!r}") - return cast( - Optional[ZoneDeleteResponse], - await self._delete( - f"/accounts/{account_identifier}/addressing/address_maps/{address_map_identifier}/zones/{zone_identifier}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[ZoneDeleteResponse] - ), # Union types cannot be passed in as arguments in the type system - ), - ) - - -class ZonesWithRawResponse: - def __init__(self, zones: Zones) -> None: - self._zones = zones - - self.update = to_raw_response_wrapper( - zones.update, - ) - self.delete = to_raw_response_wrapper( - zones.delete, - ) - - -class AsyncZonesWithRawResponse: - def __init__(self, zones: AsyncZones) -> None: - self._zones = zones - - self.update = async_to_raw_response_wrapper( - zones.update, - ) - self.delete = async_to_raw_response_wrapper( - zones.delete, - ) - - -class ZonesWithStreamingResponse: - def __init__(self, zones: Zones) -> None: - self._zones = zones - - self.update = to_streamed_response_wrapper( - zones.update, - ) - self.delete = to_streamed_response_wrapper( - zones.delete, - ) - - -class AsyncZonesWithStreamingResponse: - def __init__(self, zones: AsyncZones) -> None: - self._zones = zones - - self.update = async_to_streamed_response_wrapper( - zones.update, - ) - self.delete = async_to_streamed_response_wrapper( - zones.delete, - ) diff --git a/src/cloudflare/resources/addresses/addresses.py b/src/cloudflare/resources/addresses/addresses.py deleted file mode 100644 index 085bef79c20..00000000000 --- a/src/cloudflare/resources/addresses/addresses.py +++ /dev/null @@ -1,147 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from __future__ import annotations - -from .prefixes import ( - Prefixes, - AsyncPrefixes, - PrefixesWithRawResponse, - AsyncPrefixesWithRawResponse, - PrefixesWithStreamingResponse, - AsyncPrefixesWithStreamingResponse, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from .address_maps import ( - AddressMaps, - AsyncAddressMaps, - AddressMapsWithRawResponse, - AsyncAddressMapsWithRawResponse, - AddressMapsWithStreamingResponse, - AsyncAddressMapsWithStreamingResponse, -) -from .loa_documents import ( - LoaDocuments, - AsyncLoaDocuments, - LoaDocumentsWithRawResponse, - AsyncLoaDocumentsWithRawResponse, - LoaDocumentsWithStreamingResponse, - AsyncLoaDocumentsWithStreamingResponse, -) -from .prefixes.prefixes import Prefixes, AsyncPrefixes -from .address_maps.address_maps import AddressMaps, AsyncAddressMaps -from .loa_documents.loa_documents import LoaDocuments, AsyncLoaDocuments - -__all__ = ["Addresses", "AsyncAddresses"] - - -class Addresses(SyncAPIResource): - @cached_property - def address_maps(self) -> AddressMaps: - return AddressMaps(self._client) - - @cached_property - def loa_documents(self) -> LoaDocuments: - return LoaDocuments(self._client) - - @cached_property - def prefixes(self) -> Prefixes: - return Prefixes(self._client) - - @cached_property - def with_raw_response(self) -> AddressesWithRawResponse: - return AddressesWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AddressesWithStreamingResponse: - return AddressesWithStreamingResponse(self) - - -class AsyncAddresses(AsyncAPIResource): - @cached_property - def address_maps(self) -> AsyncAddressMaps: - return AsyncAddressMaps(self._client) - - @cached_property - def loa_documents(self) -> AsyncLoaDocuments: - return AsyncLoaDocuments(self._client) - - @cached_property - def prefixes(self) -> AsyncPrefixes: - return AsyncPrefixes(self._client) - - @cached_property - def with_raw_response(self) -> AsyncAddressesWithRawResponse: - return AsyncAddressesWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncAddressesWithStreamingResponse: - return AsyncAddressesWithStreamingResponse(self) - - -class AddressesWithRawResponse: - def __init__(self, addresses: Addresses) -> None: - self._addresses = addresses - - @cached_property - def address_maps(self) -> AddressMapsWithRawResponse: - return AddressMapsWithRawResponse(self._addresses.address_maps) - - @cached_property - def loa_documents(self) -> LoaDocumentsWithRawResponse: - return LoaDocumentsWithRawResponse(self._addresses.loa_documents) - - @cached_property - def prefixes(self) -> PrefixesWithRawResponse: - return PrefixesWithRawResponse(self._addresses.prefixes) - - -class AsyncAddressesWithRawResponse: - def __init__(self, addresses: AsyncAddresses) -> None: - self._addresses = addresses - - @cached_property - def address_maps(self) -> AsyncAddressMapsWithRawResponse: - return AsyncAddressMapsWithRawResponse(self._addresses.address_maps) - - @cached_property - def loa_documents(self) -> AsyncLoaDocumentsWithRawResponse: - return AsyncLoaDocumentsWithRawResponse(self._addresses.loa_documents) - - @cached_property - def prefixes(self) -> AsyncPrefixesWithRawResponse: - return AsyncPrefixesWithRawResponse(self._addresses.prefixes) - - -class AddressesWithStreamingResponse: - def __init__(self, addresses: Addresses) -> None: - self._addresses = addresses - - @cached_property - def address_maps(self) -> AddressMapsWithStreamingResponse: - return AddressMapsWithStreamingResponse(self._addresses.address_maps) - - @cached_property - def loa_documents(self) -> LoaDocumentsWithStreamingResponse: - return LoaDocumentsWithStreamingResponse(self._addresses.loa_documents) - - @cached_property - def prefixes(self) -> PrefixesWithStreamingResponse: - return PrefixesWithStreamingResponse(self._addresses.prefixes) - - -class AsyncAddressesWithStreamingResponse: - def __init__(self, addresses: AsyncAddresses) -> None: - self._addresses = addresses - - @cached_property - def address_maps(self) -> AsyncAddressMapsWithStreamingResponse: - return AsyncAddressMapsWithStreamingResponse(self._addresses.address_maps) - - @cached_property - def loa_documents(self) -> AsyncLoaDocumentsWithStreamingResponse: - return AsyncLoaDocumentsWithStreamingResponse(self._addresses.loa_documents) - - @cached_property - def prefixes(self) -> AsyncPrefixesWithStreamingResponse: - return AsyncPrefixesWithStreamingResponse(self._addresses.prefixes) diff --git a/src/cloudflare/resources/addresses/loa_documents/__init__.py b/src/cloudflare/resources/addresses/loa_documents/__init__.py deleted file mode 100644 index 5986f9580a8..00000000000 --- a/src/cloudflare/resources/addresses/loa_documents/__init__.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from .downloads import ( - Downloads, - AsyncDownloads, - DownloadsWithRawResponse, - AsyncDownloadsWithRawResponse, - DownloadsWithStreamingResponse, - AsyncDownloadsWithStreamingResponse, -) -from .loa_documents import ( - LoaDocuments, - AsyncLoaDocuments, - LoaDocumentsWithRawResponse, - AsyncLoaDocumentsWithRawResponse, - LoaDocumentsWithStreamingResponse, - AsyncLoaDocumentsWithStreamingResponse, -) - -__all__ = [ - "Downloads", - "AsyncDownloads", - "DownloadsWithRawResponse", - "AsyncDownloadsWithRawResponse", - "DownloadsWithStreamingResponse", - "AsyncDownloadsWithStreamingResponse", - "LoaDocuments", - "AsyncLoaDocuments", - "LoaDocumentsWithRawResponse", - "AsyncLoaDocumentsWithRawResponse", - "LoaDocumentsWithStreamingResponse", - "AsyncLoaDocumentsWithStreamingResponse", -] diff --git a/src/cloudflare/resources/addresses/loa_documents/downloads.py b/src/cloudflare/resources/addresses/loa_documents/downloads.py deleted file mode 100644 index 032dbd1c0d3..00000000000 --- a/src/cloudflare/resources/addresses/loa_documents/downloads.py +++ /dev/null @@ -1,162 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from __future__ import annotations - -from typing import Optional - -import httpx - -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ...._compat import cached_property -from ...._resource import SyncAPIResource, AsyncAPIResource -from ...._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ...._base_client import ( - make_request_options, -) - -__all__ = ["Downloads", "AsyncDownloads"] - - -class Downloads(SyncAPIResource): - @cached_property - def with_raw_response(self) -> DownloadsWithRawResponse: - return DownloadsWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> DownloadsWithStreamingResponse: - return DownloadsWithStreamingResponse(self) - - def list( - self, - loa_document_identifier: Optional[str], - *, - account_identifier: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Download specified LOA document under the account. - - Args: - account_identifier: Identifier - - loa_document_identifier: Identifier for the uploaded LOA document. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_identifier: - raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") - if not loa_document_identifier: - raise ValueError( - f"Expected a non-empty value for `loa_document_identifier` but received {loa_document_identifier!r}" - ) - return self._get( - f"/accounts/{account_identifier}/addressing/loa_documents/{loa_document_identifier}/download", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - -class AsyncDownloads(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncDownloadsWithRawResponse: - return AsyncDownloadsWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncDownloadsWithStreamingResponse: - return AsyncDownloadsWithStreamingResponse(self) - - async def list( - self, - loa_document_identifier: Optional[str], - *, - account_identifier: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Download specified LOA document under the account. - - Args: - account_identifier: Identifier - - loa_document_identifier: Identifier for the uploaded LOA document. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_identifier: - raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") - if not loa_document_identifier: - raise ValueError( - f"Expected a non-empty value for `loa_document_identifier` but received {loa_document_identifier!r}" - ) - return await self._get( - f"/accounts/{account_identifier}/addressing/loa_documents/{loa_document_identifier}/download", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - -class DownloadsWithRawResponse: - def __init__(self, downloads: Downloads) -> None: - self._downloads = downloads - - self.list = to_raw_response_wrapper( - downloads.list, - ) - - -class AsyncDownloadsWithRawResponse: - def __init__(self, downloads: AsyncDownloads) -> None: - self._downloads = downloads - - self.list = async_to_raw_response_wrapper( - downloads.list, - ) - - -class DownloadsWithStreamingResponse: - def __init__(self, downloads: Downloads) -> None: - self._downloads = downloads - - self.list = to_streamed_response_wrapper( - downloads.list, - ) - - -class AsyncDownloadsWithStreamingResponse: - def __init__(self, downloads: AsyncDownloads) -> None: - self._downloads = downloads - - self.list = async_to_streamed_response_wrapper( - downloads.list, - ) diff --git a/src/cloudflare/resources/addresses/loa_documents/loa_documents.py b/src/cloudflare/resources/addresses/loa_documents/loa_documents.py deleted file mode 100644 index f7ad541370e..00000000000 --- a/src/cloudflare/resources/addresses/loa_documents/loa_documents.py +++ /dev/null @@ -1,214 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from __future__ import annotations - -from typing import Type, cast - -import httpx - -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ...._utils import maybe_transform -from .downloads import ( - Downloads, - AsyncDownloads, - DownloadsWithRawResponse, - AsyncDownloadsWithRawResponse, - DownloadsWithStreamingResponse, - AsyncDownloadsWithStreamingResponse, -) -from ...._compat import cached_property -from ...._resource import SyncAPIResource, AsyncAPIResource -from ...._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ...._wrappers import ResultWrapper -from ...._base_client import ( - make_request_options, -) -from ....types.addresses import ( - LoaDocumentIPAddressManagementPrefixesUploadLoaDocumentResponse, - loa_document_ip_address_management_prefixes_upload_loa_document_params, -) - -__all__ = ["LoaDocuments", "AsyncLoaDocuments"] - - -class LoaDocuments(SyncAPIResource): - @cached_property - def downloads(self) -> Downloads: - return Downloads(self._client) - - @cached_property - def with_raw_response(self) -> LoaDocumentsWithRawResponse: - return LoaDocumentsWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LoaDocumentsWithStreamingResponse: - return LoaDocumentsWithStreamingResponse(self) - - def ip_address_management_prefixes_upload_loa_document( - self, - account_identifier: str, - *, - loa_document: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LoaDocumentIPAddressManagementPrefixesUploadLoaDocumentResponse: - """ - Submit LOA document (pdf format) under the account. - - Args: - account_identifier: Identifier - - loa_document: LOA document to upload. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_identifier: - raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") - return self._post( - f"/accounts/{account_identifier}/addressing/loa_documents", - body=maybe_transform( - {"loa_document": loa_document}, - loa_document_ip_address_management_prefixes_upload_loa_document_params.LoaDocumentIPAddressManagementPrefixesUploadLoaDocumentParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast( - Type[LoaDocumentIPAddressManagementPrefixesUploadLoaDocumentResponse], - ResultWrapper[LoaDocumentIPAddressManagementPrefixesUploadLoaDocumentResponse], - ), - ) - - -class AsyncLoaDocuments(AsyncAPIResource): - @cached_property - def downloads(self) -> AsyncDownloads: - return AsyncDownloads(self._client) - - @cached_property - def with_raw_response(self) -> AsyncLoaDocumentsWithRawResponse: - return AsyncLoaDocumentsWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLoaDocumentsWithStreamingResponse: - return AsyncLoaDocumentsWithStreamingResponse(self) - - async def ip_address_management_prefixes_upload_loa_document( - self, - account_identifier: str, - *, - loa_document: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LoaDocumentIPAddressManagementPrefixesUploadLoaDocumentResponse: - """ - Submit LOA document (pdf format) under the account. - - Args: - account_identifier: Identifier - - loa_document: LOA document to upload. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_identifier: - raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") - return await self._post( - f"/accounts/{account_identifier}/addressing/loa_documents", - body=maybe_transform( - {"loa_document": loa_document}, - loa_document_ip_address_management_prefixes_upload_loa_document_params.LoaDocumentIPAddressManagementPrefixesUploadLoaDocumentParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast( - Type[LoaDocumentIPAddressManagementPrefixesUploadLoaDocumentResponse], - ResultWrapper[LoaDocumentIPAddressManagementPrefixesUploadLoaDocumentResponse], - ), - ) - - -class LoaDocumentsWithRawResponse: - def __init__(self, loa_documents: LoaDocuments) -> None: - self._loa_documents = loa_documents - - self.ip_address_management_prefixes_upload_loa_document = to_raw_response_wrapper( - loa_documents.ip_address_management_prefixes_upload_loa_document, - ) - - @cached_property - def downloads(self) -> DownloadsWithRawResponse: - return DownloadsWithRawResponse(self._loa_documents.downloads) - - -class AsyncLoaDocumentsWithRawResponse: - def __init__(self, loa_documents: AsyncLoaDocuments) -> None: - self._loa_documents = loa_documents - - self.ip_address_management_prefixes_upload_loa_document = async_to_raw_response_wrapper( - loa_documents.ip_address_management_prefixes_upload_loa_document, - ) - - @cached_property - def downloads(self) -> AsyncDownloadsWithRawResponse: - return AsyncDownloadsWithRawResponse(self._loa_documents.downloads) - - -class LoaDocumentsWithStreamingResponse: - def __init__(self, loa_documents: LoaDocuments) -> None: - self._loa_documents = loa_documents - - self.ip_address_management_prefixes_upload_loa_document = to_streamed_response_wrapper( - loa_documents.ip_address_management_prefixes_upload_loa_document, - ) - - @cached_property - def downloads(self) -> DownloadsWithStreamingResponse: - return DownloadsWithStreamingResponse(self._loa_documents.downloads) - - -class AsyncLoaDocumentsWithStreamingResponse: - def __init__(self, loa_documents: AsyncLoaDocuments) -> None: - self._loa_documents = loa_documents - - self.ip_address_management_prefixes_upload_loa_document = async_to_streamed_response_wrapper( - loa_documents.ip_address_management_prefixes_upload_loa_document, - ) - - @cached_property - def downloads(self) -> AsyncDownloadsWithStreamingResponse: - return AsyncDownloadsWithStreamingResponse(self._loa_documents.downloads) diff --git a/src/cloudflare/resources/addresses/prefixes/__init__.py b/src/cloudflare/resources/addresses/prefixes/__init__.py deleted file mode 100644 index 51700297e44..00000000000 --- a/src/cloudflare/resources/addresses/prefixes/__init__.py +++ /dev/null @@ -1,47 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from .bgps import ( - BGPs, - AsyncBGPs, - BGPsWithRawResponse, - AsyncBGPsWithRawResponse, - BGPsWithStreamingResponse, - AsyncBGPsWithStreamingResponse, -) -from .prefixes import ( - Prefixes, - AsyncPrefixes, - PrefixesWithRawResponse, - AsyncPrefixesWithRawResponse, - PrefixesWithStreamingResponse, - AsyncPrefixesWithStreamingResponse, -) -from .delegations import ( - Delegations, - AsyncDelegations, - DelegationsWithRawResponse, - AsyncDelegationsWithRawResponse, - DelegationsWithStreamingResponse, - AsyncDelegationsWithStreamingResponse, -) - -__all__ = [ - "BGPs", - "AsyncBGPs", - "BGPsWithRawResponse", - "AsyncBGPsWithRawResponse", - "BGPsWithStreamingResponse", - "AsyncBGPsWithStreamingResponse", - "Delegations", - "AsyncDelegations", - "DelegationsWithRawResponse", - "AsyncDelegationsWithRawResponse", - "DelegationsWithStreamingResponse", - "AsyncDelegationsWithStreamingResponse", - "Prefixes", - "AsyncPrefixes", - "PrefixesWithRawResponse", - "AsyncPrefixesWithRawResponse", - "PrefixesWithStreamingResponse", - "AsyncPrefixesWithStreamingResponse", -] diff --git a/src/cloudflare/resources/addresses/prefixes/bgps/__init__.py b/src/cloudflare/resources/addresses/prefixes/bgps/__init__.py deleted file mode 100644 index 56fbf818846..00000000000 --- a/src/cloudflare/resources/addresses/prefixes/bgps/__init__.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from .bgps import ( - BGPs, - AsyncBGPs, - BGPsWithRawResponse, - AsyncBGPsWithRawResponse, - BGPsWithStreamingResponse, - AsyncBGPsWithStreamingResponse, -) -from .statuses import ( - Statuses, - AsyncStatuses, - StatusesWithRawResponse, - AsyncStatusesWithRawResponse, - StatusesWithStreamingResponse, - AsyncStatusesWithStreamingResponse, -) - -__all__ = [ - "Statuses", - "AsyncStatuses", - "StatusesWithRawResponse", - "AsyncStatusesWithRawResponse", - "StatusesWithStreamingResponse", - "AsyncStatusesWithStreamingResponse", - "BGPs", - "AsyncBGPs", - "BGPsWithRawResponse", - "AsyncBGPsWithRawResponse", - "BGPsWithStreamingResponse", - "AsyncBGPsWithStreamingResponse", -] diff --git a/src/cloudflare/resources/addresses/prefixes/bgps/bgps.py b/src/cloudflare/resources/addresses/prefixes/bgps/bgps.py deleted file mode 100644 index 965db014a4e..00000000000 --- a/src/cloudflare/resources/addresses/prefixes/bgps/bgps.py +++ /dev/null @@ -1,80 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from __future__ import annotations - -from .statuses import ( - Statuses, - AsyncStatuses, - StatusesWithRawResponse, - AsyncStatusesWithRawResponse, - StatusesWithStreamingResponse, - AsyncStatusesWithStreamingResponse, -) -from ....._compat import cached_property -from ....._resource import SyncAPIResource, AsyncAPIResource - -__all__ = ["BGPs", "AsyncBGPs"] - - -class BGPs(SyncAPIResource): - @cached_property - def statuses(self) -> Statuses: - return Statuses(self._client) - - @cached_property - def with_raw_response(self) -> BGPsWithRawResponse: - return BGPsWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> BGPsWithStreamingResponse: - return BGPsWithStreamingResponse(self) - - -class AsyncBGPs(AsyncAPIResource): - @cached_property - def statuses(self) -> AsyncStatuses: - return AsyncStatuses(self._client) - - @cached_property - def with_raw_response(self) -> AsyncBGPsWithRawResponse: - return AsyncBGPsWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncBGPsWithStreamingResponse: - return AsyncBGPsWithStreamingResponse(self) - - -class BGPsWithRawResponse: - def __init__(self, bgps: BGPs) -> None: - self._bgps = bgps - - @cached_property - def statuses(self) -> StatusesWithRawResponse: - return StatusesWithRawResponse(self._bgps.statuses) - - -class AsyncBGPsWithRawResponse: - def __init__(self, bgps: AsyncBGPs) -> None: - self._bgps = bgps - - @cached_property - def statuses(self) -> AsyncStatusesWithRawResponse: - return AsyncStatusesWithRawResponse(self._bgps.statuses) - - -class BGPsWithStreamingResponse: - def __init__(self, bgps: BGPs) -> None: - self._bgps = bgps - - @cached_property - def statuses(self) -> StatusesWithStreamingResponse: - return StatusesWithStreamingResponse(self._bgps.statuses) - - -class AsyncBGPsWithStreamingResponse: - def __init__(self, bgps: AsyncBGPs) -> None: - self._bgps = bgps - - @cached_property - def statuses(self) -> AsyncStatusesWithStreamingResponse: - return AsyncStatusesWithStreamingResponse(self._bgps.statuses) diff --git a/src/cloudflare/resources/addresses/prefixes/bgps/statuses.py b/src/cloudflare/resources/addresses/prefixes/bgps/statuses.py deleted file mode 100644 index f23947eb838..00000000000 --- a/src/cloudflare/resources/addresses/prefixes/bgps/statuses.py +++ /dev/null @@ -1,311 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from __future__ import annotations - -from typing import Type, cast - -import httpx - -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ....._utils import maybe_transform -from ....._compat import cached_property -from ....._resource import SyncAPIResource, AsyncAPIResource -from ....._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ....._wrappers import ResultWrapper -from ....._base_client import ( - make_request_options, -) -from .....types.addresses.prefixes.bgps import ( - StatusIPAddressManagementDynamicAdvertisementGetAdvertisementStatusResponse, - StatusIPAddressManagementDynamicAdvertisementUpdatePrefixDynamicAdvertisementStatusResponse, - status_ip_address_management_dynamic_advertisement_update_prefix_dynamic_advertisement_status_params, -) - -__all__ = ["Statuses", "AsyncStatuses"] - - -class Statuses(SyncAPIResource): - @cached_property - def with_raw_response(self) -> StatusesWithRawResponse: - return StatusesWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> StatusesWithStreamingResponse: - return StatusesWithStreamingResponse(self) - - def ip_address_management_dynamic_advertisement_get_advertisement_status( - self, - prefix_identifier: str, - *, - account_identifier: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> StatusIPAddressManagementDynamicAdvertisementGetAdvertisementStatusResponse: - """ - List the current advertisement state for a prefix. - - Args: - account_identifier: Identifier - - prefix_identifier: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_identifier: - raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") - if not prefix_identifier: - raise ValueError(f"Expected a non-empty value for `prefix_identifier` but received {prefix_identifier!r}") - return self._get( - f"/accounts/{account_identifier}/addressing/prefixes/{prefix_identifier}/bgp/status", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast( - Type[StatusIPAddressManagementDynamicAdvertisementGetAdvertisementStatusResponse], - ResultWrapper[StatusIPAddressManagementDynamicAdvertisementGetAdvertisementStatusResponse], - ), - ) - - def ip_address_management_dynamic_advertisement_update_prefix_dynamic_advertisement_status( - self, - prefix_identifier: str, - *, - account_identifier: str, - advertised: bool, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> StatusIPAddressManagementDynamicAdvertisementUpdatePrefixDynamicAdvertisementStatusResponse: - """ - Advertise or withdraw BGP route for a prefix. - - Args: - account_identifier: Identifier - - prefix_identifier: Identifier - - advertised: Enablement of prefix advertisement to the Internet. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_identifier: - raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") - if not prefix_identifier: - raise ValueError(f"Expected a non-empty value for `prefix_identifier` but received {prefix_identifier!r}") - return self._patch( - f"/accounts/{account_identifier}/addressing/prefixes/{prefix_identifier}/bgp/status", - body=maybe_transform( - {"advertised": advertised}, - status_ip_address_management_dynamic_advertisement_update_prefix_dynamic_advertisement_status_params.StatusIPAddressManagementDynamicAdvertisementUpdatePrefixDynamicAdvertisementStatusParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast( - Type[StatusIPAddressManagementDynamicAdvertisementUpdatePrefixDynamicAdvertisementStatusResponse], - ResultWrapper[ - StatusIPAddressManagementDynamicAdvertisementUpdatePrefixDynamicAdvertisementStatusResponse - ], - ), - ) - - -class AsyncStatuses(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncStatusesWithRawResponse: - return AsyncStatusesWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncStatusesWithStreamingResponse: - return AsyncStatusesWithStreamingResponse(self) - - async def ip_address_management_dynamic_advertisement_get_advertisement_status( - self, - prefix_identifier: str, - *, - account_identifier: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> StatusIPAddressManagementDynamicAdvertisementGetAdvertisementStatusResponse: - """ - List the current advertisement state for a prefix. - - Args: - account_identifier: Identifier - - prefix_identifier: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_identifier: - raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") - if not prefix_identifier: - raise ValueError(f"Expected a non-empty value for `prefix_identifier` but received {prefix_identifier!r}") - return await self._get( - f"/accounts/{account_identifier}/addressing/prefixes/{prefix_identifier}/bgp/status", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast( - Type[StatusIPAddressManagementDynamicAdvertisementGetAdvertisementStatusResponse], - ResultWrapper[StatusIPAddressManagementDynamicAdvertisementGetAdvertisementStatusResponse], - ), - ) - - async def ip_address_management_dynamic_advertisement_update_prefix_dynamic_advertisement_status( - self, - prefix_identifier: str, - *, - account_identifier: str, - advertised: bool, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> StatusIPAddressManagementDynamicAdvertisementUpdatePrefixDynamicAdvertisementStatusResponse: - """ - Advertise or withdraw BGP route for a prefix. - - Args: - account_identifier: Identifier - - prefix_identifier: Identifier - - advertised: Enablement of prefix advertisement to the Internet. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_identifier: - raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") - if not prefix_identifier: - raise ValueError(f"Expected a non-empty value for `prefix_identifier` but received {prefix_identifier!r}") - return await self._patch( - f"/accounts/{account_identifier}/addressing/prefixes/{prefix_identifier}/bgp/status", - body=maybe_transform( - {"advertised": advertised}, - status_ip_address_management_dynamic_advertisement_update_prefix_dynamic_advertisement_status_params.StatusIPAddressManagementDynamicAdvertisementUpdatePrefixDynamicAdvertisementStatusParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast( - Type[StatusIPAddressManagementDynamicAdvertisementUpdatePrefixDynamicAdvertisementStatusResponse], - ResultWrapper[ - StatusIPAddressManagementDynamicAdvertisementUpdatePrefixDynamicAdvertisementStatusResponse - ], - ), - ) - - -class StatusesWithRawResponse: - def __init__(self, statuses: Statuses) -> None: - self._statuses = statuses - - self.ip_address_management_dynamic_advertisement_get_advertisement_status = to_raw_response_wrapper( - statuses.ip_address_management_dynamic_advertisement_get_advertisement_status, - ) - self.ip_address_management_dynamic_advertisement_update_prefix_dynamic_advertisement_status = ( - to_raw_response_wrapper( - statuses.ip_address_management_dynamic_advertisement_update_prefix_dynamic_advertisement_status, - ) - ) - - -class AsyncStatusesWithRawResponse: - def __init__(self, statuses: AsyncStatuses) -> None: - self._statuses = statuses - - self.ip_address_management_dynamic_advertisement_get_advertisement_status = async_to_raw_response_wrapper( - statuses.ip_address_management_dynamic_advertisement_get_advertisement_status, - ) - self.ip_address_management_dynamic_advertisement_update_prefix_dynamic_advertisement_status = ( - async_to_raw_response_wrapper( - statuses.ip_address_management_dynamic_advertisement_update_prefix_dynamic_advertisement_status, - ) - ) - - -class StatusesWithStreamingResponse: - def __init__(self, statuses: Statuses) -> None: - self._statuses = statuses - - self.ip_address_management_dynamic_advertisement_get_advertisement_status = to_streamed_response_wrapper( - statuses.ip_address_management_dynamic_advertisement_get_advertisement_status, - ) - self.ip_address_management_dynamic_advertisement_update_prefix_dynamic_advertisement_status = ( - to_streamed_response_wrapper( - statuses.ip_address_management_dynamic_advertisement_update_prefix_dynamic_advertisement_status, - ) - ) - - -class AsyncStatusesWithStreamingResponse: - def __init__(self, statuses: AsyncStatuses) -> None: - self._statuses = statuses - - self.ip_address_management_dynamic_advertisement_get_advertisement_status = async_to_streamed_response_wrapper( - statuses.ip_address_management_dynamic_advertisement_get_advertisement_status, - ) - self.ip_address_management_dynamic_advertisement_update_prefix_dynamic_advertisement_status = ( - async_to_streamed_response_wrapper( - statuses.ip_address_management_dynamic_advertisement_update_prefix_dynamic_advertisement_status, - ) - ) diff --git a/src/cloudflare/resources/addresses/prefixes/delegations.py b/src/cloudflare/resources/addresses/prefixes/delegations.py deleted file mode 100644 index 9644c92d664..00000000000 --- a/src/cloudflare/resources/addresses/prefixes/delegations.py +++ /dev/null @@ -1,426 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from __future__ import annotations - -from typing import Type, Optional, cast - -import httpx - -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ...._utils import maybe_transform -from ...._compat import cached_property -from ...._resource import SyncAPIResource, AsyncAPIResource -from ...._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ...._wrappers import ResultWrapper -from ...._base_client import ( - make_request_options, -) -from ....types.addresses.prefixes import ( - DelegationDeleteResponse, - DelegationIPAddressManagementPrefixDelegationListPrefixDelegationsResponse, - DelegationIPAddressManagementPrefixDelegationCreatePrefixDelegationResponse, - delegation_ip_address_management_prefix_delegation_create_prefix_delegation_params, -) - -__all__ = ["Delegations", "AsyncDelegations"] - - -class Delegations(SyncAPIResource): - @cached_property - def with_raw_response(self) -> DelegationsWithRawResponse: - return DelegationsWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> DelegationsWithStreamingResponse: - return DelegationsWithStreamingResponse(self) - - def delete( - self, - delegation_identifier: str, - *, - account_identifier: str, - prefix_identifier: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DelegationDeleteResponse: - """ - Delete an account delegation for a given IP prefix. - - Args: - account_identifier: Identifier - - prefix_identifier: Identifier - - delegation_identifier: Delegation identifier tag. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_identifier: - raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") - if not prefix_identifier: - raise ValueError(f"Expected a non-empty value for `prefix_identifier` but received {prefix_identifier!r}") - if not delegation_identifier: - raise ValueError( - f"Expected a non-empty value for `delegation_identifier` but received {delegation_identifier!r}" - ) - return self._delete( - f"/accounts/{account_identifier}/addressing/prefixes/{prefix_identifier}/delegations/{delegation_identifier}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast(Type[DelegationDeleteResponse], ResultWrapper[DelegationDeleteResponse]), - ) - - def ip_address_management_prefix_delegation_create_prefix_delegation( - self, - prefix_identifier: str, - *, - account_identifier: str, - cidr: str, - delegated_account_id: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DelegationIPAddressManagementPrefixDelegationCreatePrefixDelegationResponse: - """ - Create a new account delegation for a given IP prefix. - - Args: - account_identifier: Identifier - - prefix_identifier: Identifier - - cidr: IP Prefix in Classless Inter-Domain Routing format. - - delegated_account_id: Account identifier for the account to which prefix is being delegated. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_identifier: - raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") - if not prefix_identifier: - raise ValueError(f"Expected a non-empty value for `prefix_identifier` but received {prefix_identifier!r}") - return self._post( - f"/accounts/{account_identifier}/addressing/prefixes/{prefix_identifier}/delegations", - body=maybe_transform( - { - "cidr": cidr, - "delegated_account_id": delegated_account_id, - }, - delegation_ip_address_management_prefix_delegation_create_prefix_delegation_params.DelegationIPAddressManagementPrefixDelegationCreatePrefixDelegationParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast( - Type[DelegationIPAddressManagementPrefixDelegationCreatePrefixDelegationResponse], - ResultWrapper[DelegationIPAddressManagementPrefixDelegationCreatePrefixDelegationResponse], - ), - ) - - def ip_address_management_prefix_delegation_list_prefix_delegations( - self, - prefix_identifier: str, - *, - account_identifier: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[DelegationIPAddressManagementPrefixDelegationListPrefixDelegationsResponse]: - """ - List all delegations for a given account IP prefix. - - Args: - account_identifier: Identifier - - prefix_identifier: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_identifier: - raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") - if not prefix_identifier: - raise ValueError(f"Expected a non-empty value for `prefix_identifier` but received {prefix_identifier!r}") - return self._get( - f"/accounts/{account_identifier}/addressing/prefixes/{prefix_identifier}/delegations", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast( - Type[Optional[DelegationIPAddressManagementPrefixDelegationListPrefixDelegationsResponse]], - ResultWrapper[DelegationIPAddressManagementPrefixDelegationListPrefixDelegationsResponse], - ), - ) - - -class AsyncDelegations(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncDelegationsWithRawResponse: - return AsyncDelegationsWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncDelegationsWithStreamingResponse: - return AsyncDelegationsWithStreamingResponse(self) - - async def delete( - self, - delegation_identifier: str, - *, - account_identifier: str, - prefix_identifier: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DelegationDeleteResponse: - """ - Delete an account delegation for a given IP prefix. - - Args: - account_identifier: Identifier - - prefix_identifier: Identifier - - delegation_identifier: Delegation identifier tag. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_identifier: - raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") - if not prefix_identifier: - raise ValueError(f"Expected a non-empty value for `prefix_identifier` but received {prefix_identifier!r}") - if not delegation_identifier: - raise ValueError( - f"Expected a non-empty value for `delegation_identifier` but received {delegation_identifier!r}" - ) - return await self._delete( - f"/accounts/{account_identifier}/addressing/prefixes/{prefix_identifier}/delegations/{delegation_identifier}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast(Type[DelegationDeleteResponse], ResultWrapper[DelegationDeleteResponse]), - ) - - async def ip_address_management_prefix_delegation_create_prefix_delegation( - self, - prefix_identifier: str, - *, - account_identifier: str, - cidr: str, - delegated_account_id: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DelegationIPAddressManagementPrefixDelegationCreatePrefixDelegationResponse: - """ - Create a new account delegation for a given IP prefix. - - Args: - account_identifier: Identifier - - prefix_identifier: Identifier - - cidr: IP Prefix in Classless Inter-Domain Routing format. - - delegated_account_id: Account identifier for the account to which prefix is being delegated. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_identifier: - raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") - if not prefix_identifier: - raise ValueError(f"Expected a non-empty value for `prefix_identifier` but received {prefix_identifier!r}") - return await self._post( - f"/accounts/{account_identifier}/addressing/prefixes/{prefix_identifier}/delegations", - body=maybe_transform( - { - "cidr": cidr, - "delegated_account_id": delegated_account_id, - }, - delegation_ip_address_management_prefix_delegation_create_prefix_delegation_params.DelegationIPAddressManagementPrefixDelegationCreatePrefixDelegationParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast( - Type[DelegationIPAddressManagementPrefixDelegationCreatePrefixDelegationResponse], - ResultWrapper[DelegationIPAddressManagementPrefixDelegationCreatePrefixDelegationResponse], - ), - ) - - async def ip_address_management_prefix_delegation_list_prefix_delegations( - self, - prefix_identifier: str, - *, - account_identifier: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[DelegationIPAddressManagementPrefixDelegationListPrefixDelegationsResponse]: - """ - List all delegations for a given account IP prefix. - - Args: - account_identifier: Identifier - - prefix_identifier: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_identifier: - raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") - if not prefix_identifier: - raise ValueError(f"Expected a non-empty value for `prefix_identifier` but received {prefix_identifier!r}") - return await self._get( - f"/accounts/{account_identifier}/addressing/prefixes/{prefix_identifier}/delegations", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast( - Type[Optional[DelegationIPAddressManagementPrefixDelegationListPrefixDelegationsResponse]], - ResultWrapper[DelegationIPAddressManagementPrefixDelegationListPrefixDelegationsResponse], - ), - ) - - -class DelegationsWithRawResponse: - def __init__(self, delegations: Delegations) -> None: - self._delegations = delegations - - self.delete = to_raw_response_wrapper( - delegations.delete, - ) - self.ip_address_management_prefix_delegation_create_prefix_delegation = to_raw_response_wrapper( - delegations.ip_address_management_prefix_delegation_create_prefix_delegation, - ) - self.ip_address_management_prefix_delegation_list_prefix_delegations = to_raw_response_wrapper( - delegations.ip_address_management_prefix_delegation_list_prefix_delegations, - ) - - -class AsyncDelegationsWithRawResponse: - def __init__(self, delegations: AsyncDelegations) -> None: - self._delegations = delegations - - self.delete = async_to_raw_response_wrapper( - delegations.delete, - ) - self.ip_address_management_prefix_delegation_create_prefix_delegation = async_to_raw_response_wrapper( - delegations.ip_address_management_prefix_delegation_create_prefix_delegation, - ) - self.ip_address_management_prefix_delegation_list_prefix_delegations = async_to_raw_response_wrapper( - delegations.ip_address_management_prefix_delegation_list_prefix_delegations, - ) - - -class DelegationsWithStreamingResponse: - def __init__(self, delegations: Delegations) -> None: - self._delegations = delegations - - self.delete = to_streamed_response_wrapper( - delegations.delete, - ) - self.ip_address_management_prefix_delegation_create_prefix_delegation = to_streamed_response_wrapper( - delegations.ip_address_management_prefix_delegation_create_prefix_delegation, - ) - self.ip_address_management_prefix_delegation_list_prefix_delegations = to_streamed_response_wrapper( - delegations.ip_address_management_prefix_delegation_list_prefix_delegations, - ) - - -class AsyncDelegationsWithStreamingResponse: - def __init__(self, delegations: AsyncDelegations) -> None: - self._delegations = delegations - - self.delete = async_to_streamed_response_wrapper( - delegations.delete, - ) - self.ip_address_management_prefix_delegation_create_prefix_delegation = async_to_streamed_response_wrapper( - delegations.ip_address_management_prefix_delegation_create_prefix_delegation, - ) - self.ip_address_management_prefix_delegation_list_prefix_delegations = async_to_streamed_response_wrapper( - delegations.ip_address_management_prefix_delegation_list_prefix_delegations, - ) diff --git a/src/cloudflare/resources/addresses/prefixes/prefixes.py b/src/cloudflare/resources/addresses/prefixes/prefixes.py deleted file mode 100644 index cb8651bfd0b..00000000000 --- a/src/cloudflare/resources/addresses/prefixes/prefixes.py +++ /dev/null @@ -1,686 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from __future__ import annotations - -from typing import Any, Type, Optional, cast - -import httpx - -from .bgps import ( - BGPs, - AsyncBGPs, - BGPsWithRawResponse, - AsyncBGPsWithRawResponse, - BGPsWithStreamingResponse, - AsyncBGPsWithStreamingResponse, -) -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ...._utils import maybe_transform -from .bgps.bgps import BGPs, AsyncBGPs -from ...._compat import cached_property -from .delegations import ( - Delegations, - AsyncDelegations, - DelegationsWithRawResponse, - AsyncDelegationsWithRawResponse, - DelegationsWithStreamingResponse, - AsyncDelegationsWithStreamingResponse, -) -from ...._resource import SyncAPIResource, AsyncAPIResource -from ...._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ...._wrappers import ResultWrapper -from ...._base_client import ( - make_request_options, -) -from ....types.addresses import ( - PrefixGetResponse, - PrefixDeleteResponse, - PrefixUpdateResponse, - PrefixIPAddressManagementPrefixesAddPrefixResponse, - PrefixIPAddressManagementPrefixesListPrefixesResponse, - prefix_update_params, - prefix_ip_address_management_prefixes_add_prefix_params, -) - -__all__ = ["Prefixes", "AsyncPrefixes"] - - -class Prefixes(SyncAPIResource): - @cached_property - def bgps(self) -> BGPs: - return BGPs(self._client) - - @cached_property - def delegations(self) -> Delegations: - return Delegations(self._client) - - @cached_property - def with_raw_response(self) -> PrefixesWithRawResponse: - return PrefixesWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> PrefixesWithStreamingResponse: - return PrefixesWithStreamingResponse(self) - - def update( - self, - prefix_identifier: str, - *, - account_identifier: str, - description: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> PrefixUpdateResponse: - """ - Modify the description for a prefix owned by the account. - - Args: - account_identifier: Identifier - - prefix_identifier: Identifier - - description: Description of the prefix. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_identifier: - raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") - if not prefix_identifier: - raise ValueError(f"Expected a non-empty value for `prefix_identifier` but received {prefix_identifier!r}") - return self._patch( - f"/accounts/{account_identifier}/addressing/prefixes/{prefix_identifier}", - body=maybe_transform({"description": description}, prefix_update_params.PrefixUpdateParams), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast(Type[PrefixUpdateResponse], ResultWrapper[PrefixUpdateResponse]), - ) - - def delete( - self, - prefix_identifier: str, - *, - account_identifier: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[PrefixDeleteResponse]: - """ - Delete an unapproved prefix owned by the account. - - Args: - account_identifier: Identifier - - prefix_identifier: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_identifier: - raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") - if not prefix_identifier: - raise ValueError(f"Expected a non-empty value for `prefix_identifier` but received {prefix_identifier!r}") - return cast( - Optional[PrefixDeleteResponse], - self._delete( - f"/accounts/{account_identifier}/addressing/prefixes/{prefix_identifier}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[PrefixDeleteResponse] - ), # Union types cannot be passed in as arguments in the type system - ), - ) - - def get( - self, - prefix_identifier: str, - *, - account_identifier: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> PrefixGetResponse: - """ - List a particular prefix owned by the account. - - Args: - account_identifier: Identifier - - prefix_identifier: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_identifier: - raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") - if not prefix_identifier: - raise ValueError(f"Expected a non-empty value for `prefix_identifier` but received {prefix_identifier!r}") - return self._get( - f"/accounts/{account_identifier}/addressing/prefixes/{prefix_identifier}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast(Type[PrefixGetResponse], ResultWrapper[PrefixGetResponse]), - ) - - def ip_address_management_prefixes_add_prefix( - self, - account_identifier: str, - *, - asn: Optional[int], - cidr: str, - loa_document_id: Optional[str], - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> PrefixIPAddressManagementPrefixesAddPrefixResponse: - """ - Add a new prefix under the account. - - Args: - account_identifier: Identifier - - asn: Autonomous System Number (ASN) the prefix will be advertised under. - - cidr: IP Prefix in Classless Inter-Domain Routing format. - - loa_document_id: Identifier for the uploaded LOA document. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_identifier: - raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") - return self._post( - f"/accounts/{account_identifier}/addressing/prefixes", - body=maybe_transform( - { - "asn": asn, - "cidr": cidr, - "loa_document_id": loa_document_id, - }, - prefix_ip_address_management_prefixes_add_prefix_params.PrefixIPAddressManagementPrefixesAddPrefixParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast( - Type[PrefixIPAddressManagementPrefixesAddPrefixResponse], - ResultWrapper[PrefixIPAddressManagementPrefixesAddPrefixResponse], - ), - ) - - def ip_address_management_prefixes_list_prefixes( - self, - account_identifier: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[PrefixIPAddressManagementPrefixesListPrefixesResponse]: - """ - List all prefixes owned by the account. - - Args: - account_identifier: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_identifier: - raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") - return self._get( - f"/accounts/{account_identifier}/addressing/prefixes", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast( - Type[Optional[PrefixIPAddressManagementPrefixesListPrefixesResponse]], - ResultWrapper[PrefixIPAddressManagementPrefixesListPrefixesResponse], - ), - ) - - -class AsyncPrefixes(AsyncAPIResource): - @cached_property - def bgps(self) -> AsyncBGPs: - return AsyncBGPs(self._client) - - @cached_property - def delegations(self) -> AsyncDelegations: - return AsyncDelegations(self._client) - - @cached_property - def with_raw_response(self) -> AsyncPrefixesWithRawResponse: - return AsyncPrefixesWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncPrefixesWithStreamingResponse: - return AsyncPrefixesWithStreamingResponse(self) - - async def update( - self, - prefix_identifier: str, - *, - account_identifier: str, - description: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> PrefixUpdateResponse: - """ - Modify the description for a prefix owned by the account. - - Args: - account_identifier: Identifier - - prefix_identifier: Identifier - - description: Description of the prefix. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_identifier: - raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") - if not prefix_identifier: - raise ValueError(f"Expected a non-empty value for `prefix_identifier` but received {prefix_identifier!r}") - return await self._patch( - f"/accounts/{account_identifier}/addressing/prefixes/{prefix_identifier}", - body=maybe_transform({"description": description}, prefix_update_params.PrefixUpdateParams), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast(Type[PrefixUpdateResponse], ResultWrapper[PrefixUpdateResponse]), - ) - - async def delete( - self, - prefix_identifier: str, - *, - account_identifier: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[PrefixDeleteResponse]: - """ - Delete an unapproved prefix owned by the account. - - Args: - account_identifier: Identifier - - prefix_identifier: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_identifier: - raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") - if not prefix_identifier: - raise ValueError(f"Expected a non-empty value for `prefix_identifier` but received {prefix_identifier!r}") - return cast( - Optional[PrefixDeleteResponse], - await self._delete( - f"/accounts/{account_identifier}/addressing/prefixes/{prefix_identifier}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[PrefixDeleteResponse] - ), # Union types cannot be passed in as arguments in the type system - ), - ) - - async def get( - self, - prefix_identifier: str, - *, - account_identifier: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> PrefixGetResponse: - """ - List a particular prefix owned by the account. - - Args: - account_identifier: Identifier - - prefix_identifier: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_identifier: - raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") - if not prefix_identifier: - raise ValueError(f"Expected a non-empty value for `prefix_identifier` but received {prefix_identifier!r}") - return await self._get( - f"/accounts/{account_identifier}/addressing/prefixes/{prefix_identifier}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast(Type[PrefixGetResponse], ResultWrapper[PrefixGetResponse]), - ) - - async def ip_address_management_prefixes_add_prefix( - self, - account_identifier: str, - *, - asn: Optional[int], - cidr: str, - loa_document_id: Optional[str], - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> PrefixIPAddressManagementPrefixesAddPrefixResponse: - """ - Add a new prefix under the account. - - Args: - account_identifier: Identifier - - asn: Autonomous System Number (ASN) the prefix will be advertised under. - - cidr: IP Prefix in Classless Inter-Domain Routing format. - - loa_document_id: Identifier for the uploaded LOA document. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_identifier: - raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") - return await self._post( - f"/accounts/{account_identifier}/addressing/prefixes", - body=maybe_transform( - { - "asn": asn, - "cidr": cidr, - "loa_document_id": loa_document_id, - }, - prefix_ip_address_management_prefixes_add_prefix_params.PrefixIPAddressManagementPrefixesAddPrefixParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast( - Type[PrefixIPAddressManagementPrefixesAddPrefixResponse], - ResultWrapper[PrefixIPAddressManagementPrefixesAddPrefixResponse], - ), - ) - - async def ip_address_management_prefixes_list_prefixes( - self, - account_identifier: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[PrefixIPAddressManagementPrefixesListPrefixesResponse]: - """ - List all prefixes owned by the account. - - Args: - account_identifier: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_identifier: - raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") - return await self._get( - f"/accounts/{account_identifier}/addressing/prefixes", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast( - Type[Optional[PrefixIPAddressManagementPrefixesListPrefixesResponse]], - ResultWrapper[PrefixIPAddressManagementPrefixesListPrefixesResponse], - ), - ) - - -class PrefixesWithRawResponse: - def __init__(self, prefixes: Prefixes) -> None: - self._prefixes = prefixes - - self.update = to_raw_response_wrapper( - prefixes.update, - ) - self.delete = to_raw_response_wrapper( - prefixes.delete, - ) - self.get = to_raw_response_wrapper( - prefixes.get, - ) - self.ip_address_management_prefixes_add_prefix = to_raw_response_wrapper( - prefixes.ip_address_management_prefixes_add_prefix, - ) - self.ip_address_management_prefixes_list_prefixes = to_raw_response_wrapper( - prefixes.ip_address_management_prefixes_list_prefixes, - ) - - @cached_property - def bgps(self) -> BGPsWithRawResponse: - return BGPsWithRawResponse(self._prefixes.bgps) - - @cached_property - def delegations(self) -> DelegationsWithRawResponse: - return DelegationsWithRawResponse(self._prefixes.delegations) - - -class AsyncPrefixesWithRawResponse: - def __init__(self, prefixes: AsyncPrefixes) -> None: - self._prefixes = prefixes - - self.update = async_to_raw_response_wrapper( - prefixes.update, - ) - self.delete = async_to_raw_response_wrapper( - prefixes.delete, - ) - self.get = async_to_raw_response_wrapper( - prefixes.get, - ) - self.ip_address_management_prefixes_add_prefix = async_to_raw_response_wrapper( - prefixes.ip_address_management_prefixes_add_prefix, - ) - self.ip_address_management_prefixes_list_prefixes = async_to_raw_response_wrapper( - prefixes.ip_address_management_prefixes_list_prefixes, - ) - - @cached_property - def bgps(self) -> AsyncBGPsWithRawResponse: - return AsyncBGPsWithRawResponse(self._prefixes.bgps) - - @cached_property - def delegations(self) -> AsyncDelegationsWithRawResponse: - return AsyncDelegationsWithRawResponse(self._prefixes.delegations) - - -class PrefixesWithStreamingResponse: - def __init__(self, prefixes: Prefixes) -> None: - self._prefixes = prefixes - - self.update = to_streamed_response_wrapper( - prefixes.update, - ) - self.delete = to_streamed_response_wrapper( - prefixes.delete, - ) - self.get = to_streamed_response_wrapper( - prefixes.get, - ) - self.ip_address_management_prefixes_add_prefix = to_streamed_response_wrapper( - prefixes.ip_address_management_prefixes_add_prefix, - ) - self.ip_address_management_prefixes_list_prefixes = to_streamed_response_wrapper( - prefixes.ip_address_management_prefixes_list_prefixes, - ) - - @cached_property - def bgps(self) -> BGPsWithStreamingResponse: - return BGPsWithStreamingResponse(self._prefixes.bgps) - - @cached_property - def delegations(self) -> DelegationsWithStreamingResponse: - return DelegationsWithStreamingResponse(self._prefixes.delegations) - - -class AsyncPrefixesWithStreamingResponse: - def __init__(self, prefixes: AsyncPrefixes) -> None: - self._prefixes = prefixes - - self.update = async_to_streamed_response_wrapper( - prefixes.update, - ) - self.delete = async_to_streamed_response_wrapper( - prefixes.delete, - ) - self.get = async_to_streamed_response_wrapper( - prefixes.get, - ) - self.ip_address_management_prefixes_add_prefix = async_to_streamed_response_wrapper( - prefixes.ip_address_management_prefixes_add_prefix, - ) - self.ip_address_management_prefixes_list_prefixes = async_to_streamed_response_wrapper( - prefixes.ip_address_management_prefixes_list_prefixes, - ) - - @cached_property - def bgps(self) -> AsyncBGPsWithStreamingResponse: - return AsyncBGPsWithStreamingResponse(self._prefixes.bgps) - - @cached_property - def delegations(self) -> AsyncDelegationsWithStreamingResponse: - return AsyncDelegationsWithStreamingResponse(self._prefixes.delegations) diff --git a/src/cloudflare/resources/addressing/__init__.py b/src/cloudflare/resources/addressing/__init__.py deleted file mode 100644 index f76667fc6dc..00000000000 --- a/src/cloudflare/resources/addressing/__init__.py +++ /dev/null @@ -1,47 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from .prefixes import ( - Prefixes, - AsyncPrefixes, - PrefixesWithRawResponse, - AsyncPrefixesWithRawResponse, - PrefixesWithStreamingResponse, - AsyncPrefixesWithStreamingResponse, -) -from .services import ( - Services, - AsyncServices, - ServicesWithRawResponse, - AsyncServicesWithRawResponse, - ServicesWithStreamingResponse, - AsyncServicesWithStreamingResponse, -) -from .addressing import ( - Addressing, - AsyncAddressing, - AddressingWithRawResponse, - AsyncAddressingWithRawResponse, - AddressingWithStreamingResponse, - AsyncAddressingWithStreamingResponse, -) - -__all__ = [ - "Prefixes", - "AsyncPrefixes", - "PrefixesWithRawResponse", - "AsyncPrefixesWithRawResponse", - "PrefixesWithStreamingResponse", - "AsyncPrefixesWithStreamingResponse", - "Services", - "AsyncServices", - "ServicesWithRawResponse", - "AsyncServicesWithRawResponse", - "ServicesWithStreamingResponse", - "AsyncServicesWithStreamingResponse", - "Addressing", - "AsyncAddressing", - "AddressingWithRawResponse", - "AsyncAddressingWithRawResponse", - "AddressingWithStreamingResponse", - "AsyncAddressingWithStreamingResponse", -] diff --git a/src/cloudflare/resources/addressing/addressing.py b/src/cloudflare/resources/addressing/addressing.py deleted file mode 100644 index bcb5f5b8368..00000000000 --- a/src/cloudflare/resources/addressing/addressing.py +++ /dev/null @@ -1,113 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from __future__ import annotations - -from .prefixes import ( - Prefixes, - AsyncPrefixes, - PrefixesWithRawResponse, - AsyncPrefixesWithRawResponse, - PrefixesWithStreamingResponse, - AsyncPrefixesWithStreamingResponse, -) -from .services import ( - Services, - AsyncServices, - ServicesWithRawResponse, - AsyncServicesWithRawResponse, - ServicesWithStreamingResponse, - AsyncServicesWithStreamingResponse, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from .prefixes.prefixes import Prefixes, AsyncPrefixes - -__all__ = ["Addressing", "AsyncAddressing"] - - -class Addressing(SyncAPIResource): - @cached_property - def prefixes(self) -> Prefixes: - return Prefixes(self._client) - - @cached_property - def services(self) -> Services: - return Services(self._client) - - @cached_property - def with_raw_response(self) -> AddressingWithRawResponse: - return AddressingWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AddressingWithStreamingResponse: - return AddressingWithStreamingResponse(self) - - -class AsyncAddressing(AsyncAPIResource): - @cached_property - def prefixes(self) -> AsyncPrefixes: - return AsyncPrefixes(self._client) - - @cached_property - def services(self) -> AsyncServices: - return AsyncServices(self._client) - - @cached_property - def with_raw_response(self) -> AsyncAddressingWithRawResponse: - return AsyncAddressingWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncAddressingWithStreamingResponse: - return AsyncAddressingWithStreamingResponse(self) - - -class AddressingWithRawResponse: - def __init__(self, addressing: Addressing) -> None: - self._addressing = addressing - - @cached_property - def prefixes(self) -> PrefixesWithRawResponse: - return PrefixesWithRawResponse(self._addressing.prefixes) - - @cached_property - def services(self) -> ServicesWithRawResponse: - return ServicesWithRawResponse(self._addressing.services) - - -class AsyncAddressingWithRawResponse: - def __init__(self, addressing: AsyncAddressing) -> None: - self._addressing = addressing - - @cached_property - def prefixes(self) -> AsyncPrefixesWithRawResponse: - return AsyncPrefixesWithRawResponse(self._addressing.prefixes) - - @cached_property - def services(self) -> AsyncServicesWithRawResponse: - return AsyncServicesWithRawResponse(self._addressing.services) - - -class AddressingWithStreamingResponse: - def __init__(self, addressing: Addressing) -> None: - self._addressing = addressing - - @cached_property - def prefixes(self) -> PrefixesWithStreamingResponse: - return PrefixesWithStreamingResponse(self._addressing.prefixes) - - @cached_property - def services(self) -> ServicesWithStreamingResponse: - return ServicesWithStreamingResponse(self._addressing.services) - - -class AsyncAddressingWithStreamingResponse: - def __init__(self, addressing: AsyncAddressing) -> None: - self._addressing = addressing - - @cached_property - def prefixes(self) -> AsyncPrefixesWithStreamingResponse: - return AsyncPrefixesWithStreamingResponse(self._addressing.prefixes) - - @cached_property - def services(self) -> AsyncServicesWithStreamingResponse: - return AsyncServicesWithStreamingResponse(self._addressing.services) diff --git a/src/cloudflare/resources/addressing/prefixes/__init__.py b/src/cloudflare/resources/addressing/prefixes/__init__.py deleted file mode 100644 index ebfaa22bb3d..00000000000 --- a/src/cloudflare/resources/addressing/prefixes/__init__.py +++ /dev/null @@ -1,47 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from .bindings import ( - Bindings, - AsyncBindings, - BindingsWithRawResponse, - AsyncBindingsWithRawResponse, - BindingsWithStreamingResponse, - AsyncBindingsWithStreamingResponse, -) -from .prefixes import ( - Prefixes, - AsyncPrefixes, - PrefixesWithRawResponse, - AsyncPrefixesWithRawResponse, - PrefixesWithStreamingResponse, - AsyncPrefixesWithStreamingResponse, -) -from .bgp_prefixes import ( - BGPPrefixes, - AsyncBGPPrefixes, - BGPPrefixesWithRawResponse, - AsyncBGPPrefixesWithRawResponse, - BGPPrefixesWithStreamingResponse, - AsyncBGPPrefixesWithStreamingResponse, -) - -__all__ = [ - "BGPPrefixes", - "AsyncBGPPrefixes", - "BGPPrefixesWithRawResponse", - "AsyncBGPPrefixesWithRawResponse", - "BGPPrefixesWithStreamingResponse", - "AsyncBGPPrefixesWithStreamingResponse", - "Bindings", - "AsyncBindings", - "BindingsWithRawResponse", - "AsyncBindingsWithRawResponse", - "BindingsWithStreamingResponse", - "AsyncBindingsWithStreamingResponse", - "Prefixes", - "AsyncPrefixes", - "PrefixesWithRawResponse", - "AsyncPrefixesWithRawResponse", - "PrefixesWithStreamingResponse", - "AsyncPrefixesWithStreamingResponse", -] diff --git a/src/cloudflare/resources/addressing/prefixes/bgp_prefixes.py b/src/cloudflare/resources/addressing/prefixes/bgp_prefixes.py deleted file mode 100644 index d8fdace9b69..00000000000 --- a/src/cloudflare/resources/addressing/prefixes/bgp_prefixes.py +++ /dev/null @@ -1,416 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from __future__ import annotations - -from typing import Type, Optional, cast - -import httpx - -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ...._utils import maybe_transform -from ...._compat import cached_property -from ...._resource import SyncAPIResource, AsyncAPIResource -from ...._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ...._wrappers import ResultWrapper -from ...._base_client import ( - make_request_options, -) -from ....types.addressing.prefixes import ( - BGPPrefixGetResponse, - BGPPrefixListResponse, - BGPPrefixUpdateResponse, - bgp_prefix_update_params, -) - -__all__ = ["BGPPrefixes", "AsyncBGPPrefixes"] - - -class BGPPrefixes(SyncAPIResource): - @cached_property - def with_raw_response(self) -> BGPPrefixesWithRawResponse: - return BGPPrefixesWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> BGPPrefixesWithStreamingResponse: - return BGPPrefixesWithStreamingResponse(self) - - def update( - self, - bgp_prefix_identifier: str, - *, - account_identifier: str, - prefix_identifier: str, - on_demand: bgp_prefix_update_params.OnDemand | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> BGPPrefixUpdateResponse: - """ - Update the properties of a BGP Prefix, such as the on demand advertisement - status (advertised or withdrawn). - - Args: - account_identifier: Identifier - - prefix_identifier: Identifier - - bgp_prefix_identifier: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_identifier: - raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") - if not prefix_identifier: - raise ValueError(f"Expected a non-empty value for `prefix_identifier` but received {prefix_identifier!r}") - if not bgp_prefix_identifier: - raise ValueError( - f"Expected a non-empty value for `bgp_prefix_identifier` but received {bgp_prefix_identifier!r}" - ) - return self._patch( - f"/accounts/{account_identifier}/addressing/prefixes/{prefix_identifier}/bgp/prefixes/{bgp_prefix_identifier}", - body=maybe_transform({"on_demand": on_demand}, bgp_prefix_update_params.BGPPrefixUpdateParams), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast(Type[BGPPrefixUpdateResponse], ResultWrapper[BGPPrefixUpdateResponse]), - ) - - def list( - self, - prefix_identifier: str, - *, - account_identifier: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[BGPPrefixListResponse]: - """List all BGP Prefixes within the specified IP Prefix. - - BGP Prefixes are used to - control which specific subnets are advertised to the Internet. It is possible to - advertise subnets more specific than an IP Prefix by creating more specific BGP - Prefixes. - - Args: - account_identifier: Identifier - - prefix_identifier: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_identifier: - raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") - if not prefix_identifier: - raise ValueError(f"Expected a non-empty value for `prefix_identifier` but received {prefix_identifier!r}") - return self._get( - f"/accounts/{account_identifier}/addressing/prefixes/{prefix_identifier}/bgp/prefixes", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast(Type[Optional[BGPPrefixListResponse]], ResultWrapper[BGPPrefixListResponse]), - ) - - def get( - self, - bgp_prefix_identifier: str, - *, - account_identifier: str, - prefix_identifier: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> BGPPrefixGetResponse: - """ - Retrieve a single BGP Prefix according to its identifier - - Args: - account_identifier: Identifier - - prefix_identifier: Identifier - - bgp_prefix_identifier: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_identifier: - raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") - if not prefix_identifier: - raise ValueError(f"Expected a non-empty value for `prefix_identifier` but received {prefix_identifier!r}") - if not bgp_prefix_identifier: - raise ValueError( - f"Expected a non-empty value for `bgp_prefix_identifier` but received {bgp_prefix_identifier!r}" - ) - return self._get( - f"/accounts/{account_identifier}/addressing/prefixes/{prefix_identifier}/bgp/prefixes/{bgp_prefix_identifier}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast(Type[BGPPrefixGetResponse], ResultWrapper[BGPPrefixGetResponse]), - ) - - -class AsyncBGPPrefixes(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncBGPPrefixesWithRawResponse: - return AsyncBGPPrefixesWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncBGPPrefixesWithStreamingResponse: - return AsyncBGPPrefixesWithStreamingResponse(self) - - async def update( - self, - bgp_prefix_identifier: str, - *, - account_identifier: str, - prefix_identifier: str, - on_demand: bgp_prefix_update_params.OnDemand | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> BGPPrefixUpdateResponse: - """ - Update the properties of a BGP Prefix, such as the on demand advertisement - status (advertised or withdrawn). - - Args: - account_identifier: Identifier - - prefix_identifier: Identifier - - bgp_prefix_identifier: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_identifier: - raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") - if not prefix_identifier: - raise ValueError(f"Expected a non-empty value for `prefix_identifier` but received {prefix_identifier!r}") - if not bgp_prefix_identifier: - raise ValueError( - f"Expected a non-empty value for `bgp_prefix_identifier` but received {bgp_prefix_identifier!r}" - ) - return await self._patch( - f"/accounts/{account_identifier}/addressing/prefixes/{prefix_identifier}/bgp/prefixes/{bgp_prefix_identifier}", - body=maybe_transform({"on_demand": on_demand}, bgp_prefix_update_params.BGPPrefixUpdateParams), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast(Type[BGPPrefixUpdateResponse], ResultWrapper[BGPPrefixUpdateResponse]), - ) - - async def list( - self, - prefix_identifier: str, - *, - account_identifier: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[BGPPrefixListResponse]: - """List all BGP Prefixes within the specified IP Prefix. - - BGP Prefixes are used to - control which specific subnets are advertised to the Internet. It is possible to - advertise subnets more specific than an IP Prefix by creating more specific BGP - Prefixes. - - Args: - account_identifier: Identifier - - prefix_identifier: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_identifier: - raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") - if not prefix_identifier: - raise ValueError(f"Expected a non-empty value for `prefix_identifier` but received {prefix_identifier!r}") - return await self._get( - f"/accounts/{account_identifier}/addressing/prefixes/{prefix_identifier}/bgp/prefixes", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast(Type[Optional[BGPPrefixListResponse]], ResultWrapper[BGPPrefixListResponse]), - ) - - async def get( - self, - bgp_prefix_identifier: str, - *, - account_identifier: str, - prefix_identifier: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> BGPPrefixGetResponse: - """ - Retrieve a single BGP Prefix according to its identifier - - Args: - account_identifier: Identifier - - prefix_identifier: Identifier - - bgp_prefix_identifier: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_identifier: - raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") - if not prefix_identifier: - raise ValueError(f"Expected a non-empty value for `prefix_identifier` but received {prefix_identifier!r}") - if not bgp_prefix_identifier: - raise ValueError( - f"Expected a non-empty value for `bgp_prefix_identifier` but received {bgp_prefix_identifier!r}" - ) - return await self._get( - f"/accounts/{account_identifier}/addressing/prefixes/{prefix_identifier}/bgp/prefixes/{bgp_prefix_identifier}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast(Type[BGPPrefixGetResponse], ResultWrapper[BGPPrefixGetResponse]), - ) - - -class BGPPrefixesWithRawResponse: - def __init__(self, bgp_prefixes: BGPPrefixes) -> None: - self._bgp_prefixes = bgp_prefixes - - self.update = to_raw_response_wrapper( - bgp_prefixes.update, - ) - self.list = to_raw_response_wrapper( - bgp_prefixes.list, - ) - self.get = to_raw_response_wrapper( - bgp_prefixes.get, - ) - - -class AsyncBGPPrefixesWithRawResponse: - def __init__(self, bgp_prefixes: AsyncBGPPrefixes) -> None: - self._bgp_prefixes = bgp_prefixes - - self.update = async_to_raw_response_wrapper( - bgp_prefixes.update, - ) - self.list = async_to_raw_response_wrapper( - bgp_prefixes.list, - ) - self.get = async_to_raw_response_wrapper( - bgp_prefixes.get, - ) - - -class BGPPrefixesWithStreamingResponse: - def __init__(self, bgp_prefixes: BGPPrefixes) -> None: - self._bgp_prefixes = bgp_prefixes - - self.update = to_streamed_response_wrapper( - bgp_prefixes.update, - ) - self.list = to_streamed_response_wrapper( - bgp_prefixes.list, - ) - self.get = to_streamed_response_wrapper( - bgp_prefixes.get, - ) - - -class AsyncBGPPrefixesWithStreamingResponse: - def __init__(self, bgp_prefixes: AsyncBGPPrefixes) -> None: - self._bgp_prefixes = bgp_prefixes - - self.update = async_to_streamed_response_wrapper( - bgp_prefixes.update, - ) - self.list = async_to_streamed_response_wrapper( - bgp_prefixes.list, - ) - self.get = async_to_streamed_response_wrapper( - bgp_prefixes.get, - ) diff --git a/src/cloudflare/resources/addressing/prefixes/bindings.py b/src/cloudflare/resources/addressing/prefixes/bindings.py deleted file mode 100644 index 64ebe9aba84..00000000000 --- a/src/cloudflare/resources/addressing/prefixes/bindings.py +++ /dev/null @@ -1,549 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from __future__ import annotations - -from typing import Any, Type, cast - -import httpx - -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ...._utils import maybe_transform -from ...._compat import cached_property -from ...._resource import SyncAPIResource, AsyncAPIResource -from ...._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ...._wrappers import ResultWrapper -from ...._base_client import ( - make_request_options, -) -from ....types.addressing.prefixes import ( - BindingGetResponse, - BindingListResponse, - BindingCreateResponse, - BindingDeleteResponse, - binding_create_params, -) - -__all__ = ["Bindings", "AsyncBindings"] - - -class Bindings(SyncAPIResource): - @cached_property - def with_raw_response(self) -> BindingsWithRawResponse: - return BindingsWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> BindingsWithStreamingResponse: - return BindingsWithStreamingResponse(self) - - def create( - self, - prefix_identifier: str, - *, - account_identifier: str, - cidr: str | NotGiven = NOT_GIVEN, - service_id: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> BindingCreateResponse: - """ - Creates a new Service Binding, routing traffic to IPs within the given CIDR to a - service running on Cloudflare's network. **Note:** This API may only be used on - prefixes currently configured with a Magic Transit service binding, and only - allows creating service bindings for the Cloudflare CDN or Cloudflare Spectrum. - - Args: - account_identifier: Identifier - - prefix_identifier: Identifier - - cidr: IP Prefix in Classless Inter-Domain Routing format. - - service_id: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_identifier: - raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") - if not prefix_identifier: - raise ValueError(f"Expected a non-empty value for `prefix_identifier` but received {prefix_identifier!r}") - return self._post( - f"/accounts/{account_identifier}/addressing/prefixes/{prefix_identifier}/bindings", - body=maybe_transform( - { - "cidr": cidr, - "service_id": service_id, - }, - binding_create_params.BindingCreateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast(Type[BindingCreateResponse], ResultWrapper[BindingCreateResponse]), - ) - - def list( - self, - prefix_identifier: str, - *, - account_identifier: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> BindingListResponse: - """List the Cloudflare services this prefix is currently bound to. - - Traffic sent to - an address within an IP prefix will be routed to the Cloudflare service of the - most-specific Service Binding matching the address. **Example:** binding - `192.0.2.0/24` to Cloudflare Magic Transit and `192.0.2.1/32` to the Cloudflare - CDN would route traffic for `192.0.2.1` to the CDN, and traffic for all other - IPs in the prefix to Cloudflare Magic Transit. - - Args: - account_identifier: Identifier - - prefix_identifier: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_identifier: - raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") - if not prefix_identifier: - raise ValueError(f"Expected a non-empty value for `prefix_identifier` but received {prefix_identifier!r}") - return self._get( - f"/accounts/{account_identifier}/addressing/prefixes/{prefix_identifier}/bindings", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast(Type[BindingListResponse], ResultWrapper[BindingListResponse]), - ) - - def delete( - self, - binding_identifier: str, - *, - account_identifier: str, - prefix_identifier: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> BindingDeleteResponse: - """ - Delete a Service Binding - - Args: - account_identifier: Identifier - - prefix_identifier: Identifier - - binding_identifier: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_identifier: - raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") - if not prefix_identifier: - raise ValueError(f"Expected a non-empty value for `prefix_identifier` but received {prefix_identifier!r}") - if not binding_identifier: - raise ValueError(f"Expected a non-empty value for `binding_identifier` but received {binding_identifier!r}") - return cast( - BindingDeleteResponse, - self._delete( - f"/accounts/{account_identifier}/addressing/prefixes/{prefix_identifier}/bindings/{binding_identifier}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[BindingDeleteResponse] - ), # Union types cannot be passed in as arguments in the type system - ), - ) - - def get( - self, - binding_identifier: str, - *, - account_identifier: str, - prefix_identifier: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> BindingGetResponse: - """ - Fetch a single Service Binding - - Args: - account_identifier: Identifier - - prefix_identifier: Identifier - - binding_identifier: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_identifier: - raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") - if not prefix_identifier: - raise ValueError(f"Expected a non-empty value for `prefix_identifier` but received {prefix_identifier!r}") - if not binding_identifier: - raise ValueError(f"Expected a non-empty value for `binding_identifier` but received {binding_identifier!r}") - return self._get( - f"/accounts/{account_identifier}/addressing/prefixes/{prefix_identifier}/bindings/{binding_identifier}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast(Type[BindingGetResponse], ResultWrapper[BindingGetResponse]), - ) - - -class AsyncBindings(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncBindingsWithRawResponse: - return AsyncBindingsWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncBindingsWithStreamingResponse: - return AsyncBindingsWithStreamingResponse(self) - - async def create( - self, - prefix_identifier: str, - *, - account_identifier: str, - cidr: str | NotGiven = NOT_GIVEN, - service_id: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> BindingCreateResponse: - """ - Creates a new Service Binding, routing traffic to IPs within the given CIDR to a - service running on Cloudflare's network. **Note:** This API may only be used on - prefixes currently configured with a Magic Transit service binding, and only - allows creating service bindings for the Cloudflare CDN or Cloudflare Spectrum. - - Args: - account_identifier: Identifier - - prefix_identifier: Identifier - - cidr: IP Prefix in Classless Inter-Domain Routing format. - - service_id: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_identifier: - raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") - if not prefix_identifier: - raise ValueError(f"Expected a non-empty value for `prefix_identifier` but received {prefix_identifier!r}") - return await self._post( - f"/accounts/{account_identifier}/addressing/prefixes/{prefix_identifier}/bindings", - body=maybe_transform( - { - "cidr": cidr, - "service_id": service_id, - }, - binding_create_params.BindingCreateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast(Type[BindingCreateResponse], ResultWrapper[BindingCreateResponse]), - ) - - async def list( - self, - prefix_identifier: str, - *, - account_identifier: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> BindingListResponse: - """List the Cloudflare services this prefix is currently bound to. - - Traffic sent to - an address within an IP prefix will be routed to the Cloudflare service of the - most-specific Service Binding matching the address. **Example:** binding - `192.0.2.0/24` to Cloudflare Magic Transit and `192.0.2.1/32` to the Cloudflare - CDN would route traffic for `192.0.2.1` to the CDN, and traffic for all other - IPs in the prefix to Cloudflare Magic Transit. - - Args: - account_identifier: Identifier - - prefix_identifier: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_identifier: - raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") - if not prefix_identifier: - raise ValueError(f"Expected a non-empty value for `prefix_identifier` but received {prefix_identifier!r}") - return await self._get( - f"/accounts/{account_identifier}/addressing/prefixes/{prefix_identifier}/bindings", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast(Type[BindingListResponse], ResultWrapper[BindingListResponse]), - ) - - async def delete( - self, - binding_identifier: str, - *, - account_identifier: str, - prefix_identifier: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> BindingDeleteResponse: - """ - Delete a Service Binding - - Args: - account_identifier: Identifier - - prefix_identifier: Identifier - - binding_identifier: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_identifier: - raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") - if not prefix_identifier: - raise ValueError(f"Expected a non-empty value for `prefix_identifier` but received {prefix_identifier!r}") - if not binding_identifier: - raise ValueError(f"Expected a non-empty value for `binding_identifier` but received {binding_identifier!r}") - return cast( - BindingDeleteResponse, - await self._delete( - f"/accounts/{account_identifier}/addressing/prefixes/{prefix_identifier}/bindings/{binding_identifier}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[BindingDeleteResponse] - ), # Union types cannot be passed in as arguments in the type system - ), - ) - - async def get( - self, - binding_identifier: str, - *, - account_identifier: str, - prefix_identifier: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> BindingGetResponse: - """ - Fetch a single Service Binding - - Args: - account_identifier: Identifier - - prefix_identifier: Identifier - - binding_identifier: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_identifier: - raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") - if not prefix_identifier: - raise ValueError(f"Expected a non-empty value for `prefix_identifier` but received {prefix_identifier!r}") - if not binding_identifier: - raise ValueError(f"Expected a non-empty value for `binding_identifier` but received {binding_identifier!r}") - return await self._get( - f"/accounts/{account_identifier}/addressing/prefixes/{prefix_identifier}/bindings/{binding_identifier}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast(Type[BindingGetResponse], ResultWrapper[BindingGetResponse]), - ) - - -class BindingsWithRawResponse: - def __init__(self, bindings: Bindings) -> None: - self._bindings = bindings - - self.create = to_raw_response_wrapper( - bindings.create, - ) - self.list = to_raw_response_wrapper( - bindings.list, - ) - self.delete = to_raw_response_wrapper( - bindings.delete, - ) - self.get = to_raw_response_wrapper( - bindings.get, - ) - - -class AsyncBindingsWithRawResponse: - def __init__(self, bindings: AsyncBindings) -> None: - self._bindings = bindings - - self.create = async_to_raw_response_wrapper( - bindings.create, - ) - self.list = async_to_raw_response_wrapper( - bindings.list, - ) - self.delete = async_to_raw_response_wrapper( - bindings.delete, - ) - self.get = async_to_raw_response_wrapper( - bindings.get, - ) - - -class BindingsWithStreamingResponse: - def __init__(self, bindings: Bindings) -> None: - self._bindings = bindings - - self.create = to_streamed_response_wrapper( - bindings.create, - ) - self.list = to_streamed_response_wrapper( - bindings.list, - ) - self.delete = to_streamed_response_wrapper( - bindings.delete, - ) - self.get = to_streamed_response_wrapper( - bindings.get, - ) - - -class AsyncBindingsWithStreamingResponse: - def __init__(self, bindings: AsyncBindings) -> None: - self._bindings = bindings - - self.create = async_to_streamed_response_wrapper( - bindings.create, - ) - self.list = async_to_streamed_response_wrapper( - bindings.list, - ) - self.delete = async_to_streamed_response_wrapper( - bindings.delete, - ) - self.get = async_to_streamed_response_wrapper( - bindings.get, - ) diff --git a/src/cloudflare/resources/addressing/prefixes/prefixes.py b/src/cloudflare/resources/addressing/prefixes/prefixes.py deleted file mode 100644 index 80ed05fad5f..00000000000 --- a/src/cloudflare/resources/addressing/prefixes/prefixes.py +++ /dev/null @@ -1,112 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from __future__ import annotations - -from .bindings import ( - Bindings, - AsyncBindings, - BindingsWithRawResponse, - AsyncBindingsWithRawResponse, - BindingsWithStreamingResponse, - AsyncBindingsWithStreamingResponse, -) -from ...._compat import cached_property -from ...._resource import SyncAPIResource, AsyncAPIResource -from .bgp_prefixes import ( - BGPPrefixes, - AsyncBGPPrefixes, - BGPPrefixesWithRawResponse, - AsyncBGPPrefixesWithRawResponse, - BGPPrefixesWithStreamingResponse, - AsyncBGPPrefixesWithStreamingResponse, -) - -__all__ = ["Prefixes", "AsyncPrefixes"] - - -class Prefixes(SyncAPIResource): - @cached_property - def bgp_prefixes(self) -> BGPPrefixes: - return BGPPrefixes(self._client) - - @cached_property - def bindings(self) -> Bindings: - return Bindings(self._client) - - @cached_property - def with_raw_response(self) -> PrefixesWithRawResponse: - return PrefixesWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> PrefixesWithStreamingResponse: - return PrefixesWithStreamingResponse(self) - - -class AsyncPrefixes(AsyncAPIResource): - @cached_property - def bgp_prefixes(self) -> AsyncBGPPrefixes: - return AsyncBGPPrefixes(self._client) - - @cached_property - def bindings(self) -> AsyncBindings: - return AsyncBindings(self._client) - - @cached_property - def with_raw_response(self) -> AsyncPrefixesWithRawResponse: - return AsyncPrefixesWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncPrefixesWithStreamingResponse: - return AsyncPrefixesWithStreamingResponse(self) - - -class PrefixesWithRawResponse: - def __init__(self, prefixes: Prefixes) -> None: - self._prefixes = prefixes - - @cached_property - def bgp_prefixes(self) -> BGPPrefixesWithRawResponse: - return BGPPrefixesWithRawResponse(self._prefixes.bgp_prefixes) - - @cached_property - def bindings(self) -> BindingsWithRawResponse: - return BindingsWithRawResponse(self._prefixes.bindings) - - -class AsyncPrefixesWithRawResponse: - def __init__(self, prefixes: AsyncPrefixes) -> None: - self._prefixes = prefixes - - @cached_property - def bgp_prefixes(self) -> AsyncBGPPrefixesWithRawResponse: - return AsyncBGPPrefixesWithRawResponse(self._prefixes.bgp_prefixes) - - @cached_property - def bindings(self) -> AsyncBindingsWithRawResponse: - return AsyncBindingsWithRawResponse(self._prefixes.bindings) - - -class PrefixesWithStreamingResponse: - def __init__(self, prefixes: Prefixes) -> None: - self._prefixes = prefixes - - @cached_property - def bgp_prefixes(self) -> BGPPrefixesWithStreamingResponse: - return BGPPrefixesWithStreamingResponse(self._prefixes.bgp_prefixes) - - @cached_property - def bindings(self) -> BindingsWithStreamingResponse: - return BindingsWithStreamingResponse(self._prefixes.bindings) - - -class AsyncPrefixesWithStreamingResponse: - def __init__(self, prefixes: AsyncPrefixes) -> None: - self._prefixes = prefixes - - @cached_property - def bgp_prefixes(self) -> AsyncBGPPrefixesWithStreamingResponse: - return AsyncBGPPrefixesWithStreamingResponse(self._prefixes.bgp_prefixes) - - @cached_property - def bindings(self) -> AsyncBindingsWithStreamingResponse: - return AsyncBindingsWithStreamingResponse(self._prefixes.bindings) diff --git a/src/cloudflare/resources/addressing/services.py b/src/cloudflare/resources/addressing/services.py deleted file mode 100644 index 8f57d1b48c9..00000000000 --- a/src/cloudflare/resources/addressing/services.py +++ /dev/null @@ -1,164 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from __future__ import annotations - -from typing import Type, cast - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._wrappers import ResultWrapper -from ..._base_client import ( - make_request_options, -) -from ...types.addressing import ServiceListResponse - -__all__ = ["Services", "AsyncServices"] - - -class Services(SyncAPIResource): - @cached_property - def with_raw_response(self) -> ServicesWithRawResponse: - return ServicesWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> ServicesWithStreamingResponse: - return ServicesWithStreamingResponse(self) - - def list( - self, - account_identifier: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ServiceListResponse: - """ - Bring-Your-Own IP (BYOIP) prefixes onboarded to Cloudflare must be bound to a - service running on the Cloudflare network to enable a Cloudflare product on the - IP addresses. This endpoint can be used as a reference of available services on - the Cloudflare network, and their service IDs. - - Args: - account_identifier: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_identifier: - raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") - return self._get( - f"/accounts/{account_identifier}/addressing/services", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast(Type[ServiceListResponse], ResultWrapper[ServiceListResponse]), - ) - - -class AsyncServices(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncServicesWithRawResponse: - return AsyncServicesWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncServicesWithStreamingResponse: - return AsyncServicesWithStreamingResponse(self) - - async def list( - self, - account_identifier: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ServiceListResponse: - """ - Bring-Your-Own IP (BYOIP) prefixes onboarded to Cloudflare must be bound to a - service running on the Cloudflare network to enable a Cloudflare product on the - IP addresses. This endpoint can be used as a reference of available services on - the Cloudflare network, and their service IDs. - - Args: - account_identifier: Identifier - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_identifier: - raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") - return await self._get( - f"/accounts/{account_identifier}/addressing/services", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast(Type[ServiceListResponse], ResultWrapper[ServiceListResponse]), - ) - - -class ServicesWithRawResponse: - def __init__(self, services: Services) -> None: - self._services = services - - self.list = to_raw_response_wrapper( - services.list, - ) - - -class AsyncServicesWithRawResponse: - def __init__(self, services: AsyncServices) -> None: - self._services = services - - self.list = async_to_raw_response_wrapper( - services.list, - ) - - -class ServicesWithStreamingResponse: - def __init__(self, services: Services) -> None: - self._services = services - - self.list = to_streamed_response_wrapper( - services.list, - ) - - -class AsyncServicesWithStreamingResponse: - def __init__(self, services: AsyncServices) -> None: - self._services = services - - self.list = async_to_streamed_response_wrapper( - services.list, - ) diff --git a/src/cloudflare/resources/pcaps/pcaps.py b/src/cloudflare/resources/pcaps/pcaps.py index cd71d5bbd83..9d1ffc6bb43 100644 --- a/src/cloudflare/resources/pcaps/pcaps.py +++ b/src/cloudflare/resources/pcaps/pcaps.py @@ -123,7 +123,7 @@ def magic_pcap_collection_create_pcap_request( system: Literal["magic-transit"], time_limit: float, type: Literal["simple", "full"], - filter_v1: pcap_magic_pcap_collection_create_pcap_request_params.O1v8KFfTPcapsRequestSimpleFilterV1 + filter_v1: pcap_magic_pcap_collection_create_pcap_request_params.OUcEeQdhPcapsRequestSimpleFilterV1 | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -170,7 +170,7 @@ def magic_pcap_collection_create_pcap_request( time_limit: float, type: Literal["simple", "full"], byte_limit: float | NotGiven = NOT_GIVEN, - filter_v1: pcap_magic_pcap_collection_create_pcap_request_params.O1v8KFfTPcapsRequestFullFilterV1 + filter_v1: pcap_magic_pcap_collection_create_pcap_request_params.OUcEeQdhPcapsRequestFullFilterV1 | NotGiven = NOT_GIVEN, packet_limit: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -228,7 +228,7 @@ def magic_pcap_collection_create_pcap_request( system: Literal["magic-transit"], time_limit: float, type: Literal["simple", "full"], - filter_v1: pcap_magic_pcap_collection_create_pcap_request_params.O1v8KFfTPcapsRequestSimpleFilterV1 + filter_v1: pcap_magic_pcap_collection_create_pcap_request_params.OUcEeQdhPcapsRequestSimpleFilterV1 | NotGiven = NOT_GIVEN, colo_name: str | NotGiven = NOT_GIVEN, destination_conf: str | NotGiven = NOT_GIVEN, @@ -390,7 +390,7 @@ async def magic_pcap_collection_create_pcap_request( system: Literal["magic-transit"], time_limit: float, type: Literal["simple", "full"], - filter_v1: pcap_magic_pcap_collection_create_pcap_request_params.O1v8KFfTPcapsRequestSimpleFilterV1 + filter_v1: pcap_magic_pcap_collection_create_pcap_request_params.OUcEeQdhPcapsRequestSimpleFilterV1 | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -437,7 +437,7 @@ async def magic_pcap_collection_create_pcap_request( time_limit: float, type: Literal["simple", "full"], byte_limit: float | NotGiven = NOT_GIVEN, - filter_v1: pcap_magic_pcap_collection_create_pcap_request_params.O1v8KFfTPcapsRequestFullFilterV1 + filter_v1: pcap_magic_pcap_collection_create_pcap_request_params.OUcEeQdhPcapsRequestFullFilterV1 | NotGiven = NOT_GIVEN, packet_limit: float | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -495,7 +495,7 @@ async def magic_pcap_collection_create_pcap_request( system: Literal["magic-transit"], time_limit: float, type: Literal["simple", "full"], - filter_v1: pcap_magic_pcap_collection_create_pcap_request_params.O1v8KFfTPcapsRequestSimpleFilterV1 + filter_v1: pcap_magic_pcap_collection_create_pcap_request_params.OUcEeQdhPcapsRequestSimpleFilterV1 | NotGiven = NOT_GIVEN, colo_name: str | NotGiven = NOT_GIVEN, destination_conf: str | NotGiven = NOT_GIVEN, diff --git a/src/cloudflare/resources/purge_caches.py b/src/cloudflare/resources/purge_caches.py index 73a6881edd1..dae0c52a37b 100644 --- a/src/cloudflare/resources/purge_caches.py +++ b/src/cloudflare/resources/purge_caches.py @@ -151,7 +151,7 @@ def zone_purge( self, identifier: str, *, - files: List[purge_cach_zone_purge_params.AQxFrdVfFilesFile] | NotGiven = NOT_GIVEN, + files: List[purge_cach_zone_purge_params.N2QfWbz7FilesFile] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -209,7 +209,7 @@ def zone_purge( prefixes: List[str] | NotGiven = NOT_GIVEN, tags: List[str] | NotGiven = NOT_GIVEN, purge_everything: bool | NotGiven = NOT_GIVEN, - files: List[purge_cach_zone_purge_params.AQxFrdVfFilesFile] | NotGiven = NOT_GIVEN, + files: List[purge_cach_zone_purge_params.N2QfWbz7FilesFile] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -368,7 +368,7 @@ async def zone_purge( self, identifier: str, *, - files: List[purge_cach_zone_purge_params.AQxFrdVfFilesFile] | NotGiven = NOT_GIVEN, + files: List[purge_cach_zone_purge_params.N2QfWbz7FilesFile] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -426,7 +426,7 @@ async def zone_purge( prefixes: List[str] | NotGiven = NOT_GIVEN, tags: List[str] | NotGiven = NOT_GIVEN, purge_everything: bool | NotGiven = NOT_GIVEN, - files: List[purge_cach_zone_purge_params.AQxFrdVfFilesFile] | NotGiven = NOT_GIVEN, + files: List[purge_cach_zone_purge_params.N2QfWbz7FilesFile] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, diff --git a/src/cloudflare/types/addresses/__init__.py b/src/cloudflare/types/addresses/__init__.py index 961cc75c29c..b2f53e35258 100644 --- a/src/cloudflare/types/addresses/__init__.py +++ b/src/cloudflare/types/addresses/__init__.py @@ -1,30 +1,3 @@ # File generated from our OpenAPI spec by Stainless. from __future__ import annotations - -from .prefix_get_response import PrefixGetResponse as PrefixGetResponse -from .prefix_update_params import PrefixUpdateParams as PrefixUpdateParams -from .prefix_delete_response import PrefixDeleteResponse as PrefixDeleteResponse -from .prefix_update_response import PrefixUpdateResponse as PrefixUpdateResponse -from .address_map_get_response import AddressMapGetResponse as AddressMapGetResponse -from .address_map_create_params import AddressMapCreateParams as AddressMapCreateParams -from .address_map_list_response import AddressMapListResponse as AddressMapListResponse -from .address_map_update_params import AddressMapUpdateParams as AddressMapUpdateParams -from .address_map_create_response import AddressMapCreateResponse as AddressMapCreateResponse -from .address_map_delete_response import AddressMapDeleteResponse as AddressMapDeleteResponse -from .address_map_update_response import AddressMapUpdateResponse as AddressMapUpdateResponse -from .prefix_ip_address_management_prefixes_add_prefix_params import ( - PrefixIPAddressManagementPrefixesAddPrefixParams as PrefixIPAddressManagementPrefixesAddPrefixParams, -) -from .prefix_ip_address_management_prefixes_add_prefix_response import ( - PrefixIPAddressManagementPrefixesAddPrefixResponse as PrefixIPAddressManagementPrefixesAddPrefixResponse, -) -from .prefix_ip_address_management_prefixes_list_prefixes_response import ( - PrefixIPAddressManagementPrefixesListPrefixesResponse as PrefixIPAddressManagementPrefixesListPrefixesResponse, -) -from .loa_document_ip_address_management_prefixes_upload_loa_document_params import ( - LoaDocumentIPAddressManagementPrefixesUploadLoaDocumentParams as LoaDocumentIPAddressManagementPrefixesUploadLoaDocumentParams, -) -from .loa_document_ip_address_management_prefixes_upload_loa_document_response import ( - LoaDocumentIPAddressManagementPrefixesUploadLoaDocumentResponse as LoaDocumentIPAddressManagementPrefixesUploadLoaDocumentResponse, -) diff --git a/src/cloudflare/types/addresses/address_map_create_params.py b/src/cloudflare/types/addresses/address_map_create_params.py deleted file mode 100644 index fb52bf19c11..00000000000 --- a/src/cloudflare/types/addresses/address_map_create_params.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from __future__ import annotations - -from typing import Optional -from typing_extensions import TypedDict - -__all__ = ["AddressMapCreateParams"] - - -class AddressMapCreateParams(TypedDict, total=False): - description: Optional[str] - """ - An optional description field which may be used to describe the types of IPs or - zones on the map. - """ - - enabled: Optional[bool] - """Whether the Address Map is enabled or not. - - Cloudflare's DNS will not respond with IP addresses on an Address Map until the - map is enabled. - """ diff --git a/src/cloudflare/types/addresses/address_map_create_response.py b/src/cloudflare/types/addresses/address_map_create_response.py deleted file mode 100644 index 35004d7d8c3..00000000000 --- a/src/cloudflare/types/addresses/address_map_create_response.py +++ /dev/null @@ -1,81 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from typing import List, Optional -from datetime import datetime -from typing_extensions import Literal - -from ..._models import BaseModel - -__all__ = ["AddressMapCreateResponse", "IP", "Membership"] - - -class IP(BaseModel): - created_at: Optional[datetime] = None - - ip: Optional[str] = None - """An IPv4 or IPv6 address.""" - - -class Membership(BaseModel): - can_delete: Optional[bool] = None - """Controls whether the membership can be deleted via the API or not.""" - - created_at: Optional[datetime] = None - - identifier: Optional[str] = None - """Identifier""" - - kind: Optional[Literal["zone", "account"]] = None - """The type of the membership.""" - - -class AddressMapCreateResponse(BaseModel): - id: Optional[str] = None - """Identifier""" - - can_delete: Optional[bool] = None - """If set to false, then the Address Map cannot be deleted via API. - - This is true for Cloudflare-managed maps. - """ - - can_modify_ips: Optional[bool] = None - """If set to false, then the IPs on the Address Map cannot be modified via the API. - - This is true for Cloudflare-managed maps. - """ - - created_at: Optional[datetime] = None - - default_sni: Optional[str] = None - """ - If you have legacy TLS clients which do not send the TLS server name indicator, - then you can specify one default SNI on the map. If Cloudflare receives a TLS - handshake from a client without an SNI, it will respond with the default SNI on - those IPs. The default SNI can be any valid zone or subdomain owned by the - account. - """ - - description: Optional[str] = None - """ - An optional description field which may be used to describe the types of IPs or - zones on the map. - """ - - enabled: Optional[bool] = None - """Whether the Address Map is enabled or not. - - Cloudflare's DNS will not respond with IP addresses on an Address Map until the - map is enabled. - """ - - ips: Optional[List[IP]] = None - """The set of IPs on the Address Map.""" - - memberships: Optional[List[Membership]] = None - """Zones and Accounts which will be assigned IPs on this Address Map. - - A zone membership will take priority over an account membership. - """ - - modified_at: Optional[datetime] = None diff --git a/src/cloudflare/types/addresses/address_map_delete_response.py b/src/cloudflare/types/addresses/address_map_delete_response.py deleted file mode 100644 index 0636bcf136a..00000000000 --- a/src/cloudflare/types/addresses/address_map_delete_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from typing import List, Union - -__all__ = ["AddressMapDeleteResponse"] - -AddressMapDeleteResponse = Union[object, List[object], str, None] diff --git a/src/cloudflare/types/addresses/address_map_get_response.py b/src/cloudflare/types/addresses/address_map_get_response.py deleted file mode 100644 index 08fa517dde0..00000000000 --- a/src/cloudflare/types/addresses/address_map_get_response.py +++ /dev/null @@ -1,81 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from typing import List, Optional -from datetime import datetime -from typing_extensions import Literal - -from ..._models import BaseModel - -__all__ = ["AddressMapGetResponse", "IP", "Membership"] - - -class IP(BaseModel): - created_at: Optional[datetime] = None - - ip: Optional[str] = None - """An IPv4 or IPv6 address.""" - - -class Membership(BaseModel): - can_delete: Optional[bool] = None - """Controls whether the membership can be deleted via the API or not.""" - - created_at: Optional[datetime] = None - - identifier: Optional[str] = None - """Identifier""" - - kind: Optional[Literal["zone", "account"]] = None - """The type of the membership.""" - - -class AddressMapGetResponse(BaseModel): - id: Optional[str] = None - """Identifier""" - - can_delete: Optional[bool] = None - """If set to false, then the Address Map cannot be deleted via API. - - This is true for Cloudflare-managed maps. - """ - - can_modify_ips: Optional[bool] = None - """If set to false, then the IPs on the Address Map cannot be modified via the API. - - This is true for Cloudflare-managed maps. - """ - - created_at: Optional[datetime] = None - - default_sni: Optional[str] = None - """ - If you have legacy TLS clients which do not send the TLS server name indicator, - then you can specify one default SNI on the map. If Cloudflare receives a TLS - handshake from a client without an SNI, it will respond with the default SNI on - those IPs. The default SNI can be any valid zone or subdomain owned by the - account. - """ - - description: Optional[str] = None - """ - An optional description field which may be used to describe the types of IPs or - zones on the map. - """ - - enabled: Optional[bool] = None - """Whether the Address Map is enabled or not. - - Cloudflare's DNS will not respond with IP addresses on an Address Map until the - map is enabled. - """ - - ips: Optional[List[IP]] = None - """The set of IPs on the Address Map.""" - - memberships: Optional[List[Membership]] = None - """Zones and Accounts which will be assigned IPs on this Address Map. - - A zone membership will take priority over an account membership. - """ - - modified_at: Optional[datetime] = None diff --git a/src/cloudflare/types/addresses/address_map_list_response.py b/src/cloudflare/types/addresses/address_map_list_response.py deleted file mode 100644 index 93cc94f71ce..00000000000 --- a/src/cloudflare/types/addresses/address_map_list_response.py +++ /dev/null @@ -1,54 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from typing import List, Optional -from datetime import datetime - -from ..._models import BaseModel - -__all__ = ["AddressMapListResponse", "AddressMapListResponseItem"] - - -class AddressMapListResponseItem(BaseModel): - id: Optional[str] = None - """Identifier""" - - can_delete: Optional[bool] = None - """If set to false, then the Address Map cannot be deleted via API. - - This is true for Cloudflare-managed maps. - """ - - can_modify_ips: Optional[bool] = None - """If set to false, then the IPs on the Address Map cannot be modified via the API. - - This is true for Cloudflare-managed maps. - """ - - created_at: Optional[datetime] = None - - default_sni: Optional[str] = None - """ - If you have legacy TLS clients which do not send the TLS server name indicator, - then you can specify one default SNI on the map. If Cloudflare receives a TLS - handshake from a client without an SNI, it will respond with the default SNI on - those IPs. The default SNI can be any valid zone or subdomain owned by the - account. - """ - - description: Optional[str] = None - """ - An optional description field which may be used to describe the types of IPs or - zones on the map. - """ - - enabled: Optional[bool] = None - """Whether the Address Map is enabled or not. - - Cloudflare's DNS will not respond with IP addresses on an Address Map until the - map is enabled. - """ - - modified_at: Optional[datetime] = None - - -AddressMapListResponse = List[AddressMapListResponseItem] diff --git a/src/cloudflare/types/addresses/address_map_update_params.py b/src/cloudflare/types/addresses/address_map_update_params.py deleted file mode 100644 index 07f4bda8282..00000000000 --- a/src/cloudflare/types/addresses/address_map_update_params.py +++ /dev/null @@ -1,35 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from __future__ import annotations - -from typing import Optional -from typing_extensions import Required, TypedDict - -__all__ = ["AddressMapUpdateParams"] - - -class AddressMapUpdateParams(TypedDict, total=False): - account_identifier: Required[str] - """Identifier""" - - default_sni: Optional[str] - """ - If you have legacy TLS clients which do not send the TLS server name indicator, - then you can specify one default SNI on the map. If Cloudflare receives a TLS - handshake from a client without an SNI, it will respond with the default SNI on - those IPs. The default SNI can be any valid zone or subdomain owned by the - account. - """ - - description: Optional[str] - """ - An optional description field which may be used to describe the types of IPs or - zones on the map. - """ - - enabled: Optional[bool] - """Whether the Address Map is enabled or not. - - Cloudflare's DNS will not respond with IP addresses on an Address Map until the - map is enabled. - """ diff --git a/src/cloudflare/types/addresses/address_map_update_response.py b/src/cloudflare/types/addresses/address_map_update_response.py deleted file mode 100644 index ee0db87111b..00000000000 --- a/src/cloudflare/types/addresses/address_map_update_response.py +++ /dev/null @@ -1,51 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from typing import Optional -from datetime import datetime - -from ..._models import BaseModel - -__all__ = ["AddressMapUpdateResponse"] - - -class AddressMapUpdateResponse(BaseModel): - id: Optional[str] = None - """Identifier""" - - can_delete: Optional[bool] = None - """If set to false, then the Address Map cannot be deleted via API. - - This is true for Cloudflare-managed maps. - """ - - can_modify_ips: Optional[bool] = None - """If set to false, then the IPs on the Address Map cannot be modified via the API. - - This is true for Cloudflare-managed maps. - """ - - created_at: Optional[datetime] = None - - default_sni: Optional[str] = None - """ - If you have legacy TLS clients which do not send the TLS server name indicator, - then you can specify one default SNI on the map. If Cloudflare receives a TLS - handshake from a client without an SNI, it will respond with the default SNI on - those IPs. The default SNI can be any valid zone or subdomain owned by the - account. - """ - - description: Optional[str] = None - """ - An optional description field which may be used to describe the types of IPs or - zones on the map. - """ - - enabled: Optional[bool] = None - """Whether the Address Map is enabled or not. - - Cloudflare's DNS will not respond with IP addresses on an Address Map until the - map is enabled. - """ - - modified_at: Optional[datetime] = None diff --git a/src/cloudflare/types/addresses/address_maps/__init__.py b/src/cloudflare/types/addresses/address_maps/__init__.py index e88287ad583..b2f53e35258 100644 --- a/src/cloudflare/types/addresses/address_maps/__init__.py +++ b/src/cloudflare/types/addresses/address_maps/__init__.py @@ -1,10 +1,3 @@ # File generated from our OpenAPI spec by Stainless. from __future__ import annotations - -from .ip_delete_response import IPDeleteResponse as IPDeleteResponse -from .ip_update_response import IPUpdateResponse as IPUpdateResponse -from .zone_delete_response import ZoneDeleteResponse as ZoneDeleteResponse -from .zone_update_response import ZoneUpdateResponse as ZoneUpdateResponse -from .account_delete_response import AccountDeleteResponse as AccountDeleteResponse -from .account_update_response import AccountUpdateResponse as AccountUpdateResponse diff --git a/src/cloudflare/types/addresses/address_maps/account_delete_response.py b/src/cloudflare/types/addresses/address_maps/account_delete_response.py deleted file mode 100644 index 8990853c72d..00000000000 --- a/src/cloudflare/types/addresses/address_maps/account_delete_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from typing import List, Union - -__all__ = ["AccountDeleteResponse"] - -AccountDeleteResponse = Union[object, List[object], str, None] diff --git a/src/cloudflare/types/addresses/address_maps/account_update_response.py b/src/cloudflare/types/addresses/address_maps/account_update_response.py deleted file mode 100644 index 0645f70677b..00000000000 --- a/src/cloudflare/types/addresses/address_maps/account_update_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from typing import List, Union - -__all__ = ["AccountUpdateResponse"] - -AccountUpdateResponse = Union[object, List[object], str, None] diff --git a/src/cloudflare/types/addresses/address_maps/ip_delete_response.py b/src/cloudflare/types/addresses/address_maps/ip_delete_response.py deleted file mode 100644 index 90ada06041b..00000000000 --- a/src/cloudflare/types/addresses/address_maps/ip_delete_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from typing import List, Union - -__all__ = ["IPDeleteResponse"] - -IPDeleteResponse = Union[object, List[object], str, None] diff --git a/src/cloudflare/types/addresses/address_maps/ip_update_response.py b/src/cloudflare/types/addresses/address_maps/ip_update_response.py deleted file mode 100644 index b626d7d9c0a..00000000000 --- a/src/cloudflare/types/addresses/address_maps/ip_update_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from typing import List, Union - -__all__ = ["IPUpdateResponse"] - -IPUpdateResponse = Union[object, List[object], str, None] diff --git a/src/cloudflare/types/addresses/address_maps/zone_delete_response.py b/src/cloudflare/types/addresses/address_maps/zone_delete_response.py deleted file mode 100644 index b2045a6bbd0..00000000000 --- a/src/cloudflare/types/addresses/address_maps/zone_delete_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from typing import List, Union - -__all__ = ["ZoneDeleteResponse"] - -ZoneDeleteResponse = Union[object, List[object], str, None] diff --git a/src/cloudflare/types/addresses/address_maps/zone_update_response.py b/src/cloudflare/types/addresses/address_maps/zone_update_response.py deleted file mode 100644 index 5e7a1368c03..00000000000 --- a/src/cloudflare/types/addresses/address_maps/zone_update_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from typing import List, Union - -__all__ = ["ZoneUpdateResponse"] - -ZoneUpdateResponse = Union[object, List[object], str, None] diff --git a/src/cloudflare/types/addresses/loa_document_ip_address_management_prefixes_upload_loa_document_params.py b/src/cloudflare/types/addresses/loa_document_ip_address_management_prefixes_upload_loa_document_params.py deleted file mode 100644 index 88ee02221f2..00000000000 --- a/src/cloudflare/types/addresses/loa_document_ip_address_management_prefixes_upload_loa_document_params.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LoaDocumentIPAddressManagementPrefixesUploadLoaDocumentParams"] - - -class LoaDocumentIPAddressManagementPrefixesUploadLoaDocumentParams(TypedDict, total=False): - loa_document: Required[str] - """LOA document to upload.""" diff --git a/src/cloudflare/types/addresses/loa_document_ip_address_management_prefixes_upload_loa_document_response.py b/src/cloudflare/types/addresses/loa_document_ip_address_management_prefixes_upload_loa_document_response.py deleted file mode 100644 index f3db693ebaa..00000000000 --- a/src/cloudflare/types/addresses/loa_document_ip_address_management_prefixes_upload_loa_document_response.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from typing import Optional - -from ..._models import BaseModel - -__all__ = ["LoaDocumentIPAddressManagementPrefixesUploadLoaDocumentResponse"] - - -class LoaDocumentIPAddressManagementPrefixesUploadLoaDocumentResponse(BaseModel): - filename: Optional[str] = None - """Name of LOA document.""" diff --git a/src/cloudflare/types/addresses/prefix_delete_response.py b/src/cloudflare/types/addresses/prefix_delete_response.py deleted file mode 100644 index a43a7c3f600..00000000000 --- a/src/cloudflare/types/addresses/prefix_delete_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from typing import List, Union - -__all__ = ["PrefixDeleteResponse"] - -PrefixDeleteResponse = Union[object, List[object], str, None] diff --git a/src/cloudflare/types/addresses/prefix_get_response.py b/src/cloudflare/types/addresses/prefix_get_response.py deleted file mode 100644 index d00d16988f8..00000000000 --- a/src/cloudflare/types/addresses/prefix_get_response.py +++ /dev/null @@ -1,59 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from typing import Optional -from datetime import datetime - -from ..._models import BaseModel - -__all__ = ["PrefixGetResponse"] - - -class PrefixGetResponse(BaseModel): - id: Optional[str] = None - """Identifier""" - - account_id: Optional[str] = None - """Identifier""" - - advertised: Optional[bool] = None - """Prefix advertisement status to the Internet. - - This field is only not 'null' if on demand is enabled. - """ - - advertised_modified_at: Optional[datetime] = None - """Last time the advertisement status was changed. - - This field is only not 'null' if on demand is enabled. - """ - - approved: Optional[str] = None - """Approval state of the prefix (P = pending, V = active).""" - - asn: Optional[int] = None - """Autonomous System Number (ASN) the prefix will be advertised under.""" - - cidr: Optional[str] = None - """IP Prefix in Classless Inter-Domain Routing format.""" - - created_at: Optional[datetime] = None - - description: Optional[str] = None - """Description of the prefix.""" - - loa_document_id: Optional[str] = None - """Identifier for the uploaded LOA document.""" - - modified_at: Optional[datetime] = None - - on_demand_enabled: Optional[bool] = None - """ - Whether advertisement of the prefix to the Internet may be dynamically enabled - or disabled. - """ - - on_demand_locked: Optional[bool] = None - """ - Whether advertisement status of the prefix is locked, meaning it cannot be - changed. - """ diff --git a/src/cloudflare/types/addresses/prefix_ip_address_management_prefixes_add_prefix_params.py b/src/cloudflare/types/addresses/prefix_ip_address_management_prefixes_add_prefix_params.py deleted file mode 100644 index 9793123e234..00000000000 --- a/src/cloudflare/types/addresses/prefix_ip_address_management_prefixes_add_prefix_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from __future__ import annotations - -from typing import Optional -from typing_extensions import Required, TypedDict - -__all__ = ["PrefixIPAddressManagementPrefixesAddPrefixParams"] - - -class PrefixIPAddressManagementPrefixesAddPrefixParams(TypedDict, total=False): - asn: Required[Optional[int]] - """Autonomous System Number (ASN) the prefix will be advertised under.""" - - cidr: Required[str] - """IP Prefix in Classless Inter-Domain Routing format.""" - - loa_document_id: Required[Optional[str]] - """Identifier for the uploaded LOA document.""" diff --git a/src/cloudflare/types/addresses/prefix_ip_address_management_prefixes_add_prefix_response.py b/src/cloudflare/types/addresses/prefix_ip_address_management_prefixes_add_prefix_response.py deleted file mode 100644 index 6e37091bc07..00000000000 --- a/src/cloudflare/types/addresses/prefix_ip_address_management_prefixes_add_prefix_response.py +++ /dev/null @@ -1,59 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from typing import Optional -from datetime import datetime - -from ..._models import BaseModel - -__all__ = ["PrefixIPAddressManagementPrefixesAddPrefixResponse"] - - -class PrefixIPAddressManagementPrefixesAddPrefixResponse(BaseModel): - id: Optional[str] = None - """Identifier""" - - account_id: Optional[str] = None - """Identifier""" - - advertised: Optional[bool] = None - """Prefix advertisement status to the Internet. - - This field is only not 'null' if on demand is enabled. - """ - - advertised_modified_at: Optional[datetime] = None - """Last time the advertisement status was changed. - - This field is only not 'null' if on demand is enabled. - """ - - approved: Optional[str] = None - """Approval state of the prefix (P = pending, V = active).""" - - asn: Optional[int] = None - """Autonomous System Number (ASN) the prefix will be advertised under.""" - - cidr: Optional[str] = None - """IP Prefix in Classless Inter-Domain Routing format.""" - - created_at: Optional[datetime] = None - - description: Optional[str] = None - """Description of the prefix.""" - - loa_document_id: Optional[str] = None - """Identifier for the uploaded LOA document.""" - - modified_at: Optional[datetime] = None - - on_demand_enabled: Optional[bool] = None - """ - Whether advertisement of the prefix to the Internet may be dynamically enabled - or disabled. - """ - - on_demand_locked: Optional[bool] = None - """ - Whether advertisement status of the prefix is locked, meaning it cannot be - changed. - """ diff --git a/src/cloudflare/types/addresses/prefix_ip_address_management_prefixes_list_prefixes_response.py b/src/cloudflare/types/addresses/prefix_ip_address_management_prefixes_list_prefixes_response.py deleted file mode 100644 index 03e81a5575c..00000000000 --- a/src/cloudflare/types/addresses/prefix_ip_address_management_prefixes_list_prefixes_response.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from typing import List, Optional -from datetime import datetime - -from ..._models import BaseModel - -__all__ = [ - "PrefixIPAddressManagementPrefixesListPrefixesResponse", - "PrefixIPAddressManagementPrefixesListPrefixesResponseItem", -] - - -class PrefixIPAddressManagementPrefixesListPrefixesResponseItem(BaseModel): - id: Optional[str] = None - """Identifier""" - - account_id: Optional[str] = None - """Identifier""" - - advertised: Optional[bool] = None - """Prefix advertisement status to the Internet. - - This field is only not 'null' if on demand is enabled. - """ - - advertised_modified_at: Optional[datetime] = None - """Last time the advertisement status was changed. - - This field is only not 'null' if on demand is enabled. - """ - - approved: Optional[str] = None - """Approval state of the prefix (P = pending, V = active).""" - - asn: Optional[int] = None - """Autonomous System Number (ASN) the prefix will be advertised under.""" - - cidr: Optional[str] = None - """IP Prefix in Classless Inter-Domain Routing format.""" - - created_at: Optional[datetime] = None - - description: Optional[str] = None - """Description of the prefix.""" - - loa_document_id: Optional[str] = None - """Identifier for the uploaded LOA document.""" - - modified_at: Optional[datetime] = None - - on_demand_enabled: Optional[bool] = None - """ - Whether advertisement of the prefix to the Internet may be dynamically enabled - or disabled. - """ - - on_demand_locked: Optional[bool] = None - """ - Whether advertisement status of the prefix is locked, meaning it cannot be - changed. - """ - - -PrefixIPAddressManagementPrefixesListPrefixesResponse = List[PrefixIPAddressManagementPrefixesListPrefixesResponseItem] diff --git a/src/cloudflare/types/addresses/prefix_update_params.py b/src/cloudflare/types/addresses/prefix_update_params.py deleted file mode 100644 index 8d74b012281..00000000000 --- a/src/cloudflare/types/addresses/prefix_update_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["PrefixUpdateParams"] - - -class PrefixUpdateParams(TypedDict, total=False): - account_identifier: Required[str] - """Identifier""" - - description: Required[str] - """Description of the prefix.""" diff --git a/src/cloudflare/types/addresses/prefix_update_response.py b/src/cloudflare/types/addresses/prefix_update_response.py deleted file mode 100644 index 5e044759169..00000000000 --- a/src/cloudflare/types/addresses/prefix_update_response.py +++ /dev/null @@ -1,59 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from typing import Optional -from datetime import datetime - -from ..._models import BaseModel - -__all__ = ["PrefixUpdateResponse"] - - -class PrefixUpdateResponse(BaseModel): - id: Optional[str] = None - """Identifier""" - - account_id: Optional[str] = None - """Identifier""" - - advertised: Optional[bool] = None - """Prefix advertisement status to the Internet. - - This field is only not 'null' if on demand is enabled. - """ - - advertised_modified_at: Optional[datetime] = None - """Last time the advertisement status was changed. - - This field is only not 'null' if on demand is enabled. - """ - - approved: Optional[str] = None - """Approval state of the prefix (P = pending, V = active).""" - - asn: Optional[int] = None - """Autonomous System Number (ASN) the prefix will be advertised under.""" - - cidr: Optional[str] = None - """IP Prefix in Classless Inter-Domain Routing format.""" - - created_at: Optional[datetime] = None - - description: Optional[str] = None - """Description of the prefix.""" - - loa_document_id: Optional[str] = None - """Identifier for the uploaded LOA document.""" - - modified_at: Optional[datetime] = None - - on_demand_enabled: Optional[bool] = None - """ - Whether advertisement of the prefix to the Internet may be dynamically enabled - or disabled. - """ - - on_demand_locked: Optional[bool] = None - """ - Whether advertisement status of the prefix is locked, meaning it cannot be - changed. - """ diff --git a/src/cloudflare/types/addresses/prefixes/__init__.py b/src/cloudflare/types/addresses/prefixes/__init__.py index 5edfda676e6..b2f53e35258 100644 --- a/src/cloudflare/types/addresses/prefixes/__init__.py +++ b/src/cloudflare/types/addresses/prefixes/__init__.py @@ -1,14 +1,3 @@ # File generated from our OpenAPI spec by Stainless. from __future__ import annotations - -from .delegation_delete_response import DelegationDeleteResponse as DelegationDeleteResponse -from .delegation_ip_address_management_prefix_delegation_create_prefix_delegation_params import ( - DelegationIPAddressManagementPrefixDelegationCreatePrefixDelegationParams as DelegationIPAddressManagementPrefixDelegationCreatePrefixDelegationParams, -) -from .delegation_ip_address_management_prefix_delegation_list_prefix_delegations_response import ( - DelegationIPAddressManagementPrefixDelegationListPrefixDelegationsResponse as DelegationIPAddressManagementPrefixDelegationListPrefixDelegationsResponse, -) -from .delegation_ip_address_management_prefix_delegation_create_prefix_delegation_response import ( - DelegationIPAddressManagementPrefixDelegationCreatePrefixDelegationResponse as DelegationIPAddressManagementPrefixDelegationCreatePrefixDelegationResponse, -) diff --git a/src/cloudflare/types/addresses/prefixes/bgps/__init__.py b/src/cloudflare/types/addresses/prefixes/bgps/__init__.py index 7c42dda37fc..b2f53e35258 100644 --- a/src/cloudflare/types/addresses/prefixes/bgps/__init__.py +++ b/src/cloudflare/types/addresses/prefixes/bgps/__init__.py @@ -1,13 +1,3 @@ # File generated from our OpenAPI spec by Stainless. from __future__ import annotations - -from .status_ip_address_management_dynamic_advertisement_get_advertisement_status_response import ( - StatusIPAddressManagementDynamicAdvertisementGetAdvertisementStatusResponse as StatusIPAddressManagementDynamicAdvertisementGetAdvertisementStatusResponse, -) -from .status_ip_address_management_dynamic_advertisement_update_prefix_dynamic_advertisement_status_params import ( - StatusIPAddressManagementDynamicAdvertisementUpdatePrefixDynamicAdvertisementStatusParams as StatusIPAddressManagementDynamicAdvertisementUpdatePrefixDynamicAdvertisementStatusParams, -) -from .status_ip_address_management_dynamic_advertisement_update_prefix_dynamic_advertisement_status_response import ( - StatusIPAddressManagementDynamicAdvertisementUpdatePrefixDynamicAdvertisementStatusResponse as StatusIPAddressManagementDynamicAdvertisementUpdatePrefixDynamicAdvertisementStatusResponse, -) diff --git a/src/cloudflare/types/addresses/prefixes/bgps/status_ip_address_management_dynamic_advertisement_get_advertisement_status_response.py b/src/cloudflare/types/addresses/prefixes/bgps/status_ip_address_management_dynamic_advertisement_get_advertisement_status_response.py deleted file mode 100644 index 553ea9d3a83..00000000000 --- a/src/cloudflare/types/addresses/prefixes/bgps/status_ip_address_management_dynamic_advertisement_get_advertisement_status_response.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from typing import Optional -from datetime import datetime - -from ....._models import BaseModel - -__all__ = ["StatusIPAddressManagementDynamicAdvertisementGetAdvertisementStatusResponse"] - - -class StatusIPAddressManagementDynamicAdvertisementGetAdvertisementStatusResponse(BaseModel): - advertised: Optional[bool] = None - """Enablement of prefix advertisement to the Internet.""" - - advertised_modified_at: Optional[datetime] = None - """Last time the advertisement status was changed. - - This field is only not 'null' if on demand is enabled. - """ diff --git a/src/cloudflare/types/addresses/prefixes/bgps/status_ip_address_management_dynamic_advertisement_update_prefix_dynamic_advertisement_status_params.py b/src/cloudflare/types/addresses/prefixes/bgps/status_ip_address_management_dynamic_advertisement_update_prefix_dynamic_advertisement_status_params.py deleted file mode 100644 index 84b01491a92..00000000000 --- a/src/cloudflare/types/addresses/prefixes/bgps/status_ip_address_management_dynamic_advertisement_update_prefix_dynamic_advertisement_status_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["StatusIPAddressManagementDynamicAdvertisementUpdatePrefixDynamicAdvertisementStatusParams"] - - -class StatusIPAddressManagementDynamicAdvertisementUpdatePrefixDynamicAdvertisementStatusParams(TypedDict, total=False): - account_identifier: Required[str] - """Identifier""" - - advertised: Required[bool] - """Enablement of prefix advertisement to the Internet.""" diff --git a/src/cloudflare/types/addresses/prefixes/bgps/status_ip_address_management_dynamic_advertisement_update_prefix_dynamic_advertisement_status_response.py b/src/cloudflare/types/addresses/prefixes/bgps/status_ip_address_management_dynamic_advertisement_update_prefix_dynamic_advertisement_status_response.py deleted file mode 100644 index 32c1e0f2555..00000000000 --- a/src/cloudflare/types/addresses/prefixes/bgps/status_ip_address_management_dynamic_advertisement_update_prefix_dynamic_advertisement_status_response.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from typing import Optional -from datetime import datetime - -from ....._models import BaseModel - -__all__ = ["StatusIPAddressManagementDynamicAdvertisementUpdatePrefixDynamicAdvertisementStatusResponse"] - - -class StatusIPAddressManagementDynamicAdvertisementUpdatePrefixDynamicAdvertisementStatusResponse(BaseModel): - advertised: Optional[bool] = None - """Enablement of prefix advertisement to the Internet.""" - - advertised_modified_at: Optional[datetime] = None - """Last time the advertisement status was changed. - - This field is only not 'null' if on demand is enabled. - """ diff --git a/src/cloudflare/types/addresses/prefixes/delegation_delete_response.py b/src/cloudflare/types/addresses/prefixes/delegation_delete_response.py deleted file mode 100644 index 5c7fc5b5596..00000000000 --- a/src/cloudflare/types/addresses/prefixes/delegation_delete_response.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from typing import Optional - -from ...._models import BaseModel - -__all__ = ["DelegationDeleteResponse"] - - -class DelegationDeleteResponse(BaseModel): - id: Optional[str] = None - """Delegation identifier tag.""" diff --git a/src/cloudflare/types/addresses/prefixes/delegation_ip_address_management_prefix_delegation_create_prefix_delegation_params.py b/src/cloudflare/types/addresses/prefixes/delegation_ip_address_management_prefix_delegation_create_prefix_delegation_params.py deleted file mode 100644 index 5fc98ca7df5..00000000000 --- a/src/cloudflare/types/addresses/prefixes/delegation_ip_address_management_prefix_delegation_create_prefix_delegation_params.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["DelegationIPAddressManagementPrefixDelegationCreatePrefixDelegationParams"] - - -class DelegationIPAddressManagementPrefixDelegationCreatePrefixDelegationParams(TypedDict, total=False): - account_identifier: Required[str] - """Identifier""" - - cidr: Required[str] - """IP Prefix in Classless Inter-Domain Routing format.""" - - delegated_account_id: Required[str] - """Account identifier for the account to which prefix is being delegated.""" diff --git a/src/cloudflare/types/addresses/prefixes/delegation_ip_address_management_prefix_delegation_create_prefix_delegation_response.py b/src/cloudflare/types/addresses/prefixes/delegation_ip_address_management_prefix_delegation_create_prefix_delegation_response.py deleted file mode 100644 index 4a60271f2d2..00000000000 --- a/src/cloudflare/types/addresses/prefixes/delegation_ip_address_management_prefix_delegation_create_prefix_delegation_response.py +++ /dev/null @@ -1,26 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from typing import Optional -from datetime import datetime - -from ...._models import BaseModel - -__all__ = ["DelegationIPAddressManagementPrefixDelegationCreatePrefixDelegationResponse"] - - -class DelegationIPAddressManagementPrefixDelegationCreatePrefixDelegationResponse(BaseModel): - id: Optional[str] = None - """Delegation identifier tag.""" - - cidr: Optional[str] = None - """IP Prefix in Classless Inter-Domain Routing format.""" - - created_at: Optional[datetime] = None - - delegated_account_id: Optional[str] = None - """Account identifier for the account to which prefix is being delegated.""" - - modified_at: Optional[datetime] = None - - parent_prefix_id: Optional[str] = None - """Identifier""" diff --git a/src/cloudflare/types/addresses/prefixes/delegation_ip_address_management_prefix_delegation_list_prefix_delegations_response.py b/src/cloudflare/types/addresses/prefixes/delegation_ip_address_management_prefix_delegation_list_prefix_delegations_response.py deleted file mode 100644 index f9b42aa81b1..00000000000 --- a/src/cloudflare/types/addresses/prefixes/delegation_ip_address_management_prefix_delegation_list_prefix_delegations_response.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from typing import List, Optional -from datetime import datetime - -from ...._models import BaseModel - -__all__ = [ - "DelegationIPAddressManagementPrefixDelegationListPrefixDelegationsResponse", - "DelegationIPAddressManagementPrefixDelegationListPrefixDelegationsResponseItem", -] - - -class DelegationIPAddressManagementPrefixDelegationListPrefixDelegationsResponseItem(BaseModel): - id: Optional[str] = None - """Delegation identifier tag.""" - - cidr: Optional[str] = None - """IP Prefix in Classless Inter-Domain Routing format.""" - - created_at: Optional[datetime] = None - - delegated_account_id: Optional[str] = None - """Account identifier for the account to which prefix is being delegated.""" - - modified_at: Optional[datetime] = None - - parent_prefix_id: Optional[str] = None - """Identifier""" - - -DelegationIPAddressManagementPrefixDelegationListPrefixDelegationsResponse = List[ - DelegationIPAddressManagementPrefixDelegationListPrefixDelegationsResponseItem -] diff --git a/src/cloudflare/types/addressing/__init__.py b/src/cloudflare/types/addressing/__init__.py index a91e8a4e8ca..b2f53e35258 100644 --- a/src/cloudflare/types/addressing/__init__.py +++ b/src/cloudflare/types/addressing/__init__.py @@ -1,5 +1,3 @@ # File generated from our OpenAPI spec by Stainless. from __future__ import annotations - -from .service_list_response import ServiceListResponse as ServiceListResponse diff --git a/src/cloudflare/types/addressing/prefixes/__init__.py b/src/cloudflare/types/addressing/prefixes/__init__.py index e95349b9237..b2f53e35258 100644 --- a/src/cloudflare/types/addressing/prefixes/__init__.py +++ b/src/cloudflare/types/addressing/prefixes/__init__.py @@ -1,13 +1,3 @@ # File generated from our OpenAPI spec by Stainless. from __future__ import annotations - -from .binding_get_response import BindingGetResponse as BindingGetResponse -from .binding_create_params import BindingCreateParams as BindingCreateParams -from .binding_list_response import BindingListResponse as BindingListResponse -from .bgp_prefix_get_response import BGPPrefixGetResponse as BGPPrefixGetResponse -from .binding_create_response import BindingCreateResponse as BindingCreateResponse -from .binding_delete_response import BindingDeleteResponse as BindingDeleteResponse -from .bgp_prefix_list_response import BGPPrefixListResponse as BGPPrefixListResponse -from .bgp_prefix_update_params import BGPPrefixUpdateParams as BGPPrefixUpdateParams -from .bgp_prefix_update_response import BGPPrefixUpdateResponse as BGPPrefixUpdateResponse diff --git a/src/cloudflare/types/addressing/prefixes/bgp_prefix_get_response.py b/src/cloudflare/types/addressing/prefixes/bgp_prefix_get_response.py deleted file mode 100644 index e37d7c8dcdf..00000000000 --- a/src/cloudflare/types/addressing/prefixes/bgp_prefix_get_response.py +++ /dev/null @@ -1,67 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from typing import Optional -from datetime import datetime - -from ...._models import BaseModel - -__all__ = ["BGPPrefixGetResponse", "BGPSignalOpts", "OnDemand"] - - -class BGPSignalOpts(BaseModel): - enabled: Optional[bool] = None - """ - Whether control of advertisement of the prefix to the Internet is enabled to be - performed via BGP signal - """ - - modified_at: Optional[datetime] = None - """Last time BGP signaling control was toggled. - - This field is null if BGP signaling has never been enabled. - """ - - -class OnDemand(BaseModel): - advertised: Optional[bool] = None - """Prefix advertisement status to the Internet. - - This field is only not 'null' if on demand is enabled. - """ - - advertised_modified_at: Optional[datetime] = None - """Last time the advertisement status was changed. - - This field is only not 'null' if on demand is enabled. - """ - - on_demand_enabled: Optional[bool] = None - """ - Whether advertisement of the prefix to the Internet may be dynamically enabled - or disabled. - """ - - on_demand_locked: Optional[bool] = None - """ - Whether advertisement status of the prefix is locked, meaning it cannot be - changed. - """ - - -class BGPPrefixGetResponse(BaseModel): - id: Optional[str] = None - """Identifier""" - - asn: Optional[int] = None - """Autonomous System Number (ASN) the prefix will be advertised under.""" - - bgp_signal_opts: Optional[BGPSignalOpts] = None - - cidr: Optional[str] = None - """IP Prefix in Classless Inter-Domain Routing format.""" - - created_at: Optional[datetime] = None - - modified_at: Optional[datetime] = None - - on_demand: Optional[OnDemand] = None diff --git a/src/cloudflare/types/addressing/prefixes/bgp_prefix_list_response.py b/src/cloudflare/types/addressing/prefixes/bgp_prefix_list_response.py deleted file mode 100644 index 49f0e4b00b4..00000000000 --- a/src/cloudflare/types/addressing/prefixes/bgp_prefix_list_response.py +++ /dev/null @@ -1,75 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from typing import List, Optional -from datetime import datetime - -from ...._models import BaseModel - -__all__ = [ - "BGPPrefixListResponse", - "BGPPrefixListResponseItem", - "BGPPrefixListResponseItemBGPSignalOpts", - "BGPPrefixListResponseItemOnDemand", -] - - -class BGPPrefixListResponseItemBGPSignalOpts(BaseModel): - enabled: Optional[bool] = None - """ - Whether control of advertisement of the prefix to the Internet is enabled to be - performed via BGP signal - """ - - modified_at: Optional[datetime] = None - """Last time BGP signaling control was toggled. - - This field is null if BGP signaling has never been enabled. - """ - - -class BGPPrefixListResponseItemOnDemand(BaseModel): - advertised: Optional[bool] = None - """Prefix advertisement status to the Internet. - - This field is only not 'null' if on demand is enabled. - """ - - advertised_modified_at: Optional[datetime] = None - """Last time the advertisement status was changed. - - This field is only not 'null' if on demand is enabled. - """ - - on_demand_enabled: Optional[bool] = None - """ - Whether advertisement of the prefix to the Internet may be dynamically enabled - or disabled. - """ - - on_demand_locked: Optional[bool] = None - """ - Whether advertisement status of the prefix is locked, meaning it cannot be - changed. - """ - - -class BGPPrefixListResponseItem(BaseModel): - id: Optional[str] = None - """Identifier""" - - asn: Optional[int] = None - """Autonomous System Number (ASN) the prefix will be advertised under.""" - - bgp_signal_opts: Optional[BGPPrefixListResponseItemBGPSignalOpts] = None - - cidr: Optional[str] = None - """IP Prefix in Classless Inter-Domain Routing format.""" - - created_at: Optional[datetime] = None - - modified_at: Optional[datetime] = None - - on_demand: Optional[BGPPrefixListResponseItemOnDemand] = None - - -BGPPrefixListResponse = List[BGPPrefixListResponseItem] diff --git a/src/cloudflare/types/addressing/prefixes/bgp_prefix_update_params.py b/src/cloudflare/types/addressing/prefixes/bgp_prefix_update_params.py deleted file mode 100644 index e0a391cf2a4..00000000000 --- a/src/cloudflare/types/addressing/prefixes/bgp_prefix_update_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BGPPrefixUpdateParams", "OnDemand"] - - -class BGPPrefixUpdateParams(TypedDict, total=False): - account_identifier: Required[str] - """Identifier""" - - prefix_identifier: Required[str] - """Identifier""" - - on_demand: OnDemand - - -class OnDemand(TypedDict, total=False): - advertised: bool diff --git a/src/cloudflare/types/addressing/prefixes/bgp_prefix_update_response.py b/src/cloudflare/types/addressing/prefixes/bgp_prefix_update_response.py deleted file mode 100644 index 02f3291ae41..00000000000 --- a/src/cloudflare/types/addressing/prefixes/bgp_prefix_update_response.py +++ /dev/null @@ -1,67 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from typing import Optional -from datetime import datetime - -from ...._models import BaseModel - -__all__ = ["BGPPrefixUpdateResponse", "BGPSignalOpts", "OnDemand"] - - -class BGPSignalOpts(BaseModel): - enabled: Optional[bool] = None - """ - Whether control of advertisement of the prefix to the Internet is enabled to be - performed via BGP signal - """ - - modified_at: Optional[datetime] = None - """Last time BGP signaling control was toggled. - - This field is null if BGP signaling has never been enabled. - """ - - -class OnDemand(BaseModel): - advertised: Optional[bool] = None - """Prefix advertisement status to the Internet. - - This field is only not 'null' if on demand is enabled. - """ - - advertised_modified_at: Optional[datetime] = None - """Last time the advertisement status was changed. - - This field is only not 'null' if on demand is enabled. - """ - - on_demand_enabled: Optional[bool] = None - """ - Whether advertisement of the prefix to the Internet may be dynamically enabled - or disabled. - """ - - on_demand_locked: Optional[bool] = None - """ - Whether advertisement status of the prefix is locked, meaning it cannot be - changed. - """ - - -class BGPPrefixUpdateResponse(BaseModel): - id: Optional[str] = None - """Identifier""" - - asn: Optional[int] = None - """Autonomous System Number (ASN) the prefix will be advertised under.""" - - bgp_signal_opts: Optional[BGPSignalOpts] = None - - cidr: Optional[str] = None - """IP Prefix in Classless Inter-Domain Routing format.""" - - created_at: Optional[datetime] = None - - modified_at: Optional[datetime] = None - - on_demand: Optional[OnDemand] = None diff --git a/src/cloudflare/types/addressing/prefixes/binding_create_params.py b/src/cloudflare/types/addressing/prefixes/binding_create_params.py deleted file mode 100644 index fd5a0a55171..00000000000 --- a/src/cloudflare/types/addressing/prefixes/binding_create_params.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BindingCreateParams"] - - -class BindingCreateParams(TypedDict, total=False): - account_identifier: Required[str] - """Identifier""" - - cidr: str - """IP Prefix in Classless Inter-Domain Routing format.""" - - service_id: str - """Identifier""" diff --git a/src/cloudflare/types/addressing/prefixes/binding_create_response.py b/src/cloudflare/types/addressing/prefixes/binding_create_response.py deleted file mode 100644 index d48cea87581..00000000000 --- a/src/cloudflare/types/addressing/prefixes/binding_create_response.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from typing import Optional -from typing_extensions import Literal - -from ...._models import BaseModel - -__all__ = ["BindingCreateResponse", "Provisioning"] - - -class Provisioning(BaseModel): - state: Optional[Literal["provisioning", "active"]] = None - """ - When a binding has been deployed to a majority of Cloudflare datacenters, the - binding will become active and can be used with its associated service. - """ - - -class BindingCreateResponse(BaseModel): - id: Optional[str] = None - """Identifier""" - - cidr: Optional[str] = None - """IP Prefix in Classless Inter-Domain Routing format.""" - - provisioning: Optional[Provisioning] = None - """Status of a Service Binding's deployment to the Cloudflare network""" - - service_id: Optional[str] = None - """Identifier""" - - service_name: Optional[str] = None - """Name of a service running on the Cloudflare network""" diff --git a/src/cloudflare/types/addressing/prefixes/binding_delete_response.py b/src/cloudflare/types/addressing/prefixes/binding_delete_response.py deleted file mode 100644 index 3e32a76f832..00000000000 --- a/src/cloudflare/types/addressing/prefixes/binding_delete_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from typing import List, Union - -__all__ = ["BindingDeleteResponse"] - -BindingDeleteResponse = Union[object, List[object], str] diff --git a/src/cloudflare/types/addressing/prefixes/binding_get_response.py b/src/cloudflare/types/addressing/prefixes/binding_get_response.py deleted file mode 100644 index 32438827e3e..00000000000 --- a/src/cloudflare/types/addressing/prefixes/binding_get_response.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from typing import Optional -from typing_extensions import Literal - -from ...._models import BaseModel - -__all__ = ["BindingGetResponse", "Provisioning"] - - -class Provisioning(BaseModel): - state: Optional[Literal["provisioning", "active"]] = None - """ - When a binding has been deployed to a majority of Cloudflare datacenters, the - binding will become active and can be used with its associated service. - """ - - -class BindingGetResponse(BaseModel): - id: Optional[str] = None - """Identifier""" - - cidr: Optional[str] = None - """IP Prefix in Classless Inter-Domain Routing format.""" - - provisioning: Optional[Provisioning] = None - """Status of a Service Binding's deployment to the Cloudflare network""" - - service_id: Optional[str] = None - """Identifier""" - - service_name: Optional[str] = None - """Name of a service running on the Cloudflare network""" diff --git a/src/cloudflare/types/addressing/prefixes/binding_list_response.py b/src/cloudflare/types/addressing/prefixes/binding_list_response.py deleted file mode 100644 index df5ed3f1d05..00000000000 --- a/src/cloudflare/types/addressing/prefixes/binding_list_response.py +++ /dev/null @@ -1,36 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from typing import List, Optional -from typing_extensions import Literal - -from ...._models import BaseModel - -__all__ = ["BindingListResponse", "BindingListResponseItem", "BindingListResponseItemProvisioning"] - - -class BindingListResponseItemProvisioning(BaseModel): - state: Optional[Literal["provisioning", "active"]] = None - """ - When a binding has been deployed to a majority of Cloudflare datacenters, the - binding will become active and can be used with its associated service. - """ - - -class BindingListResponseItem(BaseModel): - id: Optional[str] = None - """Identifier""" - - cidr: Optional[str] = None - """IP Prefix in Classless Inter-Domain Routing format.""" - - provisioning: Optional[BindingListResponseItemProvisioning] = None - """Status of a Service Binding's deployment to the Cloudflare network""" - - service_id: Optional[str] = None - """Identifier""" - - service_name: Optional[str] = None - """Name of a service running on the Cloudflare network""" - - -BindingListResponse = List[BindingListResponseItem] diff --git a/src/cloudflare/types/addressing/service_list_response.py b/src/cloudflare/types/addressing/service_list_response.py deleted file mode 100644 index 1a313302b14..00000000000 --- a/src/cloudflare/types/addressing/service_list_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["ServiceListResponse", "ServiceListResponseItem"] - - -class ServiceListResponseItem(BaseModel): - id: Optional[str] = None - """Identifier""" - - name: Optional[str] = None - """Name of a service running on the Cloudflare network""" - - -ServiceListResponse = List[ServiceListResponseItem] diff --git a/src/cloudflare/types/audit_log_audit_logs_get_account_audit_logs_response.py b/src/cloudflare/types/audit_log_audit_logs_get_account_audit_logs_response.py index 5cfa6d7dbfc..46aa44a6e5b 100644 --- a/src/cloudflare/types/audit_log_audit_logs_get_account_audit_logs_response.py +++ b/src/cloudflare/types/audit_log_audit_logs_get_account_audit_logs_response.py @@ -16,9 +16,9 @@ "UnionMember0ResultActor", "UnionMember0ResultOwner", "UnionMember0ResultResource", - "UofcNdOzAPIResponseCommon", - "UofcNdOzAPIResponseCommonError", - "UofcNdOzAPIResponseCommonMessage", + "Dgu8ktsMAPIResponseCommon", + "Dgu8ktsMapiResponseCommonError", + "Dgu8ktsMapiResponseCommonMessage", ] @@ -101,22 +101,22 @@ class UnionMember0(BaseModel): success: Optional[bool] = None -class UofcNdOzAPIResponseCommonError(BaseModel): +class Dgu8ktsMapiResponseCommonError(BaseModel): code: int message: str -class UofcNdOzAPIResponseCommonMessage(BaseModel): +class Dgu8ktsMapiResponseCommonMessage(BaseModel): code: int message: str -class UofcNdOzAPIResponseCommon(BaseModel): - errors: List[UofcNdOzAPIResponseCommonError] +class Dgu8ktsMAPIResponseCommon(BaseModel): + errors: List[Dgu8ktsMapiResponseCommonError] - messages: List[UofcNdOzAPIResponseCommonMessage] + messages: List[Dgu8ktsMapiResponseCommonMessage] result: Union[object, List[object], str] @@ -124,4 +124,4 @@ class UofcNdOzAPIResponseCommon(BaseModel): """Whether the API call was successful""" -AuditLogAuditLogsGetAccountAuditLogsResponse = Union[UnionMember0, UofcNdOzAPIResponseCommon] +AuditLogAuditLogsGetAccountAuditLogsResponse = Union[UnionMember0, Dgu8ktsMAPIResponseCommon] diff --git a/src/cloudflare/types/pcap_get_response.py b/src/cloudflare/types/pcap_get_response.py index 91072f6b760..b4719e0a786 100644 --- a/src/cloudflare/types/pcap_get_response.py +++ b/src/cloudflare/types/pcap_get_response.py @@ -7,14 +7,14 @@ __all__ = [ "PcapGetResponse", - "O1v8KFfTPcapsResponseSimple", - "O1v8KFfTPcapsResponseSimpleFilterV1", - "O1v8KFfTPcapsResponseFull", - "O1v8KFfTPcapsResponseFullFilterV1", + "OUcEeQdhPcapsResponseSimple", + "OUcEeQdhPcapsResponseSimpleFilterV1", + "OUcEeQdhPcapsResponseFull", + "OUcEeQdhPcapsResponseFullFilterV1", ] -class O1v8KFfTPcapsResponseSimpleFilterV1(BaseModel): +class OUcEeQdhPcapsResponseSimpleFilterV1(BaseModel): destination_address: Optional[str] = None """The destination IP address of the packet.""" @@ -31,11 +31,11 @@ class O1v8KFfTPcapsResponseSimpleFilterV1(BaseModel): """The source port of the packet.""" -class O1v8KFfTPcapsResponseSimple(BaseModel): +class OUcEeQdhPcapsResponseSimple(BaseModel): id: Optional[str] = None """The ID for the packet capture.""" - filter_v1: Optional[O1v8KFfTPcapsResponseSimpleFilterV1] = None + filter_v1: Optional[OUcEeQdhPcapsResponseSimpleFilterV1] = None """The packet capture filter. When this field is empty, all packets are captured.""" status: Optional[ @@ -62,7 +62,7 @@ class O1v8KFfTPcapsResponseSimple(BaseModel): """ -class O1v8KFfTPcapsResponseFullFilterV1(BaseModel): +class OUcEeQdhPcapsResponseFullFilterV1(BaseModel): destination_address: Optional[str] = None """The destination IP address of the packet.""" @@ -79,7 +79,7 @@ class O1v8KFfTPcapsResponseFullFilterV1(BaseModel): """The source port of the packet.""" -class O1v8KFfTPcapsResponseFull(BaseModel): +class OUcEeQdhPcapsResponseFull(BaseModel): id: Optional[str] = None """The ID for the packet capture.""" @@ -105,7 +105,7 @@ class O1v8KFfTPcapsResponseFull(BaseModel): This field only applies to `full` packet captures. """ - filter_v1: Optional[O1v8KFfTPcapsResponseFullFilterV1] = None + filter_v1: Optional[OUcEeQdhPcapsResponseFullFilterV1] = None """The packet capture filter. When this field is empty, all packets are captured.""" status: Optional[ @@ -132,4 +132,4 @@ class O1v8KFfTPcapsResponseFull(BaseModel): """ -PcapGetResponse = Union[O1v8KFfTPcapsResponseSimple, O1v8KFfTPcapsResponseFull] +PcapGetResponse = Union[OUcEeQdhPcapsResponseSimple, OUcEeQdhPcapsResponseFull] diff --git a/src/cloudflare/types/pcap_magic_pcap_collection_create_pcap_request_params.py b/src/cloudflare/types/pcap_magic_pcap_collection_create_pcap_request_params.py index a46732986ef..29f9d7115d1 100644 --- a/src/cloudflare/types/pcap_magic_pcap_collection_create_pcap_request_params.py +++ b/src/cloudflare/types/pcap_magic_pcap_collection_create_pcap_request_params.py @@ -7,14 +7,14 @@ __all__ = [ "PcapMagicPcapCollectionCreatePcapRequestParams", - "O1v8KFfTPcapsRequestSimple", - "O1v8KFfTPcapsRequestSimpleFilterV1", - "O1v8KFfTPcapsRequestFull", - "O1v8KFfTPcapsRequestFullFilterV1", + "OUcEeQdhPcapsRequestSimple", + "OUcEeQdhPcapsRequestSimpleFilterV1", + "OUcEeQdhPcapsRequestFull", + "OUcEeQdhPcapsRequestFullFilterV1", ] -class O1v8KFfTPcapsRequestSimple(TypedDict, total=False): +class OUcEeQdhPcapsRequestSimple(TypedDict, total=False): packet_limit: Required[float] """The limit of packets contained in a packet capture.""" @@ -31,11 +31,11 @@ class O1v8KFfTPcapsRequestSimple(TypedDict, total=False): non-sampled packets. """ - filter_v1: O1v8KFfTPcapsRequestSimpleFilterV1 + filter_v1: OUcEeQdhPcapsRequestSimpleFilterV1 """The packet capture filter. When this field is empty, all packets are captured.""" -class O1v8KFfTPcapsRequestSimpleFilterV1(TypedDict, total=False): +class OUcEeQdhPcapsRequestSimpleFilterV1(TypedDict, total=False): destination_address: str """The destination IP address of the packet.""" @@ -52,7 +52,7 @@ class O1v8KFfTPcapsRequestSimpleFilterV1(TypedDict, total=False): """The source port of the packet.""" -class O1v8KFfTPcapsRequestFull(TypedDict, total=False): +class OUcEeQdhPcapsRequestFull(TypedDict, total=False): colo_name: Required[str] """The name of the data center used for the packet capture. @@ -82,14 +82,14 @@ class O1v8KFfTPcapsRequestFull(TypedDict, total=False): This field only applies to `full` packet captures. """ - filter_v1: O1v8KFfTPcapsRequestFullFilterV1 + filter_v1: OUcEeQdhPcapsRequestFullFilterV1 """The packet capture filter. When this field is empty, all packets are captured.""" packet_limit: float """The limit of packets contained in a packet capture.""" -class O1v8KFfTPcapsRequestFullFilterV1(TypedDict, total=False): +class OUcEeQdhPcapsRequestFullFilterV1(TypedDict, total=False): destination_address: str """The destination IP address of the packet.""" @@ -106,4 +106,4 @@ class O1v8KFfTPcapsRequestFullFilterV1(TypedDict, total=False): """The source port of the packet.""" -PcapMagicPcapCollectionCreatePcapRequestParams = Union[O1v8KFfTPcapsRequestSimple, O1v8KFfTPcapsRequestFull] +PcapMagicPcapCollectionCreatePcapRequestParams = Union[OUcEeQdhPcapsRequestSimple, OUcEeQdhPcapsRequestFull] diff --git a/src/cloudflare/types/pcap_magic_pcap_collection_create_pcap_request_response.py b/src/cloudflare/types/pcap_magic_pcap_collection_create_pcap_request_response.py index cbc59fbbc88..e775c706fc6 100644 --- a/src/cloudflare/types/pcap_magic_pcap_collection_create_pcap_request_response.py +++ b/src/cloudflare/types/pcap_magic_pcap_collection_create_pcap_request_response.py @@ -7,14 +7,14 @@ __all__ = [ "PcapMagicPcapCollectionCreatePcapRequestResponse", - "O1v8KFfTPcapsResponseSimple", - "O1v8KFfTPcapsResponseSimpleFilterV1", - "O1v8KFfTPcapsResponseFull", - "O1v8KFfTPcapsResponseFullFilterV1", + "OUcEeQdhPcapsResponseSimple", + "OUcEeQdhPcapsResponseSimpleFilterV1", + "OUcEeQdhPcapsResponseFull", + "OUcEeQdhPcapsResponseFullFilterV1", ] -class O1v8KFfTPcapsResponseSimpleFilterV1(BaseModel): +class OUcEeQdhPcapsResponseSimpleFilterV1(BaseModel): destination_address: Optional[str] = None """The destination IP address of the packet.""" @@ -31,11 +31,11 @@ class O1v8KFfTPcapsResponseSimpleFilterV1(BaseModel): """The source port of the packet.""" -class O1v8KFfTPcapsResponseSimple(BaseModel): +class OUcEeQdhPcapsResponseSimple(BaseModel): id: Optional[str] = None """The ID for the packet capture.""" - filter_v1: Optional[O1v8KFfTPcapsResponseSimpleFilterV1] = None + filter_v1: Optional[OUcEeQdhPcapsResponseSimpleFilterV1] = None """The packet capture filter. When this field is empty, all packets are captured.""" status: Optional[ @@ -62,7 +62,7 @@ class O1v8KFfTPcapsResponseSimple(BaseModel): """ -class O1v8KFfTPcapsResponseFullFilterV1(BaseModel): +class OUcEeQdhPcapsResponseFullFilterV1(BaseModel): destination_address: Optional[str] = None """The destination IP address of the packet.""" @@ -79,7 +79,7 @@ class O1v8KFfTPcapsResponseFullFilterV1(BaseModel): """The source port of the packet.""" -class O1v8KFfTPcapsResponseFull(BaseModel): +class OUcEeQdhPcapsResponseFull(BaseModel): id: Optional[str] = None """The ID for the packet capture.""" @@ -105,7 +105,7 @@ class O1v8KFfTPcapsResponseFull(BaseModel): This field only applies to `full` packet captures. """ - filter_v1: Optional[O1v8KFfTPcapsResponseFullFilterV1] = None + filter_v1: Optional[OUcEeQdhPcapsResponseFullFilterV1] = None """The packet capture filter. When this field is empty, all packets are captured.""" status: Optional[ @@ -132,4 +132,4 @@ class O1v8KFfTPcapsResponseFull(BaseModel): """ -PcapMagicPcapCollectionCreatePcapRequestResponse = Union[O1v8KFfTPcapsResponseSimple, O1v8KFfTPcapsResponseFull] +PcapMagicPcapCollectionCreatePcapRequestResponse = Union[OUcEeQdhPcapsResponseSimple, OUcEeQdhPcapsResponseFull] diff --git a/src/cloudflare/types/pcap_magic_pcap_collection_list_packet_capture_requests_response.py b/src/cloudflare/types/pcap_magic_pcap_collection_list_packet_capture_requests_response.py index 398c306bae6..5079d317525 100644 --- a/src/cloudflare/types/pcap_magic_pcap_collection_list_packet_capture_requests_response.py +++ b/src/cloudflare/types/pcap_magic_pcap_collection_list_packet_capture_requests_response.py @@ -8,14 +8,14 @@ __all__ = [ "PcapMagicPcapCollectionListPacketCaptureRequestsResponse", "PcapMagicPcapCollectionListPacketCaptureRequestsResponseItem", - "PcapMagicPcapCollectionListPacketCaptureRequestsResponseItemO1v8KFfTPcapsResponseSimple", - "PcapMagicPcapCollectionListPacketCaptureRequestsResponseItemO1v8KFfTPcapsResponseSimpleFilterV1", - "PcapMagicPcapCollectionListPacketCaptureRequestsResponseItemO1v8KFfTPcapsResponseFull", - "PcapMagicPcapCollectionListPacketCaptureRequestsResponseItemO1v8KFfTPcapsResponseFullFilterV1", + "PcapMagicPcapCollectionListPacketCaptureRequestsResponseItemOUcEeQdhPcapsResponseSimple", + "PcapMagicPcapCollectionListPacketCaptureRequestsResponseItemOUcEeQdhPcapsResponseSimpleFilterV1", + "PcapMagicPcapCollectionListPacketCaptureRequestsResponseItemOUcEeQdhPcapsResponseFull", + "PcapMagicPcapCollectionListPacketCaptureRequestsResponseItemOUcEeQdhPcapsResponseFullFilterV1", ] -class PcapMagicPcapCollectionListPacketCaptureRequestsResponseItemO1v8KFfTPcapsResponseSimpleFilterV1(BaseModel): +class PcapMagicPcapCollectionListPacketCaptureRequestsResponseItemOUcEeQdhPcapsResponseSimpleFilterV1(BaseModel): destination_address: Optional[str] = None """The destination IP address of the packet.""" @@ -32,12 +32,12 @@ class PcapMagicPcapCollectionListPacketCaptureRequestsResponseItemO1v8KFfTPcapsR """The source port of the packet.""" -class PcapMagicPcapCollectionListPacketCaptureRequestsResponseItemO1v8KFfTPcapsResponseSimple(BaseModel): +class PcapMagicPcapCollectionListPacketCaptureRequestsResponseItemOUcEeQdhPcapsResponseSimple(BaseModel): id: Optional[str] = None """The ID for the packet capture.""" filter_v1: Optional[ - PcapMagicPcapCollectionListPacketCaptureRequestsResponseItemO1v8KFfTPcapsResponseSimpleFilterV1 + PcapMagicPcapCollectionListPacketCaptureRequestsResponseItemOUcEeQdhPcapsResponseSimpleFilterV1 ] = None """The packet capture filter. When this field is empty, all packets are captured.""" @@ -65,7 +65,7 @@ class PcapMagicPcapCollectionListPacketCaptureRequestsResponseItemO1v8KFfTPcapsR """ -class PcapMagicPcapCollectionListPacketCaptureRequestsResponseItemO1v8KFfTPcapsResponseFullFilterV1(BaseModel): +class PcapMagicPcapCollectionListPacketCaptureRequestsResponseItemOUcEeQdhPcapsResponseFullFilterV1(BaseModel): destination_address: Optional[str] = None """The destination IP address of the packet.""" @@ -82,7 +82,7 @@ class PcapMagicPcapCollectionListPacketCaptureRequestsResponseItemO1v8KFfTPcapsR """The source port of the packet.""" -class PcapMagicPcapCollectionListPacketCaptureRequestsResponseItemO1v8KFfTPcapsResponseFull(BaseModel): +class PcapMagicPcapCollectionListPacketCaptureRequestsResponseItemOUcEeQdhPcapsResponseFull(BaseModel): id: Optional[str] = None """The ID for the packet capture.""" @@ -109,7 +109,7 @@ class PcapMagicPcapCollectionListPacketCaptureRequestsResponseItemO1v8KFfTPcapsR """ filter_v1: Optional[ - PcapMagicPcapCollectionListPacketCaptureRequestsResponseItemO1v8KFfTPcapsResponseFullFilterV1 + PcapMagicPcapCollectionListPacketCaptureRequestsResponseItemOUcEeQdhPcapsResponseFullFilterV1 ] = None """The packet capture filter. When this field is empty, all packets are captured.""" @@ -138,8 +138,8 @@ class PcapMagicPcapCollectionListPacketCaptureRequestsResponseItemO1v8KFfTPcapsR PcapMagicPcapCollectionListPacketCaptureRequestsResponseItem = Union[ - PcapMagicPcapCollectionListPacketCaptureRequestsResponseItemO1v8KFfTPcapsResponseSimple, - PcapMagicPcapCollectionListPacketCaptureRequestsResponseItemO1v8KFfTPcapsResponseFull, + PcapMagicPcapCollectionListPacketCaptureRequestsResponseItemOUcEeQdhPcapsResponseSimple, + PcapMagicPcapCollectionListPacketCaptureRequestsResponseItemOUcEeQdhPcapsResponseFull, ] PcapMagicPcapCollectionListPacketCaptureRequestsResponse = List[ diff --git a/src/cloudflare/types/purge_cach_zone_purge_params.py b/src/cloudflare/types/purge_cach_zone_purge_params.py index 0682ee47ff8..b8b2415d085 100644 --- a/src/cloudflare/types/purge_cach_zone_purge_params.py +++ b/src/cloudflare/types/purge_cach_zone_purge_params.py @@ -7,15 +7,15 @@ __all__ = [ "PurgeCachZonePurgeParams", - "AQxFrdVfFlex", - "AQxFrdVfEverything", - "AQxFrdVfFiles", - "AQxFrdVfFilesFile", - "AQxFrdVfFilesFileAQxFrdVfURLAndHeaders", + "N2QfWbz7Flex", + "N2QfWbz7Everything", + "N2QfWbz7Files", + "N2QfWbz7FilesFile", + "N2QfWbz7FilesFileN2QfWbz7URLAndHeaders", ] -class AQxFrdVfFlex(TypedDict, total=False): +class N2QfWbz7Flex(TypedDict, total=False): hosts: List[str] prefixes: List[str] @@ -23,20 +23,20 @@ class AQxFrdVfFlex(TypedDict, total=False): tags: List[str] -class AQxFrdVfEverything(TypedDict, total=False): +class N2QfWbz7Everything(TypedDict, total=False): purge_everything: bool -class AQxFrdVfFiles(TypedDict, total=False): - files: List[AQxFrdVfFilesFile] +class N2QfWbz7Files(TypedDict, total=False): + files: List[N2QfWbz7FilesFile] -class AQxFrdVfFilesFileAQxFrdVfURLAndHeaders(TypedDict, total=False): +class N2QfWbz7FilesFileN2QfWbz7URLAndHeaders(TypedDict, total=False): headers: object url: str -AQxFrdVfFilesFile = Union[str, AQxFrdVfFilesFileAQxFrdVfURLAndHeaders] +N2QfWbz7FilesFile = Union[str, N2QfWbz7FilesFileN2QfWbz7URLAndHeaders] -PurgeCachZonePurgeParams = Union[AQxFrdVfFlex, AQxFrdVfEverything, AQxFrdVfFiles] +PurgeCachZonePurgeParams = Union[N2QfWbz7Flex, N2QfWbz7Everything, N2QfWbz7Files] diff --git a/src/cloudflare/types/users/audit_log_audit_logs_get_user_audit_logs_response.py b/src/cloudflare/types/users/audit_log_audit_logs_get_user_audit_logs_response.py index ad1c9b7072d..a64771fc716 100644 --- a/src/cloudflare/types/users/audit_log_audit_logs_get_user_audit_logs_response.py +++ b/src/cloudflare/types/users/audit_log_audit_logs_get_user_audit_logs_response.py @@ -16,9 +16,9 @@ "UnionMember0ResultActor", "UnionMember0ResultOwner", "UnionMember0ResultResource", - "UofcNdOzAPIResponseCommon", - "UofcNdOzAPIResponseCommonError", - "UofcNdOzAPIResponseCommonMessage", + "Dgu8ktsMAPIResponseCommon", + "Dgu8ktsMapiResponseCommonError", + "Dgu8ktsMapiResponseCommonMessage", ] @@ -101,22 +101,22 @@ class UnionMember0(BaseModel): success: Optional[bool] = None -class UofcNdOzAPIResponseCommonError(BaseModel): +class Dgu8ktsMapiResponseCommonError(BaseModel): code: int message: str -class UofcNdOzAPIResponseCommonMessage(BaseModel): +class Dgu8ktsMapiResponseCommonMessage(BaseModel): code: int message: str -class UofcNdOzAPIResponseCommon(BaseModel): - errors: List[UofcNdOzAPIResponseCommonError] +class Dgu8ktsMAPIResponseCommon(BaseModel): + errors: List[Dgu8ktsMapiResponseCommonError] - messages: List[UofcNdOzAPIResponseCommonMessage] + messages: List[Dgu8ktsMapiResponseCommonMessage] result: Union[object, List[object], str] @@ -124,4 +124,4 @@ class UofcNdOzAPIResponseCommon(BaseModel): """Whether the API call was successful""" -AuditLogAuditLogsGetUserAuditLogsResponse = Union[UnionMember0, UofcNdOzAPIResponseCommon] +AuditLogAuditLogsGetUserAuditLogsResponse = Union[UnionMember0, Dgu8ktsMAPIResponseCommon] diff --git a/tests/api_resources/addresses/address_maps/test_accounts.py b/tests/api_resources/addresses/address_maps/test_accounts.py deleted file mode 100644 index 25154eae13d..00000000000 --- a/tests/api_resources/addresses/address_maps/test_accounts.py +++ /dev/null @@ -1,286 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from __future__ import annotations - -import os -from typing import Any, Optional, cast - -import pytest - -from cloudflare import Cloudflare, AsyncCloudflare -from tests.utils import assert_matches_type -from cloudflare.types.addresses.address_maps import AccountDeleteResponse, AccountUpdateResponse - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestAccounts: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @pytest.mark.skip() - @parametrize - def test_method_update(self, client: Cloudflare) -> None: - account = client.addresses.address_maps.accounts.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier1="023e105f4ecef8ad9ca31a8372d0c353", - address_map_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(Optional[AccountUpdateResponse], account, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_raw_response_update(self, client: Cloudflare) -> None: - response = client.addresses.address_maps.accounts.with_raw_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier1="023e105f4ecef8ad9ca31a8372d0c353", - address_map_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - account = response.parse() - assert_matches_type(Optional[AccountUpdateResponse], account, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_streaming_response_update(self, client: Cloudflare) -> None: - with client.addresses.address_maps.accounts.with_streaming_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier1="023e105f4ecef8ad9ca31a8372d0c353", - address_map_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - account = response.parse() - assert_matches_type(Optional[AccountUpdateResponse], account, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - def test_path_params_update(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier1` but received ''"): - client.addresses.address_maps.accounts.with_raw_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier1="", - address_map_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - with pytest.raises( - ValueError, match=r"Expected a non-empty value for `address_map_identifier` but received ''" - ): - client.addresses.address_maps.accounts.with_raw_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier1="023e105f4ecef8ad9ca31a8372d0c353", - address_map_identifier="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"): - client.addresses.address_maps.accounts.with_raw_response.update( - "", - account_identifier1="023e105f4ecef8ad9ca31a8372d0c353", - address_map_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - @pytest.mark.skip() - @parametrize - def test_method_delete(self, client: Cloudflare) -> None: - account = client.addresses.address_maps.accounts.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier1="023e105f4ecef8ad9ca31a8372d0c353", - address_map_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(Optional[AccountDeleteResponse], account, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_raw_response_delete(self, client: Cloudflare) -> None: - response = client.addresses.address_maps.accounts.with_raw_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier1="023e105f4ecef8ad9ca31a8372d0c353", - address_map_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - account = response.parse() - assert_matches_type(Optional[AccountDeleteResponse], account, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_streaming_response_delete(self, client: Cloudflare) -> None: - with client.addresses.address_maps.accounts.with_streaming_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier1="023e105f4ecef8ad9ca31a8372d0c353", - address_map_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - account = response.parse() - assert_matches_type(Optional[AccountDeleteResponse], account, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - def test_path_params_delete(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier1` but received ''"): - client.addresses.address_maps.accounts.with_raw_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier1="", - address_map_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - with pytest.raises( - ValueError, match=r"Expected a non-empty value for `address_map_identifier` but received ''" - ): - client.addresses.address_maps.accounts.with_raw_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier1="023e105f4ecef8ad9ca31a8372d0c353", - address_map_identifier="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"): - client.addresses.address_maps.accounts.with_raw_response.delete( - "", - account_identifier1="023e105f4ecef8ad9ca31a8372d0c353", - address_map_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - -class TestAsyncAccounts: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @pytest.mark.skip() - @parametrize - async def test_method_update(self, async_client: AsyncCloudflare) -> None: - account = await async_client.addresses.address_maps.accounts.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier1="023e105f4ecef8ad9ca31a8372d0c353", - address_map_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(Optional[AccountUpdateResponse], account, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: - response = await async_client.addresses.address_maps.accounts.with_raw_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier1="023e105f4ecef8ad9ca31a8372d0c353", - address_map_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - account = await response.parse() - assert_matches_type(Optional[AccountUpdateResponse], account, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: - async with async_client.addresses.address_maps.accounts.with_streaming_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier1="023e105f4ecef8ad9ca31a8372d0c353", - address_map_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - account = await response.parse() - assert_matches_type(Optional[AccountUpdateResponse], account, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier1` but received ''"): - await async_client.addresses.address_maps.accounts.with_raw_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier1="", - address_map_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - with pytest.raises( - ValueError, match=r"Expected a non-empty value for `address_map_identifier` but received ''" - ): - await async_client.addresses.address_maps.accounts.with_raw_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier1="023e105f4ecef8ad9ca31a8372d0c353", - address_map_identifier="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"): - await async_client.addresses.address_maps.accounts.with_raw_response.update( - "", - account_identifier1="023e105f4ecef8ad9ca31a8372d0c353", - address_map_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - @pytest.mark.skip() - @parametrize - async def test_method_delete(self, async_client: AsyncCloudflare) -> None: - account = await async_client.addresses.address_maps.accounts.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier1="023e105f4ecef8ad9ca31a8372d0c353", - address_map_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(Optional[AccountDeleteResponse], account, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: - response = await async_client.addresses.address_maps.accounts.with_raw_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier1="023e105f4ecef8ad9ca31a8372d0c353", - address_map_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - account = await response.parse() - assert_matches_type(Optional[AccountDeleteResponse], account, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: - async with async_client.addresses.address_maps.accounts.with_streaming_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier1="023e105f4ecef8ad9ca31a8372d0c353", - address_map_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - account = await response.parse() - assert_matches_type(Optional[AccountDeleteResponse], account, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier1` but received ''"): - await async_client.addresses.address_maps.accounts.with_raw_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier1="", - address_map_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - with pytest.raises( - ValueError, match=r"Expected a non-empty value for `address_map_identifier` but received ''" - ): - await async_client.addresses.address_maps.accounts.with_raw_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier1="023e105f4ecef8ad9ca31a8372d0c353", - address_map_identifier="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"): - await async_client.addresses.address_maps.accounts.with_raw_response.delete( - "", - account_identifier1="023e105f4ecef8ad9ca31a8372d0c353", - address_map_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) diff --git a/tests/api_resources/addresses/address_maps/test_ips.py b/tests/api_resources/addresses/address_maps/test_ips.py deleted file mode 100644 index aa2c813c2fa..00000000000 --- a/tests/api_resources/addresses/address_maps/test_ips.py +++ /dev/null @@ -1,286 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from __future__ import annotations - -import os -from typing import Any, Optional, cast - -import pytest - -from cloudflare import Cloudflare, AsyncCloudflare -from tests.utils import assert_matches_type -from cloudflare.types.addresses.address_maps import IPDeleteResponse, IPUpdateResponse - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestIPs: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @pytest.mark.skip() - @parametrize - def test_method_update(self, client: Cloudflare) -> None: - ip = client.addresses.address_maps.ips.update( - "192.0.2.1", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - address_map_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(Optional[IPUpdateResponse], ip, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_raw_response_update(self, client: Cloudflare) -> None: - response = client.addresses.address_maps.ips.with_raw_response.update( - "192.0.2.1", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - address_map_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - ip = response.parse() - assert_matches_type(Optional[IPUpdateResponse], ip, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_streaming_response_update(self, client: Cloudflare) -> None: - with client.addresses.address_maps.ips.with_streaming_response.update( - "192.0.2.1", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - address_map_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - ip = response.parse() - assert_matches_type(Optional[IPUpdateResponse], ip, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - def test_path_params_update(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"): - client.addresses.address_maps.ips.with_raw_response.update( - "192.0.2.1", - account_identifier="", - address_map_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - with pytest.raises( - ValueError, match=r"Expected a non-empty value for `address_map_identifier` but received ''" - ): - client.addresses.address_maps.ips.with_raw_response.update( - "192.0.2.1", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - address_map_identifier="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ip_address` but received ''"): - client.addresses.address_maps.ips.with_raw_response.update( - "", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - address_map_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - @pytest.mark.skip() - @parametrize - def test_method_delete(self, client: Cloudflare) -> None: - ip = client.addresses.address_maps.ips.delete( - "192.0.2.1", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - address_map_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(Optional[IPDeleteResponse], ip, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_raw_response_delete(self, client: Cloudflare) -> None: - response = client.addresses.address_maps.ips.with_raw_response.delete( - "192.0.2.1", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - address_map_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - ip = response.parse() - assert_matches_type(Optional[IPDeleteResponse], ip, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_streaming_response_delete(self, client: Cloudflare) -> None: - with client.addresses.address_maps.ips.with_streaming_response.delete( - "192.0.2.1", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - address_map_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - ip = response.parse() - assert_matches_type(Optional[IPDeleteResponse], ip, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - def test_path_params_delete(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"): - client.addresses.address_maps.ips.with_raw_response.delete( - "192.0.2.1", - account_identifier="", - address_map_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - with pytest.raises( - ValueError, match=r"Expected a non-empty value for `address_map_identifier` but received ''" - ): - client.addresses.address_maps.ips.with_raw_response.delete( - "192.0.2.1", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - address_map_identifier="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ip_address` but received ''"): - client.addresses.address_maps.ips.with_raw_response.delete( - "", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - address_map_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - -class TestAsyncIPs: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @pytest.mark.skip() - @parametrize - async def test_method_update(self, async_client: AsyncCloudflare) -> None: - ip = await async_client.addresses.address_maps.ips.update( - "192.0.2.1", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - address_map_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(Optional[IPUpdateResponse], ip, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: - response = await async_client.addresses.address_maps.ips.with_raw_response.update( - "192.0.2.1", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - address_map_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - ip = await response.parse() - assert_matches_type(Optional[IPUpdateResponse], ip, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: - async with async_client.addresses.address_maps.ips.with_streaming_response.update( - "192.0.2.1", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - address_map_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - ip = await response.parse() - assert_matches_type(Optional[IPUpdateResponse], ip, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"): - await async_client.addresses.address_maps.ips.with_raw_response.update( - "192.0.2.1", - account_identifier="", - address_map_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - with pytest.raises( - ValueError, match=r"Expected a non-empty value for `address_map_identifier` but received ''" - ): - await async_client.addresses.address_maps.ips.with_raw_response.update( - "192.0.2.1", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - address_map_identifier="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ip_address` but received ''"): - await async_client.addresses.address_maps.ips.with_raw_response.update( - "", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - address_map_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - @pytest.mark.skip() - @parametrize - async def test_method_delete(self, async_client: AsyncCloudflare) -> None: - ip = await async_client.addresses.address_maps.ips.delete( - "192.0.2.1", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - address_map_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(Optional[IPDeleteResponse], ip, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: - response = await async_client.addresses.address_maps.ips.with_raw_response.delete( - "192.0.2.1", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - address_map_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - ip = await response.parse() - assert_matches_type(Optional[IPDeleteResponse], ip, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: - async with async_client.addresses.address_maps.ips.with_streaming_response.delete( - "192.0.2.1", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - address_map_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - ip = await response.parse() - assert_matches_type(Optional[IPDeleteResponse], ip, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"): - await async_client.addresses.address_maps.ips.with_raw_response.delete( - "192.0.2.1", - account_identifier="", - address_map_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - with pytest.raises( - ValueError, match=r"Expected a non-empty value for `address_map_identifier` but received ''" - ): - await async_client.addresses.address_maps.ips.with_raw_response.delete( - "192.0.2.1", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - address_map_identifier="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `ip_address` but received ''"): - await async_client.addresses.address_maps.ips.with_raw_response.delete( - "", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - address_map_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) diff --git a/tests/api_resources/addresses/address_maps/test_zones.py b/tests/api_resources/addresses/address_maps/test_zones.py deleted file mode 100644 index dedeca0b3ad..00000000000 --- a/tests/api_resources/addresses/address_maps/test_zones.py +++ /dev/null @@ -1,286 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from __future__ import annotations - -import os -from typing import Any, Optional, cast - -import pytest - -from cloudflare import Cloudflare, AsyncCloudflare -from tests.utils import assert_matches_type -from cloudflare.types.addresses.address_maps import ZoneDeleteResponse, ZoneUpdateResponse - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestZones: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @pytest.mark.skip() - @parametrize - def test_method_update(self, client: Cloudflare) -> None: - zone = client.addresses.address_maps.zones.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - address_map_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(Optional[ZoneUpdateResponse], zone, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_raw_response_update(self, client: Cloudflare) -> None: - response = client.addresses.address_maps.zones.with_raw_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - address_map_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - zone = response.parse() - assert_matches_type(Optional[ZoneUpdateResponse], zone, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_streaming_response_update(self, client: Cloudflare) -> None: - with client.addresses.address_maps.zones.with_streaming_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - address_map_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - zone = response.parse() - assert_matches_type(Optional[ZoneUpdateResponse], zone, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - def test_path_params_update(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"): - client.addresses.address_maps.zones.with_raw_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="", - address_map_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - with pytest.raises( - ValueError, match=r"Expected a non-empty value for `address_map_identifier` but received ''" - ): - client.addresses.address_maps.zones.with_raw_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - address_map_identifier="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_identifier` but received ''"): - client.addresses.address_maps.zones.with_raw_response.update( - "", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - address_map_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - @pytest.mark.skip() - @parametrize - def test_method_delete(self, client: Cloudflare) -> None: - zone = client.addresses.address_maps.zones.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - address_map_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(Optional[ZoneDeleteResponse], zone, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_raw_response_delete(self, client: Cloudflare) -> None: - response = client.addresses.address_maps.zones.with_raw_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - address_map_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - zone = response.parse() - assert_matches_type(Optional[ZoneDeleteResponse], zone, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_streaming_response_delete(self, client: Cloudflare) -> None: - with client.addresses.address_maps.zones.with_streaming_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - address_map_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - zone = response.parse() - assert_matches_type(Optional[ZoneDeleteResponse], zone, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - def test_path_params_delete(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"): - client.addresses.address_maps.zones.with_raw_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="", - address_map_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - with pytest.raises( - ValueError, match=r"Expected a non-empty value for `address_map_identifier` but received ''" - ): - client.addresses.address_maps.zones.with_raw_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - address_map_identifier="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_identifier` but received ''"): - client.addresses.address_maps.zones.with_raw_response.delete( - "", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - address_map_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - -class TestAsyncZones: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @pytest.mark.skip() - @parametrize - async def test_method_update(self, async_client: AsyncCloudflare) -> None: - zone = await async_client.addresses.address_maps.zones.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - address_map_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(Optional[ZoneUpdateResponse], zone, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: - response = await async_client.addresses.address_maps.zones.with_raw_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - address_map_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - zone = await response.parse() - assert_matches_type(Optional[ZoneUpdateResponse], zone, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: - async with async_client.addresses.address_maps.zones.with_streaming_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - address_map_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - zone = await response.parse() - assert_matches_type(Optional[ZoneUpdateResponse], zone, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"): - await async_client.addresses.address_maps.zones.with_raw_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="", - address_map_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - with pytest.raises( - ValueError, match=r"Expected a non-empty value for `address_map_identifier` but received ''" - ): - await async_client.addresses.address_maps.zones.with_raw_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - address_map_identifier="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_identifier` but received ''"): - await async_client.addresses.address_maps.zones.with_raw_response.update( - "", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - address_map_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - @pytest.mark.skip() - @parametrize - async def test_method_delete(self, async_client: AsyncCloudflare) -> None: - zone = await async_client.addresses.address_maps.zones.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - address_map_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(Optional[ZoneDeleteResponse], zone, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: - response = await async_client.addresses.address_maps.zones.with_raw_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - address_map_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - zone = await response.parse() - assert_matches_type(Optional[ZoneDeleteResponse], zone, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: - async with async_client.addresses.address_maps.zones.with_streaming_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - address_map_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - zone = await response.parse() - assert_matches_type(Optional[ZoneDeleteResponse], zone, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"): - await async_client.addresses.address_maps.zones.with_raw_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="", - address_map_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - with pytest.raises( - ValueError, match=r"Expected a non-empty value for `address_map_identifier` but received ''" - ): - await async_client.addresses.address_maps.zones.with_raw_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - address_map_identifier="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_identifier` but received ''"): - await async_client.addresses.address_maps.zones.with_raw_response.delete( - "", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - address_map_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) diff --git a/tests/api_resources/addresses/loa_documents/test_downloads.py b/tests/api_resources/addresses/loa_documents/test_downloads.py deleted file mode 100644 index 8f6cdcbd556..00000000000 --- a/tests/api_resources/addresses/loa_documents/test_downloads.py +++ /dev/null @@ -1,129 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from cloudflare import Cloudflare, AsyncCloudflare -from tests.utils import assert_matches_type - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestDownloads: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @pytest.mark.skip() - @parametrize - def test_method_list(self, client: Cloudflare) -> None: - download = client.addresses.loa_documents.downloads.list( - "d933b1530bc56c9953cf8ce166da8004", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(object, download, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.addresses.loa_documents.downloads.with_raw_response.list( - "d933b1530bc56c9953cf8ce166da8004", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - download = response.parse() - assert_matches_type(object, download, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.addresses.loa_documents.downloads.with_streaming_response.list( - "d933b1530bc56c9953cf8ce166da8004", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - download = response.parse() - assert_matches_type(object, download, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - def test_path_params_list(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"): - client.addresses.loa_documents.downloads.with_raw_response.list( - "d933b1530bc56c9953cf8ce166da8004", - account_identifier="", - ) - - with pytest.raises( - ValueError, match=r"Expected a non-empty value for `loa_document_identifier` but received ''" - ): - client.addresses.loa_documents.downloads.with_raw_response.list( - "", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - -class TestAsyncDownloads: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @pytest.mark.skip() - @parametrize - async def test_method_list(self, async_client: AsyncCloudflare) -> None: - download = await async_client.addresses.loa_documents.downloads.list( - "d933b1530bc56c9953cf8ce166da8004", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(object, download, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.addresses.loa_documents.downloads.with_raw_response.list( - "d933b1530bc56c9953cf8ce166da8004", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - download = await response.parse() - assert_matches_type(object, download, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.addresses.loa_documents.downloads.with_streaming_response.list( - "d933b1530bc56c9953cf8ce166da8004", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - download = await response.parse() - assert_matches_type(object, download, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"): - await async_client.addresses.loa_documents.downloads.with_raw_response.list( - "d933b1530bc56c9953cf8ce166da8004", - account_identifier="", - ) - - with pytest.raises( - ValueError, match=r"Expected a non-empty value for `loa_document_identifier` but received ''" - ): - await async_client.addresses.loa_documents.downloads.with_raw_response.list( - "", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) diff --git a/tests/api_resources/addresses/prefixes/bgps/test_statuses.py b/tests/api_resources/addresses/prefixes/bgps/test_statuses.py deleted file mode 100644 index 745ce661a74..00000000000 --- a/tests/api_resources/addresses/prefixes/bgps/test_statuses.py +++ /dev/null @@ -1,311 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from cloudflare import Cloudflare, AsyncCloudflare -from tests.utils import assert_matches_type -from cloudflare.types.addresses.prefixes.bgps import ( - StatusIPAddressManagementDynamicAdvertisementGetAdvertisementStatusResponse, - StatusIPAddressManagementDynamicAdvertisementUpdatePrefixDynamicAdvertisementStatusResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestStatuses: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @pytest.mark.skip() - @parametrize - def test_method_ip_address_management_dynamic_advertisement_get_advertisement_status( - self, client: Cloudflare - ) -> None: - status = client.addresses.prefixes.bgps.statuses.ip_address_management_dynamic_advertisement_get_advertisement_status( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type( - StatusIPAddressManagementDynamicAdvertisementGetAdvertisementStatusResponse, status, path=["response"] - ) - - @pytest.mark.skip() - @parametrize - def test_raw_response_ip_address_management_dynamic_advertisement_get_advertisement_status( - self, client: Cloudflare - ) -> None: - response = client.addresses.prefixes.bgps.statuses.with_raw_response.ip_address_management_dynamic_advertisement_get_advertisement_status( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - status = response.parse() - assert_matches_type( - StatusIPAddressManagementDynamicAdvertisementGetAdvertisementStatusResponse, status, path=["response"] - ) - - @pytest.mark.skip() - @parametrize - def test_streaming_response_ip_address_management_dynamic_advertisement_get_advertisement_status( - self, client: Cloudflare - ) -> None: - with client.addresses.prefixes.bgps.statuses.with_streaming_response.ip_address_management_dynamic_advertisement_get_advertisement_status( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - status = response.parse() - assert_matches_type( - StatusIPAddressManagementDynamicAdvertisementGetAdvertisementStatusResponse, status, path=["response"] - ) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - def test_path_params_ip_address_management_dynamic_advertisement_get_advertisement_status( - self, client: Cloudflare - ) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"): - client.addresses.prefixes.bgps.statuses.with_raw_response.ip_address_management_dynamic_advertisement_get_advertisement_status( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_identifier` but received ''"): - client.addresses.prefixes.bgps.statuses.with_raw_response.ip_address_management_dynamic_advertisement_get_advertisement_status( - "", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - @pytest.mark.skip() - @parametrize - def test_method_ip_address_management_dynamic_advertisement_update_prefix_dynamic_advertisement_status( - self, client: Cloudflare - ) -> None: - status = client.addresses.prefixes.bgps.statuses.ip_address_management_dynamic_advertisement_update_prefix_dynamic_advertisement_status( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - advertised=True, - ) - assert_matches_type( - StatusIPAddressManagementDynamicAdvertisementUpdatePrefixDynamicAdvertisementStatusResponse, - status, - path=["response"], - ) - - @pytest.mark.skip() - @parametrize - def test_raw_response_ip_address_management_dynamic_advertisement_update_prefix_dynamic_advertisement_status( - self, client: Cloudflare - ) -> None: - response = client.addresses.prefixes.bgps.statuses.with_raw_response.ip_address_management_dynamic_advertisement_update_prefix_dynamic_advertisement_status( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - advertised=True, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - status = response.parse() - assert_matches_type( - StatusIPAddressManagementDynamicAdvertisementUpdatePrefixDynamicAdvertisementStatusResponse, - status, - path=["response"], - ) - - @pytest.mark.skip() - @parametrize - def test_streaming_response_ip_address_management_dynamic_advertisement_update_prefix_dynamic_advertisement_status( - self, client: Cloudflare - ) -> None: - with client.addresses.prefixes.bgps.statuses.with_streaming_response.ip_address_management_dynamic_advertisement_update_prefix_dynamic_advertisement_status( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - advertised=True, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - status = response.parse() - assert_matches_type( - StatusIPAddressManagementDynamicAdvertisementUpdatePrefixDynamicAdvertisementStatusResponse, - status, - path=["response"], - ) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - def test_path_params_ip_address_management_dynamic_advertisement_update_prefix_dynamic_advertisement_status( - self, client: Cloudflare - ) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"): - client.addresses.prefixes.bgps.statuses.with_raw_response.ip_address_management_dynamic_advertisement_update_prefix_dynamic_advertisement_status( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="", - advertised=True, - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_identifier` but received ''"): - client.addresses.prefixes.bgps.statuses.with_raw_response.ip_address_management_dynamic_advertisement_update_prefix_dynamic_advertisement_status( - "", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - advertised=True, - ) - - -class TestAsyncStatuses: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @pytest.mark.skip() - @parametrize - async def test_method_ip_address_management_dynamic_advertisement_get_advertisement_status( - self, async_client: AsyncCloudflare - ) -> None: - status = await async_client.addresses.prefixes.bgps.statuses.ip_address_management_dynamic_advertisement_get_advertisement_status( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type( - StatusIPAddressManagementDynamicAdvertisementGetAdvertisementStatusResponse, status, path=["response"] - ) - - @pytest.mark.skip() - @parametrize - async def test_raw_response_ip_address_management_dynamic_advertisement_get_advertisement_status( - self, async_client: AsyncCloudflare - ) -> None: - response = await async_client.addresses.prefixes.bgps.statuses.with_raw_response.ip_address_management_dynamic_advertisement_get_advertisement_status( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - status = await response.parse() - assert_matches_type( - StatusIPAddressManagementDynamicAdvertisementGetAdvertisementStatusResponse, status, path=["response"] - ) - - @pytest.mark.skip() - @parametrize - async def test_streaming_response_ip_address_management_dynamic_advertisement_get_advertisement_status( - self, async_client: AsyncCloudflare - ) -> None: - async with async_client.addresses.prefixes.bgps.statuses.with_streaming_response.ip_address_management_dynamic_advertisement_get_advertisement_status( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - status = await response.parse() - assert_matches_type( - StatusIPAddressManagementDynamicAdvertisementGetAdvertisementStatusResponse, status, path=["response"] - ) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - async def test_path_params_ip_address_management_dynamic_advertisement_get_advertisement_status( - self, async_client: AsyncCloudflare - ) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"): - await async_client.addresses.prefixes.bgps.statuses.with_raw_response.ip_address_management_dynamic_advertisement_get_advertisement_status( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_identifier` but received ''"): - await async_client.addresses.prefixes.bgps.statuses.with_raw_response.ip_address_management_dynamic_advertisement_get_advertisement_status( - "", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - @pytest.mark.skip() - @parametrize - async def test_method_ip_address_management_dynamic_advertisement_update_prefix_dynamic_advertisement_status( - self, async_client: AsyncCloudflare - ) -> None: - status = await async_client.addresses.prefixes.bgps.statuses.ip_address_management_dynamic_advertisement_update_prefix_dynamic_advertisement_status( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - advertised=True, - ) - assert_matches_type( - StatusIPAddressManagementDynamicAdvertisementUpdatePrefixDynamicAdvertisementStatusResponse, - status, - path=["response"], - ) - - @pytest.mark.skip() - @parametrize - async def test_raw_response_ip_address_management_dynamic_advertisement_update_prefix_dynamic_advertisement_status( - self, async_client: AsyncCloudflare - ) -> None: - response = await async_client.addresses.prefixes.bgps.statuses.with_raw_response.ip_address_management_dynamic_advertisement_update_prefix_dynamic_advertisement_status( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - advertised=True, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - status = await response.parse() - assert_matches_type( - StatusIPAddressManagementDynamicAdvertisementUpdatePrefixDynamicAdvertisementStatusResponse, - status, - path=["response"], - ) - - @pytest.mark.skip() - @parametrize - async def test_streaming_response_ip_address_management_dynamic_advertisement_update_prefix_dynamic_advertisement_status( - self, async_client: AsyncCloudflare - ) -> None: - async with async_client.addresses.prefixes.bgps.statuses.with_streaming_response.ip_address_management_dynamic_advertisement_update_prefix_dynamic_advertisement_status( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - advertised=True, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - status = await response.parse() - assert_matches_type( - StatusIPAddressManagementDynamicAdvertisementUpdatePrefixDynamicAdvertisementStatusResponse, - status, - path=["response"], - ) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - async def test_path_params_ip_address_management_dynamic_advertisement_update_prefix_dynamic_advertisement_status( - self, async_client: AsyncCloudflare - ) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"): - await async_client.addresses.prefixes.bgps.statuses.with_raw_response.ip_address_management_dynamic_advertisement_update_prefix_dynamic_advertisement_status( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="", - advertised=True, - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_identifier` but received ''"): - await async_client.addresses.prefixes.bgps.statuses.with_raw_response.ip_address_management_dynamic_advertisement_update_prefix_dynamic_advertisement_status( - "", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - advertised=True, - ) diff --git a/tests/api_resources/addresses/prefixes/test_delegations.py b/tests/api_resources/addresses/prefixes/test_delegations.py deleted file mode 100644 index e134a3a37be..00000000000 --- a/tests/api_resources/addresses/prefixes/test_delegations.py +++ /dev/null @@ -1,454 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from __future__ import annotations - -import os -from typing import Any, Optional, cast - -import pytest - -from cloudflare import Cloudflare, AsyncCloudflare -from tests.utils import assert_matches_type -from cloudflare.types.addresses.prefixes import ( - DelegationDeleteResponse, - DelegationIPAddressManagementPrefixDelegationListPrefixDelegationsResponse, - DelegationIPAddressManagementPrefixDelegationCreatePrefixDelegationResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestDelegations: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @pytest.mark.skip() - @parametrize - def test_method_delete(self, client: Cloudflare) -> None: - delegation = client.addresses.prefixes.delegations.delete( - "d933b1530bc56c9953cf8ce166da8004", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - prefix_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(DelegationDeleteResponse, delegation, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_raw_response_delete(self, client: Cloudflare) -> None: - response = client.addresses.prefixes.delegations.with_raw_response.delete( - "d933b1530bc56c9953cf8ce166da8004", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - prefix_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - delegation = response.parse() - assert_matches_type(DelegationDeleteResponse, delegation, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_streaming_response_delete(self, client: Cloudflare) -> None: - with client.addresses.prefixes.delegations.with_streaming_response.delete( - "d933b1530bc56c9953cf8ce166da8004", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - prefix_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - delegation = response.parse() - assert_matches_type(DelegationDeleteResponse, delegation, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - def test_path_params_delete(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"): - client.addresses.prefixes.delegations.with_raw_response.delete( - "d933b1530bc56c9953cf8ce166da8004", - account_identifier="", - prefix_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_identifier` but received ''"): - client.addresses.prefixes.delegations.with_raw_response.delete( - "d933b1530bc56c9953cf8ce166da8004", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - prefix_identifier="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `delegation_identifier` but received ''"): - client.addresses.prefixes.delegations.with_raw_response.delete( - "", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - prefix_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - @pytest.mark.skip() - @parametrize - def test_method_ip_address_management_prefix_delegation_create_prefix_delegation(self, client: Cloudflare) -> None: - delegation = ( - client.addresses.prefixes.delegations.ip_address_management_prefix_delegation_create_prefix_delegation( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - cidr="192.0.2.0/24", - delegated_account_id="b1946ac92492d2347c6235b4d2611184", - ) - ) - assert_matches_type( - DelegationIPAddressManagementPrefixDelegationCreatePrefixDelegationResponse, delegation, path=["response"] - ) - - @pytest.mark.skip() - @parametrize - def test_raw_response_ip_address_management_prefix_delegation_create_prefix_delegation( - self, client: Cloudflare - ) -> None: - response = client.addresses.prefixes.delegations.with_raw_response.ip_address_management_prefix_delegation_create_prefix_delegation( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - cidr="192.0.2.0/24", - delegated_account_id="b1946ac92492d2347c6235b4d2611184", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - delegation = response.parse() - assert_matches_type( - DelegationIPAddressManagementPrefixDelegationCreatePrefixDelegationResponse, delegation, path=["response"] - ) - - @pytest.mark.skip() - @parametrize - def test_streaming_response_ip_address_management_prefix_delegation_create_prefix_delegation( - self, client: Cloudflare - ) -> None: - with client.addresses.prefixes.delegations.with_streaming_response.ip_address_management_prefix_delegation_create_prefix_delegation( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - cidr="192.0.2.0/24", - delegated_account_id="b1946ac92492d2347c6235b4d2611184", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - delegation = response.parse() - assert_matches_type( - DelegationIPAddressManagementPrefixDelegationCreatePrefixDelegationResponse, - delegation, - path=["response"], - ) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - def test_path_params_ip_address_management_prefix_delegation_create_prefix_delegation( - self, client: Cloudflare - ) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"): - client.addresses.prefixes.delegations.with_raw_response.ip_address_management_prefix_delegation_create_prefix_delegation( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="", - cidr="192.0.2.0/24", - delegated_account_id="b1946ac92492d2347c6235b4d2611184", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_identifier` but received ''"): - client.addresses.prefixes.delegations.with_raw_response.ip_address_management_prefix_delegation_create_prefix_delegation( - "", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - cidr="192.0.2.0/24", - delegated_account_id="b1946ac92492d2347c6235b4d2611184", - ) - - @pytest.mark.skip() - @parametrize - def test_method_ip_address_management_prefix_delegation_list_prefix_delegations(self, client: Cloudflare) -> None: - delegation = ( - client.addresses.prefixes.delegations.ip_address_management_prefix_delegation_list_prefix_delegations( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - ) - assert_matches_type( - Optional[DelegationIPAddressManagementPrefixDelegationListPrefixDelegationsResponse], - delegation, - path=["response"], - ) - - @pytest.mark.skip() - @parametrize - def test_raw_response_ip_address_management_prefix_delegation_list_prefix_delegations( - self, client: Cloudflare - ) -> None: - response = client.addresses.prefixes.delegations.with_raw_response.ip_address_management_prefix_delegation_list_prefix_delegations( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - delegation = response.parse() - assert_matches_type( - Optional[DelegationIPAddressManagementPrefixDelegationListPrefixDelegationsResponse], - delegation, - path=["response"], - ) - - @pytest.mark.skip() - @parametrize - def test_streaming_response_ip_address_management_prefix_delegation_list_prefix_delegations( - self, client: Cloudflare - ) -> None: - with client.addresses.prefixes.delegations.with_streaming_response.ip_address_management_prefix_delegation_list_prefix_delegations( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - delegation = response.parse() - assert_matches_type( - Optional[DelegationIPAddressManagementPrefixDelegationListPrefixDelegationsResponse], - delegation, - path=["response"], - ) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - def test_path_params_ip_address_management_prefix_delegation_list_prefix_delegations( - self, client: Cloudflare - ) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"): - client.addresses.prefixes.delegations.with_raw_response.ip_address_management_prefix_delegation_list_prefix_delegations( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_identifier` but received ''"): - client.addresses.prefixes.delegations.with_raw_response.ip_address_management_prefix_delegation_list_prefix_delegations( - "", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - -class TestAsyncDelegations: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @pytest.mark.skip() - @parametrize - async def test_method_delete(self, async_client: AsyncCloudflare) -> None: - delegation = await async_client.addresses.prefixes.delegations.delete( - "d933b1530bc56c9953cf8ce166da8004", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - prefix_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(DelegationDeleteResponse, delegation, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: - response = await async_client.addresses.prefixes.delegations.with_raw_response.delete( - "d933b1530bc56c9953cf8ce166da8004", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - prefix_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - delegation = await response.parse() - assert_matches_type(DelegationDeleteResponse, delegation, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: - async with async_client.addresses.prefixes.delegations.with_streaming_response.delete( - "d933b1530bc56c9953cf8ce166da8004", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - prefix_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - delegation = await response.parse() - assert_matches_type(DelegationDeleteResponse, delegation, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"): - await async_client.addresses.prefixes.delegations.with_raw_response.delete( - "d933b1530bc56c9953cf8ce166da8004", - account_identifier="", - prefix_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_identifier` but received ''"): - await async_client.addresses.prefixes.delegations.with_raw_response.delete( - "d933b1530bc56c9953cf8ce166da8004", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - prefix_identifier="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `delegation_identifier` but received ''"): - await async_client.addresses.prefixes.delegations.with_raw_response.delete( - "", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - prefix_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - @pytest.mark.skip() - @parametrize - async def test_method_ip_address_management_prefix_delegation_create_prefix_delegation( - self, async_client: AsyncCloudflare - ) -> None: - delegation = await async_client.addresses.prefixes.delegations.ip_address_management_prefix_delegation_create_prefix_delegation( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - cidr="192.0.2.0/24", - delegated_account_id="b1946ac92492d2347c6235b4d2611184", - ) - assert_matches_type( - DelegationIPAddressManagementPrefixDelegationCreatePrefixDelegationResponse, delegation, path=["response"] - ) - - @pytest.mark.skip() - @parametrize - async def test_raw_response_ip_address_management_prefix_delegation_create_prefix_delegation( - self, async_client: AsyncCloudflare - ) -> None: - response = await async_client.addresses.prefixes.delegations.with_raw_response.ip_address_management_prefix_delegation_create_prefix_delegation( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - cidr="192.0.2.0/24", - delegated_account_id="b1946ac92492d2347c6235b4d2611184", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - delegation = await response.parse() - assert_matches_type( - DelegationIPAddressManagementPrefixDelegationCreatePrefixDelegationResponse, delegation, path=["response"] - ) - - @pytest.mark.skip() - @parametrize - async def test_streaming_response_ip_address_management_prefix_delegation_create_prefix_delegation( - self, async_client: AsyncCloudflare - ) -> None: - async with async_client.addresses.prefixes.delegations.with_streaming_response.ip_address_management_prefix_delegation_create_prefix_delegation( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - cidr="192.0.2.0/24", - delegated_account_id="b1946ac92492d2347c6235b4d2611184", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - delegation = await response.parse() - assert_matches_type( - DelegationIPAddressManagementPrefixDelegationCreatePrefixDelegationResponse, - delegation, - path=["response"], - ) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - async def test_path_params_ip_address_management_prefix_delegation_create_prefix_delegation( - self, async_client: AsyncCloudflare - ) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"): - await async_client.addresses.prefixes.delegations.with_raw_response.ip_address_management_prefix_delegation_create_prefix_delegation( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="", - cidr="192.0.2.0/24", - delegated_account_id="b1946ac92492d2347c6235b4d2611184", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_identifier` but received ''"): - await async_client.addresses.prefixes.delegations.with_raw_response.ip_address_management_prefix_delegation_create_prefix_delegation( - "", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - cidr="192.0.2.0/24", - delegated_account_id="b1946ac92492d2347c6235b4d2611184", - ) - - @pytest.mark.skip() - @parametrize - async def test_method_ip_address_management_prefix_delegation_list_prefix_delegations( - self, async_client: AsyncCloudflare - ) -> None: - delegation = await async_client.addresses.prefixes.delegations.ip_address_management_prefix_delegation_list_prefix_delegations( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type( - Optional[DelegationIPAddressManagementPrefixDelegationListPrefixDelegationsResponse], - delegation, - path=["response"], - ) - - @pytest.mark.skip() - @parametrize - async def test_raw_response_ip_address_management_prefix_delegation_list_prefix_delegations( - self, async_client: AsyncCloudflare - ) -> None: - response = await async_client.addresses.prefixes.delegations.with_raw_response.ip_address_management_prefix_delegation_list_prefix_delegations( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - delegation = await response.parse() - assert_matches_type( - Optional[DelegationIPAddressManagementPrefixDelegationListPrefixDelegationsResponse], - delegation, - path=["response"], - ) - - @pytest.mark.skip() - @parametrize - async def test_streaming_response_ip_address_management_prefix_delegation_list_prefix_delegations( - self, async_client: AsyncCloudflare - ) -> None: - async with async_client.addresses.prefixes.delegations.with_streaming_response.ip_address_management_prefix_delegation_list_prefix_delegations( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - delegation = await response.parse() - assert_matches_type( - Optional[DelegationIPAddressManagementPrefixDelegationListPrefixDelegationsResponse], - delegation, - path=["response"], - ) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - async def test_path_params_ip_address_management_prefix_delegation_list_prefix_delegations( - self, async_client: AsyncCloudflare - ) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"): - await async_client.addresses.prefixes.delegations.with_raw_response.ip_address_management_prefix_delegation_list_prefix_delegations( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_identifier` but received ''"): - await async_client.addresses.prefixes.delegations.with_raw_response.ip_address_management_prefix_delegation_list_prefix_delegations( - "", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) diff --git a/tests/api_resources/addresses/test_address_maps.py b/tests/api_resources/addresses/test_address_maps.py deleted file mode 100644 index cc681e638d0..00000000000 --- a/tests/api_resources/addresses/test_address_maps.py +++ /dev/null @@ -1,564 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from __future__ import annotations - -import os -from typing import Any, Optional, cast - -import pytest - -from cloudflare import Cloudflare, AsyncCloudflare -from tests.utils import assert_matches_type -from cloudflare.types.addresses import ( - AddressMapGetResponse, - AddressMapListResponse, - AddressMapCreateResponse, - AddressMapDeleteResponse, - AddressMapUpdateResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestAddressMaps: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @pytest.mark.skip() - @parametrize - def test_method_create(self, client: Cloudflare) -> None: - address_map = client.addresses.address_maps.create( - "023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(AddressMapCreateResponse, address_map, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_method_create_with_all_params(self, client: Cloudflare) -> None: - address_map = client.addresses.address_maps.create( - "023e105f4ecef8ad9ca31a8372d0c353", - description="My Ecommerce zones", - enabled=True, - ) - assert_matches_type(AddressMapCreateResponse, address_map, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_raw_response_create(self, client: Cloudflare) -> None: - response = client.addresses.address_maps.with_raw_response.create( - "023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - address_map = response.parse() - assert_matches_type(AddressMapCreateResponse, address_map, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_streaming_response_create(self, client: Cloudflare) -> None: - with client.addresses.address_maps.with_streaming_response.create( - "023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - address_map = response.parse() - assert_matches_type(AddressMapCreateResponse, address_map, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - def test_path_params_create(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"): - client.addresses.address_maps.with_raw_response.create( - "", - ) - - @pytest.mark.skip() - @parametrize - def test_method_update(self, client: Cloudflare) -> None: - address_map = client.addresses.address_maps.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(AddressMapUpdateResponse, address_map, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_method_update_with_all_params(self, client: Cloudflare) -> None: - address_map = client.addresses.address_maps.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - default_sni="*.example.com", - description="My Ecommerce zones", - enabled=True, - ) - assert_matches_type(AddressMapUpdateResponse, address_map, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_raw_response_update(self, client: Cloudflare) -> None: - response = client.addresses.address_maps.with_raw_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - address_map = response.parse() - assert_matches_type(AddressMapUpdateResponse, address_map, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_streaming_response_update(self, client: Cloudflare) -> None: - with client.addresses.address_maps.with_streaming_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - address_map = response.parse() - assert_matches_type(AddressMapUpdateResponse, address_map, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - def test_path_params_update(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"): - client.addresses.address_maps.with_raw_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="", - ) - - with pytest.raises( - ValueError, match=r"Expected a non-empty value for `address_map_identifier` but received ''" - ): - client.addresses.address_maps.with_raw_response.update( - "", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - @pytest.mark.skip() - @parametrize - def test_method_list(self, client: Cloudflare) -> None: - address_map = client.addresses.address_maps.list( - "023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(Optional[AddressMapListResponse], address_map, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.addresses.address_maps.with_raw_response.list( - "023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - address_map = response.parse() - assert_matches_type(Optional[AddressMapListResponse], address_map, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.addresses.address_maps.with_streaming_response.list( - "023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - address_map = response.parse() - assert_matches_type(Optional[AddressMapListResponse], address_map, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - def test_path_params_list(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"): - client.addresses.address_maps.with_raw_response.list( - "", - ) - - @pytest.mark.skip() - @parametrize - def test_method_delete(self, client: Cloudflare) -> None: - address_map = client.addresses.address_maps.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(Optional[AddressMapDeleteResponse], address_map, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_raw_response_delete(self, client: Cloudflare) -> None: - response = client.addresses.address_maps.with_raw_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - address_map = response.parse() - assert_matches_type(Optional[AddressMapDeleteResponse], address_map, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_streaming_response_delete(self, client: Cloudflare) -> None: - with client.addresses.address_maps.with_streaming_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - address_map = response.parse() - assert_matches_type(Optional[AddressMapDeleteResponse], address_map, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - def test_path_params_delete(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"): - client.addresses.address_maps.with_raw_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="", - ) - - with pytest.raises( - ValueError, match=r"Expected a non-empty value for `address_map_identifier` but received ''" - ): - client.addresses.address_maps.with_raw_response.delete( - "", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - @pytest.mark.skip() - @parametrize - def test_method_get(self, client: Cloudflare) -> None: - address_map = client.addresses.address_maps.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(AddressMapGetResponse, address_map, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_raw_response_get(self, client: Cloudflare) -> None: - response = client.addresses.address_maps.with_raw_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - address_map = response.parse() - assert_matches_type(AddressMapGetResponse, address_map, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_streaming_response_get(self, client: Cloudflare) -> None: - with client.addresses.address_maps.with_streaming_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - address_map = response.parse() - assert_matches_type(AddressMapGetResponse, address_map, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"): - client.addresses.address_maps.with_raw_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="", - ) - - with pytest.raises( - ValueError, match=r"Expected a non-empty value for `address_map_identifier` but received ''" - ): - client.addresses.address_maps.with_raw_response.get( - "", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - -class TestAsyncAddressMaps: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @pytest.mark.skip() - @parametrize - async def test_method_create(self, async_client: AsyncCloudflare) -> None: - address_map = await async_client.addresses.address_maps.create( - "023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(AddressMapCreateResponse, address_map, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: - address_map = await async_client.addresses.address_maps.create( - "023e105f4ecef8ad9ca31a8372d0c353", - description="My Ecommerce zones", - enabled=True, - ) - assert_matches_type(AddressMapCreateResponse, address_map, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: - response = await async_client.addresses.address_maps.with_raw_response.create( - "023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - address_map = await response.parse() - assert_matches_type(AddressMapCreateResponse, address_map, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: - async with async_client.addresses.address_maps.with_streaming_response.create( - "023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - address_map = await response.parse() - assert_matches_type(AddressMapCreateResponse, address_map, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"): - await async_client.addresses.address_maps.with_raw_response.create( - "", - ) - - @pytest.mark.skip() - @parametrize - async def test_method_update(self, async_client: AsyncCloudflare) -> None: - address_map = await async_client.addresses.address_maps.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(AddressMapUpdateResponse, address_map, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: - address_map = await async_client.addresses.address_maps.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - default_sni="*.example.com", - description="My Ecommerce zones", - enabled=True, - ) - assert_matches_type(AddressMapUpdateResponse, address_map, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: - response = await async_client.addresses.address_maps.with_raw_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - address_map = await response.parse() - assert_matches_type(AddressMapUpdateResponse, address_map, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: - async with async_client.addresses.address_maps.with_streaming_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - address_map = await response.parse() - assert_matches_type(AddressMapUpdateResponse, address_map, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"): - await async_client.addresses.address_maps.with_raw_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="", - ) - - with pytest.raises( - ValueError, match=r"Expected a non-empty value for `address_map_identifier` but received ''" - ): - await async_client.addresses.address_maps.with_raw_response.update( - "", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - @pytest.mark.skip() - @parametrize - async def test_method_list(self, async_client: AsyncCloudflare) -> None: - address_map = await async_client.addresses.address_maps.list( - "023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(Optional[AddressMapListResponse], address_map, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.addresses.address_maps.with_raw_response.list( - "023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - address_map = await response.parse() - assert_matches_type(Optional[AddressMapListResponse], address_map, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.addresses.address_maps.with_streaming_response.list( - "023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - address_map = await response.parse() - assert_matches_type(Optional[AddressMapListResponse], address_map, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"): - await async_client.addresses.address_maps.with_raw_response.list( - "", - ) - - @pytest.mark.skip() - @parametrize - async def test_method_delete(self, async_client: AsyncCloudflare) -> None: - address_map = await async_client.addresses.address_maps.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(Optional[AddressMapDeleteResponse], address_map, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: - response = await async_client.addresses.address_maps.with_raw_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - address_map = await response.parse() - assert_matches_type(Optional[AddressMapDeleteResponse], address_map, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: - async with async_client.addresses.address_maps.with_streaming_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - address_map = await response.parse() - assert_matches_type(Optional[AddressMapDeleteResponse], address_map, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"): - await async_client.addresses.address_maps.with_raw_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="", - ) - - with pytest.raises( - ValueError, match=r"Expected a non-empty value for `address_map_identifier` but received ''" - ): - await async_client.addresses.address_maps.with_raw_response.delete( - "", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - @pytest.mark.skip() - @parametrize - async def test_method_get(self, async_client: AsyncCloudflare) -> None: - address_map = await async_client.addresses.address_maps.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(AddressMapGetResponse, address_map, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: - response = await async_client.addresses.address_maps.with_raw_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - address_map = await response.parse() - assert_matches_type(AddressMapGetResponse, address_map, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: - async with async_client.addresses.address_maps.with_streaming_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - address_map = await response.parse() - assert_matches_type(AddressMapGetResponse, address_map, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"): - await async_client.addresses.address_maps.with_raw_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="", - ) - - with pytest.raises( - ValueError, match=r"Expected a non-empty value for `address_map_identifier` but received ''" - ): - await async_client.addresses.address_maps.with_raw_response.get( - "", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) diff --git a/tests/api_resources/addresses/test_loa_documents.py b/tests/api_resources/addresses/test_loa_documents.py deleted file mode 100644 index 71364c7c65f..00000000000 --- a/tests/api_resources/addresses/test_loa_documents.py +++ /dev/null @@ -1,136 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from cloudflare import Cloudflare, AsyncCloudflare -from tests.utils import assert_matches_type -from cloudflare.types.addresses import ( - LoaDocumentIPAddressManagementPrefixesUploadLoaDocumentResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLoaDocuments: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @pytest.mark.skip() - @parametrize - def test_method_ip_address_management_prefixes_upload_loa_document(self, client: Cloudflare) -> None: - loa_document = client.addresses.loa_documents.ip_address_management_prefixes_upload_loa_document( - "023e105f4ecef8ad9ca31a8372d0c353", - loa_document="@document.pdf", - ) - assert_matches_type( - LoaDocumentIPAddressManagementPrefixesUploadLoaDocumentResponse, loa_document, path=["response"] - ) - - @pytest.mark.skip() - @parametrize - def test_raw_response_ip_address_management_prefixes_upload_loa_document(self, client: Cloudflare) -> None: - response = client.addresses.loa_documents.with_raw_response.ip_address_management_prefixes_upload_loa_document( - "023e105f4ecef8ad9ca31a8372d0c353", - loa_document="@document.pdf", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - loa_document = response.parse() - assert_matches_type( - LoaDocumentIPAddressManagementPrefixesUploadLoaDocumentResponse, loa_document, path=["response"] - ) - - @pytest.mark.skip() - @parametrize - def test_streaming_response_ip_address_management_prefixes_upload_loa_document(self, client: Cloudflare) -> None: - with client.addresses.loa_documents.with_streaming_response.ip_address_management_prefixes_upload_loa_document( - "023e105f4ecef8ad9ca31a8372d0c353", - loa_document="@document.pdf", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - loa_document = response.parse() - assert_matches_type( - LoaDocumentIPAddressManagementPrefixesUploadLoaDocumentResponse, loa_document, path=["response"] - ) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - def test_path_params_ip_address_management_prefixes_upload_loa_document(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"): - client.addresses.loa_documents.with_raw_response.ip_address_management_prefixes_upload_loa_document( - "", - loa_document="@document.pdf", - ) - - -class TestAsyncLoaDocuments: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @pytest.mark.skip() - @parametrize - async def test_method_ip_address_management_prefixes_upload_loa_document( - self, async_client: AsyncCloudflare - ) -> None: - loa_document = await async_client.addresses.loa_documents.ip_address_management_prefixes_upload_loa_document( - "023e105f4ecef8ad9ca31a8372d0c353", - loa_document="@document.pdf", - ) - assert_matches_type( - LoaDocumentIPAddressManagementPrefixesUploadLoaDocumentResponse, loa_document, path=["response"] - ) - - @pytest.mark.skip() - @parametrize - async def test_raw_response_ip_address_management_prefixes_upload_loa_document( - self, async_client: AsyncCloudflare - ) -> None: - response = await async_client.addresses.loa_documents.with_raw_response.ip_address_management_prefixes_upload_loa_document( - "023e105f4ecef8ad9ca31a8372d0c353", - loa_document="@document.pdf", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - loa_document = await response.parse() - assert_matches_type( - LoaDocumentIPAddressManagementPrefixesUploadLoaDocumentResponse, loa_document, path=["response"] - ) - - @pytest.mark.skip() - @parametrize - async def test_streaming_response_ip_address_management_prefixes_upload_loa_document( - self, async_client: AsyncCloudflare - ) -> None: - async with async_client.addresses.loa_documents.with_streaming_response.ip_address_management_prefixes_upload_loa_document( - "023e105f4ecef8ad9ca31a8372d0c353", - loa_document="@document.pdf", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - loa_document = await response.parse() - assert_matches_type( - LoaDocumentIPAddressManagementPrefixesUploadLoaDocumentResponse, loa_document, path=["response"] - ) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - async def test_path_params_ip_address_management_prefixes_upload_loa_document( - self, async_client: AsyncCloudflare - ) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"): - await async_client.addresses.loa_documents.with_raw_response.ip_address_management_prefixes_upload_loa_document( - "", - loa_document="@document.pdf", - ) diff --git a/tests/api_resources/addresses/test_prefixes.py b/tests/api_resources/addresses/test_prefixes.py deleted file mode 100644 index c50a66483d3..00000000000 --- a/tests/api_resources/addresses/test_prefixes.py +++ /dev/null @@ -1,554 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from __future__ import annotations - -import os -from typing import Any, Optional, cast - -import pytest - -from cloudflare import Cloudflare, AsyncCloudflare -from tests.utils import assert_matches_type -from cloudflare.types.addresses import ( - PrefixGetResponse, - PrefixDeleteResponse, - PrefixUpdateResponse, - PrefixIPAddressManagementPrefixesAddPrefixResponse, - PrefixIPAddressManagementPrefixesListPrefixesResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestPrefixes: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @pytest.mark.skip() - @parametrize - def test_method_update(self, client: Cloudflare) -> None: - prefix = client.addresses.prefixes.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - description="Internal test prefix", - ) - assert_matches_type(PrefixUpdateResponse, prefix, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_raw_response_update(self, client: Cloudflare) -> None: - response = client.addresses.prefixes.with_raw_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - description="Internal test prefix", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - prefix = response.parse() - assert_matches_type(PrefixUpdateResponse, prefix, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_streaming_response_update(self, client: Cloudflare) -> None: - with client.addresses.prefixes.with_streaming_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - description="Internal test prefix", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - prefix = response.parse() - assert_matches_type(PrefixUpdateResponse, prefix, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - def test_path_params_update(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"): - client.addresses.prefixes.with_raw_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="", - description="Internal test prefix", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_identifier` but received ''"): - client.addresses.prefixes.with_raw_response.update( - "", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - description="Internal test prefix", - ) - - @pytest.mark.skip() - @parametrize - def test_method_delete(self, client: Cloudflare) -> None: - prefix = client.addresses.prefixes.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(Optional[PrefixDeleteResponse], prefix, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_raw_response_delete(self, client: Cloudflare) -> None: - response = client.addresses.prefixes.with_raw_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - prefix = response.parse() - assert_matches_type(Optional[PrefixDeleteResponse], prefix, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_streaming_response_delete(self, client: Cloudflare) -> None: - with client.addresses.prefixes.with_streaming_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - prefix = response.parse() - assert_matches_type(Optional[PrefixDeleteResponse], prefix, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - def test_path_params_delete(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"): - client.addresses.prefixes.with_raw_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_identifier` but received ''"): - client.addresses.prefixes.with_raw_response.delete( - "", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - @pytest.mark.skip() - @parametrize - def test_method_get(self, client: Cloudflare) -> None: - prefix = client.addresses.prefixes.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(PrefixGetResponse, prefix, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_raw_response_get(self, client: Cloudflare) -> None: - response = client.addresses.prefixes.with_raw_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - prefix = response.parse() - assert_matches_type(PrefixGetResponse, prefix, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_streaming_response_get(self, client: Cloudflare) -> None: - with client.addresses.prefixes.with_streaming_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - prefix = response.parse() - assert_matches_type(PrefixGetResponse, prefix, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"): - client.addresses.prefixes.with_raw_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_identifier` but received ''"): - client.addresses.prefixes.with_raw_response.get( - "", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - @pytest.mark.skip() - @parametrize - def test_method_ip_address_management_prefixes_add_prefix(self, client: Cloudflare) -> None: - prefix = client.addresses.prefixes.ip_address_management_prefixes_add_prefix( - "023e105f4ecef8ad9ca31a8372d0c353", - asn=209242, - cidr="192.0.2.0/24", - loa_document_id="d933b1530bc56c9953cf8ce166da8004", - ) - assert_matches_type(PrefixIPAddressManagementPrefixesAddPrefixResponse, prefix, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_raw_response_ip_address_management_prefixes_add_prefix(self, client: Cloudflare) -> None: - response = client.addresses.prefixes.with_raw_response.ip_address_management_prefixes_add_prefix( - "023e105f4ecef8ad9ca31a8372d0c353", - asn=209242, - cidr="192.0.2.0/24", - loa_document_id="d933b1530bc56c9953cf8ce166da8004", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - prefix = response.parse() - assert_matches_type(PrefixIPAddressManagementPrefixesAddPrefixResponse, prefix, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_streaming_response_ip_address_management_prefixes_add_prefix(self, client: Cloudflare) -> None: - with client.addresses.prefixes.with_streaming_response.ip_address_management_prefixes_add_prefix( - "023e105f4ecef8ad9ca31a8372d0c353", - asn=209242, - cidr="192.0.2.0/24", - loa_document_id="d933b1530bc56c9953cf8ce166da8004", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - prefix = response.parse() - assert_matches_type(PrefixIPAddressManagementPrefixesAddPrefixResponse, prefix, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - def test_path_params_ip_address_management_prefixes_add_prefix(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"): - client.addresses.prefixes.with_raw_response.ip_address_management_prefixes_add_prefix( - "", - asn=209242, - cidr="192.0.2.0/24", - loa_document_id="d933b1530bc56c9953cf8ce166da8004", - ) - - @pytest.mark.skip() - @parametrize - def test_method_ip_address_management_prefixes_list_prefixes(self, client: Cloudflare) -> None: - prefix = client.addresses.prefixes.ip_address_management_prefixes_list_prefixes( - "023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(Optional[PrefixIPAddressManagementPrefixesListPrefixesResponse], prefix, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_raw_response_ip_address_management_prefixes_list_prefixes(self, client: Cloudflare) -> None: - response = client.addresses.prefixes.with_raw_response.ip_address_management_prefixes_list_prefixes( - "023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - prefix = response.parse() - assert_matches_type(Optional[PrefixIPAddressManagementPrefixesListPrefixesResponse], prefix, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_streaming_response_ip_address_management_prefixes_list_prefixes(self, client: Cloudflare) -> None: - with client.addresses.prefixes.with_streaming_response.ip_address_management_prefixes_list_prefixes( - "023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - prefix = response.parse() - assert_matches_type( - Optional[PrefixIPAddressManagementPrefixesListPrefixesResponse], prefix, path=["response"] - ) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - def test_path_params_ip_address_management_prefixes_list_prefixes(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"): - client.addresses.prefixes.with_raw_response.ip_address_management_prefixes_list_prefixes( - "", - ) - - -class TestAsyncPrefixes: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @pytest.mark.skip() - @parametrize - async def test_method_update(self, async_client: AsyncCloudflare) -> None: - prefix = await async_client.addresses.prefixes.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - description="Internal test prefix", - ) - assert_matches_type(PrefixUpdateResponse, prefix, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: - response = await async_client.addresses.prefixes.with_raw_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - description="Internal test prefix", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - prefix = await response.parse() - assert_matches_type(PrefixUpdateResponse, prefix, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: - async with async_client.addresses.prefixes.with_streaming_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - description="Internal test prefix", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - prefix = await response.parse() - assert_matches_type(PrefixUpdateResponse, prefix, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"): - await async_client.addresses.prefixes.with_raw_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="", - description="Internal test prefix", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_identifier` but received ''"): - await async_client.addresses.prefixes.with_raw_response.update( - "", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - description="Internal test prefix", - ) - - @pytest.mark.skip() - @parametrize - async def test_method_delete(self, async_client: AsyncCloudflare) -> None: - prefix = await async_client.addresses.prefixes.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(Optional[PrefixDeleteResponse], prefix, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: - response = await async_client.addresses.prefixes.with_raw_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - prefix = await response.parse() - assert_matches_type(Optional[PrefixDeleteResponse], prefix, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: - async with async_client.addresses.prefixes.with_streaming_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - prefix = await response.parse() - assert_matches_type(Optional[PrefixDeleteResponse], prefix, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"): - await async_client.addresses.prefixes.with_raw_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_identifier` but received ''"): - await async_client.addresses.prefixes.with_raw_response.delete( - "", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - @pytest.mark.skip() - @parametrize - async def test_method_get(self, async_client: AsyncCloudflare) -> None: - prefix = await async_client.addresses.prefixes.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(PrefixGetResponse, prefix, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: - response = await async_client.addresses.prefixes.with_raw_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - prefix = await response.parse() - assert_matches_type(PrefixGetResponse, prefix, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: - async with async_client.addresses.prefixes.with_streaming_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - prefix = await response.parse() - assert_matches_type(PrefixGetResponse, prefix, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"): - await async_client.addresses.prefixes.with_raw_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_identifier` but received ''"): - await async_client.addresses.prefixes.with_raw_response.get( - "", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - @pytest.mark.skip() - @parametrize - async def test_method_ip_address_management_prefixes_add_prefix(self, async_client: AsyncCloudflare) -> None: - prefix = await async_client.addresses.prefixes.ip_address_management_prefixes_add_prefix( - "023e105f4ecef8ad9ca31a8372d0c353", - asn=209242, - cidr="192.0.2.0/24", - loa_document_id="d933b1530bc56c9953cf8ce166da8004", - ) - assert_matches_type(PrefixIPAddressManagementPrefixesAddPrefixResponse, prefix, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_raw_response_ip_address_management_prefixes_add_prefix(self, async_client: AsyncCloudflare) -> None: - response = await async_client.addresses.prefixes.with_raw_response.ip_address_management_prefixes_add_prefix( - "023e105f4ecef8ad9ca31a8372d0c353", - asn=209242, - cidr="192.0.2.0/24", - loa_document_id="d933b1530bc56c9953cf8ce166da8004", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - prefix = await response.parse() - assert_matches_type(PrefixIPAddressManagementPrefixesAddPrefixResponse, prefix, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_streaming_response_ip_address_management_prefixes_add_prefix( - self, async_client: AsyncCloudflare - ) -> None: - async with async_client.addresses.prefixes.with_streaming_response.ip_address_management_prefixes_add_prefix( - "023e105f4ecef8ad9ca31a8372d0c353", - asn=209242, - cidr="192.0.2.0/24", - loa_document_id="d933b1530bc56c9953cf8ce166da8004", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - prefix = await response.parse() - assert_matches_type(PrefixIPAddressManagementPrefixesAddPrefixResponse, prefix, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - async def test_path_params_ip_address_management_prefixes_add_prefix(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"): - await async_client.addresses.prefixes.with_raw_response.ip_address_management_prefixes_add_prefix( - "", - asn=209242, - cidr="192.0.2.0/24", - loa_document_id="d933b1530bc56c9953cf8ce166da8004", - ) - - @pytest.mark.skip() - @parametrize - async def test_method_ip_address_management_prefixes_list_prefixes(self, async_client: AsyncCloudflare) -> None: - prefix = await async_client.addresses.prefixes.ip_address_management_prefixes_list_prefixes( - "023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(Optional[PrefixIPAddressManagementPrefixesListPrefixesResponse], prefix, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_raw_response_ip_address_management_prefixes_list_prefixes( - self, async_client: AsyncCloudflare - ) -> None: - response = await async_client.addresses.prefixes.with_raw_response.ip_address_management_prefixes_list_prefixes( - "023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - prefix = await response.parse() - assert_matches_type(Optional[PrefixIPAddressManagementPrefixesListPrefixesResponse], prefix, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_streaming_response_ip_address_management_prefixes_list_prefixes( - self, async_client: AsyncCloudflare - ) -> None: - async with async_client.addresses.prefixes.with_streaming_response.ip_address_management_prefixes_list_prefixes( - "023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - prefix = await response.parse() - assert_matches_type( - Optional[PrefixIPAddressManagementPrefixesListPrefixesResponse], prefix, path=["response"] - ) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - async def test_path_params_ip_address_management_prefixes_list_prefixes( - self, async_client: AsyncCloudflare - ) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"): - await async_client.addresses.prefixes.with_raw_response.ip_address_management_prefixes_list_prefixes( - "", - ) diff --git a/tests/api_resources/addressing/prefixes/test_bgp_prefixes.py b/tests/api_resources/addressing/prefixes/test_bgp_prefixes.py deleted file mode 100644 index 6b1d739d194..00000000000 --- a/tests/api_resources/addressing/prefixes/test_bgp_prefixes.py +++ /dev/null @@ -1,408 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from __future__ import annotations - -import os -from typing import Any, Optional, cast - -import pytest - -from cloudflare import Cloudflare, AsyncCloudflare -from tests.utils import assert_matches_type -from cloudflare.types.addressing.prefixes import ( - BGPPrefixGetResponse, - BGPPrefixListResponse, - BGPPrefixUpdateResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestBGPPrefixes: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @pytest.mark.skip() - @parametrize - def test_method_update(self, client: Cloudflare) -> None: - bgp_prefix = client.addressing.prefixes.bgp_prefixes.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - prefix_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(BGPPrefixUpdateResponse, bgp_prefix, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_method_update_with_all_params(self, client: Cloudflare) -> None: - bgp_prefix = client.addressing.prefixes.bgp_prefixes.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - prefix_identifier="023e105f4ecef8ad9ca31a8372d0c353", - on_demand={"advertised": True}, - ) - assert_matches_type(BGPPrefixUpdateResponse, bgp_prefix, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_raw_response_update(self, client: Cloudflare) -> None: - response = client.addressing.prefixes.bgp_prefixes.with_raw_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - prefix_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - bgp_prefix = response.parse() - assert_matches_type(BGPPrefixUpdateResponse, bgp_prefix, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_streaming_response_update(self, client: Cloudflare) -> None: - with client.addressing.prefixes.bgp_prefixes.with_streaming_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - prefix_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - bgp_prefix = response.parse() - assert_matches_type(BGPPrefixUpdateResponse, bgp_prefix, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - def test_path_params_update(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"): - client.addressing.prefixes.bgp_prefixes.with_raw_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="", - prefix_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_identifier` but received ''"): - client.addressing.prefixes.bgp_prefixes.with_raw_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - prefix_identifier="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `bgp_prefix_identifier` but received ''"): - client.addressing.prefixes.bgp_prefixes.with_raw_response.update( - "", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - prefix_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - @pytest.mark.skip() - @parametrize - def test_method_list(self, client: Cloudflare) -> None: - bgp_prefix = client.addressing.prefixes.bgp_prefixes.list( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(Optional[BGPPrefixListResponse], bgp_prefix, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.addressing.prefixes.bgp_prefixes.with_raw_response.list( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - bgp_prefix = response.parse() - assert_matches_type(Optional[BGPPrefixListResponse], bgp_prefix, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.addressing.prefixes.bgp_prefixes.with_streaming_response.list( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - bgp_prefix = response.parse() - assert_matches_type(Optional[BGPPrefixListResponse], bgp_prefix, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - def test_path_params_list(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"): - client.addressing.prefixes.bgp_prefixes.with_raw_response.list( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_identifier` but received ''"): - client.addressing.prefixes.bgp_prefixes.with_raw_response.list( - "", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - @pytest.mark.skip() - @parametrize - def test_method_get(self, client: Cloudflare) -> None: - bgp_prefix = client.addressing.prefixes.bgp_prefixes.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - prefix_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(BGPPrefixGetResponse, bgp_prefix, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_raw_response_get(self, client: Cloudflare) -> None: - response = client.addressing.prefixes.bgp_prefixes.with_raw_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - prefix_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - bgp_prefix = response.parse() - assert_matches_type(BGPPrefixGetResponse, bgp_prefix, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_streaming_response_get(self, client: Cloudflare) -> None: - with client.addressing.prefixes.bgp_prefixes.with_streaming_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - prefix_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - bgp_prefix = response.parse() - assert_matches_type(BGPPrefixGetResponse, bgp_prefix, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"): - client.addressing.prefixes.bgp_prefixes.with_raw_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="", - prefix_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_identifier` but received ''"): - client.addressing.prefixes.bgp_prefixes.with_raw_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - prefix_identifier="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `bgp_prefix_identifier` but received ''"): - client.addressing.prefixes.bgp_prefixes.with_raw_response.get( - "", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - prefix_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - -class TestAsyncBGPPrefixes: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @pytest.mark.skip() - @parametrize - async def test_method_update(self, async_client: AsyncCloudflare) -> None: - bgp_prefix = await async_client.addressing.prefixes.bgp_prefixes.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - prefix_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(BGPPrefixUpdateResponse, bgp_prefix, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: - bgp_prefix = await async_client.addressing.prefixes.bgp_prefixes.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - prefix_identifier="023e105f4ecef8ad9ca31a8372d0c353", - on_demand={"advertised": True}, - ) - assert_matches_type(BGPPrefixUpdateResponse, bgp_prefix, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: - response = await async_client.addressing.prefixes.bgp_prefixes.with_raw_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - prefix_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - bgp_prefix = await response.parse() - assert_matches_type(BGPPrefixUpdateResponse, bgp_prefix, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: - async with async_client.addressing.prefixes.bgp_prefixes.with_streaming_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - prefix_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - bgp_prefix = await response.parse() - assert_matches_type(BGPPrefixUpdateResponse, bgp_prefix, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"): - await async_client.addressing.prefixes.bgp_prefixes.with_raw_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="", - prefix_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_identifier` but received ''"): - await async_client.addressing.prefixes.bgp_prefixes.with_raw_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - prefix_identifier="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `bgp_prefix_identifier` but received ''"): - await async_client.addressing.prefixes.bgp_prefixes.with_raw_response.update( - "", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - prefix_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - @pytest.mark.skip() - @parametrize - async def test_method_list(self, async_client: AsyncCloudflare) -> None: - bgp_prefix = await async_client.addressing.prefixes.bgp_prefixes.list( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(Optional[BGPPrefixListResponse], bgp_prefix, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.addressing.prefixes.bgp_prefixes.with_raw_response.list( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - bgp_prefix = await response.parse() - assert_matches_type(Optional[BGPPrefixListResponse], bgp_prefix, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.addressing.prefixes.bgp_prefixes.with_streaming_response.list( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - bgp_prefix = await response.parse() - assert_matches_type(Optional[BGPPrefixListResponse], bgp_prefix, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"): - await async_client.addressing.prefixes.bgp_prefixes.with_raw_response.list( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_identifier` but received ''"): - await async_client.addressing.prefixes.bgp_prefixes.with_raw_response.list( - "", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - @pytest.mark.skip() - @parametrize - async def test_method_get(self, async_client: AsyncCloudflare) -> None: - bgp_prefix = await async_client.addressing.prefixes.bgp_prefixes.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - prefix_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(BGPPrefixGetResponse, bgp_prefix, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: - response = await async_client.addressing.prefixes.bgp_prefixes.with_raw_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - prefix_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - bgp_prefix = await response.parse() - assert_matches_type(BGPPrefixGetResponse, bgp_prefix, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: - async with async_client.addressing.prefixes.bgp_prefixes.with_streaming_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - prefix_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - bgp_prefix = await response.parse() - assert_matches_type(BGPPrefixGetResponse, bgp_prefix, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"): - await async_client.addressing.prefixes.bgp_prefixes.with_raw_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="", - prefix_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_identifier` but received ''"): - await async_client.addressing.prefixes.bgp_prefixes.with_raw_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - prefix_identifier="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `bgp_prefix_identifier` but received ''"): - await async_client.addressing.prefixes.bgp_prefixes.with_raw_response.get( - "", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - prefix_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) diff --git a/tests/api_resources/addressing/prefixes/test_bindings.py b/tests/api_resources/addressing/prefixes/test_bindings.py deleted file mode 100644 index e3797c2a131..00000000000 --- a/tests/api_resources/addressing/prefixes/test_bindings.py +++ /dev/null @@ -1,513 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from cloudflare import Cloudflare, AsyncCloudflare -from tests.utils import assert_matches_type -from cloudflare.types.addressing.prefixes import ( - BindingGetResponse, - BindingListResponse, - BindingCreateResponse, - BindingDeleteResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestBindings: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @pytest.mark.skip() - @parametrize - def test_method_create(self, client: Cloudflare) -> None: - binding = client.addressing.prefixes.bindings.create( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(BindingCreateResponse, binding, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_method_create_with_all_params(self, client: Cloudflare) -> None: - binding = client.addressing.prefixes.bindings.create( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - cidr="192.0.2.0/24", - service_id="2db684ee7ca04e159946fd05b99e1bcd", - ) - assert_matches_type(BindingCreateResponse, binding, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_raw_response_create(self, client: Cloudflare) -> None: - response = client.addressing.prefixes.bindings.with_raw_response.create( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - binding = response.parse() - assert_matches_type(BindingCreateResponse, binding, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_streaming_response_create(self, client: Cloudflare) -> None: - with client.addressing.prefixes.bindings.with_streaming_response.create( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - binding = response.parse() - assert_matches_type(BindingCreateResponse, binding, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - def test_path_params_create(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"): - client.addressing.prefixes.bindings.with_raw_response.create( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_identifier` but received ''"): - client.addressing.prefixes.bindings.with_raw_response.create( - "", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - @pytest.mark.skip() - @parametrize - def test_method_list(self, client: Cloudflare) -> None: - binding = client.addressing.prefixes.bindings.list( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(BindingListResponse, binding, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.addressing.prefixes.bindings.with_raw_response.list( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - binding = response.parse() - assert_matches_type(BindingListResponse, binding, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.addressing.prefixes.bindings.with_streaming_response.list( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - binding = response.parse() - assert_matches_type(BindingListResponse, binding, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - def test_path_params_list(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"): - client.addressing.prefixes.bindings.with_raw_response.list( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_identifier` but received ''"): - client.addressing.prefixes.bindings.with_raw_response.list( - "", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - @pytest.mark.skip() - @parametrize - def test_method_delete(self, client: Cloudflare) -> None: - binding = client.addressing.prefixes.bindings.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - prefix_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(BindingDeleteResponse, binding, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_raw_response_delete(self, client: Cloudflare) -> None: - response = client.addressing.prefixes.bindings.with_raw_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - prefix_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - binding = response.parse() - assert_matches_type(BindingDeleteResponse, binding, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_streaming_response_delete(self, client: Cloudflare) -> None: - with client.addressing.prefixes.bindings.with_streaming_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - prefix_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - binding = response.parse() - assert_matches_type(BindingDeleteResponse, binding, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - def test_path_params_delete(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"): - client.addressing.prefixes.bindings.with_raw_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="", - prefix_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_identifier` but received ''"): - client.addressing.prefixes.bindings.with_raw_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - prefix_identifier="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `binding_identifier` but received ''"): - client.addressing.prefixes.bindings.with_raw_response.delete( - "", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - prefix_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - @pytest.mark.skip() - @parametrize - def test_method_get(self, client: Cloudflare) -> None: - binding = client.addressing.prefixes.bindings.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - prefix_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(BindingGetResponse, binding, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_raw_response_get(self, client: Cloudflare) -> None: - response = client.addressing.prefixes.bindings.with_raw_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - prefix_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - binding = response.parse() - assert_matches_type(BindingGetResponse, binding, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_streaming_response_get(self, client: Cloudflare) -> None: - with client.addressing.prefixes.bindings.with_streaming_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - prefix_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - binding = response.parse() - assert_matches_type(BindingGetResponse, binding, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"): - client.addressing.prefixes.bindings.with_raw_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="", - prefix_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_identifier` but received ''"): - client.addressing.prefixes.bindings.with_raw_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - prefix_identifier="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `binding_identifier` but received ''"): - client.addressing.prefixes.bindings.with_raw_response.get( - "", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - prefix_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - -class TestAsyncBindings: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @pytest.mark.skip() - @parametrize - async def test_method_create(self, async_client: AsyncCloudflare) -> None: - binding = await async_client.addressing.prefixes.bindings.create( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(BindingCreateResponse, binding, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: - binding = await async_client.addressing.prefixes.bindings.create( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - cidr="192.0.2.0/24", - service_id="2db684ee7ca04e159946fd05b99e1bcd", - ) - assert_matches_type(BindingCreateResponse, binding, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: - response = await async_client.addressing.prefixes.bindings.with_raw_response.create( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - binding = await response.parse() - assert_matches_type(BindingCreateResponse, binding, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: - async with async_client.addressing.prefixes.bindings.with_streaming_response.create( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - binding = await response.parse() - assert_matches_type(BindingCreateResponse, binding, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"): - await async_client.addressing.prefixes.bindings.with_raw_response.create( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_identifier` but received ''"): - await async_client.addressing.prefixes.bindings.with_raw_response.create( - "", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - @pytest.mark.skip() - @parametrize - async def test_method_list(self, async_client: AsyncCloudflare) -> None: - binding = await async_client.addressing.prefixes.bindings.list( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(BindingListResponse, binding, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.addressing.prefixes.bindings.with_raw_response.list( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - binding = await response.parse() - assert_matches_type(BindingListResponse, binding, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.addressing.prefixes.bindings.with_streaming_response.list( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - binding = await response.parse() - assert_matches_type(BindingListResponse, binding, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"): - await async_client.addressing.prefixes.bindings.with_raw_response.list( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_identifier` but received ''"): - await async_client.addressing.prefixes.bindings.with_raw_response.list( - "", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - @pytest.mark.skip() - @parametrize - async def test_method_delete(self, async_client: AsyncCloudflare) -> None: - binding = await async_client.addressing.prefixes.bindings.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - prefix_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(BindingDeleteResponse, binding, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: - response = await async_client.addressing.prefixes.bindings.with_raw_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - prefix_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - binding = await response.parse() - assert_matches_type(BindingDeleteResponse, binding, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: - async with async_client.addressing.prefixes.bindings.with_streaming_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - prefix_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - binding = await response.parse() - assert_matches_type(BindingDeleteResponse, binding, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"): - await async_client.addressing.prefixes.bindings.with_raw_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="", - prefix_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_identifier` but received ''"): - await async_client.addressing.prefixes.bindings.with_raw_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - prefix_identifier="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `binding_identifier` but received ''"): - await async_client.addressing.prefixes.bindings.with_raw_response.delete( - "", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - prefix_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - @pytest.mark.skip() - @parametrize - async def test_method_get(self, async_client: AsyncCloudflare) -> None: - binding = await async_client.addressing.prefixes.bindings.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - prefix_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(BindingGetResponse, binding, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: - response = await async_client.addressing.prefixes.bindings.with_raw_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - prefix_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - binding = await response.parse() - assert_matches_type(BindingGetResponse, binding, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: - async with async_client.addressing.prefixes.bindings.with_streaming_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - prefix_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - binding = await response.parse() - assert_matches_type(BindingGetResponse, binding, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"): - await async_client.addressing.prefixes.bindings.with_raw_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="", - prefix_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `prefix_identifier` but received ''"): - await async_client.addressing.prefixes.bindings.with_raw_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - prefix_identifier="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `binding_identifier` but received ''"): - await async_client.addressing.prefixes.bindings.with_raw_response.get( - "", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - prefix_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) diff --git a/tests/api_resources/addressing/test_services.py b/tests/api_resources/addressing/test_services.py deleted file mode 100644 index 01e9e2224cd..00000000000 --- a/tests/api_resources/addressing/test_services.py +++ /dev/null @@ -1,106 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from cloudflare import Cloudflare, AsyncCloudflare -from tests.utils import assert_matches_type -from cloudflare.types.addressing import ServiceListResponse - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestServices: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @pytest.mark.skip() - @parametrize - def test_method_list(self, client: Cloudflare) -> None: - service = client.addressing.services.list( - "023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(ServiceListResponse, service, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.addressing.services.with_raw_response.list( - "023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - service = response.parse() - assert_matches_type(ServiceListResponse, service, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.addressing.services.with_streaming_response.list( - "023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - service = response.parse() - assert_matches_type(ServiceListResponse, service, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - def test_path_params_list(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"): - client.addressing.services.with_raw_response.list( - "", - ) - - -class TestAsyncServices: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @pytest.mark.skip() - @parametrize - async def test_method_list(self, async_client: AsyncCloudflare) -> None: - service = await async_client.addressing.services.list( - "023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(ServiceListResponse, service, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.addressing.services.with_raw_response.list( - "023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - service = await response.parse() - assert_matches_type(ServiceListResponse, service, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.addressing.services.with_streaming_response.list( - "023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - service = await response.parse() - assert_matches_type(ServiceListResponse, service, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"): - await async_client.addressing.services.with_raw_response.list( - "", - )