diff --git a/api.md b/api.md index 7425f2f0d4d..f695333d2b8 100644 --- a/api.md +++ b/api.md @@ -104,13 +104,13 @@ Methods: Types: ```python -from cloudflare.types import User, UserListResponse, UserEditResponse +from cloudflare.types import User, UserEditResponse, UserGetResponse ``` Methods: -- client.user.list() -> UserListResponse - client.user.edit(\*\*params) -> UserEditResponse +- client.user.get() -> UserGetResponse ## AuditLogs @@ -131,24 +131,24 @@ Methods: Types: ```python -from cloudflare.types.user.billing import HistoryListResponse +from cloudflare.types.user.billing import HistoryGetResponse ``` Methods: -- client.user.billing.history.list(\*\*params) -> SyncV4PagePaginationArray[HistoryListResponse] +- client.user.billing.history.get(\*\*params) -> Optional ### Profiles Types: ```python -from cloudflare.types.user.billing import ProfileListResponse +from cloudflare.types.user.billing import ProfileGetResponse ``` Methods: -- client.user.billing.profiles.list() -> ProfileListResponse +- client.user.billing.profiles.get() -> ProfileGetResponse ## Firewall @@ -297,18 +297,18 @@ Types: ```python from cloudflare.types.user import ( SubscriptionUpdateResponse, - SubscriptionListResponse, SubscriptionDeleteResponse, SubscriptionEditResponse, + SubscriptionGetResponse, ) ``` Methods: - client.user.subscriptions.update(identifier, \*\*params) -> SubscriptionUpdateResponse -- client.user.subscriptions.list() -> Optional - client.user.subscriptions.delete(identifier) -> SubscriptionDeleteResponse - client.user.subscriptions.edit(identifier, \*\*params) -> SubscriptionEditResponse +- client.user.subscriptions.get() -> Optional ## Tokens @@ -397,13 +397,13 @@ Methods: Types: ```python -from cloudflare.types.zones import SettingListResponse, SettingEditResponse +from cloudflare.types.zones import SettingEditResponse, SettingGetResponse ``` Methods: -- client.zones.settings.list(\*, zone_id) -> Optional - client.zones.settings.edit(\*, zone_id, \*\*params) -> Optional +- client.zones.settings.get(\*, zone_id) -> Optional ### ZeroRTT @@ -1228,12 +1228,12 @@ Methods: Types: ```python -from cloudflare.types.load_balancers.monitors import ReferenceListResponse +from cloudflare.types.load_balancers.monitors import ReferenceGetResponse ``` Methods: -- client.load_balancers.monitors.references.list(monitor_id, \*, account_id) -> Optional +- client.load_balancers.monitors.references.get(monitor_id, \*, account_id) -> Optional ## Pools @@ -1277,12 +1277,12 @@ Methods: Types: ```python -from cloudflare.types.load_balancers.pools import ReferenceListResponse +from cloudflare.types.load_balancers.pools import ReferenceGetResponse ``` Methods: -- client.load_balancers.pools.references.list(pool_id, \*, account_id) -> Optional +- client.load_balancers.pools.references.get(pool_id, \*, account_id) -> Optional ## Previews @@ -1314,12 +1314,12 @@ Methods: Types: ```python -from cloudflare.types.load_balancers import SearchListResponse +from cloudflare.types.load_balancers import SearchGetResponse ``` Methods: -- client.load_balancers.searches.list(\*, account_id, \*\*params) -> Optional +- client.load_balancers.searches.get(\*, account_id, \*\*params) -> Optional # Cache @@ -1339,18 +1339,18 @@ Types: ```python from cloudflare.types.cache import ( - CacheReserveListResponse, CacheReserveClearResponse, CacheReserveEditResponse, + CacheReserveGetResponse, CacheReserveStatusResponse, ) ``` Methods: -- client.cache.cache_reserve.list(\*, zone_id) -> CacheReserveListResponse - client.cache.cache_reserve.clear(\*, zone_id) -> CacheReserveClearResponse - client.cache.cache_reserve.edit(\*, zone_id, \*\*params) -> CacheReserveEditResponse +- client.cache.cache_reserve.get(\*, zone_id) -> CacheReserveGetResponse - client.cache.cache_reserve.status(\*, zone_id) -> CacheReserveStatusResponse ## SmartTieredCached @@ -1376,14 +1376,14 @@ Methods: Types: ```python -from cloudflare.types.cache import VariantListResponse, VariantDeleteResponse, VariantEditResponse +from cloudflare.types.cache import VariantDeleteResponse, VariantEditResponse, VariantGetResponse ``` Methods: -- client.cache.variants.list(\*, zone_id) -> VariantListResponse - client.cache.variants.delete(\*, zone_id) -> VariantDeleteResponse - client.cache.variants.edit(\*, zone_id, \*\*params) -> VariantEditResponse +- client.cache.variants.get(\*, zone_id) -> VariantGetResponse ## RegionalTieredCache @@ -1449,24 +1449,24 @@ Methods: Types: ```python -from cloudflare.types.ssl.certificate_packs import QuotaListResponse +from cloudflare.types.ssl.certificate_packs import QuotaGetResponse ``` Methods: -- client.ssl.certificate_packs.quota.list(\*, zone_id) -> QuotaListResponse +- client.ssl.certificate_packs.quota.get(\*, zone_id) -> QuotaGetResponse ## Recommendations Types: ```python -from cloudflare.types.ssl import RecommendationListResponse +from cloudflare.types.ssl import RecommendationGetResponse ``` Methods: -- client.ssl.recommendations.list(zone_identifier) -> Optional +- client.ssl.recommendations.get(zone_identifier) -> Optional ## Universal @@ -1488,13 +1488,13 @@ Methods: Types: ```python -from cloudflare.types.ssl import VerificationListResponse, VerificationEditResponse +from cloudflare.types.ssl import VerificationEditResponse, VerificationGetResponse ``` Methods: -- client.ssl.verification.list(\*, zone_id, \*\*params) -> Optional - client.ssl.verification.edit(certificate_pack_id, \*, zone_id, \*\*params) -> VerificationEditResponse +- client.ssl.verification.get(\*, zone_id, \*\*params) -> Optional # Subscriptions @@ -1579,12 +1579,12 @@ Methods: Types: ```python -from cloudflare.types import AvailableRatePlanListResponse +from cloudflare.types import AvailableRatePlanGetResponse ``` Methods: -- client.available_rate_plans.list(zone_identifier) -> Optional +- client.available_rate_plans.get(zone_identifier) -> Optional # CertificateAuthorities @@ -1595,14 +1595,14 @@ Types: ```python from cloudflare.types.certificate_authorities import ( HostnameAssociationUpdateResponse, - HostnameAssociationListResponse, + HostnameAssociationGetResponse, ) ``` Methods: - client.certificate_authorities.hostname_associations.update(\*, zone_id, \*\*params) -> HostnameAssociationUpdateResponse -- client.certificate_authorities.hostname_associations.list(\*, zone_id, \*\*params) -> HostnameAssociationListResponse +- client.certificate_authorities.hostname_associations.get(\*, zone_id, \*\*params) -> HostnameAssociationGetResponse # ClientCertificates @@ -1707,9 +1707,9 @@ Types: ```python from cloudflare.types import ( CustomNameserverCreateResponse, - CustomNameserverListResponse, CustomNameserverDeleteResponse, CustomNameserverAvailabiltyResponse, + CustomNameserverGetResponse, CustomNameserverVerifyResponse, ) ``` @@ -1717,9 +1717,9 @@ from cloudflare.types import ( Methods: - client.custom_nameservers.create(\*, account_id, \*\*params) -> CustomNameserverCreateResponse -- client.custom_nameservers.list(\*, account_id) -> Optional - client.custom_nameservers.delete(custom_ns_id, \*, account_id) -> Optional - client.custom_nameservers.availabilty(\*, account_id) -> Optional +- client.custom_nameservers.get(\*, account_id) -> Optional - client.custom_nameservers.verify(\*, account_id) -> Optional # DNS @@ -1762,24 +1762,24 @@ Methods: Types: ```python -from cloudflare.types.dns.analytics import ReportListResponse +from cloudflare.types.dns.analytics import ReportGetResponse ``` Methods: -- client.dns.analytics.reports.list(identifier, \*\*params) -> ReportListResponse +- client.dns.analytics.reports.get(identifier, \*\*params) -> ReportGetResponse #### Bytimes Types: ```python -from cloudflare.types.dns.analytics.reports import BytimeListResponse +from cloudflare.types.dns.analytics.reports import BytimeGetResponse ``` Methods: -- client.dns.analytics.reports.bytimes.list(identifier, \*\*params) -> BytimeListResponse +- client.dns.analytics.reports.bytimes.get(identifier, \*\*params) -> BytimeGetResponse ## Firewall @@ -1810,24 +1810,24 @@ Methods: Types: ```python -from cloudflare.types.dns.firewall.analytics import ReportListResponse +from cloudflare.types.dns.firewall.analytics import ReportGetResponse ``` Methods: -- client.dns.firewall.analytics.reports.list(identifier, \*, account_identifier, \*\*params) -> ReportListResponse +- client.dns.firewall.analytics.reports.get(identifier, \*, account_identifier, \*\*params) -> ReportGetResponse ##### Bytimes Types: ```python -from cloudflare.types.dns.firewall.analytics.reports import BytimeListResponse +from cloudflare.types.dns.firewall.analytics.reports import BytimeGetResponse ``` Methods: -- client.dns.firewall.analytics.reports.bytimes.list(identifier, \*, account_identifier, \*\*params) -> BytimeListResponse +- client.dns.firewall.analytics.reports.bytimes.get(identifier, \*, account_identifier, \*\*params) -> BytimeGetResponse # DNSSEC @@ -1935,8 +1935,8 @@ Types: ```python from cloudflare.types.email_routing.routing import ( AddressCreateResponse, + AddressListResponse, AddressDeleteResponse, - AddressEmailRoutingDestinationAddressesListDestinationAddressesResponse, AddressGetResponse, ) ``` @@ -1944,8 +1944,8 @@ from cloudflare.types.email_routing.routing import ( Methods: - client.email_routing.routing.addresses.create(account_identifier, \*\*params) -> AddressCreateResponse +- client.email_routing.routing.addresses.list(account_identifier, \*\*params) -> SyncV4PagePaginationArray[AddressListResponse] - client.email_routing.routing.addresses.delete(destination_address_identifier, \*, account_identifier) -> AddressDeleteResponse -- client.email_routing.routing.addresses.email_routing_destination_addresses_list_destination_addresses(account_identifier, \*\*params) -> Optional - client.email_routing.routing.addresses.get(destination_address_identifier, \*, account_identifier) -> AddressGetResponse # Filters @@ -2208,24 +2208,24 @@ Methods: Types: ```python -from cloudflare.types.logpush.datasets import FieldListResponse +from cloudflare.types.logpush.datasets import FieldGetResponse ``` Methods: -- client.logpush.datasets.fields.list(dataset_id, \*, account_id, zone_id) -> object +- client.logpush.datasets.fields.get(dataset_id, \*, account_id, zone_id) -> object ### Jobs Types: ```python -from cloudflare.types.logpush.datasets import JobListResponse +from cloudflare.types.logpush.datasets import JobGetResponse ``` Methods: -- client.logpush.datasets.jobs.list(dataset_id, \*, account_id, zone_id) -> JobListResponse +- client.logpush.datasets.jobs.get(dataset_id, \*, account_id, zone_id) -> JobGetResponse ## Edge @@ -2290,25 +2290,22 @@ Methods: # Logs -## Controls +## Control -### Retentions +### Retention -#### Flags +#### Flag Types: ```python -from cloudflare.types.logs.controls.retentions import ( - FlagCreateResponse, - FlagLogsReceivedGetLogRetentionFlagResponse, -) +from cloudflare.types.logs.control.retention import FlagCreateResponse, FlagGetResponse ``` Methods: -- client.logs.controls.retentions.flags.create(zone_identifier, \*\*params) -> FlagCreateResponse -- client.logs.controls.retentions.flags.logs_received_get_log_retention_flag(zone_identifier) -> FlagLogsReceivedGetLogRetentionFlagResponse +- client.logs.control.retention.flag.create(zone_identifier, \*\*params) -> FlagCreateResponse +- client.logs.control.retention.flag.get(zone_identifier) -> FlagGetResponse ### Cmb @@ -2317,7 +2314,7 @@ Methods: Types: ```python -from cloudflare.types.logs.controls.cmb import ( +from cloudflare.types.logs.control.cmb import ( ConfigCreateResponse, ConfigDeleteResponse, ConfigGetResponse, @@ -2326,11 +2323,11 @@ from cloudflare.types.logs.controls.cmb import ( Methods: -- client.logs.controls.cmb.config.create(\*, account_id, \*\*params) -> Optional -- client.logs.controls.cmb.config.delete(\*, account_id) -> Optional -- client.logs.controls.cmb.config.get(\*, account_id) -> Optional +- client.logs.control.cmb.config.create(\*, account_id, \*\*params) -> Optional +- client.logs.control.cmb.config.delete(\*, account_id) -> Optional +- client.logs.control.cmb.config.get(\*, account_id) -> Optional -## Rayids +## Rayid Types: @@ -2340,7 +2337,7 @@ from cloudflare.types.logs import RayidGetResponse Methods: -- client.logs.rayids.get(ray_identifier, \*, zone_identifier, \*\*params) -> RayidGetResponse +- client.logs.rayid.get(ray_identifier, \*, zone_identifier, \*\*params) -> RayidGetResponse ## Received @@ -2359,12 +2356,12 @@ Methods: Types: ```python -from cloudflare.types.logs.received import FieldListResponse +from cloudflare.types.logs.received import FieldGetResponse ``` Methods: -- client.logs.received.fields.list(zone_identifier) -> FieldListResponse +- client.logs.received.fields.get(zone_identifier) -> FieldGetResponse # OriginTLSClientAuth @@ -2775,14 +2772,14 @@ Types: ```python from cloudflare.types.web3.hostnames.ipfs_universal_paths import ( ContentListUpdateResponse, - ContentListListResponse, + ContentListGetResponse, ) ``` Methods: - client.web3.hostnames.ipfs_universal_paths.content_lists.update(identifier, \*, zone_identifier, \*\*params) -> ContentListUpdateResponse -- client.web3.hostnames.ipfs_universal_paths.content_lists.list(identifier, \*, zone_identifier) -> ContentListListResponse +- client.web3.hostnames.ipfs_universal_paths.content_lists.get(identifier, \*, zone_identifier) -> ContentListGetResponse ##### Entries @@ -2840,43 +2837,39 @@ Methods: Types: ```python -from cloudflare.types.workers.scripts import BindingListResponse +from cloudflare.types.workers.scripts import BindingGetResponse ``` Methods: -- client.workers.scripts.bindings.list(\*, zone_id) -> BindingListResponse +- client.workers.scripts.bindings.get(\*, zone_id) -> BindingGetResponse ### Schedules Types: ```python -from cloudflare.types.workers.scripts import ScheduleUpdateResponse, ScheduleListResponse +from cloudflare.types.workers.scripts import ScheduleUpdateResponse, ScheduleGetResponse ``` Methods: - client.workers.scripts.schedules.update(script_name, \*, account_id, \*\*params) -> ScheduleUpdateResponse -- client.workers.scripts.schedules.list(script_name, \*, account_id) -> ScheduleListResponse +- client.workers.scripts.schedules.get(script_name, \*, account_id) -> ScheduleGetResponse ### Tail Types: ```python -from cloudflare.types.workers.scripts import ( - TailCreateResponse, - TailListResponse, - TailDeleteResponse, -) +from cloudflare.types.workers.scripts import TailCreateResponse, TailDeleteResponse, TailGetResponse ``` Methods: - client.workers.scripts.tail.create(script_name, \*, account_id) -> TailCreateResponse -- client.workers.scripts.tail.list(script_name, \*, account_id) -> TailListResponse - client.workers.scripts.tail.delete(id, \*, account_id, script_name) -> TailDeleteResponse +- client.workers.scripts.tail.get(script_name, \*, account_id) -> TailGetResponse ### UsageModel @@ -2984,13 +2977,24 @@ Methods: Types: ```python -from cloudflare.types.workers.deployments import ByScriptListResponse, ByScriptGetResponse +from cloudflare.types.workers.deployments import ByScriptGetResponse +``` + +Methods: + +- client.workers.deployments.by_scripts.get(script_id, \*, account_id) -> ByScriptGetResponse + +#### Details + +Types: + +```python +from cloudflare.types.workers.deployments.by_scripts import DetailGetResponse ``` Methods: -- client.workers.deployments.by_scripts.list(script_id, \*, account_id) -> ByScriptListResponse -- client.workers.deployments.by_scripts.get(deployment_id, \*, account_id, script_id) -> ByScriptGetResponse +- client.workers.deployments.by_scripts.details.get(deployment_id, \*, account_id, script_id) -> DetailGetResponse ## Domains @@ -3183,8 +3187,8 @@ Types: from cloudflare.types.queues import ( ConsumerCreateResponse, ConsumerUpdateResponse, - ConsumerListResponse, ConsumerDeleteResponse, + ConsumerGetResponse, ) ``` @@ -3192,8 +3196,8 @@ Methods: - client.queues.consumers.create(name, \*, account_id, \*\*params) -> Optional - client.queues.consumers.update(consumer_name, \*, account_id, name, \*\*params) -> Optional -- client.queues.consumers.list(name, \*, account_id) -> Optional - client.queues.consumers.delete(consumer_name, \*, account_id, name) -> Optional +- client.queues.consumers.get(name, \*, account_id) -> Optional # ManagedHeaders @@ -3526,12 +3530,12 @@ Methods: Types: ```python -from cloudflare.types.addressing.loa_documents import DownloadListResponse +from cloudflare.types.addressing.loa_documents import DownloadGetResponse ``` Methods: -- client.addressing.loa_documents.downloads.list(loa_document_id, \*, account_id) -> object +- client.addressing.loa_documents.downloads.get(loa_document_id, \*, account_id) -> object ## Prefixes @@ -3798,12 +3802,12 @@ Methods: Types: ```python -from cloudflare.types.intel.asn import SubnetListResponse +from cloudflare.types.intel.asn import SubnetGetResponse ``` Methods: -- client.intel.asn.subnets.list(asn, \*, account_id) -> SubnetListResponse +- client.intel.asn.subnets.get(asn, \*, account_id) -> SubnetGetResponse ## DNS @@ -3841,17 +3845,17 @@ Methods: - client.intel.domains.bulks.get(\*, account_id, \*\*params) -> Optional -## DomainHistories +## DomainHistory Types: ```python -from cloudflare.types.intel import DomainHistoryListResponse +from cloudflare.types.intel import DomainHistoryGetResponse ``` Methods: -- client.intel.domain_histories.list(\*, account_id, \*\*params) -> Optional +- client.intel.domain_history.get(\*, account_id, \*\*params) -> Optional ## IPs @@ -4006,28 +4010,18 @@ from cloudflare.types.magic_transit import ( IPSECTunnelListResponse, IPSECTunnelDeleteResponse, IPSECTunnelGetResponse, + IPSECTunnelPSKGenerateResponse, ) ``` Methods: -- client.magic_transit.ipsec_tunnels.create(account_identifier, \*\*params) -> IPSECTunnelCreateResponse -- client.magic_transit.ipsec_tunnels.update(tunnel_identifier, \*, account_identifier, \*\*params) -> IPSECTunnelUpdateResponse -- client.magic_transit.ipsec_tunnels.list(account_identifier) -> IPSECTunnelListResponse -- client.magic_transit.ipsec_tunnels.delete(tunnel_identifier, \*, account_identifier) -> IPSECTunnelDeleteResponse -- client.magic_transit.ipsec_tunnels.get(tunnel_identifier, \*, account_identifier) -> IPSECTunnelGetResponse - -### PSKGenerates - -Types: - -```python -from cloudflare.types.magic_transit.ipsec_tunnels import PSKGenerateCreateResponse -``` - -Methods: - -- client.magic_transit.ipsec_tunnels.psk_generates.create(tunnel_identifier, \*, account_identifier) -> PSKGenerateCreateResponse +- client.magic_transit.ipsec_tunnels.create(account_identifier, \*\*params) -> IPSECTunnelCreateResponse +- client.magic_transit.ipsec_tunnels.update(tunnel_identifier, \*, account_identifier, \*\*params) -> IPSECTunnelUpdateResponse +- client.magic_transit.ipsec_tunnels.list(account_identifier) -> IPSECTunnelListResponse +- client.magic_transit.ipsec_tunnels.delete(tunnel_identifier, \*, account_identifier) -> IPSECTunnelDeleteResponse +- client.magic_transit.ipsec_tunnels.get(tunnel_identifier, \*, account_identifier) -> IPSECTunnelGetResponse +- client.magic_transit.ipsec_tunnels.psk_generate(tunnel_identifier, \*, account_identifier) -> IPSECTunnelPSKGenerateResponse ## Routes @@ -4063,9 +4057,9 @@ Types: from cloudflare.types.magic_network_monitoring import ( ConfigCreateResponse, ConfigUpdateResponse, - ConfigListResponse, ConfigDeleteResponse, ConfigEditResponse, + ConfigGetResponse, ) ``` @@ -4073,21 +4067,21 @@ Methods: - client.magic_network_monitoring.configs.create(account_identifier) -> ConfigCreateResponse - client.magic_network_monitoring.configs.update(account_identifier) -> ConfigUpdateResponse -- client.magic_network_monitoring.configs.list(account_identifier) -> ConfigListResponse - client.magic_network_monitoring.configs.delete(account_identifier) -> ConfigDeleteResponse - client.magic_network_monitoring.configs.edit(account_identifier) -> ConfigEditResponse +- client.magic_network_monitoring.configs.get(account_identifier) -> ConfigGetResponse -### Fulls +### Full Types: ```python -from cloudflare.types.magic_network_monitoring.configs import FullListResponse +from cloudflare.types.magic_network_monitoring.configs import FullGetResponse ``` Methods: -- client.magic_network_monitoring.configs.fulls.list(account_identifier) -> FullListResponse +- client.magic_network_monitoring.configs.full.get(account_identifier) -> FullGetResponse ## Rules @@ -4150,12 +4144,12 @@ Methods: Types: ```python -from cloudflare.types.mtls_certificates import AssociationListResponse +from cloudflare.types.mtls_certificates import AssociationGetResponse ``` Methods: -- client.mtls_certificates.associations.list(mtls_certificate_id, \*, account_id) -> Optional +- client.mtls_certificates.associations.get(mtls_certificate_id, \*, account_id) -> Optional # Pages @@ -4214,12 +4208,12 @@ Methods: Types: ```python -from cloudflare.types.pages.projects.deployments.history import LogListResponse +from cloudflare.types.pages.projects.deployments.history import LogGetResponse ``` Methods: -- client.pages.projects.deployments.history.logs.list(deployment_id, \*, account_id, project_name) -> LogListResponse +- client.pages.projects.deployments.history.logs.get(deployment_id, \*, account_id, project_name) -> LogGetResponse ### Domains @@ -4305,7 +4299,7 @@ Methods: Types: ```python -from cloudflare.types.request_tracers import TraceCreateResponse +from cloudflare.types.request_tracers import RequestTracerTrace, TraceCreateResponse ``` Methods: @@ -4406,19 +4400,19 @@ Types: ```python from cloudflare.types.stream import ( - AudioTrackCreateResponse, - AudioTrackListResponse, AudioTrackDeleteResponse, + AudioTrackCopyResponse, AudioTrackEditResponse, + AudioTrackGetResponse, ) ``` Methods: -- client.stream.audio_tracks.create(identifier, \*, account_id, \*\*params) -> AudioTrackCreateResponse -- client.stream.audio_tracks.list(identifier, \*, account_id) -> AudioTrackListResponse - client.stream.audio_tracks.delete(audio_identifier, \*, account_id, identifier) -> AudioTrackDeleteResponse +- client.stream.audio_tracks.copy(identifier, \*, account_id, \*\*params) -> AudioTrackCopyResponse - client.stream.audio_tracks.edit(audio_identifier, \*, account_id, identifier, \*\*params) -> AudioTrackEditResponse +- client.stream.audio_tracks.get(identifier, \*, account_id) -> AudioTrackGetResponse ## Videos @@ -4473,14 +4467,14 @@ Methods: Types: ```python -from cloudflare.types.stream import KeyCreateResponse, KeyListResponse, KeyDeleteResponse +from cloudflare.types.stream import KeyCreateResponse, KeyDeleteResponse, KeyGetResponse ``` Methods: - client.stream.keys.create(\*, account_id) -> KeyCreateResponse -- client.stream.keys.list(\*, account_id) -> KeyListResponse - client.stream.keys.delete(identifier, \*, account_id) -> KeyDeleteResponse +- client.stream.keys.get(\*, account_id) -> KeyGetResponse ## LiveInputs @@ -4561,18 +4555,14 @@ Methods: Types: ```python -from cloudflare.types.stream import ( - CaptionUpdateResponse, - CaptionListResponse, - CaptionDeleteResponse, -) +from cloudflare.types.stream import CaptionUpdateResponse, CaptionDeleteResponse, CaptionGetResponse ``` Methods: - client.stream.captions.update(language, \*, account_id, identifier, \*\*params) -> CaptionUpdateResponse -- client.stream.captions.list(identifier, \*, account_id) -> CaptionListResponse - client.stream.captions.delete(language, \*, account_id, identifier) -> CaptionDeleteResponse +- client.stream.captions.get(identifier, \*, account_id) -> CaptionGetResponse ## Downloads @@ -4581,28 +4571,28 @@ Types: ```python from cloudflare.types.stream import ( DownloadCreateResponse, - DownloadListResponse, DownloadDeleteResponse, + DownloadGetResponse, ) ``` Methods: - client.stream.downloads.create(identifier, \*, account_id) -> DownloadCreateResponse -- client.stream.downloads.list(identifier, \*, account_id) -> DownloadListResponse - client.stream.downloads.delete(identifier, \*, account_id) -> DownloadDeleteResponse +- client.stream.downloads.get(identifier, \*, account_id) -> DownloadGetResponse ## Embeds Types: ```python -from cloudflare.types.stream import EmbedListResponse +from cloudflare.types.stream import EmbedGetResponse ``` Methods: -- client.stream.embeds.list(identifier, \*, account_id) -> object +- client.stream.embeds.get(identifier, \*, account_id) -> object ## Tokens @@ -5415,12 +5405,12 @@ Methods: Types: ```python -from cloudflare.types.zero_trust.access.users import LastSeenIdentityListResponse +from cloudflare.types.zero_trust.access.users import LastSeenIdentityGetResponse ``` Methods: -- client.zero_trust.access.users.last_seen_identity.list(id, \*, identifier) -> LastSeenIdentityListResponse +- client.zero_trust.access.users.last_seen_identity.get(id, \*, identifier) -> LastSeenIdentityGetResponse #### FailedLogins @@ -5633,27 +5623,27 @@ Types: ```python from cloudflare.types.zero_trust.tunnels import ( ConfigurationUpdateResponse, - ConfigurationListResponse, + ConfigurationGetResponse, ) ``` Methods: - client.zero_trust.tunnels.configurations.update(tunnel_id, \*, account_id, \*\*params) -> ConfigurationUpdateResponse -- client.zero_trust.tunnels.configurations.list(tunnel_id, \*, account_id) -> ConfigurationListResponse +- client.zero_trust.tunnels.configurations.get(tunnel_id, \*, account_id) -> ConfigurationGetResponse ### Connections Types: ```python -from cloudflare.types.zero_trust.tunnels import ConnectionListResponse, ConnectionDeleteResponse +from cloudflare.types.zero_trust.tunnels import ConnectionDeleteResponse, ConnectionGetResponse ``` Methods: -- client.zero_trust.tunnels.connections.list(tunnel_id, \*, account_id) -> Optional - client.zero_trust.tunnels.connections.delete(tunnel_id, \*, account_id, \*\*params) -> ConnectionDeleteResponse +- client.zero_trust.tunnels.connections.get(tunnel_id, \*, account_id) -> Optional ### Token diff --git a/src/cloudflare/resources/addressing/loa_documents/downloads.py b/src/cloudflare/resources/addressing/loa_documents/downloads.py index f201c6be6d6..29a52355515 100644 --- a/src/cloudflare/resources/addressing/loa_documents/downloads.py +++ b/src/cloudflare/resources/addressing/loa_documents/downloads.py @@ -31,7 +31,7 @@ def with_raw_response(self) -> DownloadsWithRawResponse: def with_streaming_response(self) -> DownloadsWithStreamingResponse: return DownloadsWithStreamingResponse(self) - def list( + def get( self, loa_document_id: Optional[str], *, @@ -81,7 +81,7 @@ def with_raw_response(self) -> AsyncDownloadsWithRawResponse: def with_streaming_response(self) -> AsyncDownloadsWithStreamingResponse: return AsyncDownloadsWithStreamingResponse(self) - async def list( + async def get( self, loa_document_id: Optional[str], *, @@ -126,8 +126,8 @@ class DownloadsWithRawResponse: def __init__(self, downloads: Downloads) -> None: self._downloads = downloads - self.list = to_raw_response_wrapper( - downloads.list, + self.get = to_raw_response_wrapper( + downloads.get, ) @@ -135,8 +135,8 @@ class AsyncDownloadsWithRawResponse: def __init__(self, downloads: AsyncDownloads) -> None: self._downloads = downloads - self.list = async_to_raw_response_wrapper( - downloads.list, + self.get = async_to_raw_response_wrapper( + downloads.get, ) @@ -144,8 +144,8 @@ class DownloadsWithStreamingResponse: def __init__(self, downloads: Downloads) -> None: self._downloads = downloads - self.list = to_streamed_response_wrapper( - downloads.list, + self.get = to_streamed_response_wrapper( + downloads.get, ) @@ -153,6 +153,6 @@ class AsyncDownloadsWithStreamingResponse: def __init__(self, downloads: AsyncDownloads) -> None: self._downloads = downloads - self.list = async_to_streamed_response_wrapper( - downloads.list, + self.get = async_to_streamed_response_wrapper( + downloads.get, ) diff --git a/src/cloudflare/resources/available_rate_plans.py b/src/cloudflare/resources/available_rate_plans.py index 8b3787c93ed..b7ef70afcd3 100644 --- a/src/cloudflare/resources/available_rate_plans.py +++ b/src/cloudflare/resources/available_rate_plans.py @@ -6,7 +6,7 @@ import httpx -from ..types import AvailableRatePlanListResponse +from ..types import AvailableRatePlanGetResponse from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource @@ -33,7 +33,7 @@ def with_raw_response(self) -> AvailableRatePlansWithRawResponse: def with_streaming_response(self) -> AvailableRatePlansWithStreamingResponse: return AvailableRatePlansWithStreamingResponse(self) - def list( + def get( self, zone_identifier: str, *, @@ -43,7 +43,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[AvailableRatePlanListResponse]: + ) -> Optional[AvailableRatePlanGetResponse]: """ Lists all rate plans the zone can subscribe to. @@ -69,7 +69,7 @@ def list( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[AvailableRatePlanListResponse]], ResultWrapper[AvailableRatePlanListResponse]), + cast_to=cast(Type[Optional[AvailableRatePlanGetResponse]], ResultWrapper[AvailableRatePlanGetResponse]), ) @@ -82,7 +82,7 @@ def with_raw_response(self) -> AsyncAvailableRatePlansWithRawResponse: def with_streaming_response(self) -> AsyncAvailableRatePlansWithStreamingResponse: return AsyncAvailableRatePlansWithStreamingResponse(self) - async def list( + async def get( self, zone_identifier: str, *, @@ -92,7 +92,7 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[AvailableRatePlanListResponse]: + ) -> Optional[AvailableRatePlanGetResponse]: """ Lists all rate plans the zone can subscribe to. @@ -118,7 +118,7 @@ async def list( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[AvailableRatePlanListResponse]], ResultWrapper[AvailableRatePlanListResponse]), + cast_to=cast(Type[Optional[AvailableRatePlanGetResponse]], ResultWrapper[AvailableRatePlanGetResponse]), ) @@ -126,8 +126,8 @@ class AvailableRatePlansWithRawResponse: def __init__(self, available_rate_plans: AvailableRatePlans) -> None: self._available_rate_plans = available_rate_plans - self.list = to_raw_response_wrapper( - available_rate_plans.list, + self.get = to_raw_response_wrapper( + available_rate_plans.get, ) @@ -135,8 +135,8 @@ class AsyncAvailableRatePlansWithRawResponse: def __init__(self, available_rate_plans: AsyncAvailableRatePlans) -> None: self._available_rate_plans = available_rate_plans - self.list = async_to_raw_response_wrapper( - available_rate_plans.list, + self.get = async_to_raw_response_wrapper( + available_rate_plans.get, ) @@ -144,8 +144,8 @@ class AvailableRatePlansWithStreamingResponse: def __init__(self, available_rate_plans: AvailableRatePlans) -> None: self._available_rate_plans = available_rate_plans - self.list = to_streamed_response_wrapper( - available_rate_plans.list, + self.get = to_streamed_response_wrapper( + available_rate_plans.get, ) @@ -153,6 +153,6 @@ class AsyncAvailableRatePlansWithStreamingResponse: def __init__(self, available_rate_plans: AsyncAvailableRatePlans) -> None: self._available_rate_plans = available_rate_plans - self.list = async_to_streamed_response_wrapper( - available_rate_plans.list, + self.get = async_to_streamed_response_wrapper( + available_rate_plans.get, ) diff --git a/src/cloudflare/resources/cache/cache_reserve.py b/src/cloudflare/resources/cache/cache_reserve.py index 61a2b1c7e65..fe6ead43ce7 100644 --- a/src/cloudflare/resources/cache/cache_reserve.py +++ b/src/cloudflare/resources/cache/cache_reserve.py @@ -22,8 +22,8 @@ ) from ..._wrappers import ResultWrapper from ...types.cache import ( + CacheReserveGetResponse, CacheReserveEditResponse, - CacheReserveListResponse, CacheReserveClearResponse, CacheReserveStatusResponse, cache_reserve_edit_params, @@ -44,7 +44,7 @@ def with_raw_response(self) -> CacheReserveWithRawResponse: def with_streaming_response(self) -> CacheReserveWithStreamingResponse: return CacheReserveWithStreamingResponse(self) - def list( + def clear( self, *, zone_id: str, @@ -54,14 +54,12 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CacheReserveListResponse: + ) -> CacheReserveClearResponse: """ - Increase cache lifetimes by automatically storing all cacheable files into - Cloudflare's persistent object storage buckets. Requires Cache Reserve - subscription. Note: using Tiered Cache with Cache Reserve is highly recommended - to reduce Reserve operations costs. See the - [developer docs](https://developers.cloudflare.com/cache/about/cache-reserve) - for more information. + You can use Cache Reserve Clear to clear your Cache Reserve, but you must first + disable Cache Reserve. In most cases, this will be accomplished within 24 hours. + You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind + that you cannot undo or cancel this operation. Args: zone_id: Identifier @@ -76,8 +74,8 @@ def list( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return self._get( - f"/zones/{zone_id}/cache/cache_reserve", + return self._post( + f"/zones/{zone_id}/cache/cache_reserve_clear", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -85,29 +83,34 @@ def list( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[CacheReserveListResponse], ResultWrapper[CacheReserveListResponse]), + cast_to=cast(Type[CacheReserveClearResponse], ResultWrapper[CacheReserveClearResponse]), ) - def clear( + def edit( self, *, zone_id: str, + value: Literal["on", "off"], # 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, - ) -> CacheReserveClearResponse: + ) -> CacheReserveEditResponse: """ - You can use Cache Reserve Clear to clear your Cache Reserve, but you must first - disable Cache Reserve. In most cases, this will be accomplished within 24 hours. - You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind - that you cannot undo or cancel this operation. + Increase cache lifetimes by automatically storing all cacheable files into + Cloudflare's persistent object storage buckets. Requires Cache Reserve + subscription. Note: using Tiered Cache with Cache Reserve is highly recommended + to reduce Reserve operations costs. See the + [developer docs](https://developers.cloudflare.com/cache/about/cache-reserve) + for more information. Args: zone_id: Identifier + value: Value of the Cache Reserve zone setting. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -118,8 +121,9 @@ def clear( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return self._post( - f"/zones/{zone_id}/cache/cache_reserve_clear", + return self._patch( + f"/zones/{zone_id}/cache/cache_reserve", + body=maybe_transform({"value": value}, cache_reserve_edit_params.CacheReserveEditParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -127,21 +131,20 @@ def clear( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[CacheReserveClearResponse], ResultWrapper[CacheReserveClearResponse]), + cast_to=cast(Type[CacheReserveEditResponse], ResultWrapper[CacheReserveEditResponse]), ) - def edit( + def get( self, *, zone_id: str, - value: Literal["on", "off"], # 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, - ) -> CacheReserveEditResponse: + ) -> CacheReserveGetResponse: """ Increase cache lifetimes by automatically storing all cacheable files into Cloudflare's persistent object storage buckets. Requires Cache Reserve @@ -153,8 +156,6 @@ def edit( Args: zone_id: Identifier - value: Value of the Cache Reserve zone setting. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -165,9 +166,8 @@ def edit( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return self._patch( + return self._get( f"/zones/{zone_id}/cache/cache_reserve", - body=maybe_transform({"value": value}, cache_reserve_edit_params.CacheReserveEditParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -175,7 +175,7 @@ def edit( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[CacheReserveEditResponse], ResultWrapper[CacheReserveEditResponse]), + cast_to=cast(Type[CacheReserveGetResponse], ResultWrapper[CacheReserveGetResponse]), ) def status( @@ -230,7 +230,7 @@ def with_raw_response(self) -> AsyncCacheReserveWithRawResponse: def with_streaming_response(self) -> AsyncCacheReserveWithStreamingResponse: return AsyncCacheReserveWithStreamingResponse(self) - async def list( + async def clear( self, *, zone_id: str, @@ -240,14 +240,12 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CacheReserveListResponse: + ) -> CacheReserveClearResponse: """ - Increase cache lifetimes by automatically storing all cacheable files into - Cloudflare's persistent object storage buckets. Requires Cache Reserve - subscription. Note: using Tiered Cache with Cache Reserve is highly recommended - to reduce Reserve operations costs. See the - [developer docs](https://developers.cloudflare.com/cache/about/cache-reserve) - for more information. + You can use Cache Reserve Clear to clear your Cache Reserve, but you must first + disable Cache Reserve. In most cases, this will be accomplished within 24 hours. + You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind + that you cannot undo or cancel this operation. Args: zone_id: Identifier @@ -262,8 +260,8 @@ async def list( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return await self._get( - f"/zones/{zone_id}/cache/cache_reserve", + return await self._post( + f"/zones/{zone_id}/cache/cache_reserve_clear", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -271,29 +269,34 @@ async def list( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[CacheReserveListResponse], ResultWrapper[CacheReserveListResponse]), + cast_to=cast(Type[CacheReserveClearResponse], ResultWrapper[CacheReserveClearResponse]), ) - async def clear( + async def edit( self, *, zone_id: str, + value: Literal["on", "off"], # 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, - ) -> CacheReserveClearResponse: + ) -> CacheReserveEditResponse: """ - You can use Cache Reserve Clear to clear your Cache Reserve, but you must first - disable Cache Reserve. In most cases, this will be accomplished within 24 hours. - You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind - that you cannot undo or cancel this operation. + Increase cache lifetimes by automatically storing all cacheable files into + Cloudflare's persistent object storage buckets. Requires Cache Reserve + subscription. Note: using Tiered Cache with Cache Reserve is highly recommended + to reduce Reserve operations costs. See the + [developer docs](https://developers.cloudflare.com/cache/about/cache-reserve) + for more information. Args: zone_id: Identifier + value: Value of the Cache Reserve zone setting. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -304,8 +307,9 @@ async def clear( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return await self._post( - f"/zones/{zone_id}/cache/cache_reserve_clear", + return await self._patch( + f"/zones/{zone_id}/cache/cache_reserve", + body=await async_maybe_transform({"value": value}, cache_reserve_edit_params.CacheReserveEditParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -313,21 +317,20 @@ async def clear( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[CacheReserveClearResponse], ResultWrapper[CacheReserveClearResponse]), + cast_to=cast(Type[CacheReserveEditResponse], ResultWrapper[CacheReserveEditResponse]), ) - async def edit( + async def get( self, *, zone_id: str, - value: Literal["on", "off"], # 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, - ) -> CacheReserveEditResponse: + ) -> CacheReserveGetResponse: """ Increase cache lifetimes by automatically storing all cacheable files into Cloudflare's persistent object storage buckets. Requires Cache Reserve @@ -339,8 +342,6 @@ async def edit( Args: zone_id: Identifier - value: Value of the Cache Reserve zone setting. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -351,9 +352,8 @@ async def edit( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return await self._patch( + return await self._get( f"/zones/{zone_id}/cache/cache_reserve", - body=await async_maybe_transform({"value": value}, cache_reserve_edit_params.CacheReserveEditParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -361,7 +361,7 @@ async def edit( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[CacheReserveEditResponse], ResultWrapper[CacheReserveEditResponse]), + cast_to=cast(Type[CacheReserveGetResponse], ResultWrapper[CacheReserveGetResponse]), ) async def status( @@ -411,15 +411,15 @@ class CacheReserveWithRawResponse: def __init__(self, cache_reserve: CacheReserve) -> None: self._cache_reserve = cache_reserve - self.list = to_raw_response_wrapper( - cache_reserve.list, - ) self.clear = to_raw_response_wrapper( cache_reserve.clear, ) self.edit = to_raw_response_wrapper( cache_reserve.edit, ) + self.get = to_raw_response_wrapper( + cache_reserve.get, + ) self.status = to_raw_response_wrapper( cache_reserve.status, ) @@ -429,15 +429,15 @@ class AsyncCacheReserveWithRawResponse: def __init__(self, cache_reserve: AsyncCacheReserve) -> None: self._cache_reserve = cache_reserve - self.list = async_to_raw_response_wrapper( - cache_reserve.list, - ) self.clear = async_to_raw_response_wrapper( cache_reserve.clear, ) self.edit = async_to_raw_response_wrapper( cache_reserve.edit, ) + self.get = async_to_raw_response_wrapper( + cache_reserve.get, + ) self.status = async_to_raw_response_wrapper( cache_reserve.status, ) @@ -447,15 +447,15 @@ class CacheReserveWithStreamingResponse: def __init__(self, cache_reserve: CacheReserve) -> None: self._cache_reserve = cache_reserve - self.list = to_streamed_response_wrapper( - cache_reserve.list, - ) self.clear = to_streamed_response_wrapper( cache_reserve.clear, ) self.edit = to_streamed_response_wrapper( cache_reserve.edit, ) + self.get = to_streamed_response_wrapper( + cache_reserve.get, + ) self.status = to_streamed_response_wrapper( cache_reserve.status, ) @@ -465,15 +465,15 @@ class AsyncCacheReserveWithStreamingResponse: def __init__(self, cache_reserve: AsyncCacheReserve) -> None: self._cache_reserve = cache_reserve - self.list = async_to_streamed_response_wrapper( - cache_reserve.list, - ) self.clear = async_to_streamed_response_wrapper( cache_reserve.clear, ) self.edit = async_to_streamed_response_wrapper( cache_reserve.edit, ) + self.get = async_to_streamed_response_wrapper( + cache_reserve.get, + ) self.status = async_to_streamed_response_wrapper( cache_reserve.status, ) diff --git a/src/cloudflare/resources/cache/variants.py b/src/cloudflare/resources/cache/variants.py index 5a752cf5a10..1f70cbef85b 100644 --- a/src/cloudflare/resources/cache/variants.py +++ b/src/cloudflare/resources/cache/variants.py @@ -20,7 +20,7 @@ async_to_streamed_response_wrapper, ) from ..._wrappers import ResultWrapper -from ...types.cache import VariantEditResponse, VariantListResponse, VariantDeleteResponse, variant_edit_params +from ...types.cache import VariantGetResponse, VariantEditResponse, VariantDeleteResponse, variant_edit_params from ..._base_client import ( make_request_options, ) @@ -37,7 +37,7 @@ def with_raw_response(self) -> VariantsWithRawResponse: def with_streaming_response(self) -> VariantsWithStreamingResponse: return VariantsWithStreamingResponse(self) - def list( + def delete( self, *, zone_id: str, @@ -47,7 +47,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> VariantListResponse: + ) -> VariantDeleteResponse: """ Variant support enables caching variants of images with certain file extensions in addition to the original. This only applies when the origin server sends the @@ -68,7 +68,7 @@ def list( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return self._get( + return self._delete( f"/zones/{zone_id}/cache/variants", options=make_request_options( extra_headers=extra_headers, @@ -77,20 +77,21 @@ def list( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[VariantListResponse], ResultWrapper[VariantListResponse]), + cast_to=cast(Type[VariantDeleteResponse], ResultWrapper[VariantDeleteResponse]), ) - def delete( + def edit( self, *, zone_id: str, + value: variant_edit_params.Value, # 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, - ) -> VariantDeleteResponse: + ) -> VariantEditResponse: """ Variant support enables caching variants of images with certain file extensions in addition to the original. This only applies when the origin server sends the @@ -101,6 +102,8 @@ def delete( Args: zone_id: Identifier + value: Value of the zone setting. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -111,8 +114,9 @@ def delete( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return self._delete( + return self._patch( f"/zones/{zone_id}/cache/variants", + body=maybe_transform({"value": value}, variant_edit_params.VariantEditParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -120,21 +124,20 @@ def delete( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[VariantDeleteResponse], ResultWrapper[VariantDeleteResponse]), + cast_to=cast(Type[VariantEditResponse], ResultWrapper[VariantEditResponse]), ) - def edit( + def get( self, *, zone_id: str, - value: variant_edit_params.Value, # 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, - ) -> VariantEditResponse: + ) -> VariantGetResponse: """ Variant support enables caching variants of images with certain file extensions in addition to the original. This only applies when the origin server sends the @@ -145,8 +148,6 @@ def edit( Args: zone_id: Identifier - value: Value of the zone setting. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -157,9 +158,8 @@ def edit( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return self._patch( + return self._get( f"/zones/{zone_id}/cache/variants", - body=maybe_transform({"value": value}, variant_edit_params.VariantEditParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -167,7 +167,7 @@ def edit( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[VariantEditResponse], ResultWrapper[VariantEditResponse]), + cast_to=cast(Type[VariantGetResponse], ResultWrapper[VariantGetResponse]), ) @@ -180,7 +180,7 @@ def with_raw_response(self) -> AsyncVariantsWithRawResponse: def with_streaming_response(self) -> AsyncVariantsWithStreamingResponse: return AsyncVariantsWithStreamingResponse(self) - async def list( + async def delete( self, *, zone_id: str, @@ -190,7 +190,7 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> VariantListResponse: + ) -> VariantDeleteResponse: """ Variant support enables caching variants of images with certain file extensions in addition to the original. This only applies when the origin server sends the @@ -211,7 +211,7 @@ async def list( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return await self._get( + return await self._delete( f"/zones/{zone_id}/cache/variants", options=make_request_options( extra_headers=extra_headers, @@ -220,20 +220,21 @@ async def list( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[VariantListResponse], ResultWrapper[VariantListResponse]), + cast_to=cast(Type[VariantDeleteResponse], ResultWrapper[VariantDeleteResponse]), ) - async def delete( + async def edit( self, *, zone_id: str, + value: variant_edit_params.Value, # 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, - ) -> VariantDeleteResponse: + ) -> VariantEditResponse: """ Variant support enables caching variants of images with certain file extensions in addition to the original. This only applies when the origin server sends the @@ -244,6 +245,8 @@ async def delete( Args: zone_id: Identifier + value: Value of the zone setting. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -254,8 +257,9 @@ async def delete( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return await self._delete( + return await self._patch( f"/zones/{zone_id}/cache/variants", + body=await async_maybe_transform({"value": value}, variant_edit_params.VariantEditParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -263,21 +267,20 @@ async def delete( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[VariantDeleteResponse], ResultWrapper[VariantDeleteResponse]), + cast_to=cast(Type[VariantEditResponse], ResultWrapper[VariantEditResponse]), ) - async def edit( + async def get( self, *, zone_id: str, - value: variant_edit_params.Value, # 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, - ) -> VariantEditResponse: + ) -> VariantGetResponse: """ Variant support enables caching variants of images with certain file extensions in addition to the original. This only applies when the origin server sends the @@ -288,8 +291,6 @@ async def edit( Args: zone_id: Identifier - value: Value of the zone setting. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -300,9 +301,8 @@ async def edit( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return await self._patch( + return await self._get( f"/zones/{zone_id}/cache/variants", - body=await async_maybe_transform({"value": value}, variant_edit_params.VariantEditParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -310,7 +310,7 @@ async def edit( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[VariantEditResponse], ResultWrapper[VariantEditResponse]), + cast_to=cast(Type[VariantGetResponse], ResultWrapper[VariantGetResponse]), ) @@ -318,57 +318,57 @@ class VariantsWithRawResponse: def __init__(self, variants: Variants) -> None: self._variants = variants - self.list = to_raw_response_wrapper( - variants.list, - ) self.delete = to_raw_response_wrapper( variants.delete, ) self.edit = to_raw_response_wrapper( variants.edit, ) + self.get = to_raw_response_wrapper( + variants.get, + ) class AsyncVariantsWithRawResponse: def __init__(self, variants: AsyncVariants) -> None: self._variants = variants - self.list = async_to_raw_response_wrapper( - variants.list, - ) self.delete = async_to_raw_response_wrapper( variants.delete, ) self.edit = async_to_raw_response_wrapper( variants.edit, ) + self.get = async_to_raw_response_wrapper( + variants.get, + ) class VariantsWithStreamingResponse: def __init__(self, variants: Variants) -> None: self._variants = variants - self.list = to_streamed_response_wrapper( - variants.list, - ) self.delete = to_streamed_response_wrapper( variants.delete, ) self.edit = to_streamed_response_wrapper( variants.edit, ) + self.get = to_streamed_response_wrapper( + variants.get, + ) class AsyncVariantsWithStreamingResponse: def __init__(self, variants: AsyncVariants) -> None: self._variants = variants - self.list = async_to_streamed_response_wrapper( - variants.list, - ) self.delete = async_to_streamed_response_wrapper( variants.delete, ) self.edit = async_to_streamed_response_wrapper( variants.edit, ) + self.get = async_to_streamed_response_wrapper( + variants.get, + ) diff --git a/src/cloudflare/resources/certificate_authorities/hostname_associations.py b/src/cloudflare/resources/certificate_authorities/hostname_associations.py index 8271c4667e4..5931e320d84 100644 --- a/src/cloudflare/resources/certificate_authorities/hostname_associations.py +++ b/src/cloudflare/resources/certificate_authorities/hostname_associations.py @@ -24,9 +24,9 @@ make_request_options, ) from ...types.certificate_authorities import ( - HostnameAssociationListResponse, + HostnameAssociationGetResponse, HostnameAssociationUpdateResponse, - hostname_association_list_params, + hostname_association_get_params, hostname_association_update_params, ) @@ -94,7 +94,7 @@ def update( cast_to=cast(Type[HostnameAssociationUpdateResponse], ResultWrapper[HostnameAssociationUpdateResponse]), ) - def list( + def get( self, *, zone_id: str, @@ -105,7 +105,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HostnameAssociationListResponse: + ) -> HostnameAssociationGetResponse: """ List Hostname Associations @@ -135,11 +135,11 @@ def list( timeout=timeout, query=maybe_transform( {"mtls_certificate_id": mtls_certificate_id}, - hostname_association_list_params.HostnameAssociationListParams, + hostname_association_get_params.HostnameAssociationGetParams, ), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[HostnameAssociationListResponse], ResultWrapper[HostnameAssociationListResponse]), + cast_to=cast(Type[HostnameAssociationGetResponse], ResultWrapper[HostnameAssociationGetResponse]), ) @@ -204,7 +204,7 @@ async def update( cast_to=cast(Type[HostnameAssociationUpdateResponse], ResultWrapper[HostnameAssociationUpdateResponse]), ) - async def list( + async def get( self, *, zone_id: str, @@ -215,7 +215,7 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HostnameAssociationListResponse: + ) -> HostnameAssociationGetResponse: """ List Hostname Associations @@ -245,11 +245,11 @@ async def list( timeout=timeout, query=await async_maybe_transform( {"mtls_certificate_id": mtls_certificate_id}, - hostname_association_list_params.HostnameAssociationListParams, + hostname_association_get_params.HostnameAssociationGetParams, ), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[HostnameAssociationListResponse], ResultWrapper[HostnameAssociationListResponse]), + cast_to=cast(Type[HostnameAssociationGetResponse], ResultWrapper[HostnameAssociationGetResponse]), ) @@ -260,8 +260,8 @@ def __init__(self, hostname_associations: HostnameAssociations) -> None: self.update = to_raw_response_wrapper( hostname_associations.update, ) - self.list = to_raw_response_wrapper( - hostname_associations.list, + self.get = to_raw_response_wrapper( + hostname_associations.get, ) @@ -272,8 +272,8 @@ def __init__(self, hostname_associations: AsyncHostnameAssociations) -> None: self.update = async_to_raw_response_wrapper( hostname_associations.update, ) - self.list = async_to_raw_response_wrapper( - hostname_associations.list, + self.get = async_to_raw_response_wrapper( + hostname_associations.get, ) @@ -284,8 +284,8 @@ def __init__(self, hostname_associations: HostnameAssociations) -> None: self.update = to_streamed_response_wrapper( hostname_associations.update, ) - self.list = to_streamed_response_wrapper( - hostname_associations.list, + self.get = to_streamed_response_wrapper( + hostname_associations.get, ) @@ -296,6 +296,6 @@ def __init__(self, hostname_associations: AsyncHostnameAssociations) -> None: self.update = async_to_streamed_response_wrapper( hostname_associations.update, ) - self.list = async_to_streamed_response_wrapper( - hostname_associations.list, + self.get = async_to_streamed_response_wrapper( + hostname_associations.get, ) diff --git a/src/cloudflare/resources/custom_nameservers.py b/src/cloudflare/resources/custom_nameservers.py index a06eb774bda..f311c657c05 100644 --- a/src/cloudflare/resources/custom_nameservers.py +++ b/src/cloudflare/resources/custom_nameservers.py @@ -7,7 +7,7 @@ import httpx from ..types import ( - CustomNameserverListResponse, + CustomNameserverGetResponse, CustomNameserverCreateResponse, CustomNameserverDeleteResponse, CustomNameserverVerifyResponse, @@ -96,45 +96,6 @@ def create( cast_to=cast(Type[CustomNameserverCreateResponse], ResultWrapper[CustomNameserverCreateResponse]), ) - def list( - self, - *, - 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, - ) -> Optional[CustomNameserverListResponse]: - """ - List an account's custom nameservers. - - Args: - account_id: Account 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_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return self._get( - f"/accounts/{account_id}/custom_ns", - 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[CustomNameserverListResponse]], ResultWrapper[CustomNameserverListResponse]), - ) - def delete( self, custom_ns_id: str, @@ -225,6 +186,45 @@ def availabilty( ), ) + def get( + self, + *, + 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, + ) -> Optional[CustomNameserverGetResponse]: + """ + List an account's custom nameservers. + + Args: + account_id: Account 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_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + return self._get( + f"/accounts/{account_id}/custom_ns", + 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[CustomNameserverGetResponse]], ResultWrapper[CustomNameserverGetResponse]), + ) + def verify( self, *, @@ -326,45 +326,6 @@ async def create( cast_to=cast(Type[CustomNameserverCreateResponse], ResultWrapper[CustomNameserverCreateResponse]), ) - async def list( - self, - *, - 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, - ) -> Optional[CustomNameserverListResponse]: - """ - List an account's custom nameservers. - - Args: - account_id: Account 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_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return await self._get( - f"/accounts/{account_id}/custom_ns", - 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[CustomNameserverListResponse]], ResultWrapper[CustomNameserverListResponse]), - ) - async def delete( self, custom_ns_id: str, @@ -455,6 +416,45 @@ async def availabilty( ), ) + async def get( + self, + *, + 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, + ) -> Optional[CustomNameserverGetResponse]: + """ + List an account's custom nameservers. + + Args: + account_id: Account 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_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + return await self._get( + f"/accounts/{account_id}/custom_ns", + 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[CustomNameserverGetResponse]], ResultWrapper[CustomNameserverGetResponse]), + ) + async def verify( self, *, @@ -502,15 +502,15 @@ def __init__(self, custom_nameservers: CustomNameservers) -> None: self.create = to_raw_response_wrapper( custom_nameservers.create, ) - self.list = to_raw_response_wrapper( - custom_nameservers.list, - ) self.delete = to_raw_response_wrapper( custom_nameservers.delete, ) self.availabilty = to_raw_response_wrapper( custom_nameservers.availabilty, ) + self.get = to_raw_response_wrapper( + custom_nameservers.get, + ) self.verify = to_raw_response_wrapper( custom_nameservers.verify, ) @@ -523,15 +523,15 @@ def __init__(self, custom_nameservers: AsyncCustomNameservers) -> None: self.create = async_to_raw_response_wrapper( custom_nameservers.create, ) - self.list = async_to_raw_response_wrapper( - custom_nameservers.list, - ) self.delete = async_to_raw_response_wrapper( custom_nameservers.delete, ) self.availabilty = async_to_raw_response_wrapper( custom_nameservers.availabilty, ) + self.get = async_to_raw_response_wrapper( + custom_nameservers.get, + ) self.verify = async_to_raw_response_wrapper( custom_nameservers.verify, ) @@ -544,15 +544,15 @@ def __init__(self, custom_nameservers: CustomNameservers) -> None: self.create = to_streamed_response_wrapper( custom_nameservers.create, ) - self.list = to_streamed_response_wrapper( - custom_nameservers.list, - ) self.delete = to_streamed_response_wrapper( custom_nameservers.delete, ) self.availabilty = to_streamed_response_wrapper( custom_nameservers.availabilty, ) + self.get = to_streamed_response_wrapper( + custom_nameservers.get, + ) self.verify = to_streamed_response_wrapper( custom_nameservers.verify, ) @@ -565,15 +565,15 @@ def __init__(self, custom_nameservers: AsyncCustomNameservers) -> None: self.create = async_to_streamed_response_wrapper( custom_nameservers.create, ) - self.list = async_to_streamed_response_wrapper( - custom_nameservers.list, - ) self.delete = async_to_streamed_response_wrapper( custom_nameservers.delete, ) self.availabilty = async_to_streamed_response_wrapper( custom_nameservers.availabilty, ) + self.get = async_to_streamed_response_wrapper( + custom_nameservers.get, + ) self.verify = async_to_streamed_response_wrapper( custom_nameservers.verify, ) diff --git a/src/cloudflare/resources/dns/analytics/reports/bytimes.py b/src/cloudflare/resources/dns/analytics/reports/bytimes.py index 679b2b6a894..96478c34a4a 100644 --- a/src/cloudflare/resources/dns/analytics/reports/bytimes.py +++ b/src/cloudflare/resources/dns/analytics/reports/bytimes.py @@ -25,7 +25,7 @@ from ....._base_client import ( make_request_options, ) -from .....types.dns.analytics.reports import BytimeListResponse, bytime_list_params +from .....types.dns.analytics.reports import BytimeGetResponse, bytime_get_params __all__ = ["Bytimes", "AsyncBytimes"] @@ -39,7 +39,7 @@ def with_raw_response(self) -> BytimesWithRawResponse: def with_streaming_response(self) -> BytimesWithStreamingResponse: return BytimesWithStreamingResponse(self) - def list( + def get( self, identifier: str, *, @@ -58,7 +58,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> BytimeListResponse: + ) -> BytimeGetResponse: """ Retrieves a list of aggregate metrics grouped by time interval. @@ -114,11 +114,11 @@ def list( "time_delta": time_delta, "until": until, }, - bytime_list_params.BytimeListParams, + bytime_get_params.BytimeGetParams, ), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[BytimeListResponse], ResultWrapper[BytimeListResponse]), + cast_to=cast(Type[BytimeGetResponse], ResultWrapper[BytimeGetResponse]), ) @@ -131,7 +131,7 @@ def with_raw_response(self) -> AsyncBytimesWithRawResponse: def with_streaming_response(self) -> AsyncBytimesWithStreamingResponse: return AsyncBytimesWithStreamingResponse(self) - async def list( + async def get( self, identifier: str, *, @@ -150,7 +150,7 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> BytimeListResponse: + ) -> BytimeGetResponse: """ Retrieves a list of aggregate metrics grouped by time interval. @@ -206,11 +206,11 @@ async def list( "time_delta": time_delta, "until": until, }, - bytime_list_params.BytimeListParams, + bytime_get_params.BytimeGetParams, ), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[BytimeListResponse], ResultWrapper[BytimeListResponse]), + cast_to=cast(Type[BytimeGetResponse], ResultWrapper[BytimeGetResponse]), ) @@ -218,8 +218,8 @@ class BytimesWithRawResponse: def __init__(self, bytimes: Bytimes) -> None: self._bytimes = bytimes - self.list = to_raw_response_wrapper( - bytimes.list, + self.get = to_raw_response_wrapper( + bytimes.get, ) @@ -227,8 +227,8 @@ class AsyncBytimesWithRawResponse: def __init__(self, bytimes: AsyncBytimes) -> None: self._bytimes = bytimes - self.list = async_to_raw_response_wrapper( - bytimes.list, + self.get = async_to_raw_response_wrapper( + bytimes.get, ) @@ -236,8 +236,8 @@ class BytimesWithStreamingResponse: def __init__(self, bytimes: Bytimes) -> None: self._bytimes = bytimes - self.list = to_streamed_response_wrapper( - bytimes.list, + self.get = to_streamed_response_wrapper( + bytimes.get, ) @@ -245,6 +245,6 @@ class AsyncBytimesWithStreamingResponse: def __init__(self, bytimes: AsyncBytimes) -> None: self._bytimes = bytimes - self.list = async_to_streamed_response_wrapper( - bytimes.list, + self.get = async_to_streamed_response_wrapper( + bytimes.get, ) diff --git a/src/cloudflare/resources/dns/analytics/reports/reports.py b/src/cloudflare/resources/dns/analytics/reports/reports.py index e067be5ceec..7b386f4f3fc 100644 --- a/src/cloudflare/resources/dns/analytics/reports/reports.py +++ b/src/cloudflare/resources/dns/analytics/reports/reports.py @@ -32,7 +32,7 @@ from ....._base_client import ( make_request_options, ) -from .....types.dns.analytics import ReportListResponse, report_list_params +from .....types.dns.analytics import ReportGetResponse, report_get_params __all__ = ["Reports", "AsyncReports"] @@ -50,7 +50,7 @@ def with_raw_response(self) -> ReportsWithRawResponse: def with_streaming_response(self) -> ReportsWithStreamingResponse: return ReportsWithStreamingResponse(self) - def list( + def get( self, identifier: str, *, @@ -67,7 +67,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ReportListResponse: + ) -> ReportGetResponse: """ Retrieves a list of summarised aggregate metrics over a given time period. @@ -120,11 +120,11 @@ def list( "sort": sort, "until": until, }, - report_list_params.ReportListParams, + report_get_params.ReportGetParams, ), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ReportListResponse], ResultWrapper[ReportListResponse]), + cast_to=cast(Type[ReportGetResponse], ResultWrapper[ReportGetResponse]), ) @@ -141,7 +141,7 @@ def with_raw_response(self) -> AsyncReportsWithRawResponse: def with_streaming_response(self) -> AsyncReportsWithStreamingResponse: return AsyncReportsWithStreamingResponse(self) - async def list( + async def get( self, identifier: str, *, @@ -158,7 +158,7 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ReportListResponse: + ) -> ReportGetResponse: """ Retrieves a list of summarised aggregate metrics over a given time period. @@ -211,11 +211,11 @@ async def list( "sort": sort, "until": until, }, - report_list_params.ReportListParams, + report_get_params.ReportGetParams, ), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ReportListResponse], ResultWrapper[ReportListResponse]), + cast_to=cast(Type[ReportGetResponse], ResultWrapper[ReportGetResponse]), ) @@ -223,8 +223,8 @@ class ReportsWithRawResponse: def __init__(self, reports: Reports) -> None: self._reports = reports - self.list = to_raw_response_wrapper( - reports.list, + self.get = to_raw_response_wrapper( + reports.get, ) @cached_property @@ -236,8 +236,8 @@ class AsyncReportsWithRawResponse: def __init__(self, reports: AsyncReports) -> None: self._reports = reports - self.list = async_to_raw_response_wrapper( - reports.list, + self.get = async_to_raw_response_wrapper( + reports.get, ) @cached_property @@ -249,8 +249,8 @@ class ReportsWithStreamingResponse: def __init__(self, reports: Reports) -> None: self._reports = reports - self.list = to_streamed_response_wrapper( - reports.list, + self.get = to_streamed_response_wrapper( + reports.get, ) @cached_property @@ -262,8 +262,8 @@ class AsyncReportsWithStreamingResponse: def __init__(self, reports: AsyncReports) -> None: self._reports = reports - self.list = async_to_streamed_response_wrapper( - reports.list, + self.get = async_to_streamed_response_wrapper( + reports.get, ) @cached_property diff --git a/src/cloudflare/resources/dns/firewall/analytics/reports/bytimes.py b/src/cloudflare/resources/dns/firewall/analytics/reports/bytimes.py index ebb93caa7cf..835c57a5394 100644 --- a/src/cloudflare/resources/dns/firewall/analytics/reports/bytimes.py +++ b/src/cloudflare/resources/dns/firewall/analytics/reports/bytimes.py @@ -25,7 +25,7 @@ from ......_base_client import ( make_request_options, ) -from ......types.dns.firewall.analytics.reports import BytimeListResponse, bytime_list_params +from ......types.dns.firewall.analytics.reports import BytimeGetResponse, bytime_get_params __all__ = ["Bytimes", "AsyncBytimes"] @@ -39,7 +39,7 @@ def with_raw_response(self) -> BytimesWithRawResponse: def with_streaming_response(self) -> BytimesWithStreamingResponse: return BytimesWithStreamingResponse(self) - def list( + def get( self, identifier: str, *, @@ -59,7 +59,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> BytimeListResponse: + ) -> BytimeGetResponse: """ Retrieves a list of aggregate metrics grouped by time interval. @@ -119,11 +119,11 @@ def list( "time_delta": time_delta, "until": until, }, - bytime_list_params.BytimeListParams, + bytime_get_params.BytimeGetParams, ), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[BytimeListResponse], ResultWrapper[BytimeListResponse]), + cast_to=cast(Type[BytimeGetResponse], ResultWrapper[BytimeGetResponse]), ) @@ -136,7 +136,7 @@ def with_raw_response(self) -> AsyncBytimesWithRawResponse: def with_streaming_response(self) -> AsyncBytimesWithStreamingResponse: return AsyncBytimesWithStreamingResponse(self) - async def list( + async def get( self, identifier: str, *, @@ -156,7 +156,7 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> BytimeListResponse: + ) -> BytimeGetResponse: """ Retrieves a list of aggregate metrics grouped by time interval. @@ -216,11 +216,11 @@ async def list( "time_delta": time_delta, "until": until, }, - bytime_list_params.BytimeListParams, + bytime_get_params.BytimeGetParams, ), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[BytimeListResponse], ResultWrapper[BytimeListResponse]), + cast_to=cast(Type[BytimeGetResponse], ResultWrapper[BytimeGetResponse]), ) @@ -228,8 +228,8 @@ class BytimesWithRawResponse: def __init__(self, bytimes: Bytimes) -> None: self._bytimes = bytimes - self.list = to_raw_response_wrapper( - bytimes.list, + self.get = to_raw_response_wrapper( + bytimes.get, ) @@ -237,8 +237,8 @@ class AsyncBytimesWithRawResponse: def __init__(self, bytimes: AsyncBytimes) -> None: self._bytimes = bytimes - self.list = async_to_raw_response_wrapper( - bytimes.list, + self.get = async_to_raw_response_wrapper( + bytimes.get, ) @@ -246,8 +246,8 @@ class BytimesWithStreamingResponse: def __init__(self, bytimes: Bytimes) -> None: self._bytimes = bytimes - self.list = to_streamed_response_wrapper( - bytimes.list, + self.get = to_streamed_response_wrapper( + bytimes.get, ) @@ -255,6 +255,6 @@ class AsyncBytimesWithStreamingResponse: def __init__(self, bytimes: AsyncBytimes) -> None: self._bytimes = bytimes - self.list = async_to_streamed_response_wrapper( - bytimes.list, + self.get = async_to_streamed_response_wrapper( + bytimes.get, ) diff --git a/src/cloudflare/resources/dns/firewall/analytics/reports/reports.py b/src/cloudflare/resources/dns/firewall/analytics/reports/reports.py index ea41f0be0e1..21efcab3771 100644 --- a/src/cloudflare/resources/dns/firewall/analytics/reports/reports.py +++ b/src/cloudflare/resources/dns/firewall/analytics/reports/reports.py @@ -32,7 +32,7 @@ from ......_base_client import ( make_request_options, ) -from ......types.dns.firewall.analytics import ReportListResponse, report_list_params +from ......types.dns.firewall.analytics import ReportGetResponse, report_get_params __all__ = ["Reports", "AsyncReports"] @@ -50,7 +50,7 @@ def with_raw_response(self) -> ReportsWithRawResponse: def with_streaming_response(self) -> ReportsWithStreamingResponse: return ReportsWithStreamingResponse(self) - def list( + def get( self, identifier: str, *, @@ -68,7 +68,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ReportListResponse: + ) -> ReportGetResponse: """ Retrieves a list of summarised aggregate metrics over a given time period. @@ -125,11 +125,11 @@ def list( "sort": sort, "until": until, }, - report_list_params.ReportListParams, + report_get_params.ReportGetParams, ), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ReportListResponse], ResultWrapper[ReportListResponse]), + cast_to=cast(Type[ReportGetResponse], ResultWrapper[ReportGetResponse]), ) @@ -146,7 +146,7 @@ def with_raw_response(self) -> AsyncReportsWithRawResponse: def with_streaming_response(self) -> AsyncReportsWithStreamingResponse: return AsyncReportsWithStreamingResponse(self) - async def list( + async def get( self, identifier: str, *, @@ -164,7 +164,7 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ReportListResponse: + ) -> ReportGetResponse: """ Retrieves a list of summarised aggregate metrics over a given time period. @@ -221,11 +221,11 @@ async def list( "sort": sort, "until": until, }, - report_list_params.ReportListParams, + report_get_params.ReportGetParams, ), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ReportListResponse], ResultWrapper[ReportListResponse]), + cast_to=cast(Type[ReportGetResponse], ResultWrapper[ReportGetResponse]), ) @@ -233,8 +233,8 @@ class ReportsWithRawResponse: def __init__(self, reports: Reports) -> None: self._reports = reports - self.list = to_raw_response_wrapper( - reports.list, + self.get = to_raw_response_wrapper( + reports.get, ) @cached_property @@ -246,8 +246,8 @@ class AsyncReportsWithRawResponse: def __init__(self, reports: AsyncReports) -> None: self._reports = reports - self.list = async_to_raw_response_wrapper( - reports.list, + self.get = async_to_raw_response_wrapper( + reports.get, ) @cached_property @@ -259,8 +259,8 @@ class ReportsWithStreamingResponse: def __init__(self, reports: Reports) -> None: self._reports = reports - self.list = to_streamed_response_wrapper( - reports.list, + self.get = to_streamed_response_wrapper( + reports.get, ) @cached_property @@ -272,8 +272,8 @@ class AsyncReportsWithStreamingResponse: def __init__(self, reports: AsyncReports) -> None: self._reports = reports - self.list = async_to_streamed_response_wrapper( - reports.list, + self.get = async_to_streamed_response_wrapper( + reports.get, ) @cached_property diff --git a/src/cloudflare/resources/email_routing/routing/addresses.py b/src/cloudflare/resources/email_routing/routing/addresses.py index a62c872404a..518647efbb3 100644 --- a/src/cloudflare/resources/email_routing/routing/addresses.py +++ b/src/cloudflare/resources/email_routing/routing/addresses.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Type, Optional, cast +from typing import Type, cast from typing_extensions import Literal import httpx @@ -21,16 +21,18 @@ async_to_streamed_response_wrapper, ) from ...._wrappers import ResultWrapper +from ....pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray from ...._base_client import ( + AsyncPaginator, make_request_options, ) from ....types.email_routing.routing import ( AddressGetResponse, + AddressListResponse, AddressCreateResponse, AddressDeleteResponse, - AddressEmailRoutingDestinationAddressesListDestinationAddressesResponse, + address_list_params, address_create_params, - address_email_routing_destination_addresses_list_destination_addresses_params, ) __all__ = ["Addresses", "AsyncAddresses"] @@ -90,25 +92,34 @@ def create( cast_to=cast(Type[AddressCreateResponse], ResultWrapper[AddressCreateResponse]), ) - def delete( + def list( self, - destination_address_identifier: str, - *, account_identifier: str, + *, + direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, + page: float | NotGiven = NOT_GIVEN, + per_page: float | NotGiven = NOT_GIVEN, + verified: Literal[True, False] | 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, - ) -> AddressDeleteResponse: + ) -> SyncV4PagePaginationArray[AddressListResponse]: """ - Deletes a specific destination address. + Lists existing destination addresses. Args: account_identifier: Identifier - destination_address_identifier: Destination address identifier. + direction: Sorts results in an ascending or descending order. + + page: Page number of paginated results. + + per_page: Maximum number of results per page. + + verified: Filter by verified destination addresses. extra_headers: Send extra headers @@ -120,50 +131,46 @@ def delete( """ if not account_identifier: raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") - if not destination_address_identifier: - raise ValueError( - f"Expected a non-empty value for `destination_address_identifier` but received {destination_address_identifier!r}" - ) - return self._delete( - f"/accounts/{account_identifier}/email/routing/addresses/{destination_address_identifier}", + return self._get_api_list( + f"/accounts/{account_identifier}/email/routing/addresses", + page=SyncV4PagePaginationArray[AddressListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper._unwrapper, + query=maybe_transform( + { + "direction": direction, + "page": page, + "per_page": per_page, + "verified": verified, + }, + address_list_params.AddressListParams, + ), ), - cast_to=cast(Type[AddressDeleteResponse], ResultWrapper[AddressDeleteResponse]), + model=AddressListResponse, ) - def email_routing_destination_addresses_list_destination_addresses( + def delete( self, - account_identifier: str, + destination_address_identifier: str, *, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - verified: Literal[True, False] | NotGiven = NOT_GIVEN, + 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[AddressEmailRoutingDestinationAddressesListDestinationAddressesResponse]: + ) -> AddressDeleteResponse: """ - Lists existing destination addresses. + Deletes a specific destination address. Args: account_identifier: Identifier - direction: Sorts results in an ascending or descending order. - - page: Page number of paginated results. - - per_page: Maximum number of results per page. - - verified: Filter by verified destination addresses. + destination_address_identifier: Destination address identifier. extra_headers: Send extra headers @@ -175,28 +182,20 @@ def email_routing_destination_addresses_list_destination_addresses( """ 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}/email/routing/addresses", + if not destination_address_identifier: + raise ValueError( + f"Expected a non-empty value for `destination_address_identifier` but received {destination_address_identifier!r}" + ) + return self._delete( + f"/accounts/{account_identifier}/email/routing/addresses/{destination_address_identifier}", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=maybe_transform( - { - "direction": direction, - "page": page, - "per_page": per_page, - "verified": verified, - }, - address_email_routing_destination_addresses_list_destination_addresses_params.AddressEmailRoutingDestinationAddressesListDestinationAddressesParams, - ), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast( - Type[Optional[AddressEmailRoutingDestinationAddressesListDestinationAddressesResponse]], - ResultWrapper[AddressEmailRoutingDestinationAddressesListDestinationAddressesResponse], - ), + cast_to=cast(Type[AddressDeleteResponse], ResultWrapper[AddressDeleteResponse]), ) def get( @@ -300,25 +299,34 @@ async def create( cast_to=cast(Type[AddressCreateResponse], ResultWrapper[AddressCreateResponse]), ) - async def delete( + def list( self, - destination_address_identifier: str, - *, account_identifier: str, + *, + direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, + page: float | NotGiven = NOT_GIVEN, + per_page: float | NotGiven = NOT_GIVEN, + verified: Literal[True, False] | 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, - ) -> AddressDeleteResponse: + ) -> AsyncPaginator[AddressListResponse, AsyncV4PagePaginationArray[AddressListResponse]]: """ - Deletes a specific destination address. + Lists existing destination addresses. Args: account_identifier: Identifier - destination_address_identifier: Destination address identifier. + direction: Sorts results in an ascending or descending order. + + page: Page number of paginated results. + + per_page: Maximum number of results per page. + + verified: Filter by verified destination addresses. extra_headers: Send extra headers @@ -330,50 +338,46 @@ async def delete( """ if not account_identifier: raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") - if not destination_address_identifier: - raise ValueError( - f"Expected a non-empty value for `destination_address_identifier` but received {destination_address_identifier!r}" - ) - return await self._delete( - f"/accounts/{account_identifier}/email/routing/addresses/{destination_address_identifier}", + return self._get_api_list( + f"/accounts/{account_identifier}/email/routing/addresses", + page=AsyncV4PagePaginationArray[AddressListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper._unwrapper, + query=maybe_transform( + { + "direction": direction, + "page": page, + "per_page": per_page, + "verified": verified, + }, + address_list_params.AddressListParams, + ), ), - cast_to=cast(Type[AddressDeleteResponse], ResultWrapper[AddressDeleteResponse]), + model=AddressListResponse, ) - async def email_routing_destination_addresses_list_destination_addresses( + async def delete( self, - account_identifier: str, + destination_address_identifier: str, *, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - verified: Literal[True, False] | NotGiven = NOT_GIVEN, + 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[AddressEmailRoutingDestinationAddressesListDestinationAddressesResponse]: + ) -> AddressDeleteResponse: """ - Lists existing destination addresses. + Deletes a specific destination address. Args: account_identifier: Identifier - direction: Sorts results in an ascending or descending order. - - page: Page number of paginated results. - - per_page: Maximum number of results per page. - - verified: Filter by verified destination addresses. + destination_address_identifier: Destination address identifier. extra_headers: Send extra headers @@ -385,28 +389,20 @@ async def email_routing_destination_addresses_list_destination_addresses( """ 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}/email/routing/addresses", + if not destination_address_identifier: + raise ValueError( + f"Expected a non-empty value for `destination_address_identifier` but received {destination_address_identifier!r}" + ) + return await self._delete( + f"/accounts/{account_identifier}/email/routing/addresses/{destination_address_identifier}", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=await async_maybe_transform( - { - "direction": direction, - "page": page, - "per_page": per_page, - "verified": verified, - }, - address_email_routing_destination_addresses_list_destination_addresses_params.AddressEmailRoutingDestinationAddressesListDestinationAddressesParams, - ), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast( - Type[Optional[AddressEmailRoutingDestinationAddressesListDestinationAddressesResponse]], - ResultWrapper[AddressEmailRoutingDestinationAddressesListDestinationAddressesResponse], - ), + cast_to=cast(Type[AddressDeleteResponse], ResultWrapper[AddressDeleteResponse]), ) async def get( @@ -463,12 +459,12 @@ def __init__(self, addresses: Addresses) -> None: self.create = to_raw_response_wrapper( addresses.create, ) + self.list = to_raw_response_wrapper( + addresses.list, + ) self.delete = to_raw_response_wrapper( addresses.delete, ) - self.email_routing_destination_addresses_list_destination_addresses = to_raw_response_wrapper( - addresses.email_routing_destination_addresses_list_destination_addresses, - ) self.get = to_raw_response_wrapper( addresses.get, ) @@ -481,12 +477,12 @@ def __init__(self, addresses: AsyncAddresses) -> None: self.create = async_to_raw_response_wrapper( addresses.create, ) + self.list = async_to_raw_response_wrapper( + addresses.list, + ) self.delete = async_to_raw_response_wrapper( addresses.delete, ) - self.email_routing_destination_addresses_list_destination_addresses = async_to_raw_response_wrapper( - addresses.email_routing_destination_addresses_list_destination_addresses, - ) self.get = async_to_raw_response_wrapper( addresses.get, ) @@ -499,12 +495,12 @@ def __init__(self, addresses: Addresses) -> None: self.create = to_streamed_response_wrapper( addresses.create, ) + self.list = to_streamed_response_wrapper( + addresses.list, + ) self.delete = to_streamed_response_wrapper( addresses.delete, ) - self.email_routing_destination_addresses_list_destination_addresses = to_streamed_response_wrapper( - addresses.email_routing_destination_addresses_list_destination_addresses, - ) self.get = to_streamed_response_wrapper( addresses.get, ) @@ -517,12 +513,12 @@ def __init__(self, addresses: AsyncAddresses) -> None: self.create = async_to_streamed_response_wrapper( addresses.create, ) + self.list = async_to_streamed_response_wrapper( + addresses.list, + ) self.delete = async_to_streamed_response_wrapper( addresses.delete, ) - self.email_routing_destination_addresses_list_destination_addresses = async_to_streamed_response_wrapper( - addresses.email_routing_destination_addresses_list_destination_addresses, - ) self.get = async_to_streamed_response_wrapper( addresses.get, ) diff --git a/src/cloudflare/resources/intel/__init__.py b/src/cloudflare/resources/intel/__init__.py index 54a61822cb5..214a83262c4 100644 --- a/src/cloudflare/resources/intel/__init__.py +++ b/src/cloudflare/resources/intel/__init__.py @@ -64,6 +64,14 @@ SinkholesWithStreamingResponse, AsyncSinkholesWithStreamingResponse, ) +from .domain_history import ( + DomainHistory, + AsyncDomainHistory, + DomainHistoryWithRawResponse, + AsyncDomainHistoryWithRawResponse, + DomainHistoryWithStreamingResponse, + AsyncDomainHistoryWithStreamingResponse, +) from .indicator_feeds import ( IndicatorFeeds, AsyncIndicatorFeeds, @@ -72,14 +80,6 @@ IndicatorFeedsWithStreamingResponse, AsyncIndicatorFeedsWithStreamingResponse, ) -from .domain_histories import ( - DomainHistories, - AsyncDomainHistories, - DomainHistoriesWithRawResponse, - AsyncDomainHistoriesWithRawResponse, - DomainHistoriesWithStreamingResponse, - AsyncDomainHistoriesWithStreamingResponse, -) from .miscategorizations import ( Miscategorizations, AsyncMiscategorizations, @@ -108,12 +108,12 @@ "AsyncDomainsWithRawResponse", "DomainsWithStreamingResponse", "AsyncDomainsWithStreamingResponse", - "DomainHistories", - "AsyncDomainHistories", - "DomainHistoriesWithRawResponse", - "AsyncDomainHistoriesWithRawResponse", - "DomainHistoriesWithStreamingResponse", - "AsyncDomainHistoriesWithStreamingResponse", + "DomainHistory", + "AsyncDomainHistory", + "DomainHistoryWithRawResponse", + "AsyncDomainHistoryWithRawResponse", + "DomainHistoryWithStreamingResponse", + "AsyncDomainHistoryWithStreamingResponse", "IPs", "AsyncIPs", "IPsWithRawResponse", diff --git a/src/cloudflare/resources/intel/asn/subnets.py b/src/cloudflare/resources/intel/asn/subnets.py index 8f315cb0e70..523cf0a1086 100644 --- a/src/cloudflare/resources/intel/asn/subnets.py +++ b/src/cloudflare/resources/intel/asn/subnets.py @@ -16,7 +16,7 @@ from ...._base_client import ( make_request_options, ) -from ....types.intel.asn import SubnetListResponse +from ....types.intel.asn import SubnetGetResponse __all__ = ["Subnets", "AsyncSubnets"] @@ -30,7 +30,7 @@ def with_raw_response(self) -> SubnetsWithRawResponse: def with_streaming_response(self) -> SubnetsWithStreamingResponse: return SubnetsWithStreamingResponse(self) - def list( + def get( self, asn: int, *, @@ -41,7 +41,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SubnetListResponse: + ) -> SubnetGetResponse: """ Get ASN Subnets @@ -63,7 +63,7 @@ def list( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=SubnetListResponse, + cast_to=SubnetGetResponse, ) @@ -76,7 +76,7 @@ def with_raw_response(self) -> AsyncSubnetsWithRawResponse: def with_streaming_response(self) -> AsyncSubnetsWithStreamingResponse: return AsyncSubnetsWithStreamingResponse(self) - async def list( + async def get( self, asn: int, *, @@ -87,7 +87,7 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SubnetListResponse: + ) -> SubnetGetResponse: """ Get ASN Subnets @@ -109,7 +109,7 @@ async def list( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=SubnetListResponse, + cast_to=SubnetGetResponse, ) @@ -117,8 +117,8 @@ class SubnetsWithRawResponse: def __init__(self, subnets: Subnets) -> None: self._subnets = subnets - self.list = to_raw_response_wrapper( - subnets.list, + self.get = to_raw_response_wrapper( + subnets.get, ) @@ -126,8 +126,8 @@ class AsyncSubnetsWithRawResponse: def __init__(self, subnets: AsyncSubnets) -> None: self._subnets = subnets - self.list = async_to_raw_response_wrapper( - subnets.list, + self.get = async_to_raw_response_wrapper( + subnets.get, ) @@ -135,8 +135,8 @@ class SubnetsWithStreamingResponse: def __init__(self, subnets: Subnets) -> None: self._subnets = subnets - self.list = to_streamed_response_wrapper( - subnets.list, + self.get = to_streamed_response_wrapper( + subnets.get, ) @@ -144,6 +144,6 @@ class AsyncSubnetsWithStreamingResponse: def __init__(self, subnets: AsyncSubnets) -> None: self._subnets = subnets - self.list = async_to_streamed_response_wrapper( - subnets.list, + self.get = async_to_streamed_response_wrapper( + subnets.get, ) diff --git a/src/cloudflare/resources/intel/domain_histories.py b/src/cloudflare/resources/intel/domain_history.py similarity index 61% rename from src/cloudflare/resources/intel/domain_histories.py rename to src/cloudflare/resources/intel/domain_history.py index 77b53c2ff8e..1905525abb1 100644 --- a/src/cloudflare/resources/intel/domain_histories.py +++ b/src/cloudflare/resources/intel/domain_history.py @@ -20,24 +20,24 @@ async_to_streamed_response_wrapper, ) from ..._wrappers import ResultWrapper -from ...types.intel import DomainHistoryListResponse, domain_history_list_params +from ...types.intel import DomainHistoryGetResponse, domain_history_get_params from ..._base_client import ( make_request_options, ) -__all__ = ["DomainHistories", "AsyncDomainHistories"] +__all__ = ["DomainHistory", "AsyncDomainHistory"] -class DomainHistories(SyncAPIResource): +class DomainHistory(SyncAPIResource): @cached_property - def with_raw_response(self) -> DomainHistoriesWithRawResponse: - return DomainHistoriesWithRawResponse(self) + def with_raw_response(self) -> DomainHistoryWithRawResponse: + return DomainHistoryWithRawResponse(self) @cached_property - def with_streaming_response(self) -> DomainHistoriesWithStreamingResponse: - return DomainHistoriesWithStreamingResponse(self) + def with_streaming_response(self) -> DomainHistoryWithStreamingResponse: + return DomainHistoryWithStreamingResponse(self) - def list( + def get( self, *, account_id: str, @@ -48,7 +48,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[DomainHistoryListResponse]: + ) -> Optional[DomainHistoryGetResponse]: """ Get Domain History @@ -72,23 +72,23 @@ def list( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=maybe_transform({"domain": domain}, domain_history_list_params.DomainHistoryListParams), + query=maybe_transform({"domain": domain}, domain_history_get_params.DomainHistoryGetParams), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[DomainHistoryListResponse]], ResultWrapper[DomainHistoryListResponse]), + cast_to=cast(Type[Optional[DomainHistoryGetResponse]], ResultWrapper[DomainHistoryGetResponse]), ) -class AsyncDomainHistories(AsyncAPIResource): +class AsyncDomainHistory(AsyncAPIResource): @cached_property - def with_raw_response(self) -> AsyncDomainHistoriesWithRawResponse: - return AsyncDomainHistoriesWithRawResponse(self) + def with_raw_response(self) -> AsyncDomainHistoryWithRawResponse: + return AsyncDomainHistoryWithRawResponse(self) @cached_property - def with_streaming_response(self) -> AsyncDomainHistoriesWithStreamingResponse: - return AsyncDomainHistoriesWithStreamingResponse(self) + def with_streaming_response(self) -> AsyncDomainHistoryWithStreamingResponse: + return AsyncDomainHistoryWithStreamingResponse(self) - async def list( + async def get( self, *, account_id: str, @@ -99,7 +99,7 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[DomainHistoryListResponse]: + ) -> Optional[DomainHistoryGetResponse]: """ Get Domain History @@ -123,46 +123,44 @@ async def list( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=await async_maybe_transform( - {"domain": domain}, domain_history_list_params.DomainHistoryListParams - ), + query=await async_maybe_transform({"domain": domain}, domain_history_get_params.DomainHistoryGetParams), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[DomainHistoryListResponse]], ResultWrapper[DomainHistoryListResponse]), + cast_to=cast(Type[Optional[DomainHistoryGetResponse]], ResultWrapper[DomainHistoryGetResponse]), ) -class DomainHistoriesWithRawResponse: - def __init__(self, domain_histories: DomainHistories) -> None: - self._domain_histories = domain_histories +class DomainHistoryWithRawResponse: + def __init__(self, domain_history: DomainHistory) -> None: + self._domain_history = domain_history - self.list = to_raw_response_wrapper( - domain_histories.list, + self.get = to_raw_response_wrapper( + domain_history.get, ) -class AsyncDomainHistoriesWithRawResponse: - def __init__(self, domain_histories: AsyncDomainHistories) -> None: - self._domain_histories = domain_histories +class AsyncDomainHistoryWithRawResponse: + def __init__(self, domain_history: AsyncDomainHistory) -> None: + self._domain_history = domain_history - self.list = async_to_raw_response_wrapper( - domain_histories.list, + self.get = async_to_raw_response_wrapper( + domain_history.get, ) -class DomainHistoriesWithStreamingResponse: - def __init__(self, domain_histories: DomainHistories) -> None: - self._domain_histories = domain_histories +class DomainHistoryWithStreamingResponse: + def __init__(self, domain_history: DomainHistory) -> None: + self._domain_history = domain_history - self.list = to_streamed_response_wrapper( - domain_histories.list, + self.get = to_streamed_response_wrapper( + domain_history.get, ) -class AsyncDomainHistoriesWithStreamingResponse: - def __init__(self, domain_histories: AsyncDomainHistories) -> None: - self._domain_histories = domain_histories +class AsyncDomainHistoryWithStreamingResponse: + def __init__(self, domain_history: AsyncDomainHistory) -> None: + self._domain_history = domain_history - self.list = async_to_streamed_response_wrapper( - domain_histories.list, + self.get = async_to_streamed_response_wrapper( + domain_history.get, ) diff --git a/src/cloudflare/resources/intel/intel.py b/src/cloudflare/resources/intel/intel.py index b98e8a5d8d5..29d5624afa4 100644 --- a/src/cloudflare/resources/intel/intel.py +++ b/src/cloudflare/resources/intel/intel.py @@ -61,6 +61,14 @@ AsyncSinkholesWithStreamingResponse, ) from ..._resource import SyncAPIResource, AsyncAPIResource +from .domain_history import ( + DomainHistory, + AsyncDomainHistory, + DomainHistoryWithRawResponse, + AsyncDomainHistoryWithRawResponse, + DomainHistoryWithStreamingResponse, + AsyncDomainHistoryWithStreamingResponse, +) from .domains.domains import Domains, AsyncDomains from .indicator_feeds import ( IndicatorFeeds, @@ -70,14 +78,6 @@ IndicatorFeedsWithStreamingResponse, AsyncIndicatorFeedsWithStreamingResponse, ) -from .domain_histories import ( - DomainHistories, - AsyncDomainHistories, - DomainHistoriesWithRawResponse, - AsyncDomainHistoriesWithRawResponse, - DomainHistoriesWithStreamingResponse, - AsyncDomainHistoriesWithStreamingResponse, -) from .miscategorizations import ( Miscategorizations, AsyncMiscategorizations, @@ -105,8 +105,8 @@ def domains(self) -> Domains: return Domains(self._client) @cached_property - def domain_histories(self) -> DomainHistories: - return DomainHistories(self._client) + def domain_history(self) -> DomainHistory: + return DomainHistory(self._client) @cached_property def ips(self) -> IPs: @@ -155,8 +155,8 @@ def domains(self) -> AsyncDomains: return AsyncDomains(self._client) @cached_property - def domain_histories(self) -> AsyncDomainHistories: - return AsyncDomainHistories(self._client) + def domain_history(self) -> AsyncDomainHistory: + return AsyncDomainHistory(self._client) @cached_property def ips(self) -> AsyncIPs: @@ -208,8 +208,8 @@ def domains(self) -> DomainsWithRawResponse: return DomainsWithRawResponse(self._intel.domains) @cached_property - def domain_histories(self) -> DomainHistoriesWithRawResponse: - return DomainHistoriesWithRawResponse(self._intel.domain_histories) + def domain_history(self) -> DomainHistoryWithRawResponse: + return DomainHistoryWithRawResponse(self._intel.domain_history) @cached_property def ips(self) -> IPsWithRawResponse: @@ -253,8 +253,8 @@ def domains(self) -> AsyncDomainsWithRawResponse: return AsyncDomainsWithRawResponse(self._intel.domains) @cached_property - def domain_histories(self) -> AsyncDomainHistoriesWithRawResponse: - return AsyncDomainHistoriesWithRawResponse(self._intel.domain_histories) + def domain_history(self) -> AsyncDomainHistoryWithRawResponse: + return AsyncDomainHistoryWithRawResponse(self._intel.domain_history) @cached_property def ips(self) -> AsyncIPsWithRawResponse: @@ -298,8 +298,8 @@ def domains(self) -> DomainsWithStreamingResponse: return DomainsWithStreamingResponse(self._intel.domains) @cached_property - def domain_histories(self) -> DomainHistoriesWithStreamingResponse: - return DomainHistoriesWithStreamingResponse(self._intel.domain_histories) + def domain_history(self) -> DomainHistoryWithStreamingResponse: + return DomainHistoryWithStreamingResponse(self._intel.domain_history) @cached_property def ips(self) -> IPsWithStreamingResponse: @@ -343,8 +343,8 @@ def domains(self) -> AsyncDomainsWithStreamingResponse: return AsyncDomainsWithStreamingResponse(self._intel.domains) @cached_property - def domain_histories(self) -> AsyncDomainHistoriesWithStreamingResponse: - return AsyncDomainHistoriesWithStreamingResponse(self._intel.domain_histories) + def domain_history(self) -> AsyncDomainHistoryWithStreamingResponse: + return AsyncDomainHistoryWithStreamingResponse(self._intel.domain_history) @cached_property def ips(self) -> AsyncIPsWithStreamingResponse: diff --git a/src/cloudflare/resources/load_balancers/monitors/references.py b/src/cloudflare/resources/load_balancers/monitors/references.py index f7d09d23910..7cd6a67a262 100644 --- a/src/cloudflare/resources/load_balancers/monitors/references.py +++ b/src/cloudflare/resources/load_balancers/monitors/references.py @@ -19,7 +19,7 @@ from ...._base_client import ( make_request_options, ) -from ....types.load_balancers.monitors import ReferenceListResponse +from ....types.load_balancers.monitors import ReferenceGetResponse __all__ = ["References", "AsyncReferences"] @@ -33,7 +33,7 @@ def with_raw_response(self) -> ReferencesWithRawResponse: def with_streaming_response(self) -> ReferencesWithStreamingResponse: return ReferencesWithStreamingResponse(self) - def list( + def get( self, monitor_id: str, *, @@ -44,7 +44,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ReferenceListResponse]: + ) -> Optional[ReferenceGetResponse]: """ Get the list of resources that reference the provided monitor. @@ -72,7 +72,7 @@ def list( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[ReferenceListResponse]], ResultWrapper[ReferenceListResponse]), + cast_to=cast(Type[Optional[ReferenceGetResponse]], ResultWrapper[ReferenceGetResponse]), ) @@ -85,7 +85,7 @@ def with_raw_response(self) -> AsyncReferencesWithRawResponse: def with_streaming_response(self) -> AsyncReferencesWithStreamingResponse: return AsyncReferencesWithStreamingResponse(self) - async def list( + async def get( self, monitor_id: str, *, @@ -96,7 +96,7 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ReferenceListResponse]: + ) -> Optional[ReferenceGetResponse]: """ Get the list of resources that reference the provided monitor. @@ -124,7 +124,7 @@ async def list( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[ReferenceListResponse]], ResultWrapper[ReferenceListResponse]), + cast_to=cast(Type[Optional[ReferenceGetResponse]], ResultWrapper[ReferenceGetResponse]), ) @@ -132,8 +132,8 @@ class ReferencesWithRawResponse: def __init__(self, references: References) -> None: self._references = references - self.list = to_raw_response_wrapper( - references.list, + self.get = to_raw_response_wrapper( + references.get, ) @@ -141,8 +141,8 @@ class AsyncReferencesWithRawResponse: def __init__(self, references: AsyncReferences) -> None: self._references = references - self.list = async_to_raw_response_wrapper( - references.list, + self.get = async_to_raw_response_wrapper( + references.get, ) @@ -150,8 +150,8 @@ class ReferencesWithStreamingResponse: def __init__(self, references: References) -> None: self._references = references - self.list = to_streamed_response_wrapper( - references.list, + self.get = to_streamed_response_wrapper( + references.get, ) @@ -159,6 +159,6 @@ class AsyncReferencesWithStreamingResponse: def __init__(self, references: AsyncReferences) -> None: self._references = references - self.list = async_to_streamed_response_wrapper( - references.list, + self.get = async_to_streamed_response_wrapper( + references.get, ) diff --git a/src/cloudflare/resources/load_balancers/pools/references.py b/src/cloudflare/resources/load_balancers/pools/references.py index d7efc7238c3..20f879efb7b 100644 --- a/src/cloudflare/resources/load_balancers/pools/references.py +++ b/src/cloudflare/resources/load_balancers/pools/references.py @@ -19,7 +19,7 @@ from ...._base_client import ( make_request_options, ) -from ....types.load_balancers.pools import ReferenceListResponse +from ....types.load_balancers.pools import ReferenceGetResponse __all__ = ["References", "AsyncReferences"] @@ -33,7 +33,7 @@ def with_raw_response(self) -> ReferencesWithRawResponse: def with_streaming_response(self) -> ReferencesWithStreamingResponse: return ReferencesWithStreamingResponse(self) - def list( + def get( self, pool_id: str, *, @@ -44,7 +44,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ReferenceListResponse]: + ) -> Optional[ReferenceGetResponse]: """ Get the list of resources that reference the provided pool. @@ -72,7 +72,7 @@ def list( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[ReferenceListResponse]], ResultWrapper[ReferenceListResponse]), + cast_to=cast(Type[Optional[ReferenceGetResponse]], ResultWrapper[ReferenceGetResponse]), ) @@ -85,7 +85,7 @@ def with_raw_response(self) -> AsyncReferencesWithRawResponse: def with_streaming_response(self) -> AsyncReferencesWithStreamingResponse: return AsyncReferencesWithStreamingResponse(self) - async def list( + async def get( self, pool_id: str, *, @@ -96,7 +96,7 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ReferenceListResponse]: + ) -> Optional[ReferenceGetResponse]: """ Get the list of resources that reference the provided pool. @@ -124,7 +124,7 @@ async def list( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[ReferenceListResponse]], ResultWrapper[ReferenceListResponse]), + cast_to=cast(Type[Optional[ReferenceGetResponse]], ResultWrapper[ReferenceGetResponse]), ) @@ -132,8 +132,8 @@ class ReferencesWithRawResponse: def __init__(self, references: References) -> None: self._references = references - self.list = to_raw_response_wrapper( - references.list, + self.get = to_raw_response_wrapper( + references.get, ) @@ -141,8 +141,8 @@ class AsyncReferencesWithRawResponse: def __init__(self, references: AsyncReferences) -> None: self._references = references - self.list = async_to_raw_response_wrapper( - references.list, + self.get = async_to_raw_response_wrapper( + references.get, ) @@ -150,8 +150,8 @@ class ReferencesWithStreamingResponse: def __init__(self, references: References) -> None: self._references = references - self.list = to_streamed_response_wrapper( - references.list, + self.get = to_streamed_response_wrapper( + references.get, ) @@ -159,6 +159,6 @@ class AsyncReferencesWithStreamingResponse: def __init__(self, references: AsyncReferences) -> None: self._references = references - self.list = async_to_streamed_response_wrapper( - references.list, + self.get = async_to_streamed_response_wrapper( + references.get, ) diff --git a/src/cloudflare/resources/load_balancers/searches.py b/src/cloudflare/resources/load_balancers/searches.py index f4b87c51958..009fed15278 100644 --- a/src/cloudflare/resources/load_balancers/searches.py +++ b/src/cloudflare/resources/load_balancers/searches.py @@ -23,7 +23,7 @@ from ..._base_client import ( make_request_options, ) -from ...types.load_balancers import SearchListResponse, search_list_params +from ...types.load_balancers import SearchGetResponse, search_get_params __all__ = ["Searches", "AsyncSearches"] @@ -37,20 +37,20 @@ def with_raw_response(self) -> SearchesWithRawResponse: def with_streaming_response(self) -> SearchesWithStreamingResponse: return SearchesWithStreamingResponse(self) - def list( + def get( self, *, account_id: str, page: object | NotGiven = NOT_GIVEN, per_page: object | NotGiven = NOT_GIVEN, - search_params: search_list_params.SearchParams | NotGiven = NOT_GIVEN, + search_params: search_get_params.SearchParams | 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, - ) -> Optional[SearchListResponse]: + ) -> Optional[SearchGetResponse]: """ Search for Load Balancing resources. @@ -80,11 +80,11 @@ def list( "per_page": per_page, "search_params": search_params, }, - search_list_params.SearchListParams, + search_get_params.SearchGetParams, ), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[SearchListResponse]], ResultWrapper[SearchListResponse]), + cast_to=cast(Type[Optional[SearchGetResponse]], ResultWrapper[SearchGetResponse]), ) @@ -97,20 +97,20 @@ def with_raw_response(self) -> AsyncSearchesWithRawResponse: def with_streaming_response(self) -> AsyncSearchesWithStreamingResponse: return AsyncSearchesWithStreamingResponse(self) - async def list( + async def get( self, *, account_id: str, page: object | NotGiven = NOT_GIVEN, per_page: object | NotGiven = NOT_GIVEN, - search_params: search_list_params.SearchParams | NotGiven = NOT_GIVEN, + search_params: search_get_params.SearchParams | 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, - ) -> Optional[SearchListResponse]: + ) -> Optional[SearchGetResponse]: """ Search for Load Balancing resources. @@ -140,11 +140,11 @@ async def list( "per_page": per_page, "search_params": search_params, }, - search_list_params.SearchListParams, + search_get_params.SearchGetParams, ), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[SearchListResponse]], ResultWrapper[SearchListResponse]), + cast_to=cast(Type[Optional[SearchGetResponse]], ResultWrapper[SearchGetResponse]), ) @@ -152,8 +152,8 @@ class SearchesWithRawResponse: def __init__(self, searches: Searches) -> None: self._searches = searches - self.list = to_raw_response_wrapper( - searches.list, + self.get = to_raw_response_wrapper( + searches.get, ) @@ -161,8 +161,8 @@ class AsyncSearchesWithRawResponse: def __init__(self, searches: AsyncSearches) -> None: self._searches = searches - self.list = async_to_raw_response_wrapper( - searches.list, + self.get = async_to_raw_response_wrapper( + searches.get, ) @@ -170,8 +170,8 @@ class SearchesWithStreamingResponse: def __init__(self, searches: Searches) -> None: self._searches = searches - self.list = to_streamed_response_wrapper( - searches.list, + self.get = to_streamed_response_wrapper( + searches.get, ) @@ -179,6 +179,6 @@ class AsyncSearchesWithStreamingResponse: def __init__(self, searches: AsyncSearches) -> None: self._searches = searches - self.list = async_to_streamed_response_wrapper( - searches.list, + self.get = async_to_streamed_response_wrapper( + searches.get, ) diff --git a/src/cloudflare/resources/logpush/datasets/fields.py b/src/cloudflare/resources/logpush/datasets/fields.py index 6234954c015..6b010a7208a 100644 --- a/src/cloudflare/resources/logpush/datasets/fields.py +++ b/src/cloudflare/resources/logpush/datasets/fields.py @@ -32,7 +32,7 @@ def with_raw_response(self) -> FieldsWithRawResponse: def with_streaming_response(self) -> FieldsWithStreamingResponse: return FieldsWithStreamingResponse(self) - def list( + def get( self, dataset_id: Optional[str], *, @@ -104,7 +104,7 @@ def with_raw_response(self) -> AsyncFieldsWithRawResponse: def with_streaming_response(self) -> AsyncFieldsWithStreamingResponse: return AsyncFieldsWithStreamingResponse(self) - async def list( + async def get( self, dataset_id: Optional[str], *, @@ -171,8 +171,8 @@ class FieldsWithRawResponse: def __init__(self, fields: Fields) -> None: self._fields = fields - self.list = to_raw_response_wrapper( - fields.list, + self.get = to_raw_response_wrapper( + fields.get, ) @@ -180,8 +180,8 @@ class AsyncFieldsWithRawResponse: def __init__(self, fields: AsyncFields) -> None: self._fields = fields - self.list = async_to_raw_response_wrapper( - fields.list, + self.get = async_to_raw_response_wrapper( + fields.get, ) @@ -189,8 +189,8 @@ class FieldsWithStreamingResponse: def __init__(self, fields: Fields) -> None: self._fields = fields - self.list = to_streamed_response_wrapper( - fields.list, + self.get = to_streamed_response_wrapper( + fields.get, ) @@ -198,6 +198,6 @@ class AsyncFieldsWithStreamingResponse: def __init__(self, fields: AsyncFields) -> None: self._fields = fields - self.list = async_to_streamed_response_wrapper( - fields.list, + self.get = async_to_streamed_response_wrapper( + fields.get, ) diff --git a/src/cloudflare/resources/logpush/datasets/jobs.py b/src/cloudflare/resources/logpush/datasets/jobs.py index a5f67044e04..542abaf884a 100644 --- a/src/cloudflare/resources/logpush/datasets/jobs.py +++ b/src/cloudflare/resources/logpush/datasets/jobs.py @@ -19,7 +19,7 @@ from ...._base_client import ( make_request_options, ) -from ....types.logpush.datasets import JobListResponse +from ....types.logpush.datasets import JobGetResponse __all__ = ["Jobs", "AsyncJobs"] @@ -33,7 +33,7 @@ def with_raw_response(self) -> JobsWithRawResponse: def with_streaming_response(self) -> JobsWithStreamingResponse: return JobsWithStreamingResponse(self) - def list( + def get( self, dataset_id: Optional[str], *, @@ -45,7 +45,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> JobListResponse: + ) -> JobGetResponse: """ Lists Logpush jobs for an account or zone for a dataset. @@ -90,7 +90,7 @@ def list( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[JobListResponse], ResultWrapper[JobListResponse]), + cast_to=cast(Type[JobGetResponse], ResultWrapper[JobGetResponse]), ) @@ -103,7 +103,7 @@ def with_raw_response(self) -> AsyncJobsWithRawResponse: def with_streaming_response(self) -> AsyncJobsWithStreamingResponse: return AsyncJobsWithStreamingResponse(self) - async def list( + async def get( self, dataset_id: Optional[str], *, @@ -115,7 +115,7 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> JobListResponse: + ) -> JobGetResponse: """ Lists Logpush jobs for an account or zone for a dataset. @@ -160,7 +160,7 @@ async def list( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[JobListResponse], ResultWrapper[JobListResponse]), + cast_to=cast(Type[JobGetResponse], ResultWrapper[JobGetResponse]), ) @@ -168,8 +168,8 @@ class JobsWithRawResponse: def __init__(self, jobs: Jobs) -> None: self._jobs = jobs - self.list = to_raw_response_wrapper( - jobs.list, + self.get = to_raw_response_wrapper( + jobs.get, ) @@ -177,8 +177,8 @@ class AsyncJobsWithRawResponse: def __init__(self, jobs: AsyncJobs) -> None: self._jobs = jobs - self.list = async_to_raw_response_wrapper( - jobs.list, + self.get = async_to_raw_response_wrapper( + jobs.get, ) @@ -186,8 +186,8 @@ class JobsWithStreamingResponse: def __init__(self, jobs: Jobs) -> None: self._jobs = jobs - self.list = to_streamed_response_wrapper( - jobs.list, + self.get = to_streamed_response_wrapper( + jobs.get, ) @@ -195,6 +195,6 @@ class AsyncJobsWithStreamingResponse: def __init__(self, jobs: AsyncJobs) -> None: self._jobs = jobs - self.list = async_to_streamed_response_wrapper( - jobs.list, + self.get = async_to_streamed_response_wrapper( + jobs.get, ) diff --git a/src/cloudflare/resources/logs/__init__.py b/src/cloudflare/resources/logs/__init__.py index d2d3dc01ed0..7461c17ea78 100644 --- a/src/cloudflare/resources/logs/__init__.py +++ b/src/cloudflare/resources/logs/__init__.py @@ -8,21 +8,21 @@ LogsWithStreamingResponse, AsyncLogsWithStreamingResponse, ) -from .rayids import ( - Rayids, - AsyncRayids, - RayidsWithRawResponse, - AsyncRayidsWithRawResponse, - RayidsWithStreamingResponse, - AsyncRayidsWithStreamingResponse, +from .rayid import ( + Rayid, + AsyncRayid, + RayidWithRawResponse, + AsyncRayidWithRawResponse, + RayidWithStreamingResponse, + AsyncRayidWithStreamingResponse, ) -from .controls import ( - Controls, - AsyncControls, - ControlsWithRawResponse, - AsyncControlsWithRawResponse, - ControlsWithStreamingResponse, - AsyncControlsWithStreamingResponse, +from .control import ( + Control, + AsyncControl, + ControlWithRawResponse, + AsyncControlWithRawResponse, + ControlWithStreamingResponse, + AsyncControlWithStreamingResponse, ) from .received import ( Received, @@ -34,18 +34,18 @@ ) __all__ = [ - "Controls", - "AsyncControls", - "ControlsWithRawResponse", - "AsyncControlsWithRawResponse", - "ControlsWithStreamingResponse", - "AsyncControlsWithStreamingResponse", - "Rayids", - "AsyncRayids", - "RayidsWithRawResponse", - "AsyncRayidsWithRawResponse", - "RayidsWithStreamingResponse", - "AsyncRayidsWithStreamingResponse", + "Control", + "AsyncControl", + "ControlWithRawResponse", + "AsyncControlWithRawResponse", + "ControlWithStreamingResponse", + "AsyncControlWithStreamingResponse", + "Rayid", + "AsyncRayid", + "RayidWithRawResponse", + "AsyncRayidWithRawResponse", + "RayidWithStreamingResponse", + "AsyncRayidWithStreamingResponse", "Received", "AsyncReceived", "ReceivedWithRawResponse", diff --git a/src/cloudflare/resources/logs/control/__init__.py b/src/cloudflare/resources/logs/control/__init__.py new file mode 100644 index 00000000000..7c09a891b95 --- /dev/null +++ b/src/cloudflare/resources/logs/control/__init__.py @@ -0,0 +1,47 @@ +# File generated from our OpenAPI spec by Stainless. + +from .cmb import ( + Cmb, + AsyncCmb, + CmbWithRawResponse, + AsyncCmbWithRawResponse, + CmbWithStreamingResponse, + AsyncCmbWithStreamingResponse, +) +from .control import ( + Control, + AsyncControl, + ControlWithRawResponse, + AsyncControlWithRawResponse, + ControlWithStreamingResponse, + AsyncControlWithStreamingResponse, +) +from .retention import ( + Retention, + AsyncRetention, + RetentionWithRawResponse, + AsyncRetentionWithRawResponse, + RetentionWithStreamingResponse, + AsyncRetentionWithStreamingResponse, +) + +__all__ = [ + "Retention", + "AsyncRetention", + "RetentionWithRawResponse", + "AsyncRetentionWithRawResponse", + "RetentionWithStreamingResponse", + "AsyncRetentionWithStreamingResponse", + "Cmb", + "AsyncCmb", + "CmbWithRawResponse", + "AsyncCmbWithRawResponse", + "CmbWithStreamingResponse", + "AsyncCmbWithStreamingResponse", + "Control", + "AsyncControl", + "ControlWithRawResponse", + "AsyncControlWithRawResponse", + "ControlWithStreamingResponse", + "AsyncControlWithStreamingResponse", +] diff --git a/src/cloudflare/resources/logs/controls/cmb/__init__.py b/src/cloudflare/resources/logs/control/cmb/__init__.py similarity index 100% rename from src/cloudflare/resources/logs/controls/cmb/__init__.py rename to src/cloudflare/resources/logs/control/cmb/__init__.py diff --git a/src/cloudflare/resources/logs/controls/cmb/cmb.py b/src/cloudflare/resources/logs/control/cmb/cmb.py similarity index 100% rename from src/cloudflare/resources/logs/controls/cmb/cmb.py rename to src/cloudflare/resources/logs/control/cmb/cmb.py diff --git a/src/cloudflare/resources/logs/controls/cmb/config.py b/src/cloudflare/resources/logs/control/cmb/config.py similarity index 99% rename from src/cloudflare/resources/logs/controls/cmb/config.py rename to src/cloudflare/resources/logs/control/cmb/config.py index 55a9b600e88..80a7d9cf3fc 100644 --- a/src/cloudflare/resources/logs/controls/cmb/config.py +++ b/src/cloudflare/resources/logs/control/cmb/config.py @@ -23,7 +23,7 @@ from ....._base_client import ( make_request_options, ) -from .....types.logs.controls.cmb import ( +from .....types.logs.control.cmb import ( ConfigGetResponse, ConfigCreateResponse, ConfigDeleteResponse, diff --git a/src/cloudflare/resources/logs/control/control.py b/src/cloudflare/resources/logs/control/control.py new file mode 100644 index 00000000000..a695a762b81 --- /dev/null +++ b/src/cloudflare/resources/logs/control/control.py @@ -0,0 +1,114 @@ +# File generated from our OpenAPI spec by Stainless. + +from __future__ import annotations + +from .cmb import ( + Cmb, + AsyncCmb, + CmbWithRawResponse, + AsyncCmbWithRawResponse, + CmbWithStreamingResponse, + AsyncCmbWithStreamingResponse, +) +from .cmb.cmb import Cmb, AsyncCmb +from .retention import ( + Retention, + AsyncRetention, + RetentionWithRawResponse, + AsyncRetentionWithRawResponse, + RetentionWithStreamingResponse, + AsyncRetentionWithStreamingResponse, +) +from ...._compat import cached_property +from ...._resource import SyncAPIResource, AsyncAPIResource +from .retention.retention import Retention, AsyncRetention + +__all__ = ["Control", "AsyncControl"] + + +class Control(SyncAPIResource): + @cached_property + def retention(self) -> Retention: + return Retention(self._client) + + @cached_property + def cmb(self) -> Cmb: + return Cmb(self._client) + + @cached_property + def with_raw_response(self) -> ControlWithRawResponse: + return ControlWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> ControlWithStreamingResponse: + return ControlWithStreamingResponse(self) + + +class AsyncControl(AsyncAPIResource): + @cached_property + def retention(self) -> AsyncRetention: + return AsyncRetention(self._client) + + @cached_property + def cmb(self) -> AsyncCmb: + return AsyncCmb(self._client) + + @cached_property + def with_raw_response(self) -> AsyncControlWithRawResponse: + return AsyncControlWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncControlWithStreamingResponse: + return AsyncControlWithStreamingResponse(self) + + +class ControlWithRawResponse: + def __init__(self, control: Control) -> None: + self._control = control + + @cached_property + def retention(self) -> RetentionWithRawResponse: + return RetentionWithRawResponse(self._control.retention) + + @cached_property + def cmb(self) -> CmbWithRawResponse: + return CmbWithRawResponse(self._control.cmb) + + +class AsyncControlWithRawResponse: + def __init__(self, control: AsyncControl) -> None: + self._control = control + + @cached_property + def retention(self) -> AsyncRetentionWithRawResponse: + return AsyncRetentionWithRawResponse(self._control.retention) + + @cached_property + def cmb(self) -> AsyncCmbWithRawResponse: + return AsyncCmbWithRawResponse(self._control.cmb) + + +class ControlWithStreamingResponse: + def __init__(self, control: Control) -> None: + self._control = control + + @cached_property + def retention(self) -> RetentionWithStreamingResponse: + return RetentionWithStreamingResponse(self._control.retention) + + @cached_property + def cmb(self) -> CmbWithStreamingResponse: + return CmbWithStreamingResponse(self._control.cmb) + + +class AsyncControlWithStreamingResponse: + def __init__(self, control: AsyncControl) -> None: + self._control = control + + @cached_property + def retention(self) -> AsyncRetentionWithStreamingResponse: + return AsyncRetentionWithStreamingResponse(self._control.retention) + + @cached_property + def cmb(self) -> AsyncCmbWithStreamingResponse: + return AsyncCmbWithStreamingResponse(self._control.cmb) diff --git a/src/cloudflare/resources/logs/control/retention/__init__.py b/src/cloudflare/resources/logs/control/retention/__init__.py new file mode 100644 index 00000000000..d2f0615f319 --- /dev/null +++ b/src/cloudflare/resources/logs/control/retention/__init__.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. + +from .flag import ( + Flag, + AsyncFlag, + FlagWithRawResponse, + AsyncFlagWithRawResponse, + FlagWithStreamingResponse, + AsyncFlagWithStreamingResponse, +) +from .retention import ( + Retention, + AsyncRetention, + RetentionWithRawResponse, + AsyncRetentionWithRawResponse, + RetentionWithStreamingResponse, + AsyncRetentionWithStreamingResponse, +) + +__all__ = [ + "Flag", + "AsyncFlag", + "FlagWithRawResponse", + "AsyncFlagWithRawResponse", + "FlagWithStreamingResponse", + "AsyncFlagWithStreamingResponse", + "Retention", + "AsyncRetention", + "RetentionWithRawResponse", + "AsyncRetentionWithRawResponse", + "RetentionWithStreamingResponse", + "AsyncRetentionWithStreamingResponse", +] diff --git a/src/cloudflare/resources/logs/controls/retentions/flags.py b/src/cloudflare/resources/logs/control/retention/flag.py similarity index 75% rename from src/cloudflare/resources/logs/controls/retentions/flags.py rename to src/cloudflare/resources/logs/control/retention/flag.py index 47bad73ea3c..f0da9c7b7e4 100644 --- a/src/cloudflare/resources/logs/controls/retentions/flags.py +++ b/src/cloudflare/resources/logs/control/retention/flag.py @@ -23,23 +23,19 @@ from ....._base_client import ( make_request_options, ) -from .....types.logs.controls.retentions import ( - FlagCreateResponse, - FlagLogsReceivedGetLogRetentionFlagResponse, - flag_create_params, -) +from .....types.logs.control.retention import FlagGetResponse, FlagCreateResponse, flag_create_params -__all__ = ["Flags", "AsyncFlags"] +__all__ = ["Flag", "AsyncFlag"] -class Flags(SyncAPIResource): +class Flag(SyncAPIResource): @cached_property - def with_raw_response(self) -> FlagsWithRawResponse: - return FlagsWithRawResponse(self) + def with_raw_response(self) -> FlagWithRawResponse: + return FlagWithRawResponse(self) @cached_property - def with_streaming_response(self) -> FlagsWithStreamingResponse: - return FlagsWithStreamingResponse(self) + def with_streaming_response(self) -> FlagWithStreamingResponse: + return FlagWithStreamingResponse(self) def create( self, @@ -84,7 +80,7 @@ def create( cast_to=cast(Type[FlagCreateResponse], ResultWrapper[FlagCreateResponse]), ) - def logs_received_get_log_retention_flag( + def get( self, zone_identifier: str, *, @@ -94,7 +90,7 @@ def logs_received_get_log_retention_flag( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FlagLogsReceivedGetLogRetentionFlagResponse: + ) -> FlagGetResponse: """ Gets log retention flag for Logpull API. @@ -120,21 +116,18 @@ def logs_received_get_log_retention_flag( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast( - Type[FlagLogsReceivedGetLogRetentionFlagResponse], - ResultWrapper[FlagLogsReceivedGetLogRetentionFlagResponse], - ), + cast_to=cast(Type[FlagGetResponse], ResultWrapper[FlagGetResponse]), ) -class AsyncFlags(AsyncAPIResource): +class AsyncFlag(AsyncAPIResource): @cached_property - def with_raw_response(self) -> AsyncFlagsWithRawResponse: - return AsyncFlagsWithRawResponse(self) + def with_raw_response(self) -> AsyncFlagWithRawResponse: + return AsyncFlagWithRawResponse(self) @cached_property - def with_streaming_response(self) -> AsyncFlagsWithStreamingResponse: - return AsyncFlagsWithStreamingResponse(self) + def with_streaming_response(self) -> AsyncFlagWithStreamingResponse: + return AsyncFlagWithStreamingResponse(self) async def create( self, @@ -179,7 +172,7 @@ async def create( cast_to=cast(Type[FlagCreateResponse], ResultWrapper[FlagCreateResponse]), ) - async def logs_received_get_log_retention_flag( + async def get( self, zone_identifier: str, *, @@ -189,7 +182,7 @@ async def logs_received_get_log_retention_flag( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FlagLogsReceivedGetLogRetentionFlagResponse: + ) -> FlagGetResponse: """ Gets log retention flag for Logpull API. @@ -215,56 +208,53 @@ async def logs_received_get_log_retention_flag( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast( - Type[FlagLogsReceivedGetLogRetentionFlagResponse], - ResultWrapper[FlagLogsReceivedGetLogRetentionFlagResponse], - ), + cast_to=cast(Type[FlagGetResponse], ResultWrapper[FlagGetResponse]), ) -class FlagsWithRawResponse: - def __init__(self, flags: Flags) -> None: - self._flags = flags +class FlagWithRawResponse: + def __init__(self, flag: Flag) -> None: + self._flag = flag self.create = to_raw_response_wrapper( - flags.create, + flag.create, ) - self.logs_received_get_log_retention_flag = to_raw_response_wrapper( - flags.logs_received_get_log_retention_flag, + self.get = to_raw_response_wrapper( + flag.get, ) -class AsyncFlagsWithRawResponse: - def __init__(self, flags: AsyncFlags) -> None: - self._flags = flags +class AsyncFlagWithRawResponse: + def __init__(self, flag: AsyncFlag) -> None: + self._flag = flag self.create = async_to_raw_response_wrapper( - flags.create, + flag.create, ) - self.logs_received_get_log_retention_flag = async_to_raw_response_wrapper( - flags.logs_received_get_log_retention_flag, + self.get = async_to_raw_response_wrapper( + flag.get, ) -class FlagsWithStreamingResponse: - def __init__(self, flags: Flags) -> None: - self._flags = flags +class FlagWithStreamingResponse: + def __init__(self, flag: Flag) -> None: + self._flag = flag self.create = to_streamed_response_wrapper( - flags.create, + flag.create, ) - self.logs_received_get_log_retention_flag = to_streamed_response_wrapper( - flags.logs_received_get_log_retention_flag, + self.get = to_streamed_response_wrapper( + flag.get, ) -class AsyncFlagsWithStreamingResponse: - def __init__(self, flags: AsyncFlags) -> None: - self._flags = flags +class AsyncFlagWithStreamingResponse: + def __init__(self, flag: AsyncFlag) -> None: + self._flag = flag self.create = async_to_streamed_response_wrapper( - flags.create, + flag.create, ) - self.logs_received_get_log_retention_flag = async_to_streamed_response_wrapper( - flags.logs_received_get_log_retention_flag, + self.get = async_to_streamed_response_wrapper( + flag.get, ) diff --git a/src/cloudflare/resources/logs/control/retention/retention.py b/src/cloudflare/resources/logs/control/retention/retention.py new file mode 100644 index 00000000000..fa06d2ba6bf --- /dev/null +++ b/src/cloudflare/resources/logs/control/retention/retention.py @@ -0,0 +1,80 @@ +# File generated from our OpenAPI spec by Stainless. + +from __future__ import annotations + +from .flag import ( + Flag, + AsyncFlag, + FlagWithRawResponse, + AsyncFlagWithRawResponse, + FlagWithStreamingResponse, + AsyncFlagWithStreamingResponse, +) +from ....._compat import cached_property +from ....._resource import SyncAPIResource, AsyncAPIResource + +__all__ = ["Retention", "AsyncRetention"] + + +class Retention(SyncAPIResource): + @cached_property + def flag(self) -> Flag: + return Flag(self._client) + + @cached_property + def with_raw_response(self) -> RetentionWithRawResponse: + return RetentionWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> RetentionWithStreamingResponse: + return RetentionWithStreamingResponse(self) + + +class AsyncRetention(AsyncAPIResource): + @cached_property + def flag(self) -> AsyncFlag: + return AsyncFlag(self._client) + + @cached_property + def with_raw_response(self) -> AsyncRetentionWithRawResponse: + return AsyncRetentionWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncRetentionWithStreamingResponse: + return AsyncRetentionWithStreamingResponse(self) + + +class RetentionWithRawResponse: + def __init__(self, retention: Retention) -> None: + self._retention = retention + + @cached_property + def flag(self) -> FlagWithRawResponse: + return FlagWithRawResponse(self._retention.flag) + + +class AsyncRetentionWithRawResponse: + def __init__(self, retention: AsyncRetention) -> None: + self._retention = retention + + @cached_property + def flag(self) -> AsyncFlagWithRawResponse: + return AsyncFlagWithRawResponse(self._retention.flag) + + +class RetentionWithStreamingResponse: + def __init__(self, retention: Retention) -> None: + self._retention = retention + + @cached_property + def flag(self) -> FlagWithStreamingResponse: + return FlagWithStreamingResponse(self._retention.flag) + + +class AsyncRetentionWithStreamingResponse: + def __init__(self, retention: AsyncRetention) -> None: + self._retention = retention + + @cached_property + def flag(self) -> AsyncFlagWithStreamingResponse: + return AsyncFlagWithStreamingResponse(self._retention.flag) diff --git a/src/cloudflare/resources/logs/controls/__init__.py b/src/cloudflare/resources/logs/controls/__init__.py deleted file mode 100644 index da41f962457..00000000000 --- a/src/cloudflare/resources/logs/controls/__init__.py +++ /dev/null @@ -1,47 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from .cmb import ( - Cmb, - AsyncCmb, - CmbWithRawResponse, - AsyncCmbWithRawResponse, - CmbWithStreamingResponse, - AsyncCmbWithStreamingResponse, -) -from .controls import ( - Controls, - AsyncControls, - ControlsWithRawResponse, - AsyncControlsWithRawResponse, - ControlsWithStreamingResponse, - AsyncControlsWithStreamingResponse, -) -from .retentions import ( - Retentions, - AsyncRetentions, - RetentionsWithRawResponse, - AsyncRetentionsWithRawResponse, - RetentionsWithStreamingResponse, - AsyncRetentionsWithStreamingResponse, -) - -__all__ = [ - "Retentions", - "AsyncRetentions", - "RetentionsWithRawResponse", - "AsyncRetentionsWithRawResponse", - "RetentionsWithStreamingResponse", - "AsyncRetentionsWithStreamingResponse", - "Cmb", - "AsyncCmb", - "CmbWithRawResponse", - "AsyncCmbWithRawResponse", - "CmbWithStreamingResponse", - "AsyncCmbWithStreamingResponse", - "Controls", - "AsyncControls", - "ControlsWithRawResponse", - "AsyncControlsWithRawResponse", - "ControlsWithStreamingResponse", - "AsyncControlsWithStreamingResponse", -] diff --git a/src/cloudflare/resources/logs/controls/controls.py b/src/cloudflare/resources/logs/controls/controls.py deleted file mode 100644 index 83b07ac03a6..00000000000 --- a/src/cloudflare/resources/logs/controls/controls.py +++ /dev/null @@ -1,114 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from __future__ import annotations - -from .cmb import ( - Cmb, - AsyncCmb, - CmbWithRawResponse, - AsyncCmbWithRawResponse, - CmbWithStreamingResponse, - AsyncCmbWithStreamingResponse, -) -from .cmb.cmb import Cmb, AsyncCmb -from ...._compat import cached_property -from .retentions import ( - Retentions, - AsyncRetentions, - RetentionsWithRawResponse, - AsyncRetentionsWithRawResponse, - RetentionsWithStreamingResponse, - AsyncRetentionsWithStreamingResponse, -) -from ...._resource import SyncAPIResource, AsyncAPIResource -from .retentions.retentions import Retentions, AsyncRetentions - -__all__ = ["Controls", "AsyncControls"] - - -class Controls(SyncAPIResource): - @cached_property - def retentions(self) -> Retentions: - return Retentions(self._client) - - @cached_property - def cmb(self) -> Cmb: - return Cmb(self._client) - - @cached_property - def with_raw_response(self) -> ControlsWithRawResponse: - return ControlsWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> ControlsWithStreamingResponse: - return ControlsWithStreamingResponse(self) - - -class AsyncControls(AsyncAPIResource): - @cached_property - def retentions(self) -> AsyncRetentions: - return AsyncRetentions(self._client) - - @cached_property - def cmb(self) -> AsyncCmb: - return AsyncCmb(self._client) - - @cached_property - def with_raw_response(self) -> AsyncControlsWithRawResponse: - return AsyncControlsWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncControlsWithStreamingResponse: - return AsyncControlsWithStreamingResponse(self) - - -class ControlsWithRawResponse: - def __init__(self, controls: Controls) -> None: - self._controls = controls - - @cached_property - def retentions(self) -> RetentionsWithRawResponse: - return RetentionsWithRawResponse(self._controls.retentions) - - @cached_property - def cmb(self) -> CmbWithRawResponse: - return CmbWithRawResponse(self._controls.cmb) - - -class AsyncControlsWithRawResponse: - def __init__(self, controls: AsyncControls) -> None: - self._controls = controls - - @cached_property - def retentions(self) -> AsyncRetentionsWithRawResponse: - return AsyncRetentionsWithRawResponse(self._controls.retentions) - - @cached_property - def cmb(self) -> AsyncCmbWithRawResponse: - return AsyncCmbWithRawResponse(self._controls.cmb) - - -class ControlsWithStreamingResponse: - def __init__(self, controls: Controls) -> None: - self._controls = controls - - @cached_property - def retentions(self) -> RetentionsWithStreamingResponse: - return RetentionsWithStreamingResponse(self._controls.retentions) - - @cached_property - def cmb(self) -> CmbWithStreamingResponse: - return CmbWithStreamingResponse(self._controls.cmb) - - -class AsyncControlsWithStreamingResponse: - def __init__(self, controls: AsyncControls) -> None: - self._controls = controls - - @cached_property - def retentions(self) -> AsyncRetentionsWithStreamingResponse: - return AsyncRetentionsWithStreamingResponse(self._controls.retentions) - - @cached_property - def cmb(self) -> AsyncCmbWithStreamingResponse: - return AsyncCmbWithStreamingResponse(self._controls.cmb) diff --git a/src/cloudflare/resources/logs/controls/retentions/__init__.py b/src/cloudflare/resources/logs/controls/retentions/__init__.py deleted file mode 100644 index 76af3f37346..00000000000 --- a/src/cloudflare/resources/logs/controls/retentions/__init__.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from .flags import ( - Flags, - AsyncFlags, - FlagsWithRawResponse, - AsyncFlagsWithRawResponse, - FlagsWithStreamingResponse, - AsyncFlagsWithStreamingResponse, -) -from .retentions import ( - Retentions, - AsyncRetentions, - RetentionsWithRawResponse, - AsyncRetentionsWithRawResponse, - RetentionsWithStreamingResponse, - AsyncRetentionsWithStreamingResponse, -) - -__all__ = [ - "Flags", - "AsyncFlags", - "FlagsWithRawResponse", - "AsyncFlagsWithRawResponse", - "FlagsWithStreamingResponse", - "AsyncFlagsWithStreamingResponse", - "Retentions", - "AsyncRetentions", - "RetentionsWithRawResponse", - "AsyncRetentionsWithRawResponse", - "RetentionsWithStreamingResponse", - "AsyncRetentionsWithStreamingResponse", -] diff --git a/src/cloudflare/resources/logs/controls/retentions/retentions.py b/src/cloudflare/resources/logs/controls/retentions/retentions.py deleted file mode 100644 index fc77f8e7e50..00000000000 --- a/src/cloudflare/resources/logs/controls/retentions/retentions.py +++ /dev/null @@ -1,80 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from __future__ import annotations - -from .flags import ( - Flags, - AsyncFlags, - FlagsWithRawResponse, - AsyncFlagsWithRawResponse, - FlagsWithStreamingResponse, - AsyncFlagsWithStreamingResponse, -) -from ....._compat import cached_property -from ....._resource import SyncAPIResource, AsyncAPIResource - -__all__ = ["Retentions", "AsyncRetentions"] - - -class Retentions(SyncAPIResource): - @cached_property - def flags(self) -> Flags: - return Flags(self._client) - - @cached_property - def with_raw_response(self) -> RetentionsWithRawResponse: - return RetentionsWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> RetentionsWithStreamingResponse: - return RetentionsWithStreamingResponse(self) - - -class AsyncRetentions(AsyncAPIResource): - @cached_property - def flags(self) -> AsyncFlags: - return AsyncFlags(self._client) - - @cached_property - def with_raw_response(self) -> AsyncRetentionsWithRawResponse: - return AsyncRetentionsWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncRetentionsWithStreamingResponse: - return AsyncRetentionsWithStreamingResponse(self) - - -class RetentionsWithRawResponse: - def __init__(self, retentions: Retentions) -> None: - self._retentions = retentions - - @cached_property - def flags(self) -> FlagsWithRawResponse: - return FlagsWithRawResponse(self._retentions.flags) - - -class AsyncRetentionsWithRawResponse: - def __init__(self, retentions: AsyncRetentions) -> None: - self._retentions = retentions - - @cached_property - def flags(self) -> AsyncFlagsWithRawResponse: - return AsyncFlagsWithRawResponse(self._retentions.flags) - - -class RetentionsWithStreamingResponse: - def __init__(self, retentions: Retentions) -> None: - self._retentions = retentions - - @cached_property - def flags(self) -> FlagsWithStreamingResponse: - return FlagsWithStreamingResponse(self._retentions.flags) - - -class AsyncRetentionsWithStreamingResponse: - def __init__(self, retentions: AsyncRetentions) -> None: - self._retentions = retentions - - @cached_property - def flags(self) -> AsyncFlagsWithStreamingResponse: - return AsyncFlagsWithStreamingResponse(self._retentions.flags) diff --git a/src/cloudflare/resources/logs/logs.py b/src/cloudflare/resources/logs/logs.py index 4a0f4178b27..2e3ebcac3fd 100644 --- a/src/cloudflare/resources/logs/logs.py +++ b/src/cloudflare/resources/logs/logs.py @@ -2,21 +2,21 @@ from __future__ import annotations -from .rayids import ( - Rayids, - AsyncRayids, - RayidsWithRawResponse, - AsyncRayidsWithRawResponse, - RayidsWithStreamingResponse, - AsyncRayidsWithStreamingResponse, +from .rayid import ( + Rayid, + AsyncRayid, + RayidWithRawResponse, + AsyncRayidWithRawResponse, + RayidWithStreamingResponse, + AsyncRayidWithStreamingResponse, ) -from .controls import ( - Controls, - AsyncControls, - ControlsWithRawResponse, - AsyncControlsWithRawResponse, - ControlsWithStreamingResponse, - AsyncControlsWithStreamingResponse, +from .control import ( + Control, + AsyncControl, + ControlWithRawResponse, + AsyncControlWithRawResponse, + ControlWithStreamingResponse, + AsyncControlWithStreamingResponse, ) from .received import ( Received, @@ -28,7 +28,7 @@ ) from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource -from .controls.controls import Controls, AsyncControls +from .control.control import Control, AsyncControl from .received.received import Received, AsyncReceived __all__ = ["Logs", "AsyncLogs"] @@ -36,12 +36,12 @@ class Logs(SyncAPIResource): @cached_property - def controls(self) -> Controls: - return Controls(self._client) + def control(self) -> Control: + return Control(self._client) @cached_property - def rayids(self) -> Rayids: - return Rayids(self._client) + def rayid(self) -> Rayid: + return Rayid(self._client) @cached_property def received(self) -> Received: @@ -58,12 +58,12 @@ def with_streaming_response(self) -> LogsWithStreamingResponse: class AsyncLogs(AsyncAPIResource): @cached_property - def controls(self) -> AsyncControls: - return AsyncControls(self._client) + def control(self) -> AsyncControl: + return AsyncControl(self._client) @cached_property - def rayids(self) -> AsyncRayids: - return AsyncRayids(self._client) + def rayid(self) -> AsyncRayid: + return AsyncRayid(self._client) @cached_property def received(self) -> AsyncReceived: @@ -83,12 +83,12 @@ def __init__(self, logs: Logs) -> None: self._logs = logs @cached_property - def controls(self) -> ControlsWithRawResponse: - return ControlsWithRawResponse(self._logs.controls) + def control(self) -> ControlWithRawResponse: + return ControlWithRawResponse(self._logs.control) @cached_property - def rayids(self) -> RayidsWithRawResponse: - return RayidsWithRawResponse(self._logs.rayids) + def rayid(self) -> RayidWithRawResponse: + return RayidWithRawResponse(self._logs.rayid) @cached_property def received(self) -> ReceivedWithRawResponse: @@ -100,12 +100,12 @@ def __init__(self, logs: AsyncLogs) -> None: self._logs = logs @cached_property - def controls(self) -> AsyncControlsWithRawResponse: - return AsyncControlsWithRawResponse(self._logs.controls) + def control(self) -> AsyncControlWithRawResponse: + return AsyncControlWithRawResponse(self._logs.control) @cached_property - def rayids(self) -> AsyncRayidsWithRawResponse: - return AsyncRayidsWithRawResponse(self._logs.rayids) + def rayid(self) -> AsyncRayidWithRawResponse: + return AsyncRayidWithRawResponse(self._logs.rayid) @cached_property def received(self) -> AsyncReceivedWithRawResponse: @@ -117,12 +117,12 @@ def __init__(self, logs: Logs) -> None: self._logs = logs @cached_property - def controls(self) -> ControlsWithStreamingResponse: - return ControlsWithStreamingResponse(self._logs.controls) + def control(self) -> ControlWithStreamingResponse: + return ControlWithStreamingResponse(self._logs.control) @cached_property - def rayids(self) -> RayidsWithStreamingResponse: - return RayidsWithStreamingResponse(self._logs.rayids) + def rayid(self) -> RayidWithStreamingResponse: + return RayidWithStreamingResponse(self._logs.rayid) @cached_property def received(self) -> ReceivedWithStreamingResponse: @@ -134,12 +134,12 @@ def __init__(self, logs: AsyncLogs) -> None: self._logs = logs @cached_property - def controls(self) -> AsyncControlsWithStreamingResponse: - return AsyncControlsWithStreamingResponse(self._logs.controls) + def control(self) -> AsyncControlWithStreamingResponse: + return AsyncControlWithStreamingResponse(self._logs.control) @cached_property - def rayids(self) -> AsyncRayidsWithStreamingResponse: - return AsyncRayidsWithStreamingResponse(self._logs.rayids) + def rayid(self) -> AsyncRayidWithStreamingResponse: + return AsyncRayidWithStreamingResponse(self._logs.rayid) @cached_property def received(self) -> AsyncReceivedWithStreamingResponse: diff --git a/src/cloudflare/resources/logs/rayids.py b/src/cloudflare/resources/logs/rayid.py similarity index 88% rename from src/cloudflare/resources/logs/rayids.py rename to src/cloudflare/resources/logs/rayid.py index 687c128c67c..abc66a8ba85 100644 --- a/src/cloudflare/resources/logs/rayids.py +++ b/src/cloudflare/resources/logs/rayid.py @@ -25,17 +25,17 @@ make_request_options, ) -__all__ = ["Rayids", "AsyncRayids"] +__all__ = ["Rayid", "AsyncRayid"] -class Rayids(SyncAPIResource): +class Rayid(SyncAPIResource): @cached_property - def with_raw_response(self) -> RayidsWithRawResponse: - return RayidsWithRawResponse(self) + def with_raw_response(self) -> RayidWithRawResponse: + return RayidWithRawResponse(self) @cached_property - def with_streaming_response(self) -> RayidsWithStreamingResponse: - return RayidsWithStreamingResponse(self) + def with_streaming_response(self) -> RayidWithStreamingResponse: + return RayidWithStreamingResponse(self) def get( self, @@ -113,14 +113,14 @@ def get( ) -class AsyncRayids(AsyncAPIResource): +class AsyncRayid(AsyncAPIResource): @cached_property - def with_raw_response(self) -> AsyncRayidsWithRawResponse: - return AsyncRayidsWithRawResponse(self) + def with_raw_response(self) -> AsyncRayidWithRawResponse: + return AsyncRayidWithRawResponse(self) @cached_property - def with_streaming_response(self) -> AsyncRayidsWithStreamingResponse: - return AsyncRayidsWithStreamingResponse(self) + def with_streaming_response(self) -> AsyncRayidWithStreamingResponse: + return AsyncRayidWithStreamingResponse(self) async def get( self, @@ -198,37 +198,37 @@ async def get( ) -class RayidsWithRawResponse: - def __init__(self, rayids: Rayids) -> None: - self._rayids = rayids +class RayidWithRawResponse: + def __init__(self, rayid: Rayid) -> None: + self._rayid = rayid self.get = to_raw_response_wrapper( - rayids.get, + rayid.get, ) -class AsyncRayidsWithRawResponse: - def __init__(self, rayids: AsyncRayids) -> None: - self._rayids = rayids +class AsyncRayidWithRawResponse: + def __init__(self, rayid: AsyncRayid) -> None: + self._rayid = rayid self.get = async_to_raw_response_wrapper( - rayids.get, + rayid.get, ) -class RayidsWithStreamingResponse: - def __init__(self, rayids: Rayids) -> None: - self._rayids = rayids +class RayidWithStreamingResponse: + def __init__(self, rayid: Rayid) -> None: + self._rayid = rayid self.get = to_streamed_response_wrapper( - rayids.get, + rayid.get, ) -class AsyncRayidsWithStreamingResponse: - def __init__(self, rayids: AsyncRayids) -> None: - self._rayids = rayids +class AsyncRayidWithStreamingResponse: + def __init__(self, rayid: AsyncRayid) -> None: + self._rayid = rayid self.get = async_to_streamed_response_wrapper( - rayids.get, + rayid.get, ) diff --git a/src/cloudflare/resources/logs/received/fields.py b/src/cloudflare/resources/logs/received/fields.py index 61c1f8e227a..5a46e6a20bd 100644 --- a/src/cloudflare/resources/logs/received/fields.py +++ b/src/cloudflare/resources/logs/received/fields.py @@ -16,7 +16,7 @@ from ...._base_client import ( make_request_options, ) -from ....types.logs.received import FieldListResponse +from ....types.logs.received import FieldGetResponse __all__ = ["Fields", "AsyncFields"] @@ -30,7 +30,7 @@ def with_raw_response(self) -> FieldsWithRawResponse: def with_streaming_response(self) -> FieldsWithStreamingResponse: return FieldsWithStreamingResponse(self) - def list( + def get( self, zone_identifier: str, *, @@ -40,7 +40,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FieldListResponse: + ) -> FieldGetResponse: """Lists all fields available. The response is json object with key-value pairs, @@ -64,7 +64,7 @@ def list( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=FieldListResponse, + cast_to=FieldGetResponse, ) @@ -77,7 +77,7 @@ def with_raw_response(self) -> AsyncFieldsWithRawResponse: def with_streaming_response(self) -> AsyncFieldsWithStreamingResponse: return AsyncFieldsWithStreamingResponse(self) - async def list( + async def get( self, zone_identifier: str, *, @@ -87,7 +87,7 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FieldListResponse: + ) -> FieldGetResponse: """Lists all fields available. The response is json object with key-value pairs, @@ -111,7 +111,7 @@ async def list( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=FieldListResponse, + cast_to=FieldGetResponse, ) @@ -119,8 +119,8 @@ class FieldsWithRawResponse: def __init__(self, fields: Fields) -> None: self._fields = fields - self.list = to_raw_response_wrapper( - fields.list, + self.get = to_raw_response_wrapper( + fields.get, ) @@ -128,8 +128,8 @@ class AsyncFieldsWithRawResponse: def __init__(self, fields: AsyncFields) -> None: self._fields = fields - self.list = async_to_raw_response_wrapper( - fields.list, + self.get = async_to_raw_response_wrapper( + fields.get, ) @@ -137,8 +137,8 @@ class FieldsWithStreamingResponse: def __init__(self, fields: Fields) -> None: self._fields = fields - self.list = to_streamed_response_wrapper( - fields.list, + self.get = to_streamed_response_wrapper( + fields.get, ) @@ -146,6 +146,6 @@ class AsyncFieldsWithStreamingResponse: def __init__(self, fields: AsyncFields) -> None: self._fields = fields - self.list = async_to_streamed_response_wrapper( - fields.list, + self.get = async_to_streamed_response_wrapper( + fields.get, ) diff --git a/src/cloudflare/resources/magic_network_monitoring/configs/__init__.py b/src/cloudflare/resources/magic_network_monitoring/configs/__init__.py index a879bb5a368..e58d2521593 100644 --- a/src/cloudflare/resources/magic_network_monitoring/configs/__init__.py +++ b/src/cloudflare/resources/magic_network_monitoring/configs/__init__.py @@ -1,12 +1,12 @@ # File generated from our OpenAPI spec by Stainless. -from .fulls import ( - Fulls, - AsyncFulls, - FullsWithRawResponse, - AsyncFullsWithRawResponse, - FullsWithStreamingResponse, - AsyncFullsWithStreamingResponse, +from .full import ( + Full, + AsyncFull, + FullWithRawResponse, + AsyncFullWithRawResponse, + FullWithStreamingResponse, + AsyncFullWithStreamingResponse, ) from .configs import ( Configs, @@ -18,12 +18,12 @@ ) __all__ = [ - "Fulls", - "AsyncFulls", - "FullsWithRawResponse", - "AsyncFullsWithRawResponse", - "FullsWithStreamingResponse", - "AsyncFullsWithStreamingResponse", + "Full", + "AsyncFull", + "FullWithRawResponse", + "AsyncFullWithRawResponse", + "FullWithStreamingResponse", + "AsyncFullWithStreamingResponse", "Configs", "AsyncConfigs", "ConfigsWithRawResponse", diff --git a/src/cloudflare/resources/magic_network_monitoring/configs/configs.py b/src/cloudflare/resources/magic_network_monitoring/configs/configs.py index 34be95e519c..81fd704c059 100644 --- a/src/cloudflare/resources/magic_network_monitoring/configs/configs.py +++ b/src/cloudflare/resources/magic_network_monitoring/configs/configs.py @@ -6,13 +6,13 @@ import httpx -from .fulls import ( - Fulls, - AsyncFulls, - FullsWithRawResponse, - AsyncFullsWithRawResponse, - FullsWithStreamingResponse, - AsyncFullsWithStreamingResponse, +from .full import ( + Full, + AsyncFull, + FullWithRawResponse, + AsyncFullWithRawResponse, + FullWithStreamingResponse, + AsyncFullWithStreamingResponse, ) from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ...._compat import cached_property @@ -28,8 +28,8 @@ make_request_options, ) from ....types.magic_network_monitoring import ( + ConfigGetResponse, ConfigEditResponse, - ConfigListResponse, ConfigCreateResponse, ConfigDeleteResponse, ConfigUpdateResponse, @@ -40,8 +40,8 @@ class Configs(SyncAPIResource): @cached_property - def fulls(self) -> Fulls: - return Fulls(self._client) + def full(self) -> Full: + return Full(self._client) @cached_property def with_raw_response(self) -> ConfigsWithRawResponse: @@ -122,7 +122,7 @@ def update( cast_to=cast(Type[ConfigUpdateResponse], ResultWrapper[ConfigUpdateResponse]), ) - def list( + def delete( self, account_identifier: object, *, @@ -132,9 +132,9 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ConfigListResponse: + ) -> ConfigDeleteResponse: """ - Lists default sampling and router IPs for account. + Delete an existing network monitoring configuration. Args: extra_headers: Send extra headers @@ -145,7 +145,7 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - return self._get( + return self._delete( f"/accounts/{account_identifier}/mnm/config", options=make_request_options( extra_headers=extra_headers, @@ -154,10 +154,10 @@ def list( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ConfigListResponse], ResultWrapper[ConfigListResponse]), + cast_to=cast(Type[ConfigDeleteResponse], ResultWrapper[ConfigDeleteResponse]), ) - def delete( + def edit( self, account_identifier: object, *, @@ -167,9 +167,9 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ConfigDeleteResponse: + ) -> ConfigEditResponse: """ - Delete an existing network monitoring configuration. + Update fields in an existing network monitoring configuration. Args: extra_headers: Send extra headers @@ -180,7 +180,7 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - return self._delete( + return self._patch( f"/accounts/{account_identifier}/mnm/config", options=make_request_options( extra_headers=extra_headers, @@ -189,10 +189,10 @@ def delete( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ConfigDeleteResponse], ResultWrapper[ConfigDeleteResponse]), + cast_to=cast(Type[ConfigEditResponse], ResultWrapper[ConfigEditResponse]), ) - def edit( + def get( self, account_identifier: object, *, @@ -202,9 +202,9 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ConfigEditResponse: + ) -> ConfigGetResponse: """ - Update fields in an existing network monitoring configuration. + Lists default sampling and router IPs for account. Args: extra_headers: Send extra headers @@ -215,7 +215,7 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - return self._patch( + return self._get( f"/accounts/{account_identifier}/mnm/config", options=make_request_options( extra_headers=extra_headers, @@ -224,14 +224,14 @@ def edit( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ConfigEditResponse], ResultWrapper[ConfigEditResponse]), + cast_to=cast(Type[ConfigGetResponse], ResultWrapper[ConfigGetResponse]), ) class AsyncConfigs(AsyncAPIResource): @cached_property - def fulls(self) -> AsyncFulls: - return AsyncFulls(self._client) + def full(self) -> AsyncFull: + return AsyncFull(self._client) @cached_property def with_raw_response(self) -> AsyncConfigsWithRawResponse: @@ -312,7 +312,7 @@ async def update( cast_to=cast(Type[ConfigUpdateResponse], ResultWrapper[ConfigUpdateResponse]), ) - async def list( + async def delete( self, account_identifier: object, *, @@ -322,9 +322,9 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ConfigListResponse: + ) -> ConfigDeleteResponse: """ - Lists default sampling and router IPs for account. + Delete an existing network monitoring configuration. Args: extra_headers: Send extra headers @@ -335,7 +335,7 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - return await self._get( + return await self._delete( f"/accounts/{account_identifier}/mnm/config", options=make_request_options( extra_headers=extra_headers, @@ -344,10 +344,10 @@ async def list( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ConfigListResponse], ResultWrapper[ConfigListResponse]), + cast_to=cast(Type[ConfigDeleteResponse], ResultWrapper[ConfigDeleteResponse]), ) - async def delete( + async def edit( self, account_identifier: object, *, @@ -357,9 +357,9 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ConfigDeleteResponse: + ) -> ConfigEditResponse: """ - Delete an existing network monitoring configuration. + Update fields in an existing network monitoring configuration. Args: extra_headers: Send extra headers @@ -370,7 +370,7 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - return await self._delete( + return await self._patch( f"/accounts/{account_identifier}/mnm/config", options=make_request_options( extra_headers=extra_headers, @@ -379,10 +379,10 @@ async def delete( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ConfigDeleteResponse], ResultWrapper[ConfigDeleteResponse]), + cast_to=cast(Type[ConfigEditResponse], ResultWrapper[ConfigEditResponse]), ) - async def edit( + async def get( self, account_identifier: object, *, @@ -392,9 +392,9 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ConfigEditResponse: + ) -> ConfigGetResponse: """ - Update fields in an existing network monitoring configuration. + Lists default sampling and router IPs for account. Args: extra_headers: Send extra headers @@ -405,7 +405,7 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - return await self._patch( + return await self._get( f"/accounts/{account_identifier}/mnm/config", options=make_request_options( extra_headers=extra_headers, @@ -414,7 +414,7 @@ async def edit( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ConfigEditResponse], ResultWrapper[ConfigEditResponse]), + cast_to=cast(Type[ConfigGetResponse], ResultWrapper[ConfigGetResponse]), ) @@ -428,19 +428,19 @@ def __init__(self, configs: Configs) -> None: self.update = to_raw_response_wrapper( configs.update, ) - self.list = to_raw_response_wrapper( - configs.list, - ) self.delete = to_raw_response_wrapper( configs.delete, ) self.edit = to_raw_response_wrapper( configs.edit, ) + self.get = to_raw_response_wrapper( + configs.get, + ) @cached_property - def fulls(self) -> FullsWithRawResponse: - return FullsWithRawResponse(self._configs.fulls) + def full(self) -> FullWithRawResponse: + return FullWithRawResponse(self._configs.full) class AsyncConfigsWithRawResponse: @@ -453,19 +453,19 @@ def __init__(self, configs: AsyncConfigs) -> None: self.update = async_to_raw_response_wrapper( configs.update, ) - self.list = async_to_raw_response_wrapper( - configs.list, - ) self.delete = async_to_raw_response_wrapper( configs.delete, ) self.edit = async_to_raw_response_wrapper( configs.edit, ) + self.get = async_to_raw_response_wrapper( + configs.get, + ) @cached_property - def fulls(self) -> AsyncFullsWithRawResponse: - return AsyncFullsWithRawResponse(self._configs.fulls) + def full(self) -> AsyncFullWithRawResponse: + return AsyncFullWithRawResponse(self._configs.full) class ConfigsWithStreamingResponse: @@ -478,19 +478,19 @@ def __init__(self, configs: Configs) -> None: self.update = to_streamed_response_wrapper( configs.update, ) - self.list = to_streamed_response_wrapper( - configs.list, - ) self.delete = to_streamed_response_wrapper( configs.delete, ) self.edit = to_streamed_response_wrapper( configs.edit, ) + self.get = to_streamed_response_wrapper( + configs.get, + ) @cached_property - def fulls(self) -> FullsWithStreamingResponse: - return FullsWithStreamingResponse(self._configs.fulls) + def full(self) -> FullWithStreamingResponse: + return FullWithStreamingResponse(self._configs.full) class AsyncConfigsWithStreamingResponse: @@ -503,16 +503,16 @@ def __init__(self, configs: AsyncConfigs) -> None: self.update = async_to_streamed_response_wrapper( configs.update, ) - self.list = async_to_streamed_response_wrapper( - configs.list, - ) self.delete = async_to_streamed_response_wrapper( configs.delete, ) self.edit = async_to_streamed_response_wrapper( configs.edit, ) + self.get = async_to_streamed_response_wrapper( + configs.get, + ) @cached_property - def fulls(self) -> AsyncFullsWithStreamingResponse: - return AsyncFullsWithStreamingResponse(self._configs.fulls) + def full(self) -> AsyncFullWithStreamingResponse: + return AsyncFullWithStreamingResponse(self._configs.full) diff --git a/src/cloudflare/resources/magic_network_monitoring/configs/fulls.py b/src/cloudflare/resources/magic_network_monitoring/configs/full.py similarity index 66% rename from src/cloudflare/resources/magic_network_monitoring/configs/fulls.py rename to src/cloudflare/resources/magic_network_monitoring/configs/full.py index 02bb1101dc6..93fb33e4d43 100644 --- a/src/cloudflare/resources/magic_network_monitoring/configs/fulls.py +++ b/src/cloudflare/resources/magic_network_monitoring/configs/full.py @@ -19,21 +19,21 @@ from ...._base_client import ( make_request_options, ) -from ....types.magic_network_monitoring.configs import FullListResponse +from ....types.magic_network_monitoring.configs import FullGetResponse -__all__ = ["Fulls", "AsyncFulls"] +__all__ = ["Full", "AsyncFull"] -class Fulls(SyncAPIResource): +class Full(SyncAPIResource): @cached_property - def with_raw_response(self) -> FullsWithRawResponse: - return FullsWithRawResponse(self) + def with_raw_response(self) -> FullWithRawResponse: + return FullWithRawResponse(self) @cached_property - def with_streaming_response(self) -> FullsWithStreamingResponse: - return FullsWithStreamingResponse(self) + def with_streaming_response(self) -> FullWithStreamingResponse: + return FullWithStreamingResponse(self) - def list( + def get( self, account_identifier: object, *, @@ -43,7 +43,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FullListResponse: + ) -> FullGetResponse: """ Lists default sampling, router IPs, and rules for account. @@ -65,20 +65,20 @@ def list( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[FullListResponse], ResultWrapper[FullListResponse]), + cast_to=cast(Type[FullGetResponse], ResultWrapper[FullGetResponse]), ) -class AsyncFulls(AsyncAPIResource): +class AsyncFull(AsyncAPIResource): @cached_property - def with_raw_response(self) -> AsyncFullsWithRawResponse: - return AsyncFullsWithRawResponse(self) + def with_raw_response(self) -> AsyncFullWithRawResponse: + return AsyncFullWithRawResponse(self) @cached_property - def with_streaming_response(self) -> AsyncFullsWithStreamingResponse: - return AsyncFullsWithStreamingResponse(self) + def with_streaming_response(self) -> AsyncFullWithStreamingResponse: + return AsyncFullWithStreamingResponse(self) - async def list( + async def get( self, account_identifier: object, *, @@ -88,7 +88,7 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FullListResponse: + ) -> FullGetResponse: """ Lists default sampling, router IPs, and rules for account. @@ -110,41 +110,41 @@ async def list( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[FullListResponse], ResultWrapper[FullListResponse]), + cast_to=cast(Type[FullGetResponse], ResultWrapper[FullGetResponse]), ) -class FullsWithRawResponse: - def __init__(self, fulls: Fulls) -> None: - self._fulls = fulls +class FullWithRawResponse: + def __init__(self, full: Full) -> None: + self._full = full - self.list = to_raw_response_wrapper( - fulls.list, + self.get = to_raw_response_wrapper( + full.get, ) -class AsyncFullsWithRawResponse: - def __init__(self, fulls: AsyncFulls) -> None: - self._fulls = fulls +class AsyncFullWithRawResponse: + def __init__(self, full: AsyncFull) -> None: + self._full = full - self.list = async_to_raw_response_wrapper( - fulls.list, + self.get = async_to_raw_response_wrapper( + full.get, ) -class FullsWithStreamingResponse: - def __init__(self, fulls: Fulls) -> None: - self._fulls = fulls +class FullWithStreamingResponse: + def __init__(self, full: Full) -> None: + self._full = full - self.list = to_streamed_response_wrapper( - fulls.list, + self.get = to_streamed_response_wrapper( + full.get, ) -class AsyncFullsWithStreamingResponse: - def __init__(self, fulls: AsyncFulls) -> None: - self._fulls = fulls +class AsyncFullWithStreamingResponse: + def __init__(self, full: AsyncFull) -> None: + self._full = full - self.list = async_to_streamed_response_wrapper( - fulls.list, + self.get = async_to_streamed_response_wrapper( + full.get, ) diff --git a/src/cloudflare/resources/magic_transit/ipsec_tunnels/ipsec_tunnels.py b/src/cloudflare/resources/magic_transit/ipsec_tunnels.py similarity index 85% rename from src/cloudflare/resources/magic_transit/ipsec_tunnels/ipsec_tunnels.py rename to src/cloudflare/resources/magic_transit/ipsec_tunnels.py index d081001e2ec..f6ccc808dcd 100644 --- a/src/cloudflare/resources/magic_transit/ipsec_tunnels/ipsec_tunnels.py +++ b/src/cloudflare/resources/magic_transit/ipsec_tunnels.py @@ -6,37 +6,30 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ...._utils import ( +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( maybe_transform, async_maybe_transform, ) -from ...._compat import cached_property -from ...._resource import SyncAPIResource, AsyncAPIResource -from ...._response import ( +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 .psk_generates import ( - PSKGenerates, - AsyncPSKGenerates, - PSKGeneratesWithRawResponse, - AsyncPSKGeneratesWithRawResponse, - PSKGeneratesWithStreamingResponse, - AsyncPSKGeneratesWithStreamingResponse, -) -from ...._base_client import ( +from ..._wrappers import ResultWrapper +from ..._base_client import ( make_request_options, ) -from ....types.magic_transit import ( +from ...types.magic_transit import ( IPSECTunnelGetResponse, IPSECTunnelListResponse, IPSECTunnelCreateResponse, IPSECTunnelDeleteResponse, IPSECTunnelUpdateResponse, + IPSECTunnelPSKGenerateResponse, ipsec_tunnel_create_params, ipsec_tunnel_update_params, ) @@ -45,10 +38,6 @@ class IPSECTunnels(SyncAPIResource): - @cached_property - def psk_generates(self) -> PSKGenerates: - return PSKGenerates(self._client) - @cached_property def with_raw_response(self) -> IPSECTunnelsWithRawResponse: return IPSECTunnelsWithRawResponse(self) @@ -351,12 +340,56 @@ def get( cast_to=cast(Type[IPSECTunnelGetResponse], ResultWrapper[IPSECTunnelGetResponse]), ) + def psk_generate( + self, + tunnel_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, + ) -> IPSECTunnelPSKGenerateResponse: + """ + Generates a Pre Shared Key for a specific IPsec tunnel used in the IKE session. + Use `?validate_only=true` as an optional query parameter to only run validation + without persisting changes. After a PSK is generated, the PSK is immediately + persisted to Cloudflare's edge and cannot be retrieved later. Note the PSK in a + safe place. -class AsyncIPSECTunnels(AsyncAPIResource): - @cached_property - def psk_generates(self) -> AsyncPSKGenerates: - return AsyncPSKGenerates(self._client) + Args: + account_identifier: Identifier + + tunnel_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 tunnel_identifier: + raise ValueError(f"Expected a non-empty value for `tunnel_identifier` but received {tunnel_identifier!r}") + return self._post( + f"/accounts/{account_identifier}/magic/ipsec_tunnels/{tunnel_identifier}/psk_generate", + 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[IPSECTunnelPSKGenerateResponse], ResultWrapper[IPSECTunnelPSKGenerateResponse]), + ) + + +class AsyncIPSECTunnels(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncIPSECTunnelsWithRawResponse: return AsyncIPSECTunnelsWithRawResponse(self) @@ -659,6 +692,54 @@ async def get( cast_to=cast(Type[IPSECTunnelGetResponse], ResultWrapper[IPSECTunnelGetResponse]), ) + async def psk_generate( + self, + tunnel_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, + ) -> IPSECTunnelPSKGenerateResponse: + """ + Generates a Pre Shared Key for a specific IPsec tunnel used in the IKE session. + Use `?validate_only=true` as an optional query parameter to only run validation + without persisting changes. After a PSK is generated, the PSK is immediately + persisted to Cloudflare's edge and cannot be retrieved later. Note the PSK in a + safe place. + + Args: + account_identifier: Identifier + + tunnel_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 tunnel_identifier: + raise ValueError(f"Expected a non-empty value for `tunnel_identifier` but received {tunnel_identifier!r}") + return await self._post( + f"/accounts/{account_identifier}/magic/ipsec_tunnels/{tunnel_identifier}/psk_generate", + 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[IPSECTunnelPSKGenerateResponse], ResultWrapper[IPSECTunnelPSKGenerateResponse]), + ) + class IPSECTunnelsWithRawResponse: def __init__(self, ipsec_tunnels: IPSECTunnels) -> None: @@ -679,10 +760,9 @@ def __init__(self, ipsec_tunnels: IPSECTunnels) -> None: self.get = to_raw_response_wrapper( ipsec_tunnels.get, ) - - @cached_property - def psk_generates(self) -> PSKGeneratesWithRawResponse: - return PSKGeneratesWithRawResponse(self._ipsec_tunnels.psk_generates) + self.psk_generate = to_raw_response_wrapper( + ipsec_tunnels.psk_generate, + ) class AsyncIPSECTunnelsWithRawResponse: @@ -704,10 +784,9 @@ def __init__(self, ipsec_tunnels: AsyncIPSECTunnels) -> None: self.get = async_to_raw_response_wrapper( ipsec_tunnels.get, ) - - @cached_property - def psk_generates(self) -> AsyncPSKGeneratesWithRawResponse: - return AsyncPSKGeneratesWithRawResponse(self._ipsec_tunnels.psk_generates) + self.psk_generate = async_to_raw_response_wrapper( + ipsec_tunnels.psk_generate, + ) class IPSECTunnelsWithStreamingResponse: @@ -729,10 +808,9 @@ def __init__(self, ipsec_tunnels: IPSECTunnels) -> None: self.get = to_streamed_response_wrapper( ipsec_tunnels.get, ) - - @cached_property - def psk_generates(self) -> PSKGeneratesWithStreamingResponse: - return PSKGeneratesWithStreamingResponse(self._ipsec_tunnels.psk_generates) + self.psk_generate = to_streamed_response_wrapper( + ipsec_tunnels.psk_generate, + ) class AsyncIPSECTunnelsWithStreamingResponse: @@ -754,7 +832,6 @@ def __init__(self, ipsec_tunnels: AsyncIPSECTunnels) -> None: self.get = async_to_streamed_response_wrapper( ipsec_tunnels.get, ) - - @cached_property - def psk_generates(self) -> AsyncPSKGeneratesWithStreamingResponse: - return AsyncPSKGeneratesWithStreamingResponse(self._ipsec_tunnels.psk_generates) + self.psk_generate = async_to_streamed_response_wrapper( + ipsec_tunnels.psk_generate, + ) diff --git a/src/cloudflare/resources/magic_transit/ipsec_tunnels/__init__.py b/src/cloudflare/resources/magic_transit/ipsec_tunnels/__init__.py deleted file mode 100644 index 39f1ef594e2..00000000000 --- a/src/cloudflare/resources/magic_transit/ipsec_tunnels/__init__.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from .ipsec_tunnels import ( - IPSECTunnels, - AsyncIPSECTunnels, - IPSECTunnelsWithRawResponse, - AsyncIPSECTunnelsWithRawResponse, - IPSECTunnelsWithStreamingResponse, - AsyncIPSECTunnelsWithStreamingResponse, -) -from .psk_generates import ( - PSKGenerates, - AsyncPSKGenerates, - PSKGeneratesWithRawResponse, - AsyncPSKGeneratesWithRawResponse, - PSKGeneratesWithStreamingResponse, - AsyncPSKGeneratesWithStreamingResponse, -) - -__all__ = [ - "PSKGenerates", - "AsyncPSKGenerates", - "PSKGeneratesWithRawResponse", - "AsyncPSKGeneratesWithRawResponse", - "PSKGeneratesWithStreamingResponse", - "AsyncPSKGeneratesWithStreamingResponse", - "IPSECTunnels", - "AsyncIPSECTunnels", - "IPSECTunnelsWithRawResponse", - "AsyncIPSECTunnelsWithRawResponse", - "IPSECTunnelsWithStreamingResponse", - "AsyncIPSECTunnelsWithStreamingResponse", -] diff --git a/src/cloudflare/resources/magic_transit/ipsec_tunnels/psk_generates.py b/src/cloudflare/resources/magic_transit/ipsec_tunnels/psk_generates.py deleted file mode 100644 index 0fb1ab8b8c2..00000000000 --- a/src/cloudflare/resources/magic_transit/ipsec_tunnels/psk_generates.py +++ /dev/null @@ -1,176 +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.magic_transit.ipsec_tunnels import PSKGenerateCreateResponse - -__all__ = ["PSKGenerates", "AsyncPSKGenerates"] - - -class PSKGenerates(SyncAPIResource): - @cached_property - def with_raw_response(self) -> PSKGeneratesWithRawResponse: - return PSKGeneratesWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> PSKGeneratesWithStreamingResponse: - return PSKGeneratesWithStreamingResponse(self) - - def create( - self, - tunnel_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, - ) -> PSKGenerateCreateResponse: - """ - Generates a Pre Shared Key for a specific IPsec tunnel used in the IKE session. - Use `?validate_only=true` as an optional query parameter to only run validation - without persisting changes. After a PSK is generated, the PSK is immediately - persisted to Cloudflare's edge and cannot be retrieved later. Note the PSK in a - safe place. - - Args: - account_identifier: Identifier - - tunnel_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 tunnel_identifier: - raise ValueError(f"Expected a non-empty value for `tunnel_identifier` but received {tunnel_identifier!r}") - return self._post( - f"/accounts/{account_identifier}/magic/ipsec_tunnels/{tunnel_identifier}/psk_generate", - 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[PSKGenerateCreateResponse], ResultWrapper[PSKGenerateCreateResponse]), - ) - - -class AsyncPSKGenerates(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncPSKGeneratesWithRawResponse: - return AsyncPSKGeneratesWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncPSKGeneratesWithStreamingResponse: - return AsyncPSKGeneratesWithStreamingResponse(self) - - async def create( - self, - tunnel_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, - ) -> PSKGenerateCreateResponse: - """ - Generates a Pre Shared Key for a specific IPsec tunnel used in the IKE session. - Use `?validate_only=true` as an optional query parameter to only run validation - without persisting changes. After a PSK is generated, the PSK is immediately - persisted to Cloudflare's edge and cannot be retrieved later. Note the PSK in a - safe place. - - Args: - account_identifier: Identifier - - tunnel_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 tunnel_identifier: - raise ValueError(f"Expected a non-empty value for `tunnel_identifier` but received {tunnel_identifier!r}") - return await self._post( - f"/accounts/{account_identifier}/magic/ipsec_tunnels/{tunnel_identifier}/psk_generate", - 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[PSKGenerateCreateResponse], ResultWrapper[PSKGenerateCreateResponse]), - ) - - -class PSKGeneratesWithRawResponse: - def __init__(self, psk_generates: PSKGenerates) -> None: - self._psk_generates = psk_generates - - self.create = to_raw_response_wrapper( - psk_generates.create, - ) - - -class AsyncPSKGeneratesWithRawResponse: - def __init__(self, psk_generates: AsyncPSKGenerates) -> None: - self._psk_generates = psk_generates - - self.create = async_to_raw_response_wrapper( - psk_generates.create, - ) - - -class PSKGeneratesWithStreamingResponse: - def __init__(self, psk_generates: PSKGenerates) -> None: - self._psk_generates = psk_generates - - self.create = to_streamed_response_wrapper( - psk_generates.create, - ) - - -class AsyncPSKGeneratesWithStreamingResponse: - def __init__(self, psk_generates: AsyncPSKGenerates) -> None: - self._psk_generates = psk_generates - - self.create = async_to_streamed_response_wrapper( - psk_generates.create, - ) diff --git a/src/cloudflare/resources/magic_transit/magic_transit.py b/src/cloudflare/resources/magic_transit/magic_transit.py index 285efe9f2b8..2ff1325c25b 100644 --- a/src/cloudflare/resources/magic_transit/magic_transit.py +++ b/src/cloudflare/resources/magic_transit/magic_transit.py @@ -36,7 +36,6 @@ CfInterconnectsWithStreamingResponse, AsyncCfInterconnectsWithStreamingResponse, ) -from .ipsec_tunnels.ipsec_tunnels import IPSECTunnels, AsyncIPSECTunnels __all__ = ["MagicTransit", "AsyncMagicTransit"] diff --git a/src/cloudflare/resources/mtls_certificates/associations.py b/src/cloudflare/resources/mtls_certificates/associations.py index f2897f1faa6..a9d6554dcbb 100644 --- a/src/cloudflare/resources/mtls_certificates/associations.py +++ b/src/cloudflare/resources/mtls_certificates/associations.py @@ -19,7 +19,7 @@ from ..._base_client import ( make_request_options, ) -from ...types.mtls_certificates import AssociationListResponse +from ...types.mtls_certificates import AssociationGetResponse __all__ = ["Associations", "AsyncAssociations"] @@ -33,7 +33,7 @@ def with_raw_response(self) -> AssociationsWithRawResponse: def with_streaming_response(self) -> AssociationsWithStreamingResponse: return AssociationsWithStreamingResponse(self) - def list( + def get( self, mtls_certificate_id: str, *, @@ -44,7 +44,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[AssociationListResponse]: + ) -> Optional[AssociationGetResponse]: """ Lists all active associations between the certificate and Cloudflare services. @@ -76,7 +76,7 @@ def list( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[AssociationListResponse]], ResultWrapper[AssociationListResponse]), + cast_to=cast(Type[Optional[AssociationGetResponse]], ResultWrapper[AssociationGetResponse]), ) @@ -89,7 +89,7 @@ def with_raw_response(self) -> AsyncAssociationsWithRawResponse: def with_streaming_response(self) -> AsyncAssociationsWithStreamingResponse: return AsyncAssociationsWithStreamingResponse(self) - async def list( + async def get( self, mtls_certificate_id: str, *, @@ -100,7 +100,7 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[AssociationListResponse]: + ) -> Optional[AssociationGetResponse]: """ Lists all active associations between the certificate and Cloudflare services. @@ -132,7 +132,7 @@ async def list( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[AssociationListResponse]], ResultWrapper[AssociationListResponse]), + cast_to=cast(Type[Optional[AssociationGetResponse]], ResultWrapper[AssociationGetResponse]), ) @@ -140,8 +140,8 @@ class AssociationsWithRawResponse: def __init__(self, associations: Associations) -> None: self._associations = associations - self.list = to_raw_response_wrapper( - associations.list, + self.get = to_raw_response_wrapper( + associations.get, ) @@ -149,8 +149,8 @@ class AsyncAssociationsWithRawResponse: def __init__(self, associations: AsyncAssociations) -> None: self._associations = associations - self.list = async_to_raw_response_wrapper( - associations.list, + self.get = async_to_raw_response_wrapper( + associations.get, ) @@ -158,8 +158,8 @@ class AssociationsWithStreamingResponse: def __init__(self, associations: Associations) -> None: self._associations = associations - self.list = to_streamed_response_wrapper( - associations.list, + self.get = to_streamed_response_wrapper( + associations.get, ) @@ -167,6 +167,6 @@ class AsyncAssociationsWithStreamingResponse: def __init__(self, associations: AsyncAssociations) -> None: self._associations = associations - self.list = async_to_streamed_response_wrapper( - associations.list, + self.get = async_to_streamed_response_wrapper( + associations.get, ) diff --git a/src/cloudflare/resources/pages/projects/deployments/history/logs.py b/src/cloudflare/resources/pages/projects/deployments/history/logs.py index 5700b0a23e7..d8c72e001cf 100644 --- a/src/cloudflare/resources/pages/projects/deployments/history/logs.py +++ b/src/cloudflare/resources/pages/projects/deployments/history/logs.py @@ -19,7 +19,7 @@ from ......_base_client import ( make_request_options, ) -from ......types.pages.projects.deployments.history import LogListResponse +from ......types.pages.projects.deployments.history import LogGetResponse __all__ = ["Logs", "AsyncLogs"] @@ -33,7 +33,7 @@ def with_raw_response(self) -> LogsWithRawResponse: def with_streaming_response(self) -> LogsWithStreamingResponse: return LogsWithStreamingResponse(self) - def list( + def get( self, deployment_id: str, *, @@ -45,7 +45,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LogListResponse: + ) -> LogGetResponse: """ Fetch deployment logs for a project. @@ -71,7 +71,7 @@ def list( if not deployment_id: raise ValueError(f"Expected a non-empty value for `deployment_id` but received {deployment_id!r}") return cast( - LogListResponse, + LogGetResponse, self._get( f"/accounts/{account_id}/pages/projects/{project_name}/deployments/{deployment_id}/history/logs", options=make_request_options( @@ -82,7 +82,7 @@ def list( post_parser=ResultWrapper._unwrapper, ), cast_to=cast( - Any, ResultWrapper[LogListResponse] + Any, ResultWrapper[LogGetResponse] ), # Union types cannot be passed in as arguments in the type system ), ) @@ -97,7 +97,7 @@ def with_raw_response(self) -> AsyncLogsWithRawResponse: def with_streaming_response(self) -> AsyncLogsWithStreamingResponse: return AsyncLogsWithStreamingResponse(self) - async def list( + async def get( self, deployment_id: str, *, @@ -109,7 +109,7 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LogListResponse: + ) -> LogGetResponse: """ Fetch deployment logs for a project. @@ -135,7 +135,7 @@ async def list( if not deployment_id: raise ValueError(f"Expected a non-empty value for `deployment_id` but received {deployment_id!r}") return cast( - LogListResponse, + LogGetResponse, await self._get( f"/accounts/{account_id}/pages/projects/{project_name}/deployments/{deployment_id}/history/logs", options=make_request_options( @@ -146,7 +146,7 @@ async def list( post_parser=ResultWrapper._unwrapper, ), cast_to=cast( - Any, ResultWrapper[LogListResponse] + Any, ResultWrapper[LogGetResponse] ), # Union types cannot be passed in as arguments in the type system ), ) @@ -156,8 +156,8 @@ class LogsWithRawResponse: def __init__(self, logs: Logs) -> None: self._logs = logs - self.list = to_raw_response_wrapper( - logs.list, + self.get = to_raw_response_wrapper( + logs.get, ) @@ -165,8 +165,8 @@ class AsyncLogsWithRawResponse: def __init__(self, logs: AsyncLogs) -> None: self._logs = logs - self.list = async_to_raw_response_wrapper( - logs.list, + self.get = async_to_raw_response_wrapper( + logs.get, ) @@ -174,8 +174,8 @@ class LogsWithStreamingResponse: def __init__(self, logs: Logs) -> None: self._logs = logs - self.list = to_streamed_response_wrapper( - logs.list, + self.get = to_streamed_response_wrapper( + logs.get, ) @@ -183,6 +183,6 @@ class AsyncLogsWithStreamingResponse: def __init__(self, logs: AsyncLogs) -> None: self._logs = logs - self.list = async_to_streamed_response_wrapper( - logs.list, + self.get = async_to_streamed_response_wrapper( + logs.get, ) diff --git a/src/cloudflare/resources/queues/consumers.py b/src/cloudflare/resources/queues/consumers.py index 398603b02f9..4fae6a4d4f0 100644 --- a/src/cloudflare/resources/queues/consumers.py +++ b/src/cloudflare/resources/queues/consumers.py @@ -24,7 +24,7 @@ make_request_options, ) from ...types.queues import ( - ConsumerListResponse, + ConsumerGetResponse, ConsumerCreateResponse, ConsumerDeleteResponse, ConsumerUpdateResponse, @@ -135,20 +135,21 @@ def update( cast_to=cast(Type[Optional[ConsumerUpdateResponse]], ResultWrapper[ConsumerUpdateResponse]), ) - def list( + def delete( self, - name: str, + consumer_name: str, *, account_id: str, + name: 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[ConsumerListResponse]: + ) -> Optional[ConsumerDeleteResponse]: """ - Returns the consumers for a queue. + Deletes the consumer for a queue. Args: account_id: Identifier @@ -165,33 +166,39 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not name: raise ValueError(f"Expected a non-empty value for `name` but received {name!r}") - return self._get( - f"/accounts/{account_id}/workers/queues/{name}/consumers", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, + if not consumer_name: + raise ValueError(f"Expected a non-empty value for `consumer_name` but received {consumer_name!r}") + return cast( + Optional[ConsumerDeleteResponse], + self._delete( + f"/accounts/{account_id}/workers/queues/{name}/consumers/{consumer_name}", + 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[ConsumerDeleteResponse] + ), # Union types cannot be passed in as arguments in the type system ), - cast_to=cast(Type[Optional[ConsumerListResponse]], ResultWrapper[ConsumerListResponse]), ) - def delete( + def get( self, - consumer_name: str, + name: str, *, account_id: str, - name: 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[ConsumerDeleteResponse]: + ) -> Optional[ConsumerGetResponse]: """ - Deletes the consumer for a queue. + Returns the consumers for a queue. Args: account_id: Identifier @@ -208,23 +215,16 @@ def delete( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not name: raise ValueError(f"Expected a non-empty value for `name` but received {name!r}") - if not consumer_name: - raise ValueError(f"Expected a non-empty value for `consumer_name` but received {consumer_name!r}") - return cast( - Optional[ConsumerDeleteResponse], - self._delete( - f"/accounts/{account_id}/workers/queues/{name}/consumers/{consumer_name}", - 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[ConsumerDeleteResponse] - ), # Union types cannot be passed in as arguments in the type system + return self._get( + f"/accounts/{account_id}/workers/queues/{name}/consumers", + 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[ConsumerGetResponse]], ResultWrapper[ConsumerGetResponse]), ) @@ -328,20 +328,21 @@ async def update( cast_to=cast(Type[Optional[ConsumerUpdateResponse]], ResultWrapper[ConsumerUpdateResponse]), ) - async def list( + async def delete( self, - name: str, + consumer_name: str, *, account_id: str, + name: 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[ConsumerListResponse]: + ) -> Optional[ConsumerDeleteResponse]: """ - Returns the consumers for a queue. + Deletes the consumer for a queue. Args: account_id: Identifier @@ -358,33 +359,39 @@ async def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not name: raise ValueError(f"Expected a non-empty value for `name` but received {name!r}") - return await self._get( - f"/accounts/{account_id}/workers/queues/{name}/consumers", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, + if not consumer_name: + raise ValueError(f"Expected a non-empty value for `consumer_name` but received {consumer_name!r}") + return cast( + Optional[ConsumerDeleteResponse], + await self._delete( + f"/accounts/{account_id}/workers/queues/{name}/consumers/{consumer_name}", + 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[ConsumerDeleteResponse] + ), # Union types cannot be passed in as arguments in the type system ), - cast_to=cast(Type[Optional[ConsumerListResponse]], ResultWrapper[ConsumerListResponse]), ) - async def delete( + async def get( self, - consumer_name: str, + name: str, *, account_id: str, - name: 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[ConsumerDeleteResponse]: + ) -> Optional[ConsumerGetResponse]: """ - Deletes the consumer for a queue. + Returns the consumers for a queue. Args: account_id: Identifier @@ -401,23 +408,16 @@ async def delete( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not name: raise ValueError(f"Expected a non-empty value for `name` but received {name!r}") - if not consumer_name: - raise ValueError(f"Expected a non-empty value for `consumer_name` but received {consumer_name!r}") - return cast( - Optional[ConsumerDeleteResponse], - await self._delete( - f"/accounts/{account_id}/workers/queues/{name}/consumers/{consumer_name}", - 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[ConsumerDeleteResponse] - ), # Union types cannot be passed in as arguments in the type system + return await self._get( + f"/accounts/{account_id}/workers/queues/{name}/consumers", + 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[ConsumerGetResponse]], ResultWrapper[ConsumerGetResponse]), ) @@ -431,12 +431,12 @@ def __init__(self, consumers: Consumers) -> None: self.update = to_raw_response_wrapper( consumers.update, ) - self.list = to_raw_response_wrapper( - consumers.list, - ) self.delete = to_raw_response_wrapper( consumers.delete, ) + self.get = to_raw_response_wrapper( + consumers.get, + ) class AsyncConsumersWithRawResponse: @@ -449,12 +449,12 @@ def __init__(self, consumers: AsyncConsumers) -> None: self.update = async_to_raw_response_wrapper( consumers.update, ) - self.list = async_to_raw_response_wrapper( - consumers.list, - ) self.delete = async_to_raw_response_wrapper( consumers.delete, ) + self.get = async_to_raw_response_wrapper( + consumers.get, + ) class ConsumersWithStreamingResponse: @@ -467,12 +467,12 @@ def __init__(self, consumers: Consumers) -> None: self.update = to_streamed_response_wrapper( consumers.update, ) - self.list = to_streamed_response_wrapper( - consumers.list, - ) self.delete = to_streamed_response_wrapper( consumers.delete, ) + self.get = to_streamed_response_wrapper( + consumers.get, + ) class AsyncConsumersWithStreamingResponse: @@ -485,9 +485,9 @@ def __init__(self, consumers: AsyncConsumers) -> None: self.update = async_to_streamed_response_wrapper( consumers.update, ) - self.list = async_to_streamed_response_wrapper( - consumers.list, - ) self.delete = async_to_streamed_response_wrapper( consumers.delete, ) + self.get = async_to_streamed_response_wrapper( + consumers.get, + ) diff --git a/src/cloudflare/resources/ssl/certificate_packs/quota.py b/src/cloudflare/resources/ssl/certificate_packs/quota.py index f69ee8f4321..a3d9c935106 100644 --- a/src/cloudflare/resources/ssl/certificate_packs/quota.py +++ b/src/cloudflare/resources/ssl/certificate_packs/quota.py @@ -19,7 +19,7 @@ from ...._base_client import ( make_request_options, ) -from ....types.ssl.certificate_packs import QuotaListResponse +from ....types.ssl.certificate_packs import QuotaGetResponse __all__ = ["Quota", "AsyncQuota"] @@ -33,7 +33,7 @@ def with_raw_response(self) -> QuotaWithRawResponse: def with_streaming_response(self) -> QuotaWithStreamingResponse: return QuotaWithStreamingResponse(self) - def list( + def get( self, *, zone_id: str, @@ -43,7 +43,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> QuotaListResponse: + ) -> QuotaGetResponse: """ For a given zone, list certificate pack quotas. @@ -69,7 +69,7 @@ def list( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[QuotaListResponse], ResultWrapper[QuotaListResponse]), + cast_to=cast(Type[QuotaGetResponse], ResultWrapper[QuotaGetResponse]), ) @@ -82,7 +82,7 @@ def with_raw_response(self) -> AsyncQuotaWithRawResponse: def with_streaming_response(self) -> AsyncQuotaWithStreamingResponse: return AsyncQuotaWithStreamingResponse(self) - async def list( + async def get( self, *, zone_id: str, @@ -92,7 +92,7 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> QuotaListResponse: + ) -> QuotaGetResponse: """ For a given zone, list certificate pack quotas. @@ -118,7 +118,7 @@ async def list( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[QuotaListResponse], ResultWrapper[QuotaListResponse]), + cast_to=cast(Type[QuotaGetResponse], ResultWrapper[QuotaGetResponse]), ) @@ -126,8 +126,8 @@ class QuotaWithRawResponse: def __init__(self, quota: Quota) -> None: self._quota = quota - self.list = to_raw_response_wrapper( - quota.list, + self.get = to_raw_response_wrapper( + quota.get, ) @@ -135,8 +135,8 @@ class AsyncQuotaWithRawResponse: def __init__(self, quota: AsyncQuota) -> None: self._quota = quota - self.list = async_to_raw_response_wrapper( - quota.list, + self.get = async_to_raw_response_wrapper( + quota.get, ) @@ -144,8 +144,8 @@ class QuotaWithStreamingResponse: def __init__(self, quota: Quota) -> None: self._quota = quota - self.list = to_streamed_response_wrapper( - quota.list, + self.get = to_streamed_response_wrapper( + quota.get, ) @@ -153,6 +153,6 @@ class AsyncQuotaWithStreamingResponse: def __init__(self, quota: AsyncQuota) -> None: self._quota = quota - self.list = async_to_streamed_response_wrapper( - quota.list, + self.get = async_to_streamed_response_wrapper( + quota.get, ) diff --git a/src/cloudflare/resources/ssl/recommendations.py b/src/cloudflare/resources/ssl/recommendations.py index ced1aa50e9c..b916ff68308 100644 --- a/src/cloudflare/resources/ssl/recommendations.py +++ b/src/cloudflare/resources/ssl/recommendations.py @@ -16,7 +16,7 @@ async_to_streamed_response_wrapper, ) from ..._wrappers import ResultWrapper -from ...types.ssl import RecommendationListResponse +from ...types.ssl import RecommendationGetResponse from ..._base_client import ( make_request_options, ) @@ -33,7 +33,7 @@ def with_raw_response(self) -> RecommendationsWithRawResponse: def with_streaming_response(self) -> RecommendationsWithStreamingResponse: return RecommendationsWithStreamingResponse(self) - def list( + def get( self, zone_identifier: str, *, @@ -43,7 +43,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecommendationListResponse]: + ) -> Optional[RecommendationGetResponse]: """ Retrieve the SSL/TLS Recommender's recommendation for a zone. @@ -69,7 +69,7 @@ def list( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[RecommendationListResponse]], ResultWrapper[RecommendationListResponse]), + cast_to=cast(Type[Optional[RecommendationGetResponse]], ResultWrapper[RecommendationGetResponse]), ) @@ -82,7 +82,7 @@ def with_raw_response(self) -> AsyncRecommendationsWithRawResponse: def with_streaming_response(self) -> AsyncRecommendationsWithStreamingResponse: return AsyncRecommendationsWithStreamingResponse(self) - async def list( + async def get( self, zone_identifier: str, *, @@ -92,7 +92,7 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecommendationListResponse]: + ) -> Optional[RecommendationGetResponse]: """ Retrieve the SSL/TLS Recommender's recommendation for a zone. @@ -118,7 +118,7 @@ async def list( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[RecommendationListResponse]], ResultWrapper[RecommendationListResponse]), + cast_to=cast(Type[Optional[RecommendationGetResponse]], ResultWrapper[RecommendationGetResponse]), ) @@ -126,8 +126,8 @@ class RecommendationsWithRawResponse: def __init__(self, recommendations: Recommendations) -> None: self._recommendations = recommendations - self.list = to_raw_response_wrapper( - recommendations.list, + self.get = to_raw_response_wrapper( + recommendations.get, ) @@ -135,8 +135,8 @@ class AsyncRecommendationsWithRawResponse: def __init__(self, recommendations: AsyncRecommendations) -> None: self._recommendations = recommendations - self.list = async_to_raw_response_wrapper( - recommendations.list, + self.get = async_to_raw_response_wrapper( + recommendations.get, ) @@ -144,8 +144,8 @@ class RecommendationsWithStreamingResponse: def __init__(self, recommendations: Recommendations) -> None: self._recommendations = recommendations - self.list = to_streamed_response_wrapper( - recommendations.list, + self.get = to_streamed_response_wrapper( + recommendations.get, ) @@ -153,6 +153,6 @@ class AsyncRecommendationsWithStreamingResponse: def __init__(self, recommendations: AsyncRecommendations) -> None: self._recommendations = recommendations - self.list = async_to_streamed_response_wrapper( - recommendations.list, + self.get = async_to_streamed_response_wrapper( + recommendations.get, ) diff --git a/src/cloudflare/resources/ssl/verification.py b/src/cloudflare/resources/ssl/verification.py index 3c2aa6d64e2..cd05ebe7808 100644 --- a/src/cloudflare/resources/ssl/verification.py +++ b/src/cloudflare/resources/ssl/verification.py @@ -22,10 +22,10 @@ ) from ..._wrappers import ResultWrapper from ...types.ssl import ( + VerificationGetResponse, VerificationEditResponse, - VerificationListResponse, + verification_get_params, verification_edit_params, - verification_list_params, ) from ..._base_client import ( make_request_options, @@ -43,49 +43,6 @@ def with_raw_response(self) -> VerificationWithRawResponse: def with_streaming_response(self) -> VerificationWithStreamingResponse: return VerificationWithStreamingResponse(self) - def list( - self, - *, - zone_id: str, - retry: Literal[True] | 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, - ) -> Optional[VerificationListResponse]: - """ - Get SSL Verification Info for a Zone. - - Args: - zone_id: Identifier - - retry: Immediately retry SSL Verification. - - 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 zone_id: - raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return self._get( - f"/zones/{zone_id}/ssl/verification", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform({"retry": retry}, verification_list_params.VerificationListParams), - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast(Type[Optional[VerificationListResponse]], ResultWrapper[VerificationListResponse]), - ) - def edit( self, certificate_pack_id: str, @@ -142,17 +99,7 @@ def edit( cast_to=cast(Type[VerificationEditResponse], ResultWrapper[VerificationEditResponse]), ) - -class AsyncVerification(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncVerificationWithRawResponse: - return AsyncVerificationWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncVerificationWithStreamingResponse: - return AsyncVerificationWithStreamingResponse(self) - - async def list( + def get( self, *, zone_id: str, @@ -163,7 +110,7 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[VerificationListResponse]: + ) -> Optional[VerificationGetResponse]: """ Get SSL Verification Info for a Zone. @@ -182,19 +129,29 @@ async def list( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return await self._get( + return self._get( f"/zones/{zone_id}/ssl/verification", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=await async_maybe_transform({"retry": retry}, verification_list_params.VerificationListParams), + query=maybe_transform({"retry": retry}, verification_get_params.VerificationGetParams), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[VerificationListResponse]], ResultWrapper[VerificationListResponse]), + cast_to=cast(Type[Optional[VerificationGetResponse]], ResultWrapper[VerificationGetResponse]), ) + +class AsyncVerification(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncVerificationWithRawResponse: + return AsyncVerificationWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncVerificationWithStreamingResponse: + return AsyncVerificationWithStreamingResponse(self) + async def edit( self, certificate_pack_id: str, @@ -251,50 +208,93 @@ async def edit( cast_to=cast(Type[VerificationEditResponse], ResultWrapper[VerificationEditResponse]), ) + async def get( + self, + *, + zone_id: str, + retry: Literal[True] | 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, + ) -> Optional[VerificationGetResponse]: + """ + Get SSL Verification Info for a Zone. + + Args: + zone_id: Identifier + + retry: Immediately retry SSL Verification. + + 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 zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + return await self._get( + f"/zones/{zone_id}/ssl/verification", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform({"retry": retry}, verification_get_params.VerificationGetParams), + post_parser=ResultWrapper._unwrapper, + ), + cast_to=cast(Type[Optional[VerificationGetResponse]], ResultWrapper[VerificationGetResponse]), + ) + class VerificationWithRawResponse: def __init__(self, verification: Verification) -> None: self._verification = verification - self.list = to_raw_response_wrapper( - verification.list, - ) self.edit = to_raw_response_wrapper( verification.edit, ) + self.get = to_raw_response_wrapper( + verification.get, + ) class AsyncVerificationWithRawResponse: def __init__(self, verification: AsyncVerification) -> None: self._verification = verification - self.list = async_to_raw_response_wrapper( - verification.list, - ) self.edit = async_to_raw_response_wrapper( verification.edit, ) + self.get = async_to_raw_response_wrapper( + verification.get, + ) class VerificationWithStreamingResponse: def __init__(self, verification: Verification) -> None: self._verification = verification - self.list = to_streamed_response_wrapper( - verification.list, - ) self.edit = to_streamed_response_wrapper( verification.edit, ) + self.get = to_streamed_response_wrapper( + verification.get, + ) class AsyncVerificationWithStreamingResponse: def __init__(self, verification: AsyncVerification) -> None: self._verification = verification - self.list = async_to_streamed_response_wrapper( - verification.list, - ) self.edit = async_to_streamed_response_wrapper( verification.edit, ) + self.get = async_to_streamed_response_wrapper( + verification.get, + ) diff --git a/src/cloudflare/resources/stream/audio_tracks.py b/src/cloudflare/resources/stream/audio_tracks.py index 1ca3d8885d1..d055ff63a09 100644 --- a/src/cloudflare/resources/stream/audio_tracks.py +++ b/src/cloudflare/resources/stream/audio_tracks.py @@ -24,12 +24,12 @@ make_request_options, ) from ...types.stream import ( + AudioTrackGetResponse, + AudioTrackCopyResponse, AudioTrackEditResponse, - AudioTrackListResponse, - AudioTrackCreateResponse, AudioTrackDeleteResponse, + audio_track_copy_params, audio_track_edit_params, - audio_track_create_params, ) __all__ = ["AudioTracks", "AsyncAudioTracks"] @@ -44,112 +44,6 @@ def with_raw_response(self) -> AudioTracksWithRawResponse: def with_streaming_response(self) -> AudioTracksWithStreamingResponse: return AudioTracksWithStreamingResponse(self) - def create( - self, - identifier: str, - *, - account_id: str, - label: str, - url: 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, - ) -> AudioTrackCreateResponse: - """ - Adds an additional audio track to a video using the provided audio track URL. - - Args: - account_id: The account identifier tag. - - identifier: A Cloudflare-generated unique identifier for a media item. - - label: A string to uniquely identify the track amongst other audio track labels for the - specified video. - - url: An audio track URL. The server must be publicly routable and support `HTTP HEAD` - requests and `HTTP GET` range requests. The server should respond to `HTTP HEAD` - requests with a `content-range` header that includes the size of the file. - - 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_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not identifier: - raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}") - return self._post( - f"/accounts/{account_id}/stream/{identifier}/audio/copy", - body=maybe_transform( - { - "label": label, - "url": url, - }, - audio_track_create_params.AudioTrackCreateParams, - ), - 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[AudioTrackCreateResponse], ResultWrapper[AudioTrackCreateResponse]), - ) - - def list( - self, - identifier: str, - *, - 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, - ) -> AudioTrackListResponse: - """Lists additional audio tracks on a video. - - Note this API will not return - information for audio attached to the video upload. - - Args: - account_id: The account identifier tag. - - identifier: A Cloudflare-generated unique identifier for a media item. - - 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_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not identifier: - raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}") - return self._get( - f"/accounts/{account_id}/stream/{identifier}/audio", - 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[AudioTrackListResponse], ResultWrapper[AudioTrackListResponse]), - ) - def delete( self, audio_identifier: str, @@ -206,39 +100,35 @@ def delete( ), ) - def edit( + def copy( self, - audio_identifier: str, + identifier: str, *, account_id: str, - identifier: str, - default: bool | NotGiven = NOT_GIVEN, - label: str | NotGiven = NOT_GIVEN, + label: str, + url: 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, - ) -> AudioTrackEditResponse: - """Edits additional audio tracks on a video. - - Editing the default status of an audio - track to `true` will mark all other audio tracks on the video default status to - `false`. + ) -> AudioTrackCopyResponse: + """ + Adds an additional audio track to a video using the provided audio track URL. Args: account_id: The account identifier tag. identifier: A Cloudflare-generated unique identifier for a media item. - audio_identifier: The unique identifier for an additional audio track. - - default: Denotes whether the audio track will be played by default in a player. - label: A string to uniquely identify the track amongst other audio track labels for the specified video. + url: An audio track URL. The server must be publicly routable and support `HTTP HEAD` + requests and `HTTP GET` range requests. The server should respond to `HTTP HEAD` + requests with a `content-range` header that includes the size of the file. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -251,16 +141,14 @@ def edit( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not identifier: raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}") - if not audio_identifier: - raise ValueError(f"Expected a non-empty value for `audio_identifier` but received {audio_identifier!r}") - return self._patch( - f"/accounts/{account_id}/stream/{identifier}/audio/{audio_identifier}", + return self._post( + f"/accounts/{account_id}/stream/{identifier}/audio/copy", body=maybe_transform( { - "default": default, "label": label, + "url": url, }, - audio_track_edit_params.AudioTrackEditParams, + audio_track_copy_params.AudioTrackCopyParams, ), options=make_request_options( extra_headers=extra_headers, @@ -269,48 +157,42 @@ def edit( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[AudioTrackEditResponse], ResultWrapper[AudioTrackEditResponse]), + cast_to=cast(Type[AudioTrackCopyResponse], ResultWrapper[AudioTrackCopyResponse]), ) - -class AsyncAudioTracks(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncAudioTracksWithRawResponse: - return AsyncAudioTracksWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncAudioTracksWithStreamingResponse: - return AsyncAudioTracksWithStreamingResponse(self) - - async def create( + def edit( self, - identifier: str, + audio_identifier: str, *, account_id: str, - label: str, - url: str | NotGiven = NOT_GIVEN, + identifier: str, + default: bool | NotGiven = NOT_GIVEN, + label: 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, - ) -> AudioTrackCreateResponse: - """ - Adds an additional audio track to a video using the provided audio track URL. + ) -> AudioTrackEditResponse: + """Edits additional audio tracks on a video. + + Editing the default status of an audio + track to `true` will mark all other audio tracks on the video default status to + `false`. Args: account_id: The account identifier tag. identifier: A Cloudflare-generated unique identifier for a media item. + audio_identifier: The unique identifier for an additional audio track. + + default: Denotes whether the audio track will be played by default in a player. + label: A string to uniquely identify the track amongst other audio track labels for the specified video. - url: An audio track URL. The server must be publicly routable and support `HTTP HEAD` - requests and `HTTP GET` range requests. The server should respond to `HTTP HEAD` - requests with a `content-range` header that includes the size of the file. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -323,14 +205,16 @@ async def create( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not identifier: raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}") - return await self._post( - f"/accounts/{account_id}/stream/{identifier}/audio/copy", - body=await async_maybe_transform( + if not audio_identifier: + raise ValueError(f"Expected a non-empty value for `audio_identifier` but received {audio_identifier!r}") + return self._patch( + f"/accounts/{account_id}/stream/{identifier}/audio/{audio_identifier}", + body=maybe_transform( { + "default": default, "label": label, - "url": url, }, - audio_track_create_params.AudioTrackCreateParams, + audio_track_edit_params.AudioTrackEditParams, ), options=make_request_options( extra_headers=extra_headers, @@ -339,10 +223,10 @@ async def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[AudioTrackCreateResponse], ResultWrapper[AudioTrackCreateResponse]), + cast_to=cast(Type[AudioTrackEditResponse], ResultWrapper[AudioTrackEditResponse]), ) - async def list( + def get( self, identifier: str, *, @@ -353,7 +237,7 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AudioTrackListResponse: + ) -> AudioTrackGetResponse: """Lists additional audio tracks on a video. Note this API will not return @@ -376,7 +260,7 @@ async def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not identifier: raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}") - return await self._get( + return self._get( f"/accounts/{account_id}/stream/{identifier}/audio", options=make_request_options( extra_headers=extra_headers, @@ -385,9 +269,19 @@ async def list( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[AudioTrackListResponse], ResultWrapper[AudioTrackListResponse]), + cast_to=cast(Type[AudioTrackGetResponse], ResultWrapper[AudioTrackGetResponse]), ) + +class AsyncAudioTracks(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncAudioTracksWithRawResponse: + return AsyncAudioTracksWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncAudioTracksWithStreamingResponse: + return AsyncAudioTracksWithStreamingResponse(self) + async def delete( self, audio_identifier: str, @@ -444,6 +338,66 @@ async def delete( ), ) + async def copy( + self, + identifier: str, + *, + account_id: str, + label: str, + url: 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, + ) -> AudioTrackCopyResponse: + """ + Adds an additional audio track to a video using the provided audio track URL. + + Args: + account_id: The account identifier tag. + + identifier: A Cloudflare-generated unique identifier for a media item. + + label: A string to uniquely identify the track amongst other audio track labels for the + specified video. + + url: An audio track URL. The server must be publicly routable and support `HTTP HEAD` + requests and `HTTP GET` range requests. The server should respond to `HTTP HEAD` + requests with a `content-range` header that includes the size of the file. + + 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_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not identifier: + raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}") + return await self._post( + f"/accounts/{account_id}/stream/{identifier}/audio/copy", + body=await async_maybe_transform( + { + "label": label, + "url": url, + }, + audio_track_copy_params.AudioTrackCopyParams, + ), + 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[AudioTrackCopyResponse], ResultWrapper[AudioTrackCopyResponse]), + ) + async def edit( self, audio_identifier: str, @@ -510,74 +464,120 @@ async def edit( cast_to=cast(Type[AudioTrackEditResponse], ResultWrapper[AudioTrackEditResponse]), ) + async def get( + self, + identifier: str, + *, + 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, + ) -> AudioTrackGetResponse: + """Lists additional audio tracks on a video. + + Note this API will not return + information for audio attached to the video upload. + + Args: + account_id: The account identifier tag. + + identifier: A Cloudflare-generated unique identifier for a media item. + + 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_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not identifier: + raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}") + return await self._get( + f"/accounts/{account_id}/stream/{identifier}/audio", + 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[AudioTrackGetResponse], ResultWrapper[AudioTrackGetResponse]), + ) + class AudioTracksWithRawResponse: def __init__(self, audio_tracks: AudioTracks) -> None: self._audio_tracks = audio_tracks - self.create = to_raw_response_wrapper( - audio_tracks.create, - ) - self.list = to_raw_response_wrapper( - audio_tracks.list, - ) self.delete = to_raw_response_wrapper( audio_tracks.delete, ) + self.copy = to_raw_response_wrapper( + audio_tracks.copy, + ) self.edit = to_raw_response_wrapper( audio_tracks.edit, ) + self.get = to_raw_response_wrapper( + audio_tracks.get, + ) class AsyncAudioTracksWithRawResponse: def __init__(self, audio_tracks: AsyncAudioTracks) -> None: self._audio_tracks = audio_tracks - self.create = async_to_raw_response_wrapper( - audio_tracks.create, - ) - self.list = async_to_raw_response_wrapper( - audio_tracks.list, - ) self.delete = async_to_raw_response_wrapper( audio_tracks.delete, ) + self.copy = async_to_raw_response_wrapper( + audio_tracks.copy, + ) self.edit = async_to_raw_response_wrapper( audio_tracks.edit, ) + self.get = async_to_raw_response_wrapper( + audio_tracks.get, + ) class AudioTracksWithStreamingResponse: def __init__(self, audio_tracks: AudioTracks) -> None: self._audio_tracks = audio_tracks - self.create = to_streamed_response_wrapper( - audio_tracks.create, - ) - self.list = to_streamed_response_wrapper( - audio_tracks.list, - ) self.delete = to_streamed_response_wrapper( audio_tracks.delete, ) + self.copy = to_streamed_response_wrapper( + audio_tracks.copy, + ) self.edit = to_streamed_response_wrapper( audio_tracks.edit, ) + self.get = to_streamed_response_wrapper( + audio_tracks.get, + ) class AsyncAudioTracksWithStreamingResponse: def __init__(self, audio_tracks: AsyncAudioTracks) -> None: self._audio_tracks = audio_tracks - self.create = async_to_streamed_response_wrapper( - audio_tracks.create, - ) - self.list = async_to_streamed_response_wrapper( - audio_tracks.list, - ) self.delete = async_to_streamed_response_wrapper( audio_tracks.delete, ) + self.copy = async_to_streamed_response_wrapper( + audio_tracks.copy, + ) self.edit = async_to_streamed_response_wrapper( audio_tracks.edit, ) + self.get = async_to_streamed_response_wrapper( + audio_tracks.get, + ) diff --git a/src/cloudflare/resources/stream/captions.py b/src/cloudflare/resources/stream/captions.py index c5ff4169d0e..934863e3bb7 100644 --- a/src/cloudflare/resources/stream/captions.py +++ b/src/cloudflare/resources/stream/captions.py @@ -23,7 +23,7 @@ from ..._base_client import ( make_request_options, ) -from ...types.stream import CaptionListResponse, CaptionDeleteResponse, CaptionUpdateResponse, caption_update_params +from ...types.stream import CaptionGetResponse, CaptionDeleteResponse, CaptionUpdateResponse, caption_update_params __all__ = ["Captions", "AsyncCaptions"] @@ -96,26 +96,29 @@ def update( ), ) - def list( + def delete( self, - identifier: str, + language: str, *, account_id: str, + 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, - ) -> CaptionListResponse: + ) -> CaptionDeleteResponse: """ - Lists the available captions or subtitles for a specific video. + Removes the captions or subtitles from a video. Args: account_id: Identifier identifier: A Cloudflare-generated unique identifier for a media item. + language: The language tag in BCP 47 format. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -128,41 +131,45 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not identifier: raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}") - return self._get( - f"/accounts/{account_id}/stream/{identifier}/captions", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, + if not language: + raise ValueError(f"Expected a non-empty value for `language` but received {language!r}") + return cast( + CaptionDeleteResponse, + self._delete( + f"/accounts/{account_id}/stream/{identifier}/captions/{language}", + 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[CaptionDeleteResponse] + ), # Union types cannot be passed in as arguments in the type system ), - cast_to=cast(Type[CaptionListResponse], ResultWrapper[CaptionListResponse]), ) - def delete( + def get( self, - language: str, + identifier: str, *, account_id: str, - 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, - ) -> CaptionDeleteResponse: + ) -> CaptionGetResponse: """ - Removes the captions or subtitles from a video. + Lists the available captions or subtitles for a specific video. Args: account_id: Identifier identifier: A Cloudflare-generated unique identifier for a media item. - language: The language tag in BCP 47 format. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -175,23 +182,16 @@ def delete( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not identifier: raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}") - if not language: - raise ValueError(f"Expected a non-empty value for `language` but received {language!r}") - return cast( - CaptionDeleteResponse, - self._delete( - f"/accounts/{account_id}/stream/{identifier}/captions/{language}", - 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[CaptionDeleteResponse] - ), # Union types cannot be passed in as arguments in the type system + return self._get( + f"/accounts/{account_id}/stream/{identifier}/captions", + 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[CaptionGetResponse], ResultWrapper[CaptionGetResponse]), ) @@ -263,26 +263,29 @@ async def update( ), ) - async def list( + async def delete( self, - identifier: str, + language: str, *, account_id: str, + 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, - ) -> CaptionListResponse: + ) -> CaptionDeleteResponse: """ - Lists the available captions or subtitles for a specific video. + Removes the captions or subtitles from a video. Args: account_id: Identifier identifier: A Cloudflare-generated unique identifier for a media item. + language: The language tag in BCP 47 format. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -295,41 +298,45 @@ async def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not identifier: raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}") - return await self._get( - f"/accounts/{account_id}/stream/{identifier}/captions", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, + if not language: + raise ValueError(f"Expected a non-empty value for `language` but received {language!r}") + return cast( + CaptionDeleteResponse, + await self._delete( + f"/accounts/{account_id}/stream/{identifier}/captions/{language}", + 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[CaptionDeleteResponse] + ), # Union types cannot be passed in as arguments in the type system ), - cast_to=cast(Type[CaptionListResponse], ResultWrapper[CaptionListResponse]), ) - async def delete( + async def get( self, - language: str, + identifier: str, *, account_id: str, - 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, - ) -> CaptionDeleteResponse: + ) -> CaptionGetResponse: """ - Removes the captions or subtitles from a video. + Lists the available captions or subtitles for a specific video. Args: account_id: Identifier identifier: A Cloudflare-generated unique identifier for a media item. - language: The language tag in BCP 47 format. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -342,23 +349,16 @@ async def delete( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not identifier: raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}") - if not language: - raise ValueError(f"Expected a non-empty value for `language` but received {language!r}") - return cast( - CaptionDeleteResponse, - await self._delete( - f"/accounts/{account_id}/stream/{identifier}/captions/{language}", - 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[CaptionDeleteResponse] - ), # Union types cannot be passed in as arguments in the type system + return await self._get( + f"/accounts/{account_id}/stream/{identifier}/captions", + 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[CaptionGetResponse], ResultWrapper[CaptionGetResponse]), ) @@ -369,12 +369,12 @@ def __init__(self, captions: Captions) -> None: self.update = to_raw_response_wrapper( captions.update, ) - self.list = to_raw_response_wrapper( - captions.list, - ) self.delete = to_raw_response_wrapper( captions.delete, ) + self.get = to_raw_response_wrapper( + captions.get, + ) class AsyncCaptionsWithRawResponse: @@ -384,12 +384,12 @@ def __init__(self, captions: AsyncCaptions) -> None: self.update = async_to_raw_response_wrapper( captions.update, ) - self.list = async_to_raw_response_wrapper( - captions.list, - ) self.delete = async_to_raw_response_wrapper( captions.delete, ) + self.get = async_to_raw_response_wrapper( + captions.get, + ) class CaptionsWithStreamingResponse: @@ -399,12 +399,12 @@ def __init__(self, captions: Captions) -> None: self.update = to_streamed_response_wrapper( captions.update, ) - self.list = to_streamed_response_wrapper( - captions.list, - ) self.delete = to_streamed_response_wrapper( captions.delete, ) + self.get = to_streamed_response_wrapper( + captions.get, + ) class AsyncCaptionsWithStreamingResponse: @@ -414,9 +414,9 @@ def __init__(self, captions: AsyncCaptions) -> None: self.update = async_to_streamed_response_wrapper( captions.update, ) - self.list = async_to_streamed_response_wrapper( - captions.list, - ) self.delete = async_to_streamed_response_wrapper( captions.delete, ) + self.get = async_to_streamed_response_wrapper( + captions.get, + ) diff --git a/src/cloudflare/resources/stream/downloads.py b/src/cloudflare/resources/stream/downloads.py index b45f054756d..d7d001f0684 100644 --- a/src/cloudflare/resources/stream/downloads.py +++ b/src/cloudflare/resources/stream/downloads.py @@ -19,7 +19,7 @@ from ..._base_client import ( make_request_options, ) -from ...types.stream import DownloadListResponse, DownloadCreateResponse, DownloadDeleteResponse +from ...types.stream import DownloadGetResponse, DownloadCreateResponse, DownloadDeleteResponse __all__ = ["Downloads", "AsyncDownloads"] @@ -82,7 +82,7 @@ def create( ), ) - def list( + def delete( self, identifier: str, *, @@ -93,9 +93,9 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DownloadListResponse: + ) -> DownloadDeleteResponse: """ - Lists the downloads created for a video. + Delete the downloads for a video. Args: account_id: Identifier @@ -115,8 +115,8 @@ def list( if not identifier: raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}") return cast( - DownloadListResponse, - self._get( + DownloadDeleteResponse, + self._delete( f"/accounts/{account_id}/stream/{identifier}/downloads", options=make_request_options( extra_headers=extra_headers, @@ -126,12 +126,12 @@ def list( post_parser=ResultWrapper._unwrapper, ), cast_to=cast( - Any, ResultWrapper[DownloadListResponse] + Any, ResultWrapper[DownloadDeleteResponse] ), # Union types cannot be passed in as arguments in the type system ), ) - def delete( + def get( self, identifier: str, *, @@ -142,9 +142,9 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DownloadDeleteResponse: + ) -> DownloadGetResponse: """ - Delete the downloads for a video. + Lists the downloads created for a video. Args: account_id: Identifier @@ -164,8 +164,8 @@ def delete( if not identifier: raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}") return cast( - DownloadDeleteResponse, - self._delete( + DownloadGetResponse, + self._get( f"/accounts/{account_id}/stream/{identifier}/downloads", options=make_request_options( extra_headers=extra_headers, @@ -175,7 +175,7 @@ def delete( post_parser=ResultWrapper._unwrapper, ), cast_to=cast( - Any, ResultWrapper[DownloadDeleteResponse] + Any, ResultWrapper[DownloadGetResponse] ), # Union types cannot be passed in as arguments in the type system ), ) @@ -239,7 +239,7 @@ async def create( ), ) - async def list( + async def delete( self, identifier: str, *, @@ -250,9 +250,9 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DownloadListResponse: + ) -> DownloadDeleteResponse: """ - Lists the downloads created for a video. + Delete the downloads for a video. Args: account_id: Identifier @@ -272,8 +272,8 @@ async def list( if not identifier: raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}") return cast( - DownloadListResponse, - await self._get( + DownloadDeleteResponse, + await self._delete( f"/accounts/{account_id}/stream/{identifier}/downloads", options=make_request_options( extra_headers=extra_headers, @@ -283,12 +283,12 @@ async def list( post_parser=ResultWrapper._unwrapper, ), cast_to=cast( - Any, ResultWrapper[DownloadListResponse] + Any, ResultWrapper[DownloadDeleteResponse] ), # Union types cannot be passed in as arguments in the type system ), ) - async def delete( + async def get( self, identifier: str, *, @@ -299,9 +299,9 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DownloadDeleteResponse: + ) -> DownloadGetResponse: """ - Delete the downloads for a video. + Lists the downloads created for a video. Args: account_id: Identifier @@ -321,8 +321,8 @@ async def delete( if not identifier: raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}") return cast( - DownloadDeleteResponse, - await self._delete( + DownloadGetResponse, + await self._get( f"/accounts/{account_id}/stream/{identifier}/downloads", options=make_request_options( extra_headers=extra_headers, @@ -332,7 +332,7 @@ async def delete( post_parser=ResultWrapper._unwrapper, ), cast_to=cast( - Any, ResultWrapper[DownloadDeleteResponse] + Any, ResultWrapper[DownloadGetResponse] ), # Union types cannot be passed in as arguments in the type system ), ) @@ -345,12 +345,12 @@ def __init__(self, downloads: Downloads) -> None: self.create = to_raw_response_wrapper( downloads.create, ) - self.list = to_raw_response_wrapper( - downloads.list, - ) self.delete = to_raw_response_wrapper( downloads.delete, ) + self.get = to_raw_response_wrapper( + downloads.get, + ) class AsyncDownloadsWithRawResponse: @@ -360,12 +360,12 @@ def __init__(self, downloads: AsyncDownloads) -> None: self.create = async_to_raw_response_wrapper( downloads.create, ) - self.list = async_to_raw_response_wrapper( - downloads.list, - ) self.delete = async_to_raw_response_wrapper( downloads.delete, ) + self.get = async_to_raw_response_wrapper( + downloads.get, + ) class DownloadsWithStreamingResponse: @@ -375,12 +375,12 @@ def __init__(self, downloads: Downloads) -> None: self.create = to_streamed_response_wrapper( downloads.create, ) - self.list = to_streamed_response_wrapper( - downloads.list, - ) self.delete = to_streamed_response_wrapper( downloads.delete, ) + self.get = to_streamed_response_wrapper( + downloads.get, + ) class AsyncDownloadsWithStreamingResponse: @@ -390,9 +390,9 @@ def __init__(self, downloads: AsyncDownloads) -> None: self.create = async_to_streamed_response_wrapper( downloads.create, ) - self.list = async_to_streamed_response_wrapper( - downloads.list, - ) self.delete = async_to_streamed_response_wrapper( downloads.delete, ) + self.get = async_to_streamed_response_wrapper( + downloads.get, + ) diff --git a/src/cloudflare/resources/stream/embeds.py b/src/cloudflare/resources/stream/embeds.py index 4b3578afc8f..22a11681bb1 100644 --- a/src/cloudflare/resources/stream/embeds.py +++ b/src/cloudflare/resources/stream/embeds.py @@ -29,7 +29,7 @@ def with_raw_response(self) -> EmbedsWithRawResponse: def with_streaming_response(self) -> EmbedsWithStreamingResponse: return EmbedsWithStreamingResponse(self) - def list( + def get( self, identifier: str, *, @@ -81,7 +81,7 @@ def with_raw_response(self) -> AsyncEmbedsWithRawResponse: def with_streaming_response(self) -> AsyncEmbedsWithStreamingResponse: return AsyncEmbedsWithStreamingResponse(self) - async def list( + async def get( self, identifier: str, *, @@ -128,8 +128,8 @@ class EmbedsWithRawResponse: def __init__(self, embeds: Embeds) -> None: self._embeds = embeds - self.list = to_raw_response_wrapper( - embeds.list, + self.get = to_raw_response_wrapper( + embeds.get, ) @@ -137,8 +137,8 @@ class AsyncEmbedsWithRawResponse: def __init__(self, embeds: AsyncEmbeds) -> None: self._embeds = embeds - self.list = async_to_raw_response_wrapper( - embeds.list, + self.get = async_to_raw_response_wrapper( + embeds.get, ) @@ -146,8 +146,8 @@ class EmbedsWithStreamingResponse: def __init__(self, embeds: Embeds) -> None: self._embeds = embeds - self.list = to_streamed_response_wrapper( - embeds.list, + self.get = to_streamed_response_wrapper( + embeds.get, ) @@ -155,6 +155,6 @@ class AsyncEmbedsWithStreamingResponse: def __init__(self, embeds: AsyncEmbeds) -> None: self._embeds = embeds - self.list = async_to_streamed_response_wrapper( - embeds.list, + self.get = async_to_streamed_response_wrapper( + embeds.get, ) diff --git a/src/cloudflare/resources/stream/keys.py b/src/cloudflare/resources/stream/keys.py index 00cf094cdd3..4dbd81b9814 100644 --- a/src/cloudflare/resources/stream/keys.py +++ b/src/cloudflare/resources/stream/keys.py @@ -19,7 +19,7 @@ from ..._base_client import ( make_request_options, ) -from ...types.stream import KeyListResponse, KeyCreateResponse, KeyDeleteResponse +from ...types.stream import KeyGetResponse, KeyCreateResponse, KeyDeleteResponse __all__ = ["Keys", "AsyncKeys"] @@ -75,45 +75,6 @@ def create( cast_to=cast(Type[KeyCreateResponse], ResultWrapper[KeyCreateResponse]), ) - def list( - self, - *, - 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, - ) -> KeyListResponse: - """ - Lists the video ID and creation date and time when a signing key was created. - - Args: - account_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_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return self._get( - f"/accounts/{account_id}/stream/keys", - 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[KeyListResponse], ResultWrapper[KeyListResponse]), - ) - def delete( self, identifier: str, @@ -163,17 +124,7 @@ def delete( ), ) - -class AsyncKeys(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncKeysWithRawResponse: - return AsyncKeysWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncKeysWithStreamingResponse: - return AsyncKeysWithStreamingResponse(self) - - async def create( + def get( self, *, account_id: str, @@ -183,12 +134,9 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> KeyCreateResponse: - """Creates an RSA private key in PEM and JWK formats. - - Key files are only displayed - once after creation. Keys are created, used, and deleted independently of - videos, and every key can sign any video. + ) -> KeyGetResponse: + """ + Lists the video ID and creation date and time when a signing key was created. Args: account_id: Identifier @@ -203,7 +151,7 @@ async def create( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return await self._post( + return self._get( f"/accounts/{account_id}/stream/keys", options=make_request_options( extra_headers=extra_headers, @@ -212,10 +160,20 @@ async def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[KeyCreateResponse], ResultWrapper[KeyCreateResponse]), + cast_to=cast(Type[KeyGetResponse], ResultWrapper[KeyGetResponse]), ) - async def list( + +class AsyncKeys(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncKeysWithRawResponse: + return AsyncKeysWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncKeysWithStreamingResponse: + return AsyncKeysWithStreamingResponse(self) + + async def create( self, *, account_id: str, @@ -225,9 +183,12 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> KeyListResponse: - """ - Lists the video ID and creation date and time when a signing key was created. + ) -> KeyCreateResponse: + """Creates an RSA private key in PEM and JWK formats. + + Key files are only displayed + once after creation. Keys are created, used, and deleted independently of + videos, and every key can sign any video. Args: account_id: Identifier @@ -242,7 +203,7 @@ async def list( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return await self._get( + return await self._post( f"/accounts/{account_id}/stream/keys", options=make_request_options( extra_headers=extra_headers, @@ -251,7 +212,7 @@ async def list( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[KeyListResponse], ResultWrapper[KeyListResponse]), + cast_to=cast(Type[KeyCreateResponse], ResultWrapper[KeyCreateResponse]), ) async def delete( @@ -303,6 +264,45 @@ async def delete( ), ) + async def get( + self, + *, + 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, + ) -> KeyGetResponse: + """ + Lists the video ID and creation date and time when a signing key was created. + + Args: + account_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_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + return await self._get( + f"/accounts/{account_id}/stream/keys", + 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[KeyGetResponse], ResultWrapper[KeyGetResponse]), + ) + class KeysWithRawResponse: def __init__(self, keys: Keys) -> None: @@ -311,12 +311,12 @@ def __init__(self, keys: Keys) -> None: self.create = to_raw_response_wrapper( keys.create, ) - self.list = to_raw_response_wrapper( - keys.list, - ) self.delete = to_raw_response_wrapper( keys.delete, ) + self.get = to_raw_response_wrapper( + keys.get, + ) class AsyncKeysWithRawResponse: @@ -326,12 +326,12 @@ def __init__(self, keys: AsyncKeys) -> None: self.create = async_to_raw_response_wrapper( keys.create, ) - self.list = async_to_raw_response_wrapper( - keys.list, - ) self.delete = async_to_raw_response_wrapper( keys.delete, ) + self.get = async_to_raw_response_wrapper( + keys.get, + ) class KeysWithStreamingResponse: @@ -341,12 +341,12 @@ def __init__(self, keys: Keys) -> None: self.create = to_streamed_response_wrapper( keys.create, ) - self.list = to_streamed_response_wrapper( - keys.list, - ) self.delete = to_streamed_response_wrapper( keys.delete, ) + self.get = to_streamed_response_wrapper( + keys.get, + ) class AsyncKeysWithStreamingResponse: @@ -356,9 +356,9 @@ def __init__(self, keys: AsyncKeys) -> None: self.create = async_to_streamed_response_wrapper( keys.create, ) - self.list = async_to_streamed_response_wrapper( - keys.list, - ) self.delete = async_to_streamed_response_wrapper( keys.delete, ) + self.get = async_to_streamed_response_wrapper( + keys.get, + ) diff --git a/src/cloudflare/resources/user/billing/history.py b/src/cloudflare/resources/user/billing/history.py index d0100d4f688..b1c1821e932 100644 --- a/src/cloudflare/resources/user/billing/history.py +++ b/src/cloudflare/resources/user/billing/history.py @@ -2,12 +2,16 @@ from __future__ import annotations +from typing import Type, Optional, cast from typing_extensions import Literal import httpx from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ...._utils import maybe_transform +from ...._utils import ( + maybe_transform, + async_maybe_transform, +) from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( @@ -16,12 +20,11 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ....pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray +from ...._wrappers import ResultWrapper from ...._base_client import ( - AsyncPaginator, make_request_options, ) -from ....types.user.billing import HistoryListResponse, history_list_params +from ....types.user.billing import HistoryGetResponse, history_get_params __all__ = ["History", "AsyncHistory"] @@ -35,7 +38,7 @@ def with_raw_response(self) -> HistoryWithRawResponse: def with_streaming_response(self) -> HistoryWithStreamingResponse: return HistoryWithStreamingResponse(self) - def list( + def get( self, *, order: Literal["type", "occured_at", "action"] | NotGiven = NOT_GIVEN, @@ -47,7 +50,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncV4PagePaginationArray[HistoryListResponse]: + ) -> Optional[HistoryGetResponse]: """ Accesses your billing history object. @@ -66,9 +69,8 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - return self._get_api_list( + return self._get( "/user/billing/history", - page=SyncV4PagePaginationArray[HistoryListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -80,10 +82,11 @@ def list( "page": page, "per_page": per_page, }, - history_list_params.HistoryListParams, + history_get_params.HistoryGetParams, ), + post_parser=ResultWrapper._unwrapper, ), - model=HistoryListResponse, + cast_to=cast(Type[Optional[HistoryGetResponse]], ResultWrapper[HistoryGetResponse]), ) @@ -96,7 +99,7 @@ def with_raw_response(self) -> AsyncHistoryWithRawResponse: def with_streaming_response(self) -> AsyncHistoryWithStreamingResponse: return AsyncHistoryWithStreamingResponse(self) - def list( + async def get( self, *, order: Literal["type", "occured_at", "action"] | NotGiven = NOT_GIVEN, @@ -108,7 +111,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[HistoryListResponse, AsyncV4PagePaginationArray[HistoryListResponse]]: + ) -> Optional[HistoryGetResponse]: """ Accesses your billing history object. @@ -127,24 +130,24 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - return self._get_api_list( + return await self._get( "/user/billing/history", - page=AsyncV4PagePaginationArray[HistoryListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=maybe_transform( + query=await async_maybe_transform( { "order": order, "page": page, "per_page": per_page, }, - history_list_params.HistoryListParams, + history_get_params.HistoryGetParams, ), + post_parser=ResultWrapper._unwrapper, ), - model=HistoryListResponse, + cast_to=cast(Type[Optional[HistoryGetResponse]], ResultWrapper[HistoryGetResponse]), ) @@ -152,8 +155,8 @@ class HistoryWithRawResponse: def __init__(self, history: History) -> None: self._history = history - self.list = to_raw_response_wrapper( - history.list, + self.get = to_raw_response_wrapper( + history.get, ) @@ -161,8 +164,8 @@ class AsyncHistoryWithRawResponse: def __init__(self, history: AsyncHistory) -> None: self._history = history - self.list = async_to_raw_response_wrapper( - history.list, + self.get = async_to_raw_response_wrapper( + history.get, ) @@ -170,8 +173,8 @@ class HistoryWithStreamingResponse: def __init__(self, history: History) -> None: self._history = history - self.list = to_streamed_response_wrapper( - history.list, + self.get = to_streamed_response_wrapper( + history.get, ) @@ -179,6 +182,6 @@ class AsyncHistoryWithStreamingResponse: def __init__(self, history: AsyncHistory) -> None: self._history = history - self.list = async_to_streamed_response_wrapper( - history.list, + self.get = async_to_streamed_response_wrapper( + history.get, ) diff --git a/src/cloudflare/resources/user/billing/profiles.py b/src/cloudflare/resources/user/billing/profiles.py index c68646201c8..d358b960017 100644 --- a/src/cloudflare/resources/user/billing/profiles.py +++ b/src/cloudflare/resources/user/billing/profiles.py @@ -19,7 +19,7 @@ from ...._base_client import ( make_request_options, ) -from ....types.user.billing import ProfileListResponse +from ....types.user.billing import ProfileGetResponse __all__ = ["Profiles", "AsyncProfiles"] @@ -33,7 +33,7 @@ def with_raw_response(self) -> ProfilesWithRawResponse: def with_streaming_response(self) -> ProfilesWithStreamingResponse: return ProfilesWithStreamingResponse(self) - def list( + def get( self, *, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -42,10 +42,10 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ProfileListResponse: + ) -> ProfileGetResponse: """Accesses your billing profile object.""" return cast( - ProfileListResponse, + ProfileGetResponse, self._get( "/user/billing/profile", options=make_request_options( @@ -56,7 +56,7 @@ def list( post_parser=ResultWrapper._unwrapper, ), cast_to=cast( - Any, ResultWrapper[ProfileListResponse] + Any, ResultWrapper[ProfileGetResponse] ), # Union types cannot be passed in as arguments in the type system ), ) @@ -71,7 +71,7 @@ def with_raw_response(self) -> AsyncProfilesWithRawResponse: def with_streaming_response(self) -> AsyncProfilesWithStreamingResponse: return AsyncProfilesWithStreamingResponse(self) - async def list( + async def get( self, *, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -80,10 +80,10 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ProfileListResponse: + ) -> ProfileGetResponse: """Accesses your billing profile object.""" return cast( - ProfileListResponse, + ProfileGetResponse, await self._get( "/user/billing/profile", options=make_request_options( @@ -94,7 +94,7 @@ async def list( post_parser=ResultWrapper._unwrapper, ), cast_to=cast( - Any, ResultWrapper[ProfileListResponse] + Any, ResultWrapper[ProfileGetResponse] ), # Union types cannot be passed in as arguments in the type system ), ) @@ -104,8 +104,8 @@ class ProfilesWithRawResponse: def __init__(self, profiles: Profiles) -> None: self._profiles = profiles - self.list = to_raw_response_wrapper( - profiles.list, + self.get = to_raw_response_wrapper( + profiles.get, ) @@ -113,8 +113,8 @@ class AsyncProfilesWithRawResponse: def __init__(self, profiles: AsyncProfiles) -> None: self._profiles = profiles - self.list = async_to_raw_response_wrapper( - profiles.list, + self.get = async_to_raw_response_wrapper( + profiles.get, ) @@ -122,8 +122,8 @@ class ProfilesWithStreamingResponse: def __init__(self, profiles: Profiles) -> None: self._profiles = profiles - self.list = to_streamed_response_wrapper( - profiles.list, + self.get = to_streamed_response_wrapper( + profiles.get, ) @@ -131,6 +131,6 @@ class AsyncProfilesWithStreamingResponse: def __init__(self, profiles: AsyncProfiles) -> None: self._profiles = profiles - self.list = async_to_streamed_response_wrapper( - profiles.list, + self.get = async_to_streamed_response_wrapper( + profiles.get, ) diff --git a/src/cloudflare/resources/user/subscriptions.py b/src/cloudflare/resources/user/subscriptions.py index bfd9e759aa9..ce443484ee2 100644 --- a/src/cloudflare/resources/user/subscriptions.py +++ b/src/cloudflare/resources/user/subscriptions.py @@ -22,8 +22,8 @@ ) from ..._wrappers import ResultWrapper from ...types.user import ( + SubscriptionGetResponse, SubscriptionEditResponse, - SubscriptionListResponse, SubscriptionDeleteResponse, SubscriptionUpdateResponse, subscription_edit_params, @@ -112,29 +112,6 @@ def update( ), ) - def list( - self, - *, - # 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[SubscriptionListResponse]: - """Lists all of a user's subscriptions.""" - return self._get( - "/user/subscriptions", - 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[SubscriptionListResponse]], ResultWrapper[SubscriptionListResponse]), - ) - def delete( self, identifier: str, @@ -237,6 +214,29 @@ def edit( ), ) + def get( + self, + *, + # 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[SubscriptionGetResponse]: + """Lists all of a user's subscriptions.""" + return self._get( + "/user/subscriptions", + 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[SubscriptionGetResponse]], ResultWrapper[SubscriptionGetResponse]), + ) + class AsyncSubscriptions(AsyncAPIResource): @cached_property @@ -314,29 +314,6 @@ async def update( ), ) - async def list( - self, - *, - # 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[SubscriptionListResponse]: - """Lists all of a user's subscriptions.""" - return await self._get( - "/user/subscriptions", - 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[SubscriptionListResponse]], ResultWrapper[SubscriptionListResponse]), - ) - async def delete( self, identifier: str, @@ -439,6 +416,29 @@ async def edit( ), ) + async def get( + self, + *, + # 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[SubscriptionGetResponse]: + """Lists all of a user's subscriptions.""" + return await self._get( + "/user/subscriptions", + 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[SubscriptionGetResponse]], ResultWrapper[SubscriptionGetResponse]), + ) + class SubscriptionsWithRawResponse: def __init__(self, subscriptions: Subscriptions) -> None: @@ -447,15 +447,15 @@ def __init__(self, subscriptions: Subscriptions) -> None: self.update = to_raw_response_wrapper( subscriptions.update, ) - self.list = to_raw_response_wrapper( - subscriptions.list, - ) self.delete = to_raw_response_wrapper( subscriptions.delete, ) self.edit = to_raw_response_wrapper( subscriptions.edit, ) + self.get = to_raw_response_wrapper( + subscriptions.get, + ) class AsyncSubscriptionsWithRawResponse: @@ -465,15 +465,15 @@ def __init__(self, subscriptions: AsyncSubscriptions) -> None: self.update = async_to_raw_response_wrapper( subscriptions.update, ) - self.list = async_to_raw_response_wrapper( - subscriptions.list, - ) self.delete = async_to_raw_response_wrapper( subscriptions.delete, ) self.edit = async_to_raw_response_wrapper( subscriptions.edit, ) + self.get = async_to_raw_response_wrapper( + subscriptions.get, + ) class SubscriptionsWithStreamingResponse: @@ -483,15 +483,15 @@ def __init__(self, subscriptions: Subscriptions) -> None: self.update = to_streamed_response_wrapper( subscriptions.update, ) - self.list = to_streamed_response_wrapper( - subscriptions.list, - ) self.delete = to_streamed_response_wrapper( subscriptions.delete, ) self.edit = to_streamed_response_wrapper( subscriptions.edit, ) + self.get = to_streamed_response_wrapper( + subscriptions.get, + ) class AsyncSubscriptionsWithStreamingResponse: @@ -501,12 +501,12 @@ def __init__(self, subscriptions: AsyncSubscriptions) -> None: self.update = async_to_streamed_response_wrapper( subscriptions.update, ) - self.list = async_to_streamed_response_wrapper( - subscriptions.list, - ) self.delete = async_to_streamed_response_wrapper( subscriptions.delete, ) self.edit = async_to_streamed_response_wrapper( subscriptions.edit, ) + self.get = async_to_streamed_response_wrapper( + subscriptions.get, + ) diff --git a/src/cloudflare/resources/user/user.py b/src/cloudflare/resources/user/user.py index 5634eb8bc36..486780b88dc 100644 --- a/src/cloudflare/resources/user/user.py +++ b/src/cloudflare/resources/user/user.py @@ -14,7 +14,7 @@ TokensWithStreamingResponse, AsyncTokensWithStreamingResponse, ) -from ...types import UserEditResponse, UserListResponse, user_edit_params +from ...types import UserGetResponse, UserEditResponse, user_edit_params from .billing import ( Billing, AsyncBilling, @@ -137,34 +137,6 @@ def with_raw_response(self) -> UserResourceWithRawResponse: def with_streaming_response(self) -> UserResourceWithStreamingResponse: return UserResourceWithStreamingResponse(self) - def list( - self, - *, - # 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, - ) -> UserListResponse: - """User Details""" - return cast( - UserListResponse, - self._get( - "/user", - 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[UserListResponse] - ), # Union types cannot be passed in as arguments in the type system - ), - ) - def edit( self, *, @@ -229,6 +201,34 @@ def edit( ), ) + def get( + self, + *, + # 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, + ) -> UserGetResponse: + """User Details""" + return cast( + UserGetResponse, + self._get( + "/user", + 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[UserGetResponse] + ), # Union types cannot be passed in as arguments in the type system + ), + ) + class AsyncUserResource(AsyncAPIResource): @cached_property @@ -271,34 +271,6 @@ def with_raw_response(self) -> AsyncUserResourceWithRawResponse: def with_streaming_response(self) -> AsyncUserResourceWithStreamingResponse: return AsyncUserResourceWithStreamingResponse(self) - async def list( - self, - *, - # 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, - ) -> UserListResponse: - """User Details""" - return cast( - UserListResponse, - await self._get( - "/user", - 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[UserListResponse] - ), # Union types cannot be passed in as arguments in the type system - ), - ) - async def edit( self, *, @@ -363,17 +335,45 @@ async def edit( ), ) + async def get( + self, + *, + # 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, + ) -> UserGetResponse: + """User Details""" + return cast( + UserGetResponse, + await self._get( + "/user", + 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[UserGetResponse] + ), # Union types cannot be passed in as arguments in the type system + ), + ) + class UserResourceWithRawResponse: def __init__(self, user: UserResource) -> None: self._user = user - self.list = to_raw_response_wrapper( - user.list, - ) self.edit = to_raw_response_wrapper( user.edit, ) + self.get = to_raw_response_wrapper( + user.get, + ) @cached_property def audit_logs(self) -> AuditLogsWithRawResponse: @@ -412,12 +412,12 @@ class AsyncUserResourceWithRawResponse: def __init__(self, user: AsyncUserResource) -> None: self._user = user - self.list = async_to_raw_response_wrapper( - user.list, - ) self.edit = async_to_raw_response_wrapper( user.edit, ) + self.get = async_to_raw_response_wrapper( + user.get, + ) @cached_property def audit_logs(self) -> AsyncAuditLogsWithRawResponse: @@ -456,12 +456,12 @@ class UserResourceWithStreamingResponse: def __init__(self, user: UserResource) -> None: self._user = user - self.list = to_streamed_response_wrapper( - user.list, - ) self.edit = to_streamed_response_wrapper( user.edit, ) + self.get = to_streamed_response_wrapper( + user.get, + ) @cached_property def audit_logs(self) -> AuditLogsWithStreamingResponse: @@ -500,12 +500,12 @@ class AsyncUserResourceWithStreamingResponse: def __init__(self, user: AsyncUserResource) -> None: self._user = user - self.list = async_to_streamed_response_wrapper( - user.list, - ) self.edit = async_to_streamed_response_wrapper( user.edit, ) + self.get = async_to_streamed_response_wrapper( + user.get, + ) @cached_property def audit_logs(self) -> AsyncAuditLogsWithStreamingResponse: diff --git a/src/cloudflare/resources/web3/hostnames/ipfs_universal_paths/content_lists/content_lists.py b/src/cloudflare/resources/web3/hostnames/ipfs_universal_paths/content_lists/content_lists.py index 8ebd2c08b18..afaf9bb75f0 100644 --- a/src/cloudflare/resources/web3/hostnames/ipfs_universal_paths/content_lists/content_lists.py +++ b/src/cloudflare/resources/web3/hostnames/ipfs_universal_paths/content_lists/content_lists.py @@ -33,7 +33,7 @@ make_request_options, ) from ......types.web3.hostnames.ipfs_universal_paths import ( - ContentListListResponse, + ContentListGetResponse, ContentListUpdateResponse, content_list_update_params, ) @@ -111,7 +111,7 @@ def update( cast_to=cast(Type[ContentListUpdateResponse], ResultWrapper[ContentListUpdateResponse]), ) - def list( + def get( self, identifier: str, *, @@ -122,7 +122,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ContentListListResponse: + ) -> ContentListGetResponse: """ IPFS Universal Path Gateway Content List Details @@ -152,7 +152,7 @@ def list( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ContentListListResponse], ResultWrapper[ContentListListResponse]), + cast_to=cast(Type[ContentListGetResponse], ResultWrapper[ContentListGetResponse]), ) @@ -226,7 +226,7 @@ async def update( cast_to=cast(Type[ContentListUpdateResponse], ResultWrapper[ContentListUpdateResponse]), ) - async def list( + async def get( self, identifier: str, *, @@ -237,7 +237,7 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ContentListListResponse: + ) -> ContentListGetResponse: """ IPFS Universal Path Gateway Content List Details @@ -267,7 +267,7 @@ async def list( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ContentListListResponse], ResultWrapper[ContentListListResponse]), + cast_to=cast(Type[ContentListGetResponse], ResultWrapper[ContentListGetResponse]), ) @@ -278,8 +278,8 @@ def __init__(self, content_lists: ContentLists) -> None: self.update = to_raw_response_wrapper( content_lists.update, ) - self.list = to_raw_response_wrapper( - content_lists.list, + self.get = to_raw_response_wrapper( + content_lists.get, ) @cached_property @@ -294,8 +294,8 @@ def __init__(self, content_lists: AsyncContentLists) -> None: self.update = async_to_raw_response_wrapper( content_lists.update, ) - self.list = async_to_raw_response_wrapper( - content_lists.list, + self.get = async_to_raw_response_wrapper( + content_lists.get, ) @cached_property @@ -310,8 +310,8 @@ def __init__(self, content_lists: ContentLists) -> None: self.update = to_streamed_response_wrapper( content_lists.update, ) - self.list = to_streamed_response_wrapper( - content_lists.list, + self.get = to_streamed_response_wrapper( + content_lists.get, ) @cached_property @@ -326,8 +326,8 @@ def __init__(self, content_lists: AsyncContentLists) -> None: self.update = async_to_streamed_response_wrapper( content_lists.update, ) - self.list = async_to_streamed_response_wrapper( - content_lists.list, + self.get = async_to_streamed_response_wrapper( + content_lists.get, ) @cached_property diff --git a/src/cloudflare/resources/workers/deployments/by_scripts/__init__.py b/src/cloudflare/resources/workers/deployments/by_scripts/__init__.py new file mode 100644 index 00000000000..44dfd530bee --- /dev/null +++ b/src/cloudflare/resources/workers/deployments/by_scripts/__init__.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. + +from .details import ( + Details, + AsyncDetails, + DetailsWithRawResponse, + AsyncDetailsWithRawResponse, + DetailsWithStreamingResponse, + AsyncDetailsWithStreamingResponse, +) +from .by_scripts import ( + ByScripts, + AsyncByScripts, + ByScriptsWithRawResponse, + AsyncByScriptsWithRawResponse, + ByScriptsWithStreamingResponse, + AsyncByScriptsWithStreamingResponse, +) + +__all__ = [ + "Details", + "AsyncDetails", + "DetailsWithRawResponse", + "AsyncDetailsWithRawResponse", + "DetailsWithStreamingResponse", + "AsyncDetailsWithStreamingResponse", + "ByScripts", + "AsyncByScripts", + "ByScriptsWithRawResponse", + "AsyncByScriptsWithRawResponse", + "ByScriptsWithStreamingResponse", + "AsyncByScriptsWithStreamingResponse", +] diff --git a/src/cloudflare/resources/workers/deployments/by_scripts.py b/src/cloudflare/resources/workers/deployments/by_scripts/by_scripts.py similarity index 54% rename from src/cloudflare/resources/workers/deployments/by_scripts.py rename to src/cloudflare/resources/workers/deployments/by_scripts/by_scripts.py index eff69775c4b..07369947cc9 100644 --- a/src/cloudflare/resources/workers/deployments/by_scripts.py +++ b/src/cloudflare/resources/workers/deployments/by_scripts/by_scripts.py @@ -6,25 +6,37 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ...._compat import cached_property -from ...._resource import SyncAPIResource, AsyncAPIResource -from ...._response import ( +from .details import ( + Details, + AsyncDetails, + DetailsWithRawResponse, + AsyncDetailsWithRawResponse, + DetailsWithStreamingResponse, + AsyncDetailsWithStreamingResponse, +) +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 ( +from ....._wrappers import ResultWrapper +from ....._base_client import ( make_request_options, ) -from ....types.workers.deployments import ByScriptGetResponse, ByScriptListResponse +from .....types.workers.deployments import ByScriptGetResponse __all__ = ["ByScripts", "AsyncByScripts"] class ByScripts(SyncAPIResource): + @cached_property + def details(self) -> Details: + return Details(self._client) + @cached_property def with_raw_response(self) -> ByScriptsWithRawResponse: return ByScriptsWithRawResponse(self) @@ -33,7 +45,7 @@ def with_raw_response(self) -> ByScriptsWithRawResponse: def with_streaming_response(self) -> ByScriptsWithStreamingResponse: return ByScriptsWithStreamingResponse(self) - def list( + def get( self, script_id: str, *, @@ -44,7 +56,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ByScriptListResponse: + ) -> ByScriptGetResponse: """ List Deployments @@ -72,56 +84,15 @@ def list( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ByScriptListResponse], ResultWrapper[ByScriptListResponse]), - ) - - def get( - self, - deployment_id: str, - *, - account_id: str, - script_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, - ) -> ByScriptGetResponse: - """ - Get Deployment Detail - - Args: - account_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_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not script_id: - raise ValueError(f"Expected a non-empty value for `script_id` but received {script_id!r}") - if not deployment_id: - raise ValueError(f"Expected a non-empty value for `deployment_id` but received {deployment_id!r}") - return self._get( - f"/accounts/{account_id}/workers/deployments/by-script/{script_id}/detail/{deployment_id}", - 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[ByScriptGetResponse], ResultWrapper[ByScriptGetResponse]), ) class AsyncByScripts(AsyncAPIResource): + @cached_property + def details(self) -> AsyncDetails: + return AsyncDetails(self._client) + @cached_property def with_raw_response(self) -> AsyncByScriptsWithRawResponse: return AsyncByScriptsWithRawResponse(self) @@ -130,7 +101,7 @@ def with_raw_response(self) -> AsyncByScriptsWithRawResponse: def with_streaming_response(self) -> AsyncByScriptsWithStreamingResponse: return AsyncByScriptsWithStreamingResponse(self) - async def list( + async def get( self, script_id: str, *, @@ -141,7 +112,7 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ByScriptListResponse: + ) -> ByScriptGetResponse: """ List Deployments @@ -169,51 +140,6 @@ async def list( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ByScriptListResponse], ResultWrapper[ByScriptListResponse]), - ) - - async def get( - self, - deployment_id: str, - *, - account_id: str, - script_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, - ) -> ByScriptGetResponse: - """ - Get Deployment Detail - - Args: - account_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_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not script_id: - raise ValueError(f"Expected a non-empty value for `script_id` but received {script_id!r}") - if not deployment_id: - raise ValueError(f"Expected a non-empty value for `deployment_id` but received {deployment_id!r}") - return await self._get( - f"/accounts/{account_id}/workers/deployments/by-script/{script_id}/detail/{deployment_id}", - 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[ByScriptGetResponse], ResultWrapper[ByScriptGetResponse]), ) @@ -222,45 +148,49 @@ class ByScriptsWithRawResponse: def __init__(self, by_scripts: ByScripts) -> None: self._by_scripts = by_scripts - self.list = to_raw_response_wrapper( - by_scripts.list, - ) self.get = to_raw_response_wrapper( by_scripts.get, ) + @cached_property + def details(self) -> DetailsWithRawResponse: + return DetailsWithRawResponse(self._by_scripts.details) + class AsyncByScriptsWithRawResponse: def __init__(self, by_scripts: AsyncByScripts) -> None: self._by_scripts = by_scripts - self.list = async_to_raw_response_wrapper( - by_scripts.list, - ) self.get = async_to_raw_response_wrapper( by_scripts.get, ) + @cached_property + def details(self) -> AsyncDetailsWithRawResponse: + return AsyncDetailsWithRawResponse(self._by_scripts.details) + class ByScriptsWithStreamingResponse: def __init__(self, by_scripts: ByScripts) -> None: self._by_scripts = by_scripts - self.list = to_streamed_response_wrapper( - by_scripts.list, - ) self.get = to_streamed_response_wrapper( by_scripts.get, ) + @cached_property + def details(self) -> DetailsWithStreamingResponse: + return DetailsWithStreamingResponse(self._by_scripts.details) + class AsyncByScriptsWithStreamingResponse: def __init__(self, by_scripts: AsyncByScripts) -> None: self._by_scripts = by_scripts - self.list = async_to_streamed_response_wrapper( - by_scripts.list, - ) self.get = async_to_streamed_response_wrapper( by_scripts.get, ) + + @cached_property + def details(self) -> AsyncDetailsWithStreamingResponse: + return AsyncDetailsWithStreamingResponse(self._by_scripts.details) diff --git a/src/cloudflare/resources/workers/deployments/by_scripts/details.py b/src/cloudflare/resources/workers/deployments/by_scripts/details.py new file mode 100644 index 00000000000..8826e445845 --- /dev/null +++ b/src/cloudflare/resources/workers/deployments/by_scripts/details.py @@ -0,0 +1,170 @@ +# 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.workers.deployments.by_scripts import DetailGetResponse + +__all__ = ["Details", "AsyncDetails"] + + +class Details(SyncAPIResource): + @cached_property + def with_raw_response(self) -> DetailsWithRawResponse: + return DetailsWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> DetailsWithStreamingResponse: + return DetailsWithStreamingResponse(self) + + def get( + self, + deployment_id: str, + *, + account_id: str, + script_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, + ) -> DetailGetResponse: + """ + Get Deployment Detail + + Args: + account_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_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not script_id: + raise ValueError(f"Expected a non-empty value for `script_id` but received {script_id!r}") + if not deployment_id: + raise ValueError(f"Expected a non-empty value for `deployment_id` but received {deployment_id!r}") + return self._get( + f"/accounts/{account_id}/workers/deployments/by-script/{script_id}/detail/{deployment_id}", + 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[DetailGetResponse], ResultWrapper[DetailGetResponse]), + ) + + +class AsyncDetails(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncDetailsWithRawResponse: + return AsyncDetailsWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncDetailsWithStreamingResponse: + return AsyncDetailsWithStreamingResponse(self) + + async def get( + self, + deployment_id: str, + *, + account_id: str, + script_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, + ) -> DetailGetResponse: + """ + Get Deployment Detail + + Args: + account_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_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not script_id: + raise ValueError(f"Expected a non-empty value for `script_id` but received {script_id!r}") + if not deployment_id: + raise ValueError(f"Expected a non-empty value for `deployment_id` but received {deployment_id!r}") + return await self._get( + f"/accounts/{account_id}/workers/deployments/by-script/{script_id}/detail/{deployment_id}", + 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[DetailGetResponse], ResultWrapper[DetailGetResponse]), + ) + + +class DetailsWithRawResponse: + def __init__(self, details: Details) -> None: + self._details = details + + self.get = to_raw_response_wrapper( + details.get, + ) + + +class AsyncDetailsWithRawResponse: + def __init__(self, details: AsyncDetails) -> None: + self._details = details + + self.get = async_to_raw_response_wrapper( + details.get, + ) + + +class DetailsWithStreamingResponse: + def __init__(self, details: Details) -> None: + self._details = details + + self.get = to_streamed_response_wrapper( + details.get, + ) + + +class AsyncDetailsWithStreamingResponse: + def __init__(self, details: AsyncDetails) -> None: + self._details = details + + self.get = async_to_streamed_response_wrapper( + details.get, + ) diff --git a/src/cloudflare/resources/workers/deployments/deployments.py b/src/cloudflare/resources/workers/deployments/deployments.py index b147a547f4b..286c4e05e45 100644 --- a/src/cloudflare/resources/workers/deployments/deployments.py +++ b/src/cloudflare/resources/workers/deployments/deployments.py @@ -12,6 +12,7 @@ AsyncByScriptsWithStreamingResponse, ) from ...._resource import SyncAPIResource, AsyncAPIResource +from .by_scripts.by_scripts import ByScripts, AsyncByScripts __all__ = ["Deployments", "AsyncDeployments"] diff --git a/src/cloudflare/resources/workers/scripts/bindings.py b/src/cloudflare/resources/workers/scripts/bindings.py index 31e5943b95d..d48979022f1 100644 --- a/src/cloudflare/resources/workers/scripts/bindings.py +++ b/src/cloudflare/resources/workers/scripts/bindings.py @@ -19,7 +19,7 @@ from ...._base_client import ( make_request_options, ) -from ....types.workers.scripts import BindingListResponse +from ....types.workers.scripts import BindingGetResponse __all__ = ["Bindings", "AsyncBindings"] @@ -33,7 +33,7 @@ def with_raw_response(self) -> BindingsWithRawResponse: def with_streaming_response(self) -> BindingsWithStreamingResponse: return BindingsWithStreamingResponse(self) - def list( + def get( self, *, zone_id: str, @@ -43,7 +43,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> BindingListResponse: + ) -> BindingGetResponse: """ List the bindings for a Workers script. @@ -69,7 +69,7 @@ def list( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[BindingListResponse], ResultWrapper[BindingListResponse]), + cast_to=cast(Type[BindingGetResponse], ResultWrapper[BindingGetResponse]), ) @@ -82,7 +82,7 @@ def with_raw_response(self) -> AsyncBindingsWithRawResponse: def with_streaming_response(self) -> AsyncBindingsWithStreamingResponse: return AsyncBindingsWithStreamingResponse(self) - async def list( + async def get( self, *, zone_id: str, @@ -92,7 +92,7 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> BindingListResponse: + ) -> BindingGetResponse: """ List the bindings for a Workers script. @@ -118,7 +118,7 @@ async def list( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[BindingListResponse], ResultWrapper[BindingListResponse]), + cast_to=cast(Type[BindingGetResponse], ResultWrapper[BindingGetResponse]), ) @@ -126,8 +126,8 @@ class BindingsWithRawResponse: def __init__(self, bindings: Bindings) -> None: self._bindings = bindings - self.list = to_raw_response_wrapper( - bindings.list, + self.get = to_raw_response_wrapper( + bindings.get, ) @@ -135,8 +135,8 @@ class AsyncBindingsWithRawResponse: def __init__(self, bindings: AsyncBindings) -> None: self._bindings = bindings - self.list = async_to_raw_response_wrapper( - bindings.list, + self.get = async_to_raw_response_wrapper( + bindings.get, ) @@ -144,8 +144,8 @@ class BindingsWithStreamingResponse: def __init__(self, bindings: Bindings) -> None: self._bindings = bindings - self.list = to_streamed_response_wrapper( - bindings.list, + self.get = to_streamed_response_wrapper( + bindings.get, ) @@ -153,6 +153,6 @@ class AsyncBindingsWithStreamingResponse: def __init__(self, bindings: AsyncBindings) -> None: self._bindings = bindings - self.list = async_to_streamed_response_wrapper( - bindings.list, + self.get = async_to_streamed_response_wrapper( + bindings.get, ) diff --git a/src/cloudflare/resources/workers/scripts/schedules.py b/src/cloudflare/resources/workers/scripts/schedules.py index 3e7882fcc77..4bb18988e23 100644 --- a/src/cloudflare/resources/workers/scripts/schedules.py +++ b/src/cloudflare/resources/workers/scripts/schedules.py @@ -23,7 +23,7 @@ from ...._base_client import ( make_request_options, ) -from ....types.workers.scripts import ScheduleListResponse, ScheduleUpdateResponse, schedule_update_params +from ....types.workers.scripts import ScheduleGetResponse, ScheduleUpdateResponse, schedule_update_params __all__ = ["Schedules", "AsyncSchedules"] @@ -83,7 +83,7 @@ def update( cast_to=cast(Type[ScheduleUpdateResponse], ResultWrapper[ScheduleUpdateResponse]), ) - def list( + def get( self, script_name: str, *, @@ -94,7 +94,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ScheduleListResponse: + ) -> ScheduleGetResponse: """ Fetches Cron Triggers for a Worker. @@ -124,7 +124,7 @@ def list( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ScheduleListResponse], ResultWrapper[ScheduleListResponse]), + cast_to=cast(Type[ScheduleGetResponse], ResultWrapper[ScheduleGetResponse]), ) @@ -183,7 +183,7 @@ async def update( cast_to=cast(Type[ScheduleUpdateResponse], ResultWrapper[ScheduleUpdateResponse]), ) - async def list( + async def get( self, script_name: str, *, @@ -194,7 +194,7 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ScheduleListResponse: + ) -> ScheduleGetResponse: """ Fetches Cron Triggers for a Worker. @@ -224,7 +224,7 @@ async def list( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ScheduleListResponse], ResultWrapper[ScheduleListResponse]), + cast_to=cast(Type[ScheduleGetResponse], ResultWrapper[ScheduleGetResponse]), ) @@ -235,8 +235,8 @@ def __init__(self, schedules: Schedules) -> None: self.update = to_raw_response_wrapper( schedules.update, ) - self.list = to_raw_response_wrapper( - schedules.list, + self.get = to_raw_response_wrapper( + schedules.get, ) @@ -247,8 +247,8 @@ def __init__(self, schedules: AsyncSchedules) -> None: self.update = async_to_raw_response_wrapper( schedules.update, ) - self.list = async_to_raw_response_wrapper( - schedules.list, + self.get = async_to_raw_response_wrapper( + schedules.get, ) @@ -259,8 +259,8 @@ def __init__(self, schedules: Schedules) -> None: self.update = to_streamed_response_wrapper( schedules.update, ) - self.list = to_streamed_response_wrapper( - schedules.list, + self.get = to_streamed_response_wrapper( + schedules.get, ) @@ -271,6 +271,6 @@ def __init__(self, schedules: AsyncSchedules) -> None: self.update = async_to_streamed_response_wrapper( schedules.update, ) - self.list = async_to_streamed_response_wrapper( - schedules.list, + self.get = async_to_streamed_response_wrapper( + schedules.get, ) diff --git a/src/cloudflare/resources/workers/scripts/tail.py b/src/cloudflare/resources/workers/scripts/tail.py index 7fbd1567a37..7210dfe0b4b 100644 --- a/src/cloudflare/resources/workers/scripts/tail.py +++ b/src/cloudflare/resources/workers/scripts/tail.py @@ -19,7 +19,7 @@ from ...._base_client import ( make_request_options, ) -from ....types.workers.scripts import TailListResponse, TailCreateResponse, TailDeleteResponse +from ....types.workers.scripts import TailGetResponse, TailCreateResponse, TailDeleteResponse __all__ = ["Tail", "AsyncTail"] @@ -77,50 +77,6 @@ def create( cast_to=cast(Type[TailCreateResponse], ResultWrapper[TailCreateResponse]), ) - def list( - self, - script_name: str, - *, - 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, - ) -> TailListResponse: - """ - Get list of tails currently deployed on a Worker. - - Args: - account_id: Identifier - - script_name: Name of the script, used in URLs and route configuration. - - 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_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not script_name: - raise ValueError(f"Expected a non-empty value for `script_name` but received {script_name!r}") - return self._get( - f"/accounts/{account_id}/workers/scripts/{script_name}/tails", - 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[TailListResponse], ResultWrapper[TailListResponse]), - ) - def delete( self, id: str, @@ -175,17 +131,7 @@ def delete( ), ) - -class AsyncTail(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncTailWithRawResponse: - return AsyncTailWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncTailWithStreamingResponse: - return AsyncTailWithStreamingResponse(self) - - async def create( + def get( self, script_name: str, *, @@ -196,9 +142,9 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TailCreateResponse: + ) -> TailGetResponse: """ - Starts a tail that receives logs and exception from a Worker. + Get list of tails currently deployed on a Worker. Args: account_id: Identifier @@ -217,7 +163,7 @@ async def create( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not script_name: raise ValueError(f"Expected a non-empty value for `script_name` but received {script_name!r}") - return await self._post( + return self._get( f"/accounts/{account_id}/workers/scripts/{script_name}/tails", options=make_request_options( extra_headers=extra_headers, @@ -226,10 +172,20 @@ async def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[TailCreateResponse], ResultWrapper[TailCreateResponse]), + cast_to=cast(Type[TailGetResponse], ResultWrapper[TailGetResponse]), ) - async def list( + +class AsyncTail(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncTailWithRawResponse: + return AsyncTailWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncTailWithStreamingResponse: + return AsyncTailWithStreamingResponse(self) + + async def create( self, script_name: str, *, @@ -240,9 +196,9 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TailListResponse: + ) -> TailCreateResponse: """ - Get list of tails currently deployed on a Worker. + Starts a tail that receives logs and exception from a Worker. Args: account_id: Identifier @@ -261,7 +217,7 @@ async def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not script_name: raise ValueError(f"Expected a non-empty value for `script_name` but received {script_name!r}") - return await self._get( + return await self._post( f"/accounts/{account_id}/workers/scripts/{script_name}/tails", options=make_request_options( extra_headers=extra_headers, @@ -270,7 +226,7 @@ async def list( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[TailListResponse], ResultWrapper[TailListResponse]), + cast_to=cast(Type[TailCreateResponse], ResultWrapper[TailCreateResponse]), ) async def delete( @@ -327,6 +283,50 @@ async def delete( ), ) + async def get( + self, + script_name: str, + *, + 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, + ) -> TailGetResponse: + """ + Get list of tails currently deployed on a Worker. + + Args: + account_id: Identifier + + script_name: Name of the script, used in URLs and route configuration. + + 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_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not script_name: + raise ValueError(f"Expected a non-empty value for `script_name` but received {script_name!r}") + return await self._get( + f"/accounts/{account_id}/workers/scripts/{script_name}/tails", + 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[TailGetResponse], ResultWrapper[TailGetResponse]), + ) + class TailWithRawResponse: def __init__(self, tail: Tail) -> None: @@ -335,12 +335,12 @@ def __init__(self, tail: Tail) -> None: self.create = to_raw_response_wrapper( tail.create, ) - self.list = to_raw_response_wrapper( - tail.list, - ) self.delete = to_raw_response_wrapper( tail.delete, ) + self.get = to_raw_response_wrapper( + tail.get, + ) class AsyncTailWithRawResponse: @@ -350,12 +350,12 @@ def __init__(self, tail: AsyncTail) -> None: self.create = async_to_raw_response_wrapper( tail.create, ) - self.list = async_to_raw_response_wrapper( - tail.list, - ) self.delete = async_to_raw_response_wrapper( tail.delete, ) + self.get = async_to_raw_response_wrapper( + tail.get, + ) class TailWithStreamingResponse: @@ -365,12 +365,12 @@ def __init__(self, tail: Tail) -> None: self.create = to_streamed_response_wrapper( tail.create, ) - self.list = to_streamed_response_wrapper( - tail.list, - ) self.delete = to_streamed_response_wrapper( tail.delete, ) + self.get = to_streamed_response_wrapper( + tail.get, + ) class AsyncTailWithStreamingResponse: @@ -380,9 +380,9 @@ def __init__(self, tail: AsyncTail) -> None: self.create = async_to_streamed_response_wrapper( tail.create, ) - self.list = async_to_streamed_response_wrapper( - tail.list, - ) self.delete = async_to_streamed_response_wrapper( tail.delete, ) + self.get = async_to_streamed_response_wrapper( + tail.get, + ) diff --git a/src/cloudflare/resources/zero_trust/access/users/last_seen_identity.py b/src/cloudflare/resources/zero_trust/access/users/last_seen_identity.py index 0e94459da6a..978c33c9216 100644 --- a/src/cloudflare/resources/zero_trust/access/users/last_seen_identity.py +++ b/src/cloudflare/resources/zero_trust/access/users/last_seen_identity.py @@ -19,7 +19,7 @@ from ....._base_client import ( make_request_options, ) -from .....types.zero_trust.access.users import LastSeenIdentityListResponse +from .....types.zero_trust.access.users import LastSeenIdentityGetResponse __all__ = ["LastSeenIdentity", "AsyncLastSeenIdentity"] @@ -33,7 +33,7 @@ def with_raw_response(self) -> LastSeenIdentityWithRawResponse: def with_streaming_response(self) -> LastSeenIdentityWithStreamingResponse: return LastSeenIdentityWithStreamingResponse(self) - def list( + def get( self, id: str, *, @@ -44,7 +44,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LastSeenIdentityListResponse: + ) -> LastSeenIdentityGetResponse: """ Get last seen identity for a single user. @@ -74,7 +74,7 @@ def list( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[LastSeenIdentityListResponse], ResultWrapper[LastSeenIdentityListResponse]), + cast_to=cast(Type[LastSeenIdentityGetResponse], ResultWrapper[LastSeenIdentityGetResponse]), ) @@ -87,7 +87,7 @@ def with_raw_response(self) -> AsyncLastSeenIdentityWithRawResponse: def with_streaming_response(self) -> AsyncLastSeenIdentityWithStreamingResponse: return AsyncLastSeenIdentityWithStreamingResponse(self) - async def list( + async def get( self, id: str, *, @@ -98,7 +98,7 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LastSeenIdentityListResponse: + ) -> LastSeenIdentityGetResponse: """ Get last seen identity for a single user. @@ -128,7 +128,7 @@ async def list( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[LastSeenIdentityListResponse], ResultWrapper[LastSeenIdentityListResponse]), + cast_to=cast(Type[LastSeenIdentityGetResponse], ResultWrapper[LastSeenIdentityGetResponse]), ) @@ -136,8 +136,8 @@ class LastSeenIdentityWithRawResponse: def __init__(self, last_seen_identity: LastSeenIdentity) -> None: self._last_seen_identity = last_seen_identity - self.list = to_raw_response_wrapper( - last_seen_identity.list, + self.get = to_raw_response_wrapper( + last_seen_identity.get, ) @@ -145,8 +145,8 @@ class AsyncLastSeenIdentityWithRawResponse: def __init__(self, last_seen_identity: AsyncLastSeenIdentity) -> None: self._last_seen_identity = last_seen_identity - self.list = async_to_raw_response_wrapper( - last_seen_identity.list, + self.get = async_to_raw_response_wrapper( + last_seen_identity.get, ) @@ -154,8 +154,8 @@ class LastSeenIdentityWithStreamingResponse: def __init__(self, last_seen_identity: LastSeenIdentity) -> None: self._last_seen_identity = last_seen_identity - self.list = to_streamed_response_wrapper( - last_seen_identity.list, + self.get = to_streamed_response_wrapper( + last_seen_identity.get, ) @@ -163,6 +163,6 @@ class AsyncLastSeenIdentityWithStreamingResponse: def __init__(self, last_seen_identity: AsyncLastSeenIdentity) -> None: self._last_seen_identity = last_seen_identity - self.list = async_to_streamed_response_wrapper( - last_seen_identity.list, + self.get = async_to_streamed_response_wrapper( + last_seen_identity.get, ) diff --git a/src/cloudflare/resources/zero_trust/tunnels/configurations.py b/src/cloudflare/resources/zero_trust/tunnels/configurations.py index b47db5bd37f..111190f8610 100644 --- a/src/cloudflare/resources/zero_trust/tunnels/configurations.py +++ b/src/cloudflare/resources/zero_trust/tunnels/configurations.py @@ -24,7 +24,7 @@ make_request_options, ) from ....types.zero_trust.tunnels import ( - ConfigurationListResponse, + ConfigurationGetResponse, ConfigurationUpdateResponse, configuration_update_params, ) @@ -94,7 +94,7 @@ def update( ), ) - def list( + def get( self, tunnel_id: str, *, @@ -105,7 +105,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ConfigurationListResponse: + ) -> ConfigurationGetResponse: """ Gets the configuration for a remotely-managed tunnel @@ -127,7 +127,7 @@ def list( if not tunnel_id: raise ValueError(f"Expected a non-empty value for `tunnel_id` but received {tunnel_id!r}") return cast( - ConfigurationListResponse, + ConfigurationGetResponse, self._get( f"/accounts/{account_id}/cfd_tunnel/{tunnel_id}/configurations", options=make_request_options( @@ -138,7 +138,7 @@ def list( post_parser=ResultWrapper._unwrapper, ), cast_to=cast( - Any, ResultWrapper[ConfigurationListResponse] + Any, ResultWrapper[ConfigurationGetResponse] ), # Union types cannot be passed in as arguments in the type system ), ) @@ -208,7 +208,7 @@ async def update( ), ) - async def list( + async def get( self, tunnel_id: str, *, @@ -219,7 +219,7 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ConfigurationListResponse: + ) -> ConfigurationGetResponse: """ Gets the configuration for a remotely-managed tunnel @@ -241,7 +241,7 @@ async def list( if not tunnel_id: raise ValueError(f"Expected a non-empty value for `tunnel_id` but received {tunnel_id!r}") return cast( - ConfigurationListResponse, + ConfigurationGetResponse, await self._get( f"/accounts/{account_id}/cfd_tunnel/{tunnel_id}/configurations", options=make_request_options( @@ -252,7 +252,7 @@ async def list( post_parser=ResultWrapper._unwrapper, ), cast_to=cast( - Any, ResultWrapper[ConfigurationListResponse] + Any, ResultWrapper[ConfigurationGetResponse] ), # Union types cannot be passed in as arguments in the type system ), ) @@ -265,8 +265,8 @@ def __init__(self, configurations: Configurations) -> None: self.update = to_raw_response_wrapper( configurations.update, ) - self.list = to_raw_response_wrapper( - configurations.list, + self.get = to_raw_response_wrapper( + configurations.get, ) @@ -277,8 +277,8 @@ def __init__(self, configurations: AsyncConfigurations) -> None: self.update = async_to_raw_response_wrapper( configurations.update, ) - self.list = async_to_raw_response_wrapper( - configurations.list, + self.get = async_to_raw_response_wrapper( + configurations.get, ) @@ -289,8 +289,8 @@ def __init__(self, configurations: Configurations) -> None: self.update = to_streamed_response_wrapper( configurations.update, ) - self.list = to_streamed_response_wrapper( - configurations.list, + self.get = to_streamed_response_wrapper( + configurations.get, ) @@ -301,6 +301,6 @@ def __init__(self, configurations: AsyncConfigurations) -> None: self.update = async_to_streamed_response_wrapper( configurations.update, ) - self.list = async_to_streamed_response_wrapper( - configurations.list, + self.get = async_to_streamed_response_wrapper( + configurations.get, ) diff --git a/src/cloudflare/resources/zero_trust/tunnels/connections.py b/src/cloudflare/resources/zero_trust/tunnels/connections.py index 45005b9d2b0..5b7bf478d43 100644 --- a/src/cloudflare/resources/zero_trust/tunnels/connections.py +++ b/src/cloudflare/resources/zero_trust/tunnels/connections.py @@ -23,7 +23,7 @@ from ...._base_client import ( make_request_options, ) -from ....types.zero_trust.tunnels import ConnectionListResponse, ConnectionDeleteResponse, connection_delete_params +from ....types.zero_trust.tunnels import ConnectionGetResponse, ConnectionDeleteResponse, connection_delete_params __all__ = ["Connections", "AsyncConnections"] @@ -37,50 +37,6 @@ def with_raw_response(self) -> ConnectionsWithRawResponse: def with_streaming_response(self) -> ConnectionsWithStreamingResponse: return ConnectionsWithStreamingResponse(self) - def list( - self, - tunnel_id: str, - *, - 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, - ) -> Optional[ConnectionListResponse]: - """ - Fetches connection details for a Cloudflare Tunnel. - - Args: - account_id: Cloudflare account ID - - tunnel_id: UUID of the tunnel. - - 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_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not tunnel_id: - raise ValueError(f"Expected a non-empty value for `tunnel_id` but received {tunnel_id!r}") - return self._get( - f"/accounts/{account_id}/cfd_tunnel/{tunnel_id}/connections", - 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[ConnectionListResponse]], ResultWrapper[ConnectionListResponse]), - ) - def delete( self, tunnel_id: str, @@ -134,17 +90,7 @@ def delete( ), ) - -class AsyncConnections(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncConnectionsWithRawResponse: - return AsyncConnectionsWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncConnectionsWithStreamingResponse: - return AsyncConnectionsWithStreamingResponse(self) - - async def list( + def get( self, tunnel_id: str, *, @@ -155,7 +101,7 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ConnectionListResponse]: + ) -> Optional[ConnectionGetResponse]: """ Fetches connection details for a Cloudflare Tunnel. @@ -176,7 +122,7 @@ async def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not tunnel_id: raise ValueError(f"Expected a non-empty value for `tunnel_id` but received {tunnel_id!r}") - return await self._get( + return self._get( f"/accounts/{account_id}/cfd_tunnel/{tunnel_id}/connections", options=make_request_options( extra_headers=extra_headers, @@ -185,9 +131,19 @@ async def list( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[ConnectionListResponse]], ResultWrapper[ConnectionListResponse]), + cast_to=cast(Type[Optional[ConnectionGetResponse]], ResultWrapper[ConnectionGetResponse]), ) + +class AsyncConnections(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncConnectionsWithRawResponse: + return AsyncConnectionsWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncConnectionsWithStreamingResponse: + return AsyncConnectionsWithStreamingResponse(self) + async def delete( self, tunnel_id: str, @@ -241,50 +197,94 @@ async def delete( ), ) + async def get( + self, + tunnel_id: str, + *, + 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, + ) -> Optional[ConnectionGetResponse]: + """ + Fetches connection details for a Cloudflare Tunnel. + + Args: + account_id: Cloudflare account ID + + tunnel_id: UUID of the tunnel. + + 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_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not tunnel_id: + raise ValueError(f"Expected a non-empty value for `tunnel_id` but received {tunnel_id!r}") + return await self._get( + f"/accounts/{account_id}/cfd_tunnel/{tunnel_id}/connections", + 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[ConnectionGetResponse]], ResultWrapper[ConnectionGetResponse]), + ) + class ConnectionsWithRawResponse: def __init__(self, connections: Connections) -> None: self._connections = connections - self.list = to_raw_response_wrapper( - connections.list, - ) self.delete = to_raw_response_wrapper( connections.delete, ) + self.get = to_raw_response_wrapper( + connections.get, + ) class AsyncConnectionsWithRawResponse: def __init__(self, connections: AsyncConnections) -> None: self._connections = connections - self.list = async_to_raw_response_wrapper( - connections.list, - ) self.delete = async_to_raw_response_wrapper( connections.delete, ) + self.get = async_to_raw_response_wrapper( + connections.get, + ) class ConnectionsWithStreamingResponse: def __init__(self, connections: Connections) -> None: self._connections = connections - self.list = to_streamed_response_wrapper( - connections.list, - ) self.delete = to_streamed_response_wrapper( connections.delete, ) + self.get = to_streamed_response_wrapper( + connections.get, + ) class AsyncConnectionsWithStreamingResponse: def __init__(self, connections: AsyncConnections) -> None: self._connections = connections - self.list = async_to_streamed_response_wrapper( - connections.list, - ) self.delete = async_to_streamed_response_wrapper( connections.delete, ) + self.get = async_to_streamed_response_wrapper( + connections.get, + ) diff --git a/src/cloudflare/resources/zones/settings/settings.py b/src/cloudflare/resources/zones/settings/settings.py index 845841ece9c..5f578f5a9fc 100644 --- a/src/cloudflare/resources/zones/settings/settings.py +++ b/src/cloudflare/resources/zones/settings/settings.py @@ -212,7 +212,7 @@ RocketLoaderWithStreamingResponse, AsyncRocketLoaderWithStreamingResponse, ) -from ....types.zones import SettingEditResponse, SettingListResponse, setting_edit_params +from ....types.zones import SettingGetResponse, SettingEditResponse, setting_edit_params from .image_resizing import ( ImageResizing, AsyncImageResizing, @@ -649,23 +649,26 @@ def with_raw_response(self) -> SettingsWithRawResponse: def with_streaming_response(self) -> SettingsWithStreamingResponse: return SettingsWithStreamingResponse(self) - def list( + def edit( self, *, zone_id: str, + items: Iterable[setting_edit_params.Item], # 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[SettingListResponse]: + ) -> Optional[SettingEditResponse]: """ - Available settings for your user in relation to a zone. + Edit settings for a zone. Args: zone_id: Identifier + items: One or more zone setting objects. Must contain an ID and a value. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -676,8 +679,9 @@ def list( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return self._get( + return self._patch( f"/zones/{zone_id}/settings", + body=maybe_transform({"items": items}, setting_edit_params.SettingEditParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -685,29 +689,26 @@ def list( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[SettingListResponse]], ResultWrapper[SettingListResponse]), + cast_to=cast(Type[Optional[SettingEditResponse]], ResultWrapper[SettingEditResponse]), ) - def edit( + def get( self, *, zone_id: str, - items: Iterable[setting_edit_params.Item], # 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[SettingEditResponse]: + ) -> Optional[SettingGetResponse]: """ - Edit settings for a zone. + Available settings for your user in relation to a zone. Args: zone_id: Identifier - items: One or more zone setting objects. Must contain an ID and a value. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -718,9 +719,8 @@ def edit( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return self._patch( + return self._get( f"/zones/{zone_id}/settings", - body=maybe_transform({"items": items}, setting_edit_params.SettingEditParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -728,7 +728,7 @@ def edit( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[SettingEditResponse]], ResultWrapper[SettingEditResponse]), + cast_to=cast(Type[Optional[SettingGetResponse]], ResultWrapper[SettingGetResponse]), ) @@ -945,23 +945,26 @@ def with_raw_response(self) -> AsyncSettingsWithRawResponse: def with_streaming_response(self) -> AsyncSettingsWithStreamingResponse: return AsyncSettingsWithStreamingResponse(self) - async def list( + async def edit( self, *, zone_id: str, + items: Iterable[setting_edit_params.Item], # 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[SettingListResponse]: + ) -> Optional[SettingEditResponse]: """ - Available settings for your user in relation to a zone. + Edit settings for a zone. Args: zone_id: Identifier + items: One or more zone setting objects. Must contain an ID and a value. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -972,8 +975,9 @@ async def list( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return await self._get( + return await self._patch( f"/zones/{zone_id}/settings", + body=await async_maybe_transform({"items": items}, setting_edit_params.SettingEditParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -981,29 +985,26 @@ async def list( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[SettingListResponse]], ResultWrapper[SettingListResponse]), + cast_to=cast(Type[Optional[SettingEditResponse]], ResultWrapper[SettingEditResponse]), ) - async def edit( + async def get( self, *, zone_id: str, - items: Iterable[setting_edit_params.Item], # 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[SettingEditResponse]: + ) -> Optional[SettingGetResponse]: """ - Edit settings for a zone. + Available settings for your user in relation to a zone. Args: zone_id: Identifier - items: One or more zone setting objects. Must contain an ID and a value. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1014,9 +1015,8 @@ async def edit( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return await self._patch( + return await self._get( f"/zones/{zone_id}/settings", - body=await async_maybe_transform({"items": items}, setting_edit_params.SettingEditParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -1024,7 +1024,7 @@ async def edit( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[SettingEditResponse]], ResultWrapper[SettingEditResponse]), + cast_to=cast(Type[Optional[SettingGetResponse]], ResultWrapper[SettingGetResponse]), ) @@ -1032,12 +1032,12 @@ class SettingsWithRawResponse: def __init__(self, settings: Settings) -> None: self._settings = settings - self.list = to_raw_response_wrapper( - settings.list, - ) self.edit = to_raw_response_wrapper( settings.edit, ) + self.get = to_raw_response_wrapper( + settings.get, + ) @cached_property def zero_rtt(self) -> ZeroRTTWithRawResponse: @@ -1248,12 +1248,12 @@ class AsyncSettingsWithRawResponse: def __init__(self, settings: AsyncSettings) -> None: self._settings = settings - self.list = async_to_raw_response_wrapper( - settings.list, - ) self.edit = async_to_raw_response_wrapper( settings.edit, ) + self.get = async_to_raw_response_wrapper( + settings.get, + ) @cached_property def zero_rtt(self) -> AsyncZeroRTTWithRawResponse: @@ -1464,12 +1464,12 @@ class SettingsWithStreamingResponse: def __init__(self, settings: Settings) -> None: self._settings = settings - self.list = to_streamed_response_wrapper( - settings.list, - ) self.edit = to_streamed_response_wrapper( settings.edit, ) + self.get = to_streamed_response_wrapper( + settings.get, + ) @cached_property def zero_rtt(self) -> ZeroRTTWithStreamingResponse: @@ -1680,12 +1680,12 @@ class AsyncSettingsWithStreamingResponse: def __init__(self, settings: AsyncSettings) -> None: self._settings = settings - self.list = async_to_streamed_response_wrapper( - settings.list, - ) self.edit = async_to_streamed_response_wrapper( settings.edit, ) + self.get = async_to_streamed_response_wrapper( + settings.get, + ) @cached_property def zero_rtt(self) -> AsyncZeroRTTWithStreamingResponse: diff --git a/src/cloudflare/types/__init__.py b/src/cloudflare/types/__init__.py index 45ba166ac47..5e67eba2df7 100644 --- a/src/cloudflare/types/__init__.py +++ b/src/cloudflare/types/__init__.py @@ -14,6 +14,7 @@ from .zone_list_params import ZoneListParams as ZoneListParams from .call_get_response import CallGetResponse as CallGetResponse from .pcap_get_response import PCAPGetResponse as PCAPGetResponse +from .user_get_response import UserGetResponse as UserGetResponse from .zone_get_response import ZoneGetResponse as ZoneGetResponse from .cache_purge_params import CachePurgeParams as CachePurgeParams from .call_create_params import CallCreateParams as CallCreateParams @@ -26,7 +27,6 @@ from .queue_get_response import QueueGetResponse as QueueGetResponse from .stream_list_params import StreamListParams as StreamListParams from .user_edit_response import UserEditResponse as UserEditResponse -from .user_list_response import UserListResponse as UserListResponse from .zone_create_params import ZoneCreateParams as ZoneCreateParams from .zone_edit_response import ZoneEditResponse as ZoneEditResponse from .zone_list_response import ZoneListResponse as ZoneListResponse @@ -171,6 +171,7 @@ from .client_certificate_list_params import ClientCertificateListParams as ClientCertificateListParams from .custom_certificate_edit_params import CustomCertificateEditParams as CustomCertificateEditParams from .custom_certificate_list_params import CustomCertificateListParams as CustomCertificateListParams +from .custom_nameserver_get_response import CustomNameserverGetResponse as CustomNameserverGetResponse from .mtls_certificate_create_params import MTLSCertificateCreateParams as MTLSCertificateCreateParams from .mtls_certificate_list_response import MTLSCertificateListResponse as MTLSCertificateListResponse from .url_normalization_get_response import URLNormalizationGetResponse as URLNormalizationGetResponse @@ -181,9 +182,9 @@ from .custom_hostname_create_response import CustomHostnameCreateResponse as CustomHostnameCreateResponse from .custom_hostname_delete_response import CustomHostnameDeleteResponse as CustomHostnameDeleteResponse from .custom_nameserver_create_params import CustomNameserverCreateParams as CustomNameserverCreateParams -from .custom_nameserver_list_response import CustomNameserverListResponse as CustomNameserverListResponse from .keyless_certificate_edit_params import KeylessCertificateEditParams as KeylessCertificateEditParams from .url_normalization_update_params import URLNormalizationUpdateParams as URLNormalizationUpdateParams +from .available_rate_plan_get_response import AvailableRatePlanGetResponse as AvailableRatePlanGetResponse from .brand_protection_submit_response import BrandProtectionSubmitResponse as BrandProtectionSubmitResponse from .brand_protection_url_info_params import BrandProtectionURLInfoParams as BrandProtectionURLInfoParams from .client_certificate_create_params import ClientCertificateCreateParams as ClientCertificateCreateParams @@ -195,7 +196,6 @@ from .keyless_certificate_get_response import KeylessCertificateGetResponse as KeylessCertificateGetResponse from .mtls_certificate_create_response import MTLSCertificateCreateResponse as MTLSCertificateCreateResponse from .mtls_certificate_delete_response import MTLSCertificateDeleteResponse as MTLSCertificateDeleteResponse -from .available_rate_plan_list_response import AvailableRatePlanListResponse as AvailableRatePlanListResponse from .custom_nameserver_create_response import CustomNameserverCreateResponse as CustomNameserverCreateResponse from .custom_nameserver_delete_response import CustomNameserverDeleteResponse as CustomNameserverDeleteResponse from .custom_nameserver_verify_response import CustomNameserverVerifyResponse as CustomNameserverVerifyResponse diff --git a/src/cloudflare/types/available_rate_plan_list_response.py b/src/cloudflare/types/available_rate_plan_get_response.py similarity index 71% rename from src/cloudflare/types/available_rate_plan_list_response.py rename to src/cloudflare/types/available_rate_plan_get_response.py index 930f6ab6215..c00a52adb37 100644 --- a/src/cloudflare/types/available_rate_plan_list_response.py +++ b/src/cloudflare/types/available_rate_plan_get_response.py @@ -6,13 +6,13 @@ from .._models import BaseModel __all__ = [ - "AvailableRatePlanListResponse", - "AvailableRatePlanListResponseItem", - "AvailableRatePlanListResponseItemComponent", + "AvailableRatePlanGetResponse", + "AvailableRatePlanGetResponseItem", + "AvailableRatePlanGetResponseItemComponent", ] -class AvailableRatePlanListResponseItemComponent(BaseModel): +class AvailableRatePlanGetResponseItemComponent(BaseModel): default: Optional[float] = None """The default amount allocated.""" @@ -23,11 +23,11 @@ class AvailableRatePlanListResponseItemComponent(BaseModel): """The unit price of the addon.""" -class AvailableRatePlanListResponseItem(BaseModel): +class AvailableRatePlanGetResponseItem(BaseModel): id: Optional[str] = None """Plan identifier tag.""" - components: Optional[List[AvailableRatePlanListResponseItemComponent]] = None + components: Optional[List[AvailableRatePlanGetResponseItemComponent]] = None """Array of available components values for the plan.""" currency: Optional[str] = None @@ -43,4 +43,4 @@ class AvailableRatePlanListResponseItem(BaseModel): """The plan name.""" -AvailableRatePlanListResponse = List[AvailableRatePlanListResponseItem] +AvailableRatePlanGetResponse = List[AvailableRatePlanGetResponseItem] diff --git a/src/cloudflare/types/cache/__init__.py b/src/cloudflare/types/cache/__init__.py index 08fe23dbf1e..f4d9ef34a53 100644 --- a/src/cloudflare/types/cache/__init__.py +++ b/src/cloudflare/types/cache/__init__.py @@ -3,12 +3,12 @@ from __future__ import annotations from .variant_edit_params import VariantEditParams as VariantEditParams +from .variant_get_response import VariantGetResponse as VariantGetResponse from .variant_edit_response import VariantEditResponse as VariantEditResponse -from .variant_list_response import VariantListResponse as VariantListResponse from .variant_delete_response import VariantDeleteResponse as VariantDeleteResponse from .cache_reserve_edit_params import CacheReserveEditParams as CacheReserveEditParams +from .cache_reserve_get_response import CacheReserveGetResponse as CacheReserveGetResponse from .cache_reserve_edit_response import CacheReserveEditResponse as CacheReserveEditResponse -from .cache_reserve_list_response import CacheReserveListResponse as CacheReserveListResponse from .cache_reserve_clear_response import CacheReserveClearResponse as CacheReserveClearResponse from .cache_reserve_status_response import CacheReserveStatusResponse as CacheReserveStatusResponse from .smart_tiered_cached_edit_params import SmartTieredCachedEditParams as SmartTieredCachedEditParams diff --git a/src/cloudflare/types/cache/cache_reserve_list_response.py b/src/cloudflare/types/cache/cache_reserve_get_response.py similarity index 83% rename from src/cloudflare/types/cache/cache_reserve_list_response.py rename to src/cloudflare/types/cache/cache_reserve_get_response.py index b135bae9fc4..dfd2d0b6e0d 100644 --- a/src/cloudflare/types/cache/cache_reserve_list_response.py +++ b/src/cloudflare/types/cache/cache_reserve_get_response.py @@ -6,10 +6,10 @@ from ..._models import BaseModel -__all__ = ["CacheReserveListResponse"] +__all__ = ["CacheReserveGetResponse"] -class CacheReserveListResponse(BaseModel): +class CacheReserveGetResponse(BaseModel): id: Literal["cache_reserve"] """ID of the zone setting.""" diff --git a/src/cloudflare/types/cache/variant_list_response.py b/src/cloudflare/types/cache/variant_get_response.py similarity index 96% rename from src/cloudflare/types/cache/variant_list_response.py rename to src/cloudflare/types/cache/variant_get_response.py index 904273e72c5..a38cc1baac1 100644 --- a/src/cloudflare/types/cache/variant_list_response.py +++ b/src/cloudflare/types/cache/variant_get_response.py @@ -6,7 +6,7 @@ from ..._models import BaseModel -__all__ = ["VariantListResponse", "Value"] +__all__ = ["VariantGetResponse", "Value"] class Value(BaseModel): @@ -77,7 +77,7 @@ class Value(BaseModel): """ -class VariantListResponse(BaseModel): +class VariantGetResponse(BaseModel): id: Literal["variants"] """ID of the zone setting.""" diff --git a/src/cloudflare/types/certificate_authorities/__init__.py b/src/cloudflare/types/certificate_authorities/__init__.py index 201922cefb4..a5dcc3656ad 100644 --- a/src/cloudflare/types/certificate_authorities/__init__.py +++ b/src/cloudflare/types/certificate_authorities/__init__.py @@ -2,7 +2,7 @@ from __future__ import annotations -from .hostname_association_list_params import HostnameAssociationListParams as HostnameAssociationListParams -from .hostname_association_list_response import HostnameAssociationListResponse as HostnameAssociationListResponse +from .hostname_association_get_params import HostnameAssociationGetParams as HostnameAssociationGetParams +from .hostname_association_get_response import HostnameAssociationGetResponse as HostnameAssociationGetResponse from .hostname_association_update_params import HostnameAssociationUpdateParams as HostnameAssociationUpdateParams from .hostname_association_update_response import HostnameAssociationUpdateResponse as HostnameAssociationUpdateResponse diff --git a/src/cloudflare/types/certificate_authorities/hostname_association_list_params.py b/src/cloudflare/types/certificate_authorities/hostname_association_get_params.py similarity index 81% rename from src/cloudflare/types/certificate_authorities/hostname_association_list_params.py rename to src/cloudflare/types/certificate_authorities/hostname_association_get_params.py index f67386bb4d6..536ea625bc4 100644 --- a/src/cloudflare/types/certificate_authorities/hostname_association_list_params.py +++ b/src/cloudflare/types/certificate_authorities/hostname_association_get_params.py @@ -4,10 +4,10 @@ from typing_extensions import Required, TypedDict -__all__ = ["HostnameAssociationListParams"] +__all__ = ["HostnameAssociationGetParams"] -class HostnameAssociationListParams(TypedDict, total=False): +class HostnameAssociationGetParams(TypedDict, total=False): zone_id: Required[str] """Identifier""" diff --git a/src/cloudflare/types/certificate_authorities/hostname_association_list_response.py b/src/cloudflare/types/certificate_authorities/hostname_association_get_response.py similarity index 82% rename from src/cloudflare/types/certificate_authorities/hostname_association_list_response.py rename to src/cloudflare/types/certificate_authorities/hostname_association_get_response.py index 3e3a0e95573..f7431caedde 100644 --- a/src/cloudflare/types/certificate_authorities/hostname_association_list_response.py +++ b/src/cloudflare/types/certificate_authorities/hostname_association_get_response.py @@ -4,10 +4,10 @@ from ..._models import BaseModel -__all__ = ["HostnameAssociationListResponse"] +__all__ = ["HostnameAssociationGetResponse"] -class HostnameAssociationListResponse(BaseModel): +class HostnameAssociationGetResponse(BaseModel): hostnames: Optional[List[str]] = None mtls_certificate_id: Optional[str] = None diff --git a/src/cloudflare/types/custom_nameserver_list_response.py b/src/cloudflare/types/custom_nameserver_get_response.py similarity index 64% rename from src/cloudflare/types/custom_nameserver_list_response.py rename to src/cloudflare/types/custom_nameserver_get_response.py index 49ec90af9b3..dd8ff25ee2c 100644 --- a/src/cloudflare/types/custom_nameserver_list_response.py +++ b/src/cloudflare/types/custom_nameserver_get_response.py @@ -5,14 +5,10 @@ from .._models import BaseModel -__all__ = [ - "CustomNameserverListResponse", - "CustomNameserverListResponseItem", - "CustomNameserverListResponseItemDNSRecord", -] +__all__ = ["CustomNameserverGetResponse", "CustomNameserverGetResponseItem", "CustomNameserverGetResponseItemDNSRecord"] -class CustomNameserverListResponseItemDNSRecord(BaseModel): +class CustomNameserverGetResponseItemDNSRecord(BaseModel): type: Optional[Literal["A", "AAAA"]] = None """DNS record type.""" @@ -20,8 +16,8 @@ class CustomNameserverListResponseItemDNSRecord(BaseModel): """DNS record contents (an IPv4 or IPv6 address).""" -class CustomNameserverListResponseItem(BaseModel): - dns_records: List[CustomNameserverListResponseItemDNSRecord] +class CustomNameserverGetResponseItem(BaseModel): + dns_records: List[CustomNameserverGetResponseItemDNSRecord] """A and AAAA records associated with the nameserver.""" ns_name: str @@ -37,4 +33,4 @@ class CustomNameserverListResponseItem(BaseModel): """The number of the set that this name server belongs to.""" -CustomNameserverListResponse = List[CustomNameserverListResponseItem] +CustomNameserverGetResponse = List[CustomNameserverGetResponseItem] diff --git a/src/cloudflare/types/dns/analytics/__init__.py b/src/cloudflare/types/dns/analytics/__init__.py index e5056de4b52..f7c9d0723d8 100644 --- a/src/cloudflare/types/dns/analytics/__init__.py +++ b/src/cloudflare/types/dns/analytics/__init__.py @@ -2,5 +2,5 @@ from __future__ import annotations -from .report_list_params import ReportListParams as ReportListParams -from .report_list_response import ReportListResponse as ReportListResponse +from .report_get_params import ReportGetParams as ReportGetParams +from .report_get_response import ReportGetResponse as ReportGetResponse diff --git a/src/cloudflare/types/dns/analytics/report_list_params.py b/src/cloudflare/types/dns/analytics/report_get_params.py similarity index 92% rename from src/cloudflare/types/dns/analytics/report_list_params.py rename to src/cloudflare/types/dns/analytics/report_get_params.py index e07c0eed24d..fe6cd95fb30 100644 --- a/src/cloudflare/types/dns/analytics/report_list_params.py +++ b/src/cloudflare/types/dns/analytics/report_get_params.py @@ -8,10 +8,10 @@ from ...._utils import PropertyInfo -__all__ = ["ReportListParams"] +__all__ = ["ReportGetParams"] -class ReportListParams(TypedDict, total=False): +class ReportGetParams(TypedDict, total=False): dimensions: str """A comma-separated list of dimensions to group results by.""" diff --git a/src/cloudflare/types/dns/analytics/report_list_response.py b/src/cloudflare/types/dns/analytics/report_get_response.py similarity index 95% rename from src/cloudflare/types/dns/analytics/report_list_response.py rename to src/cloudflare/types/dns/analytics/report_get_response.py index 6023e1ca434..78eabe32d5f 100644 --- a/src/cloudflare/types/dns/analytics/report_list_response.py +++ b/src/cloudflare/types/dns/analytics/report_get_response.py @@ -5,7 +5,7 @@ from ...._models import BaseModel -__all__ = ["ReportListResponse", "Data", "Query"] +__all__ = ["ReportGetResponse", "Data", "Query"] class Data(BaseModel): @@ -45,7 +45,7 @@ class Query(BaseModel): """ -class ReportListResponse(BaseModel): +class ReportGetResponse(BaseModel): data: List[Data] """Array with one row per combination of dimension values.""" diff --git a/src/cloudflare/types/dns/analytics/reports/__init__.py b/src/cloudflare/types/dns/analytics/reports/__init__.py index 5b8178698e8..5156a0bb27c 100644 --- a/src/cloudflare/types/dns/analytics/reports/__init__.py +++ b/src/cloudflare/types/dns/analytics/reports/__init__.py @@ -2,5 +2,5 @@ from __future__ import annotations -from .bytime_list_params import BytimeListParams as BytimeListParams -from .bytime_list_response import BytimeListResponse as BytimeListResponse +from .bytime_get_params import BytimeGetParams as BytimeGetParams +from .bytime_get_response import BytimeGetResponse as BytimeGetResponse diff --git a/src/cloudflare/types/dns/analytics/reports/bytime_list_params.py b/src/cloudflare/types/dns/analytics/reports/bytime_get_params.py similarity index 93% rename from src/cloudflare/types/dns/analytics/reports/bytime_list_params.py rename to src/cloudflare/types/dns/analytics/reports/bytime_get_params.py index 3eaee62aebd..90d535fdaf8 100644 --- a/src/cloudflare/types/dns/analytics/reports/bytime_list_params.py +++ b/src/cloudflare/types/dns/analytics/reports/bytime_get_params.py @@ -8,10 +8,10 @@ from ....._utils import PropertyInfo -__all__ = ["BytimeListParams"] +__all__ = ["BytimeGetParams"] -class BytimeListParams(TypedDict, total=False): +class BytimeGetParams(TypedDict, total=False): dimensions: str """A comma-separated list of dimensions to group results by.""" diff --git a/src/cloudflare/types/dns/analytics/reports/bytime_list_response.py b/src/cloudflare/types/dns/analytics/reports/bytime_get_response.py similarity index 96% rename from src/cloudflare/types/dns/analytics/reports/bytime_list_response.py rename to src/cloudflare/types/dns/analytics/reports/bytime_get_response.py index 293e6d0ccb7..0568f1d995c 100644 --- a/src/cloudflare/types/dns/analytics/reports/bytime_list_response.py +++ b/src/cloudflare/types/dns/analytics/reports/bytime_get_response.py @@ -6,7 +6,7 @@ from ....._models import BaseModel -__all__ = ["BytimeListResponse", "Data", "Query"] +__all__ = ["BytimeGetResponse", "Data", "Query"] class Data(BaseModel): @@ -52,7 +52,7 @@ class Query(BaseModel): """ -class BytimeListResponse(BaseModel): +class BytimeGetResponse(BaseModel): data: List[Data] """Array with one row per combination of dimension values.""" diff --git a/src/cloudflare/types/dns/firewall/analytics/__init__.py b/src/cloudflare/types/dns/firewall/analytics/__init__.py index e5056de4b52..f7c9d0723d8 100644 --- a/src/cloudflare/types/dns/firewall/analytics/__init__.py +++ b/src/cloudflare/types/dns/firewall/analytics/__init__.py @@ -2,5 +2,5 @@ from __future__ import annotations -from .report_list_params import ReportListParams as ReportListParams -from .report_list_response import ReportListResponse as ReportListResponse +from .report_get_params import ReportGetParams as ReportGetParams +from .report_get_response import ReportGetResponse as ReportGetResponse diff --git a/src/cloudflare/types/dns/firewall/analytics/report_list_params.py b/src/cloudflare/types/dns/firewall/analytics/report_get_params.py similarity index 93% rename from src/cloudflare/types/dns/firewall/analytics/report_list_params.py rename to src/cloudflare/types/dns/firewall/analytics/report_get_params.py index 51101aa53b1..84b8e3e81c4 100644 --- a/src/cloudflare/types/dns/firewall/analytics/report_list_params.py +++ b/src/cloudflare/types/dns/firewall/analytics/report_get_params.py @@ -8,10 +8,10 @@ from ....._utils import PropertyInfo -__all__ = ["ReportListParams"] +__all__ = ["ReportGetParams"] -class ReportListParams(TypedDict, total=False): +class ReportGetParams(TypedDict, total=False): account_identifier: Required[str] """Identifier""" diff --git a/src/cloudflare/types/dns/firewall/analytics/report_list_response.py b/src/cloudflare/types/dns/firewall/analytics/report_get_response.py similarity index 95% rename from src/cloudflare/types/dns/firewall/analytics/report_list_response.py rename to src/cloudflare/types/dns/firewall/analytics/report_get_response.py index 1f5656bf897..d83c1eaf092 100644 --- a/src/cloudflare/types/dns/firewall/analytics/report_list_response.py +++ b/src/cloudflare/types/dns/firewall/analytics/report_get_response.py @@ -5,7 +5,7 @@ from ....._models import BaseModel -__all__ = ["ReportListResponse", "Data", "Query"] +__all__ = ["ReportGetResponse", "Data", "Query"] class Data(BaseModel): @@ -45,7 +45,7 @@ class Query(BaseModel): """ -class ReportListResponse(BaseModel): +class ReportGetResponse(BaseModel): data: List[Data] """Array with one row per combination of dimension values.""" diff --git a/src/cloudflare/types/dns/firewall/analytics/reports/__init__.py b/src/cloudflare/types/dns/firewall/analytics/reports/__init__.py index 5b8178698e8..5156a0bb27c 100644 --- a/src/cloudflare/types/dns/firewall/analytics/reports/__init__.py +++ b/src/cloudflare/types/dns/firewall/analytics/reports/__init__.py @@ -2,5 +2,5 @@ from __future__ import annotations -from .bytime_list_params import BytimeListParams as BytimeListParams -from .bytime_list_response import BytimeListResponse as BytimeListResponse +from .bytime_get_params import BytimeGetParams as BytimeGetParams +from .bytime_get_response import BytimeGetResponse as BytimeGetResponse diff --git a/src/cloudflare/types/dns/firewall/analytics/reports/bytime_list_params.py b/src/cloudflare/types/dns/firewall/analytics/reports/bytime_get_params.py similarity index 94% rename from src/cloudflare/types/dns/firewall/analytics/reports/bytime_list_params.py rename to src/cloudflare/types/dns/firewall/analytics/reports/bytime_get_params.py index e0692a0c392..74dc7e3b0bb 100644 --- a/src/cloudflare/types/dns/firewall/analytics/reports/bytime_list_params.py +++ b/src/cloudflare/types/dns/firewall/analytics/reports/bytime_get_params.py @@ -8,10 +8,10 @@ from ......_utils import PropertyInfo -__all__ = ["BytimeListParams"] +__all__ = ["BytimeGetParams"] -class BytimeListParams(TypedDict, total=False): +class BytimeGetParams(TypedDict, total=False): account_identifier: Required[str] """Identifier""" diff --git a/src/cloudflare/types/dns/firewall/analytics/reports/bytime_list_response.py b/src/cloudflare/types/dns/firewall/analytics/reports/bytime_get_response.py similarity index 96% rename from src/cloudflare/types/dns/firewall/analytics/reports/bytime_list_response.py rename to src/cloudflare/types/dns/firewall/analytics/reports/bytime_get_response.py index bfff3bc82cd..8145d26699a 100644 --- a/src/cloudflare/types/dns/firewall/analytics/reports/bytime_list_response.py +++ b/src/cloudflare/types/dns/firewall/analytics/reports/bytime_get_response.py @@ -6,7 +6,7 @@ from ......_models import BaseModel -__all__ = ["BytimeListResponse", "Data", "Query"] +__all__ = ["BytimeGetResponse", "Data", "Query"] class Data(BaseModel): @@ -52,7 +52,7 @@ class Query(BaseModel): """ -class BytimeListResponse(BaseModel): +class BytimeGetResponse(BaseModel): data: List[Data] """Array with one row per combination of dimension values.""" diff --git a/src/cloudflare/types/email_routing/routing/__init__.py b/src/cloudflare/types/email_routing/routing/__init__.py index 3cc07a818c8..2f2433a4024 100644 --- a/src/cloudflare/types/email_routing/routing/__init__.py +++ b/src/cloudflare/types/email_routing/routing/__init__.py @@ -8,18 +8,14 @@ from .rule_create_params import RuleCreateParams as RuleCreateParams from .rule_list_response import RuleListResponse as RuleListResponse from .rule_update_params import RuleUpdateParams as RuleUpdateParams +from .address_list_params import AddressListParams as AddressListParams from .address_get_response import AddressGetResponse as AddressGetResponse from .rule_create_response import RuleCreateResponse as RuleCreateResponse from .rule_delete_response import RuleDeleteResponse as RuleDeleteResponse from .rule_update_response import RuleUpdateResponse as RuleUpdateResponse from .address_create_params import AddressCreateParams as AddressCreateParams +from .address_list_response import AddressListResponse as AddressListResponse from .enable_create_response import EnableCreateResponse as EnableCreateResponse from .address_create_response import AddressCreateResponse as AddressCreateResponse from .address_delete_response import AddressDeleteResponse as AddressDeleteResponse from .disable_create_response import DisableCreateResponse as DisableCreateResponse -from .address_email_routing_destination_addresses_list_destination_addresses_params import ( - AddressEmailRoutingDestinationAddressesListDestinationAddressesParams as AddressEmailRoutingDestinationAddressesListDestinationAddressesParams, -) -from .address_email_routing_destination_addresses_list_destination_addresses_response import ( - AddressEmailRoutingDestinationAddressesListDestinationAddressesResponse as AddressEmailRoutingDestinationAddressesListDestinationAddressesResponse, -) diff --git a/src/cloudflare/types/email_routing/routing/address_email_routing_destination_addresses_list_destination_addresses_params.py b/src/cloudflare/types/email_routing/routing/address_list_params.py similarity index 71% rename from src/cloudflare/types/email_routing/routing/address_email_routing_destination_addresses_list_destination_addresses_params.py rename to src/cloudflare/types/email_routing/routing/address_list_params.py index 2db67e694e6..a97e602ae6a 100644 --- a/src/cloudflare/types/email_routing/routing/address_email_routing_destination_addresses_list_destination_addresses_params.py +++ b/src/cloudflare/types/email_routing/routing/address_list_params.py @@ -4,10 +4,10 @@ from typing_extensions import Literal, TypedDict -__all__ = ["AddressEmailRoutingDestinationAddressesListDestinationAddressesParams"] +__all__ = ["AddressListParams"] -class AddressEmailRoutingDestinationAddressesListDestinationAddressesParams(TypedDict, total=False): +class AddressListParams(TypedDict, total=False): direction: Literal["asc", "desc"] """Sorts results in an ascending or descending order.""" diff --git a/src/cloudflare/types/email_routing/routing/address_email_routing_destination_addresses_list_destination_addresses_response.py b/src/cloudflare/types/email_routing/routing/address_list_response.py similarity index 62% rename from src/cloudflare/types/email_routing/routing/address_email_routing_destination_addresses_list_destination_addresses_response.py rename to src/cloudflare/types/email_routing/routing/address_list_response.py index 5ab71e37bf3..fd5aab828d7 100644 --- a/src/cloudflare/types/email_routing/routing/address_email_routing_destination_addresses_list_destination_addresses_response.py +++ b/src/cloudflare/types/email_routing/routing/address_list_response.py @@ -1,17 +1,14 @@ # File generated from our OpenAPI spec by Stainless. -from typing import List, Optional +from typing import Optional from datetime import datetime from ...._models import BaseModel -__all__ = [ - "AddressEmailRoutingDestinationAddressesListDestinationAddressesResponse", - "AddressEmailRoutingDestinationAddressesListDestinationAddressesResponseItem", -] +__all__ = ["AddressListResponse"] -class AddressEmailRoutingDestinationAddressesListDestinationAddressesResponseItem(BaseModel): +class AddressListResponse(BaseModel): id: Optional[str] = None """Destination address identifier.""" @@ -35,8 +32,3 @@ class AddressEmailRoutingDestinationAddressesListDestinationAddressesResponseIte Null means not verified yet. """ - - -AddressEmailRoutingDestinationAddressesListDestinationAddressesResponse = List[ - AddressEmailRoutingDestinationAddressesListDestinationAddressesResponseItem -] diff --git a/src/cloudflare/types/intel/__init__.py b/src/cloudflare/types/intel/__init__.py index a482ab1bb9d..6e2650354ad 100644 --- a/src/cloudflare/types/intel/__init__.py +++ b/src/cloudflare/types/intel/__init__.py @@ -13,9 +13,9 @@ from .domain_get_response import DomainGetResponse as DomainGetResponse from .ip_list_get_response import IPListGetResponse as IPListGetResponse from .sinkhole_list_response import SinkholeListResponse as SinkholeListResponse -from .domain_history_list_params import DomainHistoryListParams as DomainHistoryListParams +from .domain_history_get_params import DomainHistoryGetParams as DomainHistoryGetParams +from .domain_history_get_response import DomainHistoryGetResponse as DomainHistoryGetResponse from .indicator_feed_get_response import IndicatorFeedGetResponse as IndicatorFeedGetResponse -from .domain_history_list_response import DomainHistoryListResponse as DomainHistoryListResponse from .indicator_feed_create_params import IndicatorFeedCreateParams as IndicatorFeedCreateParams from .indicator_feed_data_response import IndicatorFeedDataResponse as IndicatorFeedDataResponse from .indicator_feed_list_response import IndicatorFeedListResponse as IndicatorFeedListResponse diff --git a/src/cloudflare/types/intel/asn/__init__.py b/src/cloudflare/types/intel/asn/__init__.py index d17e56ccc2b..fda55da3fae 100644 --- a/src/cloudflare/types/intel/asn/__init__.py +++ b/src/cloudflare/types/intel/asn/__init__.py @@ -2,4 +2,4 @@ from __future__ import annotations -from .subnet_list_response import SubnetListResponse as SubnetListResponse +from .subnet_get_response import SubnetGetResponse as SubnetGetResponse diff --git a/src/cloudflare/types/intel/asn/subnet_list_response.py b/src/cloudflare/types/intel/asn/subnet_get_response.py similarity index 88% rename from src/cloudflare/types/intel/asn/subnet_list_response.py rename to src/cloudflare/types/intel/asn/subnet_get_response.py index f31375b4230..9f0ac4f1e80 100644 --- a/src/cloudflare/types/intel/asn/subnet_list_response.py +++ b/src/cloudflare/types/intel/asn/subnet_get_response.py @@ -4,10 +4,10 @@ from ...._models import BaseModel -__all__ = ["SubnetListResponse"] +__all__ = ["SubnetGetResponse"] -class SubnetListResponse(BaseModel): +class SubnetGetResponse(BaseModel): asn: Optional[int] = None count: Optional[float] = None diff --git a/src/cloudflare/types/intel/domain_history_list_params.py b/src/cloudflare/types/intel/domain_history_get_params.py similarity index 69% rename from src/cloudflare/types/intel/domain_history_list_params.py rename to src/cloudflare/types/intel/domain_history_get_params.py index 5ed4f327d5e..2fed1050d76 100644 --- a/src/cloudflare/types/intel/domain_history_list_params.py +++ b/src/cloudflare/types/intel/domain_history_get_params.py @@ -4,10 +4,10 @@ from typing_extensions import Required, TypedDict -__all__ = ["DomainHistoryListParams"] +__all__ = ["DomainHistoryGetParams"] -class DomainHistoryListParams(TypedDict, total=False): +class DomainHistoryGetParams(TypedDict, total=False): account_id: Required[str] """Identifier""" diff --git a/src/cloudflare/types/intel/domain_history_get_response.py b/src/cloudflare/types/intel/domain_history_get_response.py new file mode 100644 index 00000000000..24b372eb58c --- /dev/null +++ b/src/cloudflare/types/intel/domain_history_get_response.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. + +from typing import List, Optional +from datetime import date + +from ..._models import BaseModel + +__all__ = ["DomainHistoryGetResponse", "DomainHistoryGetResponseItem", "DomainHistoryGetResponseItemCategorization"] + + +class DomainHistoryGetResponseItemCategorization(BaseModel): + categories: Optional[object] = None + + end: Optional[date] = None + + start: Optional[date] = None + + +class DomainHistoryGetResponseItem(BaseModel): + categorizations: Optional[List[DomainHistoryGetResponseItemCategorization]] = None + + domain: Optional[str] = None + + +DomainHistoryGetResponse = List[DomainHistoryGetResponseItem] diff --git a/src/cloudflare/types/intel/domain_history_list_response.py b/src/cloudflare/types/intel/domain_history_list_response.py deleted file mode 100644 index ad64ac628d3..00000000000 --- a/src/cloudflare/types/intel/domain_history_list_response.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from typing import List, Optional -from datetime import date - -from ..._models import BaseModel - -__all__ = ["DomainHistoryListResponse", "DomainHistoryListResponseItem", "DomainHistoryListResponseItemCategorization"] - - -class DomainHistoryListResponseItemCategorization(BaseModel): - categories: Optional[object] = None - - end: Optional[date] = None - - start: Optional[date] = None - - -class DomainHistoryListResponseItem(BaseModel): - categorizations: Optional[List[DomainHistoryListResponseItemCategorization]] = None - - domain: Optional[str] = None - - -DomainHistoryListResponse = List[DomainHistoryListResponseItem] diff --git a/src/cloudflare/types/load_balancers/__init__.py b/src/cloudflare/types/load_balancers/__init__.py index 5d9a91faf14..d621a6d9608 100644 --- a/src/cloudflare/types/load_balancers/__init__.py +++ b/src/cloudflare/types/load_balancers/__init__.py @@ -5,21 +5,21 @@ from .pool_edit_params import PoolEditParams as PoolEditParams from .pool_list_params import PoolListParams as PoolListParams from .pool_get_response import PoolGetResponse as PoolGetResponse +from .search_get_params import SearchGetParams as SearchGetParams from .pool_create_params import PoolCreateParams as PoolCreateParams from .pool_edit_response import PoolEditResponse as PoolEditResponse from .pool_list_response import PoolListResponse as PoolListResponse from .pool_update_params import PoolUpdateParams as PoolUpdateParams from .region_list_params import RegionListParams as RegionListParams -from .search_list_params import SearchListParams as SearchListParams from .monitor_edit_params import MonitorEditParams as MonitorEditParams from .region_get_response import RegionGetResponse as RegionGetResponse +from .search_get_response import SearchGetResponse as SearchGetResponse from .monitor_get_response import MonitorGetResponse as MonitorGetResponse from .pool_create_response import PoolCreateResponse as PoolCreateResponse from .pool_delete_response import PoolDeleteResponse as PoolDeleteResponse from .pool_update_response import PoolUpdateResponse as PoolUpdateResponse from .preview_get_response import PreviewGetResponse as PreviewGetResponse from .region_list_response import RegionListResponse as RegionListResponse -from .search_list_response import SearchListResponse as SearchListResponse from .monitor_create_params import MonitorCreateParams as MonitorCreateParams from .monitor_edit_response import MonitorEditResponse as MonitorEditResponse from .monitor_list_response import MonitorListResponse as MonitorListResponse diff --git a/src/cloudflare/types/load_balancers/monitors/__init__.py b/src/cloudflare/types/load_balancers/monitors/__init__.py index f98c5999a5f..182e123ca4f 100644 --- a/src/cloudflare/types/load_balancers/monitors/__init__.py +++ b/src/cloudflare/types/load_balancers/monitors/__init__.py @@ -3,5 +3,5 @@ from __future__ import annotations from .preview_create_params import PreviewCreateParams as PreviewCreateParams +from .reference_get_response import ReferenceGetResponse as ReferenceGetResponse from .preview_create_response import PreviewCreateResponse as PreviewCreateResponse -from .reference_list_response import ReferenceListResponse as ReferenceListResponse diff --git a/src/cloudflare/types/load_balancers/pools/reference_list_response.py b/src/cloudflare/types/load_balancers/monitors/reference_get_response.py similarity index 68% rename from src/cloudflare/types/load_balancers/pools/reference_list_response.py rename to src/cloudflare/types/load_balancers/monitors/reference_get_response.py index 28995211ff2..5c397cb297d 100644 --- a/src/cloudflare/types/load_balancers/pools/reference_list_response.py +++ b/src/cloudflare/types/load_balancers/monitors/reference_get_response.py @@ -5,10 +5,10 @@ from ...._models import BaseModel -__all__ = ["ReferenceListResponse", "ReferenceListResponseItem"] +__all__ = ["ReferenceGetResponse", "ReferenceGetResponseItem"] -class ReferenceListResponseItem(BaseModel): +class ReferenceGetResponseItem(BaseModel): reference_type: Optional[Literal["*", "referral", "referrer"]] = None resource_id: Optional[str] = None @@ -18,4 +18,4 @@ class ReferenceListResponseItem(BaseModel): resource_type: Optional[str] = None -ReferenceListResponse = List[ReferenceListResponseItem] +ReferenceGetResponse = List[ReferenceGetResponseItem] diff --git a/src/cloudflare/types/load_balancers/pools/__init__.py b/src/cloudflare/types/load_balancers/pools/__init__.py index 7ab7b160b7f..454bfecc889 100644 --- a/src/cloudflare/types/load_balancers/pools/__init__.py +++ b/src/cloudflare/types/load_balancers/pools/__init__.py @@ -5,4 +5,4 @@ from .health_get_response import HealthGetResponse as HealthGetResponse from .health_create_params import HealthCreateParams as HealthCreateParams from .health_create_response import HealthCreateResponse as HealthCreateResponse -from .reference_list_response import ReferenceListResponse as ReferenceListResponse +from .reference_get_response import ReferenceGetResponse as ReferenceGetResponse diff --git a/src/cloudflare/types/load_balancers/monitors/reference_list_response.py b/src/cloudflare/types/load_balancers/pools/reference_get_response.py similarity index 68% rename from src/cloudflare/types/load_balancers/monitors/reference_list_response.py rename to src/cloudflare/types/load_balancers/pools/reference_get_response.py index 28995211ff2..5c397cb297d 100644 --- a/src/cloudflare/types/load_balancers/monitors/reference_list_response.py +++ b/src/cloudflare/types/load_balancers/pools/reference_get_response.py @@ -5,10 +5,10 @@ from ...._models import BaseModel -__all__ = ["ReferenceListResponse", "ReferenceListResponseItem"] +__all__ = ["ReferenceGetResponse", "ReferenceGetResponseItem"] -class ReferenceListResponseItem(BaseModel): +class ReferenceGetResponseItem(BaseModel): reference_type: Optional[Literal["*", "referral", "referrer"]] = None resource_id: Optional[str] = None @@ -18,4 +18,4 @@ class ReferenceListResponseItem(BaseModel): resource_type: Optional[str] = None -ReferenceListResponse = List[ReferenceListResponseItem] +ReferenceGetResponse = List[ReferenceGetResponseItem] diff --git a/src/cloudflare/types/load_balancers/search_list_params.py b/src/cloudflare/types/load_balancers/search_get_params.py similarity index 83% rename from src/cloudflare/types/load_balancers/search_list_params.py rename to src/cloudflare/types/load_balancers/search_get_params.py index ba1165e8110..ebe2299ddd2 100644 --- a/src/cloudflare/types/load_balancers/search_list_params.py +++ b/src/cloudflare/types/load_balancers/search_get_params.py @@ -4,10 +4,10 @@ from typing_extensions import Literal, Required, TypedDict -__all__ = ["SearchListParams", "SearchParams"] +__all__ = ["SearchGetParams", "SearchParams"] -class SearchListParams(TypedDict, total=False): +class SearchGetParams(TypedDict, total=False): account_id: Required[str] """Identifier""" diff --git a/src/cloudflare/types/load_balancers/search_list_response.py b/src/cloudflare/types/load_balancers/search_get_response.py similarity index 54% rename from src/cloudflare/types/load_balancers/search_list_response.py rename to src/cloudflare/types/load_balancers/search_get_response.py index f6e20941be2..408d6082fc7 100644 --- a/src/cloudflare/types/load_balancers/search_list_response.py +++ b/src/cloudflare/types/load_balancers/search_get_response.py @@ -2,6 +2,6 @@ from typing import List -__all__ = ["SearchListResponse"] +__all__ = ["SearchGetResponse"] -SearchListResponse = List[object] +SearchGetResponse = List[object] diff --git a/src/cloudflare/types/logpush/datasets/__init__.py b/src/cloudflare/types/logpush/datasets/__init__.py index ddd022539d6..f44ac485654 100644 --- a/src/cloudflare/types/logpush/datasets/__init__.py +++ b/src/cloudflare/types/logpush/datasets/__init__.py @@ -2,4 +2,4 @@ from __future__ import annotations -from .job_list_response import JobListResponse as JobListResponse +from .job_get_response import JobGetResponse as JobGetResponse diff --git a/src/cloudflare/types/logpush/datasets/job_list_response.py b/src/cloudflare/types/logpush/datasets/job_get_response.py similarity index 94% rename from src/cloudflare/types/logpush/datasets/job_list_response.py rename to src/cloudflare/types/logpush/datasets/job_get_response.py index 71ae41ad6c3..b6bb129420e 100644 --- a/src/cloudflare/types/logpush/datasets/job_list_response.py +++ b/src/cloudflare/types/logpush/datasets/job_get_response.py @@ -8,10 +8,10 @@ from ...._models import BaseModel -__all__ = ["JobListResponse", "JobListResponseItem", "JobListResponseItemOutputOptions"] +__all__ = ["JobGetResponse", "JobGetResponseItem", "JobGetResponseItemOutputOptions"] -class JobListResponseItemOutputOptions(BaseModel): +class JobGetResponseItemOutputOptions(BaseModel): batch_prefix: Optional[str] = None """String to be prepended before each batch.""" @@ -73,7 +73,7 @@ class JobListResponseItemOutputOptions(BaseModel): """ -class JobListResponseItem(BaseModel): +class JobGetResponseItem(BaseModel): id: Optional[int] = None """Unique id of the job.""" @@ -138,11 +138,11 @@ class JobListResponseItem(BaseModel): the domain name, to make it easier to identify your job. """ - output_options: Optional[JobListResponseItemOutputOptions] = None + output_options: Optional[JobGetResponseItemOutputOptions] = None """The structured replacement for `logpull_options`. When including this field, the `logpull_option` field will be ignored. """ -JobListResponse = List[Optional[JobListResponseItem]] +JobGetResponse = List[Optional[JobGetResponseItem]] diff --git a/src/cloudflare/types/logs/controls/__init__.py b/src/cloudflare/types/logs/control/__init__.py similarity index 100% rename from src/cloudflare/types/logs/controls/__init__.py rename to src/cloudflare/types/logs/control/__init__.py diff --git a/src/cloudflare/types/logs/controls/cmb/__init__.py b/src/cloudflare/types/logs/control/cmb/__init__.py similarity index 100% rename from src/cloudflare/types/logs/controls/cmb/__init__.py rename to src/cloudflare/types/logs/control/cmb/__init__.py diff --git a/src/cloudflare/types/logs/controls/cmb/config_create_params.py b/src/cloudflare/types/logs/control/cmb/config_create_params.py similarity index 100% rename from src/cloudflare/types/logs/controls/cmb/config_create_params.py rename to src/cloudflare/types/logs/control/cmb/config_create_params.py diff --git a/src/cloudflare/types/logs/controls/cmb/config_create_response.py b/src/cloudflare/types/logs/control/cmb/config_create_response.py similarity index 100% rename from src/cloudflare/types/logs/controls/cmb/config_create_response.py rename to src/cloudflare/types/logs/control/cmb/config_create_response.py diff --git a/src/cloudflare/types/logs/controls/cmb/config_delete_response.py b/src/cloudflare/types/logs/control/cmb/config_delete_response.py similarity index 100% rename from src/cloudflare/types/logs/controls/cmb/config_delete_response.py rename to src/cloudflare/types/logs/control/cmb/config_delete_response.py diff --git a/src/cloudflare/types/logs/controls/cmb/config_get_response.py b/src/cloudflare/types/logs/control/cmb/config_get_response.py similarity index 100% rename from src/cloudflare/types/logs/controls/cmb/config_get_response.py rename to src/cloudflare/types/logs/control/cmb/config_get_response.py diff --git a/src/cloudflare/types/logs/controls/retentions/__init__.py b/src/cloudflare/types/logs/control/retention/__init__.py similarity index 58% rename from src/cloudflare/types/logs/controls/retentions/__init__.py rename to src/cloudflare/types/logs/control/retention/__init__.py index c0ab8a71f83..e352f41a428 100644 --- a/src/cloudflare/types/logs/controls/retentions/__init__.py +++ b/src/cloudflare/types/logs/control/retention/__init__.py @@ -2,8 +2,6 @@ from __future__ import annotations +from .flag_get_response import FlagGetResponse as FlagGetResponse from .flag_create_params import FlagCreateParams as FlagCreateParams from .flag_create_response import FlagCreateResponse as FlagCreateResponse -from .flag_logs_received_get_log_retention_flag_response import ( - FlagLogsReceivedGetLogRetentionFlagResponse as FlagLogsReceivedGetLogRetentionFlagResponse, -) diff --git a/src/cloudflare/types/logs/controls/retentions/flag_create_params.py b/src/cloudflare/types/logs/control/retention/flag_create_params.py similarity index 100% rename from src/cloudflare/types/logs/controls/retentions/flag_create_params.py rename to src/cloudflare/types/logs/control/retention/flag_create_params.py diff --git a/src/cloudflare/types/logs/controls/retentions/flag_create_response.py b/src/cloudflare/types/logs/control/retention/flag_create_response.py similarity index 100% rename from src/cloudflare/types/logs/controls/retentions/flag_create_response.py rename to src/cloudflare/types/logs/control/retention/flag_create_response.py diff --git a/src/cloudflare/types/logs/controls/retentions/flag_logs_received_get_log_retention_flag_response.py b/src/cloudflare/types/logs/control/retention/flag_get_response.py similarity index 56% rename from src/cloudflare/types/logs/controls/retentions/flag_logs_received_get_log_retention_flag_response.py rename to src/cloudflare/types/logs/control/retention/flag_get_response.py index 81c1bd1cf30..61bf0263988 100644 --- a/src/cloudflare/types/logs/controls/retentions/flag_logs_received_get_log_retention_flag_response.py +++ b/src/cloudflare/types/logs/control/retention/flag_get_response.py @@ -4,8 +4,8 @@ from ....._models import BaseModel -__all__ = ["FlagLogsReceivedGetLogRetentionFlagResponse"] +__all__ = ["FlagGetResponse"] -class FlagLogsReceivedGetLogRetentionFlagResponse(BaseModel): +class FlagGetResponse(BaseModel): flag: Optional[bool] = None diff --git a/src/cloudflare/types/logs/received/__init__.py b/src/cloudflare/types/logs/received/__init__.py index b96e1f0f7ff..038d3abedfb 100644 --- a/src/cloudflare/types/logs/received/__init__.py +++ b/src/cloudflare/types/logs/received/__init__.py @@ -2,4 +2,4 @@ from __future__ import annotations -from .field_list_response import FieldListResponse as FieldListResponse +from .field_get_response import FieldGetResponse as FieldGetResponse diff --git a/src/cloudflare/types/logs/received/field_list_response.py b/src/cloudflare/types/logs/received/field_get_response.py similarity index 68% rename from src/cloudflare/types/logs/received/field_list_response.py rename to src/cloudflare/types/logs/received/field_get_response.py index 7bf81158b59..6434bd8d560 100644 --- a/src/cloudflare/types/logs/received/field_list_response.py +++ b/src/cloudflare/types/logs/received/field_get_response.py @@ -4,8 +4,8 @@ from ...._models import BaseModel -__all__ = ["FieldListResponse"] +__all__ = ["FieldGetResponse"] -class FieldListResponse(BaseModel): +class FieldGetResponse(BaseModel): key: Optional[str] = None diff --git a/src/cloudflare/types/magic_network_monitoring/__init__.py b/src/cloudflare/types/magic_network_monitoring/__init__.py index e02d5a72498..c90963d1558 100644 --- a/src/cloudflare/types/magic_network_monitoring/__init__.py +++ b/src/cloudflare/types/magic_network_monitoring/__init__.py @@ -5,8 +5,8 @@ from .rule_get_response import RuleGetResponse as RuleGetResponse from .rule_edit_response import RuleEditResponse as RuleEditResponse from .rule_list_response import RuleListResponse as RuleListResponse +from .config_get_response import ConfigGetResponse as ConfigGetResponse from .config_edit_response import ConfigEditResponse as ConfigEditResponse -from .config_list_response import ConfigListResponse as ConfigListResponse from .rule_create_response import RuleCreateResponse as RuleCreateResponse from .rule_delete_response import RuleDeleteResponse as RuleDeleteResponse from .rule_update_response import RuleUpdateResponse as RuleUpdateResponse diff --git a/src/cloudflare/types/magic_network_monitoring/config_list_response.py b/src/cloudflare/types/magic_network_monitoring/config_get_response.py similarity index 84% rename from src/cloudflare/types/magic_network_monitoring/config_list_response.py rename to src/cloudflare/types/magic_network_monitoring/config_get_response.py index aa6762c481c..64c97398118 100644 --- a/src/cloudflare/types/magic_network_monitoring/config_list_response.py +++ b/src/cloudflare/types/magic_network_monitoring/config_get_response.py @@ -4,10 +4,10 @@ from ..._models import BaseModel -__all__ = ["ConfigListResponse"] +__all__ = ["ConfigGetResponse"] -class ConfigListResponse(BaseModel): +class ConfigGetResponse(BaseModel): default_sampling: float """Fallback sampling rate of flow messages being sent in packets per second. diff --git a/src/cloudflare/types/magic_network_monitoring/configs/__init__.py b/src/cloudflare/types/magic_network_monitoring/configs/__init__.py index 252d452d0ae..61a79f3b58e 100644 --- a/src/cloudflare/types/magic_network_monitoring/configs/__init__.py +++ b/src/cloudflare/types/magic_network_monitoring/configs/__init__.py @@ -2,4 +2,4 @@ from __future__ import annotations -from .full_list_response import FullListResponse as FullListResponse +from .full_get_response import FullGetResponse as FullGetResponse diff --git a/src/cloudflare/types/magic_network_monitoring/configs/full_list_response.py b/src/cloudflare/types/magic_network_monitoring/configs/full_get_response.py similarity index 85% rename from src/cloudflare/types/magic_network_monitoring/configs/full_list_response.py rename to src/cloudflare/types/magic_network_monitoring/configs/full_get_response.py index 344978cb5f7..b994c67d4dc 100644 --- a/src/cloudflare/types/magic_network_monitoring/configs/full_list_response.py +++ b/src/cloudflare/types/magic_network_monitoring/configs/full_get_response.py @@ -4,10 +4,10 @@ from ...._models import BaseModel -__all__ = ["FullListResponse"] +__all__ = ["FullGetResponse"] -class FullListResponse(BaseModel): +class FullGetResponse(BaseModel): default_sampling: float """Fallback sampling rate of flow messages being sent in packets per second. diff --git a/src/cloudflare/types/magic_transit/__init__.py b/src/cloudflare/types/magic_transit/__init__.py index 2972f00c670..17f6dc135fa 100644 --- a/src/cloudflare/types/magic_transit/__init__.py +++ b/src/cloudflare/types/magic_transit/__init__.py @@ -29,3 +29,4 @@ from .cf_interconnect_list_response import CfInterconnectListResponse as CfInterconnectListResponse from .cf_interconnect_update_params import CfInterconnectUpdateParams as CfInterconnectUpdateParams from .cf_interconnect_update_response import CfInterconnectUpdateResponse as CfInterconnectUpdateResponse +from .ipsec_tunnel_psk_generate_response import IPSECTunnelPSKGenerateResponse as IPSECTunnelPSKGenerateResponse diff --git a/src/cloudflare/types/magic_transit/ipsec_tunnels/psk_generate_create_response.py b/src/cloudflare/types/magic_transit/ipsec_tunnel_psk_generate_response.py similarity index 79% rename from src/cloudflare/types/magic_transit/ipsec_tunnels/psk_generate_create_response.py rename to src/cloudflare/types/magic_transit/ipsec_tunnel_psk_generate_response.py index f746e30bc72..d11f68b71b5 100644 --- a/src/cloudflare/types/magic_transit/ipsec_tunnels/psk_generate_create_response.py +++ b/src/cloudflare/types/magic_transit/ipsec_tunnel_psk_generate_response.py @@ -3,9 +3,9 @@ from typing import Optional from datetime import datetime -from ...._models import BaseModel +from ..._models import BaseModel -__all__ = ["PSKGenerateCreateResponse", "PSKMetadata"] +__all__ = ["IPSECTunnelPSKGenerateResponse", "PSKMetadata"] class PSKMetadata(BaseModel): @@ -13,7 +13,7 @@ class PSKMetadata(BaseModel): """The date and time the tunnel was last modified.""" -class PSKGenerateCreateResponse(BaseModel): +class IPSECTunnelPSKGenerateResponse(BaseModel): ipsec_tunnel_id: Optional[str] = None """Identifier""" diff --git a/src/cloudflare/types/magic_transit/ipsec_tunnels/__init__.py b/src/cloudflare/types/magic_transit/ipsec_tunnels/__init__.py deleted file mode 100644 index a33af2e440f..00000000000 --- a/src/cloudflare/types/magic_transit/ipsec_tunnels/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from __future__ import annotations - -from .psk_generate_create_response import PSKGenerateCreateResponse as PSKGenerateCreateResponse diff --git a/src/cloudflare/types/mtls_certificates/__init__.py b/src/cloudflare/types/mtls_certificates/__init__.py index 8cdbb4387cc..55fa54c266f 100644 --- a/src/cloudflare/types/mtls_certificates/__init__.py +++ b/src/cloudflare/types/mtls_certificates/__init__.py @@ -2,4 +2,4 @@ from __future__ import annotations -from .association_list_response import AssociationListResponse as AssociationListResponse +from .association_get_response import AssociationGetResponse as AssociationGetResponse diff --git a/src/cloudflare/types/mtls_certificates/association_list_response.py b/src/cloudflare/types/mtls_certificates/association_get_response.py similarity index 63% rename from src/cloudflare/types/mtls_certificates/association_list_response.py rename to src/cloudflare/types/mtls_certificates/association_get_response.py index e7d2adab57e..f4755c2ae18 100644 --- a/src/cloudflare/types/mtls_certificates/association_list_response.py +++ b/src/cloudflare/types/mtls_certificates/association_get_response.py @@ -4,10 +4,10 @@ from ..._models import BaseModel -__all__ = ["AssociationListResponse", "AssociationListResponseItem"] +__all__ = ["AssociationGetResponse", "AssociationGetResponseItem"] -class AssociationListResponseItem(BaseModel): +class AssociationGetResponseItem(BaseModel): service: Optional[str] = None """The service using the certificate.""" @@ -15,4 +15,4 @@ class AssociationListResponseItem(BaseModel): """Certificate deployment status for the given service.""" -AssociationListResponse = List[AssociationListResponseItem] +AssociationGetResponse = List[AssociationGetResponseItem] diff --git a/src/cloudflare/types/pages/projects/deployments/history/__init__.py b/src/cloudflare/types/pages/projects/deployments/history/__init__.py index 463d24eb0f9..85c25bc1dae 100644 --- a/src/cloudflare/types/pages/projects/deployments/history/__init__.py +++ b/src/cloudflare/types/pages/projects/deployments/history/__init__.py @@ -2,4 +2,4 @@ from __future__ import annotations -from .log_list_response import LogListResponse as LogListResponse +from .log_get_response import LogGetResponse as LogGetResponse diff --git a/src/cloudflare/types/pages/projects/deployments/history/log_list_response.py b/src/cloudflare/types/pages/projects/deployments/history/log_get_response.py similarity index 51% rename from src/cloudflare/types/pages/projects/deployments/history/log_list_response.py rename to src/cloudflare/types/pages/projects/deployments/history/log_get_response.py index 071f47e4597..a71783fc3cf 100644 --- a/src/cloudflare/types/pages/projects/deployments/history/log_list_response.py +++ b/src/cloudflare/types/pages/projects/deployments/history/log_get_response.py @@ -2,6 +2,6 @@ from typing import List, Union -__all__ = ["LogListResponse"] +__all__ = ["LogGetResponse"] -LogListResponse = Union[object, List[object], str] +LogGetResponse = Union[object, List[object], str] diff --git a/src/cloudflare/types/queues/__init__.py b/src/cloudflare/types/queues/__init__.py index 4ddee29ce31..8edcd7d5c96 100644 --- a/src/cloudflare/types/queues/__init__.py +++ b/src/cloudflare/types/queues/__init__.py @@ -2,8 +2,8 @@ from __future__ import annotations +from .consumer_get_response import ConsumerGetResponse as ConsumerGetResponse from .consumer_create_params import ConsumerCreateParams as ConsumerCreateParams -from .consumer_list_response import ConsumerListResponse as ConsumerListResponse from .consumer_update_params import ConsumerUpdateParams as ConsumerUpdateParams from .consumer_create_response import ConsumerCreateResponse as ConsumerCreateResponse from .consumer_delete_response import ConsumerDeleteResponse as ConsumerDeleteResponse diff --git a/src/cloudflare/types/queues/consumer_list_response.py b/src/cloudflare/types/queues/consumer_get_response.py similarity index 57% rename from src/cloudflare/types/queues/consumer_list_response.py rename to src/cloudflare/types/queues/consumer_get_response.py index 381a38dfb61..6ef673fdf4f 100644 --- a/src/cloudflare/types/queues/consumer_list_response.py +++ b/src/cloudflare/types/queues/consumer_get_response.py @@ -4,10 +4,10 @@ from ..._models import BaseModel -__all__ = ["ConsumerListResponse", "ConsumerListResponseItem", "ConsumerListResponseItemSettings"] +__all__ = ["ConsumerGetResponse", "ConsumerGetResponseItem", "ConsumerGetResponseItemSettings"] -class ConsumerListResponseItemSettings(BaseModel): +class ConsumerGetResponseItemSettings(BaseModel): batch_size: Optional[float] = None max_retries: Optional[float] = None @@ -15,7 +15,7 @@ class ConsumerListResponseItemSettings(BaseModel): max_wait_time_ms: Optional[float] = None -class ConsumerListResponseItem(BaseModel): +class ConsumerGetResponseItem(BaseModel): created_on: Optional[object] = None environment: Optional[object] = None @@ -24,7 +24,7 @@ class ConsumerListResponseItem(BaseModel): service: Optional[object] = None - settings: Optional[ConsumerListResponseItemSettings] = None + settings: Optional[ConsumerGetResponseItemSettings] = None -ConsumerListResponse = List[ConsumerListResponseItem] +ConsumerGetResponse = List[ConsumerGetResponseItem] diff --git a/src/cloudflare/types/request_tracers/__init__.py b/src/cloudflare/types/request_tracers/__init__.py index a4276d2691c..28cefb10359 100644 --- a/src/cloudflare/types/request_tracers/__init__.py +++ b/src/cloudflare/types/request_tracers/__init__.py @@ -3,4 +3,5 @@ from __future__ import annotations from .trace_create_params import TraceCreateParams as TraceCreateParams +from .request_tracer_trace import RequestTracerTrace as RequestTracerTrace from .trace_create_response import TraceCreateResponse as TraceCreateResponse diff --git a/src/cloudflare/types/request_tracers/request_tracer_trace.py b/src/cloudflare/types/request_tracers/request_tracer_trace.py new file mode 100644 index 00000000000..87a29f00220 --- /dev/null +++ b/src/cloudflare/types/request_tracers/request_tracer_trace.py @@ -0,0 +1,49 @@ +# File generated from our OpenAPI spec by Stainless. + +from __future__ import annotations + +from typing import List, Optional + +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel + +__all__ = ["RequestTracerTrace", "RequestTracerTraceItem"] + + +class RequestTracerTraceItem(BaseModel): + action: Optional[str] = None + """If step type is rule, then action performed by this rule""" + + action_parameters: Optional[object] = None + """If step type is rule, then action parameters of this rule as JSON""" + + description: Optional[str] = None + """If step type is rule or ruleset, the description of this entity""" + + expression: Optional[str] = None + """If step type is rule, then expression used to match for this rule""" + + kind: Optional[str] = None + """If step type is ruleset, then kind of this ruleset""" + + matched: Optional[bool] = None + """Whether tracing step affected tracing request/response""" + + name: Optional[str] = None + """If step type is ruleset, then name of this ruleset""" + + step_name: Optional[str] = None + """Tracing step identifying name""" + + trace: Optional[RequestTracerTrace] = None + + type: Optional[str] = None + """Tracing step type""" + + +RequestTracerTrace = List[RequestTracerTraceItem] + +if PYDANTIC_V2: + RequestTracerTraceItem.model_rebuild() +else: + RequestTracerTraceItem.update_forward_refs() # type: ignore diff --git a/src/cloudflare/types/request_tracers/trace_create_response.py b/src/cloudflare/types/request_tracers/trace_create_response.py index 801d9ed8ef7..3993e8fdcad 100644 --- a/src/cloudflare/types/request_tracers/trace_create_response.py +++ b/src/cloudflare/types/request_tracers/trace_create_response.py @@ -1,76 +1,25 @@ # File generated from our OpenAPI spec by Stainless. -from typing import List, Optional +from __future__ import annotations -from ..._models import BaseModel - -__all__ = ["TraceCreateResponse", "Trace", "TraceTrace"] - - -class TraceTrace(BaseModel): - action: Optional[str] = None - """If step type is rule, then action performed by this rule""" - - action_parameters: Optional[object] = None - """If step type is rule, then action parameters of this rule as JSON""" - - description: Optional[str] = None - """If step type is rule or ruleset, the description of this entity""" - - expression: Optional[str] = None - """If step type is rule, then expression used to match for this rule""" - - kind: Optional[str] = None - """If step type is ruleset, then kind of this ruleset""" - - matched: Optional[bool] = None - """Whether tracing step affected tracing request/response""" - - name: Optional[str] = None - """If step type is ruleset, then name of this ruleset""" - - step_name: Optional[str] = None - """Tracing step identifying name""" - - trace: Optional[object] = None - - type: Optional[str] = None - """Tracing step type""" +from typing import Optional +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel -class Trace(BaseModel): - action: Optional[str] = None - """If step type is rule, then action performed by this rule""" - - action_parameters: Optional[object] = None - """If step type is rule, then action parameters of this rule as JSON""" - - description: Optional[str] = None - """If step type is rule or ruleset, the description of this entity""" - - expression: Optional[str] = None - """If step type is rule, then expression used to match for this rule""" - - kind: Optional[str] = None - """If step type is ruleset, then kind of this ruleset""" - - matched: Optional[bool] = None - """Whether tracing step affected tracing request/response""" - - name: Optional[str] = None - """If step type is ruleset, then name of this ruleset""" - - step_name: Optional[str] = None - """Tracing step identifying name""" - - trace: Optional[List[TraceTrace]] = None - - type: Optional[str] = None - """Tracing step type""" +__all__ = ["TraceCreateResponse"] class TraceCreateResponse(BaseModel): status_code: Optional[int] = None """HTTP Status code of zone response""" - trace: Optional[List[Trace]] = None + trace: Optional["RequestTracerTrace"] = None + + +from .request_tracer_trace import RequestTracerTrace + +if PYDANTIC_V2: + TraceCreateResponse.model_rebuild() +else: + TraceCreateResponse.update_forward_refs() # type: ignore diff --git a/src/cloudflare/types/ssl/__init__.py b/src/cloudflare/types/ssl/__init__.py index a7d199f76f9..70d528e7512 100644 --- a/src/cloudflare/types/ssl/__init__.py +++ b/src/cloudflare/types/ssl/__init__.py @@ -4,12 +4,12 @@ from .analyze_create_params import AnalyzeCreateParams as AnalyzeCreateParams from .analyze_create_response import AnalyzeCreateResponse as AnalyzeCreateResponse +from .verification_get_params import VerificationGetParams as VerificationGetParams from .verification_edit_params import VerificationEditParams as VerificationEditParams -from .verification_list_params import VerificationListParams as VerificationListParams +from .verification_get_response import VerificationGetResponse as VerificationGetResponse from .verification_edit_response import VerificationEditResponse as VerificationEditResponse -from .verification_list_response import VerificationListResponse as VerificationListResponse +from .recommendation_get_response import RecommendationGetResponse as RecommendationGetResponse from .certificate_pack_list_params import CertificatePackListParams as CertificatePackListParams -from .recommendation_list_response import RecommendationListResponse as RecommendationListResponse from .certificate_pack_get_response import CertificatePackGetResponse as CertificatePackGetResponse from .certificate_pack_edit_response import CertificatePackEditResponse as CertificatePackEditResponse from .certificate_pack_list_response import CertificatePackListResponse as CertificatePackListResponse diff --git a/src/cloudflare/types/ssl/certificate_packs/__init__.py b/src/cloudflare/types/ssl/certificate_packs/__init__.py index 6fedb3d4220..a5cb69889c8 100644 --- a/src/cloudflare/types/ssl/certificate_packs/__init__.py +++ b/src/cloudflare/types/ssl/certificate_packs/__init__.py @@ -2,6 +2,6 @@ from __future__ import annotations +from .quota_get_response import QuotaGetResponse as QuotaGetResponse from .order_create_params import OrderCreateParams as OrderCreateParams -from .quota_list_response import QuotaListResponse as QuotaListResponse from .order_create_response import OrderCreateResponse as OrderCreateResponse diff --git a/src/cloudflare/types/ssl/certificate_packs/quota_list_response.py b/src/cloudflare/types/ssl/certificate_packs/quota_get_response.py similarity index 79% rename from src/cloudflare/types/ssl/certificate_packs/quota_list_response.py rename to src/cloudflare/types/ssl/certificate_packs/quota_get_response.py index 77022a402c1..86dc248e3c3 100644 --- a/src/cloudflare/types/ssl/certificate_packs/quota_list_response.py +++ b/src/cloudflare/types/ssl/certificate_packs/quota_get_response.py @@ -4,7 +4,7 @@ from ...._models import BaseModel -__all__ = ["QuotaListResponse", "Advanced"] +__all__ = ["QuotaGetResponse", "Advanced"] class Advanced(BaseModel): @@ -15,5 +15,5 @@ class Advanced(BaseModel): """Quantity Used.""" -class QuotaListResponse(BaseModel): +class QuotaGetResponse(BaseModel): advanced: Optional[Advanced] = None diff --git a/src/cloudflare/types/ssl/recommendation_list_response.py b/src/cloudflare/types/ssl/recommendation_get_response.py similarity index 81% rename from src/cloudflare/types/ssl/recommendation_list_response.py rename to src/cloudflare/types/ssl/recommendation_get_response.py index 918bfcb0f0b..55b5a746799 100644 --- a/src/cloudflare/types/ssl/recommendation_list_response.py +++ b/src/cloudflare/types/ssl/recommendation_get_response.py @@ -6,10 +6,10 @@ from ..._models import BaseModel -__all__ = ["RecommendationListResponse"] +__all__ = ["RecommendationGetResponse"] -class RecommendationListResponse(BaseModel): +class RecommendationGetResponse(BaseModel): id: Optional[str] = None """Identifier of a recommedation result.""" diff --git a/src/cloudflare/types/ssl/verification_list_params.py b/src/cloudflare/types/ssl/verification_get_params.py similarity index 74% rename from src/cloudflare/types/ssl/verification_list_params.py rename to src/cloudflare/types/ssl/verification_get_params.py index f86cf4336b4..c15fe5ec8f2 100644 --- a/src/cloudflare/types/ssl/verification_list_params.py +++ b/src/cloudflare/types/ssl/verification_get_params.py @@ -4,10 +4,10 @@ from typing_extensions import Literal, Required, TypedDict -__all__ = ["VerificationListParams"] +__all__ = ["VerificationGetParams"] -class VerificationListParams(TypedDict, total=False): +class VerificationGetParams(TypedDict, total=False): zone_id: Required[str] """Identifier""" diff --git a/src/cloudflare/types/ssl/verification_list_response.py b/src/cloudflare/types/ssl/verification_get_response.py similarity index 78% rename from src/cloudflare/types/ssl/verification_list_response.py rename to src/cloudflare/types/ssl/verification_get_response.py index 2d1d62a7baa..2f9e63c87a5 100644 --- a/src/cloudflare/types/ssl/verification_list_response.py +++ b/src/cloudflare/types/ssl/verification_get_response.py @@ -5,10 +5,10 @@ from ..._models import BaseModel -__all__ = ["VerificationListResponse", "VerificationListResponseItem", "VerificationListResponseItemVerificationInfo"] +__all__ = ["VerificationGetResponse", "VerificationGetResponseItem", "VerificationGetResponseItemVerificationInfo"] -class VerificationListResponseItemVerificationInfo(BaseModel): +class VerificationGetResponseItemVerificationInfo(BaseModel): record_name: Optional[Literal["record_name", "http_url", "cname", "txt_name"]] = None """Name of CNAME record.""" @@ -16,7 +16,7 @@ class VerificationListResponseItemVerificationInfo(BaseModel): """Target of CNAME record.""" -class VerificationListResponseItem(BaseModel): +class VerificationGetResponseItem(BaseModel): certificate_status: Literal[ "initializing", "authorizing", "active", "expired", "issuing", "timing_out", "pending_deployment" ] @@ -34,7 +34,7 @@ class VerificationListResponseItem(BaseModel): validation_method: Optional[Literal["http", "cname", "txt"]] = None """Validation method in use for a certificate pack order.""" - verification_info: Optional[VerificationListResponseItemVerificationInfo] = None + verification_info: Optional[VerificationGetResponseItemVerificationInfo] = None """Certificate's required verification information.""" verification_status: Optional[bool] = None @@ -47,4 +47,4 @@ class VerificationListResponseItem(BaseModel): """Method of verification.""" -VerificationListResponse = List[VerificationListResponseItem] +VerificationGetResponse = List[VerificationGetResponseItem] diff --git a/src/cloudflare/types/stream/__init__.py b/src/cloudflare/types/stream/__init__.py index b5ac8dd3ae9..968a170a8d3 100644 --- a/src/cloudflare/types/stream/__init__.py +++ b/src/cloudflare/types/stream/__init__.py @@ -2,22 +2,23 @@ from __future__ import annotations -from .key_list_response import KeyListResponse as KeyListResponse +from .key_get_response import KeyGetResponse as KeyGetResponse from .clip_create_params import ClipCreateParams as ClipCreateParams from .copy_create_params import CopyCreateParams as CopyCreateParams from .key_create_response import KeyCreateResponse as KeyCreateResponse from .key_delete_response import KeyDeleteResponse as KeyDeleteResponse from .token_create_params import TokenCreateParams as TokenCreateParams +from .caption_get_response import CaptionGetResponse as CaptionGetResponse from .clip_create_response import ClipCreateResponse as ClipCreateResponse from .copy_create_response import CopyCreateResponse as CopyCreateResponse from .webhook_get_response import WebhookGetResponse as WebhookGetResponse -from .caption_list_response import CaptionListResponse as CaptionListResponse from .caption_update_params import CaptionUpdateParams as CaptionUpdateParams +from .download_get_response import DownloadGetResponse as DownloadGetResponse from .token_create_response import TokenCreateResponse as TokenCreateResponse from .webhook_update_params import WebhookUpdateParams as WebhookUpdateParams -from .download_list_response import DownloadListResponse as DownloadListResponse from .live_input_list_params import LiveInputListParams as LiveInputListParams from .watermark_get_response import WatermarkGetResponse as WatermarkGetResponse +from .audio_track_copy_params import AudioTrackCopyParams as AudioTrackCopyParams from .audio_track_edit_params import AudioTrackEditParams as AudioTrackEditParams from .caption_delete_response import CaptionDeleteResponse as CaptionDeleteResponse from .caption_update_response import CaptionUpdateResponse as CaptionUpdateResponse @@ -26,20 +27,19 @@ from .watermark_list_response import WatermarkListResponse as WatermarkListResponse from .webhook_delete_response import WebhookDeleteResponse as WebhookDeleteResponse from .webhook_update_response import WebhookUpdateResponse as WebhookUpdateResponse +from .audio_track_get_response import AudioTrackGetResponse as AudioTrackGetResponse from .download_create_response import DownloadCreateResponse as DownloadCreateResponse from .download_delete_response import DownloadDeleteResponse as DownloadDeleteResponse from .live_input_create_params import LiveInputCreateParams as LiveInputCreateParams from .live_input_list_response import LiveInputListResponse as LiveInputListResponse from .live_input_update_params import LiveInputUpdateParams as LiveInputUpdateParams -from .audio_track_create_params import AudioTrackCreateParams as AudioTrackCreateParams +from .audio_track_copy_response import AudioTrackCopyResponse as AudioTrackCopyResponse from .audio_track_edit_response import AudioTrackEditResponse as AudioTrackEditResponse -from .audio_track_list_response import AudioTrackListResponse as AudioTrackListResponse from .watermark_create_response import WatermarkCreateResponse as WatermarkCreateResponse from .watermark_delete_response import WatermarkDeleteResponse as WatermarkDeleteResponse from .live_input_create_response import LiveInputCreateResponse as LiveInputCreateResponse from .live_input_update_response import LiveInputUpdateResponse as LiveInputUpdateResponse from .video_storage_usage_params import VideoStorageUsageParams as VideoStorageUsageParams -from .audio_track_create_response import AudioTrackCreateResponse as AudioTrackCreateResponse from .audio_track_delete_response import AudioTrackDeleteResponse as AudioTrackDeleteResponse from .direct_upload_create_params import DirectUploadCreateParams as DirectUploadCreateParams from .video_storage_usage_response import VideoStorageUsageResponse as VideoStorageUsageResponse diff --git a/src/cloudflare/types/stream/audio_track_create_params.py b/src/cloudflare/types/stream/audio_track_copy_params.py similarity index 87% rename from src/cloudflare/types/stream/audio_track_create_params.py rename to src/cloudflare/types/stream/audio_track_copy_params.py index 6d68b724ec8..4b2c48ebfe2 100644 --- a/src/cloudflare/types/stream/audio_track_create_params.py +++ b/src/cloudflare/types/stream/audio_track_copy_params.py @@ -4,10 +4,10 @@ from typing_extensions import Required, TypedDict -__all__ = ["AudioTrackCreateParams"] +__all__ = ["AudioTrackCopyParams"] -class AudioTrackCreateParams(TypedDict, total=False): +class AudioTrackCopyParams(TypedDict, total=False): account_id: Required[str] """The account identifier tag.""" diff --git a/src/cloudflare/types/stream/audio_track_create_response.py b/src/cloudflare/types/stream/audio_track_copy_response.py similarity index 88% rename from src/cloudflare/types/stream/audio_track_create_response.py rename to src/cloudflare/types/stream/audio_track_copy_response.py index fbe2b916f52..6704328c5d9 100644 --- a/src/cloudflare/types/stream/audio_track_create_response.py +++ b/src/cloudflare/types/stream/audio_track_copy_response.py @@ -5,10 +5,10 @@ from ..._models import BaseModel -__all__ = ["AudioTrackCreateResponse"] +__all__ = ["AudioTrackCopyResponse"] -class AudioTrackCreateResponse(BaseModel): +class AudioTrackCopyResponse(BaseModel): default: Optional[bool] = None """Denotes whether the audio track will be played by default in a player.""" diff --git a/src/cloudflare/types/stream/audio_track_list_response.py b/src/cloudflare/types/stream/audio_track_get_response.py similarity index 79% rename from src/cloudflare/types/stream/audio_track_list_response.py rename to src/cloudflare/types/stream/audio_track_get_response.py index adfc2130e51..64cdb2ac3ac 100644 --- a/src/cloudflare/types/stream/audio_track_list_response.py +++ b/src/cloudflare/types/stream/audio_track_get_response.py @@ -5,10 +5,10 @@ from ..._models import BaseModel -__all__ = ["AudioTrackListResponse", "AudioTrackListResponseItem"] +__all__ = ["AudioTrackGetResponse", "AudioTrackGetResponseItem"] -class AudioTrackListResponseItem(BaseModel): +class AudioTrackGetResponseItem(BaseModel): default: Optional[bool] = None """Denotes whether the audio track will be played by default in a player.""" @@ -25,4 +25,4 @@ class AudioTrackListResponseItem(BaseModel): """A Cloudflare-generated unique identifier for a media item.""" -AudioTrackListResponse = List[AudioTrackListResponseItem] +AudioTrackGetResponse = List[AudioTrackGetResponseItem] diff --git a/src/cloudflare/types/stream/caption_list_response.py b/src/cloudflare/types/stream/caption_get_response.py similarity index 66% rename from src/cloudflare/types/stream/caption_list_response.py rename to src/cloudflare/types/stream/caption_get_response.py index cf4c780c1a6..3b090bafdc0 100644 --- a/src/cloudflare/types/stream/caption_list_response.py +++ b/src/cloudflare/types/stream/caption_get_response.py @@ -4,10 +4,10 @@ from ..._models import BaseModel -__all__ = ["CaptionListResponse", "CaptionListResponseItem"] +__all__ = ["CaptionGetResponse", "CaptionGetResponseItem"] -class CaptionListResponseItem(BaseModel): +class CaptionGetResponseItem(BaseModel): label: Optional[str] = None """The language label displayed in the native language to users.""" @@ -15,4 +15,4 @@ class CaptionListResponseItem(BaseModel): """The language tag in BCP 47 format.""" -CaptionListResponse = List[CaptionListResponseItem] +CaptionGetResponse = List[CaptionGetResponseItem] diff --git a/src/cloudflare/types/stream/download_list_response.py b/src/cloudflare/types/stream/download_get_response.py similarity index 51% rename from src/cloudflare/types/stream/download_list_response.py rename to src/cloudflare/types/stream/download_get_response.py index 22a4aef552f..73ea8f57999 100644 --- a/src/cloudflare/types/stream/download_list_response.py +++ b/src/cloudflare/types/stream/download_get_response.py @@ -2,6 +2,6 @@ from typing import Union -__all__ = ["DownloadListResponse"] +__all__ = ["DownloadGetResponse"] -DownloadListResponse = Union[object, str] +DownloadGetResponse = Union[object, str] diff --git a/src/cloudflare/types/stream/key_list_response.py b/src/cloudflare/types/stream/key_get_response.py similarity index 69% rename from src/cloudflare/types/stream/key_list_response.py rename to src/cloudflare/types/stream/key_get_response.py index 1da12820ddb..1933ab9d1b4 100644 --- a/src/cloudflare/types/stream/key_list_response.py +++ b/src/cloudflare/types/stream/key_get_response.py @@ -5,10 +5,10 @@ from ..._models import BaseModel -__all__ = ["KeyListResponse", "KeyListResponseItem"] +__all__ = ["KeyGetResponse", "KeyGetResponseItem"] -class KeyListResponseItem(BaseModel): +class KeyGetResponseItem(BaseModel): id: Optional[str] = None """Identifier""" @@ -16,4 +16,4 @@ class KeyListResponseItem(BaseModel): """The date and time a signing key was created.""" -KeyListResponse = List[KeyListResponseItem] +KeyGetResponse = List[KeyGetResponseItem] diff --git a/src/cloudflare/types/user/__init__.py b/src/cloudflare/types/user/__init__.py index 21f25124704..4d780bf96fc 100644 --- a/src/cloudflare/types/user/__init__.py +++ b/src/cloudflare/types/user/__init__.py @@ -20,9 +20,9 @@ from .organization_list_params import OrganizationListParams as OrganizationListParams from .subscription_edit_params import SubscriptionEditParams as SubscriptionEditParams from .organization_get_response import OrganizationGetResponse as OrganizationGetResponse +from .subscription_get_response import SubscriptionGetResponse as SubscriptionGetResponse from .organization_list_response import OrganizationListResponse as OrganizationListResponse from .subscription_edit_response import SubscriptionEditResponse as SubscriptionEditResponse -from .subscription_list_response import SubscriptionListResponse as SubscriptionListResponse from .subscription_update_params import SubscriptionUpdateParams as SubscriptionUpdateParams from .organization_delete_response import OrganizationDeleteResponse as OrganizationDeleteResponse from .subscription_delete_response import SubscriptionDeleteResponse as SubscriptionDeleteResponse diff --git a/src/cloudflare/types/user/billing/__init__.py b/src/cloudflare/types/user/billing/__init__.py index 331dd35ff93..bb208e1fe8a 100644 --- a/src/cloudflare/types/user/billing/__init__.py +++ b/src/cloudflare/types/user/billing/__init__.py @@ -2,6 +2,6 @@ from __future__ import annotations -from .history_list_params import HistoryListParams as HistoryListParams -from .history_list_response import HistoryListResponse as HistoryListResponse -from .profile_list_response import ProfileListResponse as ProfileListResponse +from .history_get_params import HistoryGetParams as HistoryGetParams +from .history_get_response import HistoryGetResponse as HistoryGetResponse +from .profile_get_response import ProfileGetResponse as ProfileGetResponse diff --git a/src/cloudflare/types/user/billing/history_list_params.py b/src/cloudflare/types/user/billing/history_get_params.py similarity index 81% rename from src/cloudflare/types/user/billing/history_list_params.py rename to src/cloudflare/types/user/billing/history_get_params.py index ea90e2ff9db..11b795d6fa9 100644 --- a/src/cloudflare/types/user/billing/history_list_params.py +++ b/src/cloudflare/types/user/billing/history_get_params.py @@ -4,10 +4,10 @@ from typing_extensions import Literal, TypedDict -__all__ = ["HistoryListParams"] +__all__ = ["HistoryGetParams"] -class HistoryListParams(TypedDict, total=False): +class HistoryGetParams(TypedDict, total=False): order: Literal["type", "occured_at", "action"] """Field to order billing history by.""" diff --git a/src/cloudflare/types/user/billing/history_list_response.py b/src/cloudflare/types/user/billing/history_get_response.py similarity index 67% rename from src/cloudflare/types/user/billing/history_list_response.py rename to src/cloudflare/types/user/billing/history_get_response.py index 6a3eddea77a..1586a198f49 100644 --- a/src/cloudflare/types/user/billing/history_list_response.py +++ b/src/cloudflare/types/user/billing/history_get_response.py @@ -1,18 +1,18 @@ # File generated from our OpenAPI spec by Stainless. -from typing import Optional +from typing import List, Optional from datetime import datetime from ...._models import BaseModel -__all__ = ["HistoryListResponse", "Zone"] +__all__ = ["HistoryGetResponse", "HistoryGetResponseItem", "HistoryGetResponseItemZone"] -class Zone(BaseModel): +class HistoryGetResponseItemZone(BaseModel): name: Optional[object] = None -class HistoryListResponse(BaseModel): +class HistoryGetResponseItem(BaseModel): id: str """Billing item identifier tag.""" @@ -34,4 +34,7 @@ class HistoryListResponse(BaseModel): type: str """The billing item type.""" - zone: Zone + zone: HistoryGetResponseItemZone + + +HistoryGetResponse = List[HistoryGetResponseItem] diff --git a/src/cloudflare/types/user/billing/profile_get_response.py b/src/cloudflare/types/user/billing/profile_get_response.py new file mode 100644 index 00000000000..10f2191badc --- /dev/null +++ b/src/cloudflare/types/user/billing/profile_get_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. + +from typing import Union, Optional + +__all__ = ["ProfileGetResponse"] + +ProfileGetResponse = Union[Optional[object], Optional[str]] diff --git a/src/cloudflare/types/user/billing/profile_list_response.py b/src/cloudflare/types/user/billing/profile_list_response.py deleted file mode 100644 index 608c09c882c..00000000000 --- a/src/cloudflare/types/user/billing/profile_list_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from typing import Union, Optional - -__all__ = ["ProfileListResponse"] - -ProfileListResponse = Union[Optional[object], Optional[str]] diff --git a/src/cloudflare/types/user/subscription_list_response.py b/src/cloudflare/types/user/subscription_get_response.py similarity index 74% rename from src/cloudflare/types/user/subscription_list_response.py rename to src/cloudflare/types/user/subscription_get_response.py index 9a79ac6a5dd..44aa27e974c 100644 --- a/src/cloudflare/types/user/subscription_list_response.py +++ b/src/cloudflare/types/user/subscription_get_response.py @@ -7,21 +7,21 @@ from ..._models import BaseModel __all__ = [ - "SubscriptionListResponse", - "SubscriptionListResponseItem", - "SubscriptionListResponseItemApp", - "SubscriptionListResponseItemComponentValue", - "SubscriptionListResponseItemRatePlan", - "SubscriptionListResponseItemZone", + "SubscriptionGetResponse", + "SubscriptionGetResponseItem", + "SubscriptionGetResponseItemApp", + "SubscriptionGetResponseItemComponentValue", + "SubscriptionGetResponseItemRatePlan", + "SubscriptionGetResponseItemZone", ] -class SubscriptionListResponseItemApp(BaseModel): +class SubscriptionGetResponseItemApp(BaseModel): install_id: Optional[str] = None """app install id.""" -class SubscriptionListResponseItemComponentValue(BaseModel): +class SubscriptionGetResponseItemComponentValue(BaseModel): default: Optional[float] = None """The default amount assigned.""" @@ -35,7 +35,7 @@ class SubscriptionListResponseItemComponentValue(BaseModel): """The amount of the component value assigned.""" -class SubscriptionListResponseItemRatePlan(BaseModel): +class SubscriptionGetResponseItemRatePlan(BaseModel): id: Optional[object] = None """The ID of the rate plan.""" @@ -58,7 +58,7 @@ class SubscriptionListResponseItemRatePlan(BaseModel): """The list of sets this rate plan applies to.""" -class SubscriptionListResponseItemZone(BaseModel): +class SubscriptionGetResponseItemZone(BaseModel): id: Optional[str] = None """Identifier""" @@ -66,13 +66,13 @@ class SubscriptionListResponseItemZone(BaseModel): """The domain name""" -class SubscriptionListResponseItem(BaseModel): +class SubscriptionGetResponseItem(BaseModel): id: Optional[str] = None """Subscription identifier tag.""" - app: Optional[SubscriptionListResponseItemApp] = None + app: Optional[SubscriptionGetResponseItemApp] = None - component_values: Optional[List[SubscriptionListResponseItemComponentValue]] = None + component_values: Optional[List[SubscriptionGetResponseItemComponentValue]] = None """The list of add-ons subscribed to.""" currency: Optional[str] = None @@ -93,14 +93,14 @@ class SubscriptionListResponseItem(BaseModel): price: Optional[float] = None """The price of the subscription that will be billed, in US dollars.""" - rate_plan: Optional[SubscriptionListResponseItemRatePlan] = None + rate_plan: Optional[SubscriptionGetResponseItemRatePlan] = None """The rate plan applied to the subscription.""" state: Optional[Literal["Trial", "Provisioned", "Paid", "AwaitingPayment", "Cancelled", "Failed", "Expired"]] = None """The state that the subscription is in.""" - zone: Optional[SubscriptionListResponseItemZone] = None + zone: Optional[SubscriptionGetResponseItemZone] = None """A simple zone object. May have null properties if not a zone subscription.""" -SubscriptionListResponse = List[SubscriptionListResponseItem] +SubscriptionGetResponse = List[SubscriptionGetResponseItem] diff --git a/src/cloudflare/types/user_list_response.py b/src/cloudflare/types/user_get_response.py similarity index 50% rename from src/cloudflare/types/user_list_response.py rename to src/cloudflare/types/user_get_response.py index 8449efcb46b..48ea13817e3 100644 --- a/src/cloudflare/types/user_list_response.py +++ b/src/cloudflare/types/user_get_response.py @@ -2,6 +2,6 @@ from typing import Union, Optional -__all__ = ["UserListResponse"] +__all__ = ["UserGetResponse"] -UserListResponse = Union[Optional[object], Optional[str]] +UserGetResponse = Union[Optional[object], Optional[str]] diff --git a/src/cloudflare/types/web3/hostnames/ipfs_universal_paths/__init__.py b/src/cloudflare/types/web3/hostnames/ipfs_universal_paths/__init__.py index 38f8caf6db3..967058fab38 100644 --- a/src/cloudflare/types/web3/hostnames/ipfs_universal_paths/__init__.py +++ b/src/cloudflare/types/web3/hostnames/ipfs_universal_paths/__init__.py @@ -2,6 +2,6 @@ from __future__ import annotations -from .content_list_list_response import ContentListListResponse as ContentListListResponse +from .content_list_get_response import ContentListGetResponse as ContentListGetResponse from .content_list_update_params import ContentListUpdateParams as ContentListUpdateParams from .content_list_update_response import ContentListUpdateResponse as ContentListUpdateResponse diff --git a/src/cloudflare/types/web3/hostnames/ipfs_universal_paths/content_list_list_response.py b/src/cloudflare/types/web3/hostnames/ipfs_universal_paths/content_list_get_response.py similarity index 75% rename from src/cloudflare/types/web3/hostnames/ipfs_universal_paths/content_list_list_response.py rename to src/cloudflare/types/web3/hostnames/ipfs_universal_paths/content_list_get_response.py index a93c3461c1a..3759efde31e 100644 --- a/src/cloudflare/types/web3/hostnames/ipfs_universal_paths/content_list_list_response.py +++ b/src/cloudflare/types/web3/hostnames/ipfs_universal_paths/content_list_get_response.py @@ -5,9 +5,9 @@ from ....._models import BaseModel -__all__ = ["ContentListListResponse"] +__all__ = ["ContentListGetResponse"] -class ContentListListResponse(BaseModel): +class ContentListGetResponse(BaseModel): action: Optional[Literal["block"]] = None """Behavior of the content list.""" diff --git a/src/cloudflare/types/workers/deployments/__init__.py b/src/cloudflare/types/workers/deployments/__init__.py index 4f8dba04da8..45cc95b6139 100644 --- a/src/cloudflare/types/workers/deployments/__init__.py +++ b/src/cloudflare/types/workers/deployments/__init__.py @@ -3,4 +3,3 @@ from __future__ import annotations from .by_script_get_response import ByScriptGetResponse as ByScriptGetResponse -from .by_script_list_response import ByScriptListResponse as ByScriptListResponse diff --git a/src/cloudflare/types/workers/deployments/by_script_get_response.py b/src/cloudflare/types/workers/deployments/by_script_get_response.py index 518bcb07401..b94f6bc3785 100644 --- a/src/cloudflare/types/workers/deployments/by_script_get_response.py +++ b/src/cloudflare/types/workers/deployments/by_script_get_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. -from typing import Optional +from typing import List, Optional from ...._models import BaseModel @@ -8,10 +8,6 @@ class ByScriptGetResponse(BaseModel): - id: Optional[str] = None + items: Optional[List[object]] = None - metadata: Optional[object] = None - - number: Optional[float] = None - - resources: Optional[object] = None + latest: Optional[object] = None diff --git a/src/cloudflare/types/workers/deployments/by_script_list_response.py b/src/cloudflare/types/workers/deployments/by_script_list_response.py deleted file mode 100644 index 5c8ddd0606d..00000000000 --- a/src/cloudflare/types/workers/deployments/by_script_list_response.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from typing import List, Optional - -from ...._models import BaseModel - -__all__ = ["ByScriptListResponse"] - - -class ByScriptListResponse(BaseModel): - items: Optional[List[object]] = None - - latest: Optional[object] = None diff --git a/src/cloudflare/types/workers/deployments/by_scripts/__init__.py b/src/cloudflare/types/workers/deployments/by_scripts/__init__.py new file mode 100644 index 00000000000..288e4694540 --- /dev/null +++ b/src/cloudflare/types/workers/deployments/by_scripts/__init__.py @@ -0,0 +1,5 @@ +# File generated from our OpenAPI spec by Stainless. + +from __future__ import annotations + +from .detail_get_response import DetailGetResponse as DetailGetResponse diff --git a/src/cloudflare/types/workers/deployments/by_scripts/detail_get_response.py b/src/cloudflare/types/workers/deployments/by_scripts/detail_get_response.py new file mode 100644 index 00000000000..2982e5e3286 --- /dev/null +++ b/src/cloudflare/types/workers/deployments/by_scripts/detail_get_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. + +from typing import Optional + +from ....._models import BaseModel + +__all__ = ["DetailGetResponse"] + + +class DetailGetResponse(BaseModel): + id: Optional[str] = None + + metadata: Optional[object] = None + + number: Optional[float] = None + + resources: Optional[object] = None diff --git a/src/cloudflare/types/workers/scripts/__init__.py b/src/cloudflare/types/workers/scripts/__init__.py index ddae04fefb8..70cf5e1993c 100644 --- a/src/cloudflare/types/workers/scripts/__init__.py +++ b/src/cloudflare/types/workers/scripts/__init__.py @@ -2,15 +2,15 @@ from __future__ import annotations -from .tail_list_response import TailListResponse as TailListResponse +from .tail_get_response import TailGetResponse as TailGetResponse from .setting_edit_params import SettingEditParams as SettingEditParams +from .binding_get_response import BindingGetResponse as BindingGetResponse from .setting_get_response import SettingGetResponse as SettingGetResponse from .tail_create_response import TailCreateResponse as TailCreateResponse from .tail_delete_response import TailDeleteResponse as TailDeleteResponse -from .binding_list_response import BindingListResponse as BindingListResponse from .content_update_params import ContentUpdateParams as ContentUpdateParams +from .schedule_get_response import ScheduleGetResponse as ScheduleGetResponse from .setting_edit_response import SettingEditResponse as SettingEditResponse -from .schedule_list_response import ScheduleListResponse as ScheduleListResponse from .schedule_update_params import ScheduleUpdateParams as ScheduleUpdateParams from .content_update_response import ContentUpdateResponse as ContentUpdateResponse from .schedule_update_response import ScheduleUpdateResponse as ScheduleUpdateResponse diff --git a/src/cloudflare/types/workers/scripts/binding_list_response.py b/src/cloudflare/types/workers/scripts/binding_get_response.py similarity index 53% rename from src/cloudflare/types/workers/scripts/binding_list_response.py rename to src/cloudflare/types/workers/scripts/binding_get_response.py index 2412e2cbab9..fd22c68f655 100644 --- a/src/cloudflare/types/workers/scripts/binding_list_response.py +++ b/src/cloudflare/types/workers/scripts/binding_get_response.py @@ -6,14 +6,14 @@ from ...._models import BaseModel __all__ = [ - "BindingListResponse", - "BindingListResponseItem", - "BindingListResponseItemWorkersKVNamespaceBinding", - "BindingListResponseItemWorkersWasmModuleBinding", + "BindingGetResponse", + "BindingGetResponseItem", + "BindingGetResponseItemWorkersKVNamespaceBinding", + "BindingGetResponseItemWorkersWasmModuleBinding", ] -class BindingListResponseItemWorkersKVNamespaceBinding(BaseModel): +class BindingGetResponseItemWorkersKVNamespaceBinding(BaseModel): name: str """A JavaScript variable name for the binding.""" @@ -24,7 +24,7 @@ class BindingListResponseItemWorkersKVNamespaceBinding(BaseModel): """The class of resource that the binding provides.""" -class BindingListResponseItemWorkersWasmModuleBinding(BaseModel): +class BindingGetResponseItemWorkersWasmModuleBinding(BaseModel): name: str """A JavaScript variable name for the binding.""" @@ -32,8 +32,8 @@ class BindingListResponseItemWorkersWasmModuleBinding(BaseModel): """The class of resource that the binding provides.""" -BindingListResponseItem = Union[ - BindingListResponseItemWorkersKVNamespaceBinding, BindingListResponseItemWorkersWasmModuleBinding +BindingGetResponseItem = Union[ + BindingGetResponseItemWorkersKVNamespaceBinding, BindingGetResponseItemWorkersWasmModuleBinding ] -BindingListResponse = List[BindingListResponseItem] +BindingGetResponse = List[BindingGetResponseItem] diff --git a/src/cloudflare/types/workers/scripts/schedule_list_response.py b/src/cloudflare/types/workers/scripts/schedule_get_response.py similarity index 78% rename from src/cloudflare/types/workers/scripts/schedule_list_response.py rename to src/cloudflare/types/workers/scripts/schedule_get_response.py index a49eb627580..e237f295a91 100644 --- a/src/cloudflare/types/workers/scripts/schedule_list_response.py +++ b/src/cloudflare/types/workers/scripts/schedule_get_response.py @@ -4,7 +4,7 @@ from ...._models import BaseModel -__all__ = ["ScheduleListResponse", "Schedule"] +__all__ = ["ScheduleGetResponse", "Schedule"] class Schedule(BaseModel): @@ -15,5 +15,5 @@ class Schedule(BaseModel): modified_on: Optional[object] = None -class ScheduleListResponse(BaseModel): +class ScheduleGetResponse(BaseModel): schedules: Optional[List[Schedule]] = None diff --git a/src/cloudflare/types/workers/scripts/tail_list_response.py b/src/cloudflare/types/workers/scripts/tail_get_response.py similarity index 77% rename from src/cloudflare/types/workers/scripts/tail_list_response.py rename to src/cloudflare/types/workers/scripts/tail_get_response.py index 6be26c0142b..7ef99090249 100644 --- a/src/cloudflare/types/workers/scripts/tail_list_response.py +++ b/src/cloudflare/types/workers/scripts/tail_get_response.py @@ -4,10 +4,10 @@ from ...._models import BaseModel -__all__ = ["TailListResponse"] +__all__ = ["TailGetResponse"] -class TailListResponse(BaseModel): +class TailGetResponse(BaseModel): id: Optional[object] = None expires_at: Optional[object] = None diff --git a/src/cloudflare/types/zero_trust/access/users/__init__.py b/src/cloudflare/types/zero_trust/access/users/__init__.py index dc3927af54f..819887430fd 100644 --- a/src/cloudflare/types/zero_trust/access/users/__init__.py +++ b/src/cloudflare/types/zero_trust/access/users/__init__.py @@ -5,4 +5,4 @@ from .failed_login_list_response import FailedLoginListResponse as FailedLoginListResponse from .active_session_get_response import ActiveSessionGetResponse as ActiveSessionGetResponse from .active_session_list_response import ActiveSessionListResponse as ActiveSessionListResponse -from .last_seen_identity_list_response import LastSeenIdentityListResponse as LastSeenIdentityListResponse +from .last_seen_identity_get_response import LastSeenIdentityGetResponse as LastSeenIdentityGetResponse diff --git a/src/cloudflare/types/zero_trust/access/users/last_seen_identity_list_response.py b/src/cloudflare/types/zero_trust/access/users/last_seen_identity_get_response.py similarity index 95% rename from src/cloudflare/types/zero_trust/access/users/last_seen_identity_list_response.py rename to src/cloudflare/types/zero_trust/access/users/last_seen_identity_get_response.py index 7fdc617464b..2af2e5e4b25 100644 --- a/src/cloudflare/types/zero_trust/access/users/last_seen_identity_list_response.py +++ b/src/cloudflare/types/zero_trust/access/users/last_seen_identity_get_response.py @@ -7,7 +7,7 @@ from ....._models import BaseModel __all__ = [ - "LastSeenIdentityListResponse", + "LastSeenIdentityGetResponse", "DeviceSessions", "DevicePosture", "DevicePostureCheck", @@ -69,7 +69,7 @@ class MTLSAuth(BaseModel): cert_serial: Optional[str] = None -class LastSeenIdentityListResponse(BaseModel): +class LastSeenIdentityGetResponse(BaseModel): account_id: Optional[str] = None auth_status: Optional[str] = None diff --git a/src/cloudflare/types/zero_trust/tunnels/__init__.py b/src/cloudflare/types/zero_trust/tunnels/__init__.py index 1903849e30b..4ff9770ddf9 100644 --- a/src/cloudflare/types/zero_trust/tunnels/__init__.py +++ b/src/cloudflare/types/zero_trust/tunnels/__init__.py @@ -4,11 +4,11 @@ from .token_get_response import TokenGetResponse as TokenGetResponse from .connector_get_response import ConnectorGetResponse as ConnectorGetResponse +from .connection_get_response import ConnectionGetResponse as ConnectionGetResponse from .connection_delete_params import ConnectionDeleteParams as ConnectionDeleteParams -from .connection_list_response import ConnectionListResponse as ConnectionListResponse from .management_create_params import ManagementCreateParams as ManagementCreateParams +from .configuration_get_response import ConfigurationGetResponse as ConfigurationGetResponse from .connection_delete_response import ConnectionDeleteResponse as ConnectionDeleteResponse from .management_create_response import ManagementCreateResponse as ManagementCreateResponse -from .configuration_list_response import ConfigurationListResponse as ConfigurationListResponse from .configuration_update_params import ConfigurationUpdateParams as ConfigurationUpdateParams from .configuration_update_response import ConfigurationUpdateResponse as ConfigurationUpdateResponse diff --git a/src/cloudflare/types/zero_trust/tunnels/configuration_get_response.py b/src/cloudflare/types/zero_trust/tunnels/configuration_get_response.py new file mode 100644 index 00000000000..9bd6090e962 --- /dev/null +++ b/src/cloudflare/types/zero_trust/tunnels/configuration_get_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. + +from typing import List, Union + +__all__ = ["ConfigurationGetResponse"] + +ConfigurationGetResponse = Union[object, List[object], str] diff --git a/src/cloudflare/types/zero_trust/tunnels/configuration_list_response.py b/src/cloudflare/types/zero_trust/tunnels/configuration_list_response.py deleted file mode 100644 index d402f19f8bf..00000000000 --- a/src/cloudflare/types/zero_trust/tunnels/configuration_list_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from typing import List, Union - -__all__ = ["ConfigurationListResponse"] - -ConfigurationListResponse = Union[object, List[object], str] diff --git a/src/cloudflare/types/zero_trust/tunnels/connection_list_response.py b/src/cloudflare/types/zero_trust/tunnels/connection_get_response.py similarity index 85% rename from src/cloudflare/types/zero_trust/tunnels/connection_list_response.py rename to src/cloudflare/types/zero_trust/tunnels/connection_get_response.py index 81c417a4a44..7356073d2b2 100644 --- a/src/cloudflare/types/zero_trust/tunnels/connection_list_response.py +++ b/src/cloudflare/types/zero_trust/tunnels/connection_get_response.py @@ -5,10 +5,10 @@ from ...._models import BaseModel -__all__ = ["ConnectionListResponse", "ConnectionListResponseItem", "ConnectionListResponseItemConn"] +__all__ = ["ConnectionGetResponse", "ConnectionGetResponseItem", "ConnectionGetResponseItemConn"] -class ConnectionListResponseItemConn(BaseModel): +class ConnectionGetResponseItemConn(BaseModel): id: Optional[str] = None """UUID of the Cloudflare Tunnel connection.""" @@ -39,7 +39,7 @@ class ConnectionListResponseItemConn(BaseModel): """UUID of the Cloudflare Tunnel connection.""" -class ConnectionListResponseItem(BaseModel): +class ConnectionGetResponseItem(BaseModel): id: Optional[str] = None """UUID of the Cloudflare Tunnel connection.""" @@ -52,7 +52,7 @@ class ConnectionListResponseItem(BaseModel): Used internally to sync cloudflared with the Zero Trust dashboard. """ - conns: Optional[List[ConnectionListResponseItemConn]] = None + conns: Optional[List[ConnectionGetResponseItemConn]] = None """The Cloudflare Tunnel connections between your origin and Cloudflare's edge.""" features: Optional[List[str]] = None @@ -65,4 +65,4 @@ class ConnectionListResponseItem(BaseModel): """The cloudflared version used to establish this connection.""" -ConnectionListResponse = List[ConnectionListResponseItem] +ConnectionGetResponse = List[ConnectionGetResponseItem] diff --git a/src/cloudflare/types/zones/__init__.py b/src/cloudflare/types/zones/__init__.py index e1b31c56f34..69f617ee56a 100644 --- a/src/cloudflare/types/zones/__init__.py +++ b/src/cloudflare/types/zones/__init__.py @@ -8,8 +8,8 @@ from .setting_edit_params import SettingEditParams as SettingEditParams from .hold_create_response import HoldCreateResponse as HoldCreateResponse from .hold_delete_response import HoldDeleteResponse as HoldDeleteResponse +from .setting_get_response import SettingGetResponse as SettingGetResponse from .setting_edit_response import SettingEditResponse as SettingEditResponse -from .setting_list_response import SettingListResponse as SettingListResponse from .subscription_get_response import SubscriptionGetResponse as SubscriptionGetResponse from .subscription_create_params import SubscriptionCreateParams as SubscriptionCreateParams from .subscription_list_response import SubscriptionListResponse as SubscriptionListResponse diff --git a/src/cloudflare/types/zones/setting_list_response.py b/src/cloudflare/types/zones/setting_get_response.py similarity index 72% rename from src/cloudflare/types/zones/setting_list_response.py rename to src/cloudflare/types/zones/setting_get_response.py index 581ed6484f0..0659b2dfb15 100644 --- a/src/cloudflare/types/zones/setting_list_response.py +++ b/src/cloudflare/types/zones/setting_get_response.py @@ -7,72 +7,72 @@ from ..._models import BaseModel __all__ = [ - "SettingListResponse", - "SettingListResponseItem", - "SettingListResponseItemZones0rtt", - "SettingListResponseItemZonesAdvancedDDOS", - "SettingListResponseItemZonesAlwaysOnline", - "SettingListResponseItemZonesAlwaysUseHTTPS", - "SettingListResponseItemZonesAutomaticHTTPSRewrites", - "SettingListResponseItemZonesBrotli", - "SettingListResponseItemZonesBrowserCacheTTL", - "SettingListResponseItemZonesBrowserCheck", - "SettingListResponseItemZonesCacheLevel", - "SettingListResponseItemZonesChallengeTTL", - "SettingListResponseItemZonesCiphers", - "SettingListResponseItemZonesCnameFlattening", - "SettingListResponseItemZonesDevelopmentMode", - "SettingListResponseItemZonesEarlyHints", - "SettingListResponseItemZonesEdgeCacheTTL", - "SettingListResponseItemZonesEmailObfuscation", - "SettingListResponseItemZonesH2Prioritization", - "SettingListResponseItemZonesHotlinkProtection", - "SettingListResponseItemZonesHTTP2", - "SettingListResponseItemZonesHTTP3", - "SettingListResponseItemZonesImageResizing", - "SettingListResponseItemZonesIPGeolocation", - "SettingListResponseItemZonesIPV6", - "SettingListResponseItemZonesMaxUpload", - "SettingListResponseItemZonesMinTLSVersion", - "SettingListResponseItemZonesMinify", - "SettingListResponseItemZonesMinifyValue", - "SettingListResponseItemZonesMirage", - "SettingListResponseItemZonesMobileRedirect", - "SettingListResponseItemZonesMobileRedirectValue", - "SettingListResponseItemZonesNEL", - "SettingListResponseItemZonesNELValue", - "SettingListResponseItemZonesOpportunisticEncryption", - "SettingListResponseItemZonesOpportunisticOnion", - "SettingListResponseItemZonesOrangeToOrange", - "SettingListResponseItemZonesOriginErrorPagePassThru", - "SettingListResponseItemZonesPolish", - "SettingListResponseItemZonesPrefetchPreload", - "SettingListResponseItemZonesProxyReadTimeout", - "SettingListResponseItemZonesPseudoIPV4", - "SettingListResponseItemZonesResponseBuffering", - "SettingListResponseItemZonesRocketLoader", - "SettingListResponseItemZonesSchemasAutomaticPlatformOptimization", - "SettingListResponseItemZonesSchemasAutomaticPlatformOptimizationValue", - "SettingListResponseItemZonesSecurityHeader", - "SettingListResponseItemZonesSecurityHeaderValue", - "SettingListResponseItemZonesSecurityHeaderValueStrictTransportSecurity", - "SettingListResponseItemZonesSecurityLevel", - "SettingListResponseItemZonesServerSideExclude", - "SettingListResponseItemZonesSha1Support", - "SettingListResponseItemZonesSortQueryStringForCache", - "SettingListResponseItemZonesSSL", - "SettingListResponseItemZonesSSLRecommender", - "SettingListResponseItemZonesTLS1_2Only", - "SettingListResponseItemZonesTLS1_3", - "SettingListResponseItemZonesTLSClientAuth", - "SettingListResponseItemZonesTrueClientIPHeader", - "SettingListResponseItemZonesWAF", - "SettingListResponseItemZonesWebp", - "SettingListResponseItemZonesWebsockets", + "SettingGetResponse", + "SettingGetResponseItem", + "SettingGetResponseItemZones0rtt", + "SettingGetResponseItemZonesAdvancedDDOS", + "SettingGetResponseItemZonesAlwaysOnline", + "SettingGetResponseItemZonesAlwaysUseHTTPS", + "SettingGetResponseItemZonesAutomaticHTTPSRewrites", + "SettingGetResponseItemZonesBrotli", + "SettingGetResponseItemZonesBrowserCacheTTL", + "SettingGetResponseItemZonesBrowserCheck", + "SettingGetResponseItemZonesCacheLevel", + "SettingGetResponseItemZonesChallengeTTL", + "SettingGetResponseItemZonesCiphers", + "SettingGetResponseItemZonesCnameFlattening", + "SettingGetResponseItemZonesDevelopmentMode", + "SettingGetResponseItemZonesEarlyHints", + "SettingGetResponseItemZonesEdgeCacheTTL", + "SettingGetResponseItemZonesEmailObfuscation", + "SettingGetResponseItemZonesH2Prioritization", + "SettingGetResponseItemZonesHotlinkProtection", + "SettingGetResponseItemZonesHTTP2", + "SettingGetResponseItemZonesHTTP3", + "SettingGetResponseItemZonesImageResizing", + "SettingGetResponseItemZonesIPGeolocation", + "SettingGetResponseItemZonesIPV6", + "SettingGetResponseItemZonesMaxUpload", + "SettingGetResponseItemZonesMinTLSVersion", + "SettingGetResponseItemZonesMinify", + "SettingGetResponseItemZonesMinifyValue", + "SettingGetResponseItemZonesMirage", + "SettingGetResponseItemZonesMobileRedirect", + "SettingGetResponseItemZonesMobileRedirectValue", + "SettingGetResponseItemZonesNEL", + "SettingGetResponseItemZonesNELValue", + "SettingGetResponseItemZonesOpportunisticEncryption", + "SettingGetResponseItemZonesOpportunisticOnion", + "SettingGetResponseItemZonesOrangeToOrange", + "SettingGetResponseItemZonesOriginErrorPagePassThru", + "SettingGetResponseItemZonesPolish", + "SettingGetResponseItemZonesPrefetchPreload", + "SettingGetResponseItemZonesProxyReadTimeout", + "SettingGetResponseItemZonesPseudoIPV4", + "SettingGetResponseItemZonesResponseBuffering", + "SettingGetResponseItemZonesRocketLoader", + "SettingGetResponseItemZonesSchemasAutomaticPlatformOptimization", + "SettingGetResponseItemZonesSchemasAutomaticPlatformOptimizationValue", + "SettingGetResponseItemZonesSecurityHeader", + "SettingGetResponseItemZonesSecurityHeaderValue", + "SettingGetResponseItemZonesSecurityHeaderValueStrictTransportSecurity", + "SettingGetResponseItemZonesSecurityLevel", + "SettingGetResponseItemZonesServerSideExclude", + "SettingGetResponseItemZonesSha1Support", + "SettingGetResponseItemZonesSortQueryStringForCache", + "SettingGetResponseItemZonesSSL", + "SettingGetResponseItemZonesSSLRecommender", + "SettingGetResponseItemZonesTLS1_2Only", + "SettingGetResponseItemZonesTLS1_3", + "SettingGetResponseItemZonesTLSClientAuth", + "SettingGetResponseItemZonesTrueClientIPHeader", + "SettingGetResponseItemZonesWAF", + "SettingGetResponseItemZonesWebp", + "SettingGetResponseItemZonesWebsockets", ] -class SettingListResponseItemZones0rtt(BaseModel): +class SettingGetResponseItemZones0rtt(BaseModel): id: Literal["0rtt"] """ID of the zone setting.""" @@ -89,7 +89,7 @@ class SettingListResponseItemZones0rtt(BaseModel): """last time this setting was modified.""" -class SettingListResponseItemZonesAdvancedDDOS(BaseModel): +class SettingGetResponseItemZonesAdvancedDDOS(BaseModel): id: Literal["advanced_ddos"] """ID of the zone setting.""" @@ -106,7 +106,7 @@ class SettingListResponseItemZonesAdvancedDDOS(BaseModel): """last time this setting was modified.""" -class SettingListResponseItemZonesAlwaysOnline(BaseModel): +class SettingGetResponseItemZonesAlwaysOnline(BaseModel): id: Literal["always_online"] """ID of the zone setting.""" @@ -123,7 +123,7 @@ class SettingListResponseItemZonesAlwaysOnline(BaseModel): """last time this setting was modified.""" -class SettingListResponseItemZonesAlwaysUseHTTPS(BaseModel): +class SettingGetResponseItemZonesAlwaysUseHTTPS(BaseModel): id: Literal["always_use_https"] """ID of the zone setting.""" @@ -140,7 +140,7 @@ class SettingListResponseItemZonesAlwaysUseHTTPS(BaseModel): """last time this setting was modified.""" -class SettingListResponseItemZonesAutomaticHTTPSRewrites(BaseModel): +class SettingGetResponseItemZonesAutomaticHTTPSRewrites(BaseModel): id: Literal["automatic_https_rewrites"] """ID of the zone setting.""" @@ -157,7 +157,7 @@ class SettingListResponseItemZonesAutomaticHTTPSRewrites(BaseModel): """last time this setting was modified.""" -class SettingListResponseItemZonesBrotli(BaseModel): +class SettingGetResponseItemZonesBrotli(BaseModel): id: Literal["brotli"] """ID of the zone setting.""" @@ -174,7 +174,7 @@ class SettingListResponseItemZonesBrotli(BaseModel): """last time this setting was modified.""" -class SettingListResponseItemZonesBrowserCacheTTL(BaseModel): +class SettingGetResponseItemZonesBrowserCacheTTL(BaseModel): id: Literal["browser_cache_ttl"] """ID of the zone setting.""" @@ -220,7 +220,7 @@ class SettingListResponseItemZonesBrowserCacheTTL(BaseModel): """last time this setting was modified.""" -class SettingListResponseItemZonesBrowserCheck(BaseModel): +class SettingGetResponseItemZonesBrowserCheck(BaseModel): id: Literal["browser_check"] """ID of the zone setting.""" @@ -237,7 +237,7 @@ class SettingListResponseItemZonesBrowserCheck(BaseModel): """last time this setting was modified.""" -class SettingListResponseItemZonesCacheLevel(BaseModel): +class SettingGetResponseItemZonesCacheLevel(BaseModel): id: Literal["cache_level"] """ID of the zone setting.""" @@ -254,7 +254,7 @@ class SettingListResponseItemZonesCacheLevel(BaseModel): """last time this setting was modified.""" -class SettingListResponseItemZonesChallengeTTL(BaseModel): +class SettingGetResponseItemZonesChallengeTTL(BaseModel): id: Literal["challenge_ttl"] """ID of the zone setting.""" @@ -271,7 +271,7 @@ class SettingListResponseItemZonesChallengeTTL(BaseModel): """last time this setting was modified.""" -class SettingListResponseItemZonesCiphers(BaseModel): +class SettingGetResponseItemZonesCiphers(BaseModel): id: Literal["ciphers"] """ID of the zone setting.""" @@ -288,7 +288,7 @@ class SettingListResponseItemZonesCiphers(BaseModel): """last time this setting was modified.""" -class SettingListResponseItemZonesCnameFlattening(BaseModel): +class SettingGetResponseItemZonesCnameFlattening(BaseModel): id: Literal["cname_flattening"] """How to flatten the cname destination.""" @@ -305,7 +305,7 @@ class SettingListResponseItemZonesCnameFlattening(BaseModel): """last time this setting was modified.""" -class SettingListResponseItemZonesDevelopmentMode(BaseModel): +class SettingGetResponseItemZonesDevelopmentMode(BaseModel): id: Literal["development_mode"] """ID of the zone setting.""" @@ -329,7 +329,7 @@ class SettingListResponseItemZonesDevelopmentMode(BaseModel): """ -class SettingListResponseItemZonesEarlyHints(BaseModel): +class SettingGetResponseItemZonesEarlyHints(BaseModel): id: Literal["early_hints"] """ID of the zone setting.""" @@ -346,7 +346,7 @@ class SettingListResponseItemZonesEarlyHints(BaseModel): """last time this setting was modified.""" -class SettingListResponseItemZonesEdgeCacheTTL(BaseModel): +class SettingGetResponseItemZonesEdgeCacheTTL(BaseModel): id: Literal["edge_cache_ttl"] """ID of the zone setting.""" @@ -385,7 +385,7 @@ class SettingListResponseItemZonesEdgeCacheTTL(BaseModel): """last time this setting was modified.""" -class SettingListResponseItemZonesEmailObfuscation(BaseModel): +class SettingGetResponseItemZonesEmailObfuscation(BaseModel): id: Literal["email_obfuscation"] """ID of the zone setting.""" @@ -402,7 +402,7 @@ class SettingListResponseItemZonesEmailObfuscation(BaseModel): """last time this setting was modified.""" -class SettingListResponseItemZonesH2Prioritization(BaseModel): +class SettingGetResponseItemZonesH2Prioritization(BaseModel): id: Literal["h2_prioritization"] """ID of the zone setting.""" @@ -419,7 +419,7 @@ class SettingListResponseItemZonesH2Prioritization(BaseModel): """last time this setting was modified.""" -class SettingListResponseItemZonesHotlinkProtection(BaseModel): +class SettingGetResponseItemZonesHotlinkProtection(BaseModel): id: Literal["hotlink_protection"] """ID of the zone setting.""" @@ -436,7 +436,7 @@ class SettingListResponseItemZonesHotlinkProtection(BaseModel): """last time this setting was modified.""" -class SettingListResponseItemZonesHTTP2(BaseModel): +class SettingGetResponseItemZonesHTTP2(BaseModel): id: Literal["http2"] """ID of the zone setting.""" @@ -453,7 +453,7 @@ class SettingListResponseItemZonesHTTP2(BaseModel): """last time this setting was modified.""" -class SettingListResponseItemZonesHTTP3(BaseModel): +class SettingGetResponseItemZonesHTTP3(BaseModel): id: Literal["http3"] """ID of the zone setting.""" @@ -470,7 +470,7 @@ class SettingListResponseItemZonesHTTP3(BaseModel): """last time this setting was modified.""" -class SettingListResponseItemZonesImageResizing(BaseModel): +class SettingGetResponseItemZonesImageResizing(BaseModel): id: Literal["image_resizing"] """ID of the zone setting.""" @@ -487,7 +487,7 @@ class SettingListResponseItemZonesImageResizing(BaseModel): """last time this setting was modified.""" -class SettingListResponseItemZonesIPGeolocation(BaseModel): +class SettingGetResponseItemZonesIPGeolocation(BaseModel): id: Literal["ip_geolocation"] """ID of the zone setting.""" @@ -504,7 +504,7 @@ class SettingListResponseItemZonesIPGeolocation(BaseModel): """last time this setting was modified.""" -class SettingListResponseItemZonesIPV6(BaseModel): +class SettingGetResponseItemZonesIPV6(BaseModel): id: Literal["ipv6"] """ID of the zone setting.""" @@ -521,7 +521,7 @@ class SettingListResponseItemZonesIPV6(BaseModel): """last time this setting was modified.""" -class SettingListResponseItemZonesMaxUpload(BaseModel): +class SettingGetResponseItemZonesMaxUpload(BaseModel): id: Literal["max_upload"] """identifier of the zone setting.""" @@ -538,7 +538,7 @@ class SettingListResponseItemZonesMaxUpload(BaseModel): """last time this setting was modified.""" -class SettingListResponseItemZonesMinTLSVersion(BaseModel): +class SettingGetResponseItemZonesMinTLSVersion(BaseModel): id: Literal["min_tls_version"] """ID of the zone setting.""" @@ -555,7 +555,7 @@ class SettingListResponseItemZonesMinTLSVersion(BaseModel): """last time this setting was modified.""" -class SettingListResponseItemZonesMinifyValue(BaseModel): +class SettingGetResponseItemZonesMinifyValue(BaseModel): css: Optional[Literal["on", "off"]] = None """Automatically minify all CSS files for your website.""" @@ -566,11 +566,11 @@ class SettingListResponseItemZonesMinifyValue(BaseModel): """Automatically minify all JavaScript files for your website.""" -class SettingListResponseItemZonesMinify(BaseModel): +class SettingGetResponseItemZonesMinify(BaseModel): id: Literal["minify"] """Zone setting identifier.""" - value: SettingListResponseItemZonesMinifyValue + value: SettingGetResponseItemZonesMinifyValue """Current value of the zone setting.""" editable: Optional[Literal[True, False]] = None @@ -583,7 +583,7 @@ class SettingListResponseItemZonesMinify(BaseModel): """last time this setting was modified.""" -class SettingListResponseItemZonesMirage(BaseModel): +class SettingGetResponseItemZonesMirage(BaseModel): id: Literal["mirage"] """ID of the zone setting.""" @@ -600,7 +600,7 @@ class SettingListResponseItemZonesMirage(BaseModel): """last time this setting was modified.""" -class SettingListResponseItemZonesMobileRedirectValue(BaseModel): +class SettingGetResponseItemZonesMobileRedirectValue(BaseModel): mobile_subdomain: Optional[str] = None """ Which subdomain prefix you wish to redirect visitors on mobile devices to @@ -617,11 +617,11 @@ class SettingListResponseItemZonesMobileRedirectValue(BaseModel): """ -class SettingListResponseItemZonesMobileRedirect(BaseModel): +class SettingGetResponseItemZonesMobileRedirect(BaseModel): id: Literal["mobile_redirect"] """Identifier of the zone setting.""" - value: SettingListResponseItemZonesMobileRedirectValue + value: SettingGetResponseItemZonesMobileRedirectValue """Current value of the zone setting.""" editable: Optional[Literal[True, False]] = None @@ -634,15 +634,15 @@ class SettingListResponseItemZonesMobileRedirect(BaseModel): """last time this setting was modified.""" -class SettingListResponseItemZonesNELValue(BaseModel): +class SettingGetResponseItemZonesNELValue(BaseModel): enabled: Optional[bool] = None -class SettingListResponseItemZonesNEL(BaseModel): +class SettingGetResponseItemZonesNEL(BaseModel): id: Literal["nel"] """Zone setting identifier.""" - value: SettingListResponseItemZonesNELValue + value: SettingGetResponseItemZonesNELValue """Current value of the zone setting.""" editable: Optional[Literal[True, False]] = None @@ -655,7 +655,7 @@ class SettingListResponseItemZonesNEL(BaseModel): """last time this setting was modified.""" -class SettingListResponseItemZonesOpportunisticEncryption(BaseModel): +class SettingGetResponseItemZonesOpportunisticEncryption(BaseModel): id: Literal["opportunistic_encryption"] """ID of the zone setting.""" @@ -672,7 +672,7 @@ class SettingListResponseItemZonesOpportunisticEncryption(BaseModel): """last time this setting was modified.""" -class SettingListResponseItemZonesOpportunisticOnion(BaseModel): +class SettingGetResponseItemZonesOpportunisticOnion(BaseModel): id: Literal["opportunistic_onion"] """ID of the zone setting.""" @@ -689,7 +689,7 @@ class SettingListResponseItemZonesOpportunisticOnion(BaseModel): """last time this setting was modified.""" -class SettingListResponseItemZonesOrangeToOrange(BaseModel): +class SettingGetResponseItemZonesOrangeToOrange(BaseModel): id: Literal["orange_to_orange"] """ID of the zone setting.""" @@ -706,7 +706,7 @@ class SettingListResponseItemZonesOrangeToOrange(BaseModel): """last time this setting was modified.""" -class SettingListResponseItemZonesOriginErrorPagePassThru(BaseModel): +class SettingGetResponseItemZonesOriginErrorPagePassThru(BaseModel): id: Literal["origin_error_page_pass_thru"] """ID of the zone setting.""" @@ -723,7 +723,7 @@ class SettingListResponseItemZonesOriginErrorPagePassThru(BaseModel): """last time this setting was modified.""" -class SettingListResponseItemZonesPolish(BaseModel): +class SettingGetResponseItemZonesPolish(BaseModel): id: Literal["polish"] """ID of the zone setting.""" @@ -740,7 +740,7 @@ class SettingListResponseItemZonesPolish(BaseModel): """last time this setting was modified.""" -class SettingListResponseItemZonesPrefetchPreload(BaseModel): +class SettingGetResponseItemZonesPrefetchPreload(BaseModel): id: Literal["prefetch_preload"] """ID of the zone setting.""" @@ -757,7 +757,7 @@ class SettingListResponseItemZonesPrefetchPreload(BaseModel): """last time this setting was modified.""" -class SettingListResponseItemZonesProxyReadTimeout(BaseModel): +class SettingGetResponseItemZonesProxyReadTimeout(BaseModel): id: Literal["proxy_read_timeout"] """ID of the zone setting.""" @@ -774,7 +774,7 @@ class SettingListResponseItemZonesProxyReadTimeout(BaseModel): """last time this setting was modified.""" -class SettingListResponseItemZonesPseudoIPV4(BaseModel): +class SettingGetResponseItemZonesPseudoIPV4(BaseModel): id: Literal["pseudo_ipv4"] """Value of the Pseudo IPv4 setting.""" @@ -791,7 +791,7 @@ class SettingListResponseItemZonesPseudoIPV4(BaseModel): """last time this setting was modified.""" -class SettingListResponseItemZonesResponseBuffering(BaseModel): +class SettingGetResponseItemZonesResponseBuffering(BaseModel): id: Literal["response_buffering"] """ID of the zone setting.""" @@ -808,7 +808,7 @@ class SettingListResponseItemZonesResponseBuffering(BaseModel): """last time this setting was modified.""" -class SettingListResponseItemZonesRocketLoader(BaseModel): +class SettingGetResponseItemZonesRocketLoader(BaseModel): id: Literal["rocket_loader"] """ID of the zone setting.""" @@ -825,7 +825,7 @@ class SettingListResponseItemZonesRocketLoader(BaseModel): """last time this setting was modified.""" -class SettingListResponseItemZonesSchemasAutomaticPlatformOptimizationValue(BaseModel): +class SettingGetResponseItemZonesSchemasAutomaticPlatformOptimizationValue(BaseModel): cache_by_device_type: bool """ Indicates whether or not @@ -856,11 +856,11 @@ class SettingListResponseItemZonesSchemasAutomaticPlatformOptimizationValue(Base """ -class SettingListResponseItemZonesSchemasAutomaticPlatformOptimization(BaseModel): +class SettingGetResponseItemZonesSchemasAutomaticPlatformOptimization(BaseModel): id: Literal["automatic_platform_optimization"] """ID of the zone setting.""" - value: SettingListResponseItemZonesSchemasAutomaticPlatformOptimizationValue + value: SettingGetResponseItemZonesSchemasAutomaticPlatformOptimizationValue """Current value of the zone setting.""" editable: Optional[Literal[True, False]] = None @@ -873,7 +873,7 @@ class SettingListResponseItemZonesSchemasAutomaticPlatformOptimization(BaseModel """last time this setting was modified.""" -class SettingListResponseItemZonesSecurityHeaderValueStrictTransportSecurity(BaseModel): +class SettingGetResponseItemZonesSecurityHeaderValueStrictTransportSecurity(BaseModel): enabled: Optional[bool] = None """Whether or not strict transport security is enabled.""" @@ -887,16 +887,16 @@ class SettingListResponseItemZonesSecurityHeaderValueStrictTransportSecurity(Bas """Whether or not to include 'X-Content-Type-Options: nosniff' header.""" -class SettingListResponseItemZonesSecurityHeaderValue(BaseModel): - strict_transport_security: Optional[SettingListResponseItemZonesSecurityHeaderValueStrictTransportSecurity] = None +class SettingGetResponseItemZonesSecurityHeaderValue(BaseModel): + strict_transport_security: Optional[SettingGetResponseItemZonesSecurityHeaderValueStrictTransportSecurity] = None """Strict Transport Security.""" -class SettingListResponseItemZonesSecurityHeader(BaseModel): +class SettingGetResponseItemZonesSecurityHeader(BaseModel): id: Literal["security_header"] """ID of the zone's security header.""" - value: SettingListResponseItemZonesSecurityHeaderValue + value: SettingGetResponseItemZonesSecurityHeaderValue """Current value of the zone setting.""" editable: Optional[Literal[True, False]] = None @@ -909,7 +909,7 @@ class SettingListResponseItemZonesSecurityHeader(BaseModel): """last time this setting was modified.""" -class SettingListResponseItemZonesSecurityLevel(BaseModel): +class SettingGetResponseItemZonesSecurityLevel(BaseModel): id: Literal["security_level"] """ID of the zone setting.""" @@ -926,7 +926,7 @@ class SettingListResponseItemZonesSecurityLevel(BaseModel): """last time this setting was modified.""" -class SettingListResponseItemZonesServerSideExclude(BaseModel): +class SettingGetResponseItemZonesServerSideExclude(BaseModel): id: Literal["server_side_exclude"] """ID of the zone setting.""" @@ -943,7 +943,7 @@ class SettingListResponseItemZonesServerSideExclude(BaseModel): """last time this setting was modified.""" -class SettingListResponseItemZonesSha1Support(BaseModel): +class SettingGetResponseItemZonesSha1Support(BaseModel): id: Literal["sha1_support"] """Zone setting identifier.""" @@ -960,7 +960,7 @@ class SettingListResponseItemZonesSha1Support(BaseModel): """last time this setting was modified.""" -class SettingListResponseItemZonesSortQueryStringForCache(BaseModel): +class SettingGetResponseItemZonesSortQueryStringForCache(BaseModel): id: Literal["sort_query_string_for_cache"] """ID of the zone setting.""" @@ -977,7 +977,7 @@ class SettingListResponseItemZonesSortQueryStringForCache(BaseModel): """last time this setting was modified.""" -class SettingListResponseItemZonesSSL(BaseModel): +class SettingGetResponseItemZonesSSL(BaseModel): id: Literal["ssl"] """ID of the zone setting.""" @@ -994,7 +994,7 @@ class SettingListResponseItemZonesSSL(BaseModel): """last time this setting was modified.""" -class SettingListResponseItemZonesSSLRecommender(BaseModel): +class SettingGetResponseItemZonesSSLRecommender(BaseModel): id: Optional[Literal["ssl_recommender"]] = None """Enrollment value for SSL/TLS Recommender.""" @@ -1002,7 +1002,7 @@ class SettingListResponseItemZonesSSLRecommender(BaseModel): """ssl-recommender enrollment setting.""" -class SettingListResponseItemZonesTLS1_2Only(BaseModel): +class SettingGetResponseItemZonesTLS1_2Only(BaseModel): id: Literal["tls_1_2_only"] """Zone setting identifier.""" @@ -1019,7 +1019,7 @@ class SettingListResponseItemZonesTLS1_2Only(BaseModel): """last time this setting was modified.""" -class SettingListResponseItemZonesTLS1_3(BaseModel): +class SettingGetResponseItemZonesTLS1_3(BaseModel): id: Literal["tls_1_3"] """ID of the zone setting.""" @@ -1036,7 +1036,7 @@ class SettingListResponseItemZonesTLS1_3(BaseModel): """last time this setting was modified.""" -class SettingListResponseItemZonesTLSClientAuth(BaseModel): +class SettingGetResponseItemZonesTLSClientAuth(BaseModel): id: Literal["tls_client_auth"] """ID of the zone setting.""" @@ -1053,7 +1053,7 @@ class SettingListResponseItemZonesTLSClientAuth(BaseModel): """last time this setting was modified.""" -class SettingListResponseItemZonesTrueClientIPHeader(BaseModel): +class SettingGetResponseItemZonesTrueClientIPHeader(BaseModel): id: Literal["true_client_ip_header"] """ID of the zone setting.""" @@ -1070,7 +1070,7 @@ class SettingListResponseItemZonesTrueClientIPHeader(BaseModel): """last time this setting was modified.""" -class SettingListResponseItemZonesWAF(BaseModel): +class SettingGetResponseItemZonesWAF(BaseModel): id: Literal["waf"] """ID of the zone setting.""" @@ -1087,7 +1087,7 @@ class SettingListResponseItemZonesWAF(BaseModel): """last time this setting was modified.""" -class SettingListResponseItemZonesWebp(BaseModel): +class SettingGetResponseItemZonesWebp(BaseModel): id: Literal["webp"] """ID of the zone setting.""" @@ -1104,7 +1104,7 @@ class SettingListResponseItemZonesWebp(BaseModel): """last time this setting was modified.""" -class SettingListResponseItemZonesWebsockets(BaseModel): +class SettingGetResponseItemZonesWebsockets(BaseModel): id: Literal["websockets"] """ID of the zone setting.""" @@ -1121,61 +1121,61 @@ class SettingListResponseItemZonesWebsockets(BaseModel): """last time this setting was modified.""" -SettingListResponseItem = Union[ - SettingListResponseItemZones0rtt, - SettingListResponseItemZonesAdvancedDDOS, - SettingListResponseItemZonesAlwaysOnline, - SettingListResponseItemZonesAlwaysUseHTTPS, - SettingListResponseItemZonesAutomaticHTTPSRewrites, - SettingListResponseItemZonesBrotli, - SettingListResponseItemZonesBrowserCacheTTL, - SettingListResponseItemZonesBrowserCheck, - SettingListResponseItemZonesCacheLevel, - SettingListResponseItemZonesChallengeTTL, - SettingListResponseItemZonesCiphers, - SettingListResponseItemZonesCnameFlattening, - SettingListResponseItemZonesDevelopmentMode, - SettingListResponseItemZonesEarlyHints, - SettingListResponseItemZonesEdgeCacheTTL, - SettingListResponseItemZonesEmailObfuscation, - SettingListResponseItemZonesH2Prioritization, - SettingListResponseItemZonesHotlinkProtection, - SettingListResponseItemZonesHTTP2, - SettingListResponseItemZonesHTTP3, - SettingListResponseItemZonesImageResizing, - SettingListResponseItemZonesIPGeolocation, - SettingListResponseItemZonesIPV6, - SettingListResponseItemZonesMaxUpload, - SettingListResponseItemZonesMinTLSVersion, - SettingListResponseItemZonesMinify, - SettingListResponseItemZonesMirage, - SettingListResponseItemZonesMobileRedirect, - SettingListResponseItemZonesNEL, - SettingListResponseItemZonesOpportunisticEncryption, - SettingListResponseItemZonesOpportunisticOnion, - SettingListResponseItemZonesOrangeToOrange, - SettingListResponseItemZonesOriginErrorPagePassThru, - SettingListResponseItemZonesPolish, - SettingListResponseItemZonesPrefetchPreload, - SettingListResponseItemZonesProxyReadTimeout, - SettingListResponseItemZonesPseudoIPV4, - SettingListResponseItemZonesResponseBuffering, - SettingListResponseItemZonesRocketLoader, - SettingListResponseItemZonesSchemasAutomaticPlatformOptimization, - SettingListResponseItemZonesSecurityHeader, - SettingListResponseItemZonesSecurityLevel, - SettingListResponseItemZonesServerSideExclude, - SettingListResponseItemZonesSha1Support, - SettingListResponseItemZonesSortQueryStringForCache, - SettingListResponseItemZonesSSL, - SettingListResponseItemZonesSSLRecommender, - SettingListResponseItemZonesTLS1_2Only, - SettingListResponseItemZonesTLS1_3, - SettingListResponseItemZonesTLSClientAuth, - SettingListResponseItemZonesTrueClientIPHeader, - SettingListResponseItemZonesWAF, - SettingListResponseItemZonesWebp, - SettingListResponseItemZonesWebsockets, +SettingGetResponseItem = Union[ + SettingGetResponseItemZones0rtt, + SettingGetResponseItemZonesAdvancedDDOS, + SettingGetResponseItemZonesAlwaysOnline, + SettingGetResponseItemZonesAlwaysUseHTTPS, + SettingGetResponseItemZonesAutomaticHTTPSRewrites, + SettingGetResponseItemZonesBrotli, + SettingGetResponseItemZonesBrowserCacheTTL, + SettingGetResponseItemZonesBrowserCheck, + SettingGetResponseItemZonesCacheLevel, + SettingGetResponseItemZonesChallengeTTL, + SettingGetResponseItemZonesCiphers, + SettingGetResponseItemZonesCnameFlattening, + SettingGetResponseItemZonesDevelopmentMode, + SettingGetResponseItemZonesEarlyHints, + SettingGetResponseItemZonesEdgeCacheTTL, + SettingGetResponseItemZonesEmailObfuscation, + SettingGetResponseItemZonesH2Prioritization, + SettingGetResponseItemZonesHotlinkProtection, + SettingGetResponseItemZonesHTTP2, + SettingGetResponseItemZonesHTTP3, + SettingGetResponseItemZonesImageResizing, + SettingGetResponseItemZonesIPGeolocation, + SettingGetResponseItemZonesIPV6, + SettingGetResponseItemZonesMaxUpload, + SettingGetResponseItemZonesMinTLSVersion, + SettingGetResponseItemZonesMinify, + SettingGetResponseItemZonesMirage, + SettingGetResponseItemZonesMobileRedirect, + SettingGetResponseItemZonesNEL, + SettingGetResponseItemZonesOpportunisticEncryption, + SettingGetResponseItemZonesOpportunisticOnion, + SettingGetResponseItemZonesOrangeToOrange, + SettingGetResponseItemZonesOriginErrorPagePassThru, + SettingGetResponseItemZonesPolish, + SettingGetResponseItemZonesPrefetchPreload, + SettingGetResponseItemZonesProxyReadTimeout, + SettingGetResponseItemZonesPseudoIPV4, + SettingGetResponseItemZonesResponseBuffering, + SettingGetResponseItemZonesRocketLoader, + SettingGetResponseItemZonesSchemasAutomaticPlatformOptimization, + SettingGetResponseItemZonesSecurityHeader, + SettingGetResponseItemZonesSecurityLevel, + SettingGetResponseItemZonesServerSideExclude, + SettingGetResponseItemZonesSha1Support, + SettingGetResponseItemZonesSortQueryStringForCache, + SettingGetResponseItemZonesSSL, + SettingGetResponseItemZonesSSLRecommender, + SettingGetResponseItemZonesTLS1_2Only, + SettingGetResponseItemZonesTLS1_3, + SettingGetResponseItemZonesTLSClientAuth, + SettingGetResponseItemZonesTrueClientIPHeader, + SettingGetResponseItemZonesWAF, + SettingGetResponseItemZonesWebp, + SettingGetResponseItemZonesWebsockets, ] -SettingListResponse = List[SettingListResponseItem] +SettingGetResponse = List[SettingGetResponseItem] diff --git a/tests/api_resources/addressing/loa_documents/test_downloads.py b/tests/api_resources/addressing/loa_documents/test_downloads.py index 3a7f477c315..2be2d8435ba 100644 --- a/tests/api_resources/addressing/loa_documents/test_downloads.py +++ b/tests/api_resources/addressing/loa_documents/test_downloads.py @@ -18,8 +18,8 @@ class TestDownloads: @pytest.mark.skip() @parametrize - def test_method_list(self, client: Cloudflare) -> None: - download = client.addressing.loa_documents.downloads.list( + def test_method_get(self, client: Cloudflare) -> None: + download = client.addressing.loa_documents.downloads.get( "d933b1530bc56c9953cf8ce166da8004", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -27,8 +27,8 @@ def test_method_list(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.addressing.loa_documents.downloads.with_raw_response.list( + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.addressing.loa_documents.downloads.with_raw_response.get( "d933b1530bc56c9953cf8ce166da8004", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -40,8 +40,8 @@ def test_raw_response_list(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.addressing.loa_documents.downloads.with_streaming_response.list( + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.addressing.loa_documents.downloads.with_streaming_response.get( "d933b1530bc56c9953cf8ce166da8004", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: @@ -55,15 +55,15 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_path_params_list(self, client: Cloudflare) -> None: + def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.addressing.loa_documents.downloads.with_raw_response.list( + client.addressing.loa_documents.downloads.with_raw_response.get( "d933b1530bc56c9953cf8ce166da8004", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `loa_document_id` but received ''"): - client.addressing.loa_documents.downloads.with_raw_response.list( + client.addressing.loa_documents.downloads.with_raw_response.get( "", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -74,8 +74,8 @@ class TestAsyncDownloads: @pytest.mark.skip() @parametrize - async def test_method_list(self, async_client: AsyncCloudflare) -> None: - download = await async_client.addressing.loa_documents.downloads.list( + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + download = await async_client.addressing.loa_documents.downloads.get( "d933b1530bc56c9953cf8ce166da8004", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -83,8 +83,8 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip() @parametrize - async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.addressing.loa_documents.downloads.with_raw_response.list( + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.addressing.loa_documents.downloads.with_raw_response.get( "d933b1530bc56c9953cf8ce166da8004", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -96,8 +96,8 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip() @parametrize - async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.addressing.loa_documents.downloads.with_streaming_response.list( + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.addressing.loa_documents.downloads.with_streaming_response.get( "d933b1530bc56c9953cf8ce166da8004", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: @@ -111,15 +111,15 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N @pytest.mark.skip() @parametrize - async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.addressing.loa_documents.downloads.with_raw_response.list( + await async_client.addressing.loa_documents.downloads.with_raw_response.get( "d933b1530bc56c9953cf8ce166da8004", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `loa_document_id` but received ''"): - await async_client.addressing.loa_documents.downloads.with_raw_response.list( + await async_client.addressing.loa_documents.downloads.with_raw_response.get( "", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) diff --git a/tests/api_resources/cache/test_cache_reserve.py b/tests/api_resources/cache/test_cache_reserve.py index b2aaadd620a..b3fe174d410 100644 --- a/tests/api_resources/cache/test_cache_reserve.py +++ b/tests/api_resources/cache/test_cache_reserve.py @@ -10,8 +10,8 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.types.cache import ( + CacheReserveGetResponse, CacheReserveEditResponse, - CacheReserveListResponse, CacheReserveClearResponse, CacheReserveStatusResponse, ) @@ -22,48 +22,6 @@ class TestCacheReserve: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() - @parametrize - def test_method_list(self, client: Cloudflare) -> None: - cache_reserve = client.cache.cache_reserve.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(CacheReserveListResponse, cache_reserve, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.cache.cache_reserve.with_raw_response.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - cache_reserve = response.parse() - assert_matches_type(CacheReserveListResponse, cache_reserve, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.cache.cache_reserve.with_streaming_response.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - cache_reserve = response.parse() - assert_matches_type(CacheReserveListResponse, cache_reserve, 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 `zone_id` but received ''"): - client.cache.cache_reserve.with_raw_response.list( - zone_id="", - ) - @pytest.mark.skip() @parametrize def test_method_clear(self, client: Cloudflare) -> None: @@ -154,92 +112,92 @@ def test_path_params_edit(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_method_status(self, client: Cloudflare) -> None: - cache_reserve = client.cache.cache_reserve.status( + def test_method_get(self, client: Cloudflare) -> None: + cache_reserve = client.cache.cache_reserve.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(CacheReserveStatusResponse, cache_reserve, path=["response"]) + assert_matches_type(CacheReserveGetResponse, cache_reserve, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_status(self, client: Cloudflare) -> None: - response = client.cache.cache_reserve.with_raw_response.status( + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.cache.cache_reserve.with_raw_response.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" cache_reserve = response.parse() - assert_matches_type(CacheReserveStatusResponse, cache_reserve, path=["response"]) + assert_matches_type(CacheReserveGetResponse, cache_reserve, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_status(self, client: Cloudflare) -> None: - with client.cache.cache_reserve.with_streaming_response.status( + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.cache.cache_reserve.with_streaming_response.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" cache_reserve = response.parse() - assert_matches_type(CacheReserveStatusResponse, cache_reserve, path=["response"]) + assert_matches_type(CacheReserveGetResponse, cache_reserve, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - def test_path_params_status(self, client: Cloudflare) -> None: + def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - client.cache.cache_reserve.with_raw_response.status( + client.cache.cache_reserve.with_raw_response.get( zone_id="", ) - -class TestAsyncCacheReserve: - 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: - cache_reserve = await async_client.cache.cache_reserve.list( + def test_method_status(self, client: Cloudflare) -> None: + cache_reserve = client.cache.cache_reserve.status( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(CacheReserveListResponse, cache_reserve, path=["response"]) + assert_matches_type(CacheReserveStatusResponse, cache_reserve, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.cache.cache_reserve.with_raw_response.list( + def test_raw_response_status(self, client: Cloudflare) -> None: + response = client.cache.cache_reserve.with_raw_response.status( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - cache_reserve = await response.parse() - assert_matches_type(CacheReserveListResponse, cache_reserve, path=["response"]) + cache_reserve = response.parse() + assert_matches_type(CacheReserveStatusResponse, cache_reserve, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.cache.cache_reserve.with_streaming_response.list( + def test_streaming_response_status(self, client: Cloudflare) -> None: + with client.cache.cache_reserve.with_streaming_response.status( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - cache_reserve = await response.parse() - assert_matches_type(CacheReserveListResponse, cache_reserve, path=["response"]) + cache_reserve = response.parse() + assert_matches_type(CacheReserveStatusResponse, cache_reserve, 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: + def test_path_params_status(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - await async_client.cache.cache_reserve.with_raw_response.list( + client.cache.cache_reserve.with_raw_response.status( zone_id="", ) + +class TestAsyncCacheReserve: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize async def test_method_clear(self, async_client: AsyncCloudflare) -> None: @@ -328,6 +286,48 @@ async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: value="on", ) + @pytest.mark.skip() + @parametrize + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + cache_reserve = await async_client.cache.cache_reserve.get( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(CacheReserveGetResponse, cache_reserve, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.cache.cache_reserve.with_raw_response.get( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + cache_reserve = await response.parse() + assert_matches_type(CacheReserveGetResponse, cache_reserve, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.cache.cache_reserve.with_streaming_response.get( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + cache_reserve = await response.parse() + assert_matches_type(CacheReserveGetResponse, cache_reserve, 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 `zone_id` but received ''"): + await async_client.cache.cache_reserve.with_raw_response.get( + zone_id="", + ) + @pytest.mark.skip() @parametrize async def test_method_status(self, async_client: AsyncCloudflare) -> None: diff --git a/tests/api_resources/cache/test_variants.py b/tests/api_resources/cache/test_variants.py index 0c95d8a33ab..98dd8330bea 100644 --- a/tests/api_resources/cache/test_variants.py +++ b/tests/api_resources/cache/test_variants.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.cache import VariantEditResponse, VariantListResponse, VariantDeleteResponse +from cloudflare.types.cache import VariantGetResponse, VariantEditResponse, VariantDeleteResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -17,48 +17,6 @@ class TestVariants: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() - @parametrize - def test_method_list(self, client: Cloudflare) -> None: - variant = client.cache.variants.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(VariantListResponse, variant, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.cache.variants.with_raw_response.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - variant = response.parse() - assert_matches_type(VariantListResponse, variant, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.cache.variants.with_streaming_response.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - variant = response.parse() - assert_matches_type(VariantListResponse, variant, 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 `zone_id` but received ''"): - client.cache.variants.with_raw_response.list( - zone_id="", - ) - @pytest.mark.skip() @parametrize def test_method_delete(self, client: Cloudflare) -> None: @@ -168,52 +126,52 @@ def test_path_params_edit(self, client: Cloudflare) -> None: value={}, ) - -class TestAsyncVariants: - 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: - variant = await async_client.cache.variants.list( + def test_method_get(self, client: Cloudflare) -> None: + variant = client.cache.variants.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(VariantListResponse, variant, path=["response"]) + assert_matches_type(VariantGetResponse, variant, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.cache.variants.with_raw_response.list( + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.cache.variants.with_raw_response.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - variant = await response.parse() - assert_matches_type(VariantListResponse, variant, path=["response"]) + variant = response.parse() + assert_matches_type(VariantGetResponse, variant, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.cache.variants.with_streaming_response.list( + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.cache.variants.with_streaming_response.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - variant = await response.parse() - assert_matches_type(VariantListResponse, variant, path=["response"]) + variant = response.parse() + assert_matches_type(VariantGetResponse, variant, 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: + def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - await async_client.cache.variants.with_raw_response.list( + client.cache.variants.with_raw_response.get( zone_id="", ) + +class TestAsyncVariants: + 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: @@ -322,3 +280,45 @@ async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: zone_id="", value={}, ) + + @pytest.mark.skip() + @parametrize + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + variant = await async_client.cache.variants.get( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(VariantGetResponse, variant, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.cache.variants.with_raw_response.get( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + variant = await response.parse() + assert_matches_type(VariantGetResponse, variant, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.cache.variants.with_streaming_response.get( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + variant = await response.parse() + assert_matches_type(VariantGetResponse, variant, 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 `zone_id` but received ''"): + await async_client.cache.variants.with_raw_response.get( + zone_id="", + ) diff --git a/tests/api_resources/certificate_authorities/test_hostname_associations.py b/tests/api_resources/certificate_authorities/test_hostname_associations.py index 8f53f068526..32def09d040 100644 --- a/tests/api_resources/certificate_authorities/test_hostname_associations.py +++ b/tests/api_resources/certificate_authorities/test_hostname_associations.py @@ -10,7 +10,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.types.certificate_authorities import ( - HostnameAssociationListResponse, + HostnameAssociationGetResponse, HostnameAssociationUpdateResponse, ) @@ -74,52 +74,52 @@ def test_path_params_update(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_method_list(self, client: Cloudflare) -> None: - hostname_association = client.certificate_authorities.hostname_associations.list( + def test_method_get(self, client: Cloudflare) -> None: + hostname_association = client.certificate_authorities.hostname_associations.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(HostnameAssociationListResponse, hostname_association, path=["response"]) + assert_matches_type(HostnameAssociationGetResponse, hostname_association, path=["response"]) @pytest.mark.skip() @parametrize - def test_method_list_with_all_params(self, client: Cloudflare) -> None: - hostname_association = client.certificate_authorities.hostname_associations.list( + def test_method_get_with_all_params(self, client: Cloudflare) -> None: + hostname_association = client.certificate_authorities.hostname_associations.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", mtls_certificate_id="b2134436-2555-4acf-be5b-26c48136575e", ) - assert_matches_type(HostnameAssociationListResponse, hostname_association, path=["response"]) + assert_matches_type(HostnameAssociationGetResponse, hostname_association, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.certificate_authorities.hostname_associations.with_raw_response.list( + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.certificate_authorities.hostname_associations.with_raw_response.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" hostname_association = response.parse() - assert_matches_type(HostnameAssociationListResponse, hostname_association, path=["response"]) + assert_matches_type(HostnameAssociationGetResponse, hostname_association, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.certificate_authorities.hostname_associations.with_streaming_response.list( + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.certificate_authorities.hostname_associations.with_streaming_response.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" hostname_association = response.parse() - assert_matches_type(HostnameAssociationListResponse, hostname_association, path=["response"]) + assert_matches_type(HostnameAssociationGetResponse, hostname_association, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - def test_path_params_list(self, client: Cloudflare) -> None: + def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - client.certificate_authorities.hostname_associations.with_raw_response.list( + client.certificate_authorities.hostname_associations.with_raw_response.get( zone_id="", ) @@ -181,51 +181,51 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip() @parametrize - async def test_method_list(self, async_client: AsyncCloudflare) -> None: - hostname_association = await async_client.certificate_authorities.hostname_associations.list( + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + hostname_association = await async_client.certificate_authorities.hostname_associations.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(HostnameAssociationListResponse, hostname_association, path=["response"]) + assert_matches_type(HostnameAssociationGetResponse, hostname_association, path=["response"]) @pytest.mark.skip() @parametrize - async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: - hostname_association = await async_client.certificate_authorities.hostname_associations.list( + async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -> None: + hostname_association = await async_client.certificate_authorities.hostname_associations.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", mtls_certificate_id="b2134436-2555-4acf-be5b-26c48136575e", ) - assert_matches_type(HostnameAssociationListResponse, hostname_association, path=["response"]) + assert_matches_type(HostnameAssociationGetResponse, hostname_association, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.certificate_authorities.hostname_associations.with_raw_response.list( + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.certificate_authorities.hostname_associations.with_raw_response.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" hostname_association = await response.parse() - assert_matches_type(HostnameAssociationListResponse, hostname_association, path=["response"]) + assert_matches_type(HostnameAssociationGetResponse, hostname_association, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.certificate_authorities.hostname_associations.with_streaming_response.list( + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.certificate_authorities.hostname_associations.with_streaming_response.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" hostname_association = await response.parse() - assert_matches_type(HostnameAssociationListResponse, hostname_association, path=["response"]) + assert_matches_type(HostnameAssociationGetResponse, hostname_association, 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: + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - await async_client.certificate_authorities.hostname_associations.with_raw_response.list( + await async_client.certificate_authorities.hostname_associations.with_raw_response.get( zone_id="", ) diff --git a/tests/api_resources/dns/analytics/reports/test_bytimes.py b/tests/api_resources/dns/analytics/reports/test_bytimes.py index 4cf47f72cdb..8ed38784ac0 100644 --- a/tests/api_resources/dns/analytics/reports/test_bytimes.py +++ b/tests/api_resources/dns/analytics/reports/test_bytimes.py @@ -10,7 +10,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare._utils import parse_datetime -from cloudflare.types.dns.analytics.reports import BytimeListResponse +from cloudflare.types.dns.analytics.reports import BytimeGetResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -20,16 +20,16 @@ class TestBytimes: @pytest.mark.skip() @parametrize - def test_method_list(self, client: Cloudflare) -> None: - bytime = client.dns.analytics.reports.bytimes.list( + def test_method_get(self, client: Cloudflare) -> None: + bytime = client.dns.analytics.reports.bytimes.get( "023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(BytimeListResponse, bytime, path=["response"]) + assert_matches_type(BytimeGetResponse, bytime, path=["response"]) @pytest.mark.skip() @parametrize - def test_method_list_with_all_params(self, client: Cloudflare) -> None: - bytime = client.dns.analytics.reports.bytimes.list( + def test_method_get_with_all_params(self, client: Cloudflare) -> None: + bytime = client.dns.analytics.reports.bytimes.get( "023e105f4ecef8ad9ca31a8372d0c353", dimensions="queryType", filters="responseCode==NOERROR,queryType==A", @@ -40,39 +40,39 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: time_delta="hour", until=parse_datetime("2023-11-11T13:00:00Z"), ) - assert_matches_type(BytimeListResponse, bytime, path=["response"]) + assert_matches_type(BytimeGetResponse, bytime, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.dns.analytics.reports.bytimes.with_raw_response.list( + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.dns.analytics.reports.bytimes.with_raw_response.get( "023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" bytime = response.parse() - assert_matches_type(BytimeListResponse, bytime, path=["response"]) + assert_matches_type(BytimeGetResponse, bytime, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.dns.analytics.reports.bytimes.with_streaming_response.list( + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.dns.analytics.reports.bytimes.with_streaming_response.get( "023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" bytime = response.parse() - assert_matches_type(BytimeListResponse, bytime, path=["response"]) + assert_matches_type(BytimeGetResponse, bytime, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - def test_path_params_list(self, client: Cloudflare) -> None: + def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `identifier` but received ''"): - client.dns.analytics.reports.bytimes.with_raw_response.list( + client.dns.analytics.reports.bytimes.with_raw_response.get( "", ) @@ -82,16 +82,16 @@ class TestAsyncBytimes: @pytest.mark.skip() @parametrize - async def test_method_list(self, async_client: AsyncCloudflare) -> None: - bytime = await async_client.dns.analytics.reports.bytimes.list( + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + bytime = await async_client.dns.analytics.reports.bytimes.get( "023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(BytimeListResponse, bytime, path=["response"]) + assert_matches_type(BytimeGetResponse, bytime, path=["response"]) @pytest.mark.skip() @parametrize - async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: - bytime = await async_client.dns.analytics.reports.bytimes.list( + async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -> None: + bytime = await async_client.dns.analytics.reports.bytimes.get( "023e105f4ecef8ad9ca31a8372d0c353", dimensions="queryType", filters="responseCode==NOERROR,queryType==A", @@ -102,38 +102,38 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) time_delta="hour", until=parse_datetime("2023-11-11T13:00:00Z"), ) - assert_matches_type(BytimeListResponse, bytime, path=["response"]) + assert_matches_type(BytimeGetResponse, bytime, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.dns.analytics.reports.bytimes.with_raw_response.list( + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.dns.analytics.reports.bytimes.with_raw_response.get( "023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" bytime = await response.parse() - assert_matches_type(BytimeListResponse, bytime, path=["response"]) + assert_matches_type(BytimeGetResponse, bytime, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.dns.analytics.reports.bytimes.with_streaming_response.list( + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.dns.analytics.reports.bytimes.with_streaming_response.get( "023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" bytime = await response.parse() - assert_matches_type(BytimeListResponse, bytime, path=["response"]) + assert_matches_type(BytimeGetResponse, bytime, 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: + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `identifier` but received ''"): - await async_client.dns.analytics.reports.bytimes.with_raw_response.list( + await async_client.dns.analytics.reports.bytimes.with_raw_response.get( "", ) diff --git a/tests/api_resources/dns/analytics/test_reports.py b/tests/api_resources/dns/analytics/test_reports.py index ebee1da7141..124d42850e5 100644 --- a/tests/api_resources/dns/analytics/test_reports.py +++ b/tests/api_resources/dns/analytics/test_reports.py @@ -10,7 +10,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare._utils import parse_datetime -from cloudflare.types.dns.analytics import ReportListResponse +from cloudflare.types.dns.analytics import ReportGetResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -20,16 +20,16 @@ class TestReports: @pytest.mark.skip() @parametrize - def test_method_list(self, client: Cloudflare) -> None: - report = client.dns.analytics.reports.list( + def test_method_get(self, client: Cloudflare) -> None: + report = client.dns.analytics.reports.get( "023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(ReportListResponse, report, path=["response"]) + assert_matches_type(ReportGetResponse, report, path=["response"]) @pytest.mark.skip() @parametrize - def test_method_list_with_all_params(self, client: Cloudflare) -> None: - report = client.dns.analytics.reports.list( + def test_method_get_with_all_params(self, client: Cloudflare) -> None: + report = client.dns.analytics.reports.get( "023e105f4ecef8ad9ca31a8372d0c353", dimensions="queryType", filters="responseCode==NOERROR,queryType==A", @@ -39,39 +39,39 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: sort="+responseCode,-queryName", until=parse_datetime("2023-11-11T13:00:00Z"), ) - assert_matches_type(ReportListResponse, report, path=["response"]) + assert_matches_type(ReportGetResponse, report, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.dns.analytics.reports.with_raw_response.list( + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.dns.analytics.reports.with_raw_response.get( "023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" report = response.parse() - assert_matches_type(ReportListResponse, report, path=["response"]) + assert_matches_type(ReportGetResponse, report, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.dns.analytics.reports.with_streaming_response.list( + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.dns.analytics.reports.with_streaming_response.get( "023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" report = response.parse() - assert_matches_type(ReportListResponse, report, path=["response"]) + assert_matches_type(ReportGetResponse, report, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - def test_path_params_list(self, client: Cloudflare) -> None: + def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `identifier` but received ''"): - client.dns.analytics.reports.with_raw_response.list( + client.dns.analytics.reports.with_raw_response.get( "", ) @@ -81,16 +81,16 @@ class TestAsyncReports: @pytest.mark.skip() @parametrize - async def test_method_list(self, async_client: AsyncCloudflare) -> None: - report = await async_client.dns.analytics.reports.list( + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + report = await async_client.dns.analytics.reports.get( "023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(ReportListResponse, report, path=["response"]) + assert_matches_type(ReportGetResponse, report, path=["response"]) @pytest.mark.skip() @parametrize - async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: - report = await async_client.dns.analytics.reports.list( + async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -> None: + report = await async_client.dns.analytics.reports.get( "023e105f4ecef8ad9ca31a8372d0c353", dimensions="queryType", filters="responseCode==NOERROR,queryType==A", @@ -100,38 +100,38 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) sort="+responseCode,-queryName", until=parse_datetime("2023-11-11T13:00:00Z"), ) - assert_matches_type(ReportListResponse, report, path=["response"]) + assert_matches_type(ReportGetResponse, report, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.dns.analytics.reports.with_raw_response.list( + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.dns.analytics.reports.with_raw_response.get( "023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" report = await response.parse() - assert_matches_type(ReportListResponse, report, path=["response"]) + assert_matches_type(ReportGetResponse, report, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.dns.analytics.reports.with_streaming_response.list( + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.dns.analytics.reports.with_streaming_response.get( "023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" report = await response.parse() - assert_matches_type(ReportListResponse, report, path=["response"]) + assert_matches_type(ReportGetResponse, report, 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: + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `identifier` but received ''"): - await async_client.dns.analytics.reports.with_raw_response.list( + await async_client.dns.analytics.reports.with_raw_response.get( "", ) diff --git a/tests/api_resources/dns/firewall/analytics/reports/test_bytimes.py b/tests/api_resources/dns/firewall/analytics/reports/test_bytimes.py index 918de0b2fd2..4c6cdb52833 100644 --- a/tests/api_resources/dns/firewall/analytics/reports/test_bytimes.py +++ b/tests/api_resources/dns/firewall/analytics/reports/test_bytimes.py @@ -10,7 +10,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare._utils import parse_datetime -from cloudflare.types.dns.firewall.analytics.reports import BytimeListResponse +from cloudflare.types.dns.firewall.analytics.reports import BytimeGetResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -20,17 +20,17 @@ class TestBytimes: @pytest.mark.skip() @parametrize - def test_method_list(self, client: Cloudflare) -> None: - bytime = client.dns.firewall.analytics.reports.bytimes.list( + def test_method_get(self, client: Cloudflare) -> None: + bytime = client.dns.firewall.analytics.reports.bytimes.get( "023e105f4ecef8ad9ca31a8372d0c353", account_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(BytimeListResponse, bytime, path=["response"]) + assert_matches_type(BytimeGetResponse, bytime, path=["response"]) @pytest.mark.skip() @parametrize - def test_method_list_with_all_params(self, client: Cloudflare) -> None: - bytime = client.dns.firewall.analytics.reports.bytimes.list( + def test_method_get_with_all_params(self, client: Cloudflare) -> None: + bytime = client.dns.firewall.analytics.reports.bytimes.get( "023e105f4ecef8ad9ca31a8372d0c353", account_identifier="023e105f4ecef8ad9ca31a8372d0c353", dimensions="queryType", @@ -42,12 +42,12 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: time_delta="hour", until=parse_datetime("2023-11-11T13:00:00Z"), ) - assert_matches_type(BytimeListResponse, bytime, path=["response"]) + assert_matches_type(BytimeGetResponse, bytime, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.dns.firewall.analytics.reports.bytimes.with_raw_response.list( + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.dns.firewall.analytics.reports.bytimes.with_raw_response.get( "023e105f4ecef8ad9ca31a8372d0c353", account_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -55,12 +55,12 @@ def test_raw_response_list(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" bytime = response.parse() - assert_matches_type(BytimeListResponse, bytime, path=["response"]) + assert_matches_type(BytimeGetResponse, bytime, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.dns.firewall.analytics.reports.bytimes.with_streaming_response.list( + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.dns.firewall.analytics.reports.bytimes.with_streaming_response.get( "023e105f4ecef8ad9ca31a8372d0c353", account_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) as response: @@ -68,21 +68,21 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" bytime = response.parse() - assert_matches_type(BytimeListResponse, bytime, path=["response"]) + assert_matches_type(BytimeGetResponse, bytime, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - def test_path_params_list(self, client: Cloudflare) -> None: + 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.dns.firewall.analytics.reports.bytimes.with_raw_response.list( + client.dns.firewall.analytics.reports.bytimes.with_raw_response.get( "023e105f4ecef8ad9ca31a8372d0c353", account_identifier="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `identifier` but received ''"): - client.dns.firewall.analytics.reports.bytimes.with_raw_response.list( + client.dns.firewall.analytics.reports.bytimes.with_raw_response.get( "", account_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -93,17 +93,17 @@ class TestAsyncBytimes: @pytest.mark.skip() @parametrize - async def test_method_list(self, async_client: AsyncCloudflare) -> None: - bytime = await async_client.dns.firewall.analytics.reports.bytimes.list( + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + bytime = await async_client.dns.firewall.analytics.reports.bytimes.get( "023e105f4ecef8ad9ca31a8372d0c353", account_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(BytimeListResponse, bytime, path=["response"]) + assert_matches_type(BytimeGetResponse, bytime, path=["response"]) @pytest.mark.skip() @parametrize - async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: - bytime = await async_client.dns.firewall.analytics.reports.bytimes.list( + async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -> None: + bytime = await async_client.dns.firewall.analytics.reports.bytimes.get( "023e105f4ecef8ad9ca31a8372d0c353", account_identifier="023e105f4ecef8ad9ca31a8372d0c353", dimensions="queryType", @@ -115,12 +115,12 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) time_delta="hour", until=parse_datetime("2023-11-11T13:00:00Z"), ) - assert_matches_type(BytimeListResponse, bytime, path=["response"]) + assert_matches_type(BytimeGetResponse, bytime, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.dns.firewall.analytics.reports.bytimes.with_raw_response.list( + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.dns.firewall.analytics.reports.bytimes.with_raw_response.get( "023e105f4ecef8ad9ca31a8372d0c353", account_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -128,12 +128,12 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" bytime = await response.parse() - assert_matches_type(BytimeListResponse, bytime, path=["response"]) + assert_matches_type(BytimeGetResponse, bytime, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.dns.firewall.analytics.reports.bytimes.with_streaming_response.list( + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.dns.firewall.analytics.reports.bytimes.with_streaming_response.get( "023e105f4ecef8ad9ca31a8372d0c353", account_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) as response: @@ -141,21 +141,21 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" bytime = await response.parse() - assert_matches_type(BytimeListResponse, bytime, path=["response"]) + assert_matches_type(BytimeGetResponse, bytime, 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: + 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.dns.firewall.analytics.reports.bytimes.with_raw_response.list( + await async_client.dns.firewall.analytics.reports.bytimes.with_raw_response.get( "023e105f4ecef8ad9ca31a8372d0c353", account_identifier="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `identifier` but received ''"): - await async_client.dns.firewall.analytics.reports.bytimes.with_raw_response.list( + await async_client.dns.firewall.analytics.reports.bytimes.with_raw_response.get( "", account_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) diff --git a/tests/api_resources/dns/firewall/analytics/test_reports.py b/tests/api_resources/dns/firewall/analytics/test_reports.py index d1ec24d7dbe..3672a21d41d 100644 --- a/tests/api_resources/dns/firewall/analytics/test_reports.py +++ b/tests/api_resources/dns/firewall/analytics/test_reports.py @@ -10,7 +10,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare._utils import parse_datetime -from cloudflare.types.dns.firewall.analytics import ReportListResponse +from cloudflare.types.dns.firewall.analytics import ReportGetResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -20,17 +20,17 @@ class TestReports: @pytest.mark.skip() @parametrize - def test_method_list(self, client: Cloudflare) -> None: - report = client.dns.firewall.analytics.reports.list( + def test_method_get(self, client: Cloudflare) -> None: + report = client.dns.firewall.analytics.reports.get( "023e105f4ecef8ad9ca31a8372d0c353", account_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(ReportListResponse, report, path=["response"]) + assert_matches_type(ReportGetResponse, report, path=["response"]) @pytest.mark.skip() @parametrize - def test_method_list_with_all_params(self, client: Cloudflare) -> None: - report = client.dns.firewall.analytics.reports.list( + def test_method_get_with_all_params(self, client: Cloudflare) -> None: + report = client.dns.firewall.analytics.reports.get( "023e105f4ecef8ad9ca31a8372d0c353", account_identifier="023e105f4ecef8ad9ca31a8372d0c353", dimensions="queryType", @@ -41,12 +41,12 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: sort="+responseCode,-queryName", until=parse_datetime("2023-11-11T13:00:00Z"), ) - assert_matches_type(ReportListResponse, report, path=["response"]) + assert_matches_type(ReportGetResponse, report, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.dns.firewall.analytics.reports.with_raw_response.list( + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.dns.firewall.analytics.reports.with_raw_response.get( "023e105f4ecef8ad9ca31a8372d0c353", account_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -54,12 +54,12 @@ def test_raw_response_list(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" report = response.parse() - assert_matches_type(ReportListResponse, report, path=["response"]) + assert_matches_type(ReportGetResponse, report, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.dns.firewall.analytics.reports.with_streaming_response.list( + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.dns.firewall.analytics.reports.with_streaming_response.get( "023e105f4ecef8ad9ca31a8372d0c353", account_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) as response: @@ -67,21 +67,21 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" report = response.parse() - assert_matches_type(ReportListResponse, report, path=["response"]) + assert_matches_type(ReportGetResponse, report, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - def test_path_params_list(self, client: Cloudflare) -> None: + 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.dns.firewall.analytics.reports.with_raw_response.list( + client.dns.firewall.analytics.reports.with_raw_response.get( "023e105f4ecef8ad9ca31a8372d0c353", account_identifier="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `identifier` but received ''"): - client.dns.firewall.analytics.reports.with_raw_response.list( + client.dns.firewall.analytics.reports.with_raw_response.get( "", account_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -92,17 +92,17 @@ class TestAsyncReports: @pytest.mark.skip() @parametrize - async def test_method_list(self, async_client: AsyncCloudflare) -> None: - report = await async_client.dns.firewall.analytics.reports.list( + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + report = await async_client.dns.firewall.analytics.reports.get( "023e105f4ecef8ad9ca31a8372d0c353", account_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(ReportListResponse, report, path=["response"]) + assert_matches_type(ReportGetResponse, report, path=["response"]) @pytest.mark.skip() @parametrize - async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: - report = await async_client.dns.firewall.analytics.reports.list( + async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -> None: + report = await async_client.dns.firewall.analytics.reports.get( "023e105f4ecef8ad9ca31a8372d0c353", account_identifier="023e105f4ecef8ad9ca31a8372d0c353", dimensions="queryType", @@ -113,12 +113,12 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) sort="+responseCode,-queryName", until=parse_datetime("2023-11-11T13:00:00Z"), ) - assert_matches_type(ReportListResponse, report, path=["response"]) + assert_matches_type(ReportGetResponse, report, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.dns.firewall.analytics.reports.with_raw_response.list( + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.dns.firewall.analytics.reports.with_raw_response.get( "023e105f4ecef8ad9ca31a8372d0c353", account_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -126,12 +126,12 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" report = await response.parse() - assert_matches_type(ReportListResponse, report, path=["response"]) + assert_matches_type(ReportGetResponse, report, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.dns.firewall.analytics.reports.with_streaming_response.list( + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.dns.firewall.analytics.reports.with_streaming_response.get( "023e105f4ecef8ad9ca31a8372d0c353", account_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) as response: @@ -139,21 +139,21 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" report = await response.parse() - assert_matches_type(ReportListResponse, report, path=["response"]) + assert_matches_type(ReportGetResponse, report, 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: + 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.dns.firewall.analytics.reports.with_raw_response.list( + await async_client.dns.firewall.analytics.reports.with_raw_response.get( "023e105f4ecef8ad9ca31a8372d0c353", account_identifier="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `identifier` but received ''"): - await async_client.dns.firewall.analytics.reports.with_raw_response.list( + await async_client.dns.firewall.analytics.reports.with_raw_response.get( "", account_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) diff --git a/tests/api_resources/email_routing/routing/test_addresses.py b/tests/api_resources/email_routing/routing/test_addresses.py index d943aa4fda7..093c74dc14f 100644 --- a/tests/api_resources/email_routing/routing/test_addresses.py +++ b/tests/api_resources/email_routing/routing/test_addresses.py @@ -3,17 +3,18 @@ from __future__ import annotations import os -from typing import Any, Optional, cast +from typing import Any, cast import pytest from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type +from cloudflare.pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray from cloudflare.types.email_routing.routing import ( AddressGetResponse, + AddressListResponse, AddressCreateResponse, AddressDeleteResponse, - AddressEmailRoutingDestinationAddressesListDestinationAddressesResponse, ) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -70,134 +71,110 @@ def test_path_params_create(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_method_delete(self, client: Cloudflare) -> None: - address = client.email_routing.routing.addresses.delete( - "ea95132c15732412d22c1476fa83f27a", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", + def test_method_list(self, client: Cloudflare) -> None: + address = client.email_routing.routing.addresses.list( + "023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AddressDeleteResponse, address, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[AddressListResponse], address, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_delete(self, client: Cloudflare) -> None: - response = client.email_routing.routing.addresses.with_raw_response.delete( - "ea95132c15732412d22c1476fa83f27a", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", + def test_method_list_with_all_params(self, client: Cloudflare) -> None: + address = client.email_routing.routing.addresses.list( + "023e105f4ecef8ad9ca31a8372d0c353", + direction="asc", + page=1, + per_page=5, + verified=True, + ) + assert_matches_type(SyncV4PagePaginationArray[AddressListResponse], address, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_list(self, client: Cloudflare) -> None: + response = client.email_routing.routing.addresses.with_raw_response.list( + "023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" address = response.parse() - assert_matches_type(AddressDeleteResponse, address, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[AddressListResponse], address, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_delete(self, client: Cloudflare) -> None: - with client.email_routing.routing.addresses.with_streaming_response.delete( - "ea95132c15732412d22c1476fa83f27a", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", + def test_streaming_response_list(self, client: Cloudflare) -> None: + with client.email_routing.routing.addresses.with_streaming_response.list( + "023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" address = response.parse() - assert_matches_type(AddressDeleteResponse, address, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[AddressListResponse], address, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - def test_path_params_delete(self, client: Cloudflare) -> None: + 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.email_routing.routing.addresses.with_raw_response.delete( - "ea95132c15732412d22c1476fa83f27a", - account_identifier="", - ) - - with pytest.raises( - ValueError, match=r"Expected a non-empty value for `destination_address_identifier` but received ''" - ): - client.email_routing.routing.addresses.with_raw_response.delete( + client.email_routing.routing.addresses.with_raw_response.list( "", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) @pytest.mark.skip() @parametrize - def test_method_email_routing_destination_addresses_list_destination_addresses(self, client: Cloudflare) -> None: - address = client.email_routing.routing.addresses.email_routing_destination_addresses_list_destination_addresses( - "023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type( - Optional[AddressEmailRoutingDestinationAddressesListDestinationAddressesResponse], - address, - path=["response"], - ) - - @pytest.mark.skip() - @parametrize - def test_method_email_routing_destination_addresses_list_destination_addresses_with_all_params( - self, client: Cloudflare - ) -> None: - address = client.email_routing.routing.addresses.email_routing_destination_addresses_list_destination_addresses( - "023e105f4ecef8ad9ca31a8372d0c353", - direction="asc", - page=1, - per_page=5, - verified=True, - ) - assert_matches_type( - Optional[AddressEmailRoutingDestinationAddressesListDestinationAddressesResponse], - address, - path=["response"], + def test_method_delete(self, client: Cloudflare) -> None: + address = client.email_routing.routing.addresses.delete( + "ea95132c15732412d22c1476fa83f27a", + account_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) + assert_matches_type(AddressDeleteResponse, address, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_email_routing_destination_addresses_list_destination_addresses( - self, client: Cloudflare - ) -> None: - response = client.email_routing.routing.addresses.with_raw_response.email_routing_destination_addresses_list_destination_addresses( - "023e105f4ecef8ad9ca31a8372d0c353", + def test_raw_response_delete(self, client: Cloudflare) -> None: + response = client.email_routing.routing.addresses.with_raw_response.delete( + "ea95132c15732412d22c1476fa83f27a", + account_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" address = response.parse() - assert_matches_type( - Optional[AddressEmailRoutingDestinationAddressesListDestinationAddressesResponse], - address, - path=["response"], - ) + assert_matches_type(AddressDeleteResponse, address, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_email_routing_destination_addresses_list_destination_addresses( - self, client: Cloudflare - ) -> None: - with client.email_routing.routing.addresses.with_streaming_response.email_routing_destination_addresses_list_destination_addresses( - "023e105f4ecef8ad9ca31a8372d0c353", + def test_streaming_response_delete(self, client: Cloudflare) -> None: + with client.email_routing.routing.addresses.with_streaming_response.delete( + "ea95132c15732412d22c1476fa83f27a", + account_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" address = response.parse() - assert_matches_type( - Optional[AddressEmailRoutingDestinationAddressesListDestinationAddressesResponse], - address, - path=["response"], - ) + assert_matches_type(AddressDeleteResponse, address, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - def test_path_params_email_routing_destination_addresses_list_destination_addresses( - self, client: Cloudflare - ) -> None: + 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.email_routing.routing.addresses.with_raw_response.email_routing_destination_addresses_list_destination_addresses( + client.email_routing.routing.addresses.with_raw_response.delete( + "ea95132c15732412d22c1476fa83f27a", + account_identifier="", + ) + + with pytest.raises( + ValueError, match=r"Expected a non-empty value for `destination_address_identifier` but received ''" + ): + client.email_routing.routing.addresses.with_raw_response.delete( "", + account_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) @pytest.mark.skip() @@ -306,136 +283,110 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip() @parametrize - async def test_method_delete(self, async_client: AsyncCloudflare) -> None: - address = await async_client.email_routing.routing.addresses.delete( - "ea95132c15732412d22c1476fa83f27a", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", + async def test_method_list(self, async_client: AsyncCloudflare) -> None: + address = await async_client.email_routing.routing.addresses.list( + "023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AddressDeleteResponse, address, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[AddressListResponse], address, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: - response = await async_client.email_routing.routing.addresses.with_raw_response.delete( - "ea95132c15732412d22c1476fa83f27a", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", + async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: + address = await async_client.email_routing.routing.addresses.list( + "023e105f4ecef8ad9ca31a8372d0c353", + direction="asc", + page=1, + per_page=5, + verified=True, + ) + assert_matches_type(AsyncV4PagePaginationArray[AddressListResponse], address, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: + response = await async_client.email_routing.routing.addresses.with_raw_response.list( + "023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" address = await response.parse() - assert_matches_type(AddressDeleteResponse, address, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[AddressListResponse], address, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: - async with async_client.email_routing.routing.addresses.with_streaming_response.delete( - "ea95132c15732412d22c1476fa83f27a", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", + async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: + async with async_client.email_routing.routing.addresses.with_streaming_response.list( + "023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" address = await response.parse() - assert_matches_type(AddressDeleteResponse, address, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[AddressListResponse], address, 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: + 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.email_routing.routing.addresses.with_raw_response.delete( - "ea95132c15732412d22c1476fa83f27a", - account_identifier="", - ) - - with pytest.raises( - ValueError, match=r"Expected a non-empty value for `destination_address_identifier` but received ''" - ): - await async_client.email_routing.routing.addresses.with_raw_response.delete( + await async_client.email_routing.routing.addresses.with_raw_response.list( "", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) @pytest.mark.skip() @parametrize - async def test_method_email_routing_destination_addresses_list_destination_addresses( - self, async_client: AsyncCloudflare - ) -> None: - address = await async_client.email_routing.routing.addresses.email_routing_destination_addresses_list_destination_addresses( - "023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type( - Optional[AddressEmailRoutingDestinationAddressesListDestinationAddressesResponse], - address, - path=["response"], - ) - - @pytest.mark.skip() - @parametrize - async def test_method_email_routing_destination_addresses_list_destination_addresses_with_all_params( - self, async_client: AsyncCloudflare - ) -> None: - address = await async_client.email_routing.routing.addresses.email_routing_destination_addresses_list_destination_addresses( - "023e105f4ecef8ad9ca31a8372d0c353", - direction="asc", - page=1, - per_page=5, - verified=True, - ) - assert_matches_type( - Optional[AddressEmailRoutingDestinationAddressesListDestinationAddressesResponse], - address, - path=["response"], + async def test_method_delete(self, async_client: AsyncCloudflare) -> None: + address = await async_client.email_routing.routing.addresses.delete( + "ea95132c15732412d22c1476fa83f27a", + account_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) + assert_matches_type(AddressDeleteResponse, address, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_email_routing_destination_addresses_list_destination_addresses( - self, async_client: AsyncCloudflare - ) -> None: - response = await async_client.email_routing.routing.addresses.with_raw_response.email_routing_destination_addresses_list_destination_addresses( - "023e105f4ecef8ad9ca31a8372d0c353", + async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: + response = await async_client.email_routing.routing.addresses.with_raw_response.delete( + "ea95132c15732412d22c1476fa83f27a", + account_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" address = await response.parse() - assert_matches_type( - Optional[AddressEmailRoutingDestinationAddressesListDestinationAddressesResponse], - address, - path=["response"], - ) + assert_matches_type(AddressDeleteResponse, address, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_email_routing_destination_addresses_list_destination_addresses( - self, async_client: AsyncCloudflare - ) -> None: - async with async_client.email_routing.routing.addresses.with_streaming_response.email_routing_destination_addresses_list_destination_addresses( - "023e105f4ecef8ad9ca31a8372d0c353", + async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: + async with async_client.email_routing.routing.addresses.with_streaming_response.delete( + "ea95132c15732412d22c1476fa83f27a", + account_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" address = await response.parse() - assert_matches_type( - Optional[AddressEmailRoutingDestinationAddressesListDestinationAddressesResponse], - address, - path=["response"], - ) + assert_matches_type(AddressDeleteResponse, address, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - async def test_path_params_email_routing_destination_addresses_list_destination_addresses( - self, async_client: AsyncCloudflare - ) -> None: + 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.email_routing.routing.addresses.with_raw_response.email_routing_destination_addresses_list_destination_addresses( + await async_client.email_routing.routing.addresses.with_raw_response.delete( + "ea95132c15732412d22c1476fa83f27a", + account_identifier="", + ) + + with pytest.raises( + ValueError, match=r"Expected a non-empty value for `destination_address_identifier` but received ''" + ): + await async_client.email_routing.routing.addresses.with_raw_response.delete( "", + account_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) @pytest.mark.skip() diff --git a/tests/api_resources/intel/asn/test_subnets.py b/tests/api_resources/intel/asn/test_subnets.py index fe2bf1132c1..e80a02a21bb 100644 --- a/tests/api_resources/intel/asn/test_subnets.py +++ b/tests/api_resources/intel/asn/test_subnets.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.intel.asn import SubnetListResponse +from cloudflare.types.intel.asn import SubnetGetResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -19,17 +19,17 @@ class TestSubnets: @pytest.mark.skip() @parametrize - def test_method_list(self, client: Cloudflare) -> None: - subnet = client.intel.asn.subnets.list( + def test_method_get(self, client: Cloudflare) -> None: + subnet = client.intel.asn.subnets.get( 0, account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SubnetListResponse, subnet, path=["response"]) + assert_matches_type(SubnetGetResponse, subnet, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.intel.asn.subnets.with_raw_response.list( + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.intel.asn.subnets.with_raw_response.get( 0, account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -37,12 +37,12 @@ def test_raw_response_list(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subnet = response.parse() - assert_matches_type(SubnetListResponse, subnet, path=["response"]) + assert_matches_type(SubnetGetResponse, subnet, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.intel.asn.subnets.with_streaming_response.list( + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.intel.asn.subnets.with_streaming_response.get( 0, account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: @@ -50,15 +50,15 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" subnet = response.parse() - assert_matches_type(SubnetListResponse, subnet, path=["response"]) + assert_matches_type(SubnetGetResponse, subnet, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - def test_path_params_list(self, client: Cloudflare) -> None: + def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.intel.asn.subnets.with_raw_response.list( + client.intel.asn.subnets.with_raw_response.get( 0, account_id="", ) @@ -69,17 +69,17 @@ class TestAsyncSubnets: @pytest.mark.skip() @parametrize - async def test_method_list(self, async_client: AsyncCloudflare) -> None: - subnet = await async_client.intel.asn.subnets.list( + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + subnet = await async_client.intel.asn.subnets.get( 0, account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SubnetListResponse, subnet, path=["response"]) + assert_matches_type(SubnetGetResponse, subnet, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.intel.asn.subnets.with_raw_response.list( + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.intel.asn.subnets.with_raw_response.get( 0, account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -87,12 +87,12 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subnet = await response.parse() - assert_matches_type(SubnetListResponse, subnet, path=["response"]) + assert_matches_type(SubnetGetResponse, subnet, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.intel.asn.subnets.with_streaming_response.list( + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.intel.asn.subnets.with_streaming_response.get( 0, account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: @@ -100,15 +100,15 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" subnet = await response.parse() - assert_matches_type(SubnetListResponse, subnet, path=["response"]) + assert_matches_type(SubnetGetResponse, subnet, 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: + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.intel.asn.subnets.with_raw_response.list( + await async_client.intel.asn.subnets.with_raw_response.get( 0, account_id="", ) diff --git a/tests/api_resources/intel/test_domain_histories.py b/tests/api_resources/intel/test_domain_history.py similarity index 53% rename from tests/api_resources/intel/test_domain_histories.py rename to tests/api_resources/intel/test_domain_history.py index 069b051e86c..fc0fecc7b7c 100644 --- a/tests/api_resources/intel/test_domain_histories.py +++ b/tests/api_resources/intel/test_domain_history.py @@ -9,116 +9,116 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.intel import DomainHistoryListResponse +from cloudflare.types.intel import DomainHistoryGetResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") -class TestDomainHistories: +class TestDomainHistory: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) @pytest.mark.skip() @parametrize - def test_method_list(self, client: Cloudflare) -> None: - domain_history = client.intel.domain_histories.list( + def test_method_get(self, client: Cloudflare) -> None: + domain_history = client.intel.domain_history.get( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[DomainHistoryListResponse], domain_history, path=["response"]) + assert_matches_type(Optional[DomainHistoryGetResponse], domain_history, path=["response"]) @pytest.mark.skip() @parametrize - def test_method_list_with_all_params(self, client: Cloudflare) -> None: - domain_history = client.intel.domain_histories.list( + def test_method_get_with_all_params(self, client: Cloudflare) -> None: + domain_history = client.intel.domain_history.get( account_id="023e105f4ecef8ad9ca31a8372d0c353", domain="example.com", ) - assert_matches_type(Optional[DomainHistoryListResponse], domain_history, path=["response"]) + assert_matches_type(Optional[DomainHistoryGetResponse], domain_history, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.intel.domain_histories.with_raw_response.list( + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.intel.domain_history.with_raw_response.get( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" domain_history = response.parse() - assert_matches_type(Optional[DomainHistoryListResponse], domain_history, path=["response"]) + assert_matches_type(Optional[DomainHistoryGetResponse], domain_history, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.intel.domain_histories.with_streaming_response.list( + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.intel.domain_history.with_streaming_response.get( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" domain_history = response.parse() - assert_matches_type(Optional[DomainHistoryListResponse], domain_history, path=["response"]) + assert_matches_type(Optional[DomainHistoryGetResponse], domain_history, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - def test_path_params_list(self, client: Cloudflare) -> None: + def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.intel.domain_histories.with_raw_response.list( + client.intel.domain_history.with_raw_response.get( account_id="", ) -class TestAsyncDomainHistories: +class TestAsyncDomainHistory: 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: - domain_history = await async_client.intel.domain_histories.list( + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + domain_history = await async_client.intel.domain_history.get( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[DomainHistoryListResponse], domain_history, path=["response"]) + assert_matches_type(Optional[DomainHistoryGetResponse], domain_history, path=["response"]) @pytest.mark.skip() @parametrize - async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: - domain_history = await async_client.intel.domain_histories.list( + async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -> None: + domain_history = await async_client.intel.domain_history.get( account_id="023e105f4ecef8ad9ca31a8372d0c353", domain="example.com", ) - assert_matches_type(Optional[DomainHistoryListResponse], domain_history, path=["response"]) + assert_matches_type(Optional[DomainHistoryGetResponse], domain_history, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.intel.domain_histories.with_raw_response.list( + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.intel.domain_history.with_raw_response.get( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" domain_history = await response.parse() - assert_matches_type(Optional[DomainHistoryListResponse], domain_history, path=["response"]) + assert_matches_type(Optional[DomainHistoryGetResponse], domain_history, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.intel.domain_histories.with_streaming_response.list( + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.intel.domain_history.with_streaming_response.get( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" domain_history = await response.parse() - assert_matches_type(Optional[DomainHistoryListResponse], domain_history, path=["response"]) + assert_matches_type(Optional[DomainHistoryGetResponse], domain_history, 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: + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.intel.domain_histories.with_raw_response.list( + await async_client.intel.domain_history.with_raw_response.get( account_id="", ) diff --git a/tests/api_resources/load_balancers/monitors/test_references.py b/tests/api_resources/load_balancers/monitors/test_references.py index 6341a37e571..1f35068462a 100644 --- a/tests/api_resources/load_balancers/monitors/test_references.py +++ b/tests/api_resources/load_balancers/monitors/test_references.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.load_balancers.monitors import ReferenceListResponse +from cloudflare.types.load_balancers.monitors import ReferenceGetResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -19,17 +19,17 @@ class TestReferences: @pytest.mark.skip() @parametrize - def test_method_list(self, client: Cloudflare) -> None: - reference = client.load_balancers.monitors.references.list( + def test_method_get(self, client: Cloudflare) -> None: + reference = client.load_balancers.monitors.references.get( "f1aba936b94213e5b8dca0c0dbf1f9cc", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[ReferenceListResponse], reference, path=["response"]) + assert_matches_type(Optional[ReferenceGetResponse], reference, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.load_balancers.monitors.references.with_raw_response.list( + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.load_balancers.monitors.references.with_raw_response.get( "f1aba936b94213e5b8dca0c0dbf1f9cc", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -37,12 +37,12 @@ def test_raw_response_list(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" reference = response.parse() - assert_matches_type(Optional[ReferenceListResponse], reference, path=["response"]) + assert_matches_type(Optional[ReferenceGetResponse], reference, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.load_balancers.monitors.references.with_streaming_response.list( + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.load_balancers.monitors.references.with_streaming_response.get( "f1aba936b94213e5b8dca0c0dbf1f9cc", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: @@ -50,21 +50,21 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" reference = response.parse() - assert_matches_type(Optional[ReferenceListResponse], reference, path=["response"]) + assert_matches_type(Optional[ReferenceGetResponse], reference, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - def test_path_params_list(self, client: Cloudflare) -> None: + def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.load_balancers.monitors.references.with_raw_response.list( + client.load_balancers.monitors.references.with_raw_response.get( "f1aba936b94213e5b8dca0c0dbf1f9cc", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `monitor_id` but received ''"): - client.load_balancers.monitors.references.with_raw_response.list( + client.load_balancers.monitors.references.with_raw_response.get( "", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -75,17 +75,17 @@ class TestAsyncReferences: @pytest.mark.skip() @parametrize - async def test_method_list(self, async_client: AsyncCloudflare) -> None: - reference = await async_client.load_balancers.monitors.references.list( + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + reference = await async_client.load_balancers.monitors.references.get( "f1aba936b94213e5b8dca0c0dbf1f9cc", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[ReferenceListResponse], reference, path=["response"]) + assert_matches_type(Optional[ReferenceGetResponse], reference, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.load_balancers.monitors.references.with_raw_response.list( + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.load_balancers.monitors.references.with_raw_response.get( "f1aba936b94213e5b8dca0c0dbf1f9cc", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -93,12 +93,12 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" reference = await response.parse() - assert_matches_type(Optional[ReferenceListResponse], reference, path=["response"]) + assert_matches_type(Optional[ReferenceGetResponse], reference, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.load_balancers.monitors.references.with_streaming_response.list( + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.load_balancers.monitors.references.with_streaming_response.get( "f1aba936b94213e5b8dca0c0dbf1f9cc", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: @@ -106,21 +106,21 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" reference = await response.parse() - assert_matches_type(Optional[ReferenceListResponse], reference, path=["response"]) + assert_matches_type(Optional[ReferenceGetResponse], reference, 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: + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.load_balancers.monitors.references.with_raw_response.list( + await async_client.load_balancers.monitors.references.with_raw_response.get( "f1aba936b94213e5b8dca0c0dbf1f9cc", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `monitor_id` but received ''"): - await async_client.load_balancers.monitors.references.with_raw_response.list( + await async_client.load_balancers.monitors.references.with_raw_response.get( "", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) diff --git a/tests/api_resources/load_balancers/pools/test_references.py b/tests/api_resources/load_balancers/pools/test_references.py index e675b056e2d..269ff7c7882 100644 --- a/tests/api_resources/load_balancers/pools/test_references.py +++ b/tests/api_resources/load_balancers/pools/test_references.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.load_balancers.pools import ReferenceListResponse +from cloudflare.types.load_balancers.pools import ReferenceGetResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -19,17 +19,17 @@ class TestReferences: @pytest.mark.skip() @parametrize - def test_method_list(self, client: Cloudflare) -> None: - reference = client.load_balancers.pools.references.list( + def test_method_get(self, client: Cloudflare) -> None: + reference = client.load_balancers.pools.references.get( "17b5962d775c646f3f9725cbc7a53df4", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[ReferenceListResponse], reference, path=["response"]) + assert_matches_type(Optional[ReferenceGetResponse], reference, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.load_balancers.pools.references.with_raw_response.list( + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.load_balancers.pools.references.with_raw_response.get( "17b5962d775c646f3f9725cbc7a53df4", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -37,12 +37,12 @@ def test_raw_response_list(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" reference = response.parse() - assert_matches_type(Optional[ReferenceListResponse], reference, path=["response"]) + assert_matches_type(Optional[ReferenceGetResponse], reference, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.load_balancers.pools.references.with_streaming_response.list( + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.load_balancers.pools.references.with_streaming_response.get( "17b5962d775c646f3f9725cbc7a53df4", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: @@ -50,21 +50,21 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" reference = response.parse() - assert_matches_type(Optional[ReferenceListResponse], reference, path=["response"]) + assert_matches_type(Optional[ReferenceGetResponse], reference, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - def test_path_params_list(self, client: Cloudflare) -> None: + def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.load_balancers.pools.references.with_raw_response.list( + client.load_balancers.pools.references.with_raw_response.get( "17b5962d775c646f3f9725cbc7a53df4", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `pool_id` but received ''"): - client.load_balancers.pools.references.with_raw_response.list( + client.load_balancers.pools.references.with_raw_response.get( "", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -75,17 +75,17 @@ class TestAsyncReferences: @pytest.mark.skip() @parametrize - async def test_method_list(self, async_client: AsyncCloudflare) -> None: - reference = await async_client.load_balancers.pools.references.list( + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + reference = await async_client.load_balancers.pools.references.get( "17b5962d775c646f3f9725cbc7a53df4", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[ReferenceListResponse], reference, path=["response"]) + assert_matches_type(Optional[ReferenceGetResponse], reference, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.load_balancers.pools.references.with_raw_response.list( + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.load_balancers.pools.references.with_raw_response.get( "17b5962d775c646f3f9725cbc7a53df4", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -93,12 +93,12 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" reference = await response.parse() - assert_matches_type(Optional[ReferenceListResponse], reference, path=["response"]) + assert_matches_type(Optional[ReferenceGetResponse], reference, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.load_balancers.pools.references.with_streaming_response.list( + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.load_balancers.pools.references.with_streaming_response.get( "17b5962d775c646f3f9725cbc7a53df4", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: @@ -106,21 +106,21 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" reference = await response.parse() - assert_matches_type(Optional[ReferenceListResponse], reference, path=["response"]) + assert_matches_type(Optional[ReferenceGetResponse], reference, 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: + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.load_balancers.pools.references.with_raw_response.list( + await async_client.load_balancers.pools.references.with_raw_response.get( "17b5962d775c646f3f9725cbc7a53df4", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `pool_id` but received ''"): - await async_client.load_balancers.pools.references.with_raw_response.list( + await async_client.load_balancers.pools.references.with_raw_response.get( "", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) diff --git a/tests/api_resources/load_balancers/test_searches.py b/tests/api_resources/load_balancers/test_searches.py index 7fae0b401a1..b62768397a7 100644 --- a/tests/api_resources/load_balancers/test_searches.py +++ b/tests/api_resources/load_balancers/test_searches.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.load_balancers import SearchListResponse +from cloudflare.types.load_balancers import SearchGetResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -19,16 +19,16 @@ class TestSearches: @pytest.mark.skip() @parametrize - def test_method_list(self, client: Cloudflare) -> None: - search = client.load_balancers.searches.list( + def test_method_get(self, client: Cloudflare) -> None: + search = client.load_balancers.searches.get( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[SearchListResponse], search, path=["response"]) + assert_matches_type(Optional[SearchGetResponse], search, path=["response"]) @pytest.mark.skip() @parametrize - def test_method_list_with_all_params(self, client: Cloudflare) -> None: - search = client.load_balancers.searches.list( + def test_method_get_with_all_params(self, client: Cloudflare) -> None: + search = client.load_balancers.searches.get( account_id="023e105f4ecef8ad9ca31a8372d0c353", page={}, per_page={}, @@ -37,39 +37,39 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: "references": "*", }, ) - assert_matches_type(Optional[SearchListResponse], search, path=["response"]) + assert_matches_type(Optional[SearchGetResponse], search, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.load_balancers.searches.with_raw_response.list( + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.load_balancers.searches.with_raw_response.get( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" search = response.parse() - assert_matches_type(Optional[SearchListResponse], search, path=["response"]) + assert_matches_type(Optional[SearchGetResponse], search, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.load_balancers.searches.with_streaming_response.list( + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.load_balancers.searches.with_streaming_response.get( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" search = response.parse() - assert_matches_type(Optional[SearchListResponse], search, path=["response"]) + assert_matches_type(Optional[SearchGetResponse], search, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - def test_path_params_list(self, client: Cloudflare) -> None: + def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.load_balancers.searches.with_raw_response.list( + client.load_balancers.searches.with_raw_response.get( account_id="", ) @@ -79,16 +79,16 @@ class TestAsyncSearches: @pytest.mark.skip() @parametrize - async def test_method_list(self, async_client: AsyncCloudflare) -> None: - search = await async_client.load_balancers.searches.list( + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + search = await async_client.load_balancers.searches.get( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[SearchListResponse], search, path=["response"]) + assert_matches_type(Optional[SearchGetResponse], search, path=["response"]) @pytest.mark.skip() @parametrize - async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: - search = await async_client.load_balancers.searches.list( + async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -> None: + search = await async_client.load_balancers.searches.get( account_id="023e105f4ecef8ad9ca31a8372d0c353", page={}, per_page={}, @@ -97,38 +97,38 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) "references": "*", }, ) - assert_matches_type(Optional[SearchListResponse], search, path=["response"]) + assert_matches_type(Optional[SearchGetResponse], search, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.load_balancers.searches.with_raw_response.list( + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.load_balancers.searches.with_raw_response.get( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" search = await response.parse() - assert_matches_type(Optional[SearchListResponse], search, path=["response"]) + assert_matches_type(Optional[SearchGetResponse], search, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.load_balancers.searches.with_streaming_response.list( + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.load_balancers.searches.with_streaming_response.get( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" search = await response.parse() - assert_matches_type(Optional[SearchListResponse], search, path=["response"]) + assert_matches_type(Optional[SearchGetResponse], search, 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: + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.load_balancers.searches.with_raw_response.list( + await async_client.load_balancers.searches.with_raw_response.get( account_id="", ) diff --git a/tests/api_resources/logpush/datasets/test_fields.py b/tests/api_resources/logpush/datasets/test_fields.py index 860d06732ce..44d22410916 100644 --- a/tests/api_resources/logpush/datasets/test_fields.py +++ b/tests/api_resources/logpush/datasets/test_fields.py @@ -18,8 +18,8 @@ class TestFields: @pytest.mark.skip() @parametrize - def test_method_list(self, client: Cloudflare) -> None: - field = client.logpush.datasets.fields.list( + def test_method_get(self, client: Cloudflare) -> None: + field = client.logpush.datasets.fields.get( "http_requests", account_id="string", zone_id="string", @@ -28,8 +28,8 @@ def test_method_list(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_method_list_with_all_params(self, client: Cloudflare) -> None: - field = client.logpush.datasets.fields.list( + def test_method_get_with_all_params(self, client: Cloudflare) -> None: + field = client.logpush.datasets.fields.get( "http_requests", account_id="string", zone_id="string", @@ -38,8 +38,8 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.logpush.datasets.fields.with_raw_response.list( + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.logpush.datasets.fields.with_raw_response.get( "http_requests", account_id="string", zone_id="string", @@ -52,8 +52,8 @@ def test_raw_response_list(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.logpush.datasets.fields.with_streaming_response.list( + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.logpush.datasets.fields.with_streaming_response.get( "http_requests", account_id="string", zone_id="string", @@ -68,23 +68,23 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_path_params_list(self, client: Cloudflare) -> None: + def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `dataset_id` but received ''"): - client.logpush.datasets.fields.with_raw_response.list( + client.logpush.datasets.fields.with_raw_response.get( "", account_id="string", zone_id="string", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.logpush.datasets.fields.with_raw_response.list( + client.logpush.datasets.fields.with_raw_response.get( "http_requests", account_id="", zone_id="string", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - client.logpush.datasets.fields.with_raw_response.list( + client.logpush.datasets.fields.with_raw_response.get( "http_requests", account_id="string", zone_id="", @@ -96,8 +96,8 @@ class TestAsyncFields: @pytest.mark.skip() @parametrize - async def test_method_list(self, async_client: AsyncCloudflare) -> None: - field = await async_client.logpush.datasets.fields.list( + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + field = await async_client.logpush.datasets.fields.get( "http_requests", account_id="string", zone_id="string", @@ -106,8 +106,8 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip() @parametrize - async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: - field = await async_client.logpush.datasets.fields.list( + async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -> None: + field = await async_client.logpush.datasets.fields.get( "http_requests", account_id="string", zone_id="string", @@ -116,8 +116,8 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) @pytest.mark.skip() @parametrize - async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.logpush.datasets.fields.with_raw_response.list( + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.logpush.datasets.fields.with_raw_response.get( "http_requests", account_id="string", zone_id="string", @@ -130,8 +130,8 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip() @parametrize - async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.logpush.datasets.fields.with_streaming_response.list( + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.logpush.datasets.fields.with_streaming_response.get( "http_requests", account_id="string", zone_id="string", @@ -146,23 +146,23 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N @pytest.mark.skip() @parametrize - async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `dataset_id` but received ''"): - await async_client.logpush.datasets.fields.with_raw_response.list( + await async_client.logpush.datasets.fields.with_raw_response.get( "", account_id="string", zone_id="string", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.logpush.datasets.fields.with_raw_response.list( + await async_client.logpush.datasets.fields.with_raw_response.get( "http_requests", account_id="", zone_id="string", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - await async_client.logpush.datasets.fields.with_raw_response.list( + await async_client.logpush.datasets.fields.with_raw_response.get( "http_requests", account_id="string", zone_id="", diff --git a/tests/api_resources/logpush/datasets/test_jobs.py b/tests/api_resources/logpush/datasets/test_jobs.py index c3add1728a0..95655ba39ba 100644 --- a/tests/api_resources/logpush/datasets/test_jobs.py +++ b/tests/api_resources/logpush/datasets/test_jobs.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.logpush.datasets import JobListResponse +from cloudflare.types.logpush.datasets import JobGetResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -19,28 +19,28 @@ class TestJobs: @pytest.mark.skip() @parametrize - def test_method_list(self, client: Cloudflare) -> None: - job = client.logpush.datasets.jobs.list( + def test_method_get(self, client: Cloudflare) -> None: + job = client.logpush.datasets.jobs.get( "http_requests", account_id="string", zone_id="string", ) - assert_matches_type(JobListResponse, job, path=["response"]) + assert_matches_type(JobGetResponse, job, path=["response"]) @pytest.mark.skip() @parametrize - def test_method_list_with_all_params(self, client: Cloudflare) -> None: - job = client.logpush.datasets.jobs.list( + def test_method_get_with_all_params(self, client: Cloudflare) -> None: + job = client.logpush.datasets.jobs.get( "http_requests", account_id="string", zone_id="string", ) - assert_matches_type(JobListResponse, job, path=["response"]) + assert_matches_type(JobGetResponse, job, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.logpush.datasets.jobs.with_raw_response.list( + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.logpush.datasets.jobs.with_raw_response.get( "http_requests", account_id="string", zone_id="string", @@ -49,12 +49,12 @@ def test_raw_response_list(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" job = response.parse() - assert_matches_type(JobListResponse, job, path=["response"]) + assert_matches_type(JobGetResponse, job, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.logpush.datasets.jobs.with_streaming_response.list( + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.logpush.datasets.jobs.with_streaming_response.get( "http_requests", account_id="string", zone_id="string", @@ -63,29 +63,29 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" job = response.parse() - assert_matches_type(JobListResponse, job, path=["response"]) + assert_matches_type(JobGetResponse, job, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - def test_path_params_list(self, client: Cloudflare) -> None: + def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `dataset_id` but received ''"): - client.logpush.datasets.jobs.with_raw_response.list( + client.logpush.datasets.jobs.with_raw_response.get( "", account_id="string", zone_id="string", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.logpush.datasets.jobs.with_raw_response.list( + client.logpush.datasets.jobs.with_raw_response.get( "http_requests", account_id="", zone_id="string", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - client.logpush.datasets.jobs.with_raw_response.list( + client.logpush.datasets.jobs.with_raw_response.get( "http_requests", account_id="string", zone_id="", @@ -97,28 +97,28 @@ class TestAsyncJobs: @pytest.mark.skip() @parametrize - async def test_method_list(self, async_client: AsyncCloudflare) -> None: - job = await async_client.logpush.datasets.jobs.list( + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + job = await async_client.logpush.datasets.jobs.get( "http_requests", account_id="string", zone_id="string", ) - assert_matches_type(JobListResponse, job, path=["response"]) + assert_matches_type(JobGetResponse, job, path=["response"]) @pytest.mark.skip() @parametrize - async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: - job = await async_client.logpush.datasets.jobs.list( + async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -> None: + job = await async_client.logpush.datasets.jobs.get( "http_requests", account_id="string", zone_id="string", ) - assert_matches_type(JobListResponse, job, path=["response"]) + assert_matches_type(JobGetResponse, job, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.logpush.datasets.jobs.with_raw_response.list( + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.logpush.datasets.jobs.with_raw_response.get( "http_requests", account_id="string", zone_id="string", @@ -127,12 +127,12 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" job = await response.parse() - assert_matches_type(JobListResponse, job, path=["response"]) + assert_matches_type(JobGetResponse, job, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.logpush.datasets.jobs.with_streaming_response.list( + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.logpush.datasets.jobs.with_streaming_response.get( "http_requests", account_id="string", zone_id="string", @@ -141,29 +141,29 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" job = await response.parse() - assert_matches_type(JobListResponse, job, path=["response"]) + assert_matches_type(JobGetResponse, job, 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: + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `dataset_id` but received ''"): - await async_client.logpush.datasets.jobs.with_raw_response.list( + await async_client.logpush.datasets.jobs.with_raw_response.get( "", account_id="string", zone_id="string", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.logpush.datasets.jobs.with_raw_response.list( + await async_client.logpush.datasets.jobs.with_raw_response.get( "http_requests", account_id="", zone_id="string", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - await async_client.logpush.datasets.jobs.with_raw_response.list( + await async_client.logpush.datasets.jobs.with_raw_response.get( "http_requests", account_id="string", zone_id="", diff --git a/tests/api_resources/logs/controls/__init__.py b/tests/api_resources/logs/control/__init__.py similarity index 100% rename from tests/api_resources/logs/controls/__init__.py rename to tests/api_resources/logs/control/__init__.py diff --git a/tests/api_resources/logs/controls/cmb/__init__.py b/tests/api_resources/logs/control/cmb/__init__.py similarity index 100% rename from tests/api_resources/logs/controls/cmb/__init__.py rename to tests/api_resources/logs/control/cmb/__init__.py diff --git a/tests/api_resources/logs/controls/cmb/test_config.py b/tests/api_resources/logs/control/cmb/test_config.py similarity index 83% rename from tests/api_resources/logs/controls/cmb/test_config.py rename to tests/api_resources/logs/control/cmb/test_config.py index 38e78af071a..10198f8ae4e 100644 --- a/tests/api_resources/logs/controls/cmb/test_config.py +++ b/tests/api_resources/logs/control/cmb/test_config.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.logs.controls.cmb import ( +from cloudflare.types.logs.control.cmb import ( ConfigGetResponse, ConfigCreateResponse, ConfigDeleteResponse, @@ -24,7 +24,7 @@ class TestConfig: @pytest.mark.skip() @parametrize def test_method_create(self, client: Cloudflare) -> None: - config = client.logs.controls.cmb.config.create( + config = client.logs.control.cmb.config.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(Optional[ConfigCreateResponse], config, path=["response"]) @@ -32,7 +32,7 @@ def test_method_create(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize def test_method_create_with_all_params(self, client: Cloudflare) -> None: - config = client.logs.controls.cmb.config.create( + config = client.logs.control.cmb.config.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", regions="eu", ) @@ -41,7 +41,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: - response = client.logs.controls.cmb.config.with_raw_response.create( + response = client.logs.control.cmb.config.with_raw_response.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -53,7 +53,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: - with client.logs.controls.cmb.config.with_streaming_response.create( + with client.logs.control.cmb.config.with_streaming_response.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed @@ -68,14 +68,14 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: @parametrize def test_path_params_create(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.logs.controls.cmb.config.with_raw_response.create( + client.logs.control.cmb.config.with_raw_response.create( account_id="", ) @pytest.mark.skip() @parametrize def test_method_delete(self, client: Cloudflare) -> None: - config = client.logs.controls.cmb.config.delete( + config = client.logs.control.cmb.config.delete( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(Optional[ConfigDeleteResponse], config, path=["response"]) @@ -83,7 +83,7 @@ def test_method_delete(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize def test_raw_response_delete(self, client: Cloudflare) -> None: - response = client.logs.controls.cmb.config.with_raw_response.delete( + response = client.logs.control.cmb.config.with_raw_response.delete( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -95,7 +95,7 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize def test_streaming_response_delete(self, client: Cloudflare) -> None: - with client.logs.controls.cmb.config.with_streaming_response.delete( + with client.logs.control.cmb.config.with_streaming_response.delete( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed @@ -110,14 +110,14 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: @parametrize def test_path_params_delete(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.logs.controls.cmb.config.with_raw_response.delete( + client.logs.control.cmb.config.with_raw_response.delete( account_id="", ) @pytest.mark.skip() @parametrize def test_method_get(self, client: Cloudflare) -> None: - config = client.logs.controls.cmb.config.get( + config = client.logs.control.cmb.config.get( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(Optional[ConfigGetResponse], config, path=["response"]) @@ -125,7 +125,7 @@ def test_method_get(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: - response = client.logs.controls.cmb.config.with_raw_response.get( + response = client.logs.control.cmb.config.with_raw_response.get( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -137,7 +137,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: - with client.logs.controls.cmb.config.with_streaming_response.get( + with client.logs.control.cmb.config.with_streaming_response.get( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed @@ -152,7 +152,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: @parametrize def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.logs.controls.cmb.config.with_raw_response.get( + client.logs.control.cmb.config.with_raw_response.get( account_id="", ) @@ -163,7 +163,7 @@ class TestAsyncConfig: @pytest.mark.skip() @parametrize async def test_method_create(self, async_client: AsyncCloudflare) -> None: - config = await async_client.logs.controls.cmb.config.create( + config = await async_client.logs.control.cmb.config.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(Optional[ConfigCreateResponse], config, path=["response"]) @@ -171,7 +171,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip() @parametrize async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: - config = await async_client.logs.controls.cmb.config.create( + config = await async_client.logs.control.cmb.config.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", regions="eu", ) @@ -180,7 +180,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare @pytest.mark.skip() @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: - response = await async_client.logs.controls.cmb.config.with_raw_response.create( + response = await async_client.logs.control.cmb.config.with_raw_response.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -192,7 +192,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip() @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: - async with async_client.logs.controls.cmb.config.with_streaming_response.create( + async with async_client.logs.control.cmb.config.with_streaming_response.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed @@ -207,14 +207,14 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> @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_id` but received ''"): - await async_client.logs.controls.cmb.config.with_raw_response.create( + await async_client.logs.control.cmb.config.with_raw_response.create( account_id="", ) @pytest.mark.skip() @parametrize async def test_method_delete(self, async_client: AsyncCloudflare) -> None: - config = await async_client.logs.controls.cmb.config.delete( + config = await async_client.logs.control.cmb.config.delete( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(Optional[ConfigDeleteResponse], config, path=["response"]) @@ -222,7 +222,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip() @parametrize async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: - response = await async_client.logs.controls.cmb.config.with_raw_response.delete( + response = await async_client.logs.control.cmb.config.with_raw_response.delete( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -234,7 +234,7 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip() @parametrize async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: - async with async_client.logs.controls.cmb.config.with_streaming_response.delete( + async with async_client.logs.control.cmb.config.with_streaming_response.delete( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed @@ -249,14 +249,14 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> @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_id` but received ''"): - await async_client.logs.controls.cmb.config.with_raw_response.delete( + await async_client.logs.control.cmb.config.with_raw_response.delete( account_id="", ) @pytest.mark.skip() @parametrize async def test_method_get(self, async_client: AsyncCloudflare) -> None: - config = await async_client.logs.controls.cmb.config.get( + config = await async_client.logs.control.cmb.config.get( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(Optional[ConfigGetResponse], config, path=["response"]) @@ -264,7 +264,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip() @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: - response = await async_client.logs.controls.cmb.config.with_raw_response.get( + response = await async_client.logs.control.cmb.config.with_raw_response.get( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -276,7 +276,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip() @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: - async with async_client.logs.controls.cmb.config.with_streaming_response.get( + async with async_client.logs.control.cmb.config.with_streaming_response.get( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed @@ -291,6 +291,6 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No @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_id` but received ''"): - await async_client.logs.controls.cmb.config.with_raw_response.get( + await async_client.logs.control.cmb.config.with_raw_response.get( account_id="", ) diff --git a/tests/api_resources/logs/controls/retentions/__init__.py b/tests/api_resources/logs/control/retention/__init__.py similarity index 100% rename from tests/api_resources/logs/controls/retentions/__init__.py rename to tests/api_resources/logs/control/retention/__init__.py diff --git a/tests/api_resources/logs/controls/retentions/test_flags.py b/tests/api_resources/logs/control/retention/test_flag.py similarity index 62% rename from tests/api_resources/logs/controls/retentions/test_flags.py rename to tests/api_resources/logs/control/retention/test_flag.py index 2f3531eae7b..5ce1d412d7d 100644 --- a/tests/api_resources/logs/controls/retentions/test_flags.py +++ b/tests/api_resources/logs/control/retention/test_flag.py @@ -9,21 +9,18 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.logs.controls.retentions import ( - FlagCreateResponse, - FlagLogsReceivedGetLogRetentionFlagResponse, -) +from cloudflare.types.logs.control.retention import FlagGetResponse, FlagCreateResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") -class TestFlags: +class TestFlag: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) @pytest.mark.skip() @parametrize def test_method_create(self, client: Cloudflare) -> None: - flag = client.logs.controls.retentions.flags.create( + flag = client.logs.control.retention.flag.create( "023e105f4ecef8ad9ca31a8372d0c353", flag=True, ) @@ -32,7 +29,7 @@ def test_method_create(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: - response = client.logs.controls.retentions.flags.with_raw_response.create( + response = client.logs.control.retention.flag.with_raw_response.create( "023e105f4ecef8ad9ca31a8372d0c353", flag=True, ) @@ -45,7 +42,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: - with client.logs.controls.retentions.flags.with_streaming_response.create( + with client.logs.control.retention.flag.with_streaming_response.create( "023e105f4ecef8ad9ca31a8372d0c353", flag=True, ) as response: @@ -61,61 +58,61 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: @parametrize def test_path_params_create(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_identifier` but received ''"): - client.logs.controls.retentions.flags.with_raw_response.create( + client.logs.control.retention.flag.with_raw_response.create( "", flag=True, ) @pytest.mark.skip() @parametrize - def test_method_logs_received_get_log_retention_flag(self, client: Cloudflare) -> None: - flag = client.logs.controls.retentions.flags.logs_received_get_log_retention_flag( + def test_method_get(self, client: Cloudflare) -> None: + flag = client.logs.control.retention.flag.get( "023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(FlagLogsReceivedGetLogRetentionFlagResponse, flag, path=["response"]) + assert_matches_type(FlagGetResponse, flag, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_logs_received_get_log_retention_flag(self, client: Cloudflare) -> None: - response = client.logs.controls.retentions.flags.with_raw_response.logs_received_get_log_retention_flag( + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.logs.control.retention.flag.with_raw_response.get( "023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" flag = response.parse() - assert_matches_type(FlagLogsReceivedGetLogRetentionFlagResponse, flag, path=["response"]) + assert_matches_type(FlagGetResponse, flag, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_logs_received_get_log_retention_flag(self, client: Cloudflare) -> None: - with client.logs.controls.retentions.flags.with_streaming_response.logs_received_get_log_retention_flag( + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.logs.control.retention.flag.with_streaming_response.get( "023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" flag = response.parse() - assert_matches_type(FlagLogsReceivedGetLogRetentionFlagResponse, flag, path=["response"]) + assert_matches_type(FlagGetResponse, flag, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - def test_path_params_logs_received_get_log_retention_flag(self, client: Cloudflare) -> None: + def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_identifier` but received ''"): - client.logs.controls.retentions.flags.with_raw_response.logs_received_get_log_retention_flag( + client.logs.control.retention.flag.with_raw_response.get( "", ) -class TestAsyncFlags: +class TestAsyncFlag: 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: - flag = await async_client.logs.controls.retentions.flags.create( + flag = await async_client.logs.control.retention.flag.create( "023e105f4ecef8ad9ca31a8372d0c353", flag=True, ) @@ -124,7 +121,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip() @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: - response = await async_client.logs.controls.retentions.flags.with_raw_response.create( + response = await async_client.logs.control.retention.flag.with_raw_response.create( "023e105f4ecef8ad9ca31a8372d0c353", flag=True, ) @@ -137,7 +134,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip() @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: - async with async_client.logs.controls.retentions.flags.with_streaming_response.create( + async with async_client.logs.control.retention.flag.with_streaming_response.create( "023e105f4ecef8ad9ca31a8372d0c353", flag=True, ) as response: @@ -153,51 +150,49 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> @parametrize async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_identifier` but received ''"): - await async_client.logs.controls.retentions.flags.with_raw_response.create( + await async_client.logs.control.retention.flag.with_raw_response.create( "", flag=True, ) @pytest.mark.skip() @parametrize - async def test_method_logs_received_get_log_retention_flag(self, async_client: AsyncCloudflare) -> None: - flag = await async_client.logs.controls.retentions.flags.logs_received_get_log_retention_flag( + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + flag = await async_client.logs.control.retention.flag.get( "023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(FlagLogsReceivedGetLogRetentionFlagResponse, flag, path=["response"]) + assert_matches_type(FlagGetResponse, flag, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_logs_received_get_log_retention_flag(self, async_client: AsyncCloudflare) -> None: - response = ( - await async_client.logs.controls.retentions.flags.with_raw_response.logs_received_get_log_retention_flag( - "023e105f4ecef8ad9ca31a8372d0c353", - ) + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.logs.control.retention.flag.with_raw_response.get( + "023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" flag = await response.parse() - assert_matches_type(FlagLogsReceivedGetLogRetentionFlagResponse, flag, path=["response"]) + assert_matches_type(FlagGetResponse, flag, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_logs_received_get_log_retention_flag(self, async_client: AsyncCloudflare) -> None: - async with async_client.logs.controls.retentions.flags.with_streaming_response.logs_received_get_log_retention_flag( + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.logs.control.retention.flag.with_streaming_response.get( "023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" flag = await response.parse() - assert_matches_type(FlagLogsReceivedGetLogRetentionFlagResponse, flag, path=["response"]) + assert_matches_type(FlagGetResponse, flag, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - async def test_path_params_logs_received_get_log_retention_flag(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_identifier` but received ''"): - await async_client.logs.controls.retentions.flags.with_raw_response.logs_received_get_log_retention_flag( + await async_client.logs.control.retention.flag.with_raw_response.get( "", ) diff --git a/tests/api_resources/logs/received/test_fields.py b/tests/api_resources/logs/received/test_fields.py index 75e635f75f7..999aee42e31 100644 --- a/tests/api_resources/logs/received/test_fields.py +++ b/tests/api_resources/logs/received/test_fields.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.logs.received import FieldListResponse +from cloudflare.types.logs.received import FieldGetResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -19,43 +19,43 @@ class TestFields: @pytest.mark.skip() @parametrize - def test_method_list(self, client: Cloudflare) -> None: - field = client.logs.received.fields.list( + def test_method_get(self, client: Cloudflare) -> None: + field = client.logs.received.fields.get( "023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(FieldListResponse, field, path=["response"]) + assert_matches_type(FieldGetResponse, field, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.logs.received.fields.with_raw_response.list( + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.logs.received.fields.with_raw_response.get( "023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" field = response.parse() - assert_matches_type(FieldListResponse, field, path=["response"]) + assert_matches_type(FieldGetResponse, field, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.logs.received.fields.with_streaming_response.list( + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.logs.received.fields.with_streaming_response.get( "023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" field = response.parse() - assert_matches_type(FieldListResponse, field, path=["response"]) + assert_matches_type(FieldGetResponse, field, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - def test_path_params_list(self, client: Cloudflare) -> None: + def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_identifier` but received ''"): - client.logs.received.fields.with_raw_response.list( + client.logs.received.fields.with_raw_response.get( "", ) @@ -65,42 +65,42 @@ class TestAsyncFields: @pytest.mark.skip() @parametrize - async def test_method_list(self, async_client: AsyncCloudflare) -> None: - field = await async_client.logs.received.fields.list( + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + field = await async_client.logs.received.fields.get( "023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(FieldListResponse, field, path=["response"]) + assert_matches_type(FieldGetResponse, field, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.logs.received.fields.with_raw_response.list( + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.logs.received.fields.with_raw_response.get( "023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" field = await response.parse() - assert_matches_type(FieldListResponse, field, path=["response"]) + assert_matches_type(FieldGetResponse, field, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.logs.received.fields.with_streaming_response.list( + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.logs.received.fields.with_streaming_response.get( "023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" field = await response.parse() - assert_matches_type(FieldListResponse, field, path=["response"]) + assert_matches_type(FieldGetResponse, field, 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: + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_identifier` but received ''"): - await async_client.logs.received.fields.with_raw_response.list( + await async_client.logs.received.fields.with_raw_response.get( "", ) diff --git a/tests/api_resources/logs/test_rayids.py b/tests/api_resources/logs/test_rayid.py similarity index 87% rename from tests/api_resources/logs/test_rayids.py rename to tests/api_resources/logs/test_rayid.py index 5a5ba75ec32..ac1a7fd3a39 100644 --- a/tests/api_resources/logs/test_rayids.py +++ b/tests/api_resources/logs/test_rayid.py @@ -14,13 +14,13 @@ base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") -class TestRayids: +class TestRayid: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) @pytest.mark.skip() @parametrize def test_method_get(self, client: Cloudflare) -> None: - rayid = client.logs.rayids.get( + rayid = client.logs.rayid.get( "41ddf1740f67442d", zone_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -29,7 +29,7 @@ def test_method_get(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize def test_method_get_with_all_params(self, client: Cloudflare) -> None: - rayid = client.logs.rayids.get( + rayid = client.logs.rayid.get( "41ddf1740f67442d", zone_identifier="023e105f4ecef8ad9ca31a8372d0c353", fields="ClientIP,RayID,EdgeStartTimestamp", @@ -40,7 +40,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: - response = client.logs.rayids.with_raw_response.get( + response = client.logs.rayid.with_raw_response.get( "41ddf1740f67442d", zone_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -53,7 +53,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: - with client.logs.rayids.with_streaming_response.get( + with client.logs.rayid.with_streaming_response.get( "41ddf1740f67442d", zone_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) as response: @@ -69,25 +69,25 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: @parametrize def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_identifier` but received ''"): - client.logs.rayids.with_raw_response.get( + client.logs.rayid.with_raw_response.get( "41ddf1740f67442d", zone_identifier="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `ray_identifier` but received ''"): - client.logs.rayids.with_raw_response.get( + client.logs.rayid.with_raw_response.get( "", zone_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) -class TestAsyncRayids: +class TestAsyncRayid: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @pytest.mark.skip() @parametrize async def test_method_get(self, async_client: AsyncCloudflare) -> None: - rayid = await async_client.logs.rayids.get( + rayid = await async_client.logs.rayid.get( "41ddf1740f67442d", zone_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -96,7 +96,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip() @parametrize async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -> None: - rayid = await async_client.logs.rayids.get( + rayid = await async_client.logs.rayid.get( "41ddf1740f67442d", zone_identifier="023e105f4ecef8ad9ca31a8372d0c353", fields="ClientIP,RayID,EdgeStartTimestamp", @@ -107,7 +107,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) - @pytest.mark.skip() @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: - response = await async_client.logs.rayids.with_raw_response.get( + response = await async_client.logs.rayid.with_raw_response.get( "41ddf1740f67442d", zone_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -120,7 +120,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip() @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: - async with async_client.logs.rayids.with_streaming_response.get( + async with async_client.logs.rayid.with_streaming_response.get( "41ddf1740f67442d", zone_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) as response: @@ -136,13 +136,13 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No @parametrize async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_identifier` but received ''"): - await async_client.logs.rayids.with_raw_response.get( + await async_client.logs.rayid.with_raw_response.get( "41ddf1740f67442d", zone_identifier="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `ray_identifier` but received ''"): - await async_client.logs.rayids.with_raw_response.get( + await async_client.logs.rayid.with_raw_response.get( "", zone_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) diff --git a/tests/api_resources/magic_network_monitoring/configs/test_fulls.py b/tests/api_resources/magic_network_monitoring/configs/test_full.py similarity index 63% rename from tests/api_resources/magic_network_monitoring/configs/test_fulls.py rename to tests/api_resources/magic_network_monitoring/configs/test_full.py index 4c5488271f3..e97f5a097ce 100644 --- a/tests/api_resources/magic_network_monitoring/configs/test_fulls.py +++ b/tests/api_resources/magic_network_monitoring/configs/test_full.py @@ -9,82 +9,82 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.magic_network_monitoring.configs import FullListResponse +from cloudflare.types.magic_network_monitoring.configs import FullGetResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") -class TestFulls: +class TestFull: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) @pytest.mark.skip() @parametrize - def test_method_list(self, client: Cloudflare) -> None: - full = client.magic_network_monitoring.configs.fulls.list( + def test_method_get(self, client: Cloudflare) -> None: + full = client.magic_network_monitoring.configs.full.get( "6f91088a406011ed95aed352566e8d4c", ) - assert_matches_type(FullListResponse, full, path=["response"]) + assert_matches_type(FullGetResponse, full, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.magic_network_monitoring.configs.fulls.with_raw_response.list( + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.magic_network_monitoring.configs.full.with_raw_response.get( "6f91088a406011ed95aed352566e8d4c", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" full = response.parse() - assert_matches_type(FullListResponse, full, path=["response"]) + assert_matches_type(FullGetResponse, full, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.magic_network_monitoring.configs.fulls.with_streaming_response.list( + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.magic_network_monitoring.configs.full.with_streaming_response.get( "6f91088a406011ed95aed352566e8d4c", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" full = response.parse() - assert_matches_type(FullListResponse, full, path=["response"]) + assert_matches_type(FullGetResponse, full, path=["response"]) assert cast(Any, response.is_closed) is True -class TestAsyncFulls: +class TestAsyncFull: 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: - full = await async_client.magic_network_monitoring.configs.fulls.list( + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + full = await async_client.magic_network_monitoring.configs.full.get( "6f91088a406011ed95aed352566e8d4c", ) - assert_matches_type(FullListResponse, full, path=["response"]) + assert_matches_type(FullGetResponse, full, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.magic_network_monitoring.configs.fulls.with_raw_response.list( + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.magic_network_monitoring.configs.full.with_raw_response.get( "6f91088a406011ed95aed352566e8d4c", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" full = await response.parse() - assert_matches_type(FullListResponse, full, path=["response"]) + assert_matches_type(FullGetResponse, full, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.magic_network_monitoring.configs.fulls.with_streaming_response.list( + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.magic_network_monitoring.configs.full.with_streaming_response.get( "6f91088a406011ed95aed352566e8d4c", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" full = await response.parse() - assert_matches_type(FullListResponse, full, path=["response"]) + assert_matches_type(FullGetResponse, full, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/magic_network_monitoring/test_configs.py b/tests/api_resources/magic_network_monitoring/test_configs.py index 64bfda33eca..f11aa1294da 100644 --- a/tests/api_resources/magic_network_monitoring/test_configs.py +++ b/tests/api_resources/magic_network_monitoring/test_configs.py @@ -10,8 +10,8 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.types.magic_network_monitoring import ( + ConfigGetResponse, ConfigEditResponse, - ConfigListResponse, ConfigCreateResponse, ConfigDeleteResponse, ConfigUpdateResponse, @@ -93,103 +93,103 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_method_list(self, client: Cloudflare) -> None: - config = client.magic_network_monitoring.configs.list( + def test_method_delete(self, client: Cloudflare) -> None: + config = client.magic_network_monitoring.configs.delete( "6f91088a406011ed95aed352566e8d4c", ) - assert_matches_type(ConfigListResponse, config, path=["response"]) + assert_matches_type(ConfigDeleteResponse, config, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.magic_network_monitoring.configs.with_raw_response.list( + def test_raw_response_delete(self, client: Cloudflare) -> None: + response = client.magic_network_monitoring.configs.with_raw_response.delete( "6f91088a406011ed95aed352566e8d4c", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = response.parse() - assert_matches_type(ConfigListResponse, config, path=["response"]) + assert_matches_type(ConfigDeleteResponse, config, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.magic_network_monitoring.configs.with_streaming_response.list( + def test_streaming_response_delete(self, client: Cloudflare) -> None: + with client.magic_network_monitoring.configs.with_streaming_response.delete( "6f91088a406011ed95aed352566e8d4c", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = response.parse() - assert_matches_type(ConfigListResponse, config, path=["response"]) + assert_matches_type(ConfigDeleteResponse, config, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - def test_method_delete(self, client: Cloudflare) -> None: - config = client.magic_network_monitoring.configs.delete( + def test_method_edit(self, client: Cloudflare) -> None: + config = client.magic_network_monitoring.configs.edit( "6f91088a406011ed95aed352566e8d4c", ) - assert_matches_type(ConfigDeleteResponse, config, path=["response"]) + assert_matches_type(ConfigEditResponse, config, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_delete(self, client: Cloudflare) -> None: - response = client.magic_network_monitoring.configs.with_raw_response.delete( + def test_raw_response_edit(self, client: Cloudflare) -> None: + response = client.magic_network_monitoring.configs.with_raw_response.edit( "6f91088a406011ed95aed352566e8d4c", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = response.parse() - assert_matches_type(ConfigDeleteResponse, config, path=["response"]) + assert_matches_type(ConfigEditResponse, config, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_delete(self, client: Cloudflare) -> None: - with client.magic_network_monitoring.configs.with_streaming_response.delete( + def test_streaming_response_edit(self, client: Cloudflare) -> None: + with client.magic_network_monitoring.configs.with_streaming_response.edit( "6f91088a406011ed95aed352566e8d4c", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = response.parse() - assert_matches_type(ConfigDeleteResponse, config, path=["response"]) + assert_matches_type(ConfigEditResponse, config, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - def test_method_edit(self, client: Cloudflare) -> None: - config = client.magic_network_monitoring.configs.edit( + def test_method_get(self, client: Cloudflare) -> None: + config = client.magic_network_monitoring.configs.get( "6f91088a406011ed95aed352566e8d4c", ) - assert_matches_type(ConfigEditResponse, config, path=["response"]) + assert_matches_type(ConfigGetResponse, config, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_edit(self, client: Cloudflare) -> None: - response = client.magic_network_monitoring.configs.with_raw_response.edit( + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.magic_network_monitoring.configs.with_raw_response.get( "6f91088a406011ed95aed352566e8d4c", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = response.parse() - assert_matches_type(ConfigEditResponse, config, path=["response"]) + assert_matches_type(ConfigGetResponse, config, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_edit(self, client: Cloudflare) -> None: - with client.magic_network_monitoring.configs.with_streaming_response.edit( + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.magic_network_monitoring.configs.with_streaming_response.get( "6f91088a406011ed95aed352566e8d4c", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = response.parse() - assert_matches_type(ConfigEditResponse, config, path=["response"]) + assert_matches_type(ConfigGetResponse, config, path=["response"]) assert cast(Any, response.is_closed) is True @@ -267,102 +267,102 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> @pytest.mark.skip() @parametrize - async def test_method_list(self, async_client: AsyncCloudflare) -> None: - config = await async_client.magic_network_monitoring.configs.list( + async def test_method_delete(self, async_client: AsyncCloudflare) -> None: + config = await async_client.magic_network_monitoring.configs.delete( "6f91088a406011ed95aed352566e8d4c", ) - assert_matches_type(ConfigListResponse, config, path=["response"]) + assert_matches_type(ConfigDeleteResponse, config, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.magic_network_monitoring.configs.with_raw_response.list( + async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: + response = await async_client.magic_network_monitoring.configs.with_raw_response.delete( "6f91088a406011ed95aed352566e8d4c", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = await response.parse() - assert_matches_type(ConfigListResponse, config, path=["response"]) + assert_matches_type(ConfigDeleteResponse, config, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.magic_network_monitoring.configs.with_streaming_response.list( + async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: + async with async_client.magic_network_monitoring.configs.with_streaming_response.delete( "6f91088a406011ed95aed352566e8d4c", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = await response.parse() - assert_matches_type(ConfigListResponse, config, path=["response"]) + assert_matches_type(ConfigDeleteResponse, config, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - async def test_method_delete(self, async_client: AsyncCloudflare) -> None: - config = await async_client.magic_network_monitoring.configs.delete( + async def test_method_edit(self, async_client: AsyncCloudflare) -> None: + config = await async_client.magic_network_monitoring.configs.edit( "6f91088a406011ed95aed352566e8d4c", ) - assert_matches_type(ConfigDeleteResponse, config, path=["response"]) + assert_matches_type(ConfigEditResponse, config, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: - response = await async_client.magic_network_monitoring.configs.with_raw_response.delete( + async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: + response = await async_client.magic_network_monitoring.configs.with_raw_response.edit( "6f91088a406011ed95aed352566e8d4c", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = await response.parse() - assert_matches_type(ConfigDeleteResponse, config, path=["response"]) + assert_matches_type(ConfigEditResponse, config, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: - async with async_client.magic_network_monitoring.configs.with_streaming_response.delete( + async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: + async with async_client.magic_network_monitoring.configs.with_streaming_response.edit( "6f91088a406011ed95aed352566e8d4c", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = await response.parse() - assert_matches_type(ConfigDeleteResponse, config, path=["response"]) + assert_matches_type(ConfigEditResponse, config, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - async def test_method_edit(self, async_client: AsyncCloudflare) -> None: - config = await async_client.magic_network_monitoring.configs.edit( + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + config = await async_client.magic_network_monitoring.configs.get( "6f91088a406011ed95aed352566e8d4c", ) - assert_matches_type(ConfigEditResponse, config, path=["response"]) + assert_matches_type(ConfigGetResponse, config, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: - response = await async_client.magic_network_monitoring.configs.with_raw_response.edit( + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.magic_network_monitoring.configs.with_raw_response.get( "6f91088a406011ed95aed352566e8d4c", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = await response.parse() - assert_matches_type(ConfigEditResponse, config, path=["response"]) + assert_matches_type(ConfigGetResponse, config, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: - async with async_client.magic_network_monitoring.configs.with_streaming_response.edit( + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.magic_network_monitoring.configs.with_streaming_response.get( "6f91088a406011ed95aed352566e8d4c", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = await response.parse() - assert_matches_type(ConfigEditResponse, config, path=["response"]) + assert_matches_type(ConfigGetResponse, config, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/magic_transit/ipsec_tunnels/test_psk_generates.py b/tests/api_resources/magic_transit/ipsec_tunnels/test_psk_generates.py deleted file mode 100644 index 26f954cf438..00000000000 --- a/tests/api_resources/magic_transit/ipsec_tunnels/test_psk_generates.py +++ /dev/null @@ -1,126 +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.magic_transit.ipsec_tunnels import PSKGenerateCreateResponse - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestPSKGenerates: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @pytest.mark.skip() - @parametrize - def test_method_create(self, client: Cloudflare) -> None: - psk_generate = client.magic_transit.ipsec_tunnels.psk_generates.create( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(PSKGenerateCreateResponse, psk_generate, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_raw_response_create(self, client: Cloudflare) -> None: - response = client.magic_transit.ipsec_tunnels.psk_generates.with_raw_response.create( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - psk_generate = response.parse() - assert_matches_type(PSKGenerateCreateResponse, psk_generate, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_streaming_response_create(self, client: Cloudflare) -> None: - with client.magic_transit.ipsec_tunnels.psk_generates.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" - - psk_generate = response.parse() - assert_matches_type(PSKGenerateCreateResponse, psk_generate, 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.magic_transit.ipsec_tunnels.psk_generates.with_raw_response.create( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_identifier` but received ''"): - client.magic_transit.ipsec_tunnels.psk_generates.with_raw_response.create( - "", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - -class TestAsyncPSKGenerates: - 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: - psk_generate = await async_client.magic_transit.ipsec_tunnels.psk_generates.create( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(PSKGenerateCreateResponse, psk_generate, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: - response = await async_client.magic_transit.ipsec_tunnels.psk_generates.with_raw_response.create( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - psk_generate = await response.parse() - assert_matches_type(PSKGenerateCreateResponse, psk_generate, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: - async with async_client.magic_transit.ipsec_tunnels.psk_generates.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" - - psk_generate = await response.parse() - assert_matches_type(PSKGenerateCreateResponse, psk_generate, 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.magic_transit.ipsec_tunnels.psk_generates.with_raw_response.create( - "023e105f4ecef8ad9ca31a8372d0c353", - account_identifier="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_identifier` but received ''"): - await async_client.magic_transit.ipsec_tunnels.psk_generates.with_raw_response.create( - "", - account_identifier="023e105f4ecef8ad9ca31a8372d0c353", - ) diff --git a/tests/api_resources/magic_transit/test_ipsec_tunnels.py b/tests/api_resources/magic_transit/test_ipsec_tunnels.py index 8c75ecbdeb3..f9002558d15 100644 --- a/tests/api_resources/magic_transit/test_ipsec_tunnels.py +++ b/tests/api_resources/magic_transit/test_ipsec_tunnels.py @@ -15,6 +15,7 @@ IPSECTunnelCreateResponse, IPSECTunnelDeleteResponse, IPSECTunnelUpdateResponse, + IPSECTunnelPSKGenerateResponse, ) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -335,6 +336,58 @@ def test_path_params_get(self, client: Cloudflare) -> None: account_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) + @pytest.mark.skip() + @parametrize + def test_method_psk_generate(self, client: Cloudflare) -> None: + ipsec_tunnel = client.magic_transit.ipsec_tunnels.psk_generate( + "023e105f4ecef8ad9ca31a8372d0c353", + account_identifier="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(IPSECTunnelPSKGenerateResponse, ipsec_tunnel, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_psk_generate(self, client: Cloudflare) -> None: + response = client.magic_transit.ipsec_tunnels.with_raw_response.psk_generate( + "023e105f4ecef8ad9ca31a8372d0c353", + account_identifier="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + ipsec_tunnel = response.parse() + assert_matches_type(IPSECTunnelPSKGenerateResponse, ipsec_tunnel, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_psk_generate(self, client: Cloudflare) -> None: + with client.magic_transit.ipsec_tunnels.with_streaming_response.psk_generate( + "023e105f4ecef8ad9ca31a8372d0c353", + account_identifier="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + ipsec_tunnel = response.parse() + assert_matches_type(IPSECTunnelPSKGenerateResponse, ipsec_tunnel, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_psk_generate(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"): + client.magic_transit.ipsec_tunnels.with_raw_response.psk_generate( + "023e105f4ecef8ad9ca31a8372d0c353", + account_identifier="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_identifier` but received ''"): + client.magic_transit.ipsec_tunnels.with_raw_response.psk_generate( + "", + account_identifier="023e105f4ecef8ad9ca31a8372d0c353", + ) + class TestAsyncIPSECTunnels: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @@ -650,3 +703,55 @@ async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: "", account_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) + + @pytest.mark.skip() + @parametrize + async def test_method_psk_generate(self, async_client: AsyncCloudflare) -> None: + ipsec_tunnel = await async_client.magic_transit.ipsec_tunnels.psk_generate( + "023e105f4ecef8ad9ca31a8372d0c353", + account_identifier="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(IPSECTunnelPSKGenerateResponse, ipsec_tunnel, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_psk_generate(self, async_client: AsyncCloudflare) -> None: + response = await async_client.magic_transit.ipsec_tunnels.with_raw_response.psk_generate( + "023e105f4ecef8ad9ca31a8372d0c353", + account_identifier="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + ipsec_tunnel = await response.parse() + assert_matches_type(IPSECTunnelPSKGenerateResponse, ipsec_tunnel, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_psk_generate(self, async_client: AsyncCloudflare) -> None: + async with async_client.magic_transit.ipsec_tunnels.with_streaming_response.psk_generate( + "023e105f4ecef8ad9ca31a8372d0c353", + account_identifier="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + ipsec_tunnel = await response.parse() + assert_matches_type(IPSECTunnelPSKGenerateResponse, ipsec_tunnel, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_psk_generate(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_identifier` but received ''"): + await async_client.magic_transit.ipsec_tunnels.with_raw_response.psk_generate( + "023e105f4ecef8ad9ca31a8372d0c353", + account_identifier="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_identifier` but received ''"): + await async_client.magic_transit.ipsec_tunnels.with_raw_response.psk_generate( + "", + account_identifier="023e105f4ecef8ad9ca31a8372d0c353", + ) diff --git a/tests/api_resources/mtls_certificates/test_associations.py b/tests/api_resources/mtls_certificates/test_associations.py index ea0b5c6cfc9..b14f612b233 100644 --- a/tests/api_resources/mtls_certificates/test_associations.py +++ b/tests/api_resources/mtls_certificates/test_associations.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.mtls_certificates import AssociationListResponse +from cloudflare.types.mtls_certificates import AssociationGetResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -19,17 +19,17 @@ class TestAssociations: @pytest.mark.skip() @parametrize - def test_method_list(self, client: Cloudflare) -> None: - association = client.mtls_certificates.associations.list( + def test_method_get(self, client: Cloudflare) -> None: + association = client.mtls_certificates.associations.get( "023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[AssociationListResponse], association, path=["response"]) + assert_matches_type(Optional[AssociationGetResponse], association, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.mtls_certificates.associations.with_raw_response.list( + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.mtls_certificates.associations.with_raw_response.get( "023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -37,12 +37,12 @@ def test_raw_response_list(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" association = response.parse() - assert_matches_type(Optional[AssociationListResponse], association, path=["response"]) + assert_matches_type(Optional[AssociationGetResponse], association, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.mtls_certificates.associations.with_streaming_response.list( + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.mtls_certificates.associations.with_streaming_response.get( "023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: @@ -50,21 +50,21 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" association = response.parse() - assert_matches_type(Optional[AssociationListResponse], association, path=["response"]) + assert_matches_type(Optional[AssociationGetResponse], association, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - def test_path_params_list(self, client: Cloudflare) -> None: + def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.mtls_certificates.associations.with_raw_response.list( + client.mtls_certificates.associations.with_raw_response.get( "023e105f4ecef8ad9ca31a8372d0c353", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `mtls_certificate_id` but received ''"): - client.mtls_certificates.associations.with_raw_response.list( + client.mtls_certificates.associations.with_raw_response.get( "", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -75,17 +75,17 @@ class TestAsyncAssociations: @pytest.mark.skip() @parametrize - async def test_method_list(self, async_client: AsyncCloudflare) -> None: - association = await async_client.mtls_certificates.associations.list( + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + association = await async_client.mtls_certificates.associations.get( "023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[AssociationListResponse], association, path=["response"]) + assert_matches_type(Optional[AssociationGetResponse], association, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.mtls_certificates.associations.with_raw_response.list( + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.mtls_certificates.associations.with_raw_response.get( "023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -93,12 +93,12 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" association = await response.parse() - assert_matches_type(Optional[AssociationListResponse], association, path=["response"]) + assert_matches_type(Optional[AssociationGetResponse], association, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.mtls_certificates.associations.with_streaming_response.list( + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.mtls_certificates.associations.with_streaming_response.get( "023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: @@ -106,21 +106,21 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" association = await response.parse() - assert_matches_type(Optional[AssociationListResponse], association, path=["response"]) + assert_matches_type(Optional[AssociationGetResponse], association, 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: + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.mtls_certificates.associations.with_raw_response.list( + await async_client.mtls_certificates.associations.with_raw_response.get( "023e105f4ecef8ad9ca31a8372d0c353", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `mtls_certificate_id` but received ''"): - await async_client.mtls_certificates.associations.with_raw_response.list( + await async_client.mtls_certificates.associations.with_raw_response.get( "", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) diff --git a/tests/api_resources/pages/projects/deployments/history/test_logs.py b/tests/api_resources/pages/projects/deployments/history/test_logs.py index 2bdb2807684..55a56ee9f09 100644 --- a/tests/api_resources/pages/projects/deployments/history/test_logs.py +++ b/tests/api_resources/pages/projects/deployments/history/test_logs.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.pages.projects.deployments.history import LogListResponse +from cloudflare.types.pages.projects.deployments.history import LogGetResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -19,18 +19,18 @@ class TestLogs: @pytest.mark.skip() @parametrize - def test_method_list(self, client: Cloudflare) -> None: - log = client.pages.projects.deployments.history.logs.list( + def test_method_get(self, client: Cloudflare) -> None: + log = client.pages.projects.deployments.history.logs.get( "023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", project_name="this-is-my-project-01", ) - assert_matches_type(LogListResponse, log, path=["response"]) + assert_matches_type(LogGetResponse, log, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.pages.projects.deployments.history.logs.with_raw_response.list( + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.pages.projects.deployments.history.logs.with_raw_response.get( "023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", project_name="this-is-my-project-01", @@ -39,12 +39,12 @@ def test_raw_response_list(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" log = response.parse() - assert_matches_type(LogListResponse, log, path=["response"]) + assert_matches_type(LogGetResponse, log, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.pages.projects.deployments.history.logs.with_streaming_response.list( + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.pages.projects.deployments.history.logs.with_streaming_response.get( "023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", project_name="this-is-my-project-01", @@ -53,29 +53,29 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" log = response.parse() - assert_matches_type(LogListResponse, log, path=["response"]) + assert_matches_type(LogGetResponse, log, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - def test_path_params_list(self, client: Cloudflare) -> None: + def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.pages.projects.deployments.history.logs.with_raw_response.list( + client.pages.projects.deployments.history.logs.with_raw_response.get( "023e105f4ecef8ad9ca31a8372d0c353", account_id="", project_name="this-is-my-project-01", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `project_name` but received ''"): - client.pages.projects.deployments.history.logs.with_raw_response.list( + client.pages.projects.deployments.history.logs.with_raw_response.get( "023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", project_name="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `deployment_id` but received ''"): - client.pages.projects.deployments.history.logs.with_raw_response.list( + client.pages.projects.deployments.history.logs.with_raw_response.get( "", account_id="023e105f4ecef8ad9ca31a8372d0c353", project_name="this-is-my-project-01", @@ -87,18 +87,18 @@ class TestAsyncLogs: @pytest.mark.skip() @parametrize - async def test_method_list(self, async_client: AsyncCloudflare) -> None: - log = await async_client.pages.projects.deployments.history.logs.list( + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + log = await async_client.pages.projects.deployments.history.logs.get( "023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", project_name="this-is-my-project-01", ) - assert_matches_type(LogListResponse, log, path=["response"]) + assert_matches_type(LogGetResponse, log, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.pages.projects.deployments.history.logs.with_raw_response.list( + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.pages.projects.deployments.history.logs.with_raw_response.get( "023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", project_name="this-is-my-project-01", @@ -107,12 +107,12 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" log = await response.parse() - assert_matches_type(LogListResponse, log, path=["response"]) + assert_matches_type(LogGetResponse, log, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.pages.projects.deployments.history.logs.with_streaming_response.list( + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.pages.projects.deployments.history.logs.with_streaming_response.get( "023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", project_name="this-is-my-project-01", @@ -121,29 +121,29 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" log = await response.parse() - assert_matches_type(LogListResponse, log, path=["response"]) + assert_matches_type(LogGetResponse, log, 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: + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.pages.projects.deployments.history.logs.with_raw_response.list( + await async_client.pages.projects.deployments.history.logs.with_raw_response.get( "023e105f4ecef8ad9ca31a8372d0c353", account_id="", project_name="this-is-my-project-01", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `project_name` but received ''"): - await async_client.pages.projects.deployments.history.logs.with_raw_response.list( + await async_client.pages.projects.deployments.history.logs.with_raw_response.get( "023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", project_name="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `deployment_id` but received ''"): - await async_client.pages.projects.deployments.history.logs.with_raw_response.list( + await async_client.pages.projects.deployments.history.logs.with_raw_response.get( "", account_id="023e105f4ecef8ad9ca31a8372d0c353", project_name="this-is-my-project-01", diff --git a/tests/api_resources/queues/test_consumers.py b/tests/api_resources/queues/test_consumers.py index c5a7bdaf619..719fe9a274b 100644 --- a/tests/api_resources/queues/test_consumers.py +++ b/tests/api_resources/queues/test_consumers.py @@ -10,7 +10,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.types.queues import ( - ConsumerListResponse, + ConsumerGetResponse, ConsumerCreateResponse, ConsumerDeleteResponse, ConsumerUpdateResponse, @@ -226,118 +226,118 @@ def test_path_params_update(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_method_list(self, client: Cloudflare) -> None: - consumer = client.queues.consumers.list( - "example-queue", + def test_method_delete(self, client: Cloudflare) -> None: + consumer = client.queues.consumers.delete( + "example-consumer", account_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example-queue", ) - assert_matches_type(Optional[ConsumerListResponse], consumer, path=["response"]) + assert_matches_type(Optional[ConsumerDeleteResponse], consumer, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.queues.consumers.with_raw_response.list( - "example-queue", + def test_raw_response_delete(self, client: Cloudflare) -> None: + response = client.queues.consumers.with_raw_response.delete( + "example-consumer", account_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example-queue", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" consumer = response.parse() - assert_matches_type(Optional[ConsumerListResponse], consumer, path=["response"]) + assert_matches_type(Optional[ConsumerDeleteResponse], consumer, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.queues.consumers.with_streaming_response.list( - "example-queue", + def test_streaming_response_delete(self, client: Cloudflare) -> None: + with client.queues.consumers.with_streaming_response.delete( + "example-consumer", account_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example-queue", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" consumer = response.parse() - assert_matches_type(Optional[ConsumerListResponse], consumer, path=["response"]) + assert_matches_type(Optional[ConsumerDeleteResponse], consumer, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - def test_path_params_list(self, client: Cloudflare) -> None: + def test_path_params_delete(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.queues.consumers.with_raw_response.list( - "example-queue", + client.queues.consumers.with_raw_response.delete( + "example-consumer", account_id="", + name="example-queue", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `name` but received ''"): - client.queues.consumers.with_raw_response.list( + client.queues.consumers.with_raw_response.delete( + "example-consumer", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + name="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `consumer_name` but received ''"): + client.queues.consumers.with_raw_response.delete( "", account_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example-queue", ) @pytest.mark.skip() @parametrize - def test_method_delete(self, client: Cloudflare) -> None: - consumer = client.queues.consumers.delete( - "example-consumer", + def test_method_get(self, client: Cloudflare) -> None: + consumer = client.queues.consumers.get( + "example-queue", account_id="023e105f4ecef8ad9ca31a8372d0c353", - name="example-queue", ) - assert_matches_type(Optional[ConsumerDeleteResponse], consumer, path=["response"]) + assert_matches_type(Optional[ConsumerGetResponse], consumer, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_delete(self, client: Cloudflare) -> None: - response = client.queues.consumers.with_raw_response.delete( - "example-consumer", + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.queues.consumers.with_raw_response.get( + "example-queue", account_id="023e105f4ecef8ad9ca31a8372d0c353", - name="example-queue", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" consumer = response.parse() - assert_matches_type(Optional[ConsumerDeleteResponse], consumer, path=["response"]) + assert_matches_type(Optional[ConsumerGetResponse], consumer, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_delete(self, client: Cloudflare) -> None: - with client.queues.consumers.with_streaming_response.delete( - "example-consumer", + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.queues.consumers.with_streaming_response.get( + "example-queue", account_id="023e105f4ecef8ad9ca31a8372d0c353", - name="example-queue", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" consumer = response.parse() - assert_matches_type(Optional[ConsumerDeleteResponse], consumer, path=["response"]) + assert_matches_type(Optional[ConsumerGetResponse], consumer, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - def test_path_params_delete(self, client: Cloudflare) -> None: + def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.queues.consumers.with_raw_response.delete( - "example-consumer", + client.queues.consumers.with_raw_response.get( + "example-queue", account_id="", - name="example-queue", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `name` but received ''"): - client.queues.consumers.with_raw_response.delete( - "example-consumer", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - name="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `consumer_name` but received ''"): - client.queues.consumers.with_raw_response.delete( + client.queues.consumers.with_raw_response.get( "", account_id="023e105f4ecef8ad9ca31a8372d0c353", - name="example-queue", ) @@ -548,116 +548,116 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip() @parametrize - async def test_method_list(self, async_client: AsyncCloudflare) -> None: - consumer = await async_client.queues.consumers.list( - "example-queue", + async def test_method_delete(self, async_client: AsyncCloudflare) -> None: + consumer = await async_client.queues.consumers.delete( + "example-consumer", account_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example-queue", ) - assert_matches_type(Optional[ConsumerListResponse], consumer, path=["response"]) + assert_matches_type(Optional[ConsumerDeleteResponse], consumer, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.queues.consumers.with_raw_response.list( - "example-queue", + async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: + response = await async_client.queues.consumers.with_raw_response.delete( + "example-consumer", account_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example-queue", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" consumer = await response.parse() - assert_matches_type(Optional[ConsumerListResponse], consumer, path=["response"]) + assert_matches_type(Optional[ConsumerDeleteResponse], consumer, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.queues.consumers.with_streaming_response.list( - "example-queue", + async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: + async with async_client.queues.consumers.with_streaming_response.delete( + "example-consumer", account_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example-queue", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" consumer = await response.parse() - assert_matches_type(Optional[ConsumerListResponse], consumer, path=["response"]) + assert_matches_type(Optional[ConsumerDeleteResponse], consumer, 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: + async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.queues.consumers.with_raw_response.list( - "example-queue", + await async_client.queues.consumers.with_raw_response.delete( + "example-consumer", account_id="", + name="example-queue", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `name` but received ''"): - await async_client.queues.consumers.with_raw_response.list( + await async_client.queues.consumers.with_raw_response.delete( + "example-consumer", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + name="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `consumer_name` but received ''"): + await async_client.queues.consumers.with_raw_response.delete( "", account_id="023e105f4ecef8ad9ca31a8372d0c353", + name="example-queue", ) @pytest.mark.skip() @parametrize - async def test_method_delete(self, async_client: AsyncCloudflare) -> None: - consumer = await async_client.queues.consumers.delete( - "example-consumer", + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + consumer = await async_client.queues.consumers.get( + "example-queue", account_id="023e105f4ecef8ad9ca31a8372d0c353", - name="example-queue", ) - assert_matches_type(Optional[ConsumerDeleteResponse], consumer, path=["response"]) + assert_matches_type(Optional[ConsumerGetResponse], consumer, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: - response = await async_client.queues.consumers.with_raw_response.delete( - "example-consumer", + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.queues.consumers.with_raw_response.get( + "example-queue", account_id="023e105f4ecef8ad9ca31a8372d0c353", - name="example-queue", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" consumer = await response.parse() - assert_matches_type(Optional[ConsumerDeleteResponse], consumer, path=["response"]) + assert_matches_type(Optional[ConsumerGetResponse], consumer, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: - async with async_client.queues.consumers.with_streaming_response.delete( - "example-consumer", + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.queues.consumers.with_streaming_response.get( + "example-queue", account_id="023e105f4ecef8ad9ca31a8372d0c353", - name="example-queue", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" consumer = await response.parse() - assert_matches_type(Optional[ConsumerDeleteResponse], consumer, path=["response"]) + assert_matches_type(Optional[ConsumerGetResponse], consumer, 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: + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.queues.consumers.with_raw_response.delete( - "example-consumer", + await async_client.queues.consumers.with_raw_response.get( + "example-queue", account_id="", - name="example-queue", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `name` but received ''"): - await async_client.queues.consumers.with_raw_response.delete( - "example-consumer", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - name="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `consumer_name` but received ''"): - await async_client.queues.consumers.with_raw_response.delete( + await async_client.queues.consumers.with_raw_response.get( "", account_id="023e105f4ecef8ad9ca31a8372d0c353", - name="example-queue", ) diff --git a/tests/api_resources/ssl/certificate_packs/test_quota.py b/tests/api_resources/ssl/certificate_packs/test_quota.py index 1bfb445a946..738a0464e0f 100644 --- a/tests/api_resources/ssl/certificate_packs/test_quota.py +++ b/tests/api_resources/ssl/certificate_packs/test_quota.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.ssl.certificate_packs import QuotaListResponse +from cloudflare.types.ssl.certificate_packs import QuotaGetResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -19,43 +19,43 @@ class TestQuota: @pytest.mark.skip() @parametrize - def test_method_list(self, client: Cloudflare) -> None: - quota = client.ssl.certificate_packs.quota.list( + def test_method_get(self, client: Cloudflare) -> None: + quota = client.ssl.certificate_packs.quota.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(QuotaListResponse, quota, path=["response"]) + assert_matches_type(QuotaGetResponse, quota, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.ssl.certificate_packs.quota.with_raw_response.list( + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.ssl.certificate_packs.quota.with_raw_response.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" quota = response.parse() - assert_matches_type(QuotaListResponse, quota, path=["response"]) + assert_matches_type(QuotaGetResponse, quota, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.ssl.certificate_packs.quota.with_streaming_response.list( + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.ssl.certificate_packs.quota.with_streaming_response.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" quota = response.parse() - assert_matches_type(QuotaListResponse, quota, path=["response"]) + assert_matches_type(QuotaGetResponse, quota, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - def test_path_params_list(self, client: Cloudflare) -> None: + def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - client.ssl.certificate_packs.quota.with_raw_response.list( + client.ssl.certificate_packs.quota.with_raw_response.get( zone_id="", ) @@ -65,42 +65,42 @@ class TestAsyncQuota: @pytest.mark.skip() @parametrize - async def test_method_list(self, async_client: AsyncCloudflare) -> None: - quota = await async_client.ssl.certificate_packs.quota.list( + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + quota = await async_client.ssl.certificate_packs.quota.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(QuotaListResponse, quota, path=["response"]) + assert_matches_type(QuotaGetResponse, quota, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.ssl.certificate_packs.quota.with_raw_response.list( + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.ssl.certificate_packs.quota.with_raw_response.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" quota = await response.parse() - assert_matches_type(QuotaListResponse, quota, path=["response"]) + assert_matches_type(QuotaGetResponse, quota, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.ssl.certificate_packs.quota.with_streaming_response.list( + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.ssl.certificate_packs.quota.with_streaming_response.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" quota = await response.parse() - assert_matches_type(QuotaListResponse, quota, path=["response"]) + assert_matches_type(QuotaGetResponse, quota, 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: + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - await async_client.ssl.certificate_packs.quota.with_raw_response.list( + await async_client.ssl.certificate_packs.quota.with_raw_response.get( zone_id="", ) diff --git a/tests/api_resources/ssl/test_recommendations.py b/tests/api_resources/ssl/test_recommendations.py index 3c617634752..223636bbe4c 100644 --- a/tests/api_resources/ssl/test_recommendations.py +++ b/tests/api_resources/ssl/test_recommendations.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.ssl import RecommendationListResponse +from cloudflare.types.ssl import RecommendationGetResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -19,43 +19,43 @@ class TestRecommendations: @pytest.mark.skip() @parametrize - def test_method_list(self, client: Cloudflare) -> None: - recommendation = client.ssl.recommendations.list( + def test_method_get(self, client: Cloudflare) -> None: + recommendation = client.ssl.recommendations.get( "023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecommendationListResponse], recommendation, path=["response"]) + assert_matches_type(Optional[RecommendationGetResponse], recommendation, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.ssl.recommendations.with_raw_response.list( + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.ssl.recommendations.with_raw_response.get( "023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" recommendation = response.parse() - assert_matches_type(Optional[RecommendationListResponse], recommendation, path=["response"]) + assert_matches_type(Optional[RecommendationGetResponse], recommendation, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.ssl.recommendations.with_streaming_response.list( + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.ssl.recommendations.with_streaming_response.get( "023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" recommendation = response.parse() - assert_matches_type(Optional[RecommendationListResponse], recommendation, path=["response"]) + assert_matches_type(Optional[RecommendationGetResponse], recommendation, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - def test_path_params_list(self, client: Cloudflare) -> None: + def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_identifier` but received ''"): - client.ssl.recommendations.with_raw_response.list( + client.ssl.recommendations.with_raw_response.get( "", ) @@ -65,42 +65,42 @@ class TestAsyncRecommendations: @pytest.mark.skip() @parametrize - async def test_method_list(self, async_client: AsyncCloudflare) -> None: - recommendation = await async_client.ssl.recommendations.list( + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + recommendation = await async_client.ssl.recommendations.get( "023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RecommendationListResponse], recommendation, path=["response"]) + assert_matches_type(Optional[RecommendationGetResponse], recommendation, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.ssl.recommendations.with_raw_response.list( + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.ssl.recommendations.with_raw_response.get( "023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" recommendation = await response.parse() - assert_matches_type(Optional[RecommendationListResponse], recommendation, path=["response"]) + assert_matches_type(Optional[RecommendationGetResponse], recommendation, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.ssl.recommendations.with_streaming_response.list( + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.ssl.recommendations.with_streaming_response.get( "023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" recommendation = await response.parse() - assert_matches_type(Optional[RecommendationListResponse], recommendation, path=["response"]) + assert_matches_type(Optional[RecommendationGetResponse], recommendation, 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: + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_identifier` but received ''"): - await async_client.ssl.recommendations.with_raw_response.list( + await async_client.ssl.recommendations.with_raw_response.get( "", ) diff --git a/tests/api_resources/ssl/test_verification.py b/tests/api_resources/ssl/test_verification.py index 58152384adc..0696c47a544 100644 --- a/tests/api_resources/ssl/test_verification.py +++ b/tests/api_resources/ssl/test_verification.py @@ -10,8 +10,8 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.types.ssl import ( + VerificationGetResponse, VerificationEditResponse, - VerificationListResponse, ) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -20,57 +20,6 @@ class TestVerification: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() - @parametrize - def test_method_list(self, client: Cloudflare) -> None: - verification = client.ssl.verification.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(Optional[VerificationListResponse], verification, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_method_list_with_all_params(self, client: Cloudflare) -> None: - verification = client.ssl.verification.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - retry=True, - ) - assert_matches_type(Optional[VerificationListResponse], verification, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.ssl.verification.with_raw_response.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - verification = response.parse() - assert_matches_type(Optional[VerificationListResponse], verification, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.ssl.verification.with_streaming_response.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - verification = response.parse() - assert_matches_type(Optional[VerificationListResponse], verification, 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 `zone_id` but received ''"): - client.ssl.verification.with_raw_response.list( - zone_id="", - ) - @pytest.mark.skip() @parametrize def test_method_edit(self, client: Cloudflare) -> None: @@ -128,61 +77,61 @@ def test_path_params_edit(self, client: Cloudflare) -> None: validation_method="txt", ) - -class TestAsyncVerification: - 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: - verification = await async_client.ssl.verification.list( + def test_method_get(self, client: Cloudflare) -> None: + verification = client.ssl.verification.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[VerificationListResponse], verification, path=["response"]) + assert_matches_type(Optional[VerificationGetResponse], verification, path=["response"]) @pytest.mark.skip() @parametrize - async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: - verification = await async_client.ssl.verification.list( + def test_method_get_with_all_params(self, client: Cloudflare) -> None: + verification = client.ssl.verification.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", retry=True, ) - assert_matches_type(Optional[VerificationListResponse], verification, path=["response"]) + assert_matches_type(Optional[VerificationGetResponse], verification, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.ssl.verification.with_raw_response.list( + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.ssl.verification.with_raw_response.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - verification = await response.parse() - assert_matches_type(Optional[VerificationListResponse], verification, path=["response"]) + verification = response.parse() + assert_matches_type(Optional[VerificationGetResponse], verification, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.ssl.verification.with_streaming_response.list( + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.ssl.verification.with_streaming_response.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - verification = await response.parse() - assert_matches_type(Optional[VerificationListResponse], verification, path=["response"]) + verification = response.parse() + assert_matches_type(Optional[VerificationGetResponse], verification, 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: + def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - await async_client.ssl.verification.with_raw_response.list( + client.ssl.verification.with_raw_response.get( zone_id="", ) + +class TestAsyncVerification: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize async def test_method_edit(self, async_client: AsyncCloudflare) -> None: @@ -239,3 +188,54 @@ async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", validation_method="txt", ) + + @pytest.mark.skip() + @parametrize + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + verification = await async_client.ssl.verification.get( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[VerificationGetResponse], verification, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -> None: + verification = await async_client.ssl.verification.get( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + retry=True, + ) + assert_matches_type(Optional[VerificationGetResponse], verification, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.ssl.verification.with_raw_response.get( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + verification = await response.parse() + assert_matches_type(Optional[VerificationGetResponse], verification, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.ssl.verification.with_streaming_response.get( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + verification = await response.parse() + assert_matches_type(Optional[VerificationGetResponse], verification, 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 `zone_id` but received ''"): + await async_client.ssl.verification.with_raw_response.get( + zone_id="", + ) diff --git a/tests/api_resources/stream/test_audio_tracks.py b/tests/api_resources/stream/test_audio_tracks.py index a12de6d7115..8d2a338ab08 100644 --- a/tests/api_resources/stream/test_audio_tracks.py +++ b/tests/api_resources/stream/test_audio_tracks.py @@ -10,9 +10,9 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.types.stream import ( + AudioTrackGetResponse, + AudioTrackCopyResponse, AudioTrackEditResponse, - AudioTrackListResponse, - AudioTrackCreateResponse, AudioTrackDeleteResponse, ) @@ -24,186 +24,134 @@ class TestAudioTracks: @pytest.mark.skip() @parametrize - def test_method_create(self, client: Cloudflare) -> None: - audio_track = client.stream.audio_tracks.create( - "ea95132c15732412d22c1476fa83f27a", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - label="director commentary", - ) - assert_matches_type(AudioTrackCreateResponse, audio_track, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_method_create_with_all_params(self, client: Cloudflare) -> None: - audio_track = client.stream.audio_tracks.create( + def test_method_delete(self, client: Cloudflare) -> None: + audio_track = client.stream.audio_tracks.delete( "ea95132c15732412d22c1476fa83f27a", account_id="023e105f4ecef8ad9ca31a8372d0c353", - label="director commentary", - url="https://www.examplestorage.com/audio_file.mp3", + identifier="ea95132c15732412d22c1476fa83f27a", ) - assert_matches_type(AudioTrackCreateResponse, audio_track, path=["response"]) + assert_matches_type(AudioTrackDeleteResponse, audio_track, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_create(self, client: Cloudflare) -> None: - response = client.stream.audio_tracks.with_raw_response.create( + def test_raw_response_delete(self, client: Cloudflare) -> None: + response = client.stream.audio_tracks.with_raw_response.delete( "ea95132c15732412d22c1476fa83f27a", account_id="023e105f4ecef8ad9ca31a8372d0c353", - label="director commentary", + identifier="ea95132c15732412d22c1476fa83f27a", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" audio_track = response.parse() - assert_matches_type(AudioTrackCreateResponse, audio_track, path=["response"]) + assert_matches_type(AudioTrackDeleteResponse, audio_track, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_create(self, client: Cloudflare) -> None: - with client.stream.audio_tracks.with_streaming_response.create( + def test_streaming_response_delete(self, client: Cloudflare) -> None: + with client.stream.audio_tracks.with_streaming_response.delete( "ea95132c15732412d22c1476fa83f27a", account_id="023e105f4ecef8ad9ca31a8372d0c353", - label="director commentary", + identifier="ea95132c15732412d22c1476fa83f27a", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" audio_track = response.parse() - assert_matches_type(AudioTrackCreateResponse, audio_track, path=["response"]) + assert_matches_type(AudioTrackDeleteResponse, audio_track, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - def test_path_params_create(self, client: Cloudflare) -> None: + def test_path_params_delete(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.stream.audio_tracks.with_raw_response.create( + client.stream.audio_tracks.with_raw_response.delete( "ea95132c15732412d22c1476fa83f27a", account_id="", - label="director commentary", + identifier="ea95132c15732412d22c1476fa83f27a", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `identifier` but received ''"): - client.stream.audio_tracks.with_raw_response.create( - "", + client.stream.audio_tracks.with_raw_response.delete( + "ea95132c15732412d22c1476fa83f27a", account_id="023e105f4ecef8ad9ca31a8372d0c353", - label="director commentary", + identifier="", ) - @pytest.mark.skip() - @parametrize - def test_method_list(self, client: Cloudflare) -> None: - audio_track = client.stream.audio_tracks.list( - "ea95132c15732412d22c1476fa83f27a", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(AudioTrackListResponse, audio_track, path=["response"]) + with pytest.raises(ValueError, match=r"Expected a non-empty value for `audio_identifier` but received ''"): + client.stream.audio_tracks.with_raw_response.delete( + "", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + identifier="ea95132c15732412d22c1476fa83f27a", + ) @pytest.mark.skip() @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.stream.audio_tracks.with_raw_response.list( + def test_method_copy(self, client: Cloudflare) -> None: + audio_track = client.stream.audio_tracks.copy( "ea95132c15732412d22c1476fa83f27a", account_id="023e105f4ecef8ad9ca31a8372d0c353", + label="director commentary", ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - audio_track = response.parse() - assert_matches_type(AudioTrackListResponse, audio_track, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.stream.audio_tracks.with_streaming_response.list( - "ea95132c15732412d22c1476fa83f27a", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - audio_track = response.parse() - assert_matches_type(AudioTrackListResponse, audio_track, 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_id` but received ''"): - client.stream.audio_tracks.with_raw_response.list( - "ea95132c15732412d22c1476fa83f27a", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `identifier` but received ''"): - client.stream.audio_tracks.with_raw_response.list( - "", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) + assert_matches_type(AudioTrackCopyResponse, audio_track, path=["response"]) @pytest.mark.skip() @parametrize - def test_method_delete(self, client: Cloudflare) -> None: - audio_track = client.stream.audio_tracks.delete( + def test_method_copy_with_all_params(self, client: Cloudflare) -> None: + audio_track = client.stream.audio_tracks.copy( "ea95132c15732412d22c1476fa83f27a", account_id="023e105f4ecef8ad9ca31a8372d0c353", - identifier="ea95132c15732412d22c1476fa83f27a", + label="director commentary", + url="https://www.examplestorage.com/audio_file.mp3", ) - assert_matches_type(AudioTrackDeleteResponse, audio_track, path=["response"]) + assert_matches_type(AudioTrackCopyResponse, audio_track, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_delete(self, client: Cloudflare) -> None: - response = client.stream.audio_tracks.with_raw_response.delete( + def test_raw_response_copy(self, client: Cloudflare) -> None: + response = client.stream.audio_tracks.with_raw_response.copy( "ea95132c15732412d22c1476fa83f27a", account_id="023e105f4ecef8ad9ca31a8372d0c353", - identifier="ea95132c15732412d22c1476fa83f27a", + label="director commentary", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" audio_track = response.parse() - assert_matches_type(AudioTrackDeleteResponse, audio_track, path=["response"]) + assert_matches_type(AudioTrackCopyResponse, audio_track, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_delete(self, client: Cloudflare) -> None: - with client.stream.audio_tracks.with_streaming_response.delete( + def test_streaming_response_copy(self, client: Cloudflare) -> None: + with client.stream.audio_tracks.with_streaming_response.copy( "ea95132c15732412d22c1476fa83f27a", account_id="023e105f4ecef8ad9ca31a8372d0c353", - identifier="ea95132c15732412d22c1476fa83f27a", + label="director commentary", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" audio_track = response.parse() - assert_matches_type(AudioTrackDeleteResponse, audio_track, path=["response"]) + assert_matches_type(AudioTrackCopyResponse, audio_track, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - def test_path_params_delete(self, client: Cloudflare) -> None: + def test_path_params_copy(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.stream.audio_tracks.with_raw_response.delete( + client.stream.audio_tracks.with_raw_response.copy( "ea95132c15732412d22c1476fa83f27a", account_id="", - identifier="ea95132c15732412d22c1476fa83f27a", + label="director commentary", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `identifier` but received ''"): - client.stream.audio_tracks.with_raw_response.delete( - "ea95132c15732412d22c1476fa83f27a", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - identifier="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `audio_identifier` but received ''"): - client.stream.audio_tracks.with_raw_response.delete( + client.stream.audio_tracks.with_raw_response.copy( "", account_id="023e105f4ecef8ad9ca31a8372d0c353", - identifier="ea95132c15732412d22c1476fa83f27a", + label="director commentary", ) @pytest.mark.skip() @@ -282,192 +230,192 @@ def test_path_params_edit(self, client: Cloudflare) -> None: identifier="ea95132c15732412d22c1476fa83f27a", ) - -class TestAsyncAudioTracks: - 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: - audio_track = await async_client.stream.audio_tracks.create( - "ea95132c15732412d22c1476fa83f27a", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - label="director commentary", - ) - assert_matches_type(AudioTrackCreateResponse, audio_track, path=["response"]) - @pytest.mark.skip() @parametrize - async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: - audio_track = await async_client.stream.audio_tracks.create( + def test_method_get(self, client: Cloudflare) -> None: + audio_track = client.stream.audio_tracks.get( "ea95132c15732412d22c1476fa83f27a", account_id="023e105f4ecef8ad9ca31a8372d0c353", - label="director commentary", - url="https://www.examplestorage.com/audio_file.mp3", ) - assert_matches_type(AudioTrackCreateResponse, audio_track, path=["response"]) + assert_matches_type(AudioTrackGetResponse, audio_track, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: - response = await async_client.stream.audio_tracks.with_raw_response.create( + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.stream.audio_tracks.with_raw_response.get( "ea95132c15732412d22c1476fa83f27a", account_id="023e105f4ecef8ad9ca31a8372d0c353", - label="director commentary", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - audio_track = await response.parse() - assert_matches_type(AudioTrackCreateResponse, audio_track, path=["response"]) + audio_track = response.parse() + assert_matches_type(AudioTrackGetResponse, audio_track, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: - async with async_client.stream.audio_tracks.with_streaming_response.create( + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.stream.audio_tracks.with_streaming_response.get( "ea95132c15732412d22c1476fa83f27a", account_id="023e105f4ecef8ad9ca31a8372d0c353", - label="director commentary", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - audio_track = await response.parse() - assert_matches_type(AudioTrackCreateResponse, audio_track, path=["response"]) + audio_track = response.parse() + assert_matches_type(AudioTrackGetResponse, audio_track, 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: + def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.stream.audio_tracks.with_raw_response.create( + client.stream.audio_tracks.with_raw_response.get( "ea95132c15732412d22c1476fa83f27a", account_id="", - label="director commentary", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `identifier` but received ''"): - await async_client.stream.audio_tracks.with_raw_response.create( + client.stream.audio_tracks.with_raw_response.get( "", account_id="023e105f4ecef8ad9ca31a8372d0c353", - label="director commentary", ) + +class TestAsyncAudioTracks: + 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: - audio_track = await async_client.stream.audio_tracks.list( + async def test_method_delete(self, async_client: AsyncCloudflare) -> None: + audio_track = await async_client.stream.audio_tracks.delete( "ea95132c15732412d22c1476fa83f27a", account_id="023e105f4ecef8ad9ca31a8372d0c353", + identifier="ea95132c15732412d22c1476fa83f27a", ) - assert_matches_type(AudioTrackListResponse, audio_track, path=["response"]) + assert_matches_type(AudioTrackDeleteResponse, audio_track, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.stream.audio_tracks.with_raw_response.list( + async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: + response = await async_client.stream.audio_tracks.with_raw_response.delete( "ea95132c15732412d22c1476fa83f27a", account_id="023e105f4ecef8ad9ca31a8372d0c353", + identifier="ea95132c15732412d22c1476fa83f27a", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" audio_track = await response.parse() - assert_matches_type(AudioTrackListResponse, audio_track, path=["response"]) + assert_matches_type(AudioTrackDeleteResponse, audio_track, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.stream.audio_tracks.with_streaming_response.list( + async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: + async with async_client.stream.audio_tracks.with_streaming_response.delete( "ea95132c15732412d22c1476fa83f27a", account_id="023e105f4ecef8ad9ca31a8372d0c353", + identifier="ea95132c15732412d22c1476fa83f27a", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" audio_track = await response.parse() - assert_matches_type(AudioTrackListResponse, audio_track, path=["response"]) + assert_matches_type(AudioTrackDeleteResponse, audio_track, 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: + async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.stream.audio_tracks.with_raw_response.list( + await async_client.stream.audio_tracks.with_raw_response.delete( "ea95132c15732412d22c1476fa83f27a", account_id="", + identifier="ea95132c15732412d22c1476fa83f27a", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `identifier` but received ''"): - await async_client.stream.audio_tracks.with_raw_response.list( + await async_client.stream.audio_tracks.with_raw_response.delete( + "ea95132c15732412d22c1476fa83f27a", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + identifier="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `audio_identifier` but received ''"): + await async_client.stream.audio_tracks.with_raw_response.delete( "", account_id="023e105f4ecef8ad9ca31a8372d0c353", + identifier="ea95132c15732412d22c1476fa83f27a", ) @pytest.mark.skip() @parametrize - async def test_method_delete(self, async_client: AsyncCloudflare) -> None: - audio_track = await async_client.stream.audio_tracks.delete( + async def test_method_copy(self, async_client: AsyncCloudflare) -> None: + audio_track = await async_client.stream.audio_tracks.copy( "ea95132c15732412d22c1476fa83f27a", account_id="023e105f4ecef8ad9ca31a8372d0c353", - identifier="ea95132c15732412d22c1476fa83f27a", + label="director commentary", ) - assert_matches_type(AudioTrackDeleteResponse, audio_track, path=["response"]) + assert_matches_type(AudioTrackCopyResponse, audio_track, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: - response = await async_client.stream.audio_tracks.with_raw_response.delete( + async def test_method_copy_with_all_params(self, async_client: AsyncCloudflare) -> None: + audio_track = await async_client.stream.audio_tracks.copy( "ea95132c15732412d22c1476fa83f27a", account_id="023e105f4ecef8ad9ca31a8372d0c353", - identifier="ea95132c15732412d22c1476fa83f27a", + label="director commentary", + url="https://www.examplestorage.com/audio_file.mp3", + ) + assert_matches_type(AudioTrackCopyResponse, audio_track, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_copy(self, async_client: AsyncCloudflare) -> None: + response = await async_client.stream.audio_tracks.with_raw_response.copy( + "ea95132c15732412d22c1476fa83f27a", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + label="director commentary", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" audio_track = await response.parse() - assert_matches_type(AudioTrackDeleteResponse, audio_track, path=["response"]) + assert_matches_type(AudioTrackCopyResponse, audio_track, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: - async with async_client.stream.audio_tracks.with_streaming_response.delete( + async def test_streaming_response_copy(self, async_client: AsyncCloudflare) -> None: + async with async_client.stream.audio_tracks.with_streaming_response.copy( "ea95132c15732412d22c1476fa83f27a", account_id="023e105f4ecef8ad9ca31a8372d0c353", - identifier="ea95132c15732412d22c1476fa83f27a", + label="director commentary", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" audio_track = await response.parse() - assert_matches_type(AudioTrackDeleteResponse, audio_track, path=["response"]) + assert_matches_type(AudioTrackCopyResponse, audio_track, 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: + async def test_path_params_copy(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.stream.audio_tracks.with_raw_response.delete( + await async_client.stream.audio_tracks.with_raw_response.copy( "ea95132c15732412d22c1476fa83f27a", account_id="", - identifier="ea95132c15732412d22c1476fa83f27a", + label="director commentary", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `identifier` but received ''"): - await async_client.stream.audio_tracks.with_raw_response.delete( - "ea95132c15732412d22c1476fa83f27a", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - identifier="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `audio_identifier` but received ''"): - await async_client.stream.audio_tracks.with_raw_response.delete( + await async_client.stream.audio_tracks.with_raw_response.copy( "", account_id="023e105f4ecef8ad9ca31a8372d0c353", - identifier="ea95132c15732412d22c1476fa83f27a", + label="director commentary", ) @pytest.mark.skip() @@ -545,3 +493,55 @@ async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", identifier="ea95132c15732412d22c1476fa83f27a", ) + + @pytest.mark.skip() + @parametrize + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + audio_track = await async_client.stream.audio_tracks.get( + "ea95132c15732412d22c1476fa83f27a", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(AudioTrackGetResponse, audio_track, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.stream.audio_tracks.with_raw_response.get( + "ea95132c15732412d22c1476fa83f27a", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + audio_track = await response.parse() + assert_matches_type(AudioTrackGetResponse, audio_track, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.stream.audio_tracks.with_streaming_response.get( + "ea95132c15732412d22c1476fa83f27a", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + audio_track = await response.parse() + assert_matches_type(AudioTrackGetResponse, audio_track, 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_id` but received ''"): + await async_client.stream.audio_tracks.with_raw_response.get( + "ea95132c15732412d22c1476fa83f27a", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `identifier` but received ''"): + await async_client.stream.audio_tracks.with_raw_response.get( + "", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) diff --git a/tests/api_resources/stream/test_captions.py b/tests/api_resources/stream/test_captions.py index 1aa1eb5a798..c3b7a98830b 100644 --- a/tests/api_resources/stream/test_captions.py +++ b/tests/api_resources/stream/test_captions.py @@ -10,7 +10,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.types.stream import ( - CaptionListResponse, + CaptionGetResponse, CaptionDeleteResponse, CaptionUpdateResponse, ) @@ -93,118 +93,118 @@ def test_path_params_update(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_method_list(self, client: Cloudflare) -> None: - caption = client.stream.captions.list( - "ea95132c15732412d22c1476fa83f27a", + def test_method_delete(self, client: Cloudflare) -> None: + caption = client.stream.captions.delete( + "tr", account_id="023e105f4ecef8ad9ca31a8372d0c353", + identifier="ea95132c15732412d22c1476fa83f27a", ) - assert_matches_type(CaptionListResponse, caption, path=["response"]) + assert_matches_type(CaptionDeleteResponse, caption, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.stream.captions.with_raw_response.list( - "ea95132c15732412d22c1476fa83f27a", + def test_raw_response_delete(self, client: Cloudflare) -> None: + response = client.stream.captions.with_raw_response.delete( + "tr", account_id="023e105f4ecef8ad9ca31a8372d0c353", + identifier="ea95132c15732412d22c1476fa83f27a", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" caption = response.parse() - assert_matches_type(CaptionListResponse, caption, path=["response"]) + assert_matches_type(CaptionDeleteResponse, caption, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.stream.captions.with_streaming_response.list( - "ea95132c15732412d22c1476fa83f27a", + def test_streaming_response_delete(self, client: Cloudflare) -> None: + with client.stream.captions.with_streaming_response.delete( + "tr", account_id="023e105f4ecef8ad9ca31a8372d0c353", + identifier="ea95132c15732412d22c1476fa83f27a", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" caption = response.parse() - assert_matches_type(CaptionListResponse, caption, path=["response"]) + assert_matches_type(CaptionDeleteResponse, caption, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - def test_path_params_list(self, client: Cloudflare) -> None: + def test_path_params_delete(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.stream.captions.with_raw_response.list( - "ea95132c15732412d22c1476fa83f27a", + client.stream.captions.with_raw_response.delete( + "tr", account_id="", + identifier="ea95132c15732412d22c1476fa83f27a", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `identifier` but received ''"): - client.stream.captions.with_raw_response.list( + client.stream.captions.with_raw_response.delete( + "tr", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + identifier="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `language` but received ''"): + client.stream.captions.with_raw_response.delete( "", account_id="023e105f4ecef8ad9ca31a8372d0c353", + identifier="ea95132c15732412d22c1476fa83f27a", ) @pytest.mark.skip() @parametrize - def test_method_delete(self, client: Cloudflare) -> None: - caption = client.stream.captions.delete( - "tr", + def test_method_get(self, client: Cloudflare) -> None: + caption = client.stream.captions.get( + "ea95132c15732412d22c1476fa83f27a", account_id="023e105f4ecef8ad9ca31a8372d0c353", - identifier="ea95132c15732412d22c1476fa83f27a", ) - assert_matches_type(CaptionDeleteResponse, caption, path=["response"]) + assert_matches_type(CaptionGetResponse, caption, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_delete(self, client: Cloudflare) -> None: - response = client.stream.captions.with_raw_response.delete( - "tr", + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.stream.captions.with_raw_response.get( + "ea95132c15732412d22c1476fa83f27a", account_id="023e105f4ecef8ad9ca31a8372d0c353", - identifier="ea95132c15732412d22c1476fa83f27a", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" caption = response.parse() - assert_matches_type(CaptionDeleteResponse, caption, path=["response"]) + assert_matches_type(CaptionGetResponse, caption, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_delete(self, client: Cloudflare) -> None: - with client.stream.captions.with_streaming_response.delete( - "tr", + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.stream.captions.with_streaming_response.get( + "ea95132c15732412d22c1476fa83f27a", account_id="023e105f4ecef8ad9ca31a8372d0c353", - identifier="ea95132c15732412d22c1476fa83f27a", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" caption = response.parse() - assert_matches_type(CaptionDeleteResponse, caption, path=["response"]) + assert_matches_type(CaptionGetResponse, caption, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - def test_path_params_delete(self, client: Cloudflare) -> None: + def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.stream.captions.with_raw_response.delete( - "tr", + client.stream.captions.with_raw_response.get( + "ea95132c15732412d22c1476fa83f27a", account_id="", - identifier="ea95132c15732412d22c1476fa83f27a", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `identifier` but received ''"): - client.stream.captions.with_raw_response.delete( - "tr", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - identifier="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `language` but received ''"): - client.stream.captions.with_raw_response.delete( + client.stream.captions.with_raw_response.get( "", account_id="023e105f4ecef8ad9ca31a8372d0c353", - identifier="ea95132c15732412d22c1476fa83f27a", ) @@ -283,116 +283,116 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip() @parametrize - async def test_method_list(self, async_client: AsyncCloudflare) -> None: - caption = await async_client.stream.captions.list( - "ea95132c15732412d22c1476fa83f27a", + async def test_method_delete(self, async_client: AsyncCloudflare) -> None: + caption = await async_client.stream.captions.delete( + "tr", account_id="023e105f4ecef8ad9ca31a8372d0c353", + identifier="ea95132c15732412d22c1476fa83f27a", ) - assert_matches_type(CaptionListResponse, caption, path=["response"]) + assert_matches_type(CaptionDeleteResponse, caption, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.stream.captions.with_raw_response.list( - "ea95132c15732412d22c1476fa83f27a", + async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: + response = await async_client.stream.captions.with_raw_response.delete( + "tr", account_id="023e105f4ecef8ad9ca31a8372d0c353", + identifier="ea95132c15732412d22c1476fa83f27a", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" caption = await response.parse() - assert_matches_type(CaptionListResponse, caption, path=["response"]) + assert_matches_type(CaptionDeleteResponse, caption, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.stream.captions.with_streaming_response.list( - "ea95132c15732412d22c1476fa83f27a", + async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: + async with async_client.stream.captions.with_streaming_response.delete( + "tr", account_id="023e105f4ecef8ad9ca31a8372d0c353", + identifier="ea95132c15732412d22c1476fa83f27a", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" caption = await response.parse() - assert_matches_type(CaptionListResponse, caption, path=["response"]) + assert_matches_type(CaptionDeleteResponse, caption, 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: + async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.stream.captions.with_raw_response.list( - "ea95132c15732412d22c1476fa83f27a", + await async_client.stream.captions.with_raw_response.delete( + "tr", account_id="", + identifier="ea95132c15732412d22c1476fa83f27a", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `identifier` but received ''"): - await async_client.stream.captions.with_raw_response.list( + await async_client.stream.captions.with_raw_response.delete( + "tr", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + identifier="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `language` but received ''"): + await async_client.stream.captions.with_raw_response.delete( "", account_id="023e105f4ecef8ad9ca31a8372d0c353", + identifier="ea95132c15732412d22c1476fa83f27a", ) @pytest.mark.skip() @parametrize - async def test_method_delete(self, async_client: AsyncCloudflare) -> None: - caption = await async_client.stream.captions.delete( - "tr", + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + caption = await async_client.stream.captions.get( + "ea95132c15732412d22c1476fa83f27a", account_id="023e105f4ecef8ad9ca31a8372d0c353", - identifier="ea95132c15732412d22c1476fa83f27a", ) - assert_matches_type(CaptionDeleteResponse, caption, path=["response"]) + assert_matches_type(CaptionGetResponse, caption, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: - response = await async_client.stream.captions.with_raw_response.delete( - "tr", + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.stream.captions.with_raw_response.get( + "ea95132c15732412d22c1476fa83f27a", account_id="023e105f4ecef8ad9ca31a8372d0c353", - identifier="ea95132c15732412d22c1476fa83f27a", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" caption = await response.parse() - assert_matches_type(CaptionDeleteResponse, caption, path=["response"]) + assert_matches_type(CaptionGetResponse, caption, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: - async with async_client.stream.captions.with_streaming_response.delete( - "tr", + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.stream.captions.with_streaming_response.get( + "ea95132c15732412d22c1476fa83f27a", account_id="023e105f4ecef8ad9ca31a8372d0c353", - identifier="ea95132c15732412d22c1476fa83f27a", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" caption = await response.parse() - assert_matches_type(CaptionDeleteResponse, caption, path=["response"]) + assert_matches_type(CaptionGetResponse, caption, 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: + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.stream.captions.with_raw_response.delete( - "tr", + await async_client.stream.captions.with_raw_response.get( + "ea95132c15732412d22c1476fa83f27a", account_id="", - identifier="ea95132c15732412d22c1476fa83f27a", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `identifier` but received ''"): - await async_client.stream.captions.with_raw_response.delete( - "tr", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - identifier="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `language` but received ''"): - await async_client.stream.captions.with_raw_response.delete( + await async_client.stream.captions.with_raw_response.get( "", account_id="023e105f4ecef8ad9ca31a8372d0c353", - identifier="ea95132c15732412d22c1476fa83f27a", ) diff --git a/tests/api_resources/stream/test_downloads.py b/tests/api_resources/stream/test_downloads.py index 4fd7d8d9ed4..c37f487bdc5 100644 --- a/tests/api_resources/stream/test_downloads.py +++ b/tests/api_resources/stream/test_downloads.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.stream import DownloadListResponse, DownloadCreateResponse, DownloadDeleteResponse +from cloudflare.types.stream import DownloadGetResponse, DownloadCreateResponse, DownloadDeleteResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -71,17 +71,17 @@ def test_path_params_create(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_method_list(self, client: Cloudflare) -> None: - download = client.stream.downloads.list( + def test_method_delete(self, client: Cloudflare) -> None: + download = client.stream.downloads.delete( "ea95132c15732412d22c1476fa83f27a", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(DownloadListResponse, download, path=["response"]) + assert_matches_type(DownloadDeleteResponse, download, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.stream.downloads.with_raw_response.list( + def test_raw_response_delete(self, client: Cloudflare) -> None: + response = client.stream.downloads.with_raw_response.delete( "ea95132c15732412d22c1476fa83f27a", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -89,12 +89,12 @@ def test_raw_response_list(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" download = response.parse() - assert_matches_type(DownloadListResponse, download, path=["response"]) + assert_matches_type(DownloadDeleteResponse, download, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.stream.downloads.with_streaming_response.list( + def test_streaming_response_delete(self, client: Cloudflare) -> None: + with client.stream.downloads.with_streaming_response.delete( "ea95132c15732412d22c1476fa83f27a", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: @@ -102,38 +102,38 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" download = response.parse() - assert_matches_type(DownloadListResponse, download, path=["response"]) + assert_matches_type(DownloadDeleteResponse, download, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - def test_path_params_list(self, client: Cloudflare) -> None: + def test_path_params_delete(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.stream.downloads.with_raw_response.list( + client.stream.downloads.with_raw_response.delete( "ea95132c15732412d22c1476fa83f27a", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `identifier` but received ''"): - client.stream.downloads.with_raw_response.list( + client.stream.downloads.with_raw_response.delete( "", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @pytest.mark.skip() @parametrize - def test_method_delete(self, client: Cloudflare) -> None: - download = client.stream.downloads.delete( + def test_method_get(self, client: Cloudflare) -> None: + download = client.stream.downloads.get( "ea95132c15732412d22c1476fa83f27a", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(DownloadDeleteResponse, download, path=["response"]) + assert_matches_type(DownloadGetResponse, download, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_delete(self, client: Cloudflare) -> None: - response = client.stream.downloads.with_raw_response.delete( + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.stream.downloads.with_raw_response.get( "ea95132c15732412d22c1476fa83f27a", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -141,12 +141,12 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" download = response.parse() - assert_matches_type(DownloadDeleteResponse, download, path=["response"]) + assert_matches_type(DownloadGetResponse, download, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_delete(self, client: Cloudflare) -> None: - with client.stream.downloads.with_streaming_response.delete( + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.stream.downloads.with_streaming_response.get( "ea95132c15732412d22c1476fa83f27a", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: @@ -154,21 +154,21 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" download = response.parse() - assert_matches_type(DownloadDeleteResponse, download, path=["response"]) + assert_matches_type(DownloadGetResponse, download, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - def test_path_params_delete(self, client: Cloudflare) -> None: + def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.stream.downloads.with_raw_response.delete( + client.stream.downloads.with_raw_response.get( "ea95132c15732412d22c1476fa83f27a", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `identifier` but received ''"): - client.stream.downloads.with_raw_response.delete( + client.stream.downloads.with_raw_response.get( "", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -231,17 +231,17 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip() @parametrize - async def test_method_list(self, async_client: AsyncCloudflare) -> None: - download = await async_client.stream.downloads.list( + async def test_method_delete(self, async_client: AsyncCloudflare) -> None: + download = await async_client.stream.downloads.delete( "ea95132c15732412d22c1476fa83f27a", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(DownloadListResponse, download, path=["response"]) + assert_matches_type(DownloadDeleteResponse, download, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.stream.downloads.with_raw_response.list( + async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: + response = await async_client.stream.downloads.with_raw_response.delete( "ea95132c15732412d22c1476fa83f27a", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -249,12 +249,12 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" download = await response.parse() - assert_matches_type(DownloadListResponse, download, path=["response"]) + assert_matches_type(DownloadDeleteResponse, download, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.stream.downloads.with_streaming_response.list( + async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: + async with async_client.stream.downloads.with_streaming_response.delete( "ea95132c15732412d22c1476fa83f27a", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: @@ -262,38 +262,38 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" download = await response.parse() - assert_matches_type(DownloadListResponse, download, path=["response"]) + assert_matches_type(DownloadDeleteResponse, 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: + async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.stream.downloads.with_raw_response.list( + await async_client.stream.downloads.with_raw_response.delete( "ea95132c15732412d22c1476fa83f27a", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `identifier` but received ''"): - await async_client.stream.downloads.with_raw_response.list( + await async_client.stream.downloads.with_raw_response.delete( "", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @pytest.mark.skip() @parametrize - async def test_method_delete(self, async_client: AsyncCloudflare) -> None: - download = await async_client.stream.downloads.delete( + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + download = await async_client.stream.downloads.get( "ea95132c15732412d22c1476fa83f27a", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(DownloadDeleteResponse, download, path=["response"]) + assert_matches_type(DownloadGetResponse, download, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: - response = await async_client.stream.downloads.with_raw_response.delete( + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.stream.downloads.with_raw_response.get( "ea95132c15732412d22c1476fa83f27a", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -301,12 +301,12 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" download = await response.parse() - assert_matches_type(DownloadDeleteResponse, download, path=["response"]) + assert_matches_type(DownloadGetResponse, download, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: - async with async_client.stream.downloads.with_streaming_response.delete( + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.stream.downloads.with_streaming_response.get( "ea95132c15732412d22c1476fa83f27a", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: @@ -314,21 +314,21 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" download = await response.parse() - assert_matches_type(DownloadDeleteResponse, download, path=["response"]) + assert_matches_type(DownloadGetResponse, download, 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: + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.stream.downloads.with_raw_response.delete( + await async_client.stream.downloads.with_raw_response.get( "ea95132c15732412d22c1476fa83f27a", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `identifier` but received ''"): - await async_client.stream.downloads.with_raw_response.delete( + await async_client.stream.downloads.with_raw_response.get( "", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) diff --git a/tests/api_resources/stream/test_embeds.py b/tests/api_resources/stream/test_embeds.py index 3160339ef1a..23550dde13e 100644 --- a/tests/api_resources/stream/test_embeds.py +++ b/tests/api_resources/stream/test_embeds.py @@ -18,8 +18,8 @@ class TestEmbeds: @pytest.mark.skip() @parametrize - def test_method_list(self, client: Cloudflare) -> None: - embed = client.stream.embeds.list( + def test_method_get(self, client: Cloudflare) -> None: + embed = client.stream.embeds.get( "ea95132c15732412d22c1476fa83f27a", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -27,8 +27,8 @@ def test_method_list(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.stream.embeds.with_raw_response.list( + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.stream.embeds.with_raw_response.get( "ea95132c15732412d22c1476fa83f27a", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -40,8 +40,8 @@ def test_raw_response_list(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.stream.embeds.with_streaming_response.list( + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.stream.embeds.with_streaming_response.get( "ea95132c15732412d22c1476fa83f27a", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: @@ -55,15 +55,15 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_path_params_list(self, client: Cloudflare) -> None: + def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.stream.embeds.with_raw_response.list( + client.stream.embeds.with_raw_response.get( "ea95132c15732412d22c1476fa83f27a", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `identifier` but received ''"): - client.stream.embeds.with_raw_response.list( + client.stream.embeds.with_raw_response.get( "", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -74,8 +74,8 @@ class TestAsyncEmbeds: @pytest.mark.skip() @parametrize - async def test_method_list(self, async_client: AsyncCloudflare) -> None: - embed = await async_client.stream.embeds.list( + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + embed = await async_client.stream.embeds.get( "ea95132c15732412d22c1476fa83f27a", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -83,8 +83,8 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip() @parametrize - async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.stream.embeds.with_raw_response.list( + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.stream.embeds.with_raw_response.get( "ea95132c15732412d22c1476fa83f27a", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -96,8 +96,8 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip() @parametrize - async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.stream.embeds.with_streaming_response.list( + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.stream.embeds.with_streaming_response.get( "ea95132c15732412d22c1476fa83f27a", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: @@ -111,15 +111,15 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N @pytest.mark.skip() @parametrize - async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.stream.embeds.with_raw_response.list( + await async_client.stream.embeds.with_raw_response.get( "ea95132c15732412d22c1476fa83f27a", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `identifier` but received ''"): - await async_client.stream.embeds.with_raw_response.list( + await async_client.stream.embeds.with_raw_response.get( "", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) diff --git a/tests/api_resources/stream/test_keys.py b/tests/api_resources/stream/test_keys.py index e7aea2de342..7d1663e3113 100644 --- a/tests/api_resources/stream/test_keys.py +++ b/tests/api_resources/stream/test_keys.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.stream import KeyListResponse, KeyCreateResponse, KeyDeleteResponse +from cloudflare.types.stream import KeyGetResponse, KeyCreateResponse, KeyDeleteResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -61,98 +61,98 @@ def test_path_params_create(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_method_list(self, client: Cloudflare) -> None: - key = client.stream.keys.list( + def test_method_delete(self, client: Cloudflare) -> None: + key = client.stream.keys.delete( + "023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(KeyListResponse, key, path=["response"]) + assert_matches_type(KeyDeleteResponse, key, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.stream.keys.with_raw_response.list( + def test_raw_response_delete(self, client: Cloudflare) -> None: + response = client.stream.keys.with_raw_response.delete( + "023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" key = response.parse() - assert_matches_type(KeyListResponse, key, path=["response"]) + assert_matches_type(KeyDeleteResponse, key, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.stream.keys.with_streaming_response.list( + def test_streaming_response_delete(self, client: Cloudflare) -> None: + with client.stream.keys.with_streaming_response.delete( + "023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" key = response.parse() - assert_matches_type(KeyListResponse, key, path=["response"]) + assert_matches_type(KeyDeleteResponse, key, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - def test_path_params_list(self, client: Cloudflare) -> None: + def test_path_params_delete(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.stream.keys.with_raw_response.list( + client.stream.keys.with_raw_response.delete( + "023e105f4ecef8ad9ca31a8372d0c353", account_id="", ) + with pytest.raises(ValueError, match=r"Expected a non-empty value for `identifier` but received ''"): + client.stream.keys.with_raw_response.delete( + "", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + @pytest.mark.skip() @parametrize - def test_method_delete(self, client: Cloudflare) -> None: - key = client.stream.keys.delete( - "023e105f4ecef8ad9ca31a8372d0c353", + def test_method_get(self, client: Cloudflare) -> None: + key = client.stream.keys.get( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(KeyDeleteResponse, key, path=["response"]) + assert_matches_type(KeyGetResponse, key, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_delete(self, client: Cloudflare) -> None: - response = client.stream.keys.with_raw_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.stream.keys.with_raw_response.get( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" key = response.parse() - assert_matches_type(KeyDeleteResponse, key, path=["response"]) + assert_matches_type(KeyGetResponse, key, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_delete(self, client: Cloudflare) -> None: - with client.stream.keys.with_streaming_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.stream.keys.with_streaming_response.get( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" key = response.parse() - assert_matches_type(KeyDeleteResponse, key, path=["response"]) + assert_matches_type(KeyGetResponse, key, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - def test_path_params_delete(self, client: Cloudflare) -> None: + def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.stream.keys.with_raw_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", + client.stream.keys.with_raw_response.get( account_id="", ) - with pytest.raises(ValueError, match=r"Expected a non-empty value for `identifier` but received ''"): - client.stream.keys.with_raw_response.delete( - "", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - class TestAsyncKeys: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @@ -201,94 +201,94 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip() @parametrize - async def test_method_list(self, async_client: AsyncCloudflare) -> None: - key = await async_client.stream.keys.list( + async def test_method_delete(self, async_client: AsyncCloudflare) -> None: + key = await async_client.stream.keys.delete( + "023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(KeyListResponse, key, path=["response"]) + assert_matches_type(KeyDeleteResponse, key, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.stream.keys.with_raw_response.list( + async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: + response = await async_client.stream.keys.with_raw_response.delete( + "023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" key = await response.parse() - assert_matches_type(KeyListResponse, key, path=["response"]) + assert_matches_type(KeyDeleteResponse, key, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.stream.keys.with_streaming_response.list( + async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: + async with async_client.stream.keys.with_streaming_response.delete( + "023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" key = await response.parse() - assert_matches_type(KeyListResponse, key, path=["response"]) + assert_matches_type(KeyDeleteResponse, key, 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: + async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.stream.keys.with_raw_response.list( + await async_client.stream.keys.with_raw_response.delete( + "023e105f4ecef8ad9ca31a8372d0c353", account_id="", ) + with pytest.raises(ValueError, match=r"Expected a non-empty value for `identifier` but received ''"): + await async_client.stream.keys.with_raw_response.delete( + "", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + @pytest.mark.skip() @parametrize - async def test_method_delete(self, async_client: AsyncCloudflare) -> None: - key = await async_client.stream.keys.delete( - "023e105f4ecef8ad9ca31a8372d0c353", + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + key = await async_client.stream.keys.get( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(KeyDeleteResponse, key, path=["response"]) + assert_matches_type(KeyGetResponse, key, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: - response = await async_client.stream.keys.with_raw_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.stream.keys.with_raw_response.get( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" key = await response.parse() - assert_matches_type(KeyDeleteResponse, key, path=["response"]) + assert_matches_type(KeyGetResponse, key, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: - async with async_client.stream.keys.with_streaming_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.stream.keys.with_streaming_response.get( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" key = await response.parse() - assert_matches_type(KeyDeleteResponse, key, path=["response"]) + assert_matches_type(KeyGetResponse, key, 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: + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.stream.keys.with_raw_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", + await async_client.stream.keys.with_raw_response.get( account_id="", ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `identifier` but received ''"): - await async_client.stream.keys.with_raw_response.delete( - "", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) diff --git a/tests/api_resources/test_available_rate_plans.py b/tests/api_resources/test_available_rate_plans.py index eb2a11d5fd5..29f9d752a30 100644 --- a/tests/api_resources/test_available_rate_plans.py +++ b/tests/api_resources/test_available_rate_plans.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types import AvailableRatePlanListResponse +from cloudflare.types import AvailableRatePlanGetResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -19,43 +19,43 @@ class TestAvailableRatePlans: @pytest.mark.skip() @parametrize - def test_method_list(self, client: Cloudflare) -> None: - available_rate_plan = client.available_rate_plans.list( + def test_method_get(self, client: Cloudflare) -> None: + available_rate_plan = client.available_rate_plans.get( "023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[AvailableRatePlanListResponse], available_rate_plan, path=["response"]) + assert_matches_type(Optional[AvailableRatePlanGetResponse], available_rate_plan, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.available_rate_plans.with_raw_response.list( + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.available_rate_plans.with_raw_response.get( "023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" available_rate_plan = response.parse() - assert_matches_type(Optional[AvailableRatePlanListResponse], available_rate_plan, path=["response"]) + assert_matches_type(Optional[AvailableRatePlanGetResponse], available_rate_plan, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.available_rate_plans.with_streaming_response.list( + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.available_rate_plans.with_streaming_response.get( "023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" available_rate_plan = response.parse() - assert_matches_type(Optional[AvailableRatePlanListResponse], available_rate_plan, path=["response"]) + assert_matches_type(Optional[AvailableRatePlanGetResponse], available_rate_plan, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - def test_path_params_list(self, client: Cloudflare) -> None: + def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_identifier` but received ''"): - client.available_rate_plans.with_raw_response.list( + client.available_rate_plans.with_raw_response.get( "", ) @@ -65,42 +65,42 @@ class TestAsyncAvailableRatePlans: @pytest.mark.skip() @parametrize - async def test_method_list(self, async_client: AsyncCloudflare) -> None: - available_rate_plan = await async_client.available_rate_plans.list( + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + available_rate_plan = await async_client.available_rate_plans.get( "023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[AvailableRatePlanListResponse], available_rate_plan, path=["response"]) + assert_matches_type(Optional[AvailableRatePlanGetResponse], available_rate_plan, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.available_rate_plans.with_raw_response.list( + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.available_rate_plans.with_raw_response.get( "023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" available_rate_plan = await response.parse() - assert_matches_type(Optional[AvailableRatePlanListResponse], available_rate_plan, path=["response"]) + assert_matches_type(Optional[AvailableRatePlanGetResponse], available_rate_plan, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.available_rate_plans.with_streaming_response.list( + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.available_rate_plans.with_streaming_response.get( "023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" available_rate_plan = await response.parse() - assert_matches_type(Optional[AvailableRatePlanListResponse], available_rate_plan, path=["response"]) + assert_matches_type(Optional[AvailableRatePlanGetResponse], available_rate_plan, 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: + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_identifier` but received ''"): - await async_client.available_rate_plans.with_raw_response.list( + await async_client.available_rate_plans.with_raw_response.get( "", ) diff --git a/tests/api_resources/test_custom_nameservers.py b/tests/api_resources/test_custom_nameservers.py index f457cd7b7fa..4a75f902692 100644 --- a/tests/api_resources/test_custom_nameservers.py +++ b/tests/api_resources/test_custom_nameservers.py @@ -10,7 +10,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.types import ( - CustomNameserverListResponse, + CustomNameserverGetResponse, CustomNameserverCreateResponse, CustomNameserverDeleteResponse, CustomNameserverVerifyResponse, @@ -79,48 +79,6 @@ def test_path_params_create(self, client: Cloudflare) -> None: ns_name="ns1.example.com", ) - @pytest.mark.skip() - @parametrize - def test_method_list(self, client: Cloudflare) -> None: - custom_nameserver = client.custom_nameservers.list( - account_id="372e67954025e0ba6aaa6d586b9e0b59", - ) - assert_matches_type(Optional[CustomNameserverListResponse], custom_nameserver, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.custom_nameservers.with_raw_response.list( - account_id="372e67954025e0ba6aaa6d586b9e0b59", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - custom_nameserver = response.parse() - assert_matches_type(Optional[CustomNameserverListResponse], custom_nameserver, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.custom_nameservers.with_streaming_response.list( - account_id="372e67954025e0ba6aaa6d586b9e0b59", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - custom_nameserver = response.parse() - assert_matches_type(Optional[CustomNameserverListResponse], custom_nameserver, 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_id` but received ''"): - client.custom_nameservers.with_raw_response.list( - account_id="", - ) - @pytest.mark.skip() @parametrize def test_method_delete(self, client: Cloudflare) -> None: @@ -215,6 +173,48 @@ def test_path_params_availabilty(self, client: Cloudflare) -> None: account_id="", ) + @pytest.mark.skip() + @parametrize + def test_method_get(self, client: Cloudflare) -> None: + custom_nameserver = client.custom_nameservers.get( + account_id="372e67954025e0ba6aaa6d586b9e0b59", + ) + assert_matches_type(Optional[CustomNameserverGetResponse], custom_nameserver, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.custom_nameservers.with_raw_response.get( + account_id="372e67954025e0ba6aaa6d586b9e0b59", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + custom_nameserver = response.parse() + assert_matches_type(Optional[CustomNameserverGetResponse], custom_nameserver, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.custom_nameservers.with_streaming_response.get( + account_id="372e67954025e0ba6aaa6d586b9e0b59", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + custom_nameserver = response.parse() + assert_matches_type(Optional[CustomNameserverGetResponse], custom_nameserver, 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_id` but received ''"): + client.custom_nameservers.with_raw_response.get( + account_id="", + ) + @pytest.mark.skip() @parametrize def test_method_verify(self, client: Cloudflare) -> None: @@ -317,48 +317,6 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: ns_name="ns1.example.com", ) - @pytest.mark.skip() - @parametrize - async def test_method_list(self, async_client: AsyncCloudflare) -> None: - custom_nameserver = await async_client.custom_nameservers.list( - account_id="372e67954025e0ba6aaa6d586b9e0b59", - ) - assert_matches_type(Optional[CustomNameserverListResponse], custom_nameserver, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.custom_nameservers.with_raw_response.list( - account_id="372e67954025e0ba6aaa6d586b9e0b59", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - custom_nameserver = await response.parse() - assert_matches_type(Optional[CustomNameserverListResponse], custom_nameserver, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.custom_nameservers.with_streaming_response.list( - account_id="372e67954025e0ba6aaa6d586b9e0b59", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - custom_nameserver = await response.parse() - assert_matches_type(Optional[CustomNameserverListResponse], custom_nameserver, 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_id` but received ''"): - await async_client.custom_nameservers.with_raw_response.list( - account_id="", - ) - @pytest.mark.skip() @parametrize async def test_method_delete(self, async_client: AsyncCloudflare) -> None: @@ -453,6 +411,48 @@ async def test_path_params_availabilty(self, async_client: AsyncCloudflare) -> N account_id="", ) + @pytest.mark.skip() + @parametrize + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + custom_nameserver = await async_client.custom_nameservers.get( + account_id="372e67954025e0ba6aaa6d586b9e0b59", + ) + assert_matches_type(Optional[CustomNameserverGetResponse], custom_nameserver, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.custom_nameservers.with_raw_response.get( + account_id="372e67954025e0ba6aaa6d586b9e0b59", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + custom_nameserver = await response.parse() + assert_matches_type(Optional[CustomNameserverGetResponse], custom_nameserver, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.custom_nameservers.with_streaming_response.get( + account_id="372e67954025e0ba6aaa6d586b9e0b59", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + custom_nameserver = await response.parse() + assert_matches_type(Optional[CustomNameserverGetResponse], custom_nameserver, 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_id` but received ''"): + await async_client.custom_nameservers.with_raw_response.get( + account_id="", + ) + @pytest.mark.skip() @parametrize async def test_method_verify(self, async_client: AsyncCloudflare) -> None: diff --git a/tests/api_resources/test_user.py b/tests/api_resources/test_user.py index 362903a18d6..fbd8ceaba22 100644 --- a/tests/api_resources/test_user.py +++ b/tests/api_resources/test_user.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types import UserEditResponse, UserListResponse +from cloudflare.types import UserGetResponse, UserEditResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -17,34 +17,6 @@ class TestUser: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() - @parametrize - def test_method_list(self, client: Cloudflare) -> None: - user = client.user.list() - assert_matches_type(UserListResponse, user, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.user.with_raw_response.list() - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - user = response.parse() - assert_matches_type(UserListResponse, user, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.user.with_streaming_response.list() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - user = response.parse() - assert_matches_type(UserListResponse, user, path=["response"]) - - assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_edit(self, client: Cloudflare) -> None: @@ -85,38 +57,38 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True - -class TestAsyncUser: - 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: - user = await async_client.user.list() - assert_matches_type(UserListResponse, user, path=["response"]) + def test_method_get(self, client: Cloudflare) -> None: + user = client.user.get() + assert_matches_type(UserGetResponse, user, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.user.with_raw_response.list() + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.user.with_raw_response.get() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - user = await response.parse() - assert_matches_type(UserListResponse, user, path=["response"]) + user = response.parse() + assert_matches_type(UserGetResponse, user, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.user.with_streaming_response.list() as response: + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.user.with_streaming_response.get() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - user = await response.parse() - assert_matches_type(UserListResponse, user, path=["response"]) + user = response.parse() + assert_matches_type(UserGetResponse, user, path=["response"]) assert cast(Any, response.is_closed) is True + +class TestAsyncUser: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() @parametrize async def test_method_edit(self, async_client: AsyncCloudflare) -> None: @@ -156,3 +128,31 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N assert_matches_type(UserEditResponse, user, path=["response"]) assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + user = await async_client.user.get() + assert_matches_type(UserGetResponse, user, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.user.with_raw_response.get() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + user = await response.parse() + assert_matches_type(UserGetResponse, user, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.user.with_streaming_response.get() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + user = await response.parse() + assert_matches_type(UserGetResponse, user, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/user/billing/test_history.py b/tests/api_resources/user/billing/test_history.py index 05a45c02c5b..b497d169a2f 100644 --- a/tests/api_resources/user/billing/test_history.py +++ b/tests/api_resources/user/billing/test_history.py @@ -3,14 +3,13 @@ from __future__ import annotations import os -from typing import Any, cast +from typing import Any, Optional, cast import pytest from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray -from cloudflare.types.user.billing import HistoryListResponse +from cloudflare.types.user.billing import HistoryGetResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -20,39 +19,39 @@ class TestHistory: @pytest.mark.skip() @parametrize - def test_method_list(self, client: Cloudflare) -> None: - history = client.user.billing.history.list() - assert_matches_type(SyncV4PagePaginationArray[HistoryListResponse], history, path=["response"]) + def test_method_get(self, client: Cloudflare) -> None: + history = client.user.billing.history.get() + assert_matches_type(Optional[HistoryGetResponse], history, path=["response"]) @pytest.mark.skip() @parametrize - def test_method_list_with_all_params(self, client: Cloudflare) -> None: - history = client.user.billing.history.list( + def test_method_get_with_all_params(self, client: Cloudflare) -> None: + history = client.user.billing.history.get( order="occured_at", page=1, per_page=5, ) - assert_matches_type(SyncV4PagePaginationArray[HistoryListResponse], history, path=["response"]) + assert_matches_type(Optional[HistoryGetResponse], history, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.user.billing.history.with_raw_response.list() + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.user.billing.history.with_raw_response.get() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" history = response.parse() - assert_matches_type(SyncV4PagePaginationArray[HistoryListResponse], history, path=["response"]) + assert_matches_type(Optional[HistoryGetResponse], history, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.user.billing.history.with_streaming_response.list() as response: + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.user.billing.history.with_streaming_response.get() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" history = response.parse() - assert_matches_type(SyncV4PagePaginationArray[HistoryListResponse], history, path=["response"]) + assert_matches_type(Optional[HistoryGetResponse], history, path=["response"]) assert cast(Any, response.is_closed) is True @@ -62,38 +61,38 @@ class TestAsyncHistory: @pytest.mark.skip() @parametrize - async def test_method_list(self, async_client: AsyncCloudflare) -> None: - history = await async_client.user.billing.history.list() - assert_matches_type(AsyncV4PagePaginationArray[HistoryListResponse], history, path=["response"]) + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + history = await async_client.user.billing.history.get() + assert_matches_type(Optional[HistoryGetResponse], history, path=["response"]) @pytest.mark.skip() @parametrize - async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: - history = await async_client.user.billing.history.list( + async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -> None: + history = await async_client.user.billing.history.get( order="occured_at", page=1, per_page=5, ) - assert_matches_type(AsyncV4PagePaginationArray[HistoryListResponse], history, path=["response"]) + assert_matches_type(Optional[HistoryGetResponse], history, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.user.billing.history.with_raw_response.list() + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.user.billing.history.with_raw_response.get() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" history = await response.parse() - assert_matches_type(AsyncV4PagePaginationArray[HistoryListResponse], history, path=["response"]) + assert_matches_type(Optional[HistoryGetResponse], history, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.user.billing.history.with_streaming_response.list() as response: + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.user.billing.history.with_streaming_response.get() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" history = await response.parse() - assert_matches_type(AsyncV4PagePaginationArray[HistoryListResponse], history, path=["response"]) + assert_matches_type(Optional[HistoryGetResponse], history, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/user/billing/test_profiles.py b/tests/api_resources/user/billing/test_profiles.py index 47345914f80..4069a259014 100644 --- a/tests/api_resources/user/billing/test_profiles.py +++ b/tests/api_resources/user/billing/test_profiles.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.user.billing import ProfileListResponse +from cloudflare.types.user.billing import ProfileGetResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -19,29 +19,29 @@ class TestProfiles: @pytest.mark.skip() @parametrize - def test_method_list(self, client: Cloudflare) -> None: - profile = client.user.billing.profiles.list() - assert_matches_type(ProfileListResponse, profile, path=["response"]) + def test_method_get(self, client: Cloudflare) -> None: + profile = client.user.billing.profiles.get() + assert_matches_type(ProfileGetResponse, profile, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.user.billing.profiles.with_raw_response.list() + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.user.billing.profiles.with_raw_response.get() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" profile = response.parse() - assert_matches_type(ProfileListResponse, profile, path=["response"]) + assert_matches_type(ProfileGetResponse, profile, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.user.billing.profiles.with_streaming_response.list() as response: + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.user.billing.profiles.with_streaming_response.get() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" profile = response.parse() - assert_matches_type(ProfileListResponse, profile, path=["response"]) + assert_matches_type(ProfileGetResponse, profile, path=["response"]) assert cast(Any, response.is_closed) is True @@ -51,28 +51,28 @@ class TestAsyncProfiles: @pytest.mark.skip() @parametrize - async def test_method_list(self, async_client: AsyncCloudflare) -> None: - profile = await async_client.user.billing.profiles.list() - assert_matches_type(ProfileListResponse, profile, path=["response"]) + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + profile = await async_client.user.billing.profiles.get() + assert_matches_type(ProfileGetResponse, profile, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.user.billing.profiles.with_raw_response.list() + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.user.billing.profiles.with_raw_response.get() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" profile = await response.parse() - assert_matches_type(ProfileListResponse, profile, path=["response"]) + assert_matches_type(ProfileGetResponse, profile, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.user.billing.profiles.with_streaming_response.list() as response: + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.user.billing.profiles.with_streaming_response.get() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" profile = await response.parse() - assert_matches_type(ProfileListResponse, profile, path=["response"]) + assert_matches_type(ProfileGetResponse, profile, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/user/test_subscriptions.py b/tests/api_resources/user/test_subscriptions.py index a91d9628ecd..cda798f037a 100644 --- a/tests/api_resources/user/test_subscriptions.py +++ b/tests/api_resources/user/test_subscriptions.py @@ -10,8 +10,8 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.types.user import ( + SubscriptionGetResponse, SubscriptionEditResponse, - SubscriptionListResponse, SubscriptionDeleteResponse, SubscriptionUpdateResponse, ) @@ -104,34 +104,6 @@ def test_path_params_update(self, client: Cloudflare) -> None: "", ) - @pytest.mark.skip() - @parametrize - def test_method_list(self, client: Cloudflare) -> None: - subscription = client.user.subscriptions.list() - assert_matches_type(Optional[SubscriptionListResponse], subscription, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.user.subscriptions.with_raw_response.list() - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - subscription = response.parse() - assert_matches_type(Optional[SubscriptionListResponse], subscription, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.user.subscriptions.with_streaming_response.list() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - subscription = response.parse() - assert_matches_type(Optional[SubscriptionListResponse], subscription, path=["response"]) - - assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize def test_method_delete(self, client: Cloudflare) -> None: @@ -256,6 +228,34 @@ def test_path_params_edit(self, client: Cloudflare) -> None: "", ) + @pytest.mark.skip() + @parametrize + def test_method_get(self, client: Cloudflare) -> None: + subscription = client.user.subscriptions.get() + assert_matches_type(Optional[SubscriptionGetResponse], subscription, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.user.subscriptions.with_raw_response.get() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + subscription = response.parse() + assert_matches_type(Optional[SubscriptionGetResponse], subscription, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.user.subscriptions.with_streaming_response.get() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + subscription = response.parse() + assert_matches_type(Optional[SubscriptionGetResponse], subscription, path=["response"]) + + assert cast(Any, response.is_closed) is True + class TestAsyncSubscriptions: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @@ -342,34 +342,6 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: "", ) - @pytest.mark.skip() - @parametrize - async def test_method_list(self, async_client: AsyncCloudflare) -> None: - subscription = await async_client.user.subscriptions.list() - assert_matches_type(Optional[SubscriptionListResponse], subscription, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.user.subscriptions.with_raw_response.list() - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - subscription = await response.parse() - assert_matches_type(Optional[SubscriptionListResponse], subscription, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.user.subscriptions.with_streaming_response.list() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - subscription = await response.parse() - assert_matches_type(Optional[SubscriptionListResponse], subscription, path=["response"]) - - assert cast(Any, response.is_closed) is True - @pytest.mark.skip() @parametrize async def test_method_delete(self, async_client: AsyncCloudflare) -> None: @@ -493,3 +465,31 @@ async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: await async_client.user.subscriptions.with_raw_response.edit( "", ) + + @pytest.mark.skip() + @parametrize + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + subscription = await async_client.user.subscriptions.get() + assert_matches_type(Optional[SubscriptionGetResponse], subscription, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.user.subscriptions.with_raw_response.get() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + subscription = await response.parse() + assert_matches_type(Optional[SubscriptionGetResponse], subscription, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.user.subscriptions.with_streaming_response.get() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + subscription = await response.parse() + assert_matches_type(Optional[SubscriptionGetResponse], subscription, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/web3/hostnames/ipfs_universal_paths/test_content_lists.py b/tests/api_resources/web3/hostnames/ipfs_universal_paths/test_content_lists.py index 2bde642c9c4..92c6f0c284c 100644 --- a/tests/api_resources/web3/hostnames/ipfs_universal_paths/test_content_lists.py +++ b/tests/api_resources/web3/hostnames/ipfs_universal_paths/test_content_lists.py @@ -10,7 +10,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.types.web3.hostnames.ipfs_universal_paths import ( - ContentListListResponse, + ContentListGetResponse, ContentListUpdateResponse, ) @@ -84,17 +84,17 @@ def test_path_params_update(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_method_list(self, client: Cloudflare) -> None: - content_list = client.web3.hostnames.ipfs_universal_paths.content_lists.list( + def test_method_get(self, client: Cloudflare) -> None: + content_list = client.web3.hostnames.ipfs_universal_paths.content_lists.get( "023e105f4ecef8ad9ca31a8372d0c353", zone_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(ContentListListResponse, content_list, path=["response"]) + assert_matches_type(ContentListGetResponse, content_list, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.web3.hostnames.ipfs_universal_paths.content_lists.with_raw_response.list( + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.web3.hostnames.ipfs_universal_paths.content_lists.with_raw_response.get( "023e105f4ecef8ad9ca31a8372d0c353", zone_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -102,12 +102,12 @@ def test_raw_response_list(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" content_list = response.parse() - assert_matches_type(ContentListListResponse, content_list, path=["response"]) + assert_matches_type(ContentListGetResponse, content_list, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.web3.hostnames.ipfs_universal_paths.content_lists.with_streaming_response.list( + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.web3.hostnames.ipfs_universal_paths.content_lists.with_streaming_response.get( "023e105f4ecef8ad9ca31a8372d0c353", zone_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) as response: @@ -115,21 +115,21 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" content_list = response.parse() - assert_matches_type(ContentListListResponse, content_list, path=["response"]) + assert_matches_type(ContentListGetResponse, content_list, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - def test_path_params_list(self, client: Cloudflare) -> None: + def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_identifier` but received ''"): - client.web3.hostnames.ipfs_universal_paths.content_lists.with_raw_response.list( + client.web3.hostnames.ipfs_universal_paths.content_lists.with_raw_response.get( "023e105f4ecef8ad9ca31a8372d0c353", zone_identifier="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `identifier` but received ''"): - client.web3.hostnames.ipfs_universal_paths.content_lists.with_raw_response.list( + client.web3.hostnames.ipfs_universal_paths.content_lists.with_raw_response.get( "", zone_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -202,17 +202,17 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip() @parametrize - async def test_method_list(self, async_client: AsyncCloudflare) -> None: - content_list = await async_client.web3.hostnames.ipfs_universal_paths.content_lists.list( + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + content_list = await async_client.web3.hostnames.ipfs_universal_paths.content_lists.get( "023e105f4ecef8ad9ca31a8372d0c353", zone_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(ContentListListResponse, content_list, path=["response"]) + assert_matches_type(ContentListGetResponse, content_list, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.web3.hostnames.ipfs_universal_paths.content_lists.with_raw_response.list( + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.web3.hostnames.ipfs_universal_paths.content_lists.with_raw_response.get( "023e105f4ecef8ad9ca31a8372d0c353", zone_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -220,12 +220,12 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" content_list = await response.parse() - assert_matches_type(ContentListListResponse, content_list, path=["response"]) + assert_matches_type(ContentListGetResponse, content_list, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.web3.hostnames.ipfs_universal_paths.content_lists.with_streaming_response.list( + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.web3.hostnames.ipfs_universal_paths.content_lists.with_streaming_response.get( "023e105f4ecef8ad9ca31a8372d0c353", zone_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) as response: @@ -233,21 +233,21 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" content_list = await response.parse() - assert_matches_type(ContentListListResponse, content_list, path=["response"]) + assert_matches_type(ContentListGetResponse, content_list, 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: + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_identifier` but received ''"): - await async_client.web3.hostnames.ipfs_universal_paths.content_lists.with_raw_response.list( + await async_client.web3.hostnames.ipfs_universal_paths.content_lists.with_raw_response.get( "023e105f4ecef8ad9ca31a8372d0c353", zone_identifier="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `identifier` but received ''"): - await async_client.web3.hostnames.ipfs_universal_paths.content_lists.with_raw_response.list( + await async_client.web3.hostnames.ipfs_universal_paths.content_lists.with_raw_response.get( "", zone_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) diff --git a/tests/api_resources/magic_transit/ipsec_tunnels/__init__.py b/tests/api_resources/workers/deployments/by_scripts/__init__.py similarity index 100% rename from tests/api_resources/magic_transit/ipsec_tunnels/__init__.py rename to tests/api_resources/workers/deployments/by_scripts/__init__.py diff --git a/tests/api_resources/workers/deployments/by_scripts/test_details.py b/tests/api_resources/workers/deployments/by_scripts/test_details.py new file mode 100644 index 00000000000..d4bc487357c --- /dev/null +++ b/tests/api_resources/workers/deployments/by_scripts/test_details.py @@ -0,0 +1,150 @@ +# 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.workers.deployments.by_scripts import DetailGetResponse + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestDetails: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @pytest.mark.skip() + @parametrize + def test_method_get(self, client: Cloudflare) -> None: + detail = client.workers.deployments.by_scripts.details.get( + "bcf48806-b317-4351-9ee7-36e7d557d4de", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + script_id="8ee82b3a2c0f42928b8f14dae4a97121", + ) + assert_matches_type(DetailGetResponse, detail, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.workers.deployments.by_scripts.details.with_raw_response.get( + "bcf48806-b317-4351-9ee7-36e7d557d4de", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + script_id="8ee82b3a2c0f42928b8f14dae4a97121", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + detail = response.parse() + assert_matches_type(DetailGetResponse, detail, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.workers.deployments.by_scripts.details.with_streaming_response.get( + "bcf48806-b317-4351-9ee7-36e7d557d4de", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + script_id="8ee82b3a2c0f42928b8f14dae4a97121", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + detail = response.parse() + assert_matches_type(DetailGetResponse, detail, 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_id` but received ''"): + client.workers.deployments.by_scripts.details.with_raw_response.get( + "bcf48806-b317-4351-9ee7-36e7d557d4de", + account_id="", + script_id="8ee82b3a2c0f42928b8f14dae4a97121", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `script_id` but received ''"): + client.workers.deployments.by_scripts.details.with_raw_response.get( + "bcf48806-b317-4351-9ee7-36e7d557d4de", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + script_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `deployment_id` but received ''"): + client.workers.deployments.by_scripts.details.with_raw_response.get( + "", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + script_id="8ee82b3a2c0f42928b8f14dae4a97121", + ) + + +class TestAsyncDetails: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @pytest.mark.skip() + @parametrize + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + detail = await async_client.workers.deployments.by_scripts.details.get( + "bcf48806-b317-4351-9ee7-36e7d557d4de", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + script_id="8ee82b3a2c0f42928b8f14dae4a97121", + ) + assert_matches_type(DetailGetResponse, detail, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.workers.deployments.by_scripts.details.with_raw_response.get( + "bcf48806-b317-4351-9ee7-36e7d557d4de", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + script_id="8ee82b3a2c0f42928b8f14dae4a97121", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + detail = await response.parse() + assert_matches_type(DetailGetResponse, detail, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.workers.deployments.by_scripts.details.with_streaming_response.get( + "bcf48806-b317-4351-9ee7-36e7d557d4de", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + script_id="8ee82b3a2c0f42928b8f14dae4a97121", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + detail = await response.parse() + assert_matches_type(DetailGetResponse, detail, 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_id` but received ''"): + await async_client.workers.deployments.by_scripts.details.with_raw_response.get( + "bcf48806-b317-4351-9ee7-36e7d557d4de", + account_id="", + script_id="8ee82b3a2c0f42928b8f14dae4a97121", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `script_id` but received ''"): + await async_client.workers.deployments.by_scripts.details.with_raw_response.get( + "bcf48806-b317-4351-9ee7-36e7d557d4de", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + script_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `deployment_id` but received ''"): + await async_client.workers.deployments.by_scripts.details.with_raw_response.get( + "", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + script_id="8ee82b3a2c0f42928b8f14dae4a97121", + ) diff --git a/tests/api_resources/workers/deployments/test_by_scripts.py b/tests/api_resources/workers/deployments/test_by_scripts.py index 601b17da59e..24d072c0ead 100644 --- a/tests/api_resources/workers/deployments/test_by_scripts.py +++ b/tests/api_resources/workers/deployments/test_by_scripts.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.workers.deployments import ByScriptGetResponse, ByScriptListResponse +from cloudflare.types.workers.deployments import ByScriptGetResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -17,65 +17,12 @@ class TestByScripts: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() - @parametrize - def test_method_list(self, client: Cloudflare) -> None: - by_script = client.workers.deployments.by_scripts.list( - "8ee82b3a2c0f42928b8f14dae4a97121", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(ByScriptListResponse, by_script, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.workers.deployments.by_scripts.with_raw_response.list( - "8ee82b3a2c0f42928b8f14dae4a97121", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - by_script = response.parse() - assert_matches_type(ByScriptListResponse, by_script, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.workers.deployments.by_scripts.with_streaming_response.list( - "8ee82b3a2c0f42928b8f14dae4a97121", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - by_script = response.parse() - assert_matches_type(ByScriptListResponse, by_script, 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_id` but received ''"): - client.workers.deployments.by_scripts.with_raw_response.list( - "8ee82b3a2c0f42928b8f14dae4a97121", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `script_id` but received ''"): - client.workers.deployments.by_scripts.with_raw_response.list( - "", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - @pytest.mark.skip() @parametrize def test_method_get(self, client: Cloudflare) -> None: by_script = client.workers.deployments.by_scripts.get( - "bcf48806-b317-4351-9ee7-36e7d557d4de", + "8ee82b3a2c0f42928b8f14dae4a97121", account_id="023e105f4ecef8ad9ca31a8372d0c353", - script_id="8ee82b3a2c0f42928b8f14dae4a97121", ) assert_matches_type(ByScriptGetResponse, by_script, path=["response"]) @@ -83,9 +30,8 @@ def test_method_get(self, client: Cloudflare) -> None: @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: response = client.workers.deployments.by_scripts.with_raw_response.get( - "bcf48806-b317-4351-9ee7-36e7d557d4de", + "8ee82b3a2c0f42928b8f14dae4a97121", account_id="023e105f4ecef8ad9ca31a8372d0c353", - script_id="8ee82b3a2c0f42928b8f14dae4a97121", ) assert response.is_closed is True @@ -97,9 +43,8 @@ def test_raw_response_get(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: with client.workers.deployments.by_scripts.with_streaming_response.get( - "bcf48806-b317-4351-9ee7-36e7d557d4de", + "8ee82b3a2c0f42928b8f14dae4a97121", account_id="023e105f4ecef8ad9ca31a8372d0c353", - script_id="8ee82b3a2c0f42928b8f14dae4a97121", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -114,88 +59,26 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): client.workers.deployments.by_scripts.with_raw_response.get( - "bcf48806-b317-4351-9ee7-36e7d557d4de", + "8ee82b3a2c0f42928b8f14dae4a97121", account_id="", - script_id="8ee82b3a2c0f42928b8f14dae4a97121", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `script_id` but received ''"): - client.workers.deployments.by_scripts.with_raw_response.get( - "bcf48806-b317-4351-9ee7-36e7d557d4de", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - script_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `deployment_id` but received ''"): client.workers.deployments.by_scripts.with_raw_response.get( "", account_id="023e105f4ecef8ad9ca31a8372d0c353", - script_id="8ee82b3a2c0f42928b8f14dae4a97121", ) class TestAsyncByScripts: 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: - by_script = await async_client.workers.deployments.by_scripts.list( - "8ee82b3a2c0f42928b8f14dae4a97121", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(ByScriptListResponse, by_script, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.workers.deployments.by_scripts.with_raw_response.list( - "8ee82b3a2c0f42928b8f14dae4a97121", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - by_script = await response.parse() - assert_matches_type(ByScriptListResponse, by_script, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.workers.deployments.by_scripts.with_streaming_response.list( - "8ee82b3a2c0f42928b8f14dae4a97121", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - by_script = await response.parse() - assert_matches_type(ByScriptListResponse, by_script, 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_id` but received ''"): - await async_client.workers.deployments.by_scripts.with_raw_response.list( - "8ee82b3a2c0f42928b8f14dae4a97121", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `script_id` but received ''"): - await async_client.workers.deployments.by_scripts.with_raw_response.list( - "", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - @pytest.mark.skip() @parametrize async def test_method_get(self, async_client: AsyncCloudflare) -> None: by_script = await async_client.workers.deployments.by_scripts.get( - "bcf48806-b317-4351-9ee7-36e7d557d4de", + "8ee82b3a2c0f42928b8f14dae4a97121", account_id="023e105f4ecef8ad9ca31a8372d0c353", - script_id="8ee82b3a2c0f42928b8f14dae4a97121", ) assert_matches_type(ByScriptGetResponse, by_script, path=["response"]) @@ -203,9 +86,8 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: response = await async_client.workers.deployments.by_scripts.with_raw_response.get( - "bcf48806-b317-4351-9ee7-36e7d557d4de", + "8ee82b3a2c0f42928b8f14dae4a97121", account_id="023e105f4ecef8ad9ca31a8372d0c353", - script_id="8ee82b3a2c0f42928b8f14dae4a97121", ) assert response.is_closed is True @@ -217,9 +99,8 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: async with async_client.workers.deployments.by_scripts.with_streaming_response.get( - "bcf48806-b317-4351-9ee7-36e7d557d4de", + "8ee82b3a2c0f42928b8f14dae4a97121", account_id="023e105f4ecef8ad9ca31a8372d0c353", - script_id="8ee82b3a2c0f42928b8f14dae4a97121", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -234,21 +115,12 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): await async_client.workers.deployments.by_scripts.with_raw_response.get( - "bcf48806-b317-4351-9ee7-36e7d557d4de", + "8ee82b3a2c0f42928b8f14dae4a97121", account_id="", - script_id="8ee82b3a2c0f42928b8f14dae4a97121", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `script_id` but received ''"): - await async_client.workers.deployments.by_scripts.with_raw_response.get( - "bcf48806-b317-4351-9ee7-36e7d557d4de", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - script_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `deployment_id` but received ''"): await async_client.workers.deployments.by_scripts.with_raw_response.get( "", account_id="023e105f4ecef8ad9ca31a8372d0c353", - script_id="8ee82b3a2c0f42928b8f14dae4a97121", ) diff --git a/tests/api_resources/workers/scripts/test_bindings.py b/tests/api_resources/workers/scripts/test_bindings.py index a74efc37865..28249940780 100644 --- a/tests/api_resources/workers/scripts/test_bindings.py +++ b/tests/api_resources/workers/scripts/test_bindings.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.workers.scripts import BindingListResponse +from cloudflare.types.workers.scripts import BindingGetResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -19,43 +19,43 @@ class TestBindings: @pytest.mark.skip() @parametrize - def test_method_list(self, client: Cloudflare) -> None: - binding = client.workers.scripts.bindings.list( + def test_method_get(self, client: Cloudflare) -> None: + binding = client.workers.scripts.bindings.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(BindingListResponse, binding, path=["response"]) + assert_matches_type(BindingGetResponse, binding, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.workers.scripts.bindings.with_raw_response.list( + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.workers.scripts.bindings.with_raw_response.get( zone_id="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"]) + assert_matches_type(BindingGetResponse, binding, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.workers.scripts.bindings.with_streaming_response.list( + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.workers.scripts.bindings.with_streaming_response.get( zone_id="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_matches_type(BindingGetResponse, binding, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - def test_path_params_list(self, client: Cloudflare) -> None: + def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - client.workers.scripts.bindings.with_raw_response.list( + client.workers.scripts.bindings.with_raw_response.get( zone_id="", ) @@ -65,42 +65,42 @@ class TestAsyncBindings: @pytest.mark.skip() @parametrize - async def test_method_list(self, async_client: AsyncCloudflare) -> None: - binding = await async_client.workers.scripts.bindings.list( + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + binding = await async_client.workers.scripts.bindings.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(BindingListResponse, binding, path=["response"]) + assert_matches_type(BindingGetResponse, binding, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.workers.scripts.bindings.with_raw_response.list( + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.workers.scripts.bindings.with_raw_response.get( zone_id="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"]) + assert_matches_type(BindingGetResponse, binding, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.workers.scripts.bindings.with_streaming_response.list( + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.workers.scripts.bindings.with_streaming_response.get( zone_id="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_matches_type(BindingGetResponse, 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: + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - await async_client.workers.scripts.bindings.with_raw_response.list( + await async_client.workers.scripts.bindings.with_raw_response.get( zone_id="", ) diff --git a/tests/api_resources/workers/scripts/test_schedules.py b/tests/api_resources/workers/scripts/test_schedules.py index 9dec24ab3fb..0f55089428a 100644 --- a/tests/api_resources/workers/scripts/test_schedules.py +++ b/tests/api_resources/workers/scripts/test_schedules.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.workers.scripts import ScheduleListResponse, ScheduleUpdateResponse +from cloudflare.types.workers.scripts import ScheduleGetResponse, ScheduleUpdateResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -76,17 +76,17 @@ def test_path_params_update(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_method_list(self, client: Cloudflare) -> None: - schedule = client.workers.scripts.schedules.list( + def test_method_get(self, client: Cloudflare) -> None: + schedule = client.workers.scripts.schedules.get( "this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(ScheduleListResponse, schedule, path=["response"]) + assert_matches_type(ScheduleGetResponse, schedule, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.workers.scripts.schedules.with_raw_response.list( + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.workers.scripts.schedules.with_raw_response.get( "this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -94,12 +94,12 @@ def test_raw_response_list(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" schedule = response.parse() - assert_matches_type(ScheduleListResponse, schedule, path=["response"]) + assert_matches_type(ScheduleGetResponse, schedule, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.workers.scripts.schedules.with_streaming_response.list( + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.workers.scripts.schedules.with_streaming_response.get( "this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: @@ -107,21 +107,21 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" schedule = response.parse() - assert_matches_type(ScheduleListResponse, schedule, path=["response"]) + assert_matches_type(ScheduleGetResponse, schedule, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - def test_path_params_list(self, client: Cloudflare) -> None: + def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.workers.scripts.schedules.with_raw_response.list( + client.workers.scripts.schedules.with_raw_response.get( "this-is_my_script-01", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `script_name` but received ''"): - client.workers.scripts.schedules.with_raw_response.list( + client.workers.scripts.schedules.with_raw_response.get( "", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -189,17 +189,17 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip() @parametrize - async def test_method_list(self, async_client: AsyncCloudflare) -> None: - schedule = await async_client.workers.scripts.schedules.list( + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + schedule = await async_client.workers.scripts.schedules.get( "this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(ScheduleListResponse, schedule, path=["response"]) + assert_matches_type(ScheduleGetResponse, schedule, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.workers.scripts.schedules.with_raw_response.list( + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.workers.scripts.schedules.with_raw_response.get( "this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -207,12 +207,12 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" schedule = await response.parse() - assert_matches_type(ScheduleListResponse, schedule, path=["response"]) + assert_matches_type(ScheduleGetResponse, schedule, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.workers.scripts.schedules.with_streaming_response.list( + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.workers.scripts.schedules.with_streaming_response.get( "this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: @@ -220,21 +220,21 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" schedule = await response.parse() - assert_matches_type(ScheduleListResponse, schedule, path=["response"]) + assert_matches_type(ScheduleGetResponse, schedule, 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: + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.workers.scripts.schedules.with_raw_response.list( + await async_client.workers.scripts.schedules.with_raw_response.get( "this-is_my_script-01", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `script_name` but received ''"): - await async_client.workers.scripts.schedules.with_raw_response.list( + await async_client.workers.scripts.schedules.with_raw_response.get( "", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) diff --git a/tests/api_resources/workers/scripts/test_tail.py b/tests/api_resources/workers/scripts/test_tail.py index 50807a87bc4..232bfa9fa82 100644 --- a/tests/api_resources/workers/scripts/test_tail.py +++ b/tests/api_resources/workers/scripts/test_tail.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.workers.scripts import TailListResponse, TailCreateResponse, TailDeleteResponse +from cloudflare.types.workers.scripts import TailGetResponse, TailCreateResponse, TailDeleteResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -69,58 +69,6 @@ def test_path_params_create(self, client: Cloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - @pytest.mark.skip() - @parametrize - def test_method_list(self, client: Cloudflare) -> None: - tail = client.workers.scripts.tail.list( - "this-is_my_script-01", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(TailListResponse, tail, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.workers.scripts.tail.with_raw_response.list( - "this-is_my_script-01", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - tail = response.parse() - assert_matches_type(TailListResponse, tail, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.workers.scripts.tail.with_streaming_response.list( - "this-is_my_script-01", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - tail = response.parse() - assert_matches_type(TailListResponse, tail, 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_id` but received ''"): - client.workers.scripts.tail.with_raw_response.list( - "this-is_my_script-01", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `script_name` but received ''"): - client.workers.scripts.tail.with_raw_response.list( - "", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - @pytest.mark.skip() @parametrize def test_method_delete(self, client: Cloudflare) -> None: @@ -185,75 +133,75 @@ def test_path_params_delete(self, client: Cloudflare) -> None: script_name="this-is_my_script-01", ) - -class TestAsyncTail: - 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: - tail = await async_client.workers.scripts.tail.create( + def test_method_get(self, client: Cloudflare) -> None: + tail = client.workers.scripts.tail.get( "this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(TailCreateResponse, tail, path=["response"]) + assert_matches_type(TailGetResponse, tail, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: - response = await async_client.workers.scripts.tail.with_raw_response.create( + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.workers.scripts.tail.with_raw_response.get( "this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - tail = await response.parse() - assert_matches_type(TailCreateResponse, tail, path=["response"]) + tail = response.parse() + assert_matches_type(TailGetResponse, tail, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: - async with async_client.workers.scripts.tail.with_streaming_response.create( + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.workers.scripts.tail.with_streaming_response.get( "this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - tail = await response.parse() - assert_matches_type(TailCreateResponse, tail, path=["response"]) + tail = response.parse() + assert_matches_type(TailGetResponse, tail, 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: + def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.workers.scripts.tail.with_raw_response.create( + client.workers.scripts.tail.with_raw_response.get( "this-is_my_script-01", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `script_name` but received ''"): - await async_client.workers.scripts.tail.with_raw_response.create( + client.workers.scripts.tail.with_raw_response.get( "", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) + +class TestAsyncTail: + 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: - tail = await async_client.workers.scripts.tail.list( + async def test_method_create(self, async_client: AsyncCloudflare) -> None: + tail = await async_client.workers.scripts.tail.create( "this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(TailListResponse, tail, path=["response"]) + assert_matches_type(TailCreateResponse, tail, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.workers.scripts.tail.with_raw_response.list( + async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: + response = await async_client.workers.scripts.tail.with_raw_response.create( "this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -261,12 +209,12 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" tail = await response.parse() - assert_matches_type(TailListResponse, tail, path=["response"]) + assert_matches_type(TailCreateResponse, tail, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.workers.scripts.tail.with_streaming_response.list( + async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: + async with async_client.workers.scripts.tail.with_streaming_response.create( "this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: @@ -274,21 +222,21 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" tail = await response.parse() - assert_matches_type(TailListResponse, tail, path=["response"]) + assert_matches_type(TailCreateResponse, tail, 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: + async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.workers.scripts.tail.with_raw_response.list( + await async_client.workers.scripts.tail.with_raw_response.create( "this-is_my_script-01", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `script_name` but received ''"): - await async_client.workers.scripts.tail.with_raw_response.list( + await async_client.workers.scripts.tail.with_raw_response.create( "", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -356,3 +304,55 @@ async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", script_name="this-is_my_script-01", ) + + @pytest.mark.skip() + @parametrize + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + tail = await async_client.workers.scripts.tail.get( + "this-is_my_script-01", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(TailGetResponse, tail, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.workers.scripts.tail.with_raw_response.get( + "this-is_my_script-01", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + tail = await response.parse() + assert_matches_type(TailGetResponse, tail, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.workers.scripts.tail.with_streaming_response.get( + "this-is_my_script-01", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + tail = await response.parse() + assert_matches_type(TailGetResponse, tail, 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_id` but received ''"): + await async_client.workers.scripts.tail.with_raw_response.get( + "this-is_my_script-01", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `script_name` but received ''"): + await async_client.workers.scripts.tail.with_raw_response.get( + "", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) diff --git a/tests/api_resources/zero_trust/access/users/test_last_seen_identity.py b/tests/api_resources/zero_trust/access/users/test_last_seen_identity.py index 30e5e8ec8d0..f4657ba962b 100644 --- a/tests/api_resources/zero_trust/access/users/test_last_seen_identity.py +++ b/tests/api_resources/zero_trust/access/users/test_last_seen_identity.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.zero_trust.access.users import LastSeenIdentityListResponse +from cloudflare.types.zero_trust.access.users import LastSeenIdentityGetResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -19,17 +19,17 @@ class TestLastSeenIdentity: @pytest.mark.skip() @parametrize - def test_method_list(self, client: Cloudflare) -> None: - last_seen_identity = client.zero_trust.access.users.last_seen_identity.list( + def test_method_get(self, client: Cloudflare) -> None: + last_seen_identity = client.zero_trust.access.users.last_seen_identity.get( "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", identifier="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(LastSeenIdentityListResponse, last_seen_identity, path=["response"]) + assert_matches_type(LastSeenIdentityGetResponse, last_seen_identity, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.zero_trust.access.users.last_seen_identity.with_raw_response.list( + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.zero_trust.access.users.last_seen_identity.with_raw_response.get( "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", identifier="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -37,12 +37,12 @@ def test_raw_response_list(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" last_seen_identity = response.parse() - assert_matches_type(LastSeenIdentityListResponse, last_seen_identity, path=["response"]) + assert_matches_type(LastSeenIdentityGetResponse, last_seen_identity, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.zero_trust.access.users.last_seen_identity.with_streaming_response.list( + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.zero_trust.access.users.last_seen_identity.with_streaming_response.get( "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", identifier="023e105f4ecef8ad9ca31a8372d0c353", ) as response: @@ -50,21 +50,21 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" last_seen_identity = response.parse() - assert_matches_type(LastSeenIdentityListResponse, last_seen_identity, path=["response"]) + assert_matches_type(LastSeenIdentityGetResponse, last_seen_identity, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - def test_path_params_list(self, client: Cloudflare) -> None: + def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `identifier` but received ''"): - client.zero_trust.access.users.last_seen_identity.with_raw_response.list( + client.zero_trust.access.users.last_seen_identity.with_raw_response.get( "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", identifier="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.zero_trust.access.users.last_seen_identity.with_raw_response.list( + client.zero_trust.access.users.last_seen_identity.with_raw_response.get( "", identifier="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -75,17 +75,17 @@ class TestAsyncLastSeenIdentity: @pytest.mark.skip() @parametrize - async def test_method_list(self, async_client: AsyncCloudflare) -> None: - last_seen_identity = await async_client.zero_trust.access.users.last_seen_identity.list( + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + last_seen_identity = await async_client.zero_trust.access.users.last_seen_identity.get( "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", identifier="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(LastSeenIdentityListResponse, last_seen_identity, path=["response"]) + assert_matches_type(LastSeenIdentityGetResponse, last_seen_identity, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.zero_trust.access.users.last_seen_identity.with_raw_response.list( + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.access.users.last_seen_identity.with_raw_response.get( "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", identifier="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -93,12 +93,12 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" last_seen_identity = await response.parse() - assert_matches_type(LastSeenIdentityListResponse, last_seen_identity, path=["response"]) + assert_matches_type(LastSeenIdentityGetResponse, last_seen_identity, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.zero_trust.access.users.last_seen_identity.with_streaming_response.list( + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.access.users.last_seen_identity.with_streaming_response.get( "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", identifier="023e105f4ecef8ad9ca31a8372d0c353", ) as response: @@ -106,21 +106,21 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" last_seen_identity = await response.parse() - assert_matches_type(LastSeenIdentityListResponse, last_seen_identity, path=["response"]) + assert_matches_type(LastSeenIdentityGetResponse, last_seen_identity, 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: + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `identifier` but received ''"): - await async_client.zero_trust.access.users.last_seen_identity.with_raw_response.list( + await async_client.zero_trust.access.users.last_seen_identity.with_raw_response.get( "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", identifier="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.zero_trust.access.users.last_seen_identity.with_raw_response.list( + await async_client.zero_trust.access.users.last_seen_identity.with_raw_response.get( "", identifier="023e105f4ecef8ad9ca31a8372d0c353", ) diff --git a/tests/api_resources/zero_trust/tunnels/test_configurations.py b/tests/api_resources/zero_trust/tunnels/test_configurations.py index c386835c21c..9ea36a15f1d 100644 --- a/tests/api_resources/zero_trust/tunnels/test_configurations.py +++ b/tests/api_resources/zero_trust/tunnels/test_configurations.py @@ -10,7 +10,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.types.zero_trust.tunnels import ( - ConfigurationListResponse, + ConfigurationGetResponse, ConfigurationUpdateResponse, ) @@ -183,17 +183,17 @@ def test_path_params_update(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_method_list(self, client: Cloudflare) -> None: - configuration = client.zero_trust.tunnels.configurations.list( + def test_method_get(self, client: Cloudflare) -> None: + configuration = client.zero_trust.tunnels.configurations.get( "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(ConfigurationListResponse, configuration, path=["response"]) + assert_matches_type(ConfigurationGetResponse, configuration, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.zero_trust.tunnels.configurations.with_raw_response.list( + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.zero_trust.tunnels.configurations.with_raw_response.get( "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -201,12 +201,12 @@ def test_raw_response_list(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" configuration = response.parse() - assert_matches_type(ConfigurationListResponse, configuration, path=["response"]) + assert_matches_type(ConfigurationGetResponse, configuration, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.zero_trust.tunnels.configurations.with_streaming_response.list( + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.zero_trust.tunnels.configurations.with_streaming_response.get( "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: @@ -214,21 +214,21 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" configuration = response.parse() - assert_matches_type(ConfigurationListResponse, configuration, path=["response"]) + assert_matches_type(ConfigurationGetResponse, configuration, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - def test_path_params_list(self, client: Cloudflare) -> None: + def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.zero_trust.tunnels.configurations.with_raw_response.list( + client.zero_trust.tunnels.configurations.with_raw_response.get( "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_id` but received ''"): - client.zero_trust.tunnels.configurations.with_raw_response.list( + client.zero_trust.tunnels.configurations.with_raw_response.get( "", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -400,17 +400,17 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip() @parametrize - async def test_method_list(self, async_client: AsyncCloudflare) -> None: - configuration = await async_client.zero_trust.tunnels.configurations.list( + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + configuration = await async_client.zero_trust.tunnels.configurations.get( "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(ConfigurationListResponse, configuration, path=["response"]) + assert_matches_type(ConfigurationGetResponse, configuration, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.zero_trust.tunnels.configurations.with_raw_response.list( + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.tunnels.configurations.with_raw_response.get( "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -418,12 +418,12 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" configuration = await response.parse() - assert_matches_type(ConfigurationListResponse, configuration, path=["response"]) + assert_matches_type(ConfigurationGetResponse, configuration, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.zero_trust.tunnels.configurations.with_streaming_response.list( + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.tunnels.configurations.with_streaming_response.get( "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: @@ -431,21 +431,21 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" configuration = await response.parse() - assert_matches_type(ConfigurationListResponse, configuration, path=["response"]) + assert_matches_type(ConfigurationGetResponse, configuration, 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: + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.zero_trust.tunnels.configurations.with_raw_response.list( + await async_client.zero_trust.tunnels.configurations.with_raw_response.get( "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_id` but received ''"): - await async_client.zero_trust.tunnels.configurations.with_raw_response.list( + await async_client.zero_trust.tunnels.configurations.with_raw_response.get( "", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) diff --git a/tests/api_resources/zero_trust/tunnels/test_connections.py b/tests/api_resources/zero_trust/tunnels/test_connections.py index 2f06f401288..b7da65f1422 100644 --- a/tests/api_resources/zero_trust/tunnels/test_connections.py +++ b/tests/api_resources/zero_trust/tunnels/test_connections.py @@ -10,7 +10,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.types.zero_trust.tunnels import ( - ConnectionListResponse, + ConnectionGetResponse, ConnectionDeleteResponse, ) @@ -22,111 +22,111 @@ class TestConnections: @pytest.mark.skip() @parametrize - def test_method_list(self, client: Cloudflare) -> None: - connection = client.zero_trust.tunnels.connections.list( + def test_method_delete(self, client: Cloudflare) -> None: + connection = client.zero_trust.tunnels.connections.delete( "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", + body={}, ) - assert_matches_type(Optional[ConnectionListResponse], connection, path=["response"]) + assert_matches_type(ConnectionDeleteResponse, connection, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.zero_trust.tunnels.connections.with_raw_response.list( + def test_raw_response_delete(self, client: Cloudflare) -> None: + response = client.zero_trust.tunnels.connections.with_raw_response.delete( "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", + body={}, ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" connection = response.parse() - assert_matches_type(Optional[ConnectionListResponse], connection, path=["response"]) + assert_matches_type(ConnectionDeleteResponse, connection, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.zero_trust.tunnels.connections.with_streaming_response.list( + def test_streaming_response_delete(self, client: Cloudflare) -> None: + with client.zero_trust.tunnels.connections.with_streaming_response.delete( "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", + body={}, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" connection = response.parse() - assert_matches_type(Optional[ConnectionListResponse], connection, path=["response"]) + assert_matches_type(ConnectionDeleteResponse, connection, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - def test_path_params_list(self, client: Cloudflare) -> None: + def test_path_params_delete(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.zero_trust.tunnels.connections.with_raw_response.list( + client.zero_trust.tunnels.connections.with_raw_response.delete( "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="", + body={}, ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_id` but received ''"): - client.zero_trust.tunnels.connections.with_raw_response.list( + client.zero_trust.tunnels.connections.with_raw_response.delete( "", account_id="699d98642c564d2e855e9661899b7252", + body={}, ) @pytest.mark.skip() @parametrize - def test_method_delete(self, client: Cloudflare) -> None: - connection = client.zero_trust.tunnels.connections.delete( + def test_method_get(self, client: Cloudflare) -> None: + connection = client.zero_trust.tunnels.connections.get( "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", - body={}, ) - assert_matches_type(ConnectionDeleteResponse, connection, path=["response"]) + assert_matches_type(Optional[ConnectionGetResponse], connection, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_delete(self, client: Cloudflare) -> None: - response = client.zero_trust.tunnels.connections.with_raw_response.delete( + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.zero_trust.tunnels.connections.with_raw_response.get( "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", - body={}, ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" connection = response.parse() - assert_matches_type(ConnectionDeleteResponse, connection, path=["response"]) + assert_matches_type(Optional[ConnectionGetResponse], connection, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_delete(self, client: Cloudflare) -> None: - with client.zero_trust.tunnels.connections.with_streaming_response.delete( + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.zero_trust.tunnels.connections.with_streaming_response.get( "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", - body={}, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" connection = response.parse() - assert_matches_type(ConnectionDeleteResponse, connection, path=["response"]) + assert_matches_type(Optional[ConnectionGetResponse], connection, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - def test_path_params_delete(self, client: Cloudflare) -> None: + def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.zero_trust.tunnels.connections.with_raw_response.delete( + client.zero_trust.tunnels.connections.with_raw_response.get( "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="", - body={}, ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_id` but received ''"): - client.zero_trust.tunnels.connections.with_raw_response.delete( + client.zero_trust.tunnels.connections.with_raw_response.get( "", account_id="699d98642c564d2e855e9661899b7252", - body={}, ) @@ -135,109 +135,109 @@ class TestAsyncConnections: @pytest.mark.skip() @parametrize - async def test_method_list(self, async_client: AsyncCloudflare) -> None: - connection = await async_client.zero_trust.tunnels.connections.list( + async def test_method_delete(self, async_client: AsyncCloudflare) -> None: + connection = await async_client.zero_trust.tunnels.connections.delete( "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", + body={}, ) - assert_matches_type(Optional[ConnectionListResponse], connection, path=["response"]) + assert_matches_type(ConnectionDeleteResponse, connection, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.zero_trust.tunnels.connections.with_raw_response.list( + async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.tunnels.connections.with_raw_response.delete( "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", + body={}, ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" connection = await response.parse() - assert_matches_type(Optional[ConnectionListResponse], connection, path=["response"]) + assert_matches_type(ConnectionDeleteResponse, connection, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.zero_trust.tunnels.connections.with_streaming_response.list( + async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.tunnels.connections.with_streaming_response.delete( "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", + body={}, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" connection = await response.parse() - assert_matches_type(Optional[ConnectionListResponse], connection, path=["response"]) + assert_matches_type(ConnectionDeleteResponse, connection, 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: + async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.zero_trust.tunnels.connections.with_raw_response.list( + await async_client.zero_trust.tunnels.connections.with_raw_response.delete( "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="", + body={}, ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_id` but received ''"): - await async_client.zero_trust.tunnels.connections.with_raw_response.list( + await async_client.zero_trust.tunnels.connections.with_raw_response.delete( "", account_id="699d98642c564d2e855e9661899b7252", + body={}, ) @pytest.mark.skip() @parametrize - async def test_method_delete(self, async_client: AsyncCloudflare) -> None: - connection = await async_client.zero_trust.tunnels.connections.delete( + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + connection = await async_client.zero_trust.tunnels.connections.get( "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", - body={}, ) - assert_matches_type(ConnectionDeleteResponse, connection, path=["response"]) + assert_matches_type(Optional[ConnectionGetResponse], connection, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: - response = await async_client.zero_trust.tunnels.connections.with_raw_response.delete( + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.tunnels.connections.with_raw_response.get( "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", - body={}, ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" connection = await response.parse() - assert_matches_type(ConnectionDeleteResponse, connection, path=["response"]) + assert_matches_type(Optional[ConnectionGetResponse], connection, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: - async with async_client.zero_trust.tunnels.connections.with_streaming_response.delete( + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.tunnels.connections.with_streaming_response.get( "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", - body={}, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" connection = await response.parse() - assert_matches_type(ConnectionDeleteResponse, connection, path=["response"]) + assert_matches_type(Optional[ConnectionGetResponse], connection, 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: + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.zero_trust.tunnels.connections.with_raw_response.delete( + await async_client.zero_trust.tunnels.connections.with_raw_response.get( "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="", - body={}, ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `tunnel_id` but received ''"): - await async_client.zero_trust.tunnels.connections.with_raw_response.delete( + await async_client.zero_trust.tunnels.connections.with_raw_response.get( "", account_id="699d98642c564d2e855e9661899b7252", - body={}, ) diff --git a/tests/api_resources/zones/test_settings.py b/tests/api_resources/zones/test_settings.py index e069c65c467..ac9f4a5edc8 100644 --- a/tests/api_resources/zones/test_settings.py +++ b/tests/api_resources/zones/test_settings.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.zones import SettingEditResponse, SettingListResponse +from cloudflare.types.zones import SettingGetResponse, SettingEditResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -17,48 +17,6 @@ class TestSettings: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() - @parametrize - def test_method_list(self, client: Cloudflare) -> None: - setting = client.zones.settings.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - assert_matches_type(Optional[SettingListResponse], setting, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.zones.settings.with_raw_response.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - setting = response.parse() - assert_matches_type(Optional[SettingListResponse], setting, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.zones.settings.with_streaming_response.list( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - setting = response.parse() - assert_matches_type(Optional[SettingListResponse], setting, 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 `zone_id` but received ''"): - client.zones.settings.with_raw_response.list( - zone_id="", - ) - @pytest.mark.skip(reason="oneOf doesnt match") @parametrize def test_method_edit(self, client: Cloudflare) -> None: @@ -157,52 +115,52 @@ def test_path_params_edit(self, client: Cloudflare) -> None: ], ) - -class TestAsyncSettings: - 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: - setting = await async_client.zones.settings.list( + def test_method_get(self, client: Cloudflare) -> None: + setting = client.zones.settings.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[SettingListResponse], setting, path=["response"]) + assert_matches_type(Optional[SettingGetResponse], setting, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.zones.settings.with_raw_response.list( + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.zones.settings.with_raw_response.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - setting = await response.parse() - assert_matches_type(Optional[SettingListResponse], setting, path=["response"]) + setting = response.parse() + assert_matches_type(Optional[SettingGetResponse], setting, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.zones.settings.with_streaming_response.list( + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.zones.settings.with_streaming_response.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - setting = await response.parse() - assert_matches_type(Optional[SettingListResponse], setting, path=["response"]) + setting = response.parse() + assert_matches_type(Optional[SettingGetResponse], setting, 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: + def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - await async_client.zones.settings.with_raw_response.list( + client.zones.settings.with_raw_response.get( zone_id="", ) + +class TestAsyncSettings: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip(reason="oneOf doesnt match") @parametrize async def test_method_edit(self, async_client: AsyncCloudflare) -> None: @@ -300,3 +258,45 @@ async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: }, ], ) + + @pytest.mark.skip() + @parametrize + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + setting = await async_client.zones.settings.get( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[SettingGetResponse], setting, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zones.settings.with_raw_response.get( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + setting = await response.parse() + assert_matches_type(Optional[SettingGetResponse], setting, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.zones.settings.with_streaming_response.get( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + setting = await response.parse() + assert_matches_type(Optional[SettingGetResponse], setting, 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 `zone_id` but received ''"): + await async_client.zones.settings.with_raw_response.get( + zone_id="", + )