diff --git a/README.md b/README.md index 41f43f1232d..e92ab950911 100644 --- a/README.md +++ b/README.md @@ -352,13 +352,12 @@ You can directly override the [httpx client](https://www.python-httpx.org/api/#c - Additional [advanced](https://www.python-httpx.org/advanced/#client-instances) functionality ```python -import httpx -from cloudflare import Cloudflare +from cloudflare import Cloudflare, DefaultHttpxClient client = Cloudflare( # Or use the `CLOUDFLARE_BASE_URL` env var base_url="http://my.test.server.example.com:8083", - http_client=httpx.Client( + http_client=DefaultHttpxClient( proxies="http://my.test.proxy.example.com", transport=httpx.HTTPTransport(local_address="0.0.0.0"), ), diff --git a/api.md b/api.md index 2205f3e5633..3e23505bc40 100644 --- a/api.md +++ b/api.md @@ -23,11 +23,9 @@ from cloudflare.types import ( UnnamedSchemaRefB92f86eb861cd3dee83c40884802fda6, UnnamedSchemaRefCc2ac1a037e5d6702fc77b3bcb527854, UnnamedSchemaRefD8600eb4758b3ae35607a0327bcd691b, - UnnamedSchemaRefDfef9380cb53cc7d4bda9f75e109d7a2, UnnamedSchemaRefE7c61ebe06ebfc3861ae8b9db4ba152b, UnnamedSchemaRefEc4d85c3d1bcc6b3b7e99c199ae99846, UnnamedSchemaRefEe1e79edcb234d14c4dd266880f2fd24, - UnnamedSchemaRefFb1dc8bb871d835b75bd0c2f50bd8572, ) ``` @@ -52,7 +50,8 @@ Types: ```python from cloudflare.types.accounts import ( Member, - MemberWithCode, + MemberRole, + MemberWithInviteCode, MemberListResponse, MemberDeleteResponse, ) @@ -60,7 +59,7 @@ from cloudflare.types.accounts import ( Methods: -- client.accounts.members.create(\*, account_id, \*\*params) -> MemberWithCode +- client.accounts.members.create(\*, account_id, \*\*params) -> MemberWithInviteCode - client.accounts.members.update(member_id, \*, account_id, \*\*params) -> Member - client.accounts.members.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[MemberListResponse] - client.accounts.members.delete(member_id, \*, account_id, \*\*params) -> Optional @@ -121,13 +120,7 @@ Methods: - client.memberships.delete(membership_id, \*\*params) -> MembershipDeleteResponse - client.memberships.get(membership_id) -> UnnamedSchemaRef9444735ca60712dbcf8afd832eb5716a -# UserResource - -Types: - -```python -from cloudflare.types import User -``` +# User Methods: @@ -173,15 +166,20 @@ Methods: Types: ```python -from cloudflare.types.user.firewall import AccessRule, AccessRuleDeleteResponse +from cloudflare.types.user.firewall import ( + AccessRuleCreateResponse, + AccessRuleListResponse, + AccessRuleDeleteResponse, + AccessRuleEditResponse, +) ``` Methods: -- client.user.firewall.access_rules.create(\*\*params) -> Optional -- client.user.firewall.access_rules.list(\*\*params) -> SyncV4PagePaginationArray[AccessRule] -- client.user.firewall.access_rules.delete(identifier, \*\*params) -> Optional -- client.user.firewall.access_rules.edit(identifier, \*\*params) -> Optional +- client.user.firewall.access_rules.create(\*\*params) -> AccessRuleCreateResponse +- client.user.firewall.access_rules.list(\*\*params) -> SyncV4PagePaginationArray[AccessRuleListResponse] +- client.user.firewall.access_rules.delete(identifier, \*\*params) -> AccessRuleDeleteResponse +- client.user.firewall.access_rules.edit(identifier, \*\*params) -> AccessRuleEditResponse ## Invites @@ -249,31 +247,31 @@ Methods: - client.user.load_balancers.pools.preview(pool_id, \*\*params) -> PoolPreviewResponse - client.user.load_balancers.pools.references(pool_id) -> Optional -### Preview +### PreviewResource Types: ```python -from cloudflare.types.user.load_balancers import LoadBalancingPreview +from cloudflare.types.user.load_balancers import Preview ``` Methods: -- client.user.load_balancers.preview.get(preview_id) -> LoadBalancingPreview +- client.user.load_balancers.preview.get(preview_id) -> Preview ### Analytics -#### Events - Types: ```python -from cloudflare.types.user.load_balancers.analytics import LoadBalancingAnalytics +from cloudflare.types.user.load_balancers import Analytics ``` +#### Events + Methods: -- client.user.load_balancers.analytics.events.list(\*\*params) -> SyncSinglePage[LoadBalancingAnalytics] +- client.user.load_balancers.analytics.events.list(\*\*params) -> SyncSinglePage[Analytics] ## Organizations @@ -311,7 +309,7 @@ Types: ```python from cloudflare.types.user import ( CIDRListItem, - PolicyWithPermissionGroups, + Policy, TokenCreateResponse, TokenListResponse, TokenDeleteResponse, @@ -340,17 +338,17 @@ Methods: - client.user.tokens.permission_groups.list() -> SyncSinglePage[object] -### Value +### ValueResource Types: ```python -from cloudflare.types.user.tokens import TokenValue +from cloudflare.types.user.tokens import Value ``` Methods: -- client.user.tokens.value.update(token_id, \*\*params) -> str +- client.user.tokens.value.update(token_id, \*\*params) -> str # Zones @@ -1073,14 +1071,14 @@ Methods: Types: ```python -from cloudflare.types.zones import UnnamedSchemaRef45004a9444b6da9f88158ed2fb9a5820 +from cloudflare.types.zones import ZoneHold ``` Methods: -- client.zones.holds.create(\*, zone_id, \*\*params) -> UnnamedSchemaRef45004a9444b6da9f88158ed2fb9a5820 -- client.zones.holds.delete(\*, zone_id, \*\*params) -> Optional -- client.zones.holds.get(\*, zone_id) -> UnnamedSchemaRef45004a9444b6da9f88158ed2fb9a5820 +- client.zones.holds.create(\*, zone_id, \*\*params) -> ZoneHold +- client.zones.holds.delete(\*, zone_id, \*\*params) -> Optional +- client.zones.holds.get(\*, zone_id) -> ZoneHold ## Workers @@ -1094,16 +1092,10 @@ Methods: ## Subscriptions -Types: - -```python -from cloudflare.types.zones import SubscriptionListResponse -``` - Methods: - client.zones.subscriptions.create(identifier, \*\*params) -> UnnamedSchemaRef9444735ca60712dbcf8afd832eb5716a -- client.zones.subscriptions.list(account_identifier) -> SyncSinglePage[SubscriptionListResponse] +- client.zones.subscriptions.list(account_identifier) -> SyncSinglePage[Subscription] - client.zones.subscriptions.get(identifier) -> UnnamedSchemaRef9444735ca60712dbcf8afd832eb5716a # LoadBalancers @@ -1123,7 +1115,6 @@ from cloudflare.types import ( LocationStrategy, NotificationFilter, Origin, - OriginItem, OriginSteering, RandomSteering, RulesItem, @@ -1229,7 +1220,7 @@ Methods: Methods: -- client.load_balancers.previews.get(preview_id, \*, account_id) -> LoadBalancingPreview +- client.load_balancers.previews.get(preview_id, \*, account_id) -> Preview ## Regions @@ -1408,16 +1399,12 @@ Methods: - client.ssl.universal.settings.edit(\*, zone_id, \*\*params) -> UniversalSSLSettings - client.ssl.universal.settings.get(\*, zone_id) -> UniversalSSLSettings -## Verification +## VerificationResource Types: ```python -from cloudflare.types.ssl import ( - TLSVerificationSetting, - VerificationEditResponse, - VerificationGetResponse, -) +from cloudflare.types.ssl import Verification, VerificationEditResponse, VerificationGetResponse ``` Methods: @@ -1430,14 +1417,14 @@ Methods: Types: ```python -from cloudflare.types import SubscriptionListResponse, SubscriptionDeleteResponse +from cloudflare.types import SubscriptionDeleteResponse ``` Methods: - client.subscriptions.create(identifier, \*\*params) -> UnnamedSchemaRef9444735ca60712dbcf8afd832eb5716a - client.subscriptions.update(subscription_identifier, \*, account_identifier, \*\*params) -> UnnamedSchemaRef9444735ca60712dbcf8afd832eb5716a -- client.subscriptions.list(account_identifier) -> SyncSinglePage[SubscriptionListResponse] +- client.subscriptions.list(account_identifier) -> SyncSinglePage[Subscription] - client.subscriptions.delete(subscription_identifier, \*, account_identifier, \*\*params) -> SubscriptionDeleteResponse - client.subscriptions.get(identifier) -> UnnamedSchemaRef9444735ca60712dbcf8afd832eb5716a @@ -1568,25 +1555,20 @@ Types: ```python from cloudflare.types import ( CustomHostname, - SSL, UnnamedSchemaRef16aca57bde2963201c7e6e895436c1c1, UnnamedSchemaRef78adb375f06c6d462dd92b99e2ecf510, UnnamedSchemaRef9a9935a9a770967bb604ae41a81e42e1, UnnamedSchemaRefD2a16d7ee1ad3a888dd5821c918d51fd, - CustomHostnameCreateResponse, - CustomHostnameListResponse, - CustomHostnameEditResponse, - CustomHostnameGetResponse, ) ``` Methods: -- client.custom_hostnames.create(\*, zone_id, \*\*params) -> CustomHostnameCreateResponse -- client.custom_hostnames.list(\*, zone_id, \*\*params) -> SyncV4PagePaginationArray[CustomHostnameListResponse] +- client.custom_hostnames.create(\*, zone_id, \*\*params) -> CustomHostname +- client.custom_hostnames.list(\*, zone_id, \*\*params) -> SyncV4PagePaginationArray[CustomHostname] - client.custom_hostnames.delete(custom_hostname_id, \*, zone_id, \*\*params) -> UnnamedSchemaRef8900f4cb9dca9b9ed0ac41ad571e6837 -- client.custom_hostnames.edit(custom_hostname_id, \*, zone_id, \*\*params) -> CustomHostnameEditResponse -- client.custom_hostnames.get(custom_hostname_id, \*, zone_id) -> CustomHostnameGetResponse +- client.custom_hostnames.edit(custom_hostname_id, \*, zone_id, \*\*params) -> CustomHostname +- client.custom_hostnames.get(custom_hostname_id, \*, zone_id) -> CustomHostname ## FallbackOrigin @@ -1687,33 +1669,33 @@ Methods: Types: ```python -from cloudflare.types.dns.analytics import DNSAnalyticsReport +from cloudflare.types.dns.analytics import Report ``` Methods: -- client.dns.analytics.reports.get(\*, zone_id, \*\*params) -> DNSAnalyticsReport +- client.dns.analytics.reports.get(\*, zone_id, \*\*params) -> Report #### Bytimes Types: ```python -from cloudflare.types.dns.analytics.reports import DNSAnalyticsReportByTime +from cloudflare.types.dns.analytics.reports import ByTime ``` Methods: -- client.dns.analytics.reports.bytimes.get(\*, zone_id, \*\*params) -> DNSAnalyticsReportByTime +- client.dns.analytics.reports.bytimes.get(\*, zone_id, \*\*params) -> ByTime -## Firewall +## FirewallResource Types: ```python from cloudflare.types.dns import ( AttackMitigation, - DNSFirewall, + Firewall, FirewallIPsItem, UnnamedSchemaRef7a0f93d9e1afc3221d2a57b7bab16955, UpstreamIPsItems, @@ -1723,11 +1705,11 @@ from cloudflare.types.dns import ( Methods: -- client.dns.firewall.create(\*, account_id, \*\*params) -> DNSFirewall -- client.dns.firewall.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[DNSFirewall] +- client.dns.firewall.create(\*, account_id, \*\*params) -> Firewall +- client.dns.firewall.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[Firewall] - client.dns.firewall.delete(dns_firewall_id, \*, account_id, \*\*params) -> FirewallDeleteResponse -- client.dns.firewall.edit(dns_firewall_id, \*, account_id, \*\*params) -> DNSFirewall -- client.dns.firewall.get(dns_firewall_id, \*, account_id) -> DNSFirewall +- client.dns.firewall.edit(dns_firewall_id, \*, account_id, \*\*params) -> Firewall +- client.dns.firewall.get(dns_firewall_id, \*, account_id) -> Firewall ### Analytics @@ -1735,13 +1717,13 @@ Methods: Methods: -- client.dns.firewall.analytics.reports.get(dns_firewall_id, \*, account_id, \*\*params) -> DNSAnalyticsReport +- client.dns.firewall.analytics.reports.get(dns_firewall_id, \*, account_id, \*\*params) -> Report ##### Bytimes Methods: -- client.dns.firewall.analytics.reports.bytimes.get(dns_firewall_id, \*, account_id, \*\*params) -> DNSAnalyticsReportByTime +- client.dns.firewall.analytics.reports.bytimes.get(dns_firewall_id, \*, account_id, \*\*params) -> ByTime # DNSSECResource @@ -1762,21 +1744,21 @@ Methods: Types: ```python -from cloudflare.types import EmailSettings +from cloudflare.types import Settings ``` Methods: -- client.email_routing.disable(zone_identifier, \*\*params) -> EmailSettings -- client.email_routing.enable(zone_identifier, \*\*params) -> EmailSettings -- client.email_routing.get(zone_identifier) -> EmailSettings +- client.email_routing.disable(zone_identifier, \*\*params) -> Settings +- client.email_routing.enable(zone_identifier, \*\*params) -> Settings +- client.email_routing.get(zone_identifier) -> Settings ## DNS Types: ```python -from cloudflare.types.email_routing import EmailDNSRecord, DNSGetResponse +from cloudflare.types.email_routing import DNSRecord, DNSGetResponse ``` Methods: @@ -1788,51 +1770,49 @@ Methods: Types: ```python -from cloudflare.types.email_routing import ( - Action, - ActionItem, - EmailRule, - Matcher, - MatcherItem, - Properties, -) +from cloudflare.types.email_routing import Action, EmailRule, Matcher ``` Methods: -- client.email_routing.rules.create(zone_identifier, \*\*params) -> Properties -- client.email_routing.rules.update(rule_identifier, \*, zone_identifier, \*\*params) -> Properties -- client.email_routing.rules.list(zone_identifier, \*\*params) -> SyncV4PagePaginationArray[Properties] -- client.email_routing.rules.delete(rule_identifier, \*, zone_identifier) -> Properties -- client.email_routing.rules.get(rule_identifier, \*, zone_identifier) -> Properties +- client.email_routing.rules.create(zone_identifier, \*\*params) -> EmailRule +- client.email_routing.rules.update(rule_identifier, \*, zone_identifier, \*\*params) -> EmailRule +- client.email_routing.rules.list(zone_identifier, \*\*params) -> SyncV4PagePaginationArray[EmailRule] +- client.email_routing.rules.delete(rule_identifier, \*, zone_identifier) -> EmailRule +- client.email_routing.rules.get(rule_identifier, \*, zone_identifier) -> EmailRule ### CatchAlls Types: ```python -from cloudflare.types.email_routing.rules import Action, EmailCatchAllRule, Matcher +from cloudflare.types.email_routing.rules import ( + CatchAllAction, + CatchAllMatcher, + CatchAllUpdateResponse, + CatchAllGetResponse, +) ``` Methods: -- client.email_routing.rules.catch_alls.update(zone_identifier, \*\*params) -> EmailCatchAllRule -- client.email_routing.rules.catch_alls.get(zone_identifier) -> EmailCatchAllRule +- client.email_routing.rules.catch_alls.update(zone_identifier, \*\*params) -> CatchAllUpdateResponse +- client.email_routing.rules.catch_alls.get(zone_identifier) -> CatchAllGetResponse ## Addresses Types: ```python -from cloudflare.types.email_routing import DestinationAddress, EmailAddresses +from cloudflare.types.email_routing import Address ``` Methods: -- client.email_routing.addresses.create(account_identifier, \*\*params) -> DestinationAddress -- client.email_routing.addresses.list(account_identifier, \*\*params) -> SyncV4PagePaginationArray[DestinationAddress] -- client.email_routing.addresses.delete(destination_address_identifier, \*, account_identifier) -> DestinationAddress -- client.email_routing.addresses.get(destination_address_identifier, \*, account_identifier) -> DestinationAddress +- client.email_routing.addresses.create(account_identifier, \*\*params) -> Address +- client.email_routing.addresses.list(account_identifier, \*\*params) -> SyncV4PagePaginationArray[Address] +- client.email_routing.addresses.delete(destination_address_identifier, \*, account_identifier) -> Address +- client.email_routing.addresses.get(destination_address_identifier, \*, account_identifier) -> Address # Filters @@ -1840,19 +1820,21 @@ Types: ```python from cloudflare.types import ( - FirewallFilter, - UnnamedSchemaRef39af4f78d23244e2595fb47c811221df, FilterCreateResponse, + FilterUpdateResponse, + FilterListResponse, + FilterDeleteResponse, + FilterGetResponse, ) ``` Methods: - client.filters.create(zone_identifier, \*\*params) -> Optional -- client.filters.update(id, \*, zone_identifier, \*\*params) -> Optional -- client.filters.list(zone_identifier, \*\*params) -> SyncV4PagePaginationArray[FirewallFilter] -- client.filters.delete(id, \*, zone_identifier, \*\*params) -> Optional -- client.filters.get(id, \*, zone_identifier) -> Optional +- client.filters.update(id, \*, zone_identifier, \*\*params) -> FilterUpdateResponse +- client.filters.list(zone_identifier, \*\*params) -> SyncV4PagePaginationArray[FilterListResponse] +- client.filters.delete(id, \*, zone_identifier, \*\*params) -> FilterDeleteResponse +- client.filters.get(id, \*, zone_identifier) -> FilterGetResponse # Firewall @@ -1862,19 +1844,22 @@ Types: ```python from cloudflare.types.firewall import ( - FirewallZoneLockdown, - UnnamedSchemaRefA4044d3c73ad1e6c8fff4dc05f922ab5, + CIDRConfiguration, + Configuration, + IPConfiguration, + Lockdown, + URLsItem, LockdownDeleteResponse, ) ``` Methods: -- client.firewall.lockdowns.create(zone_identifier, \*\*params) -> Optional -- client.firewall.lockdowns.update(id, \*, zone_identifier, \*\*params) -> Optional -- client.firewall.lockdowns.list(zone_identifier, \*\*params) -> SyncV4PagePaginationArray[FirewallZoneLockdown] +- client.firewall.lockdowns.create(zone_identifier, \*\*params) -> Lockdown +- client.firewall.lockdowns.update(id, \*, zone_identifier, \*\*params) -> Lockdown +- client.firewall.lockdowns.list(zone_identifier, \*\*params) -> SyncV4PagePaginationArray[Lockdown] - client.firewall.lockdowns.delete(id, \*, zone_identifier, \*\*params) -> Optional -- client.firewall.lockdowns.get(id, \*, zone_identifier) -> Optional +- client.firewall.lockdowns.get(id, \*, zone_identifier) -> Lockdown ## Rules @@ -1882,9 +1867,9 @@ Types: ```python from cloudflare.types.firewall import ( - FirewallFilterRule, - UnnamedSchemaRef6fe6c1eba94d9c3f475fb22f0118bf57, - UnnamedSchemaRefAb48d2d33259c9107401d174735701c7, + ProductsItem, + Rule, + DeletedFilter, RuleCreateResponse, RuleEditResponse, ) @@ -1893,11 +1878,11 @@ from cloudflare.types.firewall import ( Methods: - client.firewall.rules.create(zone_identifier, \*\*params) -> Optional -- client.firewall.rules.update(id, \*, zone_identifier, \*\*params) -> Optional -- client.firewall.rules.list(zone_identifier, \*\*params) -> SyncV4PagePaginationArray[FirewallFilterRule] -- client.firewall.rules.delete(id, \*, zone_identifier, \*\*params) -> Optional +- client.firewall.rules.update(id, \*, zone_identifier, \*\*params) -> Rule +- client.firewall.rules.list(zone_identifier, \*\*params) -> SyncV4PagePaginationArray[Rule] +- client.firewall.rules.delete(id, \*, zone_identifier, \*\*params) -> Rule - client.firewall.rules.edit(id, \*, zone_identifier, \*\*params) -> Optional -- client.firewall.rules.get(zone_identifier, \*, path_id, \*\*params) -> Optional +- client.firewall.rules.get(zone_identifier, \*, path_id, \*\*params) -> Rule ## AccessRules @@ -1920,11 +1905,7 @@ Methods: Types: ```python -from cloudflare.types.firewall import ( - FirewallUserAgentRule, - UARuleListResponse, - UARuleDeleteResponse, -) +from cloudflare.types.firewall import UARuleListResponse, UARuleDeleteResponse ``` Methods: @@ -1932,7 +1913,7 @@ Methods: - client.firewall.ua_rules.create(zone_identifier, \*\*params) -> UnnamedSchemaRef9444735ca60712dbcf8afd832eb5716a - client.firewall.ua_rules.update(id, \*, zone_identifier, \*\*params) -> UnnamedSchemaRef9444735ca60712dbcf8afd832eb5716a - client.firewall.ua_rules.list(zone_identifier, \*\*params) -> SyncV4PagePaginationArray[UARuleListResponse] -- client.firewall.ua_rules.delete(id, \*, zone_identifier, \*\*params) -> Optional +- client.firewall.ua_rules.delete(id, \*, zone_identifier, \*\*params) -> UARuleDeleteResponse - client.firewall.ua_rules.get(id, \*, zone_identifier) -> UnnamedSchemaRef9444735ca60712dbcf8afd832eb5716a ## WAF @@ -1943,19 +1924,21 @@ Types: ```python from cloudflare.types.firewall.waf import ( - UnnamedSchemaRefA9cc7506f87ce3d646e3794e609120a1, - WAFOverride, + Override, + RewriteAction, + Rules, + URLsItems, OverrideDeleteResponse, ) ``` Methods: -- client.firewall.waf.overrides.create(zone_identifier, \*\*params) -> Optional -- client.firewall.waf.overrides.update(id, \*, zone_identifier, \*\*params) -> Optional -- client.firewall.waf.overrides.list(zone_identifier, \*\*params) -> SyncV4PagePaginationArray[WAFOverride] +- client.firewall.waf.overrides.create(zone_identifier, \*\*params) -> Override +- client.firewall.waf.overrides.update(id, \*, zone_identifier, \*\*params) -> Override +- client.firewall.waf.overrides.list(zone_identifier, \*\*params) -> SyncV4PagePaginationArray[Override] - client.firewall.waf.overrides.delete(id, \*, zone_identifier, \*\*params) -> Optional -- client.firewall.waf.overrides.get(id, \*, zone_identifier) -> Optional +- client.firewall.waf.overrides.get(id, \*, zone_identifier) -> Override ### Packages @@ -1975,12 +1958,12 @@ Methods: Types: ```python -from cloudflare.types.firewall.waf.packages import WAFManagedRulesGroup +from cloudflare.types.firewall.waf.packages import Group ``` Methods: -- client.firewall.waf.packages.groups.list(package_id, \*, zone_id, \*\*params) -> SyncV4PagePaginationArray[WAFManagedRulesGroup] +- client.firewall.waf.packages.groups.list(package_id, \*, zone_id, \*\*params) -> SyncV4PagePaginationArray[Group] - client.firewall.waf.packages.groups.edit(group_id, \*, zone_id, package_id, \*\*params) -> UnnamedSchemaRef9444735ca60712dbcf8afd832eb5716a - client.firewall.waf.packages.groups.get(group_id, \*, zone_id, package_id) -> UnnamedSchemaRef9444735ca60712dbcf8afd832eb5716a @@ -1990,15 +1973,15 @@ Types: ```python from cloudflare.types.firewall.waf.packages import ( + Rule, UnnamedSchemaRef532d8b97684c9032dd36bae8acddebf5, - WAFManagedRulesRule, RuleEditResponse, ) ``` Methods: -- client.firewall.waf.packages.rules.list(package_id, \*, zone_id, \*\*params) -> SyncV4PagePaginationArray[WAFManagedRulesRule] +- client.firewall.waf.packages.rules.list(package_id, \*, zone_id, \*\*params) -> SyncV4PagePaginationArray[Rule] - client.firewall.waf.packages.rules.edit(rule_id, \*, zone_id, package_id, \*\*params) -> RuleEditResponse - client.firewall.waf.packages.rules.get(rule_id, \*, zone_id, package_id) -> UnnamedSchemaRef9444735ca60712dbcf8afd832eb5716a @@ -2008,11 +1991,11 @@ Types: ```python from cloudflare.types import ( - CheckRegionItem, + CheckRegion, Healthcheck, HTTPConfiguration, QueryHealthcheck, - TcpConfiguration, + TCPConfiguration, UnnamedSchemaRefAaa560acadcbf1ae1dc619ba1ea5948e, HealthcheckDeleteResponse, ) @@ -2047,8 +2030,8 @@ Types: ```python from cloudflare.types import ( + Hostname, KeylessCertificate, - KeylessCertificateHostname, Tunnel, UnnamedSchemaRefA91f0bd72ee433f010eecfdc94ccf298, ) @@ -2056,11 +2039,11 @@ from cloudflare.types import ( Methods: -- client.keyless_certificates.create(\*, zone_id, \*\*params) -> KeylessCertificateHostname -- client.keyless_certificates.list(\*, zone_id) -> SyncSinglePage[KeylessCertificateHostname] +- client.keyless_certificates.create(\*, zone_id, \*\*params) -> Hostname +- client.keyless_certificates.list(\*, zone_id) -> SyncSinglePage[KeylessCertificate] - client.keyless_certificates.delete(keyless_certificate_id, \*, zone_id, \*\*params) -> UnnamedSchemaRef8900f4cb9dca9b9ed0ac41ad571e6837 -- client.keyless_certificates.edit(keyless_certificate_id, \*, zone_id, \*\*params) -> KeylessCertificateHostname -- client.keyless_certificates.get(keyless_certificate_id, \*, zone_id) -> KeylessCertificateHostname +- client.keyless_certificates.edit(keyless_certificate_id, \*, zone_id, \*\*params) -> Hostname +- client.keyless_certificates.get(keyless_certificate_id, \*, zone_id) -> Hostname # Logpush @@ -2209,16 +2192,13 @@ Methods: Types: ```python -from cloudflare.types import ( - OriginTLSClientCertificateZoneAuthenticatedOriginPull, - OriginTLSClientAuthListResponse, -) +from cloudflare.types import ZoneAuthenticatedOriginPull ``` Methods: - client.origin_tls_client_auth.create(\*, zone_id, \*\*params) -> UnnamedSchemaRef9444735ca60712dbcf8afd832eb5716a -- client.origin_tls_client_auth.list(\*, zone_id) -> SyncSinglePage[OriginTLSClientAuthListResponse] +- client.origin_tls_client_auth.list(\*, zone_id) -> SyncSinglePage[ZoneAuthenticatedOriginPull] - client.origin_tls_client_auth.delete(certificate_id, \*, zone_id, \*\*params) -> UnnamedSchemaRef9444735ca60712dbcf8afd832eb5716a - client.origin_tls_client_auth.get(certificate_id, \*, zone_id) -> UnnamedSchemaRef9444735ca60712dbcf8afd832eb5716a @@ -2228,8 +2208,8 @@ Types: ```python from cloudflare.types.origin_tls_client_auth import ( - OriginTLSClientCertificateAuthenticatedOriginPull, - OriginTLSClientCertificateID, + AuthenticatedOriginPull, + ID, HostnameUpdateResponse, ) ``` @@ -2237,7 +2217,7 @@ from cloudflare.types.origin_tls_client_auth import ( Methods: - client.origin_tls_client_auth.hostnames.update(\*, zone_id, \*\*params) -> Optional -- client.origin_tls_client_auth.hostnames.get(hostname, \*, zone_id) -> OriginTLSClientCertificateID +- client.origin_tls_client_auth.hostnames.get(hostname, \*, zone_id) -> ID ### Certificates @@ -2245,17 +2225,17 @@ Types: ```python from cloudflare.types.origin_tls_client_auth.hostnames import ( - OriginTLSClientCertificate, + Certificate, UnnamedSchemaRefD182888b36f93a765d9ce5aefa3009e9, ) ``` Methods: -- client.origin_tls_client_auth.hostnames.certificates.create(\*, zone_id, \*\*params) -> OriginTLSClientCertificate -- client.origin_tls_client_auth.hostnames.certificates.list(\*, zone_id) -> SyncSinglePage[OriginTLSClientCertificateID] -- client.origin_tls_client_auth.hostnames.certificates.delete(certificate_id, \*, zone_id, \*\*params) -> OriginTLSClientCertificate -- client.origin_tls_client_auth.hostnames.certificates.get(certificate_id, \*, zone_id) -> OriginTLSClientCertificate +- client.origin_tls_client_auth.hostnames.certificates.create(\*, zone_id, \*\*params) -> Certificate +- client.origin_tls_client_auth.hostnames.certificates.list(\*, zone_id) -> SyncSinglePage[AuthenticatedOriginPull] +- client.origin_tls_client_auth.hostnames.certificates.delete(certificate_id, \*, zone_id, \*\*params) -> Certificate +- client.origin_tls_client_auth.hostnames.certificates.get(certificate_id, \*, zone_id) -> Certificate ## Settings @@ -2276,10 +2256,9 @@ Types: ```python from cloudflare.types import ( - ActionItem, PageRule, Route, - TargesItem, + Targes, URLTarget, PageruleListResponse, PageruleDeleteResponse, @@ -2300,32 +2279,26 @@ Methods: Types: ```python -from cloudflare.types.pagerules import ZonePageruleSettings +from cloudflare.types.pagerules import SettingListResponse ``` Methods: -- client.pagerules.settings.list(\*, zone_id) -> ZonePageruleSettings +- client.pagerules.settings.list(\*, zone_id) -> SettingListResponse # RateLimits Types: ```python -from cloudflare.types import ( - Action, - MethodsItem, - RateLimit, - RateLimitListResponse, - RateLimitDeleteResponse, -) +from cloudflare.types import RateLimitListResponse, RateLimitDeleteResponse ``` Methods: - client.rate_limits.create(zone_identifier, \*\*params) -> UnnamedSchemaRef9444735ca60712dbcf8afd832eb5716a - client.rate_limits.list(zone_identifier, \*\*params) -> SyncV4PagePaginationArray[RateLimitListResponse] -- client.rate_limits.delete(id, \*, zone_identifier, \*\*params) -> Optional +- client.rate_limits.delete(id, \*, zone_identifier, \*\*params) -> RateLimitDeleteResponse - client.rate_limits.edit(id, \*, zone_identifier, \*\*params) -> UnnamedSchemaRef9444735ca60712dbcf8afd832eb5716a - client.rate_limits.get(id, \*, zone_identifier) -> UnnamedSchemaRef9444735ca60712dbcf8afd832eb5716a @@ -2502,25 +2475,30 @@ Types: from cloudflare.types.waiting_rooms import ( Event, UnnamedSchemaRef229c159575bc68a9c21f5a1615629cf6, + EventCreateResponse, + EventUpdateResponse, + EventListResponse, EventDeleteResponse, + EventEditResponse, + EventGetResponse, ) ``` Methods: -- client.waiting_rooms.events.create(waiting_room_id, \*, zone_id, \*\*params) -> Event -- client.waiting_rooms.events.update(event_id, \*, zone_id, waiting_room_id, \*\*params) -> Event -- client.waiting_rooms.events.list(waiting_room_id, \*, zone_id) -> SyncSinglePage[Event] +- client.waiting_rooms.events.create(waiting_room_id, \*, zone_id, \*\*params) -> EventCreateResponse +- client.waiting_rooms.events.update(event_id, \*, zone_id, waiting_room_id, \*\*params) -> EventUpdateResponse +- client.waiting_rooms.events.list(waiting_room_id, \*, zone_id) -> SyncSinglePage[EventListResponse] - client.waiting_rooms.events.delete(event_id, \*, zone_id, waiting_room_id, \*\*params) -> EventDeleteResponse -- client.waiting_rooms.events.edit(event_id, \*, zone_id, waiting_room_id, \*\*params) -> Event -- client.waiting_rooms.events.get(event_id, \*, zone_id, waiting_room_id) -> Event +- client.waiting_rooms.events.edit(event_id, \*, zone_id, waiting_room_id, \*\*params) -> EventEditResponse +- client.waiting_rooms.events.get(event_id, \*, zone_id, waiting_room_id) -> EventGetResponse ### Details Types: ```python -from cloudflare.types.waiting_rooms.events import Event, DetailGetResponse +from cloudflare.types.waiting_rooms.events import EventQuery, DetailGetResponse ``` Methods: @@ -2537,7 +2515,6 @@ from cloudflare.types.waiting_rooms import ( UnnamedSchemaRefF1c0ba8f44601f2db2e07b9397b6c430, RuleCreateResponse, RuleUpdateResponse, - RuleListResponse, RuleDeleteResponse, RuleEditResponse, ) @@ -2547,7 +2524,7 @@ Methods: - client.waiting_rooms.rules.create(waiting_room_id, \*, zone_id, \*\*params) -> Optional - client.waiting_rooms.rules.update(waiting_room_id, \*, zone_id, \*\*params) -> Optional -- client.waiting_rooms.rules.list(waiting_room_id, \*, zone_id) -> SyncSinglePage[RuleListResponse] +- client.waiting_rooms.rules.list(waiting_room_id, \*, zone_id) -> SyncSinglePage[Event] - client.waiting_rooms.rules.delete(rule_id, \*, zone_id, waiting_room_id, \*\*params) -> Optional - client.waiting_rooms.rules.edit(rule_id, \*, zone_id, waiting_room_id, \*\*params) -> Optional @@ -2590,7 +2567,7 @@ Types: ```python from cloudflare.types.web3 import ( - DistributedWebHostname, + Hostname, UnnamedSchemaRef2e420942fb77cd2cd2ba3ca7b5f32e1e, HostnameDeleteResponse, ) @@ -2598,11 +2575,11 @@ from cloudflare.types.web3 import ( Methods: -- client.web3.hostnames.create(zone_identifier, \*\*params) -> DistributedWebHostname -- client.web3.hostnames.list(zone_identifier) -> SyncSinglePage[DistributedWebHostname] +- client.web3.hostnames.create(zone_identifier, \*\*params) -> Hostname +- client.web3.hostnames.list(zone_identifier) -> SyncSinglePage[Hostname] - client.web3.hostnames.delete(identifier, \*, zone_identifier, \*\*params) -> Optional -- client.web3.hostnames.edit(identifier, \*, zone_identifier, \*\*params) -> DistributedWebHostname -- client.web3.hostnames.get(identifier, \*, zone_identifier) -> DistributedWebHostname +- client.web3.hostnames.edit(identifier, \*, zone_identifier, \*\*params) -> Hostname +- client.web3.hostnames.get(identifier, \*, zone_identifier) -> Hostname ### IPFSUniversalPaths @@ -2611,13 +2588,13 @@ Methods: Types: ```python -from cloudflare.types.web3.hostnames.ipfs_universal_paths import DistributedWebConfigContentList +from cloudflare.types.web3.hostnames.ipfs_universal_paths import ContentList ``` Methods: -- client.web3.hostnames.ipfs_universal_paths.content_lists.update(identifier, \*, zone_identifier, \*\*params) -> DistributedWebConfigContentList -- client.web3.hostnames.ipfs_universal_paths.content_lists.get(identifier, \*, zone_identifier) -> DistributedWebConfigContentList +- client.web3.hostnames.ipfs_universal_paths.content_lists.update(identifier, \*, zone_identifier, \*\*params) -> ContentList +- client.web3.hostnames.ipfs_universal_paths.content_lists.get(identifier, \*, zone_identifier) -> ContentList ##### Entries @@ -2625,7 +2602,7 @@ Types: ```python from cloudflare.types.web3.hostnames.ipfs_universal_paths.content_lists import ( - DistributedWebConfigContentListEntry, + ContentListItem, UnnamedSchemaRef5e618833803e286db9ee7c73727f8b86, EntryListResponse, EntryDeleteResponse, @@ -2634,11 +2611,11 @@ from cloudflare.types.web3.hostnames.ipfs_universal_paths.content_lists import ( Methods: -- client.web3.hostnames.ipfs_universal_paths.content_lists.entries.create(identifier, \*, zone_identifier, \*\*params) -> DistributedWebConfigContentListEntry -- client.web3.hostnames.ipfs_universal_paths.content_lists.entries.update(content_list_entry_identifier, \*, zone_identifier, identifier, \*\*params) -> DistributedWebConfigContentListEntry +- client.web3.hostnames.ipfs_universal_paths.content_lists.entries.create(identifier, \*, zone_identifier, \*\*params) -> ContentListItem +- client.web3.hostnames.ipfs_universal_paths.content_lists.entries.update(content_list_entry_identifier, \*, zone_identifier, identifier, \*\*params) -> ContentListItem - client.web3.hostnames.ipfs_universal_paths.content_lists.entries.list(identifier, \*, zone_identifier) -> Optional - client.web3.hostnames.ipfs_universal_paths.content_lists.entries.delete(content_list_entry_identifier, \*, zone_identifier, identifier, \*\*params) -> Optional -- client.web3.hostnames.ipfs_universal_paths.content_lists.entries.get(content_list_entry_identifier, \*, zone_identifier, identifier) -> DistributedWebConfigContentListEntry +- client.web3.hostnames.ipfs_universal_paths.content_lists.entries.get(content_list_entry_identifier, \*, zone_identifier, identifier) -> ContentListItem # Workers @@ -2678,7 +2655,7 @@ Methods: Types: ```python -from cloudflare.types.workers import Script, Setting, SettingsItem +from cloudflare.types.workers import Script, ScriptSetting ``` Methods: @@ -2693,7 +2670,7 @@ Methods: Types: ```python -from cloudflare.types.workers.scripts import WorkersBinding, BindingGetResponse +from cloudflare.types.workers.scripts import BindingGetResponse ``` Methods: @@ -2765,8 +2742,8 @@ Methods: Methods: -- client.workers.scripts.settings.edit(script_name, \*, account_id, \*\*params) -> SettingsItem -- client.workers.scripts.settings.get(script_name, \*, account_id) -> SettingsItem +- client.workers.scripts.settings.edit(script_name, \*, account_id, \*\*params) -> ScriptSetting +- client.workers.scripts.settings.get(script_name, \*, account_id) -> ScriptSetting ### Deployments @@ -2808,18 +2785,13 @@ Methods: Types: ```python -from cloudflare.types.workers.scripts.versions import ( - BindingItem, - CompatibilityFlagsItem, - SettingsItem, - TagsItem, -) +from cloudflare.types.workers.scripts.versions import CompatibilityFlags, Settings, Tags ``` Methods: -- client.workers.scripts.versions.settings.edit(script_name, \*, account_id, \*\*params) -> SettingsItem -- client.workers.scripts.versions.settings.get(script_name, \*, account_id) -> SettingsItem +- client.workers.scripts.versions.settings.edit(script_name, \*, account_id, \*\*params) -> Settings +- client.workers.scripts.versions.settings.get(script_name, \*, account_id) -> Settings ## Filters @@ -2896,15 +2868,15 @@ Methods: Types: ```python -from cloudflare.types.workers import WorkersDomain +from cloudflare.types.workers import Domain ``` Methods: -- client.workers.domains.update(\*, account_id, \*\*params) -> WorkersDomain -- client.workers.domains.list(\*, account_id, \*\*params) -> SyncSinglePage[WorkersDomain] +- client.workers.domains.update(\*, account_id, \*\*params) -> Domain +- client.workers.domains.list(\*, account_id, \*\*params) -> SyncSinglePage[Domain] - client.workers.domains.delete(domain_id, \*, account_id, \*\*params) -> None -- client.workers.domains.get(domain_id, \*, account_id) -> WorkersDomain +- client.workers.domains.get(domain_id, \*, account_id) -> Domain ## Subdomains @@ -2934,8 +2906,8 @@ Methods: Methods: -- client.workers.services.environments.settings.edit(environment_name, \*, account_id, service_name, \*\*params) -> SettingsItem -- client.workers.services.environments.settings.get(environment_name, \*, account_id, service_name) -> SettingsItem +- client.workers.services.environments.settings.edit(environment_name, \*, account_id, service_name, \*\*params) -> ScriptSetting +- client.workers.services.environments.settings.get(environment_name, \*, account_id, service_name) -> ScriptSetting # KV @@ -2944,14 +2916,14 @@ Methods: Types: ```python -from cloudflare.types.kv import WorkersKVNamespace +from cloudflare.types.kv import Namespace ``` Methods: -- client.kv.namespaces.create(\*, account_id, \*\*params) -> WorkersKVNamespace +- client.kv.namespaces.create(\*, account_id, \*\*params) -> Namespace - client.kv.namespaces.update(namespace_id, \*, account_id, \*\*params) -> UnnamedSchemaRef8d6a37a1e4190f86652802244d29525f -- client.kv.namespaces.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[WorkersKVNamespace] +- client.kv.namespaces.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[Namespace] - client.kv.namespaces.delete(namespace_id, \*, account_id, \*\*params) -> UnnamedSchemaRef8d6a37a1e4190f86652802244d29525f ### Bulk @@ -2966,12 +2938,12 @@ Methods: Types: ```python -from cloudflare.types.kv.namespaces import WorkersKVKey +from cloudflare.types.kv.namespaces import Key ``` Methods: -- client.kv.namespaces.keys.list(namespace_id, \*, account_id, \*\*params) -> SyncCursorLimitPagination[WorkersKVKey] +- client.kv.namespaces.keys.list(namespace_id, \*, account_id, \*\*params) -> SyncCursorLimitPagination[Key] ### Metadata @@ -3006,12 +2978,12 @@ Methods: Types: ```python -from cloudflare.types.durable_objects import DurableObjectNamespace +from cloudflare.types.durable_objects import Namespace ``` Methods: -- client.durable_objects.namespaces.list(\*, account_id) -> SyncSinglePage[DurableObjectNamespace] +- client.durable_objects.namespaces.list(\*, account_id) -> SyncSinglePage[Namespace] ### Objects @@ -3088,12 +3060,7 @@ Methods: Types: ```python -from cloudflare.types import ( - RequestListItem, - RequestModel, - ManagedHeaderListResponse, - ManagedHeaderEditResponse, -) +from cloudflare.types import RequestModel, ManagedHeaderListResponse, ManagedHeaderEditResponse ``` Methods: @@ -3106,54 +3073,54 @@ Methods: Types: ```python -from cloudflare.types import PageShieldSetting, PageShieldUpdateResponse +from cloudflare.types import Setting, PageShieldUpdateResponse ``` Methods: - client.page_shield.update(\*, zone_id, \*\*params) -> PageShieldUpdateResponse -- client.page_shield.get(\*, zone_id) -> PageShieldSetting +- client.page_shield.get(\*, zone_id) -> Setting ## Policies Types: ```python -from cloudflare.types.page_shield import PageShieldPolicy +from cloudflare.types.page_shield import Policy ``` Methods: -- client.page_shield.policies.create(\*, zone_id, \*\*params) -> PageShieldPolicy -- client.page_shield.policies.update(policy_id, \*, zone_id, \*\*params) -> PageShieldPolicy -- client.page_shield.policies.list(\*, zone_id) -> SyncSinglePage[PageShieldPolicy] +- client.page_shield.policies.create(\*, zone_id, \*\*params) -> Policy +- client.page_shield.policies.update(policy_id, \*, zone_id, \*\*params) -> Policy +- client.page_shield.policies.list(\*, zone_id) -> SyncSinglePage[Policy] - client.page_shield.policies.delete(policy_id, \*, zone_id) -> None -- client.page_shield.policies.get(policy_id, \*, zone_id) -> PageShieldPolicy +- client.page_shield.policies.get(policy_id, \*, zone_id) -> Policy ## Connections Types: ```python -from cloudflare.types.page_shield import PageShieldConnection +from cloudflare.types.page_shield import Connection ``` Methods: -- client.page_shield.connections.list(\*, zone_id, \*\*params) -> SyncSinglePage[PageShieldConnection] -- client.page_shield.connections.get(connection_id, \*, zone_id) -> PageShieldConnection +- client.page_shield.connections.list(\*, zone_id, \*\*params) -> SyncSinglePage[Connection] +- client.page_shield.connections.get(connection_id, \*, zone_id) -> Connection ## Scripts Types: ```python -from cloudflare.types.page_shield import PageShieldScript, ScriptGetResponse +from cloudflare.types.page_shield import Script, ScriptGetResponse ``` Methods: -- client.page_shield.scripts.list(\*, zone_id, \*\*params) -> SyncSinglePage[PageShieldScript] +- client.page_shield.scripts.list(\*, zone_id, \*\*params) -> SyncSinglePage[Script] - client.page_shield.scripts.get(script_id, \*, zone_id) -> ScriptGetResponse # Rulesets @@ -3345,19 +3312,15 @@ Methods: Types: ```python -from cloudflare.types.addressing import ( - AddressingAddressMaps, - AddressMapCreateResponse, - AddressMapGetResponse, -) +from cloudflare.types.addressing import AddressMap, AddressMapCreateResponse, AddressMapGetResponse ``` Methods: - client.addressing.address_maps.create(\*, account_id, \*\*params) -> AddressMapCreateResponse -- client.addressing.address_maps.list(\*, account_id) -> SyncSinglePage[AddressingAddressMaps] +- client.addressing.address_maps.list(\*, account_id) -> SyncSinglePage[AddressMap] - client.addressing.address_maps.delete(address_map_id, \*, account_id, \*\*params) -> Optional -- client.addressing.address_maps.edit(address_map_id, \*, account_id, \*\*params) -> AddressingAddressMaps +- client.addressing.address_maps.edit(address_map_id, \*, account_id, \*\*params) -> AddressMap - client.addressing.address_maps.get(address_map_id, \*, account_id) -> AddressMapGetResponse ### Accounts @@ -3410,19 +3373,16 @@ Methods: Types: ```python -from cloudflare.types.addressing import ( - AddressingIpamPrefixes, - UnnamedSchemaRefE358666e049bf8f9281c0a4f89b5fe46, -) +from cloudflare.types.addressing import Prefix, UnnamedSchemaRefE358666e049bf8f9281c0a4f89b5fe46 ``` Methods: -- client.addressing.prefixes.create(\*, account_id, \*\*params) -> AddressingIpamPrefixes -- client.addressing.prefixes.list(\*, account_id) -> SyncSinglePage[AddressingIpamPrefixes] +- client.addressing.prefixes.create(\*, account_id, \*\*params) -> Prefix +- client.addressing.prefixes.list(\*, account_id) -> SyncSinglePage[Prefix] - client.addressing.prefixes.delete(prefix_id, \*, account_id, \*\*params) -> Optional -- client.addressing.prefixes.edit(prefix_id, \*, account_id, \*\*params) -> AddressingIpamPrefixes -- client.addressing.prefixes.get(prefix_id, \*, account_id) -> AddressingIpamPrefixes +- client.addressing.prefixes.edit(prefix_id, \*, account_id, \*\*params) -> Prefix +- client.addressing.prefixes.get(prefix_id, \*, account_id) -> Prefix ### BGP @@ -3431,29 +3391,29 @@ Methods: Types: ```python -from cloudflare.types.addressing.prefixes.bgp import AddressingServiceBinding +from cloudflare.types.addressing.prefixes.bgp import ServiceBinding ``` Methods: -- client.addressing.prefixes.bgp.bindings.create(prefix_id, \*, account_id, \*\*params) -> AddressingServiceBinding -- client.addressing.prefixes.bgp.bindings.list(prefix_id, \*, account_id) -> SyncSinglePage[AddressingServiceBinding] +- client.addressing.prefixes.bgp.bindings.create(prefix_id, \*, account_id, \*\*params) -> ServiceBinding +- client.addressing.prefixes.bgp.bindings.list(prefix_id, \*, account_id) -> SyncSinglePage[ServiceBinding] - client.addressing.prefixes.bgp.bindings.delete(binding_id, \*, account_id, prefix_id) -> UnnamedSchemaRefEc4d85c3d1bcc6b3b7e99c199ae99846 -- client.addressing.prefixes.bgp.bindings.get(binding_id, \*, account_id, prefix_id) -> AddressingServiceBinding +- client.addressing.prefixes.bgp.bindings.get(binding_id, \*, account_id, prefix_id) -> ServiceBinding #### Prefixes Types: ```python -from cloudflare.types.addressing.prefixes.bgp import AddressingIpamBGPPrefixes +from cloudflare.types.addressing.prefixes.bgp import BGPPrefix ``` Methods: -- client.addressing.prefixes.bgp.prefixes.list(prefix_id, \*, account_id) -> SyncSinglePage[AddressingIpamBGPPrefixes] -- client.addressing.prefixes.bgp.prefixes.edit(bgp_prefix_id, \*, account_id, prefix_id, \*\*params) -> AddressingIpamBGPPrefixes -- client.addressing.prefixes.bgp.prefixes.get(bgp_prefix_id, \*, account_id, prefix_id) -> AddressingIpamBGPPrefixes +- client.addressing.prefixes.bgp.prefixes.list(prefix_id, \*, account_id) -> SyncSinglePage[BGPPrefix] +- client.addressing.prefixes.bgp.prefixes.edit(bgp_prefix_id, \*, account_id, prefix_id, \*\*params) -> BGPPrefix +- client.addressing.prefixes.bgp.prefixes.get(bgp_prefix_id, \*, account_id, prefix_id) -> BGPPrefix #### Statuses @@ -3473,13 +3433,13 @@ Methods: Types: ```python -from cloudflare.types.addressing.prefixes import AddressingIpamDelegations, DelegationDeleteResponse +from cloudflare.types.addressing.prefixes import Delegations, DelegationDeleteResponse ``` Methods: -- client.addressing.prefixes.delegations.create(prefix_id, \*, account_id, \*\*params) -> AddressingIpamDelegations -- client.addressing.prefixes.delegations.list(prefix_id, \*, account_id) -> SyncSinglePage[AddressingIpamDelegations] +- client.addressing.prefixes.delegations.create(prefix_id, \*, account_id, \*\*params) -> Delegations +- client.addressing.prefixes.delegations.list(prefix_id, \*, account_id) -> SyncSinglePage[Delegations] - client.addressing.prefixes.delegations.delete(delegation_id, \*, account_id, prefix_id, \*\*params) -> DelegationDeleteResponse # AuditLogs @@ -3508,8 +3468,8 @@ Types: ```python from cloudflare.types import ( - IntelPhishingURLInfo, - IntelPhishingURLSubmit, + Info, + Submit, UnnamedSchemaRef209db30ed499548152d6f3bccf720b54, UnnamedSchemaRef39419d70e2399b28b15cd660afd342fb, UnnamedSchemaRef3e10ea08deb8102a27500f986488c1e8, @@ -3522,8 +3482,8 @@ from cloudflare.types import ( Methods: -- client.brand_protection.submit(\*, account_id, \*\*params) -> IntelPhishingURLSubmit -- client.brand_protection.url_info(\*, account_id, \*\*params) -> IntelPhishingURLInfo +- client.brand_protection.submit(\*, account_id, \*\*params) -> Submit +- client.brand_protection.url_info(\*, account_id, \*\*params) -> Info # Diagnostics @@ -3532,7 +3492,7 @@ Methods: Types: ```python -from cloudflare.types.diagnostics import MagicTransitTargetResult, TracerouteCreateResponse +from cloudflare.types.diagnostics import Traceroute, TracerouteCreateResponse ``` Methods: @@ -3566,29 +3526,26 @@ Methods: Types: ```python -from cloudflare.types.images.v1 import ( - ImagesImageKeys, - UnnamedSchemaRef918e794287a67b5e85126e00cf2d9a95, -) +from cloudflare.types.images.v1 import Key, UnnamedSchemaRef918e794287a67b5e85126e00cf2d9a95 ``` Methods: -- client.images.v1.keys.update(signing_key_name, \*, account_id) -> ImagesImageKeys -- client.images.v1.keys.list(\*, account_id) -> ImagesImageKeys -- client.images.v1.keys.delete(signing_key_name, \*, account_id) -> ImagesImageKeys +- client.images.v1.keys.update(signing_key_name, \*, account_id) -> Key +- client.images.v1.keys.list(\*, account_id) -> Key +- client.images.v1.keys.delete(signing_key_name, \*, account_id) -> Key ### Stats Types: ```python -from cloudflare.types.images.v1 import ImagesImagesStats +from cloudflare.types.images.v1 import Stat ``` Methods: -- client.images.v1.stats.get(\*, account_id) -> ImagesImagesStats +- client.images.v1.stats.get(\*, account_id) -> Stat ### Variants @@ -3597,18 +3554,20 @@ Types: ```python from cloudflare.types.images.v1 import ( UnnamedSchemaRefD02195de7dadf27801875f36cddfa3a3, - V1ImageVariant, - V1ImageVariants, + Variant, + VariantCreateResponse, + VariantEditResponse, + VariantGetResponse, ) ``` Methods: -- client.images.v1.variants.create(\*, account_id, \*\*params) -> V1ImageVariant -- client.images.v1.variants.list(\*, account_id) -> V1ImageVariants +- client.images.v1.variants.create(\*, account_id, \*\*params) -> VariantCreateResponse +- client.images.v1.variants.list(\*, account_id) -> Variant - client.images.v1.variants.delete(variant_id, \*, account_id, \*\*params) -> UnnamedSchemaRef9444735ca60712dbcf8afd832eb5716a -- client.images.v1.variants.edit(variant_id, \*, account_id, \*\*params) -> V1ImageVariant -- client.images.v1.variants.get(variant_id, \*, account_id) -> V1ImageVariant +- client.images.v1.variants.edit(variant_id, \*, account_id, \*\*params) -> VariantEditResponse +- client.images.v1.variants.get(variant_id, \*, account_id) -> VariantGetResponse ### Blobs @@ -3642,17 +3601,17 @@ Methods: # Intel -## ASN +## ASNResource Types: ```python -from cloudflare.types.intel import IntelASN +from cloudflare.types.intel import ASN ``` Methods: -- client.intel.asn.get(asn, \*, account_id) -> IntelASN +- client.intel.asn.get(asn, \*, account_id) -> ASN ### Subnets @@ -3671,27 +3630,24 @@ Methods: Types: ```python -from cloudflare.types.intel import ( - IntelPassiveDNSByIP, - UnnamedSchemaRefB5e16cee4f32382c294201aedb9fc050, -) +from cloudflare.types.intel import DNS, UnnamedSchemaRefB5e16cee4f32382c294201aedb9fc050 ``` Methods: -- client.intel.dns.get(\*, account_id, \*\*params) -> IntelPassiveDNSByIP +- client.intel.dns.get(\*, account_id, \*\*params) -> DNS ## Domains Types: ```python -from cloudflare.types.intel import IntelDomain +from cloudflare.types.intel import Domain ``` Methods: -- client.intel.domains.get(\*, account_id, \*\*params) -> IntelDomain +- client.intel.domains.get(\*, account_id, \*\*params) -> Domain ### Bulks @@ -3705,12 +3661,12 @@ Methods: - client.intel.domains.bulks.get(\*, account_id, \*\*params) -> Optional -## DomainHistory +## DomainHistoryResource Types: ```python -from cloudflare.types.intel import IntelDomainHistory, DomainHistoryGetResponse +from cloudflare.types.intel import DomainHistory, DomainHistoryGetResponse ``` Methods: @@ -3722,7 +3678,7 @@ Methods: Types: ```python -from cloudflare.types.intel import IntelSchemasIP, IPGetResponse +from cloudflare.types.intel import IP, IPGetResponse ``` Methods: @@ -3734,7 +3690,7 @@ Methods: Types: ```python -from cloudflare.types.intel import IntelIPList, IPListGetResponse +from cloudflare.types.intel import IPList, IPListGetResponse ``` Methods: @@ -3752,12 +3708,12 @@ Methods: Types: ```python -from cloudflare.types.intel import IntelWhois +from cloudflare.types.intel import Whois ``` Methods: -- client.intel.whois.get(\*, account_id, \*\*params) -> IntelWhois +- client.intel.whois.get(\*, account_id, \*\*params) -> Whois ## IndicatorFeeds @@ -3804,12 +3760,12 @@ Methods: Types: ```python -from cloudflare.types.intel import IntelSinkholeItem +from cloudflare.types.intel import SinkholeItem ``` Methods: -- client.intel.sinkholes.list(\*, account_id) -> SyncSinglePage[IntelSinkholeItem] +- client.intel.sinkholes.list(\*, account_id) -> SyncSinglePage[SinkholeItem] ## AttackSurfaceReport @@ -3831,6 +3787,11 @@ Types: ```python from cloudflare.types.intel.attack_surface_report import ( + IssueClass, + IssueType, + Product, + SeverityQueryParam, + Subject, IssueListResponse, IssueClassResponse, IssueSeverityResponse, @@ -3929,8 +3890,8 @@ Types: ```python from cloudflare.types.magic_transit import ( - ColoNamesItem, - ColoRegionsItem, + ColoName, + ColoRegion, Scope, RouteCreateResponse, RouteUpdateResponse, @@ -4009,9 +3970,9 @@ from cloudflare.types.magic_transit.sites import ( DHCPRelay, DHCPServer, LAN, + LANStaticAddressing, Nat, RoutedSubnet, - StaticAddressing, LANCreateResponse, LANUpdateResponse, LANListResponse, @@ -4034,8 +3995,8 @@ Types: ```python from cloudflare.types.magic_transit.sites import ( - StaticAddressing, WAN, + WANStaticAddressing, WANCreateResponse, WANUpdateResponse, WANListResponse, @@ -4060,24 +4021,24 @@ Types: ```python from cloudflare.types.magic_network_monitoring import ( - MagicNetworkMonitoringConfig, + Configuration, UnnamedSchemaRef621ca3f6ea9a96427c902b0d14279ff8, ) ``` Methods: -- client.magic_network_monitoring.configs.create(\*, account_id, \*\*params) -> MagicNetworkMonitoringConfig -- client.magic_network_monitoring.configs.update(\*, account_id, \*\*params) -> MagicNetworkMonitoringConfig -- client.magic_network_monitoring.configs.delete(\*, account_id, \*\*params) -> MagicNetworkMonitoringConfig -- client.magic_network_monitoring.configs.edit(\*, account_id, \*\*params) -> MagicNetworkMonitoringConfig -- client.magic_network_monitoring.configs.get(\*, account_id) -> MagicNetworkMonitoringConfig +- client.magic_network_monitoring.configs.create(\*, account_id, \*\*params) -> Configuration +- client.magic_network_monitoring.configs.update(\*, account_id, \*\*params) -> Configuration +- client.magic_network_monitoring.configs.delete(\*, account_id, \*\*params) -> Configuration +- client.magic_network_monitoring.configs.edit(\*, account_id, \*\*params) -> Configuration +- client.magic_network_monitoring.configs.get(\*, account_id) -> Configuration ### Full Methods: -- client.magic_network_monitoring.configs.full.get(\*, account_id) -> MagicNetworkMonitoringConfig +- client.magic_network_monitoring.configs.full.get(\*, account_id) -> Configuration ## Rules @@ -4104,24 +4065,24 @@ Methods: Types: ```python -from cloudflare.types.magic_network_monitoring.rules import MagicNetworkMonitoringRuleAdvertisable +from cloudflare.types.magic_network_monitoring.rules import Advertisement ``` Methods: -- client.magic_network_monitoring.rules.advertisements.edit(rule_id, \*, account_id, \*\*params) -> Optional +- client.magic_network_monitoring.rules.advertisements.edit(rule_id, \*, account_id, \*\*params) -> Optional # MTLSCertificates Types: ```python -from cloudflare.types import MTLSCertificate, MTLSCertificateUpdate +from cloudflare.types import MTLSCertificate, MTLSCertificateCreateResponse ``` Methods: -- client.mtls_certificates.create(\*, account_id, \*\*params) -> MTLSCertificateUpdate +- client.mtls_certificates.create(\*, account_id, \*\*params) -> MTLSCertificateCreateResponse - client.mtls_certificates.list(\*, account_id) -> SyncSinglePage[MTLSCertificate] - client.mtls_certificates.delete(mtls_certificate_id, \*, account_id, \*\*params) -> MTLSCertificate - client.mtls_certificates.get(mtls_certificate_id, \*, account_id) -> MTLSCertificate @@ -4131,7 +4092,7 @@ Methods: Types: ```python -from cloudflare.types.mtls_certificates import MTLSCertificateAsssociation, AssociationGetResponse +from cloudflare.types.mtls_certificates import CertificateAsssociation, AssociationGetResponse ``` Methods: @@ -4218,20 +4179,20 @@ Methods: - client.pcaps.list(\*, account_id) -> SyncSinglePage[PCAPListResponse] - client.pcaps.get(pcap_id, \*, account_id) -> PCAPGetResponse -## Ownership +## OwnershipResource Types: ```python -from cloudflare.types.pcaps import MagicVisibilityPCAPsOwnership, OwnershipGetResponse +from cloudflare.types.pcaps import Ownership, OwnershipGetResponse ``` Methods: -- client.pcaps.ownership.create(\*, account_id, \*\*params) -> MagicVisibilityPCAPsOwnership +- client.pcaps.ownership.create(\*, account_id, \*\*params) -> Ownership - client.pcaps.ownership.delete(ownership_id, \*, account_id) -> None - client.pcaps.ownership.get(\*, account_id) -> Optional -- client.pcaps.ownership.validate(\*, account_id, \*\*params) -> MagicVisibilityPCAPsOwnership +- client.pcaps.ownership.validate(\*, account_id, \*\*params) -> Ownership ## Download @@ -4246,13 +4207,13 @@ Methods: Types: ```python -from cloudflare.types.registrar import Domain, DomainListResponse +from cloudflare.types.registrar import Domain ``` Methods: - client.registrar.domains.update(domain_name, \*, account_id, \*\*params) -> Optional -- client.registrar.domains.list(\*, account_id) -> SyncSinglePage[DomainListResponse] +- client.registrar.domains.list(\*, account_id) -> SyncSinglePage[Domain] - client.registrar.domains.get(domain_name, \*, account_id) -> Optional # RequestTracers @@ -4278,7 +4239,7 @@ Types: ```python from cloudflare.types.rules import ( Hostname, - ListsList, + List, Redirect, UnnamedSchemaRefE706d5e8367564544e2991af82ebb07a, ListDeleteResponse, @@ -4287,11 +4248,11 @@ from cloudflare.types.rules import ( Methods: -- client.rules.lists.create(\*, account_id, \*\*params) -> Optional -- client.rules.lists.update(list_id, \*, account_id, \*\*params) -> Optional -- client.rules.lists.list(\*, account_id) -> SyncSinglePage[ListsList] +- client.rules.lists.create(\*, account_id, \*\*params) -> Optional +- client.rules.lists.update(list_id, \*, account_id, \*\*params) -> Optional +- client.rules.lists.list(\*, account_id) -> SyncSinglePage[List] - client.rules.lists.delete(list_id, \*, account_id, \*\*params) -> Optional -- client.rules.lists.get(list_id, \*, account_id) -> Optional +- client.rules.lists.get(list_id, \*, account_id) -> Optional ### BulkOperations @@ -4340,45 +4301,45 @@ Types: ```python from cloudflare.types.storage import ( + Components, + Schema, UnnamedSchemaRef608bee5065f7314d6fa572b89a1910f7, - WorkersKVComponentsSchemasResult, - WorkersKVSchemasResult, ) ``` Methods: -- client.storage.analytics.list(\*, account_id, \*\*params) -> WorkersKVSchemasResult -- client.storage.analytics.stored(\*, account_id, \*\*params) -> WorkersKVComponentsSchemasResult +- client.storage.analytics.list(\*, account_id, \*\*params) -> Schema +- client.storage.analytics.stored(\*, account_id, \*\*params) -> Components # Stream Types: ```python -from cloudflare.types import AllowedOriginsItem, StreamVideos +from cloudflare.types import AllowedOriginsItem, Video ``` Methods: - client.stream.create(\*, account_id, \*\*params) -> None -- client.stream.list(\*, account_id, \*\*params) -> SyncSinglePage[StreamVideos] +- client.stream.list(\*, account_id, \*\*params) -> SyncSinglePage[Video] - client.stream.delete(identifier, \*, account_id, \*\*params) -> None -- client.stream.get(identifier, \*, account_id) -> StreamVideos +- client.stream.get(identifier, \*, account_id) -> Video ## AudioTracks Types: ```python -from cloudflare.types.stream import StreamAudio, AudioTrackGetResponse +from cloudflare.types.stream import Audio, AudioTrackGetResponse ``` Methods: - client.stream.audio_tracks.delete(audio_identifier, \*, account_id, identifier) -> UnnamedSchemaRef602dd5f63eab958d53da61434dec08f0 -- client.stream.audio_tracks.copy(identifier, \*, account_id, \*\*params) -> StreamAudio -- client.stream.audio_tracks.edit(audio_identifier, \*, account_id, identifier, \*\*params) -> StreamAudio +- client.stream.audio_tracks.copy(identifier, \*, account_id, \*\*params) -> Audio +- client.stream.audio_tracks.edit(audio_identifier, \*, account_id, identifier, \*\*params) -> Audio - client.stream.audio_tracks.get(identifier, \*, account_id) -> AudioTrackGetResponse ## Videos @@ -4393,23 +4354,23 @@ Methods: - client.stream.videos.storage_usage(\*, account_id, \*\*params) -> VideoStorageUsageResponse -## Clip +## ClipResource Types: ```python -from cloudflare.types.stream import StreamClipping +from cloudflare.types.stream import Clip ``` Methods: -- client.stream.clip.create(\*, account_id, \*\*params) -> StreamClipping +- client.stream.clip.create(\*, account_id, \*\*params) -> Clip ## Copy Methods: -- client.stream.copy.create(\*, account_id, \*\*params) -> StreamVideos +- client.stream.copy.create(\*, account_id, \*\*params) -> Video ## DirectUpload @@ -4428,12 +4389,12 @@ Methods: Types: ```python -from cloudflare.types.stream import StreamKeys, KeyGetResponse +from cloudflare.types.stream import Keys, KeyGetResponse ``` Methods: -- client.stream.keys.create(\*, account_id, \*\*params) -> StreamKeys +- client.stream.keys.create(\*, account_id, \*\*params) -> Keys - client.stream.keys.delete(identifier, \*, account_id, \*\*params) -> UnnamedSchemaRef602dd5f63eab958d53da61434dec08f0 - client.stream.keys.get(\*, account_id) -> KeyGetResponse @@ -4442,30 +4403,30 @@ Methods: Types: ```python -from cloudflare.types.stream import StreamLiveInput, LiveInputListResponse +from cloudflare.types.stream import LiveInput, LiveInputListResponse ``` Methods: -- client.stream.live_inputs.create(\*, account_id, \*\*params) -> StreamLiveInput -- client.stream.live_inputs.update(live_input_identifier, \*, account_id, \*\*params) -> StreamLiveInput +- client.stream.live_inputs.create(\*, account_id, \*\*params) -> LiveInput +- client.stream.live_inputs.update(live_input_identifier, \*, account_id, \*\*params) -> LiveInput - client.stream.live_inputs.list(\*, account_id, \*\*params) -> LiveInputListResponse - client.stream.live_inputs.delete(live_input_identifier, \*, account_id, \*\*params) -> None -- client.stream.live_inputs.get(live_input_identifier, \*, account_id) -> StreamLiveInput +- client.stream.live_inputs.get(live_input_identifier, \*, account_id) -> LiveInput ### Outputs Types: ```python -from cloudflare.types.stream.live_inputs import StreamOutput +from cloudflare.types.stream.live_inputs import Output ``` Methods: -- client.stream.live_inputs.outputs.create(live_input_identifier, \*, account_id, \*\*params) -> StreamOutput -- client.stream.live_inputs.outputs.update(output_identifier, \*, account_id, live_input_identifier, \*\*params) -> StreamOutput -- client.stream.live_inputs.outputs.list(live_input_identifier, \*, account_id) -> SyncSinglePage[StreamOutput] +- client.stream.live_inputs.outputs.create(live_input_identifier, \*, account_id, \*\*params) -> Output +- client.stream.live_inputs.outputs.update(output_identifier, \*, account_id, live_input_identifier, \*\*params) -> Output +- client.stream.live_inputs.outputs.list(live_input_identifier, \*, account_id) -> SyncSinglePage[Output] - client.stream.live_inputs.outputs.delete(output_identifier, \*, account_id, live_input_identifier, \*\*params) -> None ## Watermarks @@ -4473,13 +4434,13 @@ Methods: Types: ```python -from cloudflare.types.stream import StreamWatermarks +from cloudflare.types.stream import Watermaks ``` Methods: - client.stream.watermarks.create(\*, account_id, \*\*params) -> UnnamedSchemaRef9444735ca60712dbcf8afd832eb5716a -- client.stream.watermarks.list(\*, account_id) -> SyncSinglePage[StreamWatermarks] +- client.stream.watermarks.list(\*, account_id) -> SyncSinglePage[Watermaks] - client.stream.watermarks.delete(identifier, \*, account_id, \*\*params) -> UnnamedSchemaRef602dd5f63eab958d53da61434dec08f0 - client.stream.watermarks.get(identifier, \*, account_id) -> UnnamedSchemaRef9444735ca60712dbcf8afd832eb5716a @@ -4496,7 +4457,7 @@ Methods: Types: ```python -from cloudflare.types.stream import StreamCaptions, CaptionDeleteResponse, CaptionGetResponse +from cloudflare.types.stream import Caption, CaptionDeleteResponse, CaptionGetResponse ``` Methods: @@ -4597,7 +4558,7 @@ Types: ```python from cloudflare.types.alerting.destinations import ( - AlertingWebhooks, + Webhooks, WebhookCreateResponse, WebhookUpdateResponse, ) @@ -4607,21 +4568,21 @@ Methods: - client.alerting.destinations.webhooks.create(\*, account_id, \*\*params) -> WebhookCreateResponse - client.alerting.destinations.webhooks.update(webhook_id, \*, account_id, \*\*params) -> WebhookUpdateResponse -- client.alerting.destinations.webhooks.list(\*, account_id) -> SyncSinglePage[AlertingWebhooks] +- client.alerting.destinations.webhooks.list(\*, account_id) -> SyncSinglePage[Webhooks] - client.alerting.destinations.webhooks.delete(webhook_id, \*, account_id) -> Optional -- client.alerting.destinations.webhooks.get(webhook_id, \*, account_id) -> AlertingWebhooks +- client.alerting.destinations.webhooks.get(webhook_id, \*, account_id) -> Webhooks -## History +## HistoryResource Types: ```python -from cloudflare.types.alerting import AlertingHistory +from cloudflare.types.alerting import History ``` Methods: -- client.alerting.history.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[AlertingHistory] +- client.alerting.history.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[History] ## Policies @@ -4629,9 +4590,9 @@ Types: ```python from cloudflare.types.alerting import ( - Filters, - Mechanisms, - Policies, + Filter, + Mechanism, + Policy, PolicyCreateResponse, PolicyUpdateResponse, ) @@ -4641,11 +4602,17 @@ Methods: - client.alerting.policies.create(\*, account_id, \*\*params) -> PolicyCreateResponse - client.alerting.policies.update(policy_id, \*, account_id, \*\*params) -> PolicyUpdateResponse -- client.alerting.policies.list(\*, account_id) -> SyncSinglePage[Policies] +- client.alerting.policies.list(\*, account_id) -> SyncSinglePage[Policy] - client.alerting.policies.delete(policy_id, \*, account_id) -> Optional -- client.alerting.policies.get(policy_id, \*, account_id) -> Policies +- client.alerting.policies.get(policy_id, \*, account_id) -> Policy -# D1 +# D1Resource + +Types: + +```python +from cloudflare.types import D1 +``` ## Database @@ -4653,19 +4620,19 @@ Types: ```python from cloudflare.types.d1 import ( - D1CreateDatabase, - D1DatabaseDetails, - D1QueryResult, + QueryResult, + DatabaseCreateResponse, + DatabaseListResponse, DatabaseQueryResponse, ) ``` Methods: -- client.d1.database.create(\*, account_id, \*\*params) -> D1CreateDatabase -- client.d1.database.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[D1CreateDatabase] +- client.d1.database.create(\*, account_id, \*\*params) -> DatabaseCreateResponse +- client.d1.database.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[DatabaseListResponse] - client.d1.database.delete(database_identifier, \*, account_identifier) -> UnnamedSchemaRef9444735ca60712dbcf8afd832eb5716a -- client.d1.database.get(database_identifier, \*, account_identifier) -> D1DatabaseDetails +- client.d1.database.get(database_identifier, \*, account_identifier) -> D1 - client.d1.database.query(database_identifier, \*, account_identifier, \*\*params) -> DatabaseQueryResponse # R2 @@ -4675,23 +4642,23 @@ Methods: Types: ```python -from cloudflare.types.r2 import R2Bucket, BucketDeleteResponse +from cloudflare.types.r2 import Bucket, BucketDeleteResponse ``` Methods: -- client.r2.buckets.create(\*, account_id, \*\*params) -> R2Bucket -- client.r2.buckets.list(\*, account_id, \*\*params) -> SyncCursorPagination[R2Bucket] +- client.r2.buckets.create(\*, account_id, \*\*params) -> Bucket +- client.r2.buckets.list(\*, account_id, \*\*params) -> SyncCursorPagination[Bucket] - client.r2.buckets.delete(bucket_name, \*, account_id) -> object -- client.r2.buckets.get(bucket_name, \*, account_id) -> R2Bucket +- client.r2.buckets.get(bucket_name, \*, account_id) -> Bucket -## Sippy +## SippyResource Types: ```python from cloudflare.types.r2 import ( - R2Sippy, + Sippy, UnnamedSchemaRef6430970563db310f19d39aafe3debd27, SippyDeleteResponse, ) @@ -4699,9 +4666,9 @@ from cloudflare.types.r2 import ( Methods: -- client.r2.sippy.update(bucket_name, \*, account_id, \*\*params) -> R2Sippy +- client.r2.sippy.update(bucket_name, \*, account_id, \*\*params) -> Sippy - client.r2.sippy.delete(bucket_name, \*, account_id) -> SippyDeleteResponse -- client.r2.sippy.get(bucket_name, \*, account_id) -> R2Sippy +- client.r2.sippy.get(bucket_name, \*, account_id) -> Sippy # WARPConnector @@ -4749,16 +4716,14 @@ Methods: Types: ```python -from cloudflare.types.workers_for_platforms.dispatch.namespaces import ( - WorkersForPlatformsNamespaceScript, -) +from cloudflare.types.workers_for_platforms.dispatch.namespaces import Script ``` Methods: - client.workers_for_platforms.dispatch.namespaces.scripts.update(script_name, \*, account_id, dispatch_namespace, \*\*params) -> Script - client.workers_for_platforms.dispatch.namespaces.scripts.delete(script_name, \*, account_id, dispatch_namespace, \*\*params) -> None -- client.workers_for_platforms.dispatch.namespaces.scripts.get(script_name, \*, account_id, dispatch_namespace) -> WorkersForPlatformsNamespaceScript +- client.workers_for_platforms.dispatch.namespaces.scripts.get(script_name, \*, account_id, dispatch_namespace) -> Script ##### Content @@ -4771,8 +4736,8 @@ Methods: Methods: -- client.workers_for_platforms.dispatch.namespaces.scripts.settings.edit(script_name, \*, account_id, dispatch_namespace, \*\*params) -> SettingsItem -- client.workers_for_platforms.dispatch.namespaces.scripts.settings.get(script_name, \*, account_id, dispatch_namespace) -> SettingsItem +- client.workers_for_platforms.dispatch.namespaces.scripts.settings.edit(script_name, \*, account_id, dispatch_namespace, \*\*params) -> ScriptSetting +- client.workers_for_platforms.dispatch.namespaces.scripts.settings.get(script_name, \*, account_id, dispatch_namespace) -> ScriptSetting ##### Bindings @@ -4787,12 +4752,12 @@ Methods: Types: ```python -from cloudflare.types.zero_trust import ZeroTrustDevices +from cloudflare.types.zero_trust import Device ``` Methods: -- client.zero_trust.devices.list(\*, account_id) -> SyncSinglePage[ZeroTrustDevices] +- client.zero_trust.devices.list(\*, account_id) -> SyncSinglePage[Device] - client.zero_trust.devices.get(device_id, \*, account_id) -> UnnamedSchemaRef9444735ca60712dbcf8afd832eb5716a ### DEXTests @@ -4822,7 +4787,7 @@ Types: ```python from cloudflare.types.zero_trust.devices import ( - DeviceManagedNetworks, + Network, UnnamedSchemaRefD2b048663faf5e0cd5c90501b71171de, NetworkDeleteResponse, ) @@ -4830,11 +4795,11 @@ from cloudflare.types.zero_trust.devices import ( Methods: -- client.zero_trust.devices.networks.create(\*, account_id, \*\*params) -> Optional -- client.zero_trust.devices.networks.update(network_id, \*, account_id, \*\*params) -> Optional -- client.zero_trust.devices.networks.list(\*, account_id) -> SyncSinglePage[DeviceManagedNetworks] +- client.zero_trust.devices.networks.create(\*, account_id, \*\*params) -> Optional +- client.zero_trust.devices.networks.update(network_id, \*, account_id, \*\*params) -> Optional +- client.zero_trust.devices.networks.list(\*, account_id) -> SyncSinglePage[Network] - client.zero_trust.devices.networks.delete(network_id, \*, account_id, \*\*params) -> Optional -- client.zero_trust.devices.networks.get(network_id, \*, account_id) -> Optional +- client.zero_trust.devices.networks.get(network_id, \*, account_id) -> Optional ### Policies @@ -4842,7 +4807,7 @@ Types: ```python from cloudflare.types.zero_trust.devices import ( - DevicesDeviceSettingsPolicy, + SettingsPolicy, UnnamedSchemaRefF636ff9f2cb41ff4b715cf8ed8515581, PolicyDeleteResponse, ) @@ -4850,11 +4815,11 @@ from cloudflare.types.zero_trust.devices import ( Methods: -- client.zero_trust.devices.policies.create(\*, account_id, \*\*params) -> Optional -- client.zero_trust.devices.policies.list(\*, account_id) -> SyncSinglePage[DevicesDeviceSettingsPolicy] +- client.zero_trust.devices.policies.create(\*, account_id, \*\*params) -> Optional +- client.zero_trust.devices.policies.list(\*, account_id) -> SyncSinglePage[SettingsPolicy] - client.zero_trust.devices.policies.delete(policy_id, \*, account_id, \*\*params) -> Optional -- client.zero_trust.devices.policies.edit(policy_id, \*, account_id, \*\*params) -> Optional -- client.zero_trust.devices.policies.get(policy_id, \*, account_id) -> Optional +- client.zero_trust.devices.policies.edit(policy_id, \*, account_id, \*\*params) -> Optional +- client.zero_trust.devices.policies.get(policy_id, \*, account_id) -> Optional #### DefaultPolicy @@ -4874,7 +4839,7 @@ Types: ```python from cloudflare.types.zero_trust.devices.policies import ( - DevicesSplitTunnel, + SplitTunnelExclude, UnnamedSchemaRef0462afe1a32ee90b1999d4277af59fa8, ExcludeUpdateResponse, ExcludeGetResponse, @@ -4884,7 +4849,7 @@ from cloudflare.types.zero_trust.devices.policies import ( Methods: - client.zero_trust.devices.policies.excludes.update(\*, account_id, \*\*params) -> Optional -- client.zero_trust.devices.policies.excludes.list(\*, account_id) -> SyncSinglePage[DevicesSplitTunnel] +- client.zero_trust.devices.policies.excludes.list(\*, account_id) -> SyncSinglePage[SplitTunnelExclude] - client.zero_trust.devices.policies.excludes.get(policy_id, \*, account_id) -> Optional #### FallbackDomains @@ -4893,7 +4858,7 @@ Types: ```python from cloudflare.types.zero_trust.devices.policies import ( - DevicesFallbackDomain, + FallbackDomain, UnnamedSchemaRef1fbf91ecd61792c751fead58dc8005e6, FallbackDomainUpdateResponse, FallbackDomainGetResponse, @@ -4903,7 +4868,7 @@ from cloudflare.types.zero_trust.devices.policies import ( Methods: - client.zero_trust.devices.policies.fallback_domains.update(policy_id, \*, account_id, \*\*params) -> Optional -- client.zero_trust.devices.policies.fallback_domains.list(\*, account_id) -> SyncSinglePage[DevicesFallbackDomain] +- client.zero_trust.devices.policies.fallback_domains.list(\*, account_id) -> SyncSinglePage[FallbackDomain] - client.zero_trust.devices.policies.fallback_domains.get(policy_id, \*, account_id) -> Optional #### Includes @@ -4912,7 +4877,7 @@ Types: ```python from cloudflare.types.zero_trust.devices.policies import ( - DevicesSplitTunnelInclude, + SplitTunnelInclude, UnnamedSchemaRef5e0c6134a624678286f4a424b001870a, IncludeUpdateResponse, IncludeGetResponse, @@ -4922,7 +4887,7 @@ from cloudflare.types.zero_trust.devices.policies import ( Methods: - client.zero_trust.devices.policies.includes.update(\*, account_id, \*\*params) -> Optional -- client.zero_trust.devices.policies.includes.list(\*, account_id) -> SyncSinglePage[DevicesSplitTunnelInclude] +- client.zero_trust.devices.policies.includes.list(\*, account_id) -> SyncSinglePage[SplitTunnelInclude] - client.zero_trust.devices.policies.includes.get(policy_id, \*, account_id) -> Optional ### Posture @@ -4979,13 +4944,13 @@ Methods: Types: ```python -from cloudflare.types.zero_trust.devices import ZeroTrustAccountDeviceSettings +from cloudflare.types.zero_trust.devices import DeviceSettings ``` Methods: -- client.zero_trust.devices.settings.update(\*, account_id, \*\*params) -> Optional -- client.zero_trust.devices.settings.list(\*, account_id) -> Optional +- client.zero_trust.devices.settings.update(\*, account_id, \*\*params) -> Optional +- client.zero_trust.devices.settings.list(\*, account_id) -> Optional ### Unrevoke @@ -5013,9 +4978,9 @@ Types: from cloudflare.types.zero_trust import ( AzureAd, GenericOAuthConfig, + IdentityProvider, UnnamedSchemaRef9ab84e842cdf571c8f3898648bcdabcb, UnnamedSchemaRefDd86d8b7ea73283da7b160ed3f86cae1, - ZeroTrustIdentityProviders, IdentityProviderListResponse, IdentityProviderDeleteResponse, ) @@ -5023,29 +4988,25 @@ from cloudflare.types.zero_trust import ( Methods: -- client.zero_trust.identity_providers.create(\*, account_id, zone_id, \*\*params) -> ZeroTrustIdentityProviders -- client.zero_trust.identity_providers.update(uuid, \*, account_id, zone_id, \*\*params) -> ZeroTrustIdentityProviders +- client.zero_trust.identity_providers.create(\*, account_id, zone_id, \*\*params) -> IdentityProvider +- client.zero_trust.identity_providers.update(uuid, \*, account_id, zone_id, \*\*params) -> IdentityProvider - client.zero_trust.identity_providers.list(\*, account_id, zone_id) -> SyncSinglePage[IdentityProviderListResponse] - client.zero_trust.identity_providers.delete(uuid, \*, account_id, zone_id) -> IdentityProviderDeleteResponse -- client.zero_trust.identity_providers.get(uuid, \*, account_id, zone_id) -> ZeroTrustIdentityProviders +- client.zero_trust.identity_providers.get(uuid, \*, account_id, zone_id) -> IdentityProvider ## Organizations Types: ```python -from cloudflare.types.zero_trust import ( - LoginDesign, - ZeroTrustOrganizations, - OrganizationRevokeUsersResponse, -) +from cloudflare.types.zero_trust import LoginDesign, Organizations, OrganizationRevokeUsersResponse ``` Methods: -- client.zero_trust.organizations.create(\*, account_id, zone_id, \*\*params) -> ZeroTrustOrganizations -- client.zero_trust.organizations.update(\*, account_id, zone_id, \*\*params) -> ZeroTrustOrganizations -- client.zero_trust.organizations.list(\*, account_id, zone_id) -> ZeroTrustOrganizations +- client.zero_trust.organizations.create(\*, account_id, zone_id, \*\*params) -> Organizations +- client.zero_trust.organizations.update(\*, account_id, zone_id, \*\*params) -> Organizations +- client.zero_trust.organizations.list(\*, account_id, zone_id) -> Organizations - client.zero_trust.organizations.revoke_users(\*, account_id, zone_id, \*\*params) -> Optional ## Seats @@ -5053,7 +5014,7 @@ Methods: Types: ```python -from cloudflare.types.zero_trust import ZeroTrustSeats, SeatEditResponse +from cloudflare.types.zero_trust import Seat, SeatEditResponse ``` Methods: @@ -5066,12 +5027,13 @@ Types: ```python from cloudflare.types.zero_trust import ( + AccessDevicePostureRule, + AccessRule, AnyValidServiceTokenRule, AuthenticationMethodRule, AzureGroupRule, CertificateRule, CountryRule, - DevicePostureRule, DomainRule, EmailListRule, EmailRule, @@ -5080,11 +5042,9 @@ from cloudflare.types.zero_trust import ( GitHubOrganizationRule, GroupRule, GsuiteGroupRule, - IncludeItem, IPListRule, IPRule, OktaGroupRule, - Rule, SamlGroupRule, ServiceTokenRule, ) @@ -5106,9 +5066,6 @@ from cloudflare.types.zero_trust.access import ( CustomPagesItem, SamlSaasApp, SelfHostedDomainsItem, - UnnamedSchemaRef6ed9646890b9be79e16f1cfff86ec832, - UnnamedSchemaRefC335ce55d4fdf132c942dfce6e45dcb9, - UnnamedSchemaRefC6200e37c458aaa3c42e6e5b999bc419, ApplicationDeleteResponse, ApplicationRevokeTokensResponse, ) @@ -5128,13 +5085,13 @@ Methods: Types: ```python -from cloudflare.types.zero_trust.access.applications import ZeroTrustCA, CADeleteResponse +from cloudflare.types.zero_trust.access.applications import CA, CADeleteResponse ``` Methods: - client.zero_trust.access.applications.cas.create(uuid, \*, account_id, zone_id) -> UnnamedSchemaRef9444735ca60712dbcf8afd832eb5716a -- client.zero_trust.access.applications.cas.list(\*, account_id, zone_id) -> SyncSinglePage[ZeroTrustCA] +- client.zero_trust.access.applications.cas.list(\*, account_id, zone_id) -> SyncSinglePage[CA] - client.zero_trust.access.applications.cas.delete(uuid, \*, account_id, zone_id) -> CADeleteResponse - client.zero_trust.access.applications.cas.get(uuid, \*, account_id, zone_id) -> UnnamedSchemaRef9444735ca60712dbcf8afd832eb5716a @@ -5143,10 +5100,7 @@ Methods: Types: ```python -from cloudflare.types.zero_trust.access.applications import ( - UnnamedSchemaRef6a02fe18089d53b52b2cd3949b717919, - UserPolicyCheckListResponse, -) +from cloudflare.types.zero_trust.access.applications import UserPolicyCheckListResponse ``` Methods: @@ -5160,10 +5114,7 @@ Types: ```python from cloudflare.types.zero_trust.access.applications import ( ApprovalGroup, - ApprovalGroupItem, - ExcludeItem, Policy, - RequireItem, PolicyDeleteResponse, ) ``` @@ -5202,7 +5153,7 @@ Types: ```python from cloudflare.types.zero_trust.access.certificates import ( - Settings, + CertificateSettings, SettingUpdateResponse, SettingGetResponse, ) @@ -5218,12 +5169,7 @@ Methods: Types: ```python -from cloudflare.types.zero_trust.access import ( - ExcludeItem, - RequireItem, - ZeroTrustGroup, - GroupDeleteResponse, -) +from cloudflare.types.zero_trust.access import ZeroTrustGroup, GroupDeleteResponse ``` Methods: @@ -5240,7 +5186,7 @@ Types: ```python from cloudflare.types.zero_trust.access import ( - ZeroTrustServiceTokens, + ErviceToken, ServiceTokenCreateResponse, ServiceTokenRotateResponse, ) @@ -5249,10 +5195,10 @@ from cloudflare.types.zero_trust.access import ( Methods: - client.zero_trust.access.service_tokens.create(\*, account_id, zone_id, \*\*params) -> ServiceTokenCreateResponse -- client.zero_trust.access.service_tokens.update(uuid, \*, account_id, zone_id, \*\*params) -> ZeroTrustServiceTokens -- client.zero_trust.access.service_tokens.list(\*, account_id, zone_id) -> SyncSinglePage[ZeroTrustServiceTokens] -- client.zero_trust.access.service_tokens.delete(uuid, \*, account_id, zone_id) -> ZeroTrustServiceTokens -- client.zero_trust.access.service_tokens.refresh(uuid, \*, identifier) -> ZeroTrustServiceTokens +- client.zero_trust.access.service_tokens.update(uuid, \*, account_id, zone_id, \*\*params) -> ErviceToken +- client.zero_trust.access.service_tokens.list(\*, account_id, zone_id) -> SyncSinglePage[ErviceToken] +- client.zero_trust.access.service_tokens.delete(uuid, \*, account_id, zone_id) -> ErviceToken +- client.zero_trust.access.service_tokens.refresh(uuid, \*, identifier) -> ErviceToken - client.zero_trust.access.service_tokens.rotate(uuid, \*, identifier) -> ServiceTokenRotateResponse ### Bookmarks @@ -5260,16 +5206,16 @@ Methods: Types: ```python -from cloudflare.types.zero_trust.access import ZeroTrustBookmarks, BookmarkDeleteResponse +from cloudflare.types.zero_trust.access import Bookmarks, BookmarkDeleteResponse ``` Methods: -- client.zero_trust.access.bookmarks.create(uuid, \*, identifier, \*\*params) -> ZeroTrustBookmarks -- client.zero_trust.access.bookmarks.update(uuid, \*, identifier, \*\*params) -> ZeroTrustBookmarks -- client.zero_trust.access.bookmarks.list(identifier) -> SyncSinglePage[ZeroTrustBookmarks] +- client.zero_trust.access.bookmarks.create(uuid, \*, identifier, \*\*params) -> Bookmarks +- client.zero_trust.access.bookmarks.update(uuid, \*, identifier, \*\*params) -> Bookmarks +- client.zero_trust.access.bookmarks.list(identifier) -> SyncSinglePage[Bookmarks] - client.zero_trust.access.bookmarks.delete(uuid, \*, identifier, \*\*params) -> BookmarkDeleteResponse -- client.zero_trust.access.bookmarks.get(uuid, \*, identifier) -> ZeroTrustBookmarks +- client.zero_trust.access.bookmarks.get(uuid, \*, identifier) -> Bookmarks ### Keys @@ -5286,10 +5232,7 @@ Methods: Types: ```python -from cloudflare.types.zero_trust.access.logs import ( - ZeroTrustAccessRequests, - AccessRequestListResponse, -) +from cloudflare.types.zero_trust.access.logs import AccessRequests, AccessRequestListResponse ``` Methods: @@ -5301,12 +5244,12 @@ Methods: Types: ```python -from cloudflare.types.zero_trust.access import ZeroTrustUsers +from cloudflare.types.zero_trust.access import User ``` Methods: -- client.zero_trust.access.users.list(identifier) -> SyncSinglePage[ZeroTrustUsers] +- client.zero_trust.access.users.list(identifier) -> SyncSinglePage[User] #### ActiveSessions @@ -5329,12 +5272,12 @@ Methods: Types: ```python -from cloudflare.types.zero_trust.access.users import ZeroTrustIdentity +from cloudflare.types.zero_trust.access.users import Identity ``` Methods: -- client.zero_trust.access.users.last_seen_identity.get(id, \*, identifier) -> ZeroTrustIdentity +- client.zero_trust.access.users.last_seen_identity.get(id, \*, identifier) -> Identity #### FailedLogins @@ -5354,35 +5297,35 @@ Types: ```python from cloudflare.types.zero_trust.access import ( - ZeroTrustCustomPage, - ZeroTrustCustomPageWithoutHTML, + CustomPage, + CustomPageWithoutHTML, CustomPageDeleteResponse, ) ``` Methods: -- client.zero_trust.access.custom_pages.create(identifier, \*\*params) -> ZeroTrustCustomPageWithoutHTML -- client.zero_trust.access.custom_pages.update(uuid, \*, identifier, \*\*params) -> ZeroTrustCustomPageWithoutHTML -- client.zero_trust.access.custom_pages.list(identifier) -> SyncSinglePage[ZeroTrustCustomPageWithoutHTML] +- client.zero_trust.access.custom_pages.create(identifier, \*\*params) -> CustomPageWithoutHTML +- client.zero_trust.access.custom_pages.update(uuid, \*, identifier, \*\*params) -> CustomPageWithoutHTML +- client.zero_trust.access.custom_pages.list(identifier) -> SyncSinglePage[CustomPageWithoutHTML] - client.zero_trust.access.custom_pages.delete(uuid, \*, identifier) -> CustomPageDeleteResponse -- client.zero_trust.access.custom_pages.get(uuid, \*, identifier) -> ZeroTrustCustomPage +- client.zero_trust.access.custom_pages.get(uuid, \*, identifier) -> CustomPage ### Tags Types: ```python -from cloudflare.types.zero_trust.access import ZeroTrustTag, TagDeleteResponse +from cloudflare.types.zero_trust.access import Tag, TagDeleteResponse ``` Methods: -- client.zero_trust.access.tags.create(identifier, \*\*params) -> ZeroTrustTag -- client.zero_trust.access.tags.update(tag_name, \*, identifier, \*\*params) -> ZeroTrustTag -- client.zero_trust.access.tags.list(identifier) -> SyncSinglePage[ZeroTrustTag] +- client.zero_trust.access.tags.create(identifier, \*\*params) -> Tag +- client.zero_trust.access.tags.update(tag_name, \*, identifier, \*\*params) -> Tag +- client.zero_trust.access.tags.list(identifier) -> SyncSinglePage[Tag] - client.zero_trust.access.tags.delete(name, \*, identifier) -> TagDeleteResponse -- client.zero_trust.access.tags.get(name, \*, identifier) -> ZeroTrustTag +- client.zero_trust.access.tags.get(name, \*, identifier) -> Tag ## DEX @@ -5425,12 +5368,12 @@ Methods: Types: ```python -from cloudflare.types.zero_trust.dex.fleet_status import Device +from cloudflare.types.zero_trust.dex.fleet_status import DeviceListResponse ``` Methods: -- client.zero_trust.dex.fleet_status.devices.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[Device] +- client.zero_trust.dex.fleet_status.devices.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[DeviceListResponse] ### HTTPTests @@ -5482,17 +5425,17 @@ Methods: ### TracerouteTestResults -#### NetworkPath +#### NetworkPathResource Types: ```python -from cloudflare.types.zero_trust.dex.traceroute_test_results import TracerouteTestResultNetworkPath +from cloudflare.types.zero_trust.dex.traceroute_test_results import NetworkPath ``` Methods: -- client.zero_trust.dex.traceroute_test_results.network_path.get(test_result_id, \*, account_id) -> TracerouteTestResultNetworkPath +- client.zero_trust.dex.traceroute_test_results.network_path.get(test_result_id, \*, account_id) -> NetworkPath ### TracerouteTests @@ -5500,17 +5443,17 @@ Types: ```python from cloudflare.types.zero_trust.dex import ( - TracerouteDetails, - TracerouteDetailsPercentiles, - TracerouteTestNetworkPath, + NetworkPath, + Traceroute, + TracerouteTestPercentilesResponse, ) ``` Methods: -- client.zero_trust.dex.traceroute_tests.get(test_id, \*, account_id, \*\*params) -> TracerouteDetails -- client.zero_trust.dex.traceroute_tests.network_path(test_id, \*, account_id, \*\*params) -> TracerouteTestNetworkPath -- client.zero_trust.dex.traceroute_tests.percentiles(test_id, \*, account_id, \*\*params) -> TracerouteDetailsPercentiles +- client.zero_trust.dex.traceroute_tests.get(test_id, \*, account_id, \*\*params) -> Traceroute +- client.zero_trust.dex.traceroute_tests.network_path(test_id, \*, account_id, \*\*params) -> NetworkPath +- client.zero_trust.dex.traceroute_tests.percentiles(test_id, \*, account_id, \*\*params) -> TracerouteTestPercentilesResponse ## Tunnels @@ -5544,7 +5487,7 @@ Methods: Types: ```python -from cloudflare.types.zero_trust.tunnels import TunnelTunnelClient, ConnectionGetResponse +from cloudflare.types.zero_trust.tunnels import Client, ConnectionGetResponse ``` Methods: @@ -5568,7 +5511,7 @@ Methods: Methods: -- client.zero_trust.tunnels.connectors.get(connector_id, \*, account_id, tunnel_id) -> TunnelTunnelClient +- client.zero_trust.tunnels.connectors.get(connector_id, \*, account_id, tunnel_id) -> Client ### Management @@ -5640,13 +5583,13 @@ Methods: Types: ```python -from cloudflare.types.zero_trust.dlp import UnnamedSchemaRefE31ff4936b1b42746e8cb62bbc87f2e5 +from cloudflare.types.zero_trust.dlp import PayloadLogUpdateResponse, PayloadLogGetResponse ``` Methods: -- client.zero_trust.dlp.payload_logs.update(\*, account_id, \*\*params) -> Optional -- client.zero_trust.dlp.payload_logs.get(\*, account_id) -> Optional +- client.zero_trust.dlp.payload_logs.update(\*, account_id, \*\*params) -> PayloadLogUpdateResponse +- client.zero_trust.dlp.payload_logs.get(\*, account_id) -> PayloadLogGetResponse ### Profiles @@ -5655,7 +5598,7 @@ Types: ```python from cloudflare.types.zero_trust.dlp import ( ContextAwareness, - DLPProfile, + Profile, SkipConfiguration, UnnamedSchemaRefC105db122868c71badeac3b4822ad6b1, UnnamedSchemaRefE38bfdf1acf5a4bfada6779c79528bc0, @@ -5665,7 +5608,7 @@ from cloudflare.types.zero_trust.dlp import ( Methods: -- client.zero_trust.dlp.profiles.list(\*, account_id) -> SyncSinglePage[DLPProfile] +- client.zero_trust.dlp.profiles.list(\*, account_id) -> SyncSinglePage[Profile] - client.zero_trust.dlp.profiles.get(profile_id, \*, account_id) -> ProfileGetResponse #### Custom @@ -5714,37 +5657,37 @@ Methods: Types: ```python -from cloudflare.types.zero_trust.gateway import ZeroTrustGatewaySettings +from cloudflare.types.zero_trust.gateway import GatewaySettings ``` Methods: -- client.zero_trust.gateway.audit_ssh_settings.update(\*, account_id, \*\*params) -> ZeroTrustGatewaySettings -- client.zero_trust.gateway.audit_ssh_settings.get(\*, account_id) -> ZeroTrustGatewaySettings +- client.zero_trust.gateway.audit_ssh_settings.update(\*, account_id, \*\*params) -> GatewaySettings +- client.zero_trust.gateway.audit_ssh_settings.get(\*, account_id) -> GatewaySettings ### Categories Types: ```python -from cloudflare.types.zero_trust.gateway import ZeroTrustGatewayCategories +from cloudflare.types.zero_trust.gateway import Category ``` Methods: -- client.zero_trust.gateway.categories.list(\*, account_id) -> SyncSinglePage[ZeroTrustGatewayCategories] +- client.zero_trust.gateway.categories.list(\*, account_id) -> SyncSinglePage[Category] ### AppTypes Types: ```python -from cloudflare.types.zero_trust.gateway import ZeroTrustGatewayAppTypes +from cloudflare.types.zero_trust.gateway import AppType ``` Methods: -- client.zero_trust.gateway.app_types.list(\*, account_id) -> SyncSinglePage[ZeroTrustGatewayAppTypes] +- client.zero_trust.gateway.app_types.list(\*, account_id) -> SyncSinglePage[AppType] ### Configurations @@ -5782,8 +5725,8 @@ Types: ```python from cloudflare.types.zero_trust.gateway import ( + Lists, UnnamedSchemaRef30ecd0f5ce68fc07dbb7760deda3d707, - ZeroTrustGatewayLists, ListCreateResponse, ) ``` @@ -5791,11 +5734,11 @@ from cloudflare.types.zero_trust.gateway import ( Methods: - client.zero_trust.gateway.lists.create(\*, account_id, \*\*params) -> ListCreateResponse -- client.zero_trust.gateway.lists.update(list_id, \*, account_id, \*\*params) -> ZeroTrustGatewayLists -- client.zero_trust.gateway.lists.list(\*, account_id) -> SyncSinglePage[ZeroTrustGatewayLists] +- client.zero_trust.gateway.lists.update(list_id, \*, account_id, \*\*params) -> Lists +- client.zero_trust.gateway.lists.list(\*, account_id) -> SyncSinglePage[Lists] - client.zero_trust.gateway.lists.delete(list_id, \*, account_id, \*\*params) -> UnnamedSchemaRef9444735ca60712dbcf8afd832eb5716a -- client.zero_trust.gateway.lists.edit(list_id, \*, account_id, \*\*params) -> ZeroTrustGatewayLists -- client.zero_trust.gateway.lists.get(list_id, \*, account_id) -> ZeroTrustGatewayLists +- client.zero_trust.gateway.lists.edit(list_id, \*, account_id, \*\*params) -> Lists +- client.zero_trust.gateway.lists.get(list_id, \*, account_id) -> Lists #### Items @@ -5815,20 +5758,19 @@ Types: ```python from cloudflare.types.zero_trust.gateway import ( - Locations, - Network, - NetworkItem, + Location, + LocationNetwork, UnnamedSchemaRef1b37523fdb0ae5806cd8e062492aab66, ) ``` Methods: -- client.zero_trust.gateway.locations.create(\*, account_id, \*\*params) -> Locations -- client.zero_trust.gateway.locations.update(location_id, \*, account_id, \*\*params) -> Locations -- client.zero_trust.gateway.locations.list(\*, account_id) -> SyncSinglePage[Locations] +- client.zero_trust.gateway.locations.create(\*, account_id, \*\*params) -> Location +- client.zero_trust.gateway.locations.update(location_id, \*, account_id, \*\*params) -> Location +- client.zero_trust.gateway.locations.list(\*, account_id) -> SyncSinglePage[Location] - client.zero_trust.gateway.locations.delete(location_id, \*, account_id, \*\*params) -> UnnamedSchemaRef9444735ca60712dbcf8afd832eb5716a -- client.zero_trust.gateway.locations.get(location_id, \*, account_id) -> Locations +- client.zero_trust.gateway.locations.get(location_id, \*, account_id) -> Location ### Logging @@ -5836,15 +5778,15 @@ Types: ```python from cloudflare.types.zero_trust.gateway import ( + LoggingSetting, UnnamedSchemaRefE86eeb84b7e922c35cfb0031a6309f7b, - ZeroTrustGatewayGatewayAccountLoggingSettings, ) ``` Methods: -- client.zero_trust.gateway.logging.update(\*, account_id, \*\*params) -> ZeroTrustGatewayGatewayAccountLoggingSettings -- client.zero_trust.gateway.logging.get(\*, account_id) -> ZeroTrustGatewayGatewayAccountLoggingSettings +- client.zero_trust.gateway.logging.update(\*, account_id, \*\*params) -> LoggingSetting +- client.zero_trust.gateway.logging.get(\*, account_id) -> LoggingSetting ### ProxyEndpoints @@ -5853,18 +5795,18 @@ Types: ```python from cloudflare.types.zero_trust.gateway import ( GatewayIPsItem, + ProxyEndpoint, UnnamedSchemaRef4753ee81779d0e57189420079abab61e, - ZeroTrustGatewayProxyEndpoints, ) ``` Methods: -- client.zero_trust.gateway.proxy_endpoints.create(\*, account_id, \*\*params) -> ZeroTrustGatewayProxyEndpoints -- client.zero_trust.gateway.proxy_endpoints.list(\*, account_id) -> SyncSinglePage[ZeroTrustGatewayProxyEndpoints] +- client.zero_trust.gateway.proxy_endpoints.create(\*, account_id, \*\*params) -> ProxyEndpoint +- client.zero_trust.gateway.proxy_endpoints.list(\*, account_id) -> SyncSinglePage[ProxyEndpoint] - client.zero_trust.gateway.proxy_endpoints.delete(proxy_endpoint_id, \*, account_id, \*\*params) -> UnnamedSchemaRef9444735ca60712dbcf8afd832eb5716a -- client.zero_trust.gateway.proxy_endpoints.edit(proxy_endpoint_id, \*, account_id, \*\*params) -> ZeroTrustGatewayProxyEndpoints -- client.zero_trust.gateway.proxy_endpoints.get(proxy_endpoint_id, \*, account_id) -> ZeroTrustGatewayProxyEndpoints +- client.zero_trust.gateway.proxy_endpoints.edit(proxy_endpoint_id, \*, account_id, \*\*params) -> ProxyEndpoint +- client.zero_trust.gateway.proxy_endpoints.get(proxy_endpoint_id, \*, account_id) -> ProxyEndpoint ### Rules @@ -5874,21 +5816,21 @@ Types: from cloudflare.types.zero_trust.gateway import ( DNSResolverSettingsV4, DNSResolverSettingsV6, - FitlerItem, - RuleSettings, + GatewayFilter, + Rule, + RuleSetting, Schedule, UnnamedSchemaRef0b0764cdb06aad66b555fd74c8c78b2a, - ZeroTrustGatewayRules, ) ``` Methods: -- client.zero_trust.gateway.rules.create(\*, account_id, \*\*params) -> ZeroTrustGatewayRules -- client.zero_trust.gateway.rules.update(rule_id, \*, account_id, \*\*params) -> ZeroTrustGatewayRules -- client.zero_trust.gateway.rules.list(\*, account_id) -> SyncSinglePage[ZeroTrustGatewayRules] +- client.zero_trust.gateway.rules.create(\*, account_id, \*\*params) -> Rule +- client.zero_trust.gateway.rules.update(rule_id, \*, account_id, \*\*params) -> Rule +- client.zero_trust.gateway.rules.list(\*, account_id) -> SyncSinglePage[Rule] - client.zero_trust.gateway.rules.delete(rule_id, \*, account_id, \*\*params) -> UnnamedSchemaRef9444735ca60712dbcf8afd832eb5716a -- client.zero_trust.gateway.rules.get(rule_id, \*, account_id) -> ZeroTrustGatewayRules +- client.zero_trust.gateway.rules.get(rule_id, \*, account_id) -> Rule ## Networks @@ -5898,45 +5840,45 @@ Types: ```python from cloudflare.types.zero_trust.networks import ( - TunnelRoute, - TunnelTeamnet, + Route, + Teamnet, UnnamedSchemaRefC125d35cbb7f93aab989cd19bd764ed6, ) ``` Methods: -- client.zero_trust.networks.routes.create(\*, account_id, \*\*params) -> TunnelRoute -- client.zero_trust.networks.routes.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[TunnelTeamnet] -- client.zero_trust.networks.routes.delete(route_id, \*, account_id) -> TunnelRoute -- client.zero_trust.networks.routes.edit(route_id, \*, account_id, \*\*params) -> TunnelRoute +- client.zero_trust.networks.routes.create(\*, account_id, \*\*params) -> Route +- client.zero_trust.networks.routes.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[Teamnet] +- client.zero_trust.networks.routes.delete(route_id, \*, account_id) -> Route +- client.zero_trust.networks.routes.edit(route_id, \*, account_id, \*\*params) -> Route #### IPs Methods: -- client.zero_trust.networks.routes.ips.get(ip, \*, account_id, \*\*params) -> TunnelTeamnet +- client.zero_trust.networks.routes.ips.get(ip, \*, account_id, \*\*params) -> Teamnet #### Networks Methods: -- client.zero_trust.networks.routes.networks.create(ip_network_encoded, \*, account_id, \*\*params) -> TunnelRoute -- client.zero_trust.networks.routes.networks.delete(ip_network_encoded, \*, account_id, \*\*params) -> TunnelRoute -- client.zero_trust.networks.routes.networks.edit(ip_network_encoded, \*, account_id) -> TunnelRoute +- client.zero_trust.networks.routes.networks.create(ip_network_encoded, \*, account_id, \*\*params) -> Route +- client.zero_trust.networks.routes.networks.delete(ip_network_encoded, \*, account_id, \*\*params) -> Route +- client.zero_trust.networks.routes.networks.edit(ip_network_encoded, \*, account_id) -> Route ### VirtualNetworks Types: ```python -from cloudflare.types.zero_trust.networks import TunnelVirtualNetwork +from cloudflare.types.zero_trust.networks import VirtualNetwork ``` Methods: - client.zero_trust.networks.virtual_networks.create(\*, account_id, \*\*params) -> Optional -- client.zero_trust.networks.virtual_networks.list(\*, account_id, \*\*params) -> SyncSinglePage[TunnelVirtualNetwork] +- client.zero_trust.networks.virtual_networks.list(\*, account_id, \*\*params) -> SyncSinglePage[VirtualNetwork] - client.zero_trust.networks.virtual_networks.delete(virtual_network_id, \*, account_id, \*\*params) -> Optional - client.zero_trust.networks.virtual_networks.edit(virtual_network_id, \*, account_id, \*\*params) -> Optional @@ -5947,21 +5889,17 @@ Methods: Types: ```python -from cloudflare.types.challenges import ( - ChallengesWidget, - ChallengesWidgetList, - ChallengesWidgetListItem, -) +from cloudflare.types.challenges import Widget, WidgetDomain, WidgetDomainItem ``` Methods: -- client.challenges.widgets.create(\*, account_id, \*\*params) -> Optional -- client.challenges.widgets.update(sitekey, \*, account_id, \*\*params) -> Optional -- client.challenges.widgets.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[ChallengesWidgetList] -- client.challenges.widgets.delete(sitekey, \*, account_id) -> Optional -- client.challenges.widgets.get(sitekey, \*, account_id) -> Optional -- client.challenges.widgets.rotate_secret(sitekey, \*, account_id, \*\*params) -> Optional +- client.challenges.widgets.create(\*, account_id, \*\*params) -> Optional +- client.challenges.widgets.update(sitekey, \*, account_id, \*\*params) -> Optional +- client.challenges.widgets.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[WidgetDomain] +- client.challenges.widgets.delete(sitekey, \*, account_id) -> Optional +- client.challenges.widgets.get(sitekey, \*, account_id) -> Optional +- client.challenges.widgets.rotate_secret(sitekey, \*, account_id, \*\*params) -> Optional # HyperdriveResource @@ -5973,26 +5911,14 @@ from cloudflare.types import Configuration, Hyperdrive ## Configs -Types: - -```python -from cloudflare.types.hyperdrive import ( - ConfigCreateResponse, - ConfigUpdateResponse, - ConfigListResponse, - ConfigEditResponse, - ConfigGetResponse, -) -``` - Methods: -- client.hyperdrive.configs.create(\*, account_id, \*\*params) -> Optional -- client.hyperdrive.configs.update(hyperdrive_id, \*, account_id, \*\*params) -> Optional -- client.hyperdrive.configs.list(\*, account_id) -> SyncSinglePage[ConfigListResponse] +- client.hyperdrive.configs.create(\*, account_id, \*\*params) -> Optional +- client.hyperdrive.configs.update(hyperdrive_id, \*, account_id, \*\*params) -> Optional +- client.hyperdrive.configs.list(\*, account_id) -> SyncSinglePage[Hyperdrive] - client.hyperdrive.configs.delete(hyperdrive_id, \*, account_id) -> UnnamedSchemaRef9444735ca60712dbcf8afd832eb5716a -- client.hyperdrive.configs.edit(hyperdrive_id, \*, account_id, \*\*params) -> Optional -- client.hyperdrive.configs.get(hyperdrive_id, \*, account_id) -> Optional +- client.hyperdrive.configs.edit(hyperdrive_id, \*, account_id, \*\*params) -> Optional +- client.hyperdrive.configs.get(hyperdrive_id, \*, account_id) -> Optional # RUM @@ -6001,29 +5927,29 @@ Methods: Types: ```python -from cloudflare.types.rum import RUMSite, SiteInfoDeleteResponse +from cloudflare.types.rum import Site, SiteInfoDeleteResponse ``` Methods: -- client.rum.site_info.create(\*, account_id, \*\*params) -> Optional -- client.rum.site_info.update(site_id, \*, account_id, \*\*params) -> Optional -- client.rum.site_info.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[RUMSite] +- client.rum.site_info.create(\*, account_id, \*\*params) -> Optional +- client.rum.site_info.update(site_id, \*, account_id, \*\*params) -> Optional +- client.rum.site_info.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[Site] - client.rum.site_info.delete(site_id, \*, account_id) -> Optional -- client.rum.site_info.get(site_id, \*, account_id) -> Optional +- client.rum.site_info.get(site_id, \*, account_id) -> Optional ## Rules Types: ```python -from cloudflare.types.rum import RUMRule, RuleListResponse, RuleDeleteResponse +from cloudflare.types.rum import Rule, RuleListResponse, RuleDeleteResponse ``` Methods: -- client.rum.rules.create(ruleset_id, \*, account_id, \*\*params) -> Optional -- client.rum.rules.update(rule_id, \*, account_id, ruleset_id, \*\*params) -> Optional +- client.rum.rules.create(ruleset_id, \*, account_id, \*\*params) -> Optional +- client.rum.rules.update(rule_id, \*, account_id, ruleset_id, \*\*params) -> Optional - client.rum.rules.list(ruleset_id, \*, account_id) -> Optional - client.rum.rules.delete(rule_id, \*, account_id, ruleset_id) -> Optional @@ -7191,42 +7117,36 @@ Methods: Types: ```python -from cloudflare.types import ( - LabeledRegion, - LighthouseReport, - ObservatorySchedule, - ObservatoryTrend, - SpeedDeleteResponse, -) +from cloudflare.types import LabeledRegion, LighthouseReport, Trend, SpeedDeleteResponse ``` Methods: - client.speed.delete(url, \*, zone_id, \*\*params) -> Optional -- client.speed.schedule_get(url, \*, zone_id, \*\*params) -> Optional -- client.speed.trends_list(url, \*, zone_id, \*\*params) -> Optional +- client.speed.schedule_get(url, \*, zone_id, \*\*params) -> Optional +- client.speed.trends_list(url, \*, zone_id, \*\*params) -> Optional ## Tests Types: ```python -from cloudflare.types.speed import ObservatoryPageTest, TestListResponse, TestDeleteResponse +from cloudflare.types.speed import Test, TestListResponse, TestDeleteResponse ``` Methods: -- client.speed.tests.create(url, \*, zone_id, \*\*params) -> Optional +- client.speed.tests.create(url, \*, zone_id, \*\*params) -> Optional - client.speed.tests.list(url, \*, zone_id, \*\*params) -> TestListResponse - client.speed.tests.delete(url, \*, zone_id, \*\*params) -> Optional -- client.speed.tests.get(test_id, \*, zone_id, url) -> Optional +- client.speed.tests.get(test_id, \*, zone_id, url) -> Optional -## Schedule +## ScheduleResource Types: ```python -from cloudflare.types.speed import ScheduleCreateResponse +from cloudflare.types.speed import Schedule, ScheduleCreateResponse ``` Methods: @@ -7238,12 +7158,12 @@ Methods: Types: ```python -from cloudflare.types.speed import ObservatoryAvailabilities +from cloudflare.types.speed import Availability ``` Methods: -- client.speed.availabilities.list(\*, zone_id) -> Optional +- client.speed.availabilities.list(\*, zone_id) -> Optional ## Pages @@ -7351,56 +7271,47 @@ Methods: Types: ```python -from cloudflare.types.cloudforce_one import ( - CloudforceOneQuota, - CloudforceOneRequestConstants, - CloudforceOneRequestItem, - CloudforceOneRequestListItem, - CloudforceOneRequestTypes, -) +from cloudflare.types.cloudforce_one import Item, ListItem, Quota, RequestConstants, RequestTypes ``` Methods: -- client.cloudforce_one.requests.create(account_identifier, \*\*params) -> CloudforceOneRequestItem -- client.cloudforce_one.requests.update(request_identifier, \*, account_identifier, \*\*params) -> CloudforceOneRequestItem -- client.cloudforce_one.requests.list(account_identifier, \*\*params) -> SyncV4PagePaginationArray[CloudforceOneRequestListItem] +- client.cloudforce_one.requests.create(account_identifier, \*\*params) -> Item +- client.cloudforce_one.requests.update(request_identifier, \*, account_identifier, \*\*params) -> Item +- client.cloudforce_one.requests.list(account_identifier, \*\*params) -> SyncV4PagePaginationArray[ListItem] - client.cloudforce_one.requests.delete(request_identifier, \*, account_identifier) -> UnnamedSchemaRefEc4d85c3d1bcc6b3b7e99c199ae99846 -- client.cloudforce_one.requests.constants(account_identifier) -> CloudforceOneRequestConstants -- client.cloudforce_one.requests.get(request_identifier, \*, account_identifier) -> CloudforceOneRequestItem -- client.cloudforce_one.requests.quota(account_identifier) -> CloudforceOneQuota -- client.cloudforce_one.requests.types(account_identifier) -> CloudforceOneRequestTypes +- client.cloudforce_one.requests.constants(account_identifier) -> RequestConstants +- client.cloudforce_one.requests.get(request_identifier, \*, account_identifier) -> Item +- client.cloudforce_one.requests.quota(account_identifier) -> Quota +- client.cloudforce_one.requests.types(account_identifier) -> RequestTypes -### Message +### MessageResource Types: ```python -from cloudflare.types.cloudforce_one.requests import ( - CloudforceOneRequestMessageItem, - MessageGetResponse, -) +from cloudflare.types.cloudforce_one.requests import Message, MessageGetResponse ``` Methods: -- client.cloudforce_one.requests.message.create(request_identifier, \*, account_identifier, \*\*params) -> CloudforceOneRequestMessageItem -- client.cloudforce_one.requests.message.update(message_identifer, \*, account_identifier, request_identifier, \*\*params) -> CloudforceOneRequestMessageItem +- client.cloudforce_one.requests.message.create(request_identifier, \*, account_identifier, \*\*params) -> Message +- client.cloudforce_one.requests.message.update(message_identifer, \*, account_identifier, request_identifier, \*\*params) -> Message - client.cloudforce_one.requests.message.delete(message_identifer, \*, account_identifier, request_identifier) -> UnnamedSchemaRefEc4d85c3d1bcc6b3b7e99c199ae99846 - client.cloudforce_one.requests.message.get(request_identifier, \*, account_identifier, \*\*params) -> MessageGetResponse -### Priority +### PriorityResource Types: ```python -from cloudflare.types.cloudforce_one.requests import CloudforceOnePriorityItem +from cloudflare.types.cloudforce_one.requests import LabelItem, Priority, PriorityEdit ``` Methods: -- client.cloudforce_one.requests.priority.create(account_identifier, \*\*params) -> CloudforceOnePriorityItem -- client.cloudforce_one.requests.priority.update(priority_identifer, \*, account_identifier, \*\*params) -> CloudforceOneRequestItem +- client.cloudforce_one.requests.priority.create(account_identifier, \*\*params) -> Priority +- client.cloudforce_one.requests.priority.update(priority_identifer, \*, account_identifier, \*\*params) -> Item - client.cloudforce_one.requests.priority.delete(priority_identifer, \*, account_identifier) -> UnnamedSchemaRefEc4d85c3d1bcc6b3b7e99c199ae99846 -- client.cloudforce_one.requests.priority.get(priority_identifer, \*, account_identifier) -> CloudforceOneRequestItem -- client.cloudforce_one.requests.priority.quota(account_identifier) -> CloudforceOneQuota +- client.cloudforce_one.requests.priority.get(priority_identifer, \*, account_identifier) -> Item +- client.cloudforce_one.requests.priority.quota(account_identifier) -> Quota diff --git a/src/cloudflare/__init__.py b/src/cloudflare/__init__.py index c68ec60b863..bd005a22911 100644 --- a/src/cloudflare/__init__.py +++ b/src/cloudflare/__init__.py @@ -34,6 +34,7 @@ UnprocessableEntityError, APIResponseValidationError, ) +from ._base_client import DefaultHttpxClient, DefaultAsyncHttpxClient from ._utils._logs import setup_logging as _setup_logging __all__ = [ @@ -72,6 +73,8 @@ "DEFAULT_TIMEOUT", "DEFAULT_MAX_RETRIES", "DEFAULT_CONNECTION_LIMITS", + "DefaultHttpxClient", + "DefaultAsyncHttpxClient", ] _setup_logging() diff --git a/src/cloudflare/_base_client.py b/src/cloudflare/_base_client.py index 21c336d5fe8..750773d8246 100644 --- a/src/cloudflare/_base_client.py +++ b/src/cloudflare/_base_client.py @@ -715,7 +715,27 @@ def _idempotency_key(self) -> str: return f"stainless-python-retry-{uuid.uuid4()}" -class SyncHttpxClientWrapper(httpx.Client): +class _DefaultHttpxClient(httpx.Client): + def __init__(self, **kwargs: Any) -> None: + kwargs.setdefault("timeout", DEFAULT_TIMEOUT) + kwargs.setdefault("limits", DEFAULT_CONNECTION_LIMITS) + kwargs.setdefault("follow_redirects", True) + super().__init__(**kwargs) + + +if TYPE_CHECKING: + DefaultHttpxClient = httpx.Client + """An alias to `httpx.Client` that provides the same defaults that this SDK + uses internally. + + This is useful because overriding the `http_client` with your own instance of + `httpx.Client` will result in httpx's defaults being used, not ours. + """ +else: + DefaultHttpxClient = _DefaultHttpxClient + + +class SyncHttpxClientWrapper(DefaultHttpxClient): def __del__(self) -> None: try: self.close() @@ -1248,7 +1268,27 @@ def get_api_list( return self._request_api_list(model, page, opts) -class AsyncHttpxClientWrapper(httpx.AsyncClient): +class _DefaultAsyncHttpxClient(httpx.AsyncClient): + def __init__(self, **kwargs: Any) -> None: + kwargs.setdefault("timeout", DEFAULT_TIMEOUT) + kwargs.setdefault("limits", DEFAULT_CONNECTION_LIMITS) + kwargs.setdefault("follow_redirects", True) + super().__init__(**kwargs) + + +if TYPE_CHECKING: + DefaultAsyncHttpxClient = httpx.AsyncClient + """An alias to `httpx.AsyncClient` that provides the same defaults that this SDK + uses internally. + + This is useful because overriding the `http_client` with your own instance of + `httpx.AsyncClient` will result in httpx's defaults being used, not ours. + """ +else: + DefaultAsyncHttpxClient = _DefaultAsyncHttpxClient + + +class AsyncHttpxClientWrapper(DefaultAsyncHttpxClient): def __del__(self) -> None: try: # TODO(someday): support non asyncio runtimes here diff --git a/src/cloudflare/_client.py b/src/cloudflare/_client.py index e5ae42da70f..000dc7fe45a 100644 --- a/src/cloudflare/_client.py +++ b/src/cloudflare/_client.py @@ -51,7 +51,7 @@ class Cloudflare(SyncAPIClient): origin_ca_certificates: resources.OriginCACertificates ips: resources.IPs memberships: resources.Memberships - user: resources.UserResource + user: resources.User zones: resources.Zones load_balancers: resources.LoadBalancers cache: resources.Cache @@ -108,7 +108,7 @@ class Cloudflare(SyncAPIClient): storage: resources.Storage stream: resources.Stream alerting: resources.Alerting - d1: resources.D1 + d1: resources.D1Resource r2: resources.R2 warp_connector: resources.WARPConnector workers_for_platforms: resources.WorkersForPlatforms @@ -148,7 +148,9 @@ def __init__( max_retries: int = DEFAULT_MAX_RETRIES, default_headers: Mapping[str, str] | None = None, default_query: Mapping[str, object] | None = None, - # Configure a custom httpx client. See the [httpx documentation](https://www.python-httpx.org/api/#client) for more details. + # Configure a custom httpx client. + # We provide a `DefaultHttpxClient` class that you can pass to retain the default values we use for `limits`, `timeout` & `follow_redirects`. + # See the [httpx documentation](https://www.python-httpx.org/api/#client) for more details. http_client: httpx.Client | None = None, # Enable or disable schema validation for data returned by the API. # When enabled an error APIResponseValidationError is raised @@ -204,7 +206,7 @@ def __init__( self.origin_ca_certificates = resources.OriginCACertificates(self) self.ips = resources.IPs(self) self.memberships = resources.Memberships(self) - self.user = resources.UserResource(self) + self.user = resources.User(self) self.zones = resources.Zones(self) self.load_balancers = resources.LoadBalancers(self) self.cache = resources.Cache(self) @@ -261,7 +263,7 @@ def __init__( self.storage = resources.Storage(self) self.stream = resources.Stream(self) self.alerting = resources.Alerting(self) - self.d1 = resources.D1(self) + self.d1 = resources.D1Resource(self) self.r2 = resources.R2(self) self.warp_connector = resources.WARPConnector(self) self.workers_for_platforms = resources.WorkersForPlatforms(self) @@ -462,7 +464,7 @@ class AsyncCloudflare(AsyncAPIClient): origin_ca_certificates: resources.AsyncOriginCACertificates ips: resources.AsyncIPs memberships: resources.AsyncMemberships - user: resources.AsyncUserResource + user: resources.AsyncUser zones: resources.AsyncZones load_balancers: resources.AsyncLoadBalancers cache: resources.AsyncCache @@ -519,7 +521,7 @@ class AsyncCloudflare(AsyncAPIClient): storage: resources.AsyncStorage stream: resources.AsyncStream alerting: resources.AsyncAlerting - d1: resources.AsyncD1 + d1: resources.AsyncD1Resource r2: resources.AsyncR2 warp_connector: resources.AsyncWARPConnector workers_for_platforms: resources.AsyncWorkersForPlatforms @@ -559,7 +561,9 @@ def __init__( max_retries: int = DEFAULT_MAX_RETRIES, default_headers: Mapping[str, str] | None = None, default_query: Mapping[str, object] | None = None, - # Configure a custom httpx client. See the [httpx documentation](https://www.python-httpx.org/api/#asyncclient) for more details. + # Configure a custom httpx client. + # We provide a `DefaultAsyncHttpxClient` class that you can pass to retain the default values we use for `limits`, `timeout` & `follow_redirects`. + # See the [httpx documentation](https://www.python-httpx.org/api/#asyncclient) for more details. http_client: httpx.AsyncClient | None = None, # Enable or disable schema validation for data returned by the API. # When enabled an error APIResponseValidationError is raised @@ -615,7 +619,7 @@ def __init__( self.origin_ca_certificates = resources.AsyncOriginCACertificates(self) self.ips = resources.AsyncIPs(self) self.memberships = resources.AsyncMemberships(self) - self.user = resources.AsyncUserResource(self) + self.user = resources.AsyncUser(self) self.zones = resources.AsyncZones(self) self.load_balancers = resources.AsyncLoadBalancers(self) self.cache = resources.AsyncCache(self) @@ -672,7 +676,7 @@ def __init__( self.storage = resources.AsyncStorage(self) self.stream = resources.AsyncStream(self) self.alerting = resources.AsyncAlerting(self) - self.d1 = resources.AsyncD1(self) + self.d1 = resources.AsyncD1Resource(self) self.r2 = resources.AsyncR2(self) self.warp_connector = resources.AsyncWARPConnector(self) self.workers_for_platforms = resources.AsyncWorkersForPlatforms(self) @@ -874,7 +878,7 @@ def __init__(self, client: Cloudflare) -> None: self.origin_ca_certificates = resources.OriginCACertificatesWithRawResponse(client.origin_ca_certificates) self.ips = resources.IPsWithRawResponse(client.ips) self.memberships = resources.MembershipsWithRawResponse(client.memberships) - self.user = resources.UserResourceWithRawResponse(client.user) + self.user = resources.UserWithRawResponse(client.user) self.zones = resources.ZonesWithRawResponse(client.zones) self.load_balancers = resources.LoadBalancersWithRawResponse(client.load_balancers) self.cache = resources.CacheWithRawResponse(client.cache) @@ -931,7 +935,7 @@ def __init__(self, client: Cloudflare) -> None: self.storage = resources.StorageWithRawResponse(client.storage) self.stream = resources.StreamWithRawResponse(client.stream) self.alerting = resources.AlertingWithRawResponse(client.alerting) - self.d1 = resources.D1WithRawResponse(client.d1) + self.d1 = resources.D1ResourceWithRawResponse(client.d1) self.r2 = resources.R2WithRawResponse(client.r2) self.warp_connector = resources.WARPConnectorWithRawResponse(client.warp_connector) self.workers_for_platforms = resources.WorkersForPlatformsWithRawResponse(client.workers_for_platforms) @@ -960,7 +964,7 @@ def __init__(self, client: AsyncCloudflare) -> None: self.origin_ca_certificates = resources.AsyncOriginCACertificatesWithRawResponse(client.origin_ca_certificates) self.ips = resources.AsyncIPsWithRawResponse(client.ips) self.memberships = resources.AsyncMembershipsWithRawResponse(client.memberships) - self.user = resources.AsyncUserResourceWithRawResponse(client.user) + self.user = resources.AsyncUserWithRawResponse(client.user) self.zones = resources.AsyncZonesWithRawResponse(client.zones) self.load_balancers = resources.AsyncLoadBalancersWithRawResponse(client.load_balancers) self.cache = resources.AsyncCacheWithRawResponse(client.cache) @@ -1021,7 +1025,7 @@ def __init__(self, client: AsyncCloudflare) -> None: self.storage = resources.AsyncStorageWithRawResponse(client.storage) self.stream = resources.AsyncStreamWithRawResponse(client.stream) self.alerting = resources.AsyncAlertingWithRawResponse(client.alerting) - self.d1 = resources.AsyncD1WithRawResponse(client.d1) + self.d1 = resources.AsyncD1ResourceWithRawResponse(client.d1) self.r2 = resources.AsyncR2WithRawResponse(client.r2) self.warp_connector = resources.AsyncWARPConnectorWithRawResponse(client.warp_connector) self.workers_for_platforms = resources.AsyncWorkersForPlatformsWithRawResponse(client.workers_for_platforms) @@ -1050,7 +1054,7 @@ def __init__(self, client: Cloudflare) -> None: self.origin_ca_certificates = resources.OriginCACertificatesWithStreamingResponse(client.origin_ca_certificates) self.ips = resources.IPsWithStreamingResponse(client.ips) self.memberships = resources.MembershipsWithStreamingResponse(client.memberships) - self.user = resources.UserResourceWithStreamingResponse(client.user) + self.user = resources.UserWithStreamingResponse(client.user) self.zones = resources.ZonesWithStreamingResponse(client.zones) self.load_balancers = resources.LoadBalancersWithStreamingResponse(client.load_balancers) self.cache = resources.CacheWithStreamingResponse(client.cache) @@ -1111,7 +1115,7 @@ def __init__(self, client: Cloudflare) -> None: self.storage = resources.StorageWithStreamingResponse(client.storage) self.stream = resources.StreamWithStreamingResponse(client.stream) self.alerting = resources.AlertingWithStreamingResponse(client.alerting) - self.d1 = resources.D1WithStreamingResponse(client.d1) + self.d1 = resources.D1ResourceWithStreamingResponse(client.d1) self.r2 = resources.R2WithStreamingResponse(client.r2) self.warp_connector = resources.WARPConnectorWithStreamingResponse(client.warp_connector) self.workers_for_platforms = resources.WorkersForPlatformsWithStreamingResponse(client.workers_for_platforms) @@ -1142,7 +1146,7 @@ def __init__(self, client: AsyncCloudflare) -> None: ) self.ips = resources.AsyncIPsWithStreamingResponse(client.ips) self.memberships = resources.AsyncMembershipsWithStreamingResponse(client.memberships) - self.user = resources.AsyncUserResourceWithStreamingResponse(client.user) + self.user = resources.AsyncUserWithStreamingResponse(client.user) self.zones = resources.AsyncZonesWithStreamingResponse(client.zones) self.load_balancers = resources.AsyncLoadBalancersWithStreamingResponse(client.load_balancers) self.cache = resources.AsyncCacheWithStreamingResponse(client.cache) @@ -1205,7 +1209,7 @@ def __init__(self, client: AsyncCloudflare) -> None: self.storage = resources.AsyncStorageWithStreamingResponse(client.storage) self.stream = resources.AsyncStreamWithStreamingResponse(client.stream) self.alerting = resources.AsyncAlertingWithStreamingResponse(client.alerting) - self.d1 = resources.AsyncD1WithStreamingResponse(client.d1) + self.d1 = resources.AsyncD1ResourceWithStreamingResponse(client.d1) self.r2 = resources.AsyncR2WithStreamingResponse(client.r2) self.warp_connector = resources.AsyncWARPConnectorWithStreamingResponse(client.warp_connector) self.workers_for_platforms = resources.AsyncWorkersForPlatformsWithStreamingResponse( diff --git a/src/cloudflare/resources/__init__.py b/src/cloudflare/resources/__init__.py index 84e182ac364..22875e389ef 100644 --- a/src/cloudflare/resources/__init__.py +++ b/src/cloudflare/resources/__init__.py @@ -1,12 +1,12 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from .d1 import ( - D1, - AsyncD1, - D1WithRawResponse, - AsyncD1WithRawResponse, - D1WithStreamingResponse, - AsyncD1WithStreamingResponse, + D1Resource, + AsyncD1Resource, + D1ResourceWithRawResponse, + AsyncD1ResourceWithRawResponse, + D1ResourceWithStreamingResponse, + AsyncD1ResourceWithStreamingResponse, ) from .kv import ( KV, @@ -81,12 +81,12 @@ AsyncLogsWithStreamingResponse, ) from .user import ( - UserResource, - AsyncUserResource, - UserResourceWithRawResponse, - AsyncUserResourceWithRawResponse, - UserResourceWithStreamingResponse, - AsyncUserResourceWithStreamingResponse, + User, + AsyncUser, + UserWithRawResponse, + AsyncUserWithRawResponse, + UserWithStreamingResponse, + AsyncUserWithStreamingResponse, ) from .web3 import ( Web3, @@ -666,12 +666,12 @@ "AsyncMembershipsWithRawResponse", "MembershipsWithStreamingResponse", "AsyncMembershipsWithStreamingResponse", - "UserResource", - "AsyncUserResource", - "UserResourceWithRawResponse", - "AsyncUserResourceWithRawResponse", - "UserResourceWithStreamingResponse", - "AsyncUserResourceWithStreamingResponse", + "User", + "AsyncUser", + "UserWithRawResponse", + "AsyncUserWithRawResponse", + "UserWithStreamingResponse", + "AsyncUserWithStreamingResponse", "Zones", "AsyncZones", "ZonesWithRawResponse", @@ -1008,12 +1008,12 @@ "AsyncAlertingWithRawResponse", "AlertingWithStreamingResponse", "AsyncAlertingWithStreamingResponse", - "D1", - "AsyncD1", - "D1WithRawResponse", - "AsyncD1WithRawResponse", - "D1WithStreamingResponse", - "AsyncD1WithStreamingResponse", + "D1Resource", + "AsyncD1Resource", + "D1ResourceWithRawResponse", + "AsyncD1ResourceWithRawResponse", + "D1ResourceWithStreamingResponse", + "AsyncD1ResourceWithStreamingResponse", "R2", "AsyncR2", "R2WithRawResponse", diff --git a/src/cloudflare/resources/accounts/members.py b/src/cloudflare/resources/accounts/members.py index 3d4388ae195..76b969ef07c 100644 --- a/src/cloudflare/resources/accounts/members.py +++ b/src/cloudflare/resources/accounts/members.py @@ -28,9 +28,10 @@ ) from ...types.accounts import ( Member, - MemberWithCode, + MemberRoleParam, MemberListResponse, MemberDeleteResponse, + MemberWithInviteCode, member_list_params, member_create_params, member_delete_params, @@ -62,7 +63,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> MemberWithCode: + ) -> MemberWithInviteCode: """ Add a user to the list of members for this account. @@ -96,7 +97,7 @@ def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[MemberWithCode], ResultWrapper[MemberWithCode]), + cast_to=cast(Type[MemberWithInviteCode], ResultWrapper[MemberWithInviteCode]), ) def update( @@ -104,7 +105,7 @@ def update( member_id: str, *, account_id: object, - roles: Iterable[member_update_params.Role], + roles: Iterable[MemberRoleParam], # 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, @@ -308,7 +309,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> MemberWithCode: + ) -> MemberWithInviteCode: """ Add a user to the list of members for this account. @@ -342,7 +343,7 @@ async def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[MemberWithCode], ResultWrapper[MemberWithCode]), + cast_to=cast(Type[MemberWithInviteCode], ResultWrapper[MemberWithInviteCode]), ) async def update( @@ -350,7 +351,7 @@ async def update( member_id: str, *, account_id: object, - roles: Iterable[member_update_params.Role], + roles: Iterable[MemberRoleParam], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, diff --git a/src/cloudflare/resources/addressing/address_maps/address_maps.py b/src/cloudflare/resources/addressing/address_maps/address_maps.py index 86420e471f2..4c21df1fac0 100644 --- a/src/cloudflare/resources/addressing/address_maps/address_maps.py +++ b/src/cloudflare/resources/addressing/address_maps/address_maps.py @@ -51,7 +51,7 @@ ) from ....types.shared import UnnamedSchemaRef67bbb1ccdd42c3e2937b9fd19f791151 from ....types.addressing import ( - AddressingAddressMaps, + AddressMap, AddressMapGetResponse, AddressMapCreateResponse, address_map_edit_params, @@ -147,7 +147,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[AddressingAddressMaps]: + ) -> SyncSinglePage[AddressMap]: """ List all address maps owned by the account. @@ -166,11 +166,11 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/addressing/address_maps", - page=SyncSinglePage[AddressingAddressMaps], + page=SyncSinglePage[AddressMap], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=AddressingAddressMaps, + model=AddressMap, ) def delete( @@ -240,7 +240,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AddressingAddressMaps: + ) -> AddressMap: """ Modify properties of an address map owned by the account. @@ -290,7 +290,7 @@ def edit( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[AddressingAddressMaps], ResultWrapper[AddressingAddressMaps]), + cast_to=cast(Type[AddressMap], ResultWrapper[AddressMap]), ) def get( @@ -423,7 +423,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[AddressingAddressMaps, AsyncSinglePage[AddressingAddressMaps]]: + ) -> AsyncPaginator[AddressMap, AsyncSinglePage[AddressMap]]: """ List all address maps owned by the account. @@ -442,11 +442,11 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/addressing/address_maps", - page=AsyncSinglePage[AddressingAddressMaps], + page=AsyncSinglePage[AddressMap], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=AddressingAddressMaps, + model=AddressMap, ) async def delete( @@ -516,7 +516,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AddressingAddressMaps: + ) -> AddressMap: """ Modify properties of an address map owned by the account. @@ -566,7 +566,7 @@ async def edit( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[AddressingAddressMaps], ResultWrapper[AddressingAddressMaps]), + cast_to=cast(Type[AddressMap], ResultWrapper[AddressMap]), ) async def get( diff --git a/src/cloudflare/resources/addressing/prefixes/bgp/bindings.py b/src/cloudflare/resources/addressing/prefixes/bgp/bindings.py index 35d3c67232f..a292cb3ea77 100644 --- a/src/cloudflare/resources/addressing/prefixes/bgp/bindings.py +++ b/src/cloudflare/resources/addressing/prefixes/bgp/bindings.py @@ -26,7 +26,7 @@ make_request_options, ) from .....types.shared import UnnamedSchemaRefEc4d85c3d1bcc6b3b7e99c199ae99846 -from .....types.addressing.prefixes.bgp import AddressingServiceBinding, binding_create_params +from .....types.addressing.prefixes.bgp import ServiceBinding, binding_create_params __all__ = ["Bindings", "AsyncBindings"] @@ -53,7 +53,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AddressingServiceBinding: + ) -> ServiceBinding: """ Creates a new Service Binding, routing traffic to IPs within the given CIDR to a service running on Cloudflare's network. **Note:** This API may only be used on @@ -97,7 +97,7 @@ def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[AddressingServiceBinding], ResultWrapper[AddressingServiceBinding]), + cast_to=cast(Type[ServiceBinding], ResultWrapper[ServiceBinding]), ) def list( @@ -111,7 +111,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[AddressingServiceBinding]: + ) -> SyncSinglePage[ServiceBinding]: """List the Cloudflare services this prefix is currently bound to. Traffic sent to @@ -140,11 +140,11 @@ def list( raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}") return self._get_api_list( f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bindings", - page=SyncSinglePage[AddressingServiceBinding], + page=SyncSinglePage[ServiceBinding], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=AddressingServiceBinding, + model=ServiceBinding, ) def delete( @@ -213,7 +213,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AddressingServiceBinding: + ) -> ServiceBinding: """ Fetch a single Service Binding @@ -247,7 +247,7 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[AddressingServiceBinding], ResultWrapper[AddressingServiceBinding]), + cast_to=cast(Type[ServiceBinding], ResultWrapper[ServiceBinding]), ) @@ -273,7 +273,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AddressingServiceBinding: + ) -> ServiceBinding: """ Creates a new Service Binding, routing traffic to IPs within the given CIDR to a service running on Cloudflare's network. **Note:** This API may only be used on @@ -317,7 +317,7 @@ async def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[AddressingServiceBinding], ResultWrapper[AddressingServiceBinding]), + cast_to=cast(Type[ServiceBinding], ResultWrapper[ServiceBinding]), ) def list( @@ -331,7 +331,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[AddressingServiceBinding, AsyncSinglePage[AddressingServiceBinding]]: + ) -> AsyncPaginator[ServiceBinding, AsyncSinglePage[ServiceBinding]]: """List the Cloudflare services this prefix is currently bound to. Traffic sent to @@ -360,11 +360,11 @@ def list( raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}") return self._get_api_list( f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bindings", - page=AsyncSinglePage[AddressingServiceBinding], + page=AsyncSinglePage[ServiceBinding], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=AddressingServiceBinding, + model=ServiceBinding, ) async def delete( @@ -433,7 +433,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AddressingServiceBinding: + ) -> ServiceBinding: """ Fetch a single Service Binding @@ -467,7 +467,7 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[AddressingServiceBinding], ResultWrapper[AddressingServiceBinding]), + cast_to=cast(Type[ServiceBinding], ResultWrapper[ServiceBinding]), ) diff --git a/src/cloudflare/resources/addressing/prefixes/bgp/prefixes.py b/src/cloudflare/resources/addressing/prefixes/bgp/prefixes.py index 113ea0f6d3d..5232463bd75 100644 --- a/src/cloudflare/resources/addressing/prefixes/bgp/prefixes.py +++ b/src/cloudflare/resources/addressing/prefixes/bgp/prefixes.py @@ -25,7 +25,7 @@ AsyncPaginator, make_request_options, ) -from .....types.addressing.prefixes.bgp import AddressingIpamBGPPrefixes, prefix_edit_params +from .....types.addressing.prefixes.bgp import BGPPrefix, prefix_edit_params __all__ = ["Prefixes", "AsyncPrefixes"] @@ -50,7 +50,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[AddressingIpamBGPPrefixes]: + ) -> SyncSinglePage[BGPPrefix]: """List all BGP Prefixes within the specified IP Prefix. BGP Prefixes are used to @@ -77,11 +77,11 @@ def list( raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}") return self._get_api_list( f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/prefixes", - page=SyncSinglePage[AddressingIpamBGPPrefixes], + page=SyncSinglePage[BGPPrefix], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=AddressingIpamBGPPrefixes, + model=BGPPrefix, ) def edit( @@ -97,7 +97,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AddressingIpamBGPPrefixes: + ) -> BGPPrefix: """ Update the properties of a BGP Prefix, such as the on demand advertisement status (advertised or withdrawn). @@ -133,7 +133,7 @@ def edit( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[AddressingIpamBGPPrefixes], ResultWrapper[AddressingIpamBGPPrefixes]), + cast_to=cast(Type[BGPPrefix], ResultWrapper[BGPPrefix]), ) def get( @@ -148,7 +148,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AddressingIpamBGPPrefixes: + ) -> BGPPrefix: """ Retrieve a single BGP Prefix according to its identifier @@ -182,7 +182,7 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[AddressingIpamBGPPrefixes], ResultWrapper[AddressingIpamBGPPrefixes]), + cast_to=cast(Type[BGPPrefix], ResultWrapper[BGPPrefix]), ) @@ -206,7 +206,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[AddressingIpamBGPPrefixes, AsyncSinglePage[AddressingIpamBGPPrefixes]]: + ) -> AsyncPaginator[BGPPrefix, AsyncSinglePage[BGPPrefix]]: """List all BGP Prefixes within the specified IP Prefix. BGP Prefixes are used to @@ -233,11 +233,11 @@ def list( raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}") return self._get_api_list( f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/prefixes", - page=AsyncSinglePage[AddressingIpamBGPPrefixes], + page=AsyncSinglePage[BGPPrefix], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=AddressingIpamBGPPrefixes, + model=BGPPrefix, ) async def edit( @@ -253,7 +253,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AddressingIpamBGPPrefixes: + ) -> BGPPrefix: """ Update the properties of a BGP Prefix, such as the on demand advertisement status (advertised or withdrawn). @@ -289,7 +289,7 @@ async def edit( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[AddressingIpamBGPPrefixes], ResultWrapper[AddressingIpamBGPPrefixes]), + cast_to=cast(Type[BGPPrefix], ResultWrapper[BGPPrefix]), ) async def get( @@ -304,7 +304,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AddressingIpamBGPPrefixes: + ) -> BGPPrefix: """ Retrieve a single BGP Prefix according to its identifier @@ -338,7 +338,7 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[AddressingIpamBGPPrefixes], ResultWrapper[AddressingIpamBGPPrefixes]), + cast_to=cast(Type[BGPPrefix], ResultWrapper[BGPPrefix]), ) diff --git a/src/cloudflare/resources/addressing/prefixes/delegations.py b/src/cloudflare/resources/addressing/prefixes/delegations.py index 3345bbadc87..53b872930b0 100644 --- a/src/cloudflare/resources/addressing/prefixes/delegations.py +++ b/src/cloudflare/resources/addressing/prefixes/delegations.py @@ -27,7 +27,7 @@ ) from ....types.addressing.prefixes import ( DelegationDeleteResponse, - AddressingIpamDelegations, + delegations, delegation_create_params, delegation_delete_params, ) @@ -57,7 +57,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AddressingIpamDelegations: + ) -> delegations.Delegations: """ Create a new account delegation for a given IP prefix. @@ -98,7 +98,7 @@ def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[AddressingIpamDelegations], ResultWrapper[AddressingIpamDelegations]), + cast_to=cast(Type[delegations.Delegations], ResultWrapper[delegations.Delegations]), ) def list( @@ -112,7 +112,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[AddressingIpamDelegations]: + ) -> SyncSinglePage[delegations.Delegations]: """ List all delegations for a given account IP prefix. @@ -135,11 +135,11 @@ def list( raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}") return self._get_api_list( f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/delegations", - page=SyncSinglePage[AddressingIpamDelegations], + page=SyncSinglePage[delegations.Delegations], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=AddressingIpamDelegations, + model=delegations.Delegations, ) def delete( @@ -216,7 +216,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AddressingIpamDelegations: + ) -> delegations.Delegations: """ Create a new account delegation for a given IP prefix. @@ -257,7 +257,7 @@ async def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[AddressingIpamDelegations], ResultWrapper[AddressingIpamDelegations]), + cast_to=cast(Type[delegations.Delegations], ResultWrapper[delegations.Delegations]), ) def list( @@ -271,7 +271,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[AddressingIpamDelegations, AsyncSinglePage[AddressingIpamDelegations]]: + ) -> AsyncPaginator[delegations.Delegations, AsyncSinglePage[delegations.Delegations]]: """ List all delegations for a given account IP prefix. @@ -294,11 +294,11 @@ def list( raise ValueError(f"Expected a non-empty value for `prefix_id` but received {prefix_id!r}") return self._get_api_list( f"/accounts/{account_id}/addressing/prefixes/{prefix_id}/delegations", - page=AsyncSinglePage[AddressingIpamDelegations], + page=AsyncSinglePage[delegations.Delegations], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=AddressingIpamDelegations, + model=delegations.Delegations, ) async def delete( diff --git a/src/cloudflare/resources/addressing/prefixes/prefixes.py b/src/cloudflare/resources/addressing/prefixes/prefixes.py index 7844e7fab44..c42d1662141 100644 --- a/src/cloudflare/resources/addressing/prefixes/prefixes.py +++ b/src/cloudflare/resources/addressing/prefixes/prefixes.py @@ -43,7 +43,7 @@ make_request_options, ) from ....types.shared import UnnamedSchemaRef67bbb1ccdd42c3e2937b9fd19f791151 -from ....types.addressing import AddressingIpamPrefixes, prefix_edit_params, prefix_create_params, prefix_delete_params +from ....types.addressing import Prefix, prefix_edit_params, prefix_create_params, prefix_delete_params __all__ = ["Prefixes", "AsyncPrefixes"] @@ -78,7 +78,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AddressingIpamPrefixes: + ) -> Prefix: """ Add a new prefix under the account. @@ -118,7 +118,7 @@ def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[AddressingIpamPrefixes], ResultWrapper[AddressingIpamPrefixes]), + cast_to=cast(Type[Prefix], ResultWrapper[Prefix]), ) def list( @@ -131,7 +131,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[AddressingIpamPrefixes]: + ) -> SyncSinglePage[Prefix]: """ List all prefixes owned by the account. @@ -150,11 +150,11 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/addressing/prefixes", - page=SyncSinglePage[AddressingIpamPrefixes], + page=SyncSinglePage[Prefix], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=AddressingIpamPrefixes, + model=Prefix, ) def delete( @@ -220,7 +220,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AddressingIpamPrefixes: + ) -> Prefix: """ Modify the description for a prefix owned by the account. @@ -253,7 +253,7 @@ def edit( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[AddressingIpamPrefixes], ResultWrapper[AddressingIpamPrefixes]), + cast_to=cast(Type[Prefix], ResultWrapper[Prefix]), ) def get( @@ -267,7 +267,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AddressingIpamPrefixes: + ) -> Prefix: """ List a particular prefix owned by the account. @@ -297,7 +297,7 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[AddressingIpamPrefixes], ResultWrapper[AddressingIpamPrefixes]), + cast_to=cast(Type[Prefix], ResultWrapper[Prefix]), ) @@ -331,7 +331,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AddressingIpamPrefixes: + ) -> Prefix: """ Add a new prefix under the account. @@ -371,7 +371,7 @@ async def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[AddressingIpamPrefixes], ResultWrapper[AddressingIpamPrefixes]), + cast_to=cast(Type[Prefix], ResultWrapper[Prefix]), ) def list( @@ -384,7 +384,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[AddressingIpamPrefixes, AsyncSinglePage[AddressingIpamPrefixes]]: + ) -> AsyncPaginator[Prefix, AsyncSinglePage[Prefix]]: """ List all prefixes owned by the account. @@ -403,11 +403,11 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/addressing/prefixes", - page=AsyncSinglePage[AddressingIpamPrefixes], + page=AsyncSinglePage[Prefix], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=AddressingIpamPrefixes, + model=Prefix, ) async def delete( @@ -473,7 +473,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AddressingIpamPrefixes: + ) -> Prefix: """ Modify the description for a prefix owned by the account. @@ -506,7 +506,7 @@ async def edit( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[AddressingIpamPrefixes], ResultWrapper[AddressingIpamPrefixes]), + cast_to=cast(Type[Prefix], ResultWrapper[Prefix]), ) async def get( @@ -520,7 +520,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AddressingIpamPrefixes: + ) -> Prefix: """ List a particular prefix owned by the account. @@ -550,7 +550,7 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[AddressingIpamPrefixes], ResultWrapper[AddressingIpamPrefixes]), + cast_to=cast(Type[Prefix], ResultWrapper[Prefix]), ) diff --git a/src/cloudflare/resources/alerting/__init__.py b/src/cloudflare/resources/alerting/__init__.py index 055626c3866..81f9af833e5 100644 --- a/src/cloudflare/resources/alerting/__init__.py +++ b/src/cloudflare/resources/alerting/__init__.py @@ -1,12 +1,12 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from .history import ( - History, - AsyncHistory, - HistoryWithRawResponse, - AsyncHistoryWithRawResponse, - HistoryWithStreamingResponse, - AsyncHistoryWithStreamingResponse, + HistoryResource, + AsyncHistoryResource, + HistoryResourceWithRawResponse, + AsyncHistoryResourceWithRawResponse, + HistoryResourceWithStreamingResponse, + AsyncHistoryResourceWithStreamingResponse, ) from .alerting import ( Alerting, @@ -54,12 +54,12 @@ "AsyncDestinationsWithRawResponse", "DestinationsWithStreamingResponse", "AsyncDestinationsWithStreamingResponse", - "History", - "AsyncHistory", - "HistoryWithRawResponse", - "AsyncHistoryWithRawResponse", - "HistoryWithStreamingResponse", - "AsyncHistoryWithStreamingResponse", + "HistoryResource", + "AsyncHistoryResource", + "HistoryResourceWithRawResponse", + "AsyncHistoryResourceWithRawResponse", + "HistoryResourceWithStreamingResponse", + "AsyncHistoryResourceWithStreamingResponse", "Policies", "AsyncPolicies", "PoliciesWithRawResponse", diff --git a/src/cloudflare/resources/alerting/alerting.py b/src/cloudflare/resources/alerting/alerting.py index 24e7cc35418..169617e7ffc 100644 --- a/src/cloudflare/resources/alerting/alerting.py +++ b/src/cloudflare/resources/alerting/alerting.py @@ -3,12 +3,12 @@ from __future__ import annotations from .history import ( - History, - AsyncHistory, - HistoryWithRawResponse, - AsyncHistoryWithRawResponse, - HistoryWithStreamingResponse, - AsyncHistoryWithStreamingResponse, + HistoryResource, + AsyncHistoryResource, + HistoryResourceWithRawResponse, + AsyncHistoryResourceWithRawResponse, + HistoryResourceWithStreamingResponse, + AsyncHistoryResourceWithStreamingResponse, ) from .policies import ( Policies, @@ -51,8 +51,8 @@ def destinations(self) -> Destinations: return Destinations(self._client) @cached_property - def history(self) -> History: - return History(self._client) + def history(self) -> HistoryResource: + return HistoryResource(self._client) @cached_property def policies(self) -> Policies: @@ -77,8 +77,8 @@ def destinations(self) -> AsyncDestinations: return AsyncDestinations(self._client) @cached_property - def history(self) -> AsyncHistory: - return AsyncHistory(self._client) + def history(self) -> AsyncHistoryResource: + return AsyncHistoryResource(self._client) @cached_property def policies(self) -> AsyncPolicies: @@ -106,8 +106,8 @@ def destinations(self) -> DestinationsWithRawResponse: return DestinationsWithRawResponse(self._alerting.destinations) @cached_property - def history(self) -> HistoryWithRawResponse: - return HistoryWithRawResponse(self._alerting.history) + def history(self) -> HistoryResourceWithRawResponse: + return HistoryResourceWithRawResponse(self._alerting.history) @cached_property def policies(self) -> PoliciesWithRawResponse: @@ -127,8 +127,8 @@ def destinations(self) -> AsyncDestinationsWithRawResponse: return AsyncDestinationsWithRawResponse(self._alerting.destinations) @cached_property - def history(self) -> AsyncHistoryWithRawResponse: - return AsyncHistoryWithRawResponse(self._alerting.history) + def history(self) -> AsyncHistoryResourceWithRawResponse: + return AsyncHistoryResourceWithRawResponse(self._alerting.history) @cached_property def policies(self) -> AsyncPoliciesWithRawResponse: @@ -148,8 +148,8 @@ def destinations(self) -> DestinationsWithStreamingResponse: return DestinationsWithStreamingResponse(self._alerting.destinations) @cached_property - def history(self) -> HistoryWithStreamingResponse: - return HistoryWithStreamingResponse(self._alerting.history) + def history(self) -> HistoryResourceWithStreamingResponse: + return HistoryResourceWithStreamingResponse(self._alerting.history) @cached_property def policies(self) -> PoliciesWithStreamingResponse: @@ -169,8 +169,8 @@ def destinations(self) -> AsyncDestinationsWithStreamingResponse: return AsyncDestinationsWithStreamingResponse(self._alerting.destinations) @cached_property - def history(self) -> AsyncHistoryWithStreamingResponse: - return AsyncHistoryWithStreamingResponse(self._alerting.history) + def history(self) -> AsyncHistoryResourceWithStreamingResponse: + return AsyncHistoryResourceWithStreamingResponse(self._alerting.history) @cached_property def policies(self) -> AsyncPoliciesWithStreamingResponse: diff --git a/src/cloudflare/resources/alerting/destinations/webhooks.py b/src/cloudflare/resources/alerting/destinations/webhooks.py index def4692982b..f6ed4d29692 100644 --- a/src/cloudflare/resources/alerting/destinations/webhooks.py +++ b/src/cloudflare/resources/alerting/destinations/webhooks.py @@ -27,9 +27,9 @@ ) from ....types.shared import UnnamedSchemaRef67bbb1ccdd42c3e2937b9fd19f791151 from ....types.alerting.destinations import ( - AlertingWebhooks, WebhookCreateResponse, WebhookUpdateResponse, + webhooks, webhook_create_params, webhook_update_params, ) @@ -179,7 +179,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[AlertingWebhooks]: + ) -> SyncSinglePage[webhooks.Webhooks]: """ Gets a list of all configured webhook destinations. @@ -198,11 +198,11 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/alerting/v3/destinations/webhooks", - page=SyncSinglePage[AlertingWebhooks], + page=SyncSinglePage[webhooks.Webhooks], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=AlertingWebhooks, + model=webhooks.Webhooks, ) def delete( @@ -265,7 +265,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AlertingWebhooks: + ) -> webhooks.Webhooks: """ Get details for a single webhooks destination. @@ -295,7 +295,7 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[AlertingWebhooks], ResultWrapper[AlertingWebhooks]), + cast_to=cast(Type[webhooks.Webhooks], ResultWrapper[webhooks.Webhooks]), ) @@ -441,7 +441,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[AlertingWebhooks, AsyncSinglePage[AlertingWebhooks]]: + ) -> AsyncPaginator[webhooks.Webhooks, AsyncSinglePage[webhooks.Webhooks]]: """ Gets a list of all configured webhook destinations. @@ -460,11 +460,11 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/alerting/v3/destinations/webhooks", - page=AsyncSinglePage[AlertingWebhooks], + page=AsyncSinglePage[webhooks.Webhooks], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=AlertingWebhooks, + model=webhooks.Webhooks, ) async def delete( @@ -527,7 +527,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AlertingWebhooks: + ) -> webhooks.Webhooks: """ Get details for a single webhooks destination. @@ -557,7 +557,7 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[AlertingWebhooks], ResultWrapper[AlertingWebhooks]), + cast_to=cast(Type[webhooks.Webhooks], ResultWrapper[webhooks.Webhooks]), ) diff --git a/src/cloudflare/resources/alerting/history.py b/src/cloudflare/resources/alerting/history.py index 9d7bfbb9b2b..aa17818d0eb 100644 --- a/src/cloudflare/resources/alerting/history.py +++ b/src/cloudflare/resources/alerting/history.py @@ -22,19 +22,19 @@ AsyncPaginator, make_request_options, ) -from ...types.alerting import AlertingHistory, history_list_params +from ...types.alerting import History, history_list_params -__all__ = ["History", "AsyncHistory"] +__all__ = ["HistoryResource", "AsyncHistoryResource"] -class History(SyncAPIResource): +class HistoryResource(SyncAPIResource): @cached_property - def with_raw_response(self) -> HistoryWithRawResponse: - return HistoryWithRawResponse(self) + def with_raw_response(self) -> HistoryResourceWithRawResponse: + return HistoryResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> HistoryWithStreamingResponse: - return HistoryWithStreamingResponse(self) + def with_streaming_response(self) -> HistoryResourceWithStreamingResponse: + return HistoryResourceWithStreamingResponse(self) def list( self, @@ -50,7 +50,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncV4PagePaginationArray[AlertingHistory]: + ) -> SyncV4PagePaginationArray[History]: """Gets a list of history records for notifications sent to an account. The records @@ -82,7 +82,7 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/alerting/v3/history", - page=SyncV4PagePaginationArray[AlertingHistory], + page=SyncV4PagePaginationArray[History], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -98,18 +98,18 @@ def list( history_list_params.HistoryListParams, ), ), - model=AlertingHistory, + model=History, ) -class AsyncHistory(AsyncAPIResource): +class AsyncHistoryResource(AsyncAPIResource): @cached_property - def with_raw_response(self) -> AsyncHistoryWithRawResponse: - return AsyncHistoryWithRawResponse(self) + def with_raw_response(self) -> AsyncHistoryResourceWithRawResponse: + return AsyncHistoryResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> AsyncHistoryWithStreamingResponse: - return AsyncHistoryWithStreamingResponse(self) + def with_streaming_response(self) -> AsyncHistoryResourceWithStreamingResponse: + return AsyncHistoryResourceWithStreamingResponse(self) def list( self, @@ -125,7 +125,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[AlertingHistory, AsyncV4PagePaginationArray[AlertingHistory]]: + ) -> AsyncPaginator[History, AsyncV4PagePaginationArray[History]]: """Gets a list of history records for notifications sent to an account. The records @@ -157,7 +157,7 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/alerting/v3/history", - page=AsyncV4PagePaginationArray[AlertingHistory], + page=AsyncV4PagePaginationArray[History], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -173,12 +173,12 @@ def list( history_list_params.HistoryListParams, ), ), - model=AlertingHistory, + model=History, ) -class HistoryWithRawResponse: - def __init__(self, history: History) -> None: +class HistoryResourceWithRawResponse: + def __init__(self, history: HistoryResource) -> None: self._history = history self.list = to_raw_response_wrapper( @@ -186,8 +186,8 @@ def __init__(self, history: History) -> None: ) -class AsyncHistoryWithRawResponse: - def __init__(self, history: AsyncHistory) -> None: +class AsyncHistoryResourceWithRawResponse: + def __init__(self, history: AsyncHistoryResource) -> None: self._history = history self.list = async_to_raw_response_wrapper( @@ -195,8 +195,8 @@ def __init__(self, history: AsyncHistory) -> None: ) -class HistoryWithStreamingResponse: - def __init__(self, history: History) -> None: +class HistoryResourceWithStreamingResponse: + def __init__(self, history: HistoryResource) -> None: self._history = history self.list = to_streamed_response_wrapper( @@ -204,8 +204,8 @@ def __init__(self, history: History) -> None: ) -class AsyncHistoryWithStreamingResponse: - def __init__(self, history: AsyncHistory) -> None: +class AsyncHistoryResourceWithStreamingResponse: + def __init__(self, history: AsyncHistoryResource) -> None: self._history = history self.list = async_to_streamed_response_wrapper( diff --git a/src/cloudflare/resources/alerting/policies.py b/src/cloudflare/resources/alerting/policies.py index 7939e702bf8..f9499a2efd2 100644 --- a/src/cloudflare/resources/alerting/policies.py +++ b/src/cloudflare/resources/alerting/policies.py @@ -28,11 +28,11 @@ ) from ...types.shared import UnnamedSchemaRef67bbb1ccdd42c3e2937b9fd19f791151 from ...types.alerting import ( - FiltersParam, - MechanismsParam, + Policy, + FilterParam, + MechanismParam, PolicyCreateResponse, PolicyUpdateResponse, - policies, policy_create_params, policy_update_params, ) @@ -111,10 +111,10 @@ def create( "zone_aop_custom_certificate_expiration_type", ], enabled: bool, - mechanisms: MechanismsParam, + mechanisms: MechanismParam, name: str, description: str | NotGiven = NOT_GIVEN, - filters: FiltersParam | NotGiven = NOT_GIVEN, + filters: FilterParam | 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, @@ -243,8 +243,8 @@ def update( | NotGiven = NOT_GIVEN, description: str | NotGiven = NOT_GIVEN, enabled: bool | NotGiven = NOT_GIVEN, - filters: FiltersParam | NotGiven = NOT_GIVEN, - mechanisms: MechanismsParam | NotGiven = NOT_GIVEN, + filters: FilterParam | NotGiven = NOT_GIVEN, + mechanisms: MechanismParam | NotGiven = NOT_GIVEN, name: 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. @@ -323,7 +323,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[policies.Policies]: + ) -> SyncSinglePage[Policy]: """ Get a list of all Notification policies. @@ -342,11 +342,11 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/alerting/v3/policies", - page=SyncSinglePage[policies.Policies], + page=SyncSinglePage[Policy], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=policies.Policies, + model=Policy, ) def delete( @@ -409,7 +409,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> policies.Policies: + ) -> Policy: """ Get details for a single policy. @@ -439,7 +439,7 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[policies.Policies], ResultWrapper[policies.Policies]), + cast_to=cast(Type[Policy], ResultWrapper[Policy]), ) @@ -514,10 +514,10 @@ async def create( "zone_aop_custom_certificate_expiration_type", ], enabled: bool, - mechanisms: MechanismsParam, + mechanisms: MechanismParam, name: str, description: str | NotGiven = NOT_GIVEN, - filters: FiltersParam | NotGiven = NOT_GIVEN, + filters: FilterParam | 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, @@ -646,8 +646,8 @@ async def update( | NotGiven = NOT_GIVEN, description: str | NotGiven = NOT_GIVEN, enabled: bool | NotGiven = NOT_GIVEN, - filters: FiltersParam | NotGiven = NOT_GIVEN, - mechanisms: MechanismsParam | NotGiven = NOT_GIVEN, + filters: FilterParam | NotGiven = NOT_GIVEN, + mechanisms: MechanismParam | NotGiven = NOT_GIVEN, name: 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. @@ -726,7 +726,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[policies.Policies, AsyncSinglePage[policies.Policies]]: + ) -> AsyncPaginator[Policy, AsyncSinglePage[Policy]]: """ Get a list of all Notification policies. @@ -745,11 +745,11 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/alerting/v3/policies", - page=AsyncSinglePage[policies.Policies], + page=AsyncSinglePage[Policy], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=policies.Policies, + model=Policy, ) async def delete( @@ -812,7 +812,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> policies.Policies: + ) -> Policy: """ Get details for a single policy. @@ -842,7 +842,7 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[policies.Policies], ResultWrapper[policies.Policies]), + cast_to=cast(Type[Policy], ResultWrapper[Policy]), ) diff --git a/src/cloudflare/resources/brand_protection.py b/src/cloudflare/resources/brand_protection.py index 6bfc0100398..12f0f1a12f3 100644 --- a/src/cloudflare/resources/brand_protection.py +++ b/src/cloudflare/resources/brand_protection.py @@ -6,12 +6,7 @@ import httpx -from ..types import ( - IntelPhishingURLInfo, - IntelPhishingURLSubmit, - brand_protection_submit_params, - brand_protection_url_info_params, -) +from ..types import Info, Submit, brand_protection_submit_params, brand_protection_url_info_params from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven from .._utils import ( maybe_transform, @@ -53,7 +48,7 @@ def submit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> IntelPhishingURLSubmit: + ) -> Submit: """ Submit suspicious URL for scanning @@ -82,7 +77,7 @@ def submit( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[IntelPhishingURLSubmit], ResultWrapper[IntelPhishingURLSubmit]), + cast_to=cast(Type[Submit], ResultWrapper[Submit]), ) def url_info( @@ -97,7 +92,7 @@ def url_info( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> IntelPhishingURLInfo: + ) -> Info: """ Get results for a URL scan @@ -130,7 +125,7 @@ def url_info( ), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[IntelPhishingURLInfo], ResultWrapper[IntelPhishingURLInfo]), + cast_to=cast(Type[Info], ResultWrapper[Info]), ) @@ -154,7 +149,7 @@ async def submit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> IntelPhishingURLSubmit: + ) -> Submit: """ Submit suspicious URL for scanning @@ -183,7 +178,7 @@ async def submit( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[IntelPhishingURLSubmit], ResultWrapper[IntelPhishingURLSubmit]), + cast_to=cast(Type[Submit], ResultWrapper[Submit]), ) async def url_info( @@ -198,7 +193,7 @@ async def url_info( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> IntelPhishingURLInfo: + ) -> Info: """ Get results for a URL scan @@ -231,7 +226,7 @@ async def url_info( ), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[IntelPhishingURLInfo], ResultWrapper[IntelPhishingURLInfo]), + cast_to=cast(Type[Info], ResultWrapper[Info]), ) diff --git a/src/cloudflare/resources/challenges/widgets.py b/src/cloudflare/resources/challenges/widgets.py index 6f594a7932c..812bd140148 100644 --- a/src/cloudflare/resources/challenges/widgets.py +++ b/src/cloudflare/resources/challenges/widgets.py @@ -27,9 +27,9 @@ make_request_options, ) from ...types.challenges import ( - ChallengesWidget, - ChallengesWidgetList, - ChallengesWidgetListItem, + Widget, + WidgetDomain, + WidgetDomainItem, widget_list_params, widget_create_params, widget_update_params, @@ -52,7 +52,7 @@ def create( self, *, account_id: str, - domains: List[ChallengesWidgetListItem], + domains: List[WidgetDomainItem], mode: Literal["non-interactive", "invisible", "managed"], name: str, direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, @@ -69,7 +69,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ChallengesWidget]: + ) -> Optional[Widget]: """ Lists challenge widgets. @@ -140,7 +140,7 @@ def create( ), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[ChallengesWidget]], ResultWrapper[ChallengesWidget]), + cast_to=cast(Type[Optional[Widget]], ResultWrapper[Widget]), ) def update( @@ -148,7 +148,7 @@ def update( sitekey: str, *, account_id: str, - domains: List[ChallengesWidgetListItem], + domains: List[WidgetDomainItem], mode: Literal["non-interactive", "invisible", "managed"], name: str, bot_fight_mode: bool | NotGiven = NOT_GIVEN, @@ -160,7 +160,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ChallengesWidget]: + ) -> Optional[Widget]: """ Update the configuration of a widget. @@ -215,7 +215,7 @@ def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[ChallengesWidget]], ResultWrapper[ChallengesWidget]), + cast_to=cast(Type[Optional[Widget]], ResultWrapper[Widget]), ) def list( @@ -232,7 +232,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncV4PagePaginationArray[ChallengesWidgetList]: + ) -> SyncV4PagePaginationArray[WidgetDomain]: """ Lists all turnstile widgets of an account. @@ -259,7 +259,7 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/challenges/widgets", - page=SyncV4PagePaginationArray[ChallengesWidgetList], + page=SyncV4PagePaginationArray[WidgetDomain], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -275,7 +275,7 @@ def list( widget_list_params.WidgetListParams, ), ), - model=ChallengesWidgetList, + model=WidgetDomain, ) def delete( @@ -289,7 +289,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ChallengesWidget]: + ) -> Optional[Widget]: """ Destroy a Turnstile Widget. @@ -319,7 +319,7 @@ def delete( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[ChallengesWidget]], ResultWrapper[ChallengesWidget]), + cast_to=cast(Type[Optional[Widget]], ResultWrapper[Widget]), ) def get( @@ -333,7 +333,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ChallengesWidget]: + ) -> Optional[Widget]: """ Show a single challenge widget configuration. @@ -363,7 +363,7 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[ChallengesWidget]], ResultWrapper[ChallengesWidget]), + cast_to=cast(Type[Optional[Widget]], ResultWrapper[Widget]), ) def rotate_secret( @@ -378,7 +378,7 @@ def rotate_secret( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ChallengesWidget]: + ) -> Optional[Widget]: """Generate a new secret key for this widget. If `invalidate_immediately` is set to @@ -419,7 +419,7 @@ def rotate_secret( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[ChallengesWidget]], ResultWrapper[ChallengesWidget]), + cast_to=cast(Type[Optional[Widget]], ResultWrapper[Widget]), ) @@ -436,7 +436,7 @@ async def create( self, *, account_id: str, - domains: List[ChallengesWidgetListItem], + domains: List[WidgetDomainItem], mode: Literal["non-interactive", "invisible", "managed"], name: str, direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, @@ -453,7 +453,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ChallengesWidget]: + ) -> Optional[Widget]: """ Lists challenge widgets. @@ -524,7 +524,7 @@ async def create( ), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[ChallengesWidget]], ResultWrapper[ChallengesWidget]), + cast_to=cast(Type[Optional[Widget]], ResultWrapper[Widget]), ) async def update( @@ -532,7 +532,7 @@ async def update( sitekey: str, *, account_id: str, - domains: List[ChallengesWidgetListItem], + domains: List[WidgetDomainItem], mode: Literal["non-interactive", "invisible", "managed"], name: str, bot_fight_mode: bool | NotGiven = NOT_GIVEN, @@ -544,7 +544,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ChallengesWidget]: + ) -> Optional[Widget]: """ Update the configuration of a widget. @@ -599,7 +599,7 @@ async def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[ChallengesWidget]], ResultWrapper[ChallengesWidget]), + cast_to=cast(Type[Optional[Widget]], ResultWrapper[Widget]), ) def list( @@ -616,7 +616,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[ChallengesWidgetList, AsyncV4PagePaginationArray[ChallengesWidgetList]]: + ) -> AsyncPaginator[WidgetDomain, AsyncV4PagePaginationArray[WidgetDomain]]: """ Lists all turnstile widgets of an account. @@ -643,7 +643,7 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/challenges/widgets", - page=AsyncV4PagePaginationArray[ChallengesWidgetList], + page=AsyncV4PagePaginationArray[WidgetDomain], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -659,7 +659,7 @@ def list( widget_list_params.WidgetListParams, ), ), - model=ChallengesWidgetList, + model=WidgetDomain, ) async def delete( @@ -673,7 +673,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ChallengesWidget]: + ) -> Optional[Widget]: """ Destroy a Turnstile Widget. @@ -703,7 +703,7 @@ async def delete( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[ChallengesWidget]], ResultWrapper[ChallengesWidget]), + cast_to=cast(Type[Optional[Widget]], ResultWrapper[Widget]), ) async def get( @@ -717,7 +717,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ChallengesWidget]: + ) -> Optional[Widget]: """ Show a single challenge widget configuration. @@ -747,7 +747,7 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[ChallengesWidget]], ResultWrapper[ChallengesWidget]), + cast_to=cast(Type[Optional[Widget]], ResultWrapper[Widget]), ) async def rotate_secret( @@ -762,7 +762,7 @@ async def rotate_secret( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ChallengesWidget]: + ) -> Optional[Widget]: """Generate a new secret key for this widget. If `invalidate_immediately` is set to @@ -803,7 +803,7 @@ async def rotate_secret( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[ChallengesWidget]], ResultWrapper[ChallengesWidget]), + cast_to=cast(Type[Optional[Widget]], ResultWrapper[Widget]), ) diff --git a/src/cloudflare/resources/cloudforce_one/requests/__init__.py b/src/cloudflare/resources/cloudforce_one/requests/__init__.py index d1d7dd5273e..5dd358e569c 100644 --- a/src/cloudflare/resources/cloudforce_one/requests/__init__.py +++ b/src/cloudflare/resources/cloudforce_one/requests/__init__.py @@ -1,20 +1,20 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from .message import ( - Message, - AsyncMessage, - MessageWithRawResponse, - AsyncMessageWithRawResponse, - MessageWithStreamingResponse, - AsyncMessageWithStreamingResponse, + MessageResource, + AsyncMessageResource, + MessageResourceWithRawResponse, + AsyncMessageResourceWithRawResponse, + MessageResourceWithStreamingResponse, + AsyncMessageResourceWithStreamingResponse, ) from .priority import ( - Priority, - AsyncPriority, - PriorityWithRawResponse, - AsyncPriorityWithRawResponse, - PriorityWithStreamingResponse, - AsyncPriorityWithStreamingResponse, + PriorityResource, + AsyncPriorityResource, + PriorityResourceWithRawResponse, + AsyncPriorityResourceWithRawResponse, + PriorityResourceWithStreamingResponse, + AsyncPriorityResourceWithStreamingResponse, ) from .requests import ( Requests, @@ -26,18 +26,18 @@ ) __all__ = [ - "Message", - "AsyncMessage", - "MessageWithRawResponse", - "AsyncMessageWithRawResponse", - "MessageWithStreamingResponse", - "AsyncMessageWithStreamingResponse", - "Priority", - "AsyncPriority", - "PriorityWithRawResponse", - "AsyncPriorityWithRawResponse", - "PriorityWithStreamingResponse", - "AsyncPriorityWithStreamingResponse", + "MessageResource", + "AsyncMessageResource", + "MessageResourceWithRawResponse", + "AsyncMessageResourceWithRawResponse", + "MessageResourceWithStreamingResponse", + "AsyncMessageResourceWithStreamingResponse", + "PriorityResource", + "AsyncPriorityResource", + "PriorityResourceWithRawResponse", + "AsyncPriorityResourceWithRawResponse", + "PriorityResourceWithStreamingResponse", + "AsyncPriorityResourceWithStreamingResponse", "Requests", "AsyncRequests", "RequestsWithRawResponse", diff --git a/src/cloudflare/resources/cloudforce_one/requests/message.py b/src/cloudflare/resources/cloudforce_one/requests/message.py index ca2d2f9dccd..49c3ac654b0 100644 --- a/src/cloudflare/resources/cloudforce_one/requests/message.py +++ b/src/cloudflare/resources/cloudforce_one/requests/message.py @@ -27,24 +27,24 @@ ) from ....types.shared import UnnamedSchemaRefEc4d85c3d1bcc6b3b7e99c199ae99846 from ....types.cloudforce_one.requests import ( + Message, MessageGetResponse, - CloudforceOneRequestMessageItem, message_get_params, message_create_params, message_update_params, ) -__all__ = ["Message", "AsyncMessage"] +__all__ = ["MessageResource", "AsyncMessageResource"] -class Message(SyncAPIResource): +class MessageResource(SyncAPIResource): @cached_property - def with_raw_response(self) -> MessageWithRawResponse: - return MessageWithRawResponse(self) + def with_raw_response(self) -> MessageResourceWithRawResponse: + return MessageResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> MessageWithStreamingResponse: - return MessageWithStreamingResponse(self) + def with_streaming_response(self) -> MessageResourceWithStreamingResponse: + return MessageResourceWithStreamingResponse(self) def create( self, @@ -58,7 +58,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CloudforceOneRequestMessageItem: + ) -> Message: """ Creating a request adds the request into the Cloudforce One queue for analysis. In addition to the content, a short title, type, priority, and releasability @@ -93,7 +93,7 @@ def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[CloudforceOneRequestMessageItem], ResultWrapper[CloudforceOneRequestMessageItem]), + cast_to=cast(Type[Message], ResultWrapper[Message]), ) def update( @@ -113,7 +113,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CloudforceOneRequestMessageItem: + ) -> Message: """ Update a Request Message @@ -163,7 +163,7 @@ def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[CloudforceOneRequestMessageItem], ResultWrapper[CloudforceOneRequestMessageItem]), + cast_to=cast(Type[Message], ResultWrapper[Message]), ) def delete( @@ -290,14 +290,14 @@ def get( ) -class AsyncMessage(AsyncAPIResource): +class AsyncMessageResource(AsyncAPIResource): @cached_property - def with_raw_response(self) -> AsyncMessageWithRawResponse: - return AsyncMessageWithRawResponse(self) + def with_raw_response(self) -> AsyncMessageResourceWithRawResponse: + return AsyncMessageResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> AsyncMessageWithStreamingResponse: - return AsyncMessageWithStreamingResponse(self) + def with_streaming_response(self) -> AsyncMessageResourceWithStreamingResponse: + return AsyncMessageResourceWithStreamingResponse(self) async def create( self, @@ -311,7 +311,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CloudforceOneRequestMessageItem: + ) -> Message: """ Creating a request adds the request into the Cloudforce One queue for analysis. In addition to the content, a short title, type, priority, and releasability @@ -346,7 +346,7 @@ async def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[CloudforceOneRequestMessageItem], ResultWrapper[CloudforceOneRequestMessageItem]), + cast_to=cast(Type[Message], ResultWrapper[Message]), ) async def update( @@ -366,7 +366,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CloudforceOneRequestMessageItem: + ) -> Message: """ Update a Request Message @@ -416,7 +416,7 @@ async def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[CloudforceOneRequestMessageItem], ResultWrapper[CloudforceOneRequestMessageItem]), + cast_to=cast(Type[Message], ResultWrapper[Message]), ) async def delete( @@ -543,8 +543,8 @@ async def get( ) -class MessageWithRawResponse: - def __init__(self, message: Message) -> None: +class MessageResourceWithRawResponse: + def __init__(self, message: MessageResource) -> None: self._message = message self.create = to_raw_response_wrapper( @@ -561,8 +561,8 @@ def __init__(self, message: Message) -> None: ) -class AsyncMessageWithRawResponse: - def __init__(self, message: AsyncMessage) -> None: +class AsyncMessageResourceWithRawResponse: + def __init__(self, message: AsyncMessageResource) -> None: self._message = message self.create = async_to_raw_response_wrapper( @@ -579,8 +579,8 @@ def __init__(self, message: AsyncMessage) -> None: ) -class MessageWithStreamingResponse: - def __init__(self, message: Message) -> None: +class MessageResourceWithStreamingResponse: + def __init__(self, message: MessageResource) -> None: self._message = message self.create = to_streamed_response_wrapper( @@ -597,8 +597,8 @@ def __init__(self, message: Message) -> None: ) -class AsyncMessageWithStreamingResponse: - def __init__(self, message: AsyncMessage) -> None: +class AsyncMessageResourceWithStreamingResponse: + def __init__(self, message: AsyncMessageResource) -> None: self._message = message self.create = async_to_streamed_response_wrapper( diff --git a/src/cloudflare/resources/cloudforce_one/requests/priority.py b/src/cloudflare/resources/cloudforce_one/requests/priority.py index 76b7eabea30..aa4c0be0cf0 100644 --- a/src/cloudflare/resources/cloudforce_one/requests/priority.py +++ b/src/cloudflare/resources/cloudforce_one/requests/priority.py @@ -25,26 +25,26 @@ make_request_options, ) from ....types.shared import UnnamedSchemaRefEc4d85c3d1bcc6b3b7e99c199ae99846 -from ....types.cloudforce_one import CloudforceOneQuota, CloudforceOneRequestItem -from ....types.cloudforce_one.requests import CloudforceOnePriorityItem, priority_create_params, priority_update_params +from ....types.cloudforce_one import Item, Quota +from ....types.cloudforce_one.requests import Priority, LabelItem, priority_create_params, priority_update_params -__all__ = ["Priority", "AsyncPriority"] +__all__ = ["PriorityResource", "AsyncPriorityResource"] -class Priority(SyncAPIResource): +class PriorityResource(SyncAPIResource): @cached_property - def with_raw_response(self) -> PriorityWithRawResponse: - return PriorityWithRawResponse(self) + def with_raw_response(self) -> PriorityResourceWithRawResponse: + return PriorityResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> PriorityWithStreamingResponse: - return PriorityWithStreamingResponse(self) + def with_streaming_response(self) -> PriorityResourceWithStreamingResponse: + return PriorityResourceWithStreamingResponse(self) def create( self, account_identifier: str, *, - labels: List[str], + labels: List[LabelItem], priority: int, requirement: str, tlp: Literal["clear", "amber", "amber-strict", "green", "red"], @@ -54,7 +54,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CloudforceOnePriorityItem: + ) -> Priority: """ Create a New Priority Requirement @@ -97,7 +97,7 @@ def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[CloudforceOnePriorityItem], ResultWrapper[CloudforceOnePriorityItem]), + cast_to=cast(Type[Priority], ResultWrapper[Priority]), ) def update( @@ -105,7 +105,7 @@ def update( priority_identifer: str, *, account_identifier: str, - labels: List[str], + labels: List[LabelItem], priority: int, requirement: str, tlp: Literal["clear", "amber", "amber-strict", "green", "red"], @@ -115,7 +115,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CloudforceOneRequestItem: + ) -> Item: """ Update a Priority Intelligence Requirement @@ -162,7 +162,7 @@ def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[CloudforceOneRequestItem], ResultWrapper[CloudforceOneRequestItem]), + cast_to=cast(Type[Item], ResultWrapper[Item]), ) def delete( @@ -225,7 +225,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CloudforceOneRequestItem: + ) -> Item: """ Get a Priority Intelligence Requirement @@ -255,7 +255,7 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[CloudforceOneRequestItem], ResultWrapper[CloudforceOneRequestItem]), + cast_to=cast(Type[Item], ResultWrapper[Item]), ) def quota( @@ -268,7 +268,7 @@ def quota( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CloudforceOneQuota: + ) -> Quota: """ Get Priority Intelligence Requirement Quota @@ -294,24 +294,24 @@ def quota( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[CloudforceOneQuota], ResultWrapper[CloudforceOneQuota]), + cast_to=cast(Type[Quota], ResultWrapper[Quota]), ) -class AsyncPriority(AsyncAPIResource): +class AsyncPriorityResource(AsyncAPIResource): @cached_property - def with_raw_response(self) -> AsyncPriorityWithRawResponse: - return AsyncPriorityWithRawResponse(self) + def with_raw_response(self) -> AsyncPriorityResourceWithRawResponse: + return AsyncPriorityResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> AsyncPriorityWithStreamingResponse: - return AsyncPriorityWithStreamingResponse(self) + def with_streaming_response(self) -> AsyncPriorityResourceWithStreamingResponse: + return AsyncPriorityResourceWithStreamingResponse(self) async def create( self, account_identifier: str, *, - labels: List[str], + labels: List[LabelItem], priority: int, requirement: str, tlp: Literal["clear", "amber", "amber-strict", "green", "red"], @@ -321,7 +321,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CloudforceOnePriorityItem: + ) -> Priority: """ Create a New Priority Requirement @@ -364,7 +364,7 @@ async def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[CloudforceOnePriorityItem], ResultWrapper[CloudforceOnePriorityItem]), + cast_to=cast(Type[Priority], ResultWrapper[Priority]), ) async def update( @@ -372,7 +372,7 @@ async def update( priority_identifer: str, *, account_identifier: str, - labels: List[str], + labels: List[LabelItem], priority: int, requirement: str, tlp: Literal["clear", "amber", "amber-strict", "green", "red"], @@ -382,7 +382,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CloudforceOneRequestItem: + ) -> Item: """ Update a Priority Intelligence Requirement @@ -429,7 +429,7 @@ async def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[CloudforceOneRequestItem], ResultWrapper[CloudforceOneRequestItem]), + cast_to=cast(Type[Item], ResultWrapper[Item]), ) async def delete( @@ -492,7 +492,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CloudforceOneRequestItem: + ) -> Item: """ Get a Priority Intelligence Requirement @@ -522,7 +522,7 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[CloudforceOneRequestItem], ResultWrapper[CloudforceOneRequestItem]), + cast_to=cast(Type[Item], ResultWrapper[Item]), ) async def quota( @@ -535,7 +535,7 @@ async def quota( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CloudforceOneQuota: + ) -> Quota: """ Get Priority Intelligence Requirement Quota @@ -561,12 +561,12 @@ async def quota( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[CloudforceOneQuota], ResultWrapper[CloudforceOneQuota]), + cast_to=cast(Type[Quota], ResultWrapper[Quota]), ) -class PriorityWithRawResponse: - def __init__(self, priority: Priority) -> None: +class PriorityResourceWithRawResponse: + def __init__(self, priority: PriorityResource) -> None: self._priority = priority self.create = to_raw_response_wrapper( @@ -586,8 +586,8 @@ def __init__(self, priority: Priority) -> None: ) -class AsyncPriorityWithRawResponse: - def __init__(self, priority: AsyncPriority) -> None: +class AsyncPriorityResourceWithRawResponse: + def __init__(self, priority: AsyncPriorityResource) -> None: self._priority = priority self.create = async_to_raw_response_wrapper( @@ -607,8 +607,8 @@ def __init__(self, priority: AsyncPriority) -> None: ) -class PriorityWithStreamingResponse: - def __init__(self, priority: Priority) -> None: +class PriorityResourceWithStreamingResponse: + def __init__(self, priority: PriorityResource) -> None: self._priority = priority self.create = to_streamed_response_wrapper( @@ -628,8 +628,8 @@ def __init__(self, priority: Priority) -> None: ) -class AsyncPriorityWithStreamingResponse: - def __init__(self, priority: AsyncPriority) -> None: +class AsyncPriorityResourceWithStreamingResponse: + def __init__(self, priority: AsyncPriorityResource) -> None: self._priority = priority self.create = async_to_streamed_response_wrapper( diff --git a/src/cloudflare/resources/cloudforce_one/requests/requests.py b/src/cloudflare/resources/cloudforce_one/requests/requests.py index cc623d1a55f..f3b1eeafd91 100644 --- a/src/cloudflare/resources/cloudforce_one/requests/requests.py +++ b/src/cloudflare/resources/cloudforce_one/requests/requests.py @@ -9,20 +9,20 @@ import httpx from .message import ( - Message, - AsyncMessage, - MessageWithRawResponse, - AsyncMessageWithRawResponse, - MessageWithStreamingResponse, - AsyncMessageWithStreamingResponse, + MessageResource, + AsyncMessageResource, + MessageResourceWithRawResponse, + AsyncMessageResourceWithRawResponse, + MessageResourceWithStreamingResponse, + AsyncMessageResourceWithStreamingResponse, ) from .priority import ( - Priority, - AsyncPriority, - PriorityWithRawResponse, - AsyncPriorityWithRawResponse, - PriorityWithStreamingResponse, - AsyncPriorityWithStreamingResponse, + PriorityResource, + AsyncPriorityResource, + PriorityResourceWithRawResponse, + AsyncPriorityResourceWithRawResponse, + PriorityResourceWithStreamingResponse, + AsyncPriorityResourceWithStreamingResponse, ) from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ...._utils import ( @@ -45,11 +45,11 @@ ) from ....types.shared import UnnamedSchemaRefEc4d85c3d1bcc6b3b7e99c199ae99846 from ....types.cloudforce_one import ( - CloudforceOneQuota, - CloudforceOneRequestItem, - CloudforceOneRequestTypes, - CloudforceOneRequestListItem, - CloudforceOneRequestConstants, + Item, + Quota, + ListItem, + RequestTypes, + RequestConstants, request_list_params, request_create_params, request_update_params, @@ -60,12 +60,12 @@ class Requests(SyncAPIResource): @cached_property - def message(self) -> Message: - return Message(self._client) + def message(self) -> MessageResource: + return MessageResource(self._client) @cached_property - def priority(self) -> Priority: - return Priority(self._client) + def priority(self) -> PriorityResource: + return PriorityResource(self._client) @cached_property def with_raw_response(self) -> RequestsWithRawResponse: @@ -90,7 +90,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CloudforceOneRequestItem: + ) -> Item: """ Creating a request adds the request into the Cloudforce One queue for analysis. In addition to the content, a short title, type, priority, and releasability @@ -138,7 +138,7 @@ def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[CloudforceOneRequestItem], ResultWrapper[CloudforceOneRequestItem]), + cast_to=cast(Type[Item], ResultWrapper[Item]), ) def update( @@ -157,7 +157,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CloudforceOneRequestItem: + ) -> Item: """Updating a request alters the request in the Cloudforce One queue. This API may @@ -210,7 +210,7 @@ def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[CloudforceOneRequestItem], ResultWrapper[CloudforceOneRequestItem]), + cast_to=cast(Type[Item], ResultWrapper[Item]), ) def list( @@ -233,7 +233,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncV4PagePaginationArray[CloudforceOneRequestListItem]: + ) -> SyncV4PagePaginationArray[ListItem]: """ List Requests @@ -272,7 +272,7 @@ def list( raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") return self._get_api_list( f"/accounts/{account_identifier}/cloudforce-one/requests", - page=SyncV4PagePaginationArray[CloudforceOneRequestListItem], + page=SyncV4PagePaginationArray[ListItem], body=maybe_transform( { "page": page, @@ -291,7 +291,7 @@ def list( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=CloudforceOneRequestListItem, + model=ListItem, method="post", ) @@ -354,7 +354,7 @@ def constants( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CloudforceOneRequestConstants: + ) -> RequestConstants: """ Get Request Priority, Status, and TLP constants @@ -380,7 +380,7 @@ def constants( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[CloudforceOneRequestConstants], ResultWrapper[CloudforceOneRequestConstants]), + cast_to=cast(Type[RequestConstants], ResultWrapper[RequestConstants]), ) def get( @@ -394,7 +394,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CloudforceOneRequestItem: + ) -> Item: """ Get a Request @@ -424,7 +424,7 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[CloudforceOneRequestItem], ResultWrapper[CloudforceOneRequestItem]), + cast_to=cast(Type[Item], ResultWrapper[Item]), ) def quota( @@ -437,7 +437,7 @@ def quota( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CloudforceOneQuota: + ) -> Quota: """ Get Request Quota @@ -463,7 +463,7 @@ def quota( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[CloudforceOneQuota], ResultWrapper[CloudforceOneQuota]), + cast_to=cast(Type[Quota], ResultWrapper[Quota]), ) def types( @@ -476,7 +476,7 @@ def types( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CloudforceOneRequestTypes: + ) -> RequestTypes: """ Get Request Types @@ -502,18 +502,18 @@ def types( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[CloudforceOneRequestTypes], ResultWrapper[CloudforceOneRequestTypes]), + cast_to=cast(Type[RequestTypes], ResultWrapper[RequestTypes]), ) class AsyncRequests(AsyncAPIResource): @cached_property - def message(self) -> AsyncMessage: - return AsyncMessage(self._client) + def message(self) -> AsyncMessageResource: + return AsyncMessageResource(self._client) @cached_property - def priority(self) -> AsyncPriority: - return AsyncPriority(self._client) + def priority(self) -> AsyncPriorityResource: + return AsyncPriorityResource(self._client) @cached_property def with_raw_response(self) -> AsyncRequestsWithRawResponse: @@ -538,7 +538,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CloudforceOneRequestItem: + ) -> Item: """ Creating a request adds the request into the Cloudforce One queue for analysis. In addition to the content, a short title, type, priority, and releasability @@ -586,7 +586,7 @@ async def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[CloudforceOneRequestItem], ResultWrapper[CloudforceOneRequestItem]), + cast_to=cast(Type[Item], ResultWrapper[Item]), ) async def update( @@ -605,7 +605,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CloudforceOneRequestItem: + ) -> Item: """Updating a request alters the request in the Cloudforce One queue. This API may @@ -658,7 +658,7 @@ async def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[CloudforceOneRequestItem], ResultWrapper[CloudforceOneRequestItem]), + cast_to=cast(Type[Item], ResultWrapper[Item]), ) def list( @@ -681,7 +681,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[CloudforceOneRequestListItem, AsyncV4PagePaginationArray[CloudforceOneRequestListItem]]: + ) -> AsyncPaginator[ListItem, AsyncV4PagePaginationArray[ListItem]]: """ List Requests @@ -720,7 +720,7 @@ def list( raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") return self._get_api_list( f"/accounts/{account_identifier}/cloudforce-one/requests", - page=AsyncV4PagePaginationArray[CloudforceOneRequestListItem], + page=AsyncV4PagePaginationArray[ListItem], body=maybe_transform( { "page": page, @@ -739,7 +739,7 @@ def list( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=CloudforceOneRequestListItem, + model=ListItem, method="post", ) @@ -802,7 +802,7 @@ async def constants( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CloudforceOneRequestConstants: + ) -> RequestConstants: """ Get Request Priority, Status, and TLP constants @@ -828,7 +828,7 @@ async def constants( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[CloudforceOneRequestConstants], ResultWrapper[CloudforceOneRequestConstants]), + cast_to=cast(Type[RequestConstants], ResultWrapper[RequestConstants]), ) async def get( @@ -842,7 +842,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CloudforceOneRequestItem: + ) -> Item: """ Get a Request @@ -872,7 +872,7 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[CloudforceOneRequestItem], ResultWrapper[CloudforceOneRequestItem]), + cast_to=cast(Type[Item], ResultWrapper[Item]), ) async def quota( @@ -885,7 +885,7 @@ async def quota( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CloudforceOneQuota: + ) -> Quota: """ Get Request Quota @@ -911,7 +911,7 @@ async def quota( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[CloudforceOneQuota], ResultWrapper[CloudforceOneQuota]), + cast_to=cast(Type[Quota], ResultWrapper[Quota]), ) async def types( @@ -924,7 +924,7 @@ async def types( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CloudforceOneRequestTypes: + ) -> RequestTypes: """ Get Request Types @@ -950,7 +950,7 @@ async def types( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[CloudforceOneRequestTypes], ResultWrapper[CloudforceOneRequestTypes]), + cast_to=cast(Type[RequestTypes], ResultWrapper[RequestTypes]), ) @@ -984,12 +984,12 @@ def __init__(self, requests: Requests) -> None: ) @cached_property - def message(self) -> MessageWithRawResponse: - return MessageWithRawResponse(self._requests.message) + def message(self) -> MessageResourceWithRawResponse: + return MessageResourceWithRawResponse(self._requests.message) @cached_property - def priority(self) -> PriorityWithRawResponse: - return PriorityWithRawResponse(self._requests.priority) + def priority(self) -> PriorityResourceWithRawResponse: + return PriorityResourceWithRawResponse(self._requests.priority) class AsyncRequestsWithRawResponse: @@ -1022,12 +1022,12 @@ def __init__(self, requests: AsyncRequests) -> None: ) @cached_property - def message(self) -> AsyncMessageWithRawResponse: - return AsyncMessageWithRawResponse(self._requests.message) + def message(self) -> AsyncMessageResourceWithRawResponse: + return AsyncMessageResourceWithRawResponse(self._requests.message) @cached_property - def priority(self) -> AsyncPriorityWithRawResponse: - return AsyncPriorityWithRawResponse(self._requests.priority) + def priority(self) -> AsyncPriorityResourceWithRawResponse: + return AsyncPriorityResourceWithRawResponse(self._requests.priority) class RequestsWithStreamingResponse: @@ -1060,12 +1060,12 @@ def __init__(self, requests: Requests) -> None: ) @cached_property - def message(self) -> MessageWithStreamingResponse: - return MessageWithStreamingResponse(self._requests.message) + def message(self) -> MessageResourceWithStreamingResponse: + return MessageResourceWithStreamingResponse(self._requests.message) @cached_property - def priority(self) -> PriorityWithStreamingResponse: - return PriorityWithStreamingResponse(self._requests.priority) + def priority(self) -> PriorityResourceWithStreamingResponse: + return PriorityResourceWithStreamingResponse(self._requests.priority) class AsyncRequestsWithStreamingResponse: @@ -1098,9 +1098,9 @@ def __init__(self, requests: AsyncRequests) -> None: ) @cached_property - def message(self) -> AsyncMessageWithStreamingResponse: - return AsyncMessageWithStreamingResponse(self._requests.message) + def message(self) -> AsyncMessageResourceWithStreamingResponse: + return AsyncMessageResourceWithStreamingResponse(self._requests.message) @cached_property - def priority(self) -> AsyncPriorityWithStreamingResponse: - return AsyncPriorityWithStreamingResponse(self._requests.priority) + def priority(self) -> AsyncPriorityResourceWithStreamingResponse: + return AsyncPriorityResourceWithStreamingResponse(self._requests.priority) diff --git a/src/cloudflare/resources/custom_hostnames/custom_hostnames.py b/src/cloudflare/resources/custom_hostnames/custom_hostnames.py index 8df996166ac..7a934e04304 100644 --- a/src/cloudflare/resources/custom_hostnames/custom_hostnames.py +++ b/src/cloudflare/resources/custom_hostnames/custom_hostnames.py @@ -8,10 +8,7 @@ import httpx from ...types import ( - CustomHostnameGetResponse, - CustomHostnameEditResponse, - CustomHostnameListResponse, - CustomHostnameCreateResponse, + CustomHostname, custom_hostname_edit_params, custom_hostname_list_params, custom_hostname_create_params, @@ -75,7 +72,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CustomHostnameCreateResponse: + ) -> CustomHostname: """ Add a new custom hostname and request that an SSL certificate be issued for it. One of three validation methods—http, txt, email—should be used, with 'http' @@ -121,7 +118,7 @@ def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[CustomHostnameCreateResponse], ResultWrapper[CustomHostnameCreateResponse]), + cast_to=cast(Type[CustomHostname], ResultWrapper[CustomHostname]), ) def list( @@ -141,7 +138,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncV4PagePaginationArray[CustomHostnameListResponse]: + ) -> SyncV4PagePaginationArray[CustomHostname]: """ List, search, sort, and filter all of your custom hostnames. @@ -177,7 +174,7 @@ def list( raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get_api_list( f"/zones/{zone_id}/custom_hostnames", - page=SyncV4PagePaginationArray[CustomHostnameListResponse], + page=SyncV4PagePaginationArray[CustomHostname], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -196,7 +193,7 @@ def list( custom_hostname_list_params.CustomHostnameListParams, ), ), - model=CustomHostnameListResponse, + model=CustomHostname, ) def delete( @@ -256,7 +253,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CustomHostnameEditResponse: + ) -> CustomHostname: """Modify SSL configuration for a custom hostname. When sent with SSL config that @@ -312,7 +309,7 @@ def edit( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[CustomHostnameEditResponse], ResultWrapper[CustomHostnameEditResponse]), + cast_to=cast(Type[CustomHostname], ResultWrapper[CustomHostname]), ) def get( @@ -326,7 +323,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CustomHostnameGetResponse: + ) -> CustomHostname: """ Custom Hostname Details @@ -356,7 +353,7 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[CustomHostnameGetResponse], ResultWrapper[CustomHostnameGetResponse]), + cast_to=cast(Type[CustomHostname], ResultWrapper[CustomHostname]), ) @@ -386,7 +383,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CustomHostnameCreateResponse: + ) -> CustomHostname: """ Add a new custom hostname and request that an SSL certificate be issued for it. One of three validation methods—http, txt, email—should be used, with 'http' @@ -432,7 +429,7 @@ async def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[CustomHostnameCreateResponse], ResultWrapper[CustomHostnameCreateResponse]), + cast_to=cast(Type[CustomHostname], ResultWrapper[CustomHostname]), ) def list( @@ -452,7 +449,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[CustomHostnameListResponse, AsyncV4PagePaginationArray[CustomHostnameListResponse]]: + ) -> AsyncPaginator[CustomHostname, AsyncV4PagePaginationArray[CustomHostname]]: """ List, search, sort, and filter all of your custom hostnames. @@ -488,7 +485,7 @@ def list( raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get_api_list( f"/zones/{zone_id}/custom_hostnames", - page=AsyncV4PagePaginationArray[CustomHostnameListResponse], + page=AsyncV4PagePaginationArray[CustomHostname], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -507,7 +504,7 @@ def list( custom_hostname_list_params.CustomHostnameListParams, ), ), - model=CustomHostnameListResponse, + model=CustomHostname, ) async def delete( @@ -567,7 +564,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CustomHostnameEditResponse: + ) -> CustomHostname: """Modify SSL configuration for a custom hostname. When sent with SSL config that @@ -623,7 +620,7 @@ async def edit( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[CustomHostnameEditResponse], ResultWrapper[CustomHostnameEditResponse]), + cast_to=cast(Type[CustomHostname], ResultWrapper[CustomHostname]), ) async def get( @@ -637,7 +634,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CustomHostnameGetResponse: + ) -> CustomHostname: """ Custom Hostname Details @@ -667,7 +664,7 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[CustomHostnameGetResponse], ResultWrapper[CustomHostnameGetResponse]), + cast_to=cast(Type[CustomHostname], ResultWrapper[CustomHostname]), ) diff --git a/src/cloudflare/resources/d1/__init__.py b/src/cloudflare/resources/d1/__init__.py index e2fbaa90f75..5d31a056646 100644 --- a/src/cloudflare/resources/d1/__init__.py +++ b/src/cloudflare/resources/d1/__init__.py @@ -1,12 +1,12 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from .d1 import ( - D1, - AsyncD1, - D1WithRawResponse, - AsyncD1WithRawResponse, - D1WithStreamingResponse, - AsyncD1WithStreamingResponse, + D1Resource, + AsyncD1Resource, + D1ResourceWithRawResponse, + AsyncD1ResourceWithRawResponse, + D1ResourceWithStreamingResponse, + AsyncD1ResourceWithStreamingResponse, ) from .database import ( Database, @@ -24,10 +24,10 @@ "AsyncDatabaseWithRawResponse", "DatabaseWithStreamingResponse", "AsyncDatabaseWithStreamingResponse", - "D1", - "AsyncD1", - "D1WithRawResponse", - "AsyncD1WithRawResponse", - "D1WithStreamingResponse", - "AsyncD1WithStreamingResponse", + "D1Resource", + "AsyncD1Resource", + "D1ResourceWithRawResponse", + "AsyncD1ResourceWithRawResponse", + "D1ResourceWithStreamingResponse", + "AsyncD1ResourceWithStreamingResponse", ] diff --git a/src/cloudflare/resources/d1/d1.py b/src/cloudflare/resources/d1/d1.py index 7c5263013fd..445bd0fcccf 100644 --- a/src/cloudflare/resources/d1/d1.py +++ b/src/cloudflare/resources/d1/d1.py @@ -13,39 +13,39 @@ from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource -__all__ = ["D1", "AsyncD1"] +__all__ = ["D1Resource", "AsyncD1Resource"] -class D1(SyncAPIResource): +class D1Resource(SyncAPIResource): @cached_property def database(self) -> Database: return Database(self._client) @cached_property - def with_raw_response(self) -> D1WithRawResponse: - return D1WithRawResponse(self) + def with_raw_response(self) -> D1ResourceWithRawResponse: + return D1ResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> D1WithStreamingResponse: - return D1WithStreamingResponse(self) + def with_streaming_response(self) -> D1ResourceWithStreamingResponse: + return D1ResourceWithStreamingResponse(self) -class AsyncD1(AsyncAPIResource): +class AsyncD1Resource(AsyncAPIResource): @cached_property def database(self) -> AsyncDatabase: return AsyncDatabase(self._client) @cached_property - def with_raw_response(self) -> AsyncD1WithRawResponse: - return AsyncD1WithRawResponse(self) + def with_raw_response(self) -> AsyncD1ResourceWithRawResponse: + return AsyncD1ResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> AsyncD1WithStreamingResponse: - return AsyncD1WithStreamingResponse(self) + def with_streaming_response(self) -> AsyncD1ResourceWithStreamingResponse: + return AsyncD1ResourceWithStreamingResponse(self) -class D1WithRawResponse: - def __init__(self, d1: D1) -> None: +class D1ResourceWithRawResponse: + def __init__(self, d1: D1Resource) -> None: self._d1 = d1 @cached_property @@ -53,8 +53,8 @@ def database(self) -> DatabaseWithRawResponse: return DatabaseWithRawResponse(self._d1.database) -class AsyncD1WithRawResponse: - def __init__(self, d1: AsyncD1) -> None: +class AsyncD1ResourceWithRawResponse: + def __init__(self, d1: AsyncD1Resource) -> None: self._d1 = d1 @cached_property @@ -62,8 +62,8 @@ def database(self) -> AsyncDatabaseWithRawResponse: return AsyncDatabaseWithRawResponse(self._d1.database) -class D1WithStreamingResponse: - def __init__(self, d1: D1) -> None: +class D1ResourceWithStreamingResponse: + def __init__(self, d1: D1Resource) -> None: self._d1 = d1 @cached_property @@ -71,8 +71,8 @@ def database(self) -> DatabaseWithStreamingResponse: return DatabaseWithStreamingResponse(self._d1.database) -class AsyncD1WithStreamingResponse: - def __init__(self, d1: AsyncD1) -> None: +class AsyncD1ResourceWithStreamingResponse: + def __init__(self, d1: AsyncD1Resource) -> None: self._d1 = d1 @cached_property diff --git a/src/cloudflare/resources/d1/database.py b/src/cloudflare/resources/d1/database.py index 3961a6bc193..516a55c90a9 100644 --- a/src/cloudflare/resources/d1/database.py +++ b/src/cloudflare/resources/d1/database.py @@ -6,6 +6,7 @@ import httpx +from ...types import D1 from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( maybe_transform, @@ -13,9 +14,9 @@ ) from ..._compat import cached_property from ...types.d1 import ( - D1CreateDatabase, - D1DatabaseDetails, + DatabaseListResponse, DatabaseQueryResponse, + DatabaseCreateResponse, database_list_params, database_query_params, database_create_params, @@ -58,7 +59,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> D1CreateDatabase: + ) -> DatabaseCreateResponse: """ Returns the created D1 database. @@ -85,7 +86,7 @@ def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[D1CreateDatabase], ResultWrapper[D1CreateDatabase]), + cast_to=cast(Type[DatabaseCreateResponse], ResultWrapper[DatabaseCreateResponse]), ) def list( @@ -101,7 +102,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncV4PagePaginationArray[D1CreateDatabase]: + ) -> SyncV4PagePaginationArray[DatabaseListResponse]: """ Returns a list of D1 databases. @@ -126,7 +127,7 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/d1/database", - page=SyncV4PagePaginationArray[D1CreateDatabase], + page=SyncV4PagePaginationArray[DatabaseListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -141,7 +142,7 @@ def list( database_list_params.DatabaseListParams, ), ), - model=D1CreateDatabase, + model=DatabaseListResponse, ) def delete( @@ -204,7 +205,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> D1DatabaseDetails: + ) -> D1: """ Returns the specified D1 database. @@ -234,7 +235,7 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[D1DatabaseDetails], ResultWrapper[D1DatabaseDetails]), + cast_to=cast(Type[D1], ResultWrapper[D1]), ) def query( @@ -311,7 +312,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> D1CreateDatabase: + ) -> DatabaseCreateResponse: """ Returns the created D1 database. @@ -338,7 +339,7 @@ async def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[D1CreateDatabase], ResultWrapper[D1CreateDatabase]), + cast_to=cast(Type[DatabaseCreateResponse], ResultWrapper[DatabaseCreateResponse]), ) def list( @@ -354,7 +355,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[D1CreateDatabase, AsyncV4PagePaginationArray[D1CreateDatabase]]: + ) -> AsyncPaginator[DatabaseListResponse, AsyncV4PagePaginationArray[DatabaseListResponse]]: """ Returns a list of D1 databases. @@ -379,7 +380,7 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/d1/database", - page=AsyncV4PagePaginationArray[D1CreateDatabase], + page=AsyncV4PagePaginationArray[DatabaseListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -394,7 +395,7 @@ def list( database_list_params.DatabaseListParams, ), ), - model=D1CreateDatabase, + model=DatabaseListResponse, ) async def delete( @@ -457,7 +458,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> D1DatabaseDetails: + ) -> D1: """ Returns the specified D1 database. @@ -487,7 +488,7 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[D1DatabaseDetails], ResultWrapper[D1DatabaseDetails]), + cast_to=cast(Type[D1], ResultWrapper[D1]), ) async def query( diff --git a/src/cloudflare/resources/dns/__init__.py b/src/cloudflare/resources/dns/__init__.py index bec5b418f44..3a2befc7254 100644 --- a/src/cloudflare/resources/dns/__init__.py +++ b/src/cloudflare/resources/dns/__init__.py @@ -17,12 +17,12 @@ AsyncRecordsWithStreamingResponse, ) from .firewall import ( - Firewall, - AsyncFirewall, - FirewallWithRawResponse, - AsyncFirewallWithRawResponse, - FirewallWithStreamingResponse, - AsyncFirewallWithStreamingResponse, + FirewallResource, + AsyncFirewallResource, + FirewallResourceWithRawResponse, + AsyncFirewallResourceWithRawResponse, + FirewallResourceWithStreamingResponse, + AsyncFirewallResourceWithStreamingResponse, ) from .analytics import ( Analytics, @@ -46,12 +46,12 @@ "AsyncAnalyticsWithRawResponse", "AnalyticsWithStreamingResponse", "AsyncAnalyticsWithStreamingResponse", - "Firewall", - "AsyncFirewall", - "FirewallWithRawResponse", - "AsyncFirewallWithRawResponse", - "FirewallWithStreamingResponse", - "AsyncFirewallWithStreamingResponse", + "FirewallResource", + "AsyncFirewallResource", + "FirewallResourceWithRawResponse", + "AsyncFirewallResourceWithRawResponse", + "FirewallResourceWithStreamingResponse", + "AsyncFirewallResourceWithStreamingResponse", "DNS", "AsyncDNS", "DNSWithRawResponse", diff --git a/src/cloudflare/resources/dns/analytics/reports/bytimes.py b/src/cloudflare/resources/dns/analytics/reports/bytimes.py index 7e04d625393..e228c82e87d 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 DNSAnalyticsReportByTime, bytime_get_params +from .....types.dns.analytics.reports import ByTime, bytime_get_params __all__ = ["Bytimes", "AsyncBytimes"] @@ -58,7 +58,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DNSAnalyticsReportByTime: + ) -> ByTime: """ Retrieves a list of aggregate metrics grouped by time interval. @@ -118,7 +118,7 @@ def get( ), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[DNSAnalyticsReportByTime], ResultWrapper[DNSAnalyticsReportByTime]), + cast_to=cast(Type[ByTime], ResultWrapper[ByTime]), ) @@ -150,7 +150,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DNSAnalyticsReportByTime: + ) -> ByTime: """ Retrieves a list of aggregate metrics grouped by time interval. @@ -210,7 +210,7 @@ async def get( ), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[DNSAnalyticsReportByTime], ResultWrapper[DNSAnalyticsReportByTime]), + cast_to=cast(Type[ByTime], ResultWrapper[ByTime]), ) diff --git a/src/cloudflare/resources/dns/analytics/reports/reports.py b/src/cloudflare/resources/dns/analytics/reports/reports.py index 0a1f0f1716c..bd4f7e91bd7 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 DNSAnalyticsReport, report_get_params +from .....types.dns.analytics import Report, report_get_params __all__ = ["Reports", "AsyncReports"] @@ -67,7 +67,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DNSAnalyticsReport: + ) -> Report: """ Retrieves a list of summarised aggregate metrics over a given time period. @@ -124,7 +124,7 @@ def get( ), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[DNSAnalyticsReport], ResultWrapper[DNSAnalyticsReport]), + cast_to=cast(Type[Report], ResultWrapper[Report]), ) @@ -158,7 +158,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DNSAnalyticsReport: + ) -> Report: """ Retrieves a list of summarised aggregate metrics over a given time period. @@ -215,7 +215,7 @@ async def get( ), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[DNSAnalyticsReport], ResultWrapper[DNSAnalyticsReport]), + cast_to=cast(Type[Report], ResultWrapper[Report]), ) diff --git a/src/cloudflare/resources/dns/dns.py b/src/cloudflare/resources/dns/dns.py index 9107057d3d0..a57b310be04 100644 --- a/src/cloudflare/resources/dns/dns.py +++ b/src/cloudflare/resources/dns/dns.py @@ -11,12 +11,12 @@ AsyncRecordsWithStreamingResponse, ) from .firewall import ( - Firewall, - AsyncFirewall, - FirewallWithRawResponse, - AsyncFirewallWithRawResponse, - FirewallWithStreamingResponse, - AsyncFirewallWithStreamingResponse, + FirewallResource, + AsyncFirewallResource, + FirewallResourceWithRawResponse, + AsyncFirewallResourceWithRawResponse, + FirewallResourceWithStreamingResponse, + AsyncFirewallResourceWithStreamingResponse, ) from ..._compat import cached_property from .analytics import ( @@ -28,7 +28,7 @@ AsyncAnalyticsWithStreamingResponse, ) from ..._resource import SyncAPIResource, AsyncAPIResource -from .firewall.firewall import Firewall, AsyncFirewall +from .firewall.firewall import FirewallResource, AsyncFirewallResource from .analytics.analytics import Analytics, AsyncAnalytics __all__ = ["DNS", "AsyncDNS"] @@ -44,8 +44,8 @@ def analytics(self) -> Analytics: return Analytics(self._client) @cached_property - def firewall(self) -> Firewall: - return Firewall(self._client) + def firewall(self) -> FirewallResource: + return FirewallResource(self._client) @cached_property def with_raw_response(self) -> DNSWithRawResponse: @@ -66,8 +66,8 @@ def analytics(self) -> AsyncAnalytics: return AsyncAnalytics(self._client) @cached_property - def firewall(self) -> AsyncFirewall: - return AsyncFirewall(self._client) + def firewall(self) -> AsyncFirewallResource: + return AsyncFirewallResource(self._client) @cached_property def with_raw_response(self) -> AsyncDNSWithRawResponse: @@ -91,8 +91,8 @@ def analytics(self) -> AnalyticsWithRawResponse: return AnalyticsWithRawResponse(self._dns.analytics) @cached_property - def firewall(self) -> FirewallWithRawResponse: - return FirewallWithRawResponse(self._dns.firewall) + def firewall(self) -> FirewallResourceWithRawResponse: + return FirewallResourceWithRawResponse(self._dns.firewall) class AsyncDNSWithRawResponse: @@ -108,8 +108,8 @@ def analytics(self) -> AsyncAnalyticsWithRawResponse: return AsyncAnalyticsWithRawResponse(self._dns.analytics) @cached_property - def firewall(self) -> AsyncFirewallWithRawResponse: - return AsyncFirewallWithRawResponse(self._dns.firewall) + def firewall(self) -> AsyncFirewallResourceWithRawResponse: + return AsyncFirewallResourceWithRawResponse(self._dns.firewall) class DNSWithStreamingResponse: @@ -125,8 +125,8 @@ def analytics(self) -> AnalyticsWithStreamingResponse: return AnalyticsWithStreamingResponse(self._dns.analytics) @cached_property - def firewall(self) -> FirewallWithStreamingResponse: - return FirewallWithStreamingResponse(self._dns.firewall) + def firewall(self) -> FirewallResourceWithStreamingResponse: + return FirewallResourceWithStreamingResponse(self._dns.firewall) class AsyncDNSWithStreamingResponse: @@ -142,5 +142,5 @@ def analytics(self) -> AsyncAnalyticsWithStreamingResponse: return AsyncAnalyticsWithStreamingResponse(self._dns.analytics) @cached_property - def firewall(self) -> AsyncFirewallWithStreamingResponse: - return AsyncFirewallWithStreamingResponse(self._dns.firewall) + def firewall(self) -> AsyncFirewallResourceWithStreamingResponse: + return AsyncFirewallResourceWithStreamingResponse(self._dns.firewall) diff --git a/src/cloudflare/resources/dns/firewall/__init__.py b/src/cloudflare/resources/dns/firewall/__init__.py index f2d282ba943..a79f372cfa4 100644 --- a/src/cloudflare/resources/dns/firewall/__init__.py +++ b/src/cloudflare/resources/dns/firewall/__init__.py @@ -1,12 +1,12 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from .firewall import ( - Firewall, - AsyncFirewall, - FirewallWithRawResponse, - AsyncFirewallWithRawResponse, - FirewallWithStreamingResponse, - AsyncFirewallWithStreamingResponse, + FirewallResource, + AsyncFirewallResource, + FirewallResourceWithRawResponse, + AsyncFirewallResourceWithRawResponse, + FirewallResourceWithStreamingResponse, + AsyncFirewallResourceWithStreamingResponse, ) from .analytics import ( Analytics, @@ -24,10 +24,10 @@ "AsyncAnalyticsWithRawResponse", "AnalyticsWithStreamingResponse", "AsyncAnalyticsWithStreamingResponse", - "Firewall", - "AsyncFirewall", - "FirewallWithRawResponse", - "AsyncFirewallWithRawResponse", - "FirewallWithStreamingResponse", - "AsyncFirewallWithStreamingResponse", + "FirewallResource", + "AsyncFirewallResource", + "FirewallResourceWithRawResponse", + "AsyncFirewallResourceWithRawResponse", + "FirewallResourceWithStreamingResponse", + "AsyncFirewallResourceWithStreamingResponse", ] diff --git a/src/cloudflare/resources/dns/firewall/analytics/reports/bytimes.py b/src/cloudflare/resources/dns/firewall/analytics/reports/bytimes.py index a86961c5b7b..8f85b980eed 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.analytics.reports import DNSAnalyticsReportByTime +from ......types.dns.analytics.reports import ByTime from ......types.dns.firewall.analytics.reports import bytime_get_params __all__ = ["Bytimes", "AsyncBytimes"] @@ -60,7 +60,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DNSAnalyticsReportByTime: + ) -> ByTime: """ Retrieves a list of aggregate metrics grouped by time interval. @@ -124,7 +124,7 @@ def get( ), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[DNSAnalyticsReportByTime], ResultWrapper[DNSAnalyticsReportByTime]), + cast_to=cast(Type[ByTime], ResultWrapper[ByTime]), ) @@ -157,7 +157,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DNSAnalyticsReportByTime: + ) -> ByTime: """ Retrieves a list of aggregate metrics grouped by time interval. @@ -221,7 +221,7 @@ async def get( ), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[DNSAnalyticsReportByTime], ResultWrapper[DNSAnalyticsReportByTime]), + cast_to=cast(Type[ByTime], ResultWrapper[ByTime]), ) diff --git a/src/cloudflare/resources/dns/firewall/analytics/reports/reports.py b/src/cloudflare/resources/dns/firewall/analytics/reports/reports.py index e21dbc531ac..5dd9b793eb8 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.analytics import DNSAnalyticsReport +from ......types.dns.analytics import Report from ......types.dns.firewall.analytics import report_get_params __all__ = ["Reports", "AsyncReports"] @@ -69,7 +69,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DNSAnalyticsReport: + ) -> Report: """ Retrieves a list of summarised aggregate metrics over a given time period. @@ -130,7 +130,7 @@ def get( ), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[DNSAnalyticsReport], ResultWrapper[DNSAnalyticsReport]), + cast_to=cast(Type[Report], ResultWrapper[Report]), ) @@ -165,7 +165,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DNSAnalyticsReport: + ) -> Report: """ Retrieves a list of summarised aggregate metrics over a given time period. @@ -226,7 +226,7 @@ async def get( ), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[DNSAnalyticsReport], ResultWrapper[DNSAnalyticsReport]), + cast_to=cast(Type[Report], ResultWrapper[Report]), ) diff --git a/src/cloudflare/resources/dns/firewall/firewall.py b/src/cloudflare/resources/dns/firewall/firewall.py index 4f61ad6f09a..b3b2fa22a50 100644 --- a/src/cloudflare/resources/dns/firewall/firewall.py +++ b/src/cloudflare/resources/dns/firewall/firewall.py @@ -29,7 +29,7 @@ ) from ...._wrappers import ResultWrapper from ....types.dns import ( - DNSFirewall, + Firewall, FirewallIPsItemParam, AttackMitigationParam, UpstreamIPsItemsParam, @@ -46,21 +46,21 @@ ) from .analytics.analytics import Analytics, AsyncAnalytics -__all__ = ["Firewall", "AsyncFirewall"] +__all__ = ["FirewallResource", "AsyncFirewallResource"] -class Firewall(SyncAPIResource): +class FirewallResource(SyncAPIResource): @cached_property def analytics(self) -> Analytics: return Analytics(self._client) @cached_property - def with_raw_response(self) -> FirewallWithRawResponse: - return FirewallWithRawResponse(self) + def with_raw_response(self) -> FirewallResourceWithRawResponse: + return FirewallResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> FirewallWithStreamingResponse: - return FirewallWithStreamingResponse(self) + def with_streaming_response(self) -> FirewallResourceWithStreamingResponse: + return FirewallResourceWithStreamingResponse(self) def create( self, @@ -82,7 +82,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DNSFirewall: + ) -> Firewall: """ Create a configured DNS Firewall Cluster. @@ -143,7 +143,7 @@ def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[DNSFirewall], ResultWrapper[DNSFirewall]), + cast_to=cast(Type[Firewall], ResultWrapper[Firewall]), ) def list( @@ -158,7 +158,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncV4PagePaginationArray[DNSFirewall]: + ) -> SyncV4PagePaginationArray[Firewall]: """ List configured DNS Firewall clusters for an account. @@ -181,7 +181,7 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/dns_firewall", - page=SyncV4PagePaginationArray[DNSFirewall], + page=SyncV4PagePaginationArray[Firewall], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -195,7 +195,7 @@ def list( firewall_list_params.FirewallListParams, ), ), - model=DNSFirewall, + model=Firewall, ) def delete( @@ -266,7 +266,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DNSFirewall: + ) -> Firewall: """ Modify a DNS Firewall Cluster configuration. @@ -332,7 +332,7 @@ def edit( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[DNSFirewall], ResultWrapper[DNSFirewall]), + cast_to=cast(Type[Firewall], ResultWrapper[Firewall]), ) def get( @@ -346,7 +346,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DNSFirewall: + ) -> Firewall: """ Show a single configured DNS Firewall cluster for an account. @@ -376,22 +376,22 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[DNSFirewall], ResultWrapper[DNSFirewall]), + cast_to=cast(Type[Firewall], ResultWrapper[Firewall]), ) -class AsyncFirewall(AsyncAPIResource): +class AsyncFirewallResource(AsyncAPIResource): @cached_property def analytics(self) -> AsyncAnalytics: return AsyncAnalytics(self._client) @cached_property - def with_raw_response(self) -> AsyncFirewallWithRawResponse: - return AsyncFirewallWithRawResponse(self) + def with_raw_response(self) -> AsyncFirewallResourceWithRawResponse: + return AsyncFirewallResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> AsyncFirewallWithStreamingResponse: - return AsyncFirewallWithStreamingResponse(self) + def with_streaming_response(self) -> AsyncFirewallResourceWithStreamingResponse: + return AsyncFirewallResourceWithStreamingResponse(self) async def create( self, @@ -413,7 +413,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DNSFirewall: + ) -> Firewall: """ Create a configured DNS Firewall Cluster. @@ -474,7 +474,7 @@ async def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[DNSFirewall], ResultWrapper[DNSFirewall]), + cast_to=cast(Type[Firewall], ResultWrapper[Firewall]), ) def list( @@ -489,7 +489,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[DNSFirewall, AsyncV4PagePaginationArray[DNSFirewall]]: + ) -> AsyncPaginator[Firewall, AsyncV4PagePaginationArray[Firewall]]: """ List configured DNS Firewall clusters for an account. @@ -512,7 +512,7 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/dns_firewall", - page=AsyncV4PagePaginationArray[DNSFirewall], + page=AsyncV4PagePaginationArray[Firewall], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -526,7 +526,7 @@ def list( firewall_list_params.FirewallListParams, ), ), - model=DNSFirewall, + model=Firewall, ) async def delete( @@ -597,7 +597,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DNSFirewall: + ) -> Firewall: """ Modify a DNS Firewall Cluster configuration. @@ -663,7 +663,7 @@ async def edit( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[DNSFirewall], ResultWrapper[DNSFirewall]), + cast_to=cast(Type[Firewall], ResultWrapper[Firewall]), ) async def get( @@ -677,7 +677,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DNSFirewall: + ) -> Firewall: """ Show a single configured DNS Firewall cluster for an account. @@ -707,12 +707,12 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[DNSFirewall], ResultWrapper[DNSFirewall]), + cast_to=cast(Type[Firewall], ResultWrapper[Firewall]), ) -class FirewallWithRawResponse: - def __init__(self, firewall: Firewall) -> None: +class FirewallResourceWithRawResponse: + def __init__(self, firewall: FirewallResource) -> None: self._firewall = firewall self.create = to_raw_response_wrapper( @@ -736,8 +736,8 @@ def analytics(self) -> AnalyticsWithRawResponse: return AnalyticsWithRawResponse(self._firewall.analytics) -class AsyncFirewallWithRawResponse: - def __init__(self, firewall: AsyncFirewall) -> None: +class AsyncFirewallResourceWithRawResponse: + def __init__(self, firewall: AsyncFirewallResource) -> None: self._firewall = firewall self.create = async_to_raw_response_wrapper( @@ -761,8 +761,8 @@ def analytics(self) -> AsyncAnalyticsWithRawResponse: return AsyncAnalyticsWithRawResponse(self._firewall.analytics) -class FirewallWithStreamingResponse: - def __init__(self, firewall: Firewall) -> None: +class FirewallResourceWithStreamingResponse: + def __init__(self, firewall: FirewallResource) -> None: self._firewall = firewall self.create = to_streamed_response_wrapper( @@ -786,8 +786,8 @@ def analytics(self) -> AnalyticsWithStreamingResponse: return AnalyticsWithStreamingResponse(self._firewall.analytics) -class AsyncFirewallWithStreamingResponse: - def __init__(self, firewall: AsyncFirewall) -> None: +class AsyncFirewallResourceWithStreamingResponse: + def __init__(self, firewall: AsyncFirewallResource) -> None: self._firewall = firewall self.create = async_to_streamed_response_wrapper( diff --git a/src/cloudflare/resources/durable_objects/namespaces/namespaces.py b/src/cloudflare/resources/durable_objects/namespaces/namespaces.py index a46939676e7..86abe9b9665 100644 --- a/src/cloudflare/resources/durable_objects/namespaces/namespaces.py +++ b/src/cloudflare/resources/durable_objects/namespaces/namespaces.py @@ -26,7 +26,7 @@ AsyncPaginator, make_request_options, ) -from ....types.durable_objects import DurableObjectNamespace +from ....types.durable_objects import Namespace __all__ = ["Namespaces", "AsyncNamespaces"] @@ -54,7 +54,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[DurableObjectNamespace]: + ) -> SyncSinglePage[Namespace]: """ Returns the Durable Object namespaces owned by an account. @@ -73,11 +73,11 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/workers/durable_objects/namespaces", - page=SyncSinglePage[DurableObjectNamespace], + page=SyncSinglePage[Namespace], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=DurableObjectNamespace, + model=Namespace, ) @@ -104,7 +104,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[DurableObjectNamespace, AsyncSinglePage[DurableObjectNamespace]]: + ) -> AsyncPaginator[Namespace, AsyncSinglePage[Namespace]]: """ Returns the Durable Object namespaces owned by an account. @@ -123,11 +123,11 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/workers/durable_objects/namespaces", - page=AsyncSinglePage[DurableObjectNamespace], + page=AsyncSinglePage[Namespace], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=DurableObjectNamespace, + model=Namespace, ) diff --git a/src/cloudflare/resources/email_routing/addresses.py b/src/cloudflare/resources/email_routing/addresses.py index 20370e1b2b1..2341ffcd553 100644 --- a/src/cloudflare/resources/email_routing/addresses.py +++ b/src/cloudflare/resources/email_routing/addresses.py @@ -26,7 +26,7 @@ AsyncPaginator, make_request_options, ) -from ...types.email_routing import DestinationAddress, address_list_params, address_create_params +from ...types.email_routing import Address, address_list_params, address_create_params __all__ = ["Addresses", "AsyncAddresses"] @@ -51,7 +51,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DestinationAddress: + ) -> Address: """Create a destination address to forward your emails to. Destination addresses @@ -82,7 +82,7 @@ def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[DestinationAddress], ResultWrapper[DestinationAddress]), + cast_to=cast(Type[Address], ResultWrapper[Address]), ) def list( @@ -99,7 +99,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncV4PagePaginationArray[DestinationAddress]: + ) -> SyncV4PagePaginationArray[Address]: """ Lists existing destination addresses. @@ -126,7 +126,7 @@ def list( raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") return self._get_api_list( f"/accounts/{account_identifier}/email/routing/addresses", - page=SyncV4PagePaginationArray[DestinationAddress], + page=SyncV4PagePaginationArray[Address], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -142,7 +142,7 @@ def list( address_list_params.AddressListParams, ), ), - model=DestinationAddress, + model=Address, ) def delete( @@ -156,7 +156,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DestinationAddress: + ) -> Address: """ Deletes a specific destination address. @@ -188,7 +188,7 @@ def delete( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[DestinationAddress], ResultWrapper[DestinationAddress]), + cast_to=cast(Type[Address], ResultWrapper[Address]), ) def get( @@ -202,7 +202,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DestinationAddress: + ) -> Address: """ Gets information for a specific destination email already created. @@ -234,7 +234,7 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[DestinationAddress], ResultWrapper[DestinationAddress]), + cast_to=cast(Type[Address], ResultWrapper[Address]), ) @@ -258,7 +258,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DestinationAddress: + ) -> Address: """Create a destination address to forward your emails to. Destination addresses @@ -289,7 +289,7 @@ async def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[DestinationAddress], ResultWrapper[DestinationAddress]), + cast_to=cast(Type[Address], ResultWrapper[Address]), ) def list( @@ -306,7 +306,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[DestinationAddress, AsyncV4PagePaginationArray[DestinationAddress]]: + ) -> AsyncPaginator[Address, AsyncV4PagePaginationArray[Address]]: """ Lists existing destination addresses. @@ -333,7 +333,7 @@ def list( raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") return self._get_api_list( f"/accounts/{account_identifier}/email/routing/addresses", - page=AsyncV4PagePaginationArray[DestinationAddress], + page=AsyncV4PagePaginationArray[Address], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -349,7 +349,7 @@ def list( address_list_params.AddressListParams, ), ), - model=DestinationAddress, + model=Address, ) async def delete( @@ -363,7 +363,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DestinationAddress: + ) -> Address: """ Deletes a specific destination address. @@ -395,7 +395,7 @@ async def delete( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[DestinationAddress], ResultWrapper[DestinationAddress]), + cast_to=cast(Type[Address], ResultWrapper[Address]), ) async def get( @@ -409,7 +409,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DestinationAddress: + ) -> Address: """ Gets information for a specific destination email already created. @@ -441,7 +441,7 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[DestinationAddress], ResultWrapper[DestinationAddress]), + cast_to=cast(Type[Address], ResultWrapper[Address]), ) diff --git a/src/cloudflare/resources/email_routing/email_routing.py b/src/cloudflare/resources/email_routing/email_routing.py index 7868034517a..5636c839f42 100644 --- a/src/cloudflare/resources/email_routing/email_routing.py +++ b/src/cloudflare/resources/email_routing/email_routing.py @@ -22,7 +22,7 @@ RulesWithStreamingResponse, AsyncRulesWithStreamingResponse, ) -from ...types import EmailSettings, email_routing_enable_params, email_routing_disable_params +from ...types import Settings, email_routing_enable_params, email_routing_disable_params from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( maybe_transform, @@ -85,7 +85,7 @@ def disable( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> EmailSettings: + ) -> Settings: """Disable your Email Routing zone. Also removes additional MX records previously @@ -114,7 +114,7 @@ def disable( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[EmailSettings], ResultWrapper[EmailSettings]), + cast_to=cast(Type[Settings], ResultWrapper[Settings]), ) def enable( @@ -128,7 +128,7 @@ def enable( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> EmailSettings: + ) -> Settings: """Enable you Email Routing zone. Add and lock the necessary MX and SPF records. @@ -156,7 +156,7 @@ def enable( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[EmailSettings], ResultWrapper[EmailSettings]), + cast_to=cast(Type[Settings], ResultWrapper[Settings]), ) def get( @@ -169,7 +169,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> EmailSettings: + ) -> Settings: """ Get information about the settings for your Email Routing zone. @@ -195,7 +195,7 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[EmailSettings], ResultWrapper[EmailSettings]), + cast_to=cast(Type[Settings], ResultWrapper[Settings]), ) @@ -231,7 +231,7 @@ async def disable( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> EmailSettings: + ) -> Settings: """Disable your Email Routing zone. Also removes additional MX records previously @@ -260,7 +260,7 @@ async def disable( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[EmailSettings], ResultWrapper[EmailSettings]), + cast_to=cast(Type[Settings], ResultWrapper[Settings]), ) async def enable( @@ -274,7 +274,7 @@ async def enable( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> EmailSettings: + ) -> Settings: """Enable you Email Routing zone. Add and lock the necessary MX and SPF records. @@ -302,7 +302,7 @@ async def enable( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[EmailSettings], ResultWrapper[EmailSettings]), + cast_to=cast(Type[Settings], ResultWrapper[Settings]), ) async def get( @@ -315,7 +315,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> EmailSettings: + ) -> Settings: """ Get information about the settings for your Email Routing zone. @@ -341,7 +341,7 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[EmailSettings], ResultWrapper[EmailSettings]), + cast_to=cast(Type[Settings], ResultWrapper[Settings]), ) diff --git a/src/cloudflare/resources/email_routing/rules/catch_alls.py b/src/cloudflare/resources/email_routing/rules/catch_alls.py index 368e4515c89..13471d10142 100644 --- a/src/cloudflare/resources/email_routing/rules/catch_alls.py +++ b/src/cloudflare/resources/email_routing/rules/catch_alls.py @@ -24,7 +24,13 @@ from ...._base_client import ( make_request_options, ) -from ....types.email_routing.rules import ActionParam, MatcherParam, EmailCatchAllRule, catch_all_update_params +from ....types.email_routing.rules import ( + CatchAllActionParam, + CatchAllGetResponse, + CatchAllMatcherParam, + CatchAllUpdateResponse, + catch_all_update_params, +) __all__ = ["CatchAlls", "AsyncCatchAlls"] @@ -42,8 +48,8 @@ def update( self, zone_identifier: str, *, - actions: Iterable[ActionParam], - matchers: Iterable[MatcherParam], + actions: Iterable[CatchAllActionParam], + matchers: Iterable[CatchAllMatcherParam], enabled: Literal[True, False] | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -52,7 +58,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> EmailCatchAllRule: + ) -> CatchAllUpdateResponse: """ Enable or disable catch-all routing rule, or change action to forward to specific destination address. @@ -96,7 +102,7 @@ def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[EmailCatchAllRule], ResultWrapper[EmailCatchAllRule]), + cast_to=cast(Type[CatchAllUpdateResponse], ResultWrapper[CatchAllUpdateResponse]), ) def get( @@ -109,7 +115,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> EmailCatchAllRule: + ) -> CatchAllGetResponse: """ Get information on the default catch-all routing rule. @@ -135,7 +141,7 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[EmailCatchAllRule], ResultWrapper[EmailCatchAllRule]), + cast_to=cast(Type[CatchAllGetResponse], ResultWrapper[CatchAllGetResponse]), ) @@ -152,8 +158,8 @@ async def update( self, zone_identifier: str, *, - actions: Iterable[ActionParam], - matchers: Iterable[MatcherParam], + actions: Iterable[CatchAllActionParam], + matchers: Iterable[CatchAllMatcherParam], enabled: Literal[True, False] | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -162,7 +168,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> EmailCatchAllRule: + ) -> CatchAllUpdateResponse: """ Enable or disable catch-all routing rule, or change action to forward to specific destination address. @@ -206,7 +212,7 @@ async def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[EmailCatchAllRule], ResultWrapper[EmailCatchAllRule]), + cast_to=cast(Type[CatchAllUpdateResponse], ResultWrapper[CatchAllUpdateResponse]), ) async def get( @@ -219,7 +225,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> EmailCatchAllRule: + ) -> CatchAllGetResponse: """ Get information on the default catch-all routing rule. @@ -245,7 +251,7 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[EmailCatchAllRule], ResultWrapper[EmailCatchAllRule]), + cast_to=cast(Type[CatchAllGetResponse], ResultWrapper[CatchAllGetResponse]), ) diff --git a/src/cloudflare/resources/email_routing/rules/rules.py b/src/cloudflare/resources/email_routing/rules/rules.py index f6df8dfc380..f93d725b0ea 100644 --- a/src/cloudflare/resources/email_routing/rules/rules.py +++ b/src/cloudflare/resources/email_routing/rules/rules.py @@ -35,11 +35,9 @@ make_request_options, ) from ....types.email_routing import ( - Properties, + EmailRule, ActionParam, MatcherParam, - ActionItemParam, - MatcherItemParam, rule_list_params, rule_create_params, rule_update_params, @@ -76,7 +74,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Properties: + ) -> EmailRule: """ Rules consist of a set of criteria for matching emails (such as an email being sent to a specific custom email address) plus a set of actions to take on the @@ -124,7 +122,7 @@ def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Properties], ResultWrapper[Properties]), + cast_to=cast(Type[EmailRule], ResultWrapper[EmailRule]), ) def update( @@ -132,8 +130,8 @@ def update( rule_identifier: str, *, zone_identifier: str, - actions: Iterable[ActionItemParam], - matchers: Iterable[MatcherItemParam], + actions: Iterable[ActionParam], + matchers: Iterable[MatcherParam], enabled: Literal[True, False] | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, priority: float | NotGiven = NOT_GIVEN, @@ -143,7 +141,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Properties: + ) -> EmailRule: """ Update actions and matches, or enable/disable specific routing rules. @@ -193,7 +191,7 @@ def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Properties], ResultWrapper[Properties]), + cast_to=cast(Type[EmailRule], ResultWrapper[EmailRule]), ) def list( @@ -209,7 +207,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncV4PagePaginationArray[Properties]: + ) -> SyncV4PagePaginationArray[EmailRule]: """ Lists existing routing rules. @@ -234,7 +232,7 @@ def list( raise ValueError(f"Expected a non-empty value for `zone_identifier` but received {zone_identifier!r}") return self._get_api_list( f"/zones/{zone_identifier}/email/routing/rules", - page=SyncV4PagePaginationArray[Properties], + page=SyncV4PagePaginationArray[EmailRule], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -249,7 +247,7 @@ def list( rule_list_params.RuleListParams, ), ), - model=Properties, + model=EmailRule, ) def delete( @@ -263,7 +261,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Properties: + ) -> EmailRule: """ Delete a specific routing rule. @@ -293,7 +291,7 @@ def delete( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Properties], ResultWrapper[Properties]), + cast_to=cast(Type[EmailRule], ResultWrapper[EmailRule]), ) def get( @@ -307,7 +305,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Properties: + ) -> EmailRule: """ Get information for a specific routing rule already created. @@ -337,7 +335,7 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Properties], ResultWrapper[Properties]), + cast_to=cast(Type[EmailRule], ResultWrapper[EmailRule]), ) @@ -369,7 +367,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Properties: + ) -> EmailRule: """ Rules consist of a set of criteria for matching emails (such as an email being sent to a specific custom email address) plus a set of actions to take on the @@ -417,7 +415,7 @@ async def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Properties], ResultWrapper[Properties]), + cast_to=cast(Type[EmailRule], ResultWrapper[EmailRule]), ) async def update( @@ -425,8 +423,8 @@ async def update( rule_identifier: str, *, zone_identifier: str, - actions: Iterable[ActionItemParam], - matchers: Iterable[MatcherItemParam], + actions: Iterable[ActionParam], + matchers: Iterable[MatcherParam], enabled: Literal[True, False] | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, priority: float | NotGiven = NOT_GIVEN, @@ -436,7 +434,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Properties: + ) -> EmailRule: """ Update actions and matches, or enable/disable specific routing rules. @@ -486,7 +484,7 @@ async def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Properties], ResultWrapper[Properties]), + cast_to=cast(Type[EmailRule], ResultWrapper[EmailRule]), ) def list( @@ -502,7 +500,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[Properties, AsyncV4PagePaginationArray[Properties]]: + ) -> AsyncPaginator[EmailRule, AsyncV4PagePaginationArray[EmailRule]]: """ Lists existing routing rules. @@ -527,7 +525,7 @@ def list( raise ValueError(f"Expected a non-empty value for `zone_identifier` but received {zone_identifier!r}") return self._get_api_list( f"/zones/{zone_identifier}/email/routing/rules", - page=AsyncV4PagePaginationArray[Properties], + page=AsyncV4PagePaginationArray[EmailRule], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -542,7 +540,7 @@ def list( rule_list_params.RuleListParams, ), ), - model=Properties, + model=EmailRule, ) async def delete( @@ -556,7 +554,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Properties: + ) -> EmailRule: """ Delete a specific routing rule. @@ -586,7 +584,7 @@ async def delete( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Properties], ResultWrapper[Properties]), + cast_to=cast(Type[EmailRule], ResultWrapper[EmailRule]), ) async def get( @@ -600,7 +598,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Properties: + ) -> EmailRule: """ Get information for a specific routing rule already created. @@ -630,7 +628,7 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Properties], ResultWrapper[Properties]), + cast_to=cast(Type[EmailRule], ResultWrapper[EmailRule]), ) diff --git a/src/cloudflare/resources/filters.py b/src/cloudflare/resources/filters.py index 4ac01f05cfa..257d44d0267 100644 --- a/src/cloudflare/resources/filters.py +++ b/src/cloudflare/resources/filters.py @@ -7,8 +7,11 @@ import httpx from ..types import ( - FirewallFilter, + FilterGetResponse, + FilterListResponse, FilterCreateResponse, + FilterDeleteResponse, + FilterUpdateResponse, filter_list_params, filter_create_params, filter_delete_params, @@ -99,7 +102,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[FirewallFilter]: + ) -> FilterUpdateResponse: """ Updates an existing filter. @@ -130,7 +133,7 @@ def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[FirewallFilter]], ResultWrapper[FirewallFilter]), + cast_to=cast(Type[FilterUpdateResponse], ResultWrapper[FilterUpdateResponse]), ) def list( @@ -150,7 +153,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncV4PagePaginationArray[FirewallFilter]: + ) -> SyncV4PagePaginationArray[FilterListResponse]: """Fetches filters in a zone. You can filter the results using several optional @@ -185,7 +188,7 @@ def list( raise ValueError(f"Expected a non-empty value for `zone_identifier` but received {zone_identifier!r}") return self._get_api_list( f"/zones/{zone_identifier}/filters", - page=SyncV4PagePaginationArray[FirewallFilter], + page=SyncV4PagePaginationArray[FilterListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -204,7 +207,7 @@ def list( filter_list_params.FilterListParams, ), ), - model=FirewallFilter, + model=FilterListResponse, ) def delete( @@ -219,7 +222,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[FirewallFilter]: + ) -> FilterDeleteResponse: """ Deletes an existing filter. @@ -250,7 +253,7 @@ def delete( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[FirewallFilter]], ResultWrapper[FirewallFilter]), + cast_to=cast(Type[FilterDeleteResponse], ResultWrapper[FilterDeleteResponse]), ) def get( @@ -264,7 +267,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[FirewallFilter]: + ) -> FilterGetResponse: """ Fetches the details of a filter. @@ -294,7 +297,7 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[FirewallFilter]], ResultWrapper[FirewallFilter]), + cast_to=cast(Type[FilterGetResponse], ResultWrapper[FilterGetResponse]), ) @@ -360,7 +363,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[FirewallFilter]: + ) -> FilterUpdateResponse: """ Updates an existing filter. @@ -391,7 +394,7 @@ async def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[FirewallFilter]], ResultWrapper[FirewallFilter]), + cast_to=cast(Type[FilterUpdateResponse], ResultWrapper[FilterUpdateResponse]), ) def list( @@ -411,7 +414,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[FirewallFilter, AsyncV4PagePaginationArray[FirewallFilter]]: + ) -> AsyncPaginator[FilterListResponse, AsyncV4PagePaginationArray[FilterListResponse]]: """Fetches filters in a zone. You can filter the results using several optional @@ -446,7 +449,7 @@ def list( raise ValueError(f"Expected a non-empty value for `zone_identifier` but received {zone_identifier!r}") return self._get_api_list( f"/zones/{zone_identifier}/filters", - page=AsyncV4PagePaginationArray[FirewallFilter], + page=AsyncV4PagePaginationArray[FilterListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -465,7 +468,7 @@ def list( filter_list_params.FilterListParams, ), ), - model=FirewallFilter, + model=FilterListResponse, ) async def delete( @@ -480,7 +483,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[FirewallFilter]: + ) -> FilterDeleteResponse: """ Deletes an existing filter. @@ -511,7 +514,7 @@ async def delete( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[FirewallFilter]], ResultWrapper[FirewallFilter]), + cast_to=cast(Type[FilterDeleteResponse], ResultWrapper[FilterDeleteResponse]), ) async def get( @@ -525,7 +528,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[FirewallFilter]: + ) -> FilterGetResponse: """ Fetches the details of a filter. @@ -555,7 +558,7 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[FirewallFilter]], ResultWrapper[FirewallFilter]), + cast_to=cast(Type[FilterGetResponse], ResultWrapper[FilterGetResponse]), ) diff --git a/src/cloudflare/resources/firewall/lockdowns.py b/src/cloudflare/resources/firewall/lockdowns.py index b6365d5cea6..87019d3c193 100644 --- a/src/cloudflare/resources/firewall/lockdowns.py +++ b/src/cloudflare/resources/firewall/lockdowns.py @@ -27,7 +27,7 @@ make_request_options, ) from ...types.firewall import ( - FirewallZoneLockdown, + Lockdown, LockdownDeleteResponse, lockdown_list_params, lockdown_create_params, @@ -58,7 +58,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[FirewallZoneLockdown]: + ) -> Lockdown: """ Creates a new Zone Lockdown rule. @@ -85,7 +85,7 @@ def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[FirewallZoneLockdown]], ResultWrapper[FirewallZoneLockdown]), + cast_to=cast(Type[Lockdown], ResultWrapper[Lockdown]), ) def update( @@ -100,7 +100,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[FirewallZoneLockdown]: + ) -> Lockdown: """ Updates an existing Zone Lockdown rule. @@ -131,7 +131,7 @@ def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[FirewallZoneLockdown]], ResultWrapper[FirewallZoneLockdown]), + cast_to=cast(Type[Lockdown], ResultWrapper[Lockdown]), ) def list( @@ -155,7 +155,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncV4PagePaginationArray[FirewallZoneLockdown]: + ) -> SyncV4PagePaginationArray[Lockdown]: """Fetches Zone Lockdown rules. You can filter the results using several optional @@ -201,7 +201,7 @@ def list( raise ValueError(f"Expected a non-empty value for `zone_identifier` but received {zone_identifier!r}") return self._get_api_list( f"/zones/{zone_identifier}/firewall/lockdowns", - page=SyncV4PagePaginationArray[FirewallZoneLockdown], + page=SyncV4PagePaginationArray[Lockdown], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -224,7 +224,7 @@ def list( lockdown_list_params.LockdownListParams, ), ), - model=FirewallZoneLockdown, + model=Lockdown, ) def delete( @@ -284,7 +284,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[FirewallZoneLockdown]: + ) -> Lockdown: """ Fetches the details of a Zone Lockdown rule. @@ -314,7 +314,7 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[FirewallZoneLockdown]], ResultWrapper[FirewallZoneLockdown]), + cast_to=cast(Type[Lockdown], ResultWrapper[Lockdown]), ) @@ -338,7 +338,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[FirewallZoneLockdown]: + ) -> Lockdown: """ Creates a new Zone Lockdown rule. @@ -365,7 +365,7 @@ async def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[FirewallZoneLockdown]], ResultWrapper[FirewallZoneLockdown]), + cast_to=cast(Type[Lockdown], ResultWrapper[Lockdown]), ) async def update( @@ -380,7 +380,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[FirewallZoneLockdown]: + ) -> Lockdown: """ Updates an existing Zone Lockdown rule. @@ -411,7 +411,7 @@ async def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[FirewallZoneLockdown]], ResultWrapper[FirewallZoneLockdown]), + cast_to=cast(Type[Lockdown], ResultWrapper[Lockdown]), ) def list( @@ -435,7 +435,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[FirewallZoneLockdown, AsyncV4PagePaginationArray[FirewallZoneLockdown]]: + ) -> AsyncPaginator[Lockdown, AsyncV4PagePaginationArray[Lockdown]]: """Fetches Zone Lockdown rules. You can filter the results using several optional @@ -481,7 +481,7 @@ def list( raise ValueError(f"Expected a non-empty value for `zone_identifier` but received {zone_identifier!r}") return self._get_api_list( f"/zones/{zone_identifier}/firewall/lockdowns", - page=AsyncV4PagePaginationArray[FirewallZoneLockdown], + page=AsyncV4PagePaginationArray[Lockdown], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -504,7 +504,7 @@ def list( lockdown_list_params.LockdownListParams, ), ), - model=FirewallZoneLockdown, + model=Lockdown, ) async def delete( @@ -564,7 +564,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[FirewallZoneLockdown]: + ) -> Lockdown: """ Fetches the details of a Zone Lockdown rule. @@ -594,7 +594,7 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[FirewallZoneLockdown]], ResultWrapper[FirewallZoneLockdown]), + cast_to=cast(Type[Lockdown], ResultWrapper[Lockdown]), ) diff --git a/src/cloudflare/resources/firewall/rules.py b/src/cloudflare/resources/firewall/rules.py index 66b95e44291..f03e62414c3 100644 --- a/src/cloudflare/resources/firewall/rules.py +++ b/src/cloudflare/resources/firewall/rules.py @@ -26,8 +26,8 @@ make_request_options, ) from ...types.firewall import ( + Rule, RuleEditResponse, - FirewallFilterRule, RuleCreateResponse, rule_get_params, rule_edit_params, @@ -102,7 +102,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[FirewallFilterRule]: + ) -> Rule: """ Updates an existing firewall rule. @@ -133,7 +133,7 @@ def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[FirewallFilterRule]], ResultWrapper[FirewallFilterRule]), + cast_to=cast(Type[Rule], ResultWrapper[Rule]), ) def list( @@ -152,7 +152,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncV4PagePaginationArray[FirewallFilterRule]: + ) -> SyncV4PagePaginationArray[Rule]: """Fetches firewall rules in a zone. You can filter the results using several @@ -185,7 +185,7 @@ def list( raise ValueError(f"Expected a non-empty value for `zone_identifier` but received {zone_identifier!r}") return self._get_api_list( f"/zones/{zone_identifier}/firewall/rules", - page=SyncV4PagePaginationArray[FirewallFilterRule], + page=SyncV4PagePaginationArray[Rule], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -203,7 +203,7 @@ def list( rule_list_params.RuleListParams, ), ), - model=FirewallFilterRule, + model=Rule, ) def delete( @@ -218,7 +218,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[FirewallFilterRule]: + ) -> Rule: """ Deletes an existing firewall rule. @@ -254,7 +254,7 @@ def delete( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[FirewallFilterRule]], ResultWrapper[FirewallFilterRule]), + cast_to=cast(Type[Rule], ResultWrapper[Rule]), ) def edit( @@ -315,7 +315,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[FirewallFilterRule]: + ) -> Rule: """ Fetches the details of a firewall rule. @@ -348,7 +348,7 @@ def get( query=maybe_transform({"id": query_id}, rule_get_params.RuleGetParams), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[FirewallFilterRule]], ResultWrapper[FirewallFilterRule]), + cast_to=cast(Type[Rule], ResultWrapper[Rule]), ) @@ -414,7 +414,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[FirewallFilterRule]: + ) -> Rule: """ Updates an existing firewall rule. @@ -445,7 +445,7 @@ async def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[FirewallFilterRule]], ResultWrapper[FirewallFilterRule]), + cast_to=cast(Type[Rule], ResultWrapper[Rule]), ) def list( @@ -464,7 +464,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[FirewallFilterRule, AsyncV4PagePaginationArray[FirewallFilterRule]]: + ) -> AsyncPaginator[Rule, AsyncV4PagePaginationArray[Rule]]: """Fetches firewall rules in a zone. You can filter the results using several @@ -497,7 +497,7 @@ def list( raise ValueError(f"Expected a non-empty value for `zone_identifier` but received {zone_identifier!r}") return self._get_api_list( f"/zones/{zone_identifier}/firewall/rules", - page=AsyncV4PagePaginationArray[FirewallFilterRule], + page=AsyncV4PagePaginationArray[Rule], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -515,7 +515,7 @@ def list( rule_list_params.RuleListParams, ), ), - model=FirewallFilterRule, + model=Rule, ) async def delete( @@ -530,7 +530,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[FirewallFilterRule]: + ) -> Rule: """ Deletes an existing firewall rule. @@ -566,7 +566,7 @@ async def delete( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[FirewallFilterRule]], ResultWrapper[FirewallFilterRule]), + cast_to=cast(Type[Rule], ResultWrapper[Rule]), ) async def edit( @@ -627,7 +627,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[FirewallFilterRule]: + ) -> Rule: """ Fetches the details of a firewall rule. @@ -660,7 +660,7 @@ async def get( query=await async_maybe_transform({"id": query_id}, rule_get_params.RuleGetParams), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[FirewallFilterRule]], ResultWrapper[FirewallFilterRule]), + cast_to=cast(Type[Rule], ResultWrapper[Rule]), ) diff --git a/src/cloudflare/resources/firewall/ua_rules.py b/src/cloudflare/resources/firewall/ua_rules.py index a08a6661470..f27c54383dc 100644 --- a/src/cloudflare/resources/firewall/ua_rules.py +++ b/src/cloudflare/resources/firewall/ua_rules.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Any, Type, Optional, cast +from typing import Any, Type, cast import httpx @@ -223,7 +223,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[UARuleDeleteResponse]: + ) -> UARuleDeleteResponse: """ Deletes an existing User Agent Blocking rule. @@ -254,7 +254,7 @@ def delete( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[UARuleDeleteResponse]], ResultWrapper[UARuleDeleteResponse]), + cast_to=cast(Type[UARuleDeleteResponse], ResultWrapper[UARuleDeleteResponse]), ) def get( @@ -492,7 +492,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[UARuleDeleteResponse]: + ) -> UARuleDeleteResponse: """ Deletes an existing User Agent Blocking rule. @@ -523,7 +523,7 @@ async def delete( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[UARuleDeleteResponse]], ResultWrapper[UARuleDeleteResponse]), + cast_to=cast(Type[UARuleDeleteResponse], ResultWrapper[UARuleDeleteResponse]), ) async def get( diff --git a/src/cloudflare/resources/firewall/waf/overrides.py b/src/cloudflare/resources/firewall/waf/overrides.py index 9f624027cc1..898b709701b 100644 --- a/src/cloudflare/resources/firewall/waf/overrides.py +++ b/src/cloudflare/resources/firewall/waf/overrides.py @@ -26,7 +26,7 @@ make_request_options, ) from ....types.firewall.waf import ( - WAFOverride, + Override, OverrideDeleteResponse, override_list_params, override_create_params, @@ -57,7 +57,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[WAFOverride]: + ) -> Override: """ Creates a URI-based WAF override for a zone. @@ -87,7 +87,7 @@ def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[WAFOverride]], ResultWrapper[WAFOverride]), + cast_to=cast(Type[Override], ResultWrapper[Override]), ) def update( @@ -102,7 +102,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[WAFOverride]: + ) -> Override: """ Updates an existing URI-based WAF override. @@ -136,7 +136,7 @@ def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[WAFOverride]], ResultWrapper[WAFOverride]), + cast_to=cast(Type[Override], ResultWrapper[Override]), ) def list( @@ -151,7 +151,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncV4PagePaginationArray[WAFOverride]: + ) -> SyncV4PagePaginationArray[Override]: """ Fetches the URI-based WAF overrides in a zone. @@ -177,7 +177,7 @@ def list( raise ValueError(f"Expected a non-empty value for `zone_identifier` but received {zone_identifier!r}") return self._get_api_list( f"/zones/{zone_identifier}/firewall/waf/overrides", - page=SyncV4PagePaginationArray[WAFOverride], + page=SyncV4PagePaginationArray[Override], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -191,7 +191,7 @@ def list( override_list_params.OverrideListParams, ), ), - model=WAFOverride, + model=Override, ) def delete( @@ -254,7 +254,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[WAFOverride]: + ) -> Override: """ Fetches the details of a URI-based WAF override. @@ -287,7 +287,7 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[WAFOverride]], ResultWrapper[WAFOverride]), + cast_to=cast(Type[Override], ResultWrapper[Override]), ) @@ -311,7 +311,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[WAFOverride]: + ) -> Override: """ Creates a URI-based WAF override for a zone. @@ -341,7 +341,7 @@ async def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[WAFOverride]], ResultWrapper[WAFOverride]), + cast_to=cast(Type[Override], ResultWrapper[Override]), ) async def update( @@ -356,7 +356,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[WAFOverride]: + ) -> Override: """ Updates an existing URI-based WAF override. @@ -390,7 +390,7 @@ async def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[WAFOverride]], ResultWrapper[WAFOverride]), + cast_to=cast(Type[Override], ResultWrapper[Override]), ) def list( @@ -405,7 +405,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[WAFOverride, AsyncV4PagePaginationArray[WAFOverride]]: + ) -> AsyncPaginator[Override, AsyncV4PagePaginationArray[Override]]: """ Fetches the URI-based WAF overrides in a zone. @@ -431,7 +431,7 @@ def list( raise ValueError(f"Expected a non-empty value for `zone_identifier` but received {zone_identifier!r}") return self._get_api_list( f"/zones/{zone_identifier}/firewall/waf/overrides", - page=AsyncV4PagePaginationArray[WAFOverride], + page=AsyncV4PagePaginationArray[Override], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -445,7 +445,7 @@ def list( override_list_params.OverrideListParams, ), ), - model=WAFOverride, + model=Override, ) async def delete( @@ -508,7 +508,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[WAFOverride]: + ) -> Override: """ Fetches the details of a URI-based WAF override. @@ -541,7 +541,7 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[WAFOverride]], ResultWrapper[WAFOverride]), + cast_to=cast(Type[Override], ResultWrapper[Override]), ) diff --git a/src/cloudflare/resources/firewall/waf/packages/groups.py b/src/cloudflare/resources/firewall/waf/packages/groups.py index 048f71acf11..cc56aa33724 100644 --- a/src/cloudflare/resources/firewall/waf/packages/groups.py +++ b/src/cloudflare/resources/firewall/waf/packages/groups.py @@ -27,7 +27,7 @@ make_request_options, ) from .....types.shared import UnnamedSchemaRef9444735ca60712dbcf8afd832eb5716a -from .....types.firewall.waf.packages import WAFManagedRulesGroup, group_edit_params, group_list_params +from .....types.firewall.waf.packages import Group, group_edit_params, group_list_params __all__ = ["Groups", "AsyncGroups"] @@ -60,7 +60,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncV4PagePaginationArray[WAFManagedRulesGroup]: + ) -> SyncV4PagePaginationArray[Group]: """ Fetches the WAF rule groups in a WAF package. @@ -104,7 +104,7 @@ def list( raise ValueError(f"Expected a non-empty value for `package_id` but received {package_id!r}") return self._get_api_list( f"/zones/{zone_id}/firewall/waf/packages/{package_id}/groups", - page=SyncV4PagePaginationArray[WAFManagedRulesGroup], + page=SyncV4PagePaginationArray[Group], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -124,7 +124,7 @@ def list( group_list_params.GroupListParams, ), ), - model=WAFManagedRulesGroup, + model=Group, ) def edit( @@ -277,7 +277,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[WAFManagedRulesGroup, AsyncV4PagePaginationArray[WAFManagedRulesGroup]]: + ) -> AsyncPaginator[Group, AsyncV4PagePaginationArray[Group]]: """ Fetches the WAF rule groups in a WAF package. @@ -321,7 +321,7 @@ def list( raise ValueError(f"Expected a non-empty value for `package_id` but received {package_id!r}") return self._get_api_list( f"/zones/{zone_id}/firewall/waf/packages/{package_id}/groups", - page=AsyncV4PagePaginationArray[WAFManagedRulesGroup], + page=AsyncV4PagePaginationArray[Group], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -341,7 +341,7 @@ def list( group_list_params.GroupListParams, ), ), - model=WAFManagedRulesGroup, + model=Group, ) async def edit( diff --git a/src/cloudflare/resources/firewall/waf/packages/packages.py b/src/cloudflare/resources/firewall/waf/packages/packages.py index 716cfc05a19..baad2052735 100644 --- a/src/cloudflare/resources/firewall/waf/packages/packages.py +++ b/src/cloudflare/resources/firewall/waf/packages/packages.py @@ -153,7 +153,7 @@ def get( Args: zone_identifier: Identifier - identifier: The unique identifier of a WAF package. + identifier: Identifier extra_headers: Send extra headers @@ -291,7 +291,7 @@ async def get( Args: zone_identifier: Identifier - identifier: The unique identifier of a WAF package. + identifier: Identifier extra_headers: Send extra headers diff --git a/src/cloudflare/resources/firewall/waf/packages/rules.py b/src/cloudflare/resources/firewall/waf/packages/rules.py index 175ca9e97ad..e0b4b4fb72d 100644 --- a/src/cloudflare/resources/firewall/waf/packages/rules.py +++ b/src/cloudflare/resources/firewall/waf/packages/rules.py @@ -27,7 +27,7 @@ make_request_options, ) from .....types.shared import UnnamedSchemaRef9444735ca60712dbcf8afd832eb5716a -from .....types.firewall.waf.packages import RuleEditResponse, WAFManagedRulesRule, rule_edit_params, rule_list_params +from .....types.firewall.waf.packages import Rule, RuleEditResponse, rule_edit_params, rule_list_params __all__ = ["Rules", "AsyncRules"] @@ -61,7 +61,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncV4PagePaginationArray[WAFManagedRulesRule]: + ) -> SyncV4PagePaginationArray[Rule]: """ Fetches WAF rules in a WAF package. @@ -106,7 +106,7 @@ def list( raise ValueError(f"Expected a non-empty value for `package_id` but received {package_id!r}") return self._get_api_list( f"/zones/{zone_id}/firewall/waf/packages/{package_id}/rules", - page=SyncV4PagePaginationArray[WAFManagedRulesRule], + page=SyncV4PagePaginationArray[Rule], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -127,7 +127,7 @@ def list( rule_list_params.RuleListParams, ), ), - model=cast(Any, WAFManagedRulesRule), # Union types cannot be passed in as arguments in the type system + model=cast(Any, Rule), # Union types cannot be passed in as arguments in the type system ) def edit( @@ -280,7 +280,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[WAFManagedRulesRule, AsyncV4PagePaginationArray[WAFManagedRulesRule]]: + ) -> AsyncPaginator[Rule, AsyncV4PagePaginationArray[Rule]]: """ Fetches WAF rules in a WAF package. @@ -325,7 +325,7 @@ def list( raise ValueError(f"Expected a non-empty value for `package_id` but received {package_id!r}") return self._get_api_list( f"/zones/{zone_id}/firewall/waf/packages/{package_id}/rules", - page=AsyncV4PagePaginationArray[WAFManagedRulesRule], + page=AsyncV4PagePaginationArray[Rule], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -346,7 +346,7 @@ def list( rule_list_params.RuleListParams, ), ), - model=cast(Any, WAFManagedRulesRule), # Union types cannot be passed in as arguments in the type system + model=cast(Any, Rule), # Union types cannot be passed in as arguments in the type system ) async def edit( diff --git a/src/cloudflare/resources/healthchecks/healthchecks.py b/src/cloudflare/resources/healthchecks/healthchecks.py index ebe50760c48..060a1b661d9 100644 --- a/src/cloudflare/resources/healthchecks/healthchecks.py +++ b/src/cloudflare/resources/healthchecks/healthchecks.py @@ -7,9 +7,9 @@ import httpx from ...types import ( + CheckRegion, Healthcheck, - CheckRegionItem, - TcpConfigurationParam, + TCPConfigurationParam, HTTPConfigurationParam, HealthcheckDeleteResponse, healthcheck_edit_params, @@ -67,7 +67,7 @@ def create( zone_id: str, address: str, name: str, - check_regions: Optional[List[CheckRegionItem]] | NotGiven = NOT_GIVEN, + check_regions: Optional[List[CheckRegion]] | NotGiven = NOT_GIVEN, consecutive_fails: int | NotGiven = NOT_GIVEN, consecutive_successes: int | NotGiven = NOT_GIVEN, description: str | NotGiven = NOT_GIVEN, @@ -75,7 +75,7 @@ def create( interval: int | NotGiven = NOT_GIVEN, retries: int | NotGiven = NOT_GIVEN, suspended: bool | NotGiven = NOT_GIVEN, - tcp_config: Optional[TcpConfigurationParam] | NotGiven = NOT_GIVEN, + tcp_config: Optional[TCPConfigurationParam] | NotGiven = NOT_GIVEN, healthcheck_timeout: int | NotGiven = NOT_GIVEN, type: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -172,7 +172,7 @@ def update( zone_id: str, address: str, name: str, - check_regions: Optional[List[CheckRegionItem]] | NotGiven = NOT_GIVEN, + check_regions: Optional[List[CheckRegion]] | NotGiven = NOT_GIVEN, consecutive_fails: int | NotGiven = NOT_GIVEN, consecutive_successes: int | NotGiven = NOT_GIVEN, description: str | NotGiven = NOT_GIVEN, @@ -180,7 +180,7 @@ def update( interval: int | NotGiven = NOT_GIVEN, retries: int | NotGiven = NOT_GIVEN, suspended: bool | NotGiven = NOT_GIVEN, - tcp_config: Optional[TcpConfigurationParam] | NotGiven = NOT_GIVEN, + tcp_config: Optional[TCPConfigurationParam] | NotGiven = NOT_GIVEN, healthcheck_timeout: int | NotGiven = NOT_GIVEN, type: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -363,7 +363,7 @@ def edit( zone_id: str, address: str, name: str, - check_regions: Optional[List[CheckRegionItem]] | NotGiven = NOT_GIVEN, + check_regions: Optional[List[CheckRegion]] | NotGiven = NOT_GIVEN, consecutive_fails: int | NotGiven = NOT_GIVEN, consecutive_successes: int | NotGiven = NOT_GIVEN, description: str | NotGiven = NOT_GIVEN, @@ -371,7 +371,7 @@ def edit( interval: int | NotGiven = NOT_GIVEN, retries: int | NotGiven = NOT_GIVEN, suspended: bool | NotGiven = NOT_GIVEN, - tcp_config: Optional[TcpConfigurationParam] | NotGiven = NOT_GIVEN, + tcp_config: Optional[TCPConfigurationParam] | NotGiven = NOT_GIVEN, healthcheck_timeout: int | NotGiven = NOT_GIVEN, type: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -529,7 +529,7 @@ async def create( zone_id: str, address: str, name: str, - check_regions: Optional[List[CheckRegionItem]] | NotGiven = NOT_GIVEN, + check_regions: Optional[List[CheckRegion]] | NotGiven = NOT_GIVEN, consecutive_fails: int | NotGiven = NOT_GIVEN, consecutive_successes: int | NotGiven = NOT_GIVEN, description: str | NotGiven = NOT_GIVEN, @@ -537,7 +537,7 @@ async def create( interval: int | NotGiven = NOT_GIVEN, retries: int | NotGiven = NOT_GIVEN, suspended: bool | NotGiven = NOT_GIVEN, - tcp_config: Optional[TcpConfigurationParam] | NotGiven = NOT_GIVEN, + tcp_config: Optional[TCPConfigurationParam] | NotGiven = NOT_GIVEN, healthcheck_timeout: int | NotGiven = NOT_GIVEN, type: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -634,7 +634,7 @@ async def update( zone_id: str, address: str, name: str, - check_regions: Optional[List[CheckRegionItem]] | NotGiven = NOT_GIVEN, + check_regions: Optional[List[CheckRegion]] | NotGiven = NOT_GIVEN, consecutive_fails: int | NotGiven = NOT_GIVEN, consecutive_successes: int | NotGiven = NOT_GIVEN, description: str | NotGiven = NOT_GIVEN, @@ -642,7 +642,7 @@ async def update( interval: int | NotGiven = NOT_GIVEN, retries: int | NotGiven = NOT_GIVEN, suspended: bool | NotGiven = NOT_GIVEN, - tcp_config: Optional[TcpConfigurationParam] | NotGiven = NOT_GIVEN, + tcp_config: Optional[TCPConfigurationParam] | NotGiven = NOT_GIVEN, healthcheck_timeout: int | NotGiven = NOT_GIVEN, type: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -825,7 +825,7 @@ async def edit( zone_id: str, address: str, name: str, - check_regions: Optional[List[CheckRegionItem]] | NotGiven = NOT_GIVEN, + check_regions: Optional[List[CheckRegion]] | NotGiven = NOT_GIVEN, consecutive_fails: int | NotGiven = NOT_GIVEN, consecutive_successes: int | NotGiven = NOT_GIVEN, description: str | NotGiven = NOT_GIVEN, @@ -833,7 +833,7 @@ async def edit( interval: int | NotGiven = NOT_GIVEN, retries: int | NotGiven = NOT_GIVEN, suspended: bool | NotGiven = NOT_GIVEN, - tcp_config: Optional[TcpConfigurationParam] | NotGiven = NOT_GIVEN, + tcp_config: Optional[TCPConfigurationParam] | NotGiven = NOT_GIVEN, healthcheck_timeout: int | NotGiven = NOT_GIVEN, type: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. diff --git a/src/cloudflare/resources/healthchecks/previews.py b/src/cloudflare/resources/healthchecks/previews.py index e4e6cee57d9..244cf878ccf 100644 --- a/src/cloudflare/resources/healthchecks/previews.py +++ b/src/cloudflare/resources/healthchecks/previews.py @@ -7,8 +7,9 @@ import httpx from ...types import ( + CheckRegion, Healthcheck, - TcpConfigurationParam, + TCPConfigurationParam, HTTPConfigurationParam, ) from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven @@ -28,7 +29,7 @@ from ..._base_client import ( make_request_options, ) -from ...types.healthchecks import CheckRegionItem, PreviewDeleteResponse, preview_create_params, preview_delete_params +from ...types.healthchecks import PreviewDeleteResponse, preview_create_params, preview_delete_params __all__ = ["Previews", "AsyncPreviews"] @@ -48,7 +49,7 @@ def create( zone_id: str, address: str, name: str, - check_regions: Optional[List[CheckRegionItem]] | NotGiven = NOT_GIVEN, + check_regions: Optional[List[CheckRegion]] | NotGiven = NOT_GIVEN, consecutive_fails: int | NotGiven = NOT_GIVEN, consecutive_successes: int | NotGiven = NOT_GIVEN, description: str | NotGiven = NOT_GIVEN, @@ -56,7 +57,7 @@ def create( interval: int | NotGiven = NOT_GIVEN, retries: int | NotGiven = NOT_GIVEN, suspended: bool | NotGiven = NOT_GIVEN, - tcp_config: Optional[TcpConfigurationParam] | NotGiven = NOT_GIVEN, + tcp_config: Optional[TCPConfigurationParam] | NotGiven = NOT_GIVEN, healthcheck_timeout: int | NotGiven = NOT_GIVEN, type: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -252,7 +253,7 @@ async def create( zone_id: str, address: str, name: str, - check_regions: Optional[List[CheckRegionItem]] | NotGiven = NOT_GIVEN, + check_regions: Optional[List[CheckRegion]] | NotGiven = NOT_GIVEN, consecutive_fails: int | NotGiven = NOT_GIVEN, consecutive_successes: int | NotGiven = NOT_GIVEN, description: str | NotGiven = NOT_GIVEN, @@ -260,7 +261,7 @@ async def create( interval: int | NotGiven = NOT_GIVEN, retries: int | NotGiven = NOT_GIVEN, suspended: bool | NotGiven = NOT_GIVEN, - tcp_config: Optional[TcpConfigurationParam] | NotGiven = NOT_GIVEN, + tcp_config: Optional[TCPConfigurationParam] | NotGiven = NOT_GIVEN, healthcheck_timeout: int | NotGiven = NOT_GIVEN, type: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. diff --git a/src/cloudflare/resources/hyperdrive/configs.py b/src/cloudflare/resources/hyperdrive/configs.py index d1ee6586108..b412f91877f 100644 --- a/src/cloudflare/resources/hyperdrive/configs.py +++ b/src/cloudflare/resources/hyperdrive/configs.py @@ -6,6 +6,7 @@ import httpx +from ...types import Hyperdrive, ConfigurationParam from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( maybe_transform, @@ -26,16 +27,7 @@ make_request_options, ) from ...types.shared import UnnamedSchemaRef9444735ca60712dbcf8afd832eb5716a -from ...types.hyperdrive import ( - ConfigGetResponse, - ConfigEditResponse, - ConfigListResponse, - ConfigCreateResponse, - ConfigUpdateResponse, - config_edit_params, - config_create_params, - config_update_params, -) +from ...types.hyperdrive import config_edit_params, config_create_params, config_update_params __all__ = ["Configs", "AsyncConfigs"] @@ -54,14 +46,14 @@ def create( *, account_id: str, name: object, - origin: config_create_params.Origin, + origin: ConfigurationParam, # 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[ConfigCreateResponse]: + ) -> Optional[Hyperdrive]: """ Creates and returns a new Hyperdrive configuration. @@ -94,7 +86,7 @@ def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[ConfigCreateResponse]], ResultWrapper[ConfigCreateResponse]), + cast_to=cast(Type[Optional[Hyperdrive]], ResultWrapper[Hyperdrive]), ) def update( @@ -103,14 +95,14 @@ def update( *, account_id: str, name: object, - origin: config_update_params.Origin, + origin: ConfigurationParam, # 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[ConfigUpdateResponse]: + ) -> Optional[Hyperdrive]: """ Updates and returns the specified Hyperdrive configuration. @@ -147,7 +139,7 @@ def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[ConfigUpdateResponse]], ResultWrapper[ConfigUpdateResponse]), + cast_to=cast(Type[Optional[Hyperdrive]], ResultWrapper[Hyperdrive]), ) def list( @@ -160,7 +152,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[ConfigListResponse]: + ) -> SyncSinglePage[Hyperdrive]: """ Returns a list of Hyperdrives @@ -179,11 +171,11 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/hyperdrive/configs", - page=SyncSinglePage[ConfigListResponse], + page=SyncSinglePage[Hyperdrive], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=ConfigListResponse, + model=Hyperdrive, ) def delete( @@ -240,14 +232,14 @@ def edit( hyperdrive_id: str, *, account_id: str, - origin: config_edit_params.Origin | NotGiven = NOT_GIVEN, + origin: ConfigurationParam | 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[ConfigEditResponse]: + ) -> Optional[Hyperdrive]: """Patches and returns the specified Hyperdrive configuration. Updates to the @@ -280,7 +272,7 @@ def edit( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[ConfigEditResponse]], ResultWrapper[ConfigEditResponse]), + cast_to=cast(Type[Optional[Hyperdrive]], ResultWrapper[Hyperdrive]), ) def get( @@ -294,7 +286,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ConfigGetResponse]: + ) -> Optional[Hyperdrive]: """ Returns the specified Hyperdrive configuration. @@ -324,7 +316,7 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[ConfigGetResponse]], ResultWrapper[ConfigGetResponse]), + cast_to=cast(Type[Optional[Hyperdrive]], ResultWrapper[Hyperdrive]), ) @@ -342,14 +334,14 @@ async def create( *, account_id: str, name: object, - origin: config_create_params.Origin, + origin: ConfigurationParam, # 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[ConfigCreateResponse]: + ) -> Optional[Hyperdrive]: """ Creates and returns a new Hyperdrive configuration. @@ -382,7 +374,7 @@ async def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[ConfigCreateResponse]], ResultWrapper[ConfigCreateResponse]), + cast_to=cast(Type[Optional[Hyperdrive]], ResultWrapper[Hyperdrive]), ) async def update( @@ -391,14 +383,14 @@ async def update( *, account_id: str, name: object, - origin: config_update_params.Origin, + origin: ConfigurationParam, # 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[ConfigUpdateResponse]: + ) -> Optional[Hyperdrive]: """ Updates and returns the specified Hyperdrive configuration. @@ -435,7 +427,7 @@ async def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[ConfigUpdateResponse]], ResultWrapper[ConfigUpdateResponse]), + cast_to=cast(Type[Optional[Hyperdrive]], ResultWrapper[Hyperdrive]), ) def list( @@ -448,7 +440,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[ConfigListResponse, AsyncSinglePage[ConfigListResponse]]: + ) -> AsyncPaginator[Hyperdrive, AsyncSinglePage[Hyperdrive]]: """ Returns a list of Hyperdrives @@ -467,11 +459,11 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/hyperdrive/configs", - page=AsyncSinglePage[ConfigListResponse], + page=AsyncSinglePage[Hyperdrive], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=ConfigListResponse, + model=Hyperdrive, ) async def delete( @@ -528,14 +520,14 @@ async def edit( hyperdrive_id: str, *, account_id: str, - origin: config_edit_params.Origin | NotGiven = NOT_GIVEN, + origin: ConfigurationParam | 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[ConfigEditResponse]: + ) -> Optional[Hyperdrive]: """Patches and returns the specified Hyperdrive configuration. Updates to the @@ -568,7 +560,7 @@ async def edit( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[ConfigEditResponse]], ResultWrapper[ConfigEditResponse]), + cast_to=cast(Type[Optional[Hyperdrive]], ResultWrapper[Hyperdrive]), ) async def get( @@ -582,7 +574,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ConfigGetResponse]: + ) -> Optional[Hyperdrive]: """ Returns the specified Hyperdrive configuration. @@ -612,7 +604,7 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[ConfigGetResponse]], ResultWrapper[ConfigGetResponse]), + cast_to=cast(Type[Optional[Hyperdrive]], ResultWrapper[Hyperdrive]), ) diff --git a/src/cloudflare/resources/images/v1/keys.py b/src/cloudflare/resources/images/v1/keys.py index b646e0cb140..55e77704a86 100644 --- a/src/cloudflare/resources/images/v1/keys.py +++ b/src/cloudflare/resources/images/v1/keys.py @@ -19,7 +19,7 @@ from ...._base_client import ( make_request_options, ) -from ....types.images.v1 import ImagesImageKeys +from ....types.images.v1 import Key __all__ = ["Keys", "AsyncKeys"] @@ -44,7 +44,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ImagesImageKeys: + ) -> Key: """Create a new signing key with specified name. Returns all keys available. @@ -73,7 +73,7 @@ def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ImagesImageKeys], ResultWrapper[ImagesImageKeys]), + cast_to=cast(Type[Key], ResultWrapper[Key]), ) def list( @@ -86,7 +86,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ImagesImageKeys: + ) -> Key: """Lists your signing keys. These can be found on your Cloudflare Images dashboard. @@ -113,7 +113,7 @@ def list( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ImagesImageKeys], ResultWrapper[ImagesImageKeys]), + cast_to=cast(Type[Key], ResultWrapper[Key]), ) def delete( @@ -127,7 +127,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ImagesImageKeys: + ) -> Key: """Delete signing key with specified name. Returns all keys available. When last @@ -157,7 +157,7 @@ def delete( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ImagesImageKeys], ResultWrapper[ImagesImageKeys]), + cast_to=cast(Type[Key], ResultWrapper[Key]), ) @@ -181,7 +181,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ImagesImageKeys: + ) -> Key: """Create a new signing key with specified name. Returns all keys available. @@ -210,7 +210,7 @@ async def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ImagesImageKeys], ResultWrapper[ImagesImageKeys]), + cast_to=cast(Type[Key], ResultWrapper[Key]), ) async def list( @@ -223,7 +223,7 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ImagesImageKeys: + ) -> Key: """Lists your signing keys. These can be found on your Cloudflare Images dashboard. @@ -250,7 +250,7 @@ async def list( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ImagesImageKeys], ResultWrapper[ImagesImageKeys]), + cast_to=cast(Type[Key], ResultWrapper[Key]), ) async def delete( @@ -264,7 +264,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ImagesImageKeys: + ) -> Key: """Delete signing key with specified name. Returns all keys available. When last @@ -294,7 +294,7 @@ async def delete( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ImagesImageKeys], ResultWrapper[ImagesImageKeys]), + cast_to=cast(Type[Key], ResultWrapper[Key]), ) diff --git a/src/cloudflare/resources/images/v1/stats.py b/src/cloudflare/resources/images/v1/stats.py index 40c4307c82b..8a6a54a1fe5 100644 --- a/src/cloudflare/resources/images/v1/stats.py +++ b/src/cloudflare/resources/images/v1/stats.py @@ -19,7 +19,7 @@ from ...._base_client import ( make_request_options, ) -from ....types.images.v1 import ImagesImagesStats +from ....types.images.v1 import Stat __all__ = ["Stats", "AsyncStats"] @@ -43,7 +43,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ImagesImagesStats: + ) -> Stat: """ Fetch usage statistics details for Cloudflare Images. @@ -69,7 +69,7 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ImagesImagesStats], ResultWrapper[ImagesImagesStats]), + cast_to=cast(Type[Stat], ResultWrapper[Stat]), ) @@ -92,7 +92,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ImagesImagesStats: + ) -> Stat: """ Fetch usage statistics details for Cloudflare Images. @@ -118,7 +118,7 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ImagesImagesStats], ResultWrapper[ImagesImagesStats]), + cast_to=cast(Type[Stat], ResultWrapper[Stat]), ) diff --git a/src/cloudflare/resources/images/v1/v1.py b/src/cloudflare/resources/images/v1/v1.py index 2fea92dac9b..e3f746b1d80 100644 --- a/src/cloudflare/resources/images/v1/v1.py +++ b/src/cloudflare/resources/images/v1/v1.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Any, Type, cast, overload +from typing import Any, Type, cast import httpx @@ -40,7 +40,6 @@ ) from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ...._utils import ( - required_args, maybe_transform, async_maybe_transform, ) @@ -89,12 +88,14 @@ def with_raw_response(self) -> V1WithRawResponse: def with_streaming_response(self) -> V1WithStreamingResponse: return V1WithStreamingResponse(self) - @overload def create( self, *, account_id: str, - file: object, + file: object | NotGiven = NOT_GIVEN, + metadata: object | NotGiven = NOT_GIVEN, + require_signed_urls: bool | NotGiven = NOT_GIVEN, + 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, @@ -110,40 +111,15 @@ def create( Args: account_id: Account identifier tag. - file: An image binary data. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request + file: An image binary data. Only needed when type is uploading a file. - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - def create( - self, - *, - account_id: str, - url: 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, - ) -> Image: - """ - Upload an image with up to 10 Megabytes using a single HTTP POST - (multipart/form-data) request. An image can be uploaded by sending an image file - or passing an accessible to an API url. + metadata: User modifiable key-value store. Can use used for keeping references to another + system of record for managing images. - Args: - account_id: Account identifier tag. + require_signed_urls: Indicates whether the image requires a signature token for the access. - url: A URL to fetch an image from origin. + url: A URL to fetch an image from origin. Only needed when type is uploading from a + URL. extra_headers: Send extra headers @@ -153,22 +129,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @required_args(["account_id", "file"], ["account_id", "url"]) - def create( - self, - *, - account_id: str, - file: object | NotGiven = NOT_GIVEN, - 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, - ) -> Image: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -176,6 +136,8 @@ def create( body=maybe_transform( { "file": file, + "metadata": metadata, + "require_signed_urls": require_signed_urls, "url": url, }, v1_create_params.V1CreateParams, @@ -429,12 +391,14 @@ def with_raw_response(self) -> AsyncV1WithRawResponse: def with_streaming_response(self) -> AsyncV1WithStreamingResponse: return AsyncV1WithStreamingResponse(self) - @overload async def create( self, *, account_id: str, - file: object, + file: object | NotGiven = NOT_GIVEN, + metadata: object | NotGiven = NOT_GIVEN, + require_signed_urls: bool | NotGiven = NOT_GIVEN, + 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, @@ -450,40 +414,15 @@ async def create( Args: account_id: Account identifier tag. - file: An image binary data. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request + file: An image binary data. Only needed when type is uploading a file. - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - async def create( - self, - *, - account_id: str, - url: 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, - ) -> Image: - """ - Upload an image with up to 10 Megabytes using a single HTTP POST - (multipart/form-data) request. An image can be uploaded by sending an image file - or passing an accessible to an API url. + metadata: User modifiable key-value store. Can use used for keeping references to another + system of record for managing images. - Args: - account_id: Account identifier tag. + require_signed_urls: Indicates whether the image requires a signature token for the access. - url: A URL to fetch an image from origin. + url: A URL to fetch an image from origin. Only needed when type is uploading from a + URL. extra_headers: Send extra headers @@ -493,22 +432,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @required_args(["account_id", "file"], ["account_id", "url"]) - async def create( - self, - *, - account_id: str, - file: object | NotGiven = NOT_GIVEN, - 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, - ) -> Image: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -516,6 +439,8 @@ async def create( body=await async_maybe_transform( { "file": file, + "metadata": metadata, + "require_signed_urls": require_signed_urls, "url": url, }, v1_create_params.V1CreateParams, diff --git a/src/cloudflare/resources/images/v1/variants.py b/src/cloudflare/resources/images/v1/variants.py index 7e5ab26a470..462f999bb9f 100644 --- a/src/cloudflare/resources/images/v1/variants.py +++ b/src/cloudflare/resources/images/v1/variants.py @@ -25,8 +25,10 @@ ) from ....types.shared import UnnamedSchemaRef9444735ca60712dbcf8afd832eb5716a from ....types.images.v1 import ( - V1ImageVariant, - V1ImageVariants, + Variant, + VariantGetResponse, + VariantEditResponse, + VariantCreateResponse, variant_edit_params, variant_create_params, variant_delete_params, @@ -57,7 +59,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> V1ImageVariant: + ) -> VariantCreateResponse: """ Specify variants that allow you to resize images for different use cases. @@ -96,7 +98,7 @@ def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[V1ImageVariant], ResultWrapper[V1ImageVariant]), + cast_to=cast(Type[VariantCreateResponse], ResultWrapper[VariantCreateResponse]), ) def list( @@ -109,7 +111,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> V1ImageVariants: + ) -> Variant: """ Lists existing variants. @@ -135,7 +137,7 @@ def list( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[V1ImageVariants], ResultWrapper[V1ImageVariants]), + cast_to=cast(Type[Variant], ResultWrapper[Variant]), ) def delete( @@ -200,7 +202,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> V1ImageVariant: + ) -> VariantEditResponse: """ Updating a variant purges the cache for all images associated with the variant. @@ -240,7 +242,7 @@ def edit( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[V1ImageVariant], ResultWrapper[V1ImageVariant]), + cast_to=cast(Type[VariantEditResponse], ResultWrapper[VariantEditResponse]), ) def get( @@ -254,7 +256,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> V1ImageVariant: + ) -> VariantGetResponse: """ Fetch details for a single variant. @@ -282,7 +284,7 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[V1ImageVariant], ResultWrapper[V1ImageVariant]), + cast_to=cast(Type[VariantGetResponse], ResultWrapper[VariantGetResponse]), ) @@ -308,7 +310,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> V1ImageVariant: + ) -> VariantCreateResponse: """ Specify variants that allow you to resize images for different use cases. @@ -347,7 +349,7 @@ async def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[V1ImageVariant], ResultWrapper[V1ImageVariant]), + cast_to=cast(Type[VariantCreateResponse], ResultWrapper[VariantCreateResponse]), ) async def list( @@ -360,7 +362,7 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> V1ImageVariants: + ) -> Variant: """ Lists existing variants. @@ -386,7 +388,7 @@ async def list( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[V1ImageVariants], ResultWrapper[V1ImageVariants]), + cast_to=cast(Type[Variant], ResultWrapper[Variant]), ) async def delete( @@ -451,7 +453,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> V1ImageVariant: + ) -> VariantEditResponse: """ Updating a variant purges the cache for all images associated with the variant. @@ -491,7 +493,7 @@ async def edit( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[V1ImageVariant], ResultWrapper[V1ImageVariant]), + cast_to=cast(Type[VariantEditResponse], ResultWrapper[VariantEditResponse]), ) async def get( @@ -505,7 +507,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> V1ImageVariant: + ) -> VariantGetResponse: """ Fetch details for a single variant. @@ -533,7 +535,7 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[V1ImageVariant], ResultWrapper[V1ImageVariant]), + cast_to=cast(Type[VariantGetResponse], ResultWrapper[VariantGetResponse]), ) diff --git a/src/cloudflare/resources/intel/__init__.py b/src/cloudflare/resources/intel/__init__.py index 2d6b3ff1216..8c3c0156d55 100644 --- a/src/cloudflare/resources/intel/__init__.py +++ b/src/cloudflare/resources/intel/__init__.py @@ -1,12 +1,12 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from .asn import ( - ASN, - AsyncASN, - ASNWithRawResponse, - AsyncASNWithRawResponse, - ASNWithStreamingResponse, - AsyncASNWithStreamingResponse, + ASNResource, + AsyncASNResource, + ASNResourceWithRawResponse, + AsyncASNResourceWithRawResponse, + ASNResourceWithStreamingResponse, + AsyncASNResourceWithStreamingResponse, ) from .dns import ( DNS, @@ -65,12 +65,12 @@ AsyncSinkholesWithStreamingResponse, ) from .domain_history import ( - DomainHistory, - AsyncDomainHistory, - DomainHistoryWithRawResponse, - AsyncDomainHistoryWithRawResponse, - DomainHistoryWithStreamingResponse, - AsyncDomainHistoryWithStreamingResponse, + DomainHistoryResource, + AsyncDomainHistoryResource, + DomainHistoryResourceWithRawResponse, + AsyncDomainHistoryResourceWithRawResponse, + DomainHistoryResourceWithStreamingResponse, + AsyncDomainHistoryResourceWithStreamingResponse, ) from .indicator_feeds import ( IndicatorFeeds, @@ -98,12 +98,12 @@ ) __all__ = [ - "ASN", - "AsyncASN", - "ASNWithRawResponse", - "AsyncASNWithRawResponse", - "ASNWithStreamingResponse", - "AsyncASNWithStreamingResponse", + "ASNResource", + "AsyncASNResource", + "ASNResourceWithRawResponse", + "AsyncASNResourceWithRawResponse", + "ASNResourceWithStreamingResponse", + "AsyncASNResourceWithStreamingResponse", "DNS", "AsyncDNS", "DNSWithRawResponse", @@ -116,12 +116,12 @@ "AsyncDomainsWithRawResponse", "DomainsWithStreamingResponse", "AsyncDomainsWithStreamingResponse", - "DomainHistory", - "AsyncDomainHistory", - "DomainHistoryWithRawResponse", - "AsyncDomainHistoryWithRawResponse", - "DomainHistoryWithStreamingResponse", - "AsyncDomainHistoryWithStreamingResponse", + "DomainHistoryResource", + "AsyncDomainHistoryResource", + "DomainHistoryResourceWithRawResponse", + "AsyncDomainHistoryResourceWithRawResponse", + "DomainHistoryResourceWithStreamingResponse", + "AsyncDomainHistoryResourceWithStreamingResponse", "IPs", "AsyncIPs", "IPsWithRawResponse", diff --git a/src/cloudflare/resources/intel/asn/__init__.py b/src/cloudflare/resources/intel/asn/__init__.py index 3992bce51a8..6332d501529 100644 --- a/src/cloudflare/resources/intel/asn/__init__.py +++ b/src/cloudflare/resources/intel/asn/__init__.py @@ -1,12 +1,12 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from .asn import ( - ASN, - AsyncASN, - ASNWithRawResponse, - AsyncASNWithRawResponse, - ASNWithStreamingResponse, - AsyncASNWithStreamingResponse, + ASNResource, + AsyncASNResource, + ASNResourceWithRawResponse, + AsyncASNResourceWithRawResponse, + ASNResourceWithStreamingResponse, + AsyncASNResourceWithStreamingResponse, ) from .subnets import ( Subnets, @@ -24,10 +24,10 @@ "AsyncSubnetsWithRawResponse", "SubnetsWithStreamingResponse", "AsyncSubnetsWithStreamingResponse", - "ASN", - "AsyncASN", - "ASNWithRawResponse", - "AsyncASNWithRawResponse", - "ASNWithStreamingResponse", - "AsyncASNWithStreamingResponse", + "ASNResource", + "AsyncASNResource", + "ASNResourceWithRawResponse", + "AsyncASNResourceWithRawResponse", + "ASNResourceWithStreamingResponse", + "AsyncASNResourceWithStreamingResponse", ] diff --git a/src/cloudflare/resources/intel/asn/asn.py b/src/cloudflare/resources/intel/asn/asn.py index f3687f935e4..1ca7ea04b37 100644 --- a/src/cloudflare/resources/intel/asn/asn.py +++ b/src/cloudflare/resources/intel/asn/asn.py @@ -24,30 +24,30 @@ async_to_streamed_response_wrapper, ) from ...._wrappers import ResultWrapper -from ....types.intel import IntelASN +from ....types.intel import ASN from ...._base_client import ( make_request_options, ) -__all__ = ["ASN", "AsyncASN"] +__all__ = ["ASNResource", "AsyncASNResource"] -class ASN(SyncAPIResource): +class ASNResource(SyncAPIResource): @cached_property def subnets(self) -> Subnets: return Subnets(self._client) @cached_property - def with_raw_response(self) -> ASNWithRawResponse: - return ASNWithRawResponse(self) + def with_raw_response(self) -> ASNResourceWithRawResponse: + return ASNResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> ASNWithStreamingResponse: - return ASNWithStreamingResponse(self) + def with_streaming_response(self) -> ASNResourceWithStreamingResponse: + return ASNResourceWithStreamingResponse(self) def get( self, - asn: IntelASN, + asn: ASN, *, account_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -56,7 +56,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> IntelASN: + ) -> ASN: """ Get ASN Overview @@ -82,26 +82,26 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[IntelASN], ResultWrapper[int]), + cast_to=cast(Type[ASN], ResultWrapper[int]), ) -class AsyncASN(AsyncAPIResource): +class AsyncASNResource(AsyncAPIResource): @cached_property def subnets(self) -> AsyncSubnets: return AsyncSubnets(self._client) @cached_property - def with_raw_response(self) -> AsyncASNWithRawResponse: - return AsyncASNWithRawResponse(self) + def with_raw_response(self) -> AsyncASNResourceWithRawResponse: + return AsyncASNResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> AsyncASNWithStreamingResponse: - return AsyncASNWithStreamingResponse(self) + def with_streaming_response(self) -> AsyncASNResourceWithStreamingResponse: + return AsyncASNResourceWithStreamingResponse(self) async def get( self, - asn: IntelASN, + asn: ASN, *, account_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -110,7 +110,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> IntelASN: + ) -> ASN: """ Get ASN Overview @@ -136,12 +136,12 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[IntelASN], ResultWrapper[int]), + cast_to=cast(Type[ASN], ResultWrapper[int]), ) -class ASNWithRawResponse: - def __init__(self, asn: ASN) -> None: +class ASNResourceWithRawResponse: + def __init__(self, asn: ASNResource) -> None: self._asn = asn self.get = to_raw_response_wrapper( @@ -153,8 +153,8 @@ def subnets(self) -> SubnetsWithRawResponse: return SubnetsWithRawResponse(self._asn.subnets) -class AsyncASNWithRawResponse: - def __init__(self, asn: AsyncASN) -> None: +class AsyncASNResourceWithRawResponse: + def __init__(self, asn: AsyncASNResource) -> None: self._asn = asn self.get = async_to_raw_response_wrapper( @@ -166,8 +166,8 @@ def subnets(self) -> AsyncSubnetsWithRawResponse: return AsyncSubnetsWithRawResponse(self._asn.subnets) -class ASNWithStreamingResponse: - def __init__(self, asn: ASN) -> None: +class ASNResourceWithStreamingResponse: + def __init__(self, asn: ASNResource) -> None: self._asn = asn self.get = to_streamed_response_wrapper( @@ -179,8 +179,8 @@ def subnets(self) -> SubnetsWithStreamingResponse: return SubnetsWithStreamingResponse(self._asn.subnets) -class AsyncASNWithStreamingResponse: - def __init__(self, asn: AsyncASN) -> None: +class AsyncASNResourceWithStreamingResponse: + def __init__(self, asn: AsyncASNResource) -> None: self._asn = asn self.get = async_to_streamed_response_wrapper( diff --git a/src/cloudflare/resources/intel/asn/subnets.py b/src/cloudflare/resources/intel/asn/subnets.py index 6e47fc5da93..42426f5f4f3 100644 --- a/src/cloudflare/resources/intel/asn/subnets.py +++ b/src/cloudflare/resources/intel/asn/subnets.py @@ -13,7 +13,7 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ....types.intel import IntelASN +from ....types.intel import ASN from ...._base_client import ( make_request_options, ) @@ -33,7 +33,7 @@ def with_streaming_response(self) -> SubnetsWithStreamingResponse: def get( self, - asn: IntelASN, + asn: ASN, *, account_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -79,7 +79,7 @@ def with_streaming_response(self) -> AsyncSubnetsWithStreamingResponse: async def get( self, - asn: IntelASN, + asn: ASN, *, account_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. diff --git a/src/cloudflare/resources/intel/attack_surface_report/issues.py b/src/cloudflare/resources/intel/attack_surface_report/issues.py index 8f9ec519506..55cd6a8b592 100644 --- a/src/cloudflare/resources/intel/attack_surface_report/issues.py +++ b/src/cloudflare/resources/intel/attack_surface_report/issues.py @@ -3,7 +3,6 @@ from __future__ import annotations from typing import Any, List, Type, cast -from typing_extensions import Literal import httpx @@ -28,9 +27,14 @@ ) from ....types.shared import UnnamedSchemaRef8d6a37a1e4190f86652802244d29525f from ....types.intel.attack_surface_report import ( + Product, + Subject, + IssueType, + IssueClass, IssueListResponse, IssueTypeResponse, IssueClassResponse, + SeverityQueryParam, IssueSeverityResponse, issue_list_params, issue_type_params, @@ -56,36 +60,18 @@ def list( *, account_id: str, dismissed: bool | NotGiven = NOT_GIVEN, - issue_class: List[str] | NotGiven = NOT_GIVEN, - issue_class_neq: List[str] | NotGiven = NOT_GIVEN, - issue_type: List[ - Literal[ - "compliance_violation", - "email_security", - "exposed_infrastructure", - "insecure_configuration", - "weak_authentication", - ] - ] - | NotGiven = NOT_GIVEN, - issue_type_neq: List[ - Literal[ - "compliance_violation", - "email_security", - "exposed_infrastructure", - "insecure_configuration", - "weak_authentication", - ] - ] - | NotGiven = NOT_GIVEN, + issue_class: List[IssueClass] | NotGiven = NOT_GIVEN, + issue_class_neq: List[IssueClass] | NotGiven = NOT_GIVEN, + issue_type: List[IssueType] | NotGiven = NOT_GIVEN, + issue_type_neq: List[IssueType] | NotGiven = NOT_GIVEN, page: int | NotGiven = NOT_GIVEN, per_page: int | NotGiven = NOT_GIVEN, - product: List[str] | NotGiven = NOT_GIVEN, - product_neq: List[str] | NotGiven = NOT_GIVEN, - severity: List[Literal["low", "moderate", "critical"]] | NotGiven = NOT_GIVEN, - severity_neq: List[Literal["low", "moderate", "critical"]] | NotGiven = NOT_GIVEN, - subject: List[str] | NotGiven = NOT_GIVEN, - subject_neq: List[str] | NotGiven = NOT_GIVEN, + product: List[Product] | NotGiven = NOT_GIVEN, + product_neq: List[Product] | NotGiven = NOT_GIVEN, + severity: List[SeverityQueryParam] | NotGiven = NOT_GIVEN, + severity_neq: List[SeverityQueryParam] | NotGiven = NOT_GIVEN, + subject: List[Subject] | NotGiven = NOT_GIVEN, + subject_neq: List[Subject] | 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, @@ -148,34 +134,16 @@ def class_( *, account_id: str, dismissed: bool | NotGiven = NOT_GIVEN, - issue_class: List[str] | NotGiven = NOT_GIVEN, - issue_class_neq: List[str] | NotGiven = NOT_GIVEN, - issue_type: List[ - Literal[ - "compliance_violation", - "email_security", - "exposed_infrastructure", - "insecure_configuration", - "weak_authentication", - ] - ] - | NotGiven = NOT_GIVEN, - issue_type_neq: List[ - Literal[ - "compliance_violation", - "email_security", - "exposed_infrastructure", - "insecure_configuration", - "weak_authentication", - ] - ] - | NotGiven = NOT_GIVEN, - product: List[str] | NotGiven = NOT_GIVEN, - product_neq: List[str] | NotGiven = NOT_GIVEN, - severity: List[Literal["low", "moderate", "critical"]] | NotGiven = NOT_GIVEN, - severity_neq: List[Literal["low", "moderate", "critical"]] | NotGiven = NOT_GIVEN, - subject: List[str] | NotGiven = NOT_GIVEN, - subject_neq: List[str] | NotGiven = NOT_GIVEN, + issue_class: List[IssueClass] | NotGiven = NOT_GIVEN, + issue_class_neq: List[IssueClass] | NotGiven = NOT_GIVEN, + issue_type: List[IssueType] | NotGiven = NOT_GIVEN, + issue_type_neq: List[IssueType] | NotGiven = NOT_GIVEN, + product: List[Product] | NotGiven = NOT_GIVEN, + product_neq: List[Product] | NotGiven = NOT_GIVEN, + severity: List[SeverityQueryParam] | NotGiven = NOT_GIVEN, + severity_neq: List[SeverityQueryParam] | NotGiven = NOT_GIVEN, + subject: List[Subject] | NotGiven = NOT_GIVEN, + subject_neq: List[Subject] | 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, @@ -281,34 +249,16 @@ def severity( *, account_id: str, dismissed: bool | NotGiven = NOT_GIVEN, - issue_class: List[str] | NotGiven = NOT_GIVEN, - issue_class_neq: List[str] | NotGiven = NOT_GIVEN, - issue_type: List[ - Literal[ - "compliance_violation", - "email_security", - "exposed_infrastructure", - "insecure_configuration", - "weak_authentication", - ] - ] - | NotGiven = NOT_GIVEN, - issue_type_neq: List[ - Literal[ - "compliance_violation", - "email_security", - "exposed_infrastructure", - "insecure_configuration", - "weak_authentication", - ] - ] - | NotGiven = NOT_GIVEN, - product: List[str] | NotGiven = NOT_GIVEN, - product_neq: List[str] | NotGiven = NOT_GIVEN, - severity: List[Literal["low", "moderate", "critical"]] | NotGiven = NOT_GIVEN, - severity_neq: List[Literal["low", "moderate", "critical"]] | NotGiven = NOT_GIVEN, - subject: List[str] | NotGiven = NOT_GIVEN, - subject_neq: List[str] | NotGiven = NOT_GIVEN, + issue_class: List[IssueClass] | NotGiven = NOT_GIVEN, + issue_class_neq: List[IssueClass] | NotGiven = NOT_GIVEN, + issue_type: List[IssueType] | NotGiven = NOT_GIVEN, + issue_type_neq: List[IssueType] | NotGiven = NOT_GIVEN, + product: List[Product] | NotGiven = NOT_GIVEN, + product_neq: List[Product] | NotGiven = NOT_GIVEN, + severity: List[SeverityQueryParam] | NotGiven = NOT_GIVEN, + severity_neq: List[SeverityQueryParam] | NotGiven = NOT_GIVEN, + subject: List[Subject] | NotGiven = NOT_GIVEN, + subject_neq: List[Subject] | 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, @@ -365,34 +315,16 @@ def type( *, account_id: str, dismissed: bool | NotGiven = NOT_GIVEN, - issue_class: List[str] | NotGiven = NOT_GIVEN, - issue_class_neq: List[str] | NotGiven = NOT_GIVEN, - issue_type: List[ - Literal[ - "compliance_violation", - "email_security", - "exposed_infrastructure", - "insecure_configuration", - "weak_authentication", - ] - ] - | NotGiven = NOT_GIVEN, - issue_type_neq: List[ - Literal[ - "compliance_violation", - "email_security", - "exposed_infrastructure", - "insecure_configuration", - "weak_authentication", - ] - ] - | NotGiven = NOT_GIVEN, - product: List[str] | NotGiven = NOT_GIVEN, - product_neq: List[str] | NotGiven = NOT_GIVEN, - severity: List[Literal["low", "moderate", "critical"]] | NotGiven = NOT_GIVEN, - severity_neq: List[Literal["low", "moderate", "critical"]] | NotGiven = NOT_GIVEN, - subject: List[str] | NotGiven = NOT_GIVEN, - subject_neq: List[str] | NotGiven = NOT_GIVEN, + issue_class: List[IssueClass] | NotGiven = NOT_GIVEN, + issue_class_neq: List[IssueClass] | NotGiven = NOT_GIVEN, + issue_type: List[IssueType] | NotGiven = NOT_GIVEN, + issue_type_neq: List[IssueType] | NotGiven = NOT_GIVEN, + product: List[Product] | NotGiven = NOT_GIVEN, + product_neq: List[Product] | NotGiven = NOT_GIVEN, + severity: List[SeverityQueryParam] | NotGiven = NOT_GIVEN, + severity_neq: List[SeverityQueryParam] | NotGiven = NOT_GIVEN, + subject: List[Subject] | NotGiven = NOT_GIVEN, + subject_neq: List[Subject] | 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, @@ -459,36 +391,18 @@ def list( *, account_id: str, dismissed: bool | NotGiven = NOT_GIVEN, - issue_class: List[str] | NotGiven = NOT_GIVEN, - issue_class_neq: List[str] | NotGiven = NOT_GIVEN, - issue_type: List[ - Literal[ - "compliance_violation", - "email_security", - "exposed_infrastructure", - "insecure_configuration", - "weak_authentication", - ] - ] - | NotGiven = NOT_GIVEN, - issue_type_neq: List[ - Literal[ - "compliance_violation", - "email_security", - "exposed_infrastructure", - "insecure_configuration", - "weak_authentication", - ] - ] - | NotGiven = NOT_GIVEN, + issue_class: List[IssueClass] | NotGiven = NOT_GIVEN, + issue_class_neq: List[IssueClass] | NotGiven = NOT_GIVEN, + issue_type: List[IssueType] | NotGiven = NOT_GIVEN, + issue_type_neq: List[IssueType] | NotGiven = NOT_GIVEN, page: int | NotGiven = NOT_GIVEN, per_page: int | NotGiven = NOT_GIVEN, - product: List[str] | NotGiven = NOT_GIVEN, - product_neq: List[str] | NotGiven = NOT_GIVEN, - severity: List[Literal["low", "moderate", "critical"]] | NotGiven = NOT_GIVEN, - severity_neq: List[Literal["low", "moderate", "critical"]] | NotGiven = NOT_GIVEN, - subject: List[str] | NotGiven = NOT_GIVEN, - subject_neq: List[str] | NotGiven = NOT_GIVEN, + product: List[Product] | NotGiven = NOT_GIVEN, + product_neq: List[Product] | NotGiven = NOT_GIVEN, + severity: List[SeverityQueryParam] | NotGiven = NOT_GIVEN, + severity_neq: List[SeverityQueryParam] | NotGiven = NOT_GIVEN, + subject: List[Subject] | NotGiven = NOT_GIVEN, + subject_neq: List[Subject] | 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, @@ -551,34 +465,16 @@ async def class_( *, account_id: str, dismissed: bool | NotGiven = NOT_GIVEN, - issue_class: List[str] | NotGiven = NOT_GIVEN, - issue_class_neq: List[str] | NotGiven = NOT_GIVEN, - issue_type: List[ - Literal[ - "compliance_violation", - "email_security", - "exposed_infrastructure", - "insecure_configuration", - "weak_authentication", - ] - ] - | NotGiven = NOT_GIVEN, - issue_type_neq: List[ - Literal[ - "compliance_violation", - "email_security", - "exposed_infrastructure", - "insecure_configuration", - "weak_authentication", - ] - ] - | NotGiven = NOT_GIVEN, - product: List[str] | NotGiven = NOT_GIVEN, - product_neq: List[str] | NotGiven = NOT_GIVEN, - severity: List[Literal["low", "moderate", "critical"]] | NotGiven = NOT_GIVEN, - severity_neq: List[Literal["low", "moderate", "critical"]] | NotGiven = NOT_GIVEN, - subject: List[str] | NotGiven = NOT_GIVEN, - subject_neq: List[str] | NotGiven = NOT_GIVEN, + issue_class: List[IssueClass] | NotGiven = NOT_GIVEN, + issue_class_neq: List[IssueClass] | NotGiven = NOT_GIVEN, + issue_type: List[IssueType] | NotGiven = NOT_GIVEN, + issue_type_neq: List[IssueType] | NotGiven = NOT_GIVEN, + product: List[Product] | NotGiven = NOT_GIVEN, + product_neq: List[Product] | NotGiven = NOT_GIVEN, + severity: List[SeverityQueryParam] | NotGiven = NOT_GIVEN, + severity_neq: List[SeverityQueryParam] | NotGiven = NOT_GIVEN, + subject: List[Subject] | NotGiven = NOT_GIVEN, + subject_neq: List[Subject] | 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, @@ -684,34 +580,16 @@ async def severity( *, account_id: str, dismissed: bool | NotGiven = NOT_GIVEN, - issue_class: List[str] | NotGiven = NOT_GIVEN, - issue_class_neq: List[str] | NotGiven = NOT_GIVEN, - issue_type: List[ - Literal[ - "compliance_violation", - "email_security", - "exposed_infrastructure", - "insecure_configuration", - "weak_authentication", - ] - ] - | NotGiven = NOT_GIVEN, - issue_type_neq: List[ - Literal[ - "compliance_violation", - "email_security", - "exposed_infrastructure", - "insecure_configuration", - "weak_authentication", - ] - ] - | NotGiven = NOT_GIVEN, - product: List[str] | NotGiven = NOT_GIVEN, - product_neq: List[str] | NotGiven = NOT_GIVEN, - severity: List[Literal["low", "moderate", "critical"]] | NotGiven = NOT_GIVEN, - severity_neq: List[Literal["low", "moderate", "critical"]] | NotGiven = NOT_GIVEN, - subject: List[str] | NotGiven = NOT_GIVEN, - subject_neq: List[str] | NotGiven = NOT_GIVEN, + issue_class: List[IssueClass] | NotGiven = NOT_GIVEN, + issue_class_neq: List[IssueClass] | NotGiven = NOT_GIVEN, + issue_type: List[IssueType] | NotGiven = NOT_GIVEN, + issue_type_neq: List[IssueType] | NotGiven = NOT_GIVEN, + product: List[Product] | NotGiven = NOT_GIVEN, + product_neq: List[Product] | NotGiven = NOT_GIVEN, + severity: List[SeverityQueryParam] | NotGiven = NOT_GIVEN, + severity_neq: List[SeverityQueryParam] | NotGiven = NOT_GIVEN, + subject: List[Subject] | NotGiven = NOT_GIVEN, + subject_neq: List[Subject] | 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, @@ -768,34 +646,16 @@ async def type( *, account_id: str, dismissed: bool | NotGiven = NOT_GIVEN, - issue_class: List[str] | NotGiven = NOT_GIVEN, - issue_class_neq: List[str] | NotGiven = NOT_GIVEN, - issue_type: List[ - Literal[ - "compliance_violation", - "email_security", - "exposed_infrastructure", - "insecure_configuration", - "weak_authentication", - ] - ] - | NotGiven = NOT_GIVEN, - issue_type_neq: List[ - Literal[ - "compliance_violation", - "email_security", - "exposed_infrastructure", - "insecure_configuration", - "weak_authentication", - ] - ] - | NotGiven = NOT_GIVEN, - product: List[str] | NotGiven = NOT_GIVEN, - product_neq: List[str] | NotGiven = NOT_GIVEN, - severity: List[Literal["low", "moderate", "critical"]] | NotGiven = NOT_GIVEN, - severity_neq: List[Literal["low", "moderate", "critical"]] | NotGiven = NOT_GIVEN, - subject: List[str] | NotGiven = NOT_GIVEN, - subject_neq: List[str] | NotGiven = NOT_GIVEN, + issue_class: List[IssueClass] | NotGiven = NOT_GIVEN, + issue_class_neq: List[IssueClass] | NotGiven = NOT_GIVEN, + issue_type: List[IssueType] | NotGiven = NOT_GIVEN, + issue_type_neq: List[IssueType] | NotGiven = NOT_GIVEN, + product: List[Product] | NotGiven = NOT_GIVEN, + product_neq: List[Product] | NotGiven = NOT_GIVEN, + severity: List[SeverityQueryParam] | NotGiven = NOT_GIVEN, + severity_neq: List[SeverityQueryParam] | NotGiven = NOT_GIVEN, + subject: List[Subject] | NotGiven = NOT_GIVEN, + subject_neq: List[Subject] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, diff --git a/src/cloudflare/resources/intel/dns.py b/src/cloudflare/resources/intel/dns.py index 4b5effc93f9..ccb0f4ee538 100644 --- a/src/cloudflare/resources/intel/dns.py +++ b/src/cloudflare/resources/intel/dns.py @@ -20,7 +20,7 @@ async_to_streamed_response_wrapper, ) from ..._wrappers import ResultWrapper -from ...types.intel import IntelPassiveDNSByIP, dns_get_params +from ...types.intel import dns, dns_get_params from ..._base_client import ( make_request_options, ) @@ -51,7 +51,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> IntelPassiveDNSByIP: + ) -> dns.DNS: """ Get Passive DNS by IP @@ -90,7 +90,7 @@ def get( ), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[IntelPassiveDNSByIP], ResultWrapper[IntelPassiveDNSByIP]), + cast_to=cast(Type[dns.DNS], ResultWrapper[dns.DNS]), ) @@ -117,7 +117,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> IntelPassiveDNSByIP: + ) -> dns.DNS: """ Get Passive DNS by IP @@ -156,7 +156,7 @@ async def get( ), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[IntelPassiveDNSByIP], ResultWrapper[IntelPassiveDNSByIP]), + cast_to=cast(Type[dns.DNS], ResultWrapper[dns.DNS]), ) diff --git a/src/cloudflare/resources/intel/domain_history.py b/src/cloudflare/resources/intel/domain_history.py index 25de53aa218..ef320f1e4c3 100644 --- a/src/cloudflare/resources/intel/domain_history.py +++ b/src/cloudflare/resources/intel/domain_history.py @@ -25,17 +25,17 @@ make_request_options, ) -__all__ = ["DomainHistory", "AsyncDomainHistory"] +__all__ = ["DomainHistoryResource", "AsyncDomainHistoryResource"] -class DomainHistory(SyncAPIResource): +class DomainHistoryResource(SyncAPIResource): @cached_property - def with_raw_response(self) -> DomainHistoryWithRawResponse: - return DomainHistoryWithRawResponse(self) + def with_raw_response(self) -> DomainHistoryResourceWithRawResponse: + return DomainHistoryResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> DomainHistoryWithStreamingResponse: - return DomainHistoryWithStreamingResponse(self) + def with_streaming_response(self) -> DomainHistoryResourceWithStreamingResponse: + return DomainHistoryResourceWithStreamingResponse(self) def get( self, @@ -79,14 +79,14 @@ def get( ) -class AsyncDomainHistory(AsyncAPIResource): +class AsyncDomainHistoryResource(AsyncAPIResource): @cached_property - def with_raw_response(self) -> AsyncDomainHistoryWithRawResponse: - return AsyncDomainHistoryWithRawResponse(self) + def with_raw_response(self) -> AsyncDomainHistoryResourceWithRawResponse: + return AsyncDomainHistoryResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> AsyncDomainHistoryWithStreamingResponse: - return AsyncDomainHistoryWithStreamingResponse(self) + def with_streaming_response(self) -> AsyncDomainHistoryResourceWithStreamingResponse: + return AsyncDomainHistoryResourceWithStreamingResponse(self) async def get( self, @@ -130,8 +130,8 @@ async def get( ) -class DomainHistoryWithRawResponse: - def __init__(self, domain_history: DomainHistory) -> None: +class DomainHistoryResourceWithRawResponse: + def __init__(self, domain_history: DomainHistoryResource) -> None: self._domain_history = domain_history self.get = to_raw_response_wrapper( @@ -139,8 +139,8 @@ def __init__(self, domain_history: DomainHistory) -> None: ) -class AsyncDomainHistoryWithRawResponse: - def __init__(self, domain_history: AsyncDomainHistory) -> None: +class AsyncDomainHistoryResourceWithRawResponse: + def __init__(self, domain_history: AsyncDomainHistoryResource) -> None: self._domain_history = domain_history self.get = async_to_raw_response_wrapper( @@ -148,8 +148,8 @@ def __init__(self, domain_history: AsyncDomainHistory) -> None: ) -class DomainHistoryWithStreamingResponse: - def __init__(self, domain_history: DomainHistory) -> None: +class DomainHistoryResourceWithStreamingResponse: + def __init__(self, domain_history: DomainHistoryResource) -> None: self._domain_history = domain_history self.get = to_streamed_response_wrapper( @@ -157,8 +157,8 @@ def __init__(self, domain_history: DomainHistory) -> None: ) -class AsyncDomainHistoryWithStreamingResponse: - def __init__(self, domain_history: AsyncDomainHistory) -> None: +class AsyncDomainHistoryResourceWithStreamingResponse: + def __init__(self, domain_history: AsyncDomainHistoryResource) -> None: self._domain_history = domain_history self.get = async_to_streamed_response_wrapper( diff --git a/src/cloudflare/resources/intel/domains/domains.py b/src/cloudflare/resources/intel/domains/domains.py index a8eee7ac86b..dd53305ffaf 100644 --- a/src/cloudflare/resources/intel/domains/domains.py +++ b/src/cloudflare/resources/intel/domains/domains.py @@ -28,7 +28,7 @@ async_to_streamed_response_wrapper, ) from ...._wrappers import ResultWrapper -from ....types.intel import IntelDomain, domain_get_params +from ....types.intel import Domain, domain_get_params from ...._base_client import ( make_request_options, ) @@ -60,7 +60,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> IntelDomain: + ) -> Domain: """ Get Domain Details @@ -87,7 +87,7 @@ def get( query=maybe_transform({"domain": domain}, domain_get_params.DomainGetParams), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[IntelDomain], ResultWrapper[IntelDomain]), + cast_to=cast(Type[Domain], ResultWrapper[Domain]), ) @@ -115,7 +115,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> IntelDomain: + ) -> Domain: """ Get Domain Details @@ -142,7 +142,7 @@ async def get( query=await async_maybe_transform({"domain": domain}, domain_get_params.DomainGetParams), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[IntelDomain], ResultWrapper[IntelDomain]), + cast_to=cast(Type[Domain], ResultWrapper[Domain]), ) diff --git a/src/cloudflare/resources/intel/intel.py b/src/cloudflare/resources/intel/intel.py index c67ec7e95d4..e44e4e274ff 100644 --- a/src/cloudflare/resources/intel/intel.py +++ b/src/cloudflare/resources/intel/intel.py @@ -3,12 +3,12 @@ from __future__ import annotations from .asn import ( - ASN, - AsyncASN, - ASNWithRawResponse, - AsyncASNWithRawResponse, - ASNWithStreamingResponse, - AsyncASNWithStreamingResponse, + ASNResource, + AsyncASNResource, + ASNResourceWithRawResponse, + AsyncASNResourceWithRawResponse, + ASNResourceWithStreamingResponse, + AsyncASNResourceWithStreamingResponse, ) from .dns import ( DNS, @@ -34,7 +34,7 @@ WhoisWithStreamingResponse, AsyncWhoisWithStreamingResponse, ) -from .asn.asn import ASN, AsyncASN +from .asn.asn import ASNResource, AsyncASNResource from .domains import ( Domains, AsyncDomains, @@ -62,12 +62,12 @@ ) from ..._resource import SyncAPIResource, AsyncAPIResource from .domain_history import ( - DomainHistory, - AsyncDomainHistory, - DomainHistoryWithRawResponse, - AsyncDomainHistoryWithRawResponse, - DomainHistoryWithStreamingResponse, - AsyncDomainHistoryWithStreamingResponse, + DomainHistoryResource, + AsyncDomainHistoryResource, + DomainHistoryResourceWithRawResponse, + AsyncDomainHistoryResourceWithRawResponse, + DomainHistoryResourceWithStreamingResponse, + AsyncDomainHistoryResourceWithStreamingResponse, ) from .domains.domains import Domains, AsyncDomains from .indicator_feeds import ( @@ -102,8 +102,8 @@ class Intel(SyncAPIResource): @cached_property - def asn(self) -> ASN: - return ASN(self._client) + def asn(self) -> ASNResource: + return ASNResource(self._client) @cached_property def dns(self) -> DNS: @@ -114,8 +114,8 @@ def domains(self) -> Domains: return Domains(self._client) @cached_property - def domain_history(self) -> DomainHistory: - return DomainHistory(self._client) + def domain_history(self) -> DomainHistoryResource: + return DomainHistoryResource(self._client) @cached_property def ips(self) -> IPs: @@ -156,8 +156,8 @@ def with_streaming_response(self) -> IntelWithStreamingResponse: class AsyncIntel(AsyncAPIResource): @cached_property - def asn(self) -> AsyncASN: - return AsyncASN(self._client) + def asn(self) -> AsyncASNResource: + return AsyncASNResource(self._client) @cached_property def dns(self) -> AsyncDNS: @@ -168,8 +168,8 @@ def domains(self) -> AsyncDomains: return AsyncDomains(self._client) @cached_property - def domain_history(self) -> AsyncDomainHistory: - return AsyncDomainHistory(self._client) + def domain_history(self) -> AsyncDomainHistoryResource: + return AsyncDomainHistoryResource(self._client) @cached_property def ips(self) -> AsyncIPs: @@ -213,8 +213,8 @@ def __init__(self, intel: Intel) -> None: self._intel = intel @cached_property - def asn(self) -> ASNWithRawResponse: - return ASNWithRawResponse(self._intel.asn) + def asn(self) -> ASNResourceWithRawResponse: + return ASNResourceWithRawResponse(self._intel.asn) @cached_property def dns(self) -> DNSWithRawResponse: @@ -225,8 +225,8 @@ def domains(self) -> DomainsWithRawResponse: return DomainsWithRawResponse(self._intel.domains) @cached_property - def domain_history(self) -> DomainHistoryWithRawResponse: - return DomainHistoryWithRawResponse(self._intel.domain_history) + def domain_history(self) -> DomainHistoryResourceWithRawResponse: + return DomainHistoryResourceWithRawResponse(self._intel.domain_history) @cached_property def ips(self) -> IPsWithRawResponse: @@ -262,8 +262,8 @@ def __init__(self, intel: AsyncIntel) -> None: self._intel = intel @cached_property - def asn(self) -> AsyncASNWithRawResponse: - return AsyncASNWithRawResponse(self._intel.asn) + def asn(self) -> AsyncASNResourceWithRawResponse: + return AsyncASNResourceWithRawResponse(self._intel.asn) @cached_property def dns(self) -> AsyncDNSWithRawResponse: @@ -274,8 +274,8 @@ def domains(self) -> AsyncDomainsWithRawResponse: return AsyncDomainsWithRawResponse(self._intel.domains) @cached_property - def domain_history(self) -> AsyncDomainHistoryWithRawResponse: - return AsyncDomainHistoryWithRawResponse(self._intel.domain_history) + def domain_history(self) -> AsyncDomainHistoryResourceWithRawResponse: + return AsyncDomainHistoryResourceWithRawResponse(self._intel.domain_history) @cached_property def ips(self) -> AsyncIPsWithRawResponse: @@ -311,8 +311,8 @@ def __init__(self, intel: Intel) -> None: self._intel = intel @cached_property - def asn(self) -> ASNWithStreamingResponse: - return ASNWithStreamingResponse(self._intel.asn) + def asn(self) -> ASNResourceWithStreamingResponse: + return ASNResourceWithStreamingResponse(self._intel.asn) @cached_property def dns(self) -> DNSWithStreamingResponse: @@ -323,8 +323,8 @@ def domains(self) -> DomainsWithStreamingResponse: return DomainsWithStreamingResponse(self._intel.domains) @cached_property - def domain_history(self) -> DomainHistoryWithStreamingResponse: - return DomainHistoryWithStreamingResponse(self._intel.domain_history) + def domain_history(self) -> DomainHistoryResourceWithStreamingResponse: + return DomainHistoryResourceWithStreamingResponse(self._intel.domain_history) @cached_property def ips(self) -> IPsWithStreamingResponse: @@ -360,8 +360,8 @@ def __init__(self, intel: AsyncIntel) -> None: self._intel = intel @cached_property - def asn(self) -> AsyncASNWithStreamingResponse: - return AsyncASNWithStreamingResponse(self._intel.asn) + def asn(self) -> AsyncASNResourceWithStreamingResponse: + return AsyncASNResourceWithStreamingResponse(self._intel.asn) @cached_property def dns(self) -> AsyncDNSWithStreamingResponse: @@ -372,8 +372,8 @@ def domains(self) -> AsyncDomainsWithStreamingResponse: return AsyncDomainsWithStreamingResponse(self._intel.domains) @cached_property - def domain_history(self) -> AsyncDomainHistoryWithStreamingResponse: - return AsyncDomainHistoryWithStreamingResponse(self._intel.domain_history) + def domain_history(self) -> AsyncDomainHistoryResourceWithStreamingResponse: + return AsyncDomainHistoryResourceWithStreamingResponse(self._intel.domain_history) @cached_property def ips(self) -> AsyncIPsWithStreamingResponse: diff --git a/src/cloudflare/resources/intel/sinkholes.py b/src/cloudflare/resources/intel/sinkholes.py index ecd8c6c8e4e..37298291a02 100644 --- a/src/cloudflare/resources/intel/sinkholes.py +++ b/src/cloudflare/resources/intel/sinkholes.py @@ -14,7 +14,7 @@ async_to_streamed_response_wrapper, ) from ...pagination import SyncSinglePage, AsyncSinglePage -from ...types.intel import IntelSinkholeItem +from ...types.intel import SinkholeItem from ..._base_client import ( AsyncPaginator, make_request_options, @@ -42,7 +42,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[IntelSinkholeItem]: + ) -> SyncSinglePage[SinkholeItem]: """ List sinkholes owned by this account @@ -61,11 +61,11 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/intel/sinkholes", - page=SyncSinglePage[IntelSinkholeItem], + page=SyncSinglePage[SinkholeItem], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=IntelSinkholeItem, + model=SinkholeItem, ) @@ -88,7 +88,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[IntelSinkholeItem, AsyncSinglePage[IntelSinkholeItem]]: + ) -> AsyncPaginator[SinkholeItem, AsyncSinglePage[SinkholeItem]]: """ List sinkholes owned by this account @@ -107,11 +107,11 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/intel/sinkholes", - page=AsyncSinglePage[IntelSinkholeItem], + page=AsyncSinglePage[SinkholeItem], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=IntelSinkholeItem, + model=SinkholeItem, ) diff --git a/src/cloudflare/resources/intel/whois.py b/src/cloudflare/resources/intel/whois.py index 01ed43b6f03..14e83309360 100644 --- a/src/cloudflare/resources/intel/whois.py +++ b/src/cloudflare/resources/intel/whois.py @@ -20,7 +20,7 @@ async_to_streamed_response_wrapper, ) from ..._wrappers import ResultWrapper -from ...types.intel import IntelWhois, whois_get_params +from ...types.intel import whois, whois_get_params from ..._base_client import ( make_request_options, ) @@ -48,7 +48,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> IntelWhois: + ) -> whois.Whois: """ Get WHOIS Record @@ -75,7 +75,7 @@ def get( query=maybe_transform({"domain": domain}, whois_get_params.WhoisGetParams), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[IntelWhois], ResultWrapper[IntelWhois]), + cast_to=cast(Type[whois.Whois], ResultWrapper[whois.Whois]), ) @@ -99,7 +99,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> IntelWhois: + ) -> whois.Whois: """ Get WHOIS Record @@ -126,7 +126,7 @@ async def get( query=await async_maybe_transform({"domain": domain}, whois_get_params.WhoisGetParams), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[IntelWhois], ResultWrapper[IntelWhois]), + cast_to=cast(Type[whois.Whois], ResultWrapper[whois.Whois]), ) diff --git a/src/cloudflare/resources/keyless_certificates.py b/src/cloudflare/resources/keyless_certificates.py index 700a9dc23a6..6ab2afa8aad 100644 --- a/src/cloudflare/resources/keyless_certificates.py +++ b/src/cloudflare/resources/keyless_certificates.py @@ -7,8 +7,9 @@ import httpx from ..types import ( + Hostname, TunnelParam, - KeylessCertificateHostname, + KeylessCertificate, UnnamedSchemaRef16aca57bde2963201c7e6e895436c1c1, keyless_certificate_edit_params, keyless_certificate_create_params, @@ -63,7 +64,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> KeylessCertificateHostname: + ) -> Hostname: """ Create Keyless SSL Configuration @@ -116,7 +117,7 @@ def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[KeylessCertificateHostname], ResultWrapper[KeylessCertificateHostname]), + cast_to=cast(Type[Hostname], ResultWrapper[Hostname]), ) def list( @@ -129,7 +130,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[KeylessCertificateHostname]: + ) -> SyncSinglePage[KeylessCertificate]: """ List all Keyless SSL configurations for a given zone. @@ -148,11 +149,11 @@ def list( raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get_api_list( f"/zones/{zone_id}/keyless_certificates", - page=SyncSinglePage[KeylessCertificateHostname], + page=SyncSinglePage[KeylessCertificate], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=KeylessCertificateHostname, + model=KeylessCertificate, ) def delete( @@ -222,7 +223,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> KeylessCertificateHostname: + ) -> Hostname: """This will update attributes of a Keyless SSL. Consists of one or more of the @@ -277,7 +278,7 @@ def edit( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[KeylessCertificateHostname], ResultWrapper[KeylessCertificateHostname]), + cast_to=cast(Type[Hostname], ResultWrapper[Hostname]), ) def get( @@ -291,7 +292,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> KeylessCertificateHostname: + ) -> Hostname: """ Get details for one Keyless SSL configuration. @@ -323,7 +324,7 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[KeylessCertificateHostname], ResultWrapper[KeylessCertificateHostname]), + cast_to=cast(Type[Hostname], ResultWrapper[Hostname]), ) @@ -352,7 +353,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> KeylessCertificateHostname: + ) -> Hostname: """ Create Keyless SSL Configuration @@ -405,7 +406,7 @@ async def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[KeylessCertificateHostname], ResultWrapper[KeylessCertificateHostname]), + cast_to=cast(Type[Hostname], ResultWrapper[Hostname]), ) def list( @@ -418,7 +419,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[KeylessCertificateHostname, AsyncSinglePage[KeylessCertificateHostname]]: + ) -> AsyncPaginator[KeylessCertificate, AsyncSinglePage[KeylessCertificate]]: """ List all Keyless SSL configurations for a given zone. @@ -437,11 +438,11 @@ def list( raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get_api_list( f"/zones/{zone_id}/keyless_certificates", - page=AsyncSinglePage[KeylessCertificateHostname], + page=AsyncSinglePage[KeylessCertificate], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=KeylessCertificateHostname, + model=KeylessCertificate, ) async def delete( @@ -511,7 +512,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> KeylessCertificateHostname: + ) -> Hostname: """This will update attributes of a Keyless SSL. Consists of one or more of the @@ -566,7 +567,7 @@ async def edit( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[KeylessCertificateHostname], ResultWrapper[KeylessCertificateHostname]), + cast_to=cast(Type[Hostname], ResultWrapper[Hostname]), ) async def get( @@ -580,7 +581,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> KeylessCertificateHostname: + ) -> Hostname: """ Get details for one Keyless SSL configuration. @@ -612,7 +613,7 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[KeylessCertificateHostname], ResultWrapper[KeylessCertificateHostname]), + cast_to=cast(Type[Hostname], ResultWrapper[Hostname]), ) diff --git a/src/cloudflare/resources/kv/namespaces/keys.py b/src/cloudflare/resources/kv/namespaces/keys.py index 86bc2d6296c..10ba4df5c0b 100644 --- a/src/cloudflare/resources/kv/namespaces/keys.py +++ b/src/cloudflare/resources/kv/namespaces/keys.py @@ -19,7 +19,7 @@ AsyncPaginator, make_request_options, ) -from ....types.kv.namespaces import WorkersKVKey, key_list_params +from ....types.kv.namespaces import Key, key_list_params __all__ = ["Keys", "AsyncKeys"] @@ -47,7 +47,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncCursorLimitPagination[WorkersKVKey]: + ) -> SyncCursorLimitPagination[Key]: """ Lists a namespace's keys. @@ -81,7 +81,7 @@ def list( raise ValueError(f"Expected a non-empty value for `namespace_id` but received {namespace_id!r}") return self._get_api_list( f"/accounts/{account_id}/storage/kv/namespaces/{namespace_id}/keys", - page=SyncCursorLimitPagination[WorkersKVKey], + page=SyncCursorLimitPagination[Key], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -96,7 +96,7 @@ def list( key_list_params.KeyListParams, ), ), - model=WorkersKVKey, + model=Key, ) @@ -123,7 +123,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[WorkersKVKey, AsyncCursorLimitPagination[WorkersKVKey]]: + ) -> AsyncPaginator[Key, AsyncCursorLimitPagination[Key]]: """ Lists a namespace's keys. @@ -157,7 +157,7 @@ def list( raise ValueError(f"Expected a non-empty value for `namespace_id` but received {namespace_id!r}") return self._get_api_list( f"/accounts/{account_id}/storage/kv/namespaces/{namespace_id}/keys", - page=AsyncCursorLimitPagination[WorkersKVKey], + page=AsyncCursorLimitPagination[Key], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -172,7 +172,7 @@ def list( key_list_params.KeyListParams, ), ), - model=WorkersKVKey, + model=Key, ) diff --git a/src/cloudflare/resources/kv/namespaces/namespaces.py b/src/cloudflare/resources/kv/namespaces/namespaces.py index 0c4b86a3ce8..ef005563556 100644 --- a/src/cloudflare/resources/kv/namespaces/namespaces.py +++ b/src/cloudflare/resources/kv/namespaces/namespaces.py @@ -46,7 +46,7 @@ ) from ...._compat import cached_property from ....types.kv import ( - WorkersKVNamespace, + Namespace, namespace_list_params, namespace_create_params, namespace_delete_params, @@ -106,7 +106,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> WorkersKVNamespace: + ) -> Namespace: """Creates a namespace under the given title. A `400` is returned if the account @@ -138,7 +138,7 @@ def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[WorkersKVNamespace], ResultWrapper[WorkersKVNamespace]), + cast_to=cast(Type[Namespace], ResultWrapper[Namespace]), ) def update( @@ -208,7 +208,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncV4PagePaginationArray[WorkersKVNamespace]: + ) -> SyncV4PagePaginationArray[Namespace]: """ Returns the namespaces owned by an account. @@ -235,7 +235,7 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/storage/kv/namespaces", - page=SyncV4PagePaginationArray[WorkersKVNamespace], + page=SyncV4PagePaginationArray[Namespace], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -251,7 +251,7 @@ def list( namespace_list_params.NamespaceListParams, ), ), - model=WorkersKVNamespace, + model=Namespace, ) def delete( @@ -342,7 +342,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> WorkersKVNamespace: + ) -> Namespace: """Creates a namespace under the given title. A `400` is returned if the account @@ -374,7 +374,7 @@ async def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[WorkersKVNamespace], ResultWrapper[WorkersKVNamespace]), + cast_to=cast(Type[Namespace], ResultWrapper[Namespace]), ) async def update( @@ -444,7 +444,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[WorkersKVNamespace, AsyncV4PagePaginationArray[WorkersKVNamespace]]: + ) -> AsyncPaginator[Namespace, AsyncV4PagePaginationArray[Namespace]]: """ Returns the namespaces owned by an account. @@ -471,7 +471,7 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/storage/kv/namespaces", - page=AsyncV4PagePaginationArray[WorkersKVNamespace], + page=AsyncV4PagePaginationArray[Namespace], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -487,7 +487,7 @@ def list( namespace_list_params.NamespaceListParams, ), ), - model=WorkersKVNamespace, + model=Namespace, ) async def delete( diff --git a/src/cloudflare/resources/load_balancers/pools/pools.py b/src/cloudflare/resources/load_balancers/pools/pools.py index 611e7389ba2..9c4f01c48c6 100644 --- a/src/cloudflare/resources/load_balancers/pools/pools.py +++ b/src/cloudflare/resources/load_balancers/pools/pools.py @@ -15,7 +15,8 @@ AsyncHealthWithStreamingResponse, ) from ....types import ( - OriginItemParam, + CheckRegion, + OriginParam, LoadSheddingParam, OriginSteeringParam, NotificationFilterParam, @@ -48,7 +49,6 @@ make_request_options, ) from ....types.load_balancers import ( - CheckRegion, PoolDeleteResponse, pool_edit_params, pool_list_params, @@ -83,7 +83,7 @@ def create( *, account_id: str, name: str, - origins: Iterable[OriginItemParam], + origins: Iterable[OriginParam], description: str | NotGiven = NOT_GIVEN, enabled: bool | NotGiven = NOT_GIVEN, latitude: float | NotGiven = NOT_GIVEN, @@ -191,7 +191,7 @@ def update( *, account_id: str, name: str, - origins: Iterable[OriginItemParam], + origins: Iterable[OriginParam], check_regions: Optional[List[CheckRegion]] | NotGiven = NOT_GIVEN, description: str | NotGiven = NOT_GIVEN, enabled: bool | NotGiven = NOT_GIVEN, @@ -405,7 +405,7 @@ def edit( notification_email: str | NotGiven = NOT_GIVEN, notification_filter: Optional[NotificationFilterParam] | NotGiven = NOT_GIVEN, origin_steering: OriginSteeringParam | NotGiven = NOT_GIVEN, - origins: Iterable[OriginItemParam] | NotGiven = NOT_GIVEN, + origins: Iterable[OriginParam] | 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, @@ -568,7 +568,7 @@ async def create( *, account_id: str, name: str, - origins: Iterable[OriginItemParam], + origins: Iterable[OriginParam], description: str | NotGiven = NOT_GIVEN, enabled: bool | NotGiven = NOT_GIVEN, latitude: float | NotGiven = NOT_GIVEN, @@ -676,7 +676,7 @@ async def update( *, account_id: str, name: str, - origins: Iterable[OriginItemParam], + origins: Iterable[OriginParam], check_regions: Optional[List[CheckRegion]] | NotGiven = NOT_GIVEN, description: str | NotGiven = NOT_GIVEN, enabled: bool | NotGiven = NOT_GIVEN, @@ -890,7 +890,7 @@ async def edit( notification_email: str | NotGiven = NOT_GIVEN, notification_filter: Optional[NotificationFilterParam] | NotGiven = NOT_GIVEN, origin_steering: OriginSteeringParam | NotGiven = NOT_GIVEN, - origins: Iterable[OriginItemParam] | NotGiven = NOT_GIVEN, + origins: Iterable[OriginParam] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, diff --git a/src/cloudflare/resources/load_balancers/previews.py b/src/cloudflare/resources/load_balancers/previews.py index 06267b7e36a..e896b284fc8 100644 --- a/src/cloudflare/resources/load_balancers/previews.py +++ b/src/cloudflare/resources/load_balancers/previews.py @@ -19,7 +19,7 @@ from ..._base_client import ( make_request_options, ) -from ...types.user.load_balancers import LoadBalancingPreview +from ...types.user.load_balancers import Preview __all__ = ["Previews", "AsyncPreviews"] @@ -44,7 +44,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LoadBalancingPreview: + ) -> Preview: """ Get the result of a previous preview operation using the provided preview_id. @@ -72,7 +72,7 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[LoadBalancingPreview], ResultWrapper[LoadBalancingPreview]), + cast_to=cast(Type[Preview], ResultWrapper[Preview]), ) @@ -96,7 +96,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LoadBalancingPreview: + ) -> Preview: """ Get the result of a previous preview operation using the provided preview_id. @@ -124,7 +124,7 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[LoadBalancingPreview], ResultWrapper[LoadBalancingPreview]), + cast_to=cast(Type[Preview], ResultWrapper[Preview]), ) diff --git a/src/cloudflare/resources/magic_network_monitoring/configs/configs.py b/src/cloudflare/resources/magic_network_monitoring/configs/configs.py index f0144152ae0..efb97ba52b1 100644 --- a/src/cloudflare/resources/magic_network_monitoring/configs/configs.py +++ b/src/cloudflare/resources/magic_network_monitoring/configs/configs.py @@ -32,7 +32,7 @@ make_request_options, ) from ....types.magic_network_monitoring import ( - MagicNetworkMonitoringConfig, + Configuration, config_edit_params, config_create_params, config_delete_params, @@ -66,7 +66,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> MagicNetworkMonitoringConfig: + ) -> Configuration: """ Create a new network monitoring configuration. @@ -91,7 +91,7 @@ def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[MagicNetworkMonitoringConfig], ResultWrapper[MagicNetworkMonitoringConfig]), + cast_to=cast(Type[Configuration], ResultWrapper[Configuration]), ) def update( @@ -105,7 +105,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> MagicNetworkMonitoringConfig: + ) -> Configuration: """ Update an existing network monitoring configuration, requires the entire configuration to be updated at once. @@ -131,7 +131,7 @@ def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[MagicNetworkMonitoringConfig], ResultWrapper[MagicNetworkMonitoringConfig]), + cast_to=cast(Type[Configuration], ResultWrapper[Configuration]), ) def delete( @@ -145,7 +145,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> MagicNetworkMonitoringConfig: + ) -> Configuration: """ Delete an existing network monitoring configuration. @@ -170,7 +170,7 @@ def delete( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[MagicNetworkMonitoringConfig], ResultWrapper[MagicNetworkMonitoringConfig]), + cast_to=cast(Type[Configuration], ResultWrapper[Configuration]), ) def edit( @@ -184,7 +184,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> MagicNetworkMonitoringConfig: + ) -> Configuration: """ Update fields in an existing network monitoring configuration. @@ -209,7 +209,7 @@ def edit( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[MagicNetworkMonitoringConfig], ResultWrapper[MagicNetworkMonitoringConfig]), + cast_to=cast(Type[Configuration], ResultWrapper[Configuration]), ) def get( @@ -222,7 +222,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> MagicNetworkMonitoringConfig: + ) -> Configuration: """ Lists default sampling and router IPs for account. @@ -246,7 +246,7 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[MagicNetworkMonitoringConfig], ResultWrapper[MagicNetworkMonitoringConfig]), + cast_to=cast(Type[Configuration], ResultWrapper[Configuration]), ) @@ -274,7 +274,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> MagicNetworkMonitoringConfig: + ) -> Configuration: """ Create a new network monitoring configuration. @@ -299,7 +299,7 @@ async def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[MagicNetworkMonitoringConfig], ResultWrapper[MagicNetworkMonitoringConfig]), + cast_to=cast(Type[Configuration], ResultWrapper[Configuration]), ) async def update( @@ -313,7 +313,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> MagicNetworkMonitoringConfig: + ) -> Configuration: """ Update an existing network monitoring configuration, requires the entire configuration to be updated at once. @@ -339,7 +339,7 @@ async def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[MagicNetworkMonitoringConfig], ResultWrapper[MagicNetworkMonitoringConfig]), + cast_to=cast(Type[Configuration], ResultWrapper[Configuration]), ) async def delete( @@ -353,7 +353,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> MagicNetworkMonitoringConfig: + ) -> Configuration: """ Delete an existing network monitoring configuration. @@ -378,7 +378,7 @@ async def delete( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[MagicNetworkMonitoringConfig], ResultWrapper[MagicNetworkMonitoringConfig]), + cast_to=cast(Type[Configuration], ResultWrapper[Configuration]), ) async def edit( @@ -392,7 +392,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> MagicNetworkMonitoringConfig: + ) -> Configuration: """ Update fields in an existing network monitoring configuration. @@ -417,7 +417,7 @@ async def edit( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[MagicNetworkMonitoringConfig], ResultWrapper[MagicNetworkMonitoringConfig]), + cast_to=cast(Type[Configuration], ResultWrapper[Configuration]), ) async def get( @@ -430,7 +430,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> MagicNetworkMonitoringConfig: + ) -> Configuration: """ Lists default sampling and router IPs for account. @@ -454,7 +454,7 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[MagicNetworkMonitoringConfig], ResultWrapper[MagicNetworkMonitoringConfig]), + cast_to=cast(Type[Configuration], ResultWrapper[Configuration]), ) diff --git a/src/cloudflare/resources/magic_network_monitoring/configs/full.py b/src/cloudflare/resources/magic_network_monitoring/configs/full.py index 14f0d1a6dde..ea693256282 100644 --- a/src/cloudflare/resources/magic_network_monitoring/configs/full.py +++ b/src/cloudflare/resources/magic_network_monitoring/configs/full.py @@ -19,7 +19,7 @@ from ...._base_client import ( make_request_options, ) -from ....types.magic_network_monitoring import MagicNetworkMonitoringConfig +from ....types.magic_network_monitoring import Configuration __all__ = ["Full", "AsyncFull"] @@ -43,7 +43,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> MagicNetworkMonitoringConfig: + ) -> Configuration: """ Lists default sampling, router IPs, and rules for account. @@ -67,7 +67,7 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[MagicNetworkMonitoringConfig], ResultWrapper[MagicNetworkMonitoringConfig]), + cast_to=cast(Type[Configuration], ResultWrapper[Configuration]), ) @@ -90,7 +90,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> MagicNetworkMonitoringConfig: + ) -> Configuration: """ Lists default sampling, router IPs, and rules for account. @@ -114,7 +114,7 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[MagicNetworkMonitoringConfig], ResultWrapper[MagicNetworkMonitoringConfig]), + cast_to=cast(Type[Configuration], ResultWrapper[Configuration]), ) diff --git a/src/cloudflare/resources/magic_network_monitoring/rules/advertisements.py b/src/cloudflare/resources/magic_network_monitoring/rules/advertisements.py index 58535efb5bb..e2ca1205ecf 100644 --- a/src/cloudflare/resources/magic_network_monitoring/rules/advertisements.py +++ b/src/cloudflare/resources/magic_network_monitoring/rules/advertisements.py @@ -23,7 +23,7 @@ from ...._base_client import ( make_request_options, ) -from ....types.magic_network_monitoring.rules import MagicNetworkMonitoringRuleAdvertisable, advertisement_edit_params +from ....types.magic_network_monitoring.rules import Advertisement, advertisement_edit_params __all__ = ["Advertisements", "AsyncAdvertisements"] @@ -49,7 +49,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[MagicNetworkMonitoringRuleAdvertisable]: + ) -> Optional[Advertisement]: """ Update advertisement for rule. @@ -76,10 +76,7 @@ def edit( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast( - Type[Optional[MagicNetworkMonitoringRuleAdvertisable]], - ResultWrapper[MagicNetworkMonitoringRuleAdvertisable], - ), + cast_to=cast(Type[Optional[Advertisement]], ResultWrapper[Advertisement]), ) @@ -104,7 +101,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[MagicNetworkMonitoringRuleAdvertisable]: + ) -> Optional[Advertisement]: """ Update advertisement for rule. @@ -131,10 +128,7 @@ async def edit( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast( - Type[Optional[MagicNetworkMonitoringRuleAdvertisable]], - ResultWrapper[MagicNetworkMonitoringRuleAdvertisable], - ), + cast_to=cast(Type[Optional[Advertisement]], ResultWrapper[Advertisement]), ) diff --git a/src/cloudflare/resources/managed_headers.py b/src/cloudflare/resources/managed_headers.py index ae715f2683f..2ef53643588 100644 --- a/src/cloudflare/resources/managed_headers.py +++ b/src/cloudflare/resources/managed_headers.py @@ -7,7 +7,7 @@ import httpx from ..types import ( - RequestListItemParam, + RequestModelParam, ManagedHeaderEditResponse, ManagedHeaderListResponse, managed_header_edit_params, @@ -80,8 +80,8 @@ def edit( self, *, zone_id: str, - managed_request_headers: Iterable[RequestListItemParam], - managed_response_headers: Iterable[RequestListItemParam], + managed_request_headers: Iterable[RequestModelParam], + managed_response_headers: Iterable[RequestModelParam], # 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, @@ -169,8 +169,8 @@ async def edit( self, *, zone_id: str, - managed_request_headers: Iterable[RequestListItemParam], - managed_response_headers: Iterable[RequestListItemParam], + managed_request_headers: Iterable[RequestModelParam], + managed_response_headers: Iterable[RequestModelParam], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, diff --git a/src/cloudflare/resources/mtls_certificates/mtls_certificates.py b/src/cloudflare/resources/mtls_certificates/mtls_certificates.py index 67a1d4b29e1..6495b75b34b 100644 --- a/src/cloudflare/resources/mtls_certificates/mtls_certificates.py +++ b/src/cloudflare/resources/mtls_certificates/mtls_certificates.py @@ -8,7 +8,7 @@ from ...types import ( MTLSCertificate, - MTLSCertificateUpdate, + MTLSCertificateCreateResponse, mtls_certificate_create_params, mtls_certificate_delete_params, ) @@ -70,7 +70,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> MTLSCertificateUpdate: + ) -> MTLSCertificateCreateResponse: """ Upload a certificate that you want to use with mTLS-enabled Cloudflare services. @@ -113,7 +113,7 @@ def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[MTLSCertificateUpdate], ResultWrapper[MTLSCertificateUpdate]), + cast_to=cast(Type[MTLSCertificateCreateResponse], ResultWrapper[MTLSCertificateCreateResponse]), ) def list( @@ -275,7 +275,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> MTLSCertificateUpdate: + ) -> MTLSCertificateCreateResponse: """ Upload a certificate that you want to use with mTLS-enabled Cloudflare services. @@ -318,7 +318,7 @@ async def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[MTLSCertificateUpdate], ResultWrapper[MTLSCertificateUpdate]), + cast_to=cast(Type[MTLSCertificateCreateResponse], ResultWrapper[MTLSCertificateCreateResponse]), ) def list( diff --git a/src/cloudflare/resources/origin_tls_client_auth/hostnames/certificates.py b/src/cloudflare/resources/origin_tls_client_auth/hostnames/certificates.py index a48879933af..5e6b5108291 100644 --- a/src/cloudflare/resources/origin_tls_client_auth/hostnames/certificates.py +++ b/src/cloudflare/resources/origin_tls_client_auth/hostnames/certificates.py @@ -25,12 +25,8 @@ AsyncPaginator, make_request_options, ) -from ....types.origin_tls_client_auth import OriginTLSClientCertificateID -from ....types.origin_tls_client_auth.hostnames import ( - OriginTLSClientCertificate, - certificate_create_params, - certificate_delete_params, -) +from ....types.origin_tls_client_auth import AuthenticatedOriginPull +from ....types.origin_tls_client_auth.hostnames import Certificate, certificate_create_params, certificate_delete_params __all__ = ["Certificates", "AsyncCertificates"] @@ -56,7 +52,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> OriginTLSClientCertificate: + ) -> Certificate: """Upload a certificate to be used for client authentication on a hostname. 10 @@ -95,7 +91,7 @@ def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[OriginTLSClientCertificate], ResultWrapper[OriginTLSClientCertificate]), + cast_to=cast(Type[Certificate], ResultWrapper[Certificate]), ) def list( @@ -108,7 +104,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[OriginTLSClientCertificateID]: + ) -> SyncSinglePage[AuthenticatedOriginPull]: """ List Certificates @@ -127,11 +123,11 @@ def list( raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get_api_list( f"/zones/{zone_id}/origin_tls_client_auth/hostnames/certificates", - page=SyncSinglePage[OriginTLSClientCertificateID], + page=SyncSinglePage[AuthenticatedOriginPull], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=OriginTLSClientCertificateID, + model=AuthenticatedOriginPull, ) def delete( @@ -146,7 +142,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> OriginTLSClientCertificate: + ) -> Certificate: """ Delete Hostname Client Certificate @@ -177,7 +173,7 @@ def delete( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[OriginTLSClientCertificate], ResultWrapper[OriginTLSClientCertificate]), + cast_to=cast(Type[Certificate], ResultWrapper[Certificate]), ) def get( @@ -191,7 +187,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> OriginTLSClientCertificate: + ) -> Certificate: """ Get the certificate by ID to be used for client authentication on a hostname. @@ -221,7 +217,7 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[OriginTLSClientCertificate], ResultWrapper[OriginTLSClientCertificate]), + cast_to=cast(Type[Certificate], ResultWrapper[Certificate]), ) @@ -246,7 +242,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> OriginTLSClientCertificate: + ) -> Certificate: """Upload a certificate to be used for client authentication on a hostname. 10 @@ -285,7 +281,7 @@ async def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[OriginTLSClientCertificate], ResultWrapper[OriginTLSClientCertificate]), + cast_to=cast(Type[Certificate], ResultWrapper[Certificate]), ) def list( @@ -298,7 +294,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[OriginTLSClientCertificateID, AsyncSinglePage[OriginTLSClientCertificateID]]: + ) -> AsyncPaginator[AuthenticatedOriginPull, AsyncSinglePage[AuthenticatedOriginPull]]: """ List Certificates @@ -317,11 +313,11 @@ def list( raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get_api_list( f"/zones/{zone_id}/origin_tls_client_auth/hostnames/certificates", - page=AsyncSinglePage[OriginTLSClientCertificateID], + page=AsyncSinglePage[AuthenticatedOriginPull], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=OriginTLSClientCertificateID, + model=AuthenticatedOriginPull, ) async def delete( @@ -336,7 +332,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> OriginTLSClientCertificate: + ) -> Certificate: """ Delete Hostname Client Certificate @@ -367,7 +363,7 @@ async def delete( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[OriginTLSClientCertificate], ResultWrapper[OriginTLSClientCertificate]), + cast_to=cast(Type[Certificate], ResultWrapper[Certificate]), ) async def get( @@ -381,7 +377,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> OriginTLSClientCertificate: + ) -> Certificate: """ Get the certificate by ID to be used for client authentication on a hostname. @@ -411,7 +407,7 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[OriginTLSClientCertificate], ResultWrapper[OriginTLSClientCertificate]), + cast_to=cast(Type[Certificate], ResultWrapper[Certificate]), ) diff --git a/src/cloudflare/resources/origin_tls_client_auth/hostnames/hostnames.py b/src/cloudflare/resources/origin_tls_client_auth/hostnames/hostnames.py index 2ebc5bf3915..bdf976384d5 100644 --- a/src/cloudflare/resources/origin_tls_client_auth/hostnames/hostnames.py +++ b/src/cloudflare/resources/origin_tls_client_auth/hostnames/hostnames.py @@ -31,11 +31,7 @@ from ...._base_client import ( make_request_options, ) -from ....types.origin_tls_client_auth import ( - HostnameUpdateResponse, - OriginTLSClientCertificateID, - hostname_update_params, -) +from ....types.origin_tls_client_auth import ID, HostnameUpdateResponse, hostname_update_params __all__ = ["Hostnames", "AsyncHostnames"] @@ -109,7 +105,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> OriginTLSClientCertificateID: + ) -> ID: """ Get the Hostname Status for Client Authentication @@ -140,7 +136,7 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[OriginTLSClientCertificateID], ResultWrapper[OriginTLSClientCertificateID]), + cast_to=cast(Type[ID], ResultWrapper[ID]), ) @@ -213,7 +209,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> OriginTLSClientCertificateID: + ) -> ID: """ Get the Hostname Status for Client Authentication @@ -244,7 +240,7 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[OriginTLSClientCertificateID], ResultWrapper[OriginTLSClientCertificateID]), + cast_to=cast(Type[ID], ResultWrapper[ID]), ) diff --git a/src/cloudflare/resources/origin_tls_client_auth/origin_tls_client_auth.py b/src/cloudflare/resources/origin_tls_client_auth/origin_tls_client_auth.py index 8ecae3b0394..0a1c7d5ddfb 100644 --- a/src/cloudflare/resources/origin_tls_client_auth/origin_tls_client_auth.py +++ b/src/cloudflare/resources/origin_tls_client_auth/origin_tls_client_auth.py @@ -7,7 +7,7 @@ import httpx from ...types import ( - OriginTLSClientAuthListResponse, + ZoneAuthenticatedOriginPull, origin_tls_client_auth_create_params, origin_tls_client_auth_delete_params, ) @@ -140,7 +140,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[OriginTLSClientAuthListResponse]: + ) -> SyncSinglePage[ZoneAuthenticatedOriginPull]: """ List Certificates @@ -159,11 +159,11 @@ def list( raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get_api_list( f"/zones/{zone_id}/origin_tls_client_auth", - page=SyncSinglePage[OriginTLSClientAuthListResponse], + page=SyncSinglePage[ZoneAuthenticatedOriginPull], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=OriginTLSClientAuthListResponse, + model=ZoneAuthenticatedOriginPull, ) def delete( @@ -355,7 +355,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[OriginTLSClientAuthListResponse, AsyncSinglePage[OriginTLSClientAuthListResponse]]: + ) -> AsyncPaginator[ZoneAuthenticatedOriginPull, AsyncSinglePage[ZoneAuthenticatedOriginPull]]: """ List Certificates @@ -374,11 +374,11 @@ def list( raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get_api_list( f"/zones/{zone_id}/origin_tls_client_auth", - page=AsyncSinglePage[OriginTLSClientAuthListResponse], + page=AsyncSinglePage[ZoneAuthenticatedOriginPull], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=OriginTLSClientAuthListResponse, + model=ZoneAuthenticatedOriginPull, ) async def delete( diff --git a/src/cloudflare/resources/page_shield/connections.py b/src/cloudflare/resources/page_shield/connections.py index 64c146b362e..be851a093f7 100644 --- a/src/cloudflare/resources/page_shield/connections.py +++ b/src/cloudflare/resources/page_shield/connections.py @@ -21,7 +21,7 @@ AsyncPaginator, make_request_options, ) -from ...types.page_shield import PageShieldConnection, connection_list_params +from ...types.page_shield import Connection, connection_list_params __all__ = ["Connections", "AsyncConnections"] @@ -57,7 +57,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[PageShieldConnection]: + ) -> SyncSinglePage[Connection]: """ Lists all connections detected by Page Shield. @@ -122,7 +122,7 @@ def list( raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get_api_list( f"/zones/{zone_id}/page_shield/connections", - page=SyncSinglePage[PageShieldConnection], + page=SyncSinglePage[Connection], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -146,7 +146,7 @@ def list( connection_list_params.ConnectionListParams, ), ), - model=PageShieldConnection, + model=Connection, ) def get( @@ -160,7 +160,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> PageShieldConnection: + ) -> Connection: """ Fetches a connection detected by Page Shield by connection ID. @@ -186,7 +186,7 @@ def get( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=PageShieldConnection, + cast_to=Connection, ) @@ -221,7 +221,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[PageShieldConnection, AsyncSinglePage[PageShieldConnection]]: + ) -> AsyncPaginator[Connection, AsyncSinglePage[Connection]]: """ Lists all connections detected by Page Shield. @@ -286,7 +286,7 @@ def list( raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get_api_list( f"/zones/{zone_id}/page_shield/connections", - page=AsyncSinglePage[PageShieldConnection], + page=AsyncSinglePage[Connection], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -310,7 +310,7 @@ def list( connection_list_params.ConnectionListParams, ), ), - model=PageShieldConnection, + model=Connection, ) async def get( @@ -324,7 +324,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> PageShieldConnection: + ) -> Connection: """ Fetches a connection detected by Page Shield by connection ID. @@ -350,7 +350,7 @@ async def get( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=PageShieldConnection, + cast_to=Connection, ) diff --git a/src/cloudflare/resources/page_shield/page_shield.py b/src/cloudflare/resources/page_shield/page_shield.py index 4c0d32b9133..6ea4f18f024 100644 --- a/src/cloudflare/resources/page_shield/page_shield.py +++ b/src/cloudflare/resources/page_shield/page_shield.py @@ -6,7 +6,7 @@ import httpx -from ...types import PageShieldSetting, PageShieldUpdateResponse, page_shield_update_params +from ...types import Setting, PageShieldUpdateResponse, page_shield_update_params from .scripts import ( Scripts, AsyncScripts, @@ -140,7 +140,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> PageShieldSetting: + ) -> Setting: """ Fetches the Page Shield settings. @@ -166,7 +166,7 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[PageShieldSetting], ResultWrapper[PageShieldSetting]), + cast_to=cast(Type[Setting], ResultWrapper[Setting]), ) @@ -258,7 +258,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> PageShieldSetting: + ) -> Setting: """ Fetches the Page Shield settings. @@ -284,7 +284,7 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[PageShieldSetting], ResultWrapper[PageShieldSetting]), + cast_to=cast(Type[Setting], ResultWrapper[Setting]), ) diff --git a/src/cloudflare/resources/page_shield/policies.py b/src/cloudflare/resources/page_shield/policies.py index 5f55c1bc288..adea1b1a818 100644 --- a/src/cloudflare/resources/page_shield/policies.py +++ b/src/cloudflare/resources/page_shield/policies.py @@ -24,7 +24,7 @@ AsyncPaginator, make_request_options, ) -from ...types.page_shield import PageShieldPolicy, policy_create_params, policy_update_params +from ...types.page_shield import Policy, policy_create_params, policy_update_params __all__ = ["Policies", "AsyncPolicies"] @@ -53,7 +53,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> PageShieldPolicy: + ) -> Policy: """ Create a Page Shield policy. @@ -96,7 +96,7 @@ def create( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=PageShieldPolicy, + cast_to=Policy, ) def update( @@ -115,7 +115,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> PageShieldPolicy: + ) -> Policy: """ Update a Page Shield policy by ID. @@ -162,7 +162,7 @@ def update( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=PageShieldPolicy, + cast_to=Policy, ) def list( @@ -175,7 +175,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[PageShieldPolicy]: + ) -> SyncSinglePage[Policy]: """ Lists all Page Shield policies. @@ -194,11 +194,11 @@ def list( raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get_api_list( f"/zones/{zone_id}/page_shield/policies", - page=SyncSinglePage[PageShieldPolicy], + page=SyncSinglePage[Policy], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=PageShieldPolicy, + model=Policy, ) def delete( @@ -253,7 +253,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> PageShieldPolicy: + ) -> Policy: """ Fetches a Page Shield policy by ID. @@ -279,7 +279,7 @@ def get( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=PageShieldPolicy, + cast_to=Policy, ) @@ -307,7 +307,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> PageShieldPolicy: + ) -> Policy: """ Create a Page Shield policy. @@ -350,7 +350,7 @@ async def create( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=PageShieldPolicy, + cast_to=Policy, ) async def update( @@ -369,7 +369,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> PageShieldPolicy: + ) -> Policy: """ Update a Page Shield policy by ID. @@ -416,7 +416,7 @@ async def update( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=PageShieldPolicy, + cast_to=Policy, ) def list( @@ -429,7 +429,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[PageShieldPolicy, AsyncSinglePage[PageShieldPolicy]]: + ) -> AsyncPaginator[Policy, AsyncSinglePage[Policy]]: """ Lists all Page Shield policies. @@ -448,11 +448,11 @@ def list( raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get_api_list( f"/zones/{zone_id}/page_shield/policies", - page=AsyncSinglePage[PageShieldPolicy], + page=AsyncSinglePage[Policy], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=PageShieldPolicy, + model=Policy, ) async def delete( @@ -507,7 +507,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> PageShieldPolicy: + ) -> Policy: """ Fetches a Page Shield policy by ID. @@ -533,7 +533,7 @@ async def get( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=PageShieldPolicy, + cast_to=Policy, ) diff --git a/src/cloudflare/resources/page_shield/scripts.py b/src/cloudflare/resources/page_shield/scripts.py index 58d201d5e36..da125df7dce 100644 --- a/src/cloudflare/resources/page_shield/scripts.py +++ b/src/cloudflare/resources/page_shield/scripts.py @@ -21,7 +21,7 @@ AsyncPaginator, make_request_options, ) -from ...types.page_shield import PageShieldScript, ScriptGetResponse, script_list_params +from ...types.page_shield import Script, ScriptGetResponse, script_list_params __all__ = ["Scripts", "AsyncScripts"] @@ -58,7 +58,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[PageShieldScript]: + ) -> SyncSinglePage[Script]: """ Lists all scripts detected by Page Shield. @@ -128,7 +128,7 @@ def list( raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get_api_list( f"/zones/{zone_id}/page_shield/scripts", - page=SyncSinglePage[PageShieldScript], + page=SyncSinglePage[Script], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -153,7 +153,7 @@ def list( script_list_params.ScriptListParams, ), ), - model=PageShieldScript, + model=Script, ) def get( @@ -229,7 +229,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[PageShieldScript, AsyncSinglePage[PageShieldScript]]: + ) -> AsyncPaginator[Script, AsyncSinglePage[Script]]: """ Lists all scripts detected by Page Shield. @@ -299,7 +299,7 @@ def list( raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get_api_list( f"/zones/{zone_id}/page_shield/scripts", - page=AsyncSinglePage[PageShieldScript], + page=AsyncSinglePage[Script], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -324,7 +324,7 @@ def list( script_list_params.ScriptListParams, ), ), - model=PageShieldScript, + model=Script, ) async def get( diff --git a/src/cloudflare/resources/pagerules/pagerules.py b/src/cloudflare/resources/pagerules/pagerules.py index 41b9955c190..b63d394d3a7 100644 --- a/src/cloudflare/resources/pagerules/pagerules.py +++ b/src/cloudflare/resources/pagerules/pagerules.py @@ -8,8 +8,8 @@ import httpx from ...types import ( - ActionItemParam, - TargesItemParam, + RouteParam, + TargesParam, PageruleListResponse, PageruleDeleteResponse, pagerule_edit_params, @@ -65,8 +65,8 @@ def create( self, *, zone_id: str, - actions: Iterable[ActionItemParam], - targets: Iterable[TargesItemParam], + actions: Iterable[RouteParam], + targets: Iterable[TargesParam], priority: int | NotGiven = NOT_GIVEN, status: Literal["active", "disabled"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -136,8 +136,8 @@ def update( pagerule_id: str, *, zone_id: str, - actions: Iterable[ActionItemParam], - targets: Iterable[TargesItemParam], + actions: Iterable[RouteParam], + targets: Iterable[TargesParam], priority: int | NotGiven = NOT_GIVEN, status: Literal["active", "disabled"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -320,10 +320,10 @@ def edit( pagerule_id: str, *, zone_id: str, - actions: Iterable[ActionItemParam] | NotGiven = NOT_GIVEN, + actions: Iterable[RouteParam] | NotGiven = NOT_GIVEN, priority: int | NotGiven = NOT_GIVEN, status: Literal["active", "disabled"] | NotGiven = NOT_GIVEN, - targets: Iterable[TargesItemParam] | NotGiven = NOT_GIVEN, + targets: Iterable[TargesParam] | 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, @@ -457,8 +457,8 @@ async def create( self, *, zone_id: str, - actions: Iterable[ActionItemParam], - targets: Iterable[TargesItemParam], + actions: Iterable[RouteParam], + targets: Iterable[TargesParam], priority: int | NotGiven = NOT_GIVEN, status: Literal["active", "disabled"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -528,8 +528,8 @@ async def update( pagerule_id: str, *, zone_id: str, - actions: Iterable[ActionItemParam], - targets: Iterable[TargesItemParam], + actions: Iterable[RouteParam], + targets: Iterable[TargesParam], priority: int | NotGiven = NOT_GIVEN, status: Literal["active", "disabled"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -712,10 +712,10 @@ async def edit( pagerule_id: str, *, zone_id: str, - actions: Iterable[ActionItemParam] | NotGiven = NOT_GIVEN, + actions: Iterable[RouteParam] | NotGiven = NOT_GIVEN, priority: int | NotGiven = NOT_GIVEN, status: Literal["active", "disabled"] | NotGiven = NOT_GIVEN, - targets: Iterable[TargesItemParam] | NotGiven = NOT_GIVEN, + targets: Iterable[TargesParam] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, diff --git a/src/cloudflare/resources/pagerules/settings.py b/src/cloudflare/resources/pagerules/settings.py index d78d2708c42..10275729a2d 100644 --- a/src/cloudflare/resources/pagerules/settings.py +++ b/src/cloudflare/resources/pagerules/settings.py @@ -19,7 +19,7 @@ from ..._base_client import ( make_request_options, ) -from ...types.pagerules import ZonePageruleSettings +from ...types.pagerules import SettingListResponse __all__ = ["Settings", "AsyncSettings"] @@ -43,7 +43,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZonePageruleSettings: + ) -> SettingListResponse: """ Returns a list of settings (and their details) that Page Rules can apply to matching requests. @@ -70,7 +70,7 @@ def list( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ZonePageruleSettings], ResultWrapper[ZonePageruleSettings]), + cast_to=cast(Type[SettingListResponse], ResultWrapper[SettingListResponse]), ) @@ -93,7 +93,7 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZonePageruleSettings: + ) -> SettingListResponse: """ Returns a list of settings (and their details) that Page Rules can apply to matching requests. @@ -120,7 +120,7 @@ async def list( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ZonePageruleSettings], ResultWrapper[ZonePageruleSettings]), + cast_to=cast(Type[SettingListResponse], ResultWrapper[SettingListResponse]), ) diff --git a/src/cloudflare/resources/pcaps/__init__.py b/src/cloudflare/resources/pcaps/__init__.py index a49b718eb5e..bbb51133cbe 100644 --- a/src/cloudflare/resources/pcaps/__init__.py +++ b/src/cloudflare/resources/pcaps/__init__.py @@ -17,21 +17,21 @@ AsyncDownloadWithStreamingResponse, ) from .ownership import ( - Ownership, - AsyncOwnership, - OwnershipWithRawResponse, - AsyncOwnershipWithRawResponse, - OwnershipWithStreamingResponse, - AsyncOwnershipWithStreamingResponse, + OwnershipResource, + AsyncOwnershipResource, + OwnershipResourceWithRawResponse, + AsyncOwnershipResourceWithRawResponse, + OwnershipResourceWithStreamingResponse, + AsyncOwnershipResourceWithStreamingResponse, ) __all__ = [ - "Ownership", - "AsyncOwnership", - "OwnershipWithRawResponse", - "AsyncOwnershipWithRawResponse", - "OwnershipWithStreamingResponse", - "AsyncOwnershipWithStreamingResponse", + "OwnershipResource", + "AsyncOwnershipResource", + "OwnershipResourceWithRawResponse", + "AsyncOwnershipResourceWithRawResponse", + "OwnershipResourceWithStreamingResponse", + "AsyncOwnershipResourceWithStreamingResponse", "Download", "AsyncDownload", "DownloadWithRawResponse", diff --git a/src/cloudflare/resources/pcaps/ownership.py b/src/cloudflare/resources/pcaps/ownership.py index ece8b105f61..d83a71027c8 100644 --- a/src/cloudflare/resources/pcaps/ownership.py +++ b/src/cloudflare/resources/pcaps/ownership.py @@ -20,27 +20,22 @@ async_to_streamed_response_wrapper, ) from ..._wrappers import ResultWrapper -from ...types.pcaps import ( - OwnershipGetResponse, - MagicVisibilityPCAPsOwnership, - ownership_create_params, - ownership_validate_params, -) +from ...types.pcaps import Ownership, OwnershipGetResponse, ownership_create_params, ownership_validate_params from ..._base_client import ( make_request_options, ) -__all__ = ["Ownership", "AsyncOwnership"] +__all__ = ["OwnershipResource", "AsyncOwnershipResource"] -class Ownership(SyncAPIResource): +class OwnershipResource(SyncAPIResource): @cached_property - def with_raw_response(self) -> OwnershipWithRawResponse: - return OwnershipWithRawResponse(self) + def with_raw_response(self) -> OwnershipResourceWithRawResponse: + return OwnershipResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> OwnershipWithStreamingResponse: - return OwnershipWithStreamingResponse(self) + def with_streaming_response(self) -> OwnershipResourceWithStreamingResponse: + return OwnershipResourceWithStreamingResponse(self) def create( self, @@ -53,7 +48,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> MagicVisibilityPCAPsOwnership: + ) -> Ownership: """ Adds an AWS or GCP bucket to use with full packet captures. @@ -82,7 +77,7 @@ def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[MagicVisibilityPCAPsOwnership], ResultWrapper[MagicVisibilityPCAPsOwnership]), + cast_to=cast(Type[Ownership], ResultWrapper[Ownership]), ) def delete( @@ -177,7 +172,7 @@ def validate( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> MagicVisibilityPCAPsOwnership: + ) -> Ownership: """ Validates buckets added to the packet captures API. @@ -214,18 +209,18 @@ def validate( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[MagicVisibilityPCAPsOwnership], ResultWrapper[MagicVisibilityPCAPsOwnership]), + cast_to=cast(Type[Ownership], ResultWrapper[Ownership]), ) -class AsyncOwnership(AsyncAPIResource): +class AsyncOwnershipResource(AsyncAPIResource): @cached_property - def with_raw_response(self) -> AsyncOwnershipWithRawResponse: - return AsyncOwnershipWithRawResponse(self) + def with_raw_response(self) -> AsyncOwnershipResourceWithRawResponse: + return AsyncOwnershipResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> AsyncOwnershipWithStreamingResponse: - return AsyncOwnershipWithStreamingResponse(self) + def with_streaming_response(self) -> AsyncOwnershipResourceWithStreamingResponse: + return AsyncOwnershipResourceWithStreamingResponse(self) async def create( self, @@ -238,7 +233,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> MagicVisibilityPCAPsOwnership: + ) -> Ownership: """ Adds an AWS or GCP bucket to use with full packet captures. @@ -269,7 +264,7 @@ async def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[MagicVisibilityPCAPsOwnership], ResultWrapper[MagicVisibilityPCAPsOwnership]), + cast_to=cast(Type[Ownership], ResultWrapper[Ownership]), ) async def delete( @@ -364,7 +359,7 @@ async def validate( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> MagicVisibilityPCAPsOwnership: + ) -> Ownership: """ Validates buckets added to the packet captures API. @@ -401,12 +396,12 @@ async def validate( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[MagicVisibilityPCAPsOwnership], ResultWrapper[MagicVisibilityPCAPsOwnership]), + cast_to=cast(Type[Ownership], ResultWrapper[Ownership]), ) -class OwnershipWithRawResponse: - def __init__(self, ownership: Ownership) -> None: +class OwnershipResourceWithRawResponse: + def __init__(self, ownership: OwnershipResource) -> None: self._ownership = ownership self.create = to_raw_response_wrapper( @@ -423,8 +418,8 @@ def __init__(self, ownership: Ownership) -> None: ) -class AsyncOwnershipWithRawResponse: - def __init__(self, ownership: AsyncOwnership) -> None: +class AsyncOwnershipResourceWithRawResponse: + def __init__(self, ownership: AsyncOwnershipResource) -> None: self._ownership = ownership self.create = async_to_raw_response_wrapper( @@ -441,8 +436,8 @@ def __init__(self, ownership: AsyncOwnership) -> None: ) -class OwnershipWithStreamingResponse: - def __init__(self, ownership: Ownership) -> None: +class OwnershipResourceWithStreamingResponse: + def __init__(self, ownership: OwnershipResource) -> None: self._ownership = ownership self.create = to_streamed_response_wrapper( @@ -459,8 +454,8 @@ def __init__(self, ownership: Ownership) -> None: ) -class AsyncOwnershipWithStreamingResponse: - def __init__(self, ownership: AsyncOwnership) -> None: +class AsyncOwnershipResourceWithStreamingResponse: + def __init__(self, ownership: AsyncOwnershipResource) -> None: self._ownership = ownership self.create = async_to_streamed_response_wrapper( diff --git a/src/cloudflare/resources/pcaps/pcaps.py b/src/cloudflare/resources/pcaps/pcaps.py index 2f022030035..22bc54ce2e0 100644 --- a/src/cloudflare/resources/pcaps/pcaps.py +++ b/src/cloudflare/resources/pcaps/pcaps.py @@ -30,12 +30,12 @@ ) from ..._compat import cached_property from .ownership import ( - Ownership, - AsyncOwnership, - OwnershipWithRawResponse, - AsyncOwnershipWithRawResponse, - OwnershipWithStreamingResponse, - AsyncOwnershipWithStreamingResponse, + OwnershipResource, + AsyncOwnershipResource, + OwnershipResourceWithRawResponse, + AsyncOwnershipResourceWithRawResponse, + OwnershipResourceWithStreamingResponse, + AsyncOwnershipResourceWithStreamingResponse, ) from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( @@ -56,8 +56,8 @@ class PCAPs(SyncAPIResource): @cached_property - def ownership(self) -> Ownership: - return Ownership(self._client) + def ownership(self) -> OwnershipResource: + return OwnershipResource(self._client) @cached_property def download(self) -> Download: @@ -314,8 +314,8 @@ def get( class AsyncPCAPs(AsyncAPIResource): @cached_property - def ownership(self) -> AsyncOwnership: - return AsyncOwnership(self._client) + def ownership(self) -> AsyncOwnershipResource: + return AsyncOwnershipResource(self._client) @cached_property def download(self) -> AsyncDownload: @@ -585,8 +585,8 @@ def __init__(self, pcaps: PCAPs) -> None: ) @cached_property - def ownership(self) -> OwnershipWithRawResponse: - return OwnershipWithRawResponse(self._pcaps.ownership) + def ownership(self) -> OwnershipResourceWithRawResponse: + return OwnershipResourceWithRawResponse(self._pcaps.ownership) @cached_property def download(self) -> DownloadWithRawResponse: @@ -608,8 +608,8 @@ def __init__(self, pcaps: AsyncPCAPs) -> None: ) @cached_property - def ownership(self) -> AsyncOwnershipWithRawResponse: - return AsyncOwnershipWithRawResponse(self._pcaps.ownership) + def ownership(self) -> AsyncOwnershipResourceWithRawResponse: + return AsyncOwnershipResourceWithRawResponse(self._pcaps.ownership) @cached_property def download(self) -> AsyncDownloadWithRawResponse: @@ -631,8 +631,8 @@ def __init__(self, pcaps: PCAPs) -> None: ) @cached_property - def ownership(self) -> OwnershipWithStreamingResponse: - return OwnershipWithStreamingResponse(self._pcaps.ownership) + def ownership(self) -> OwnershipResourceWithStreamingResponse: + return OwnershipResourceWithStreamingResponse(self._pcaps.ownership) @cached_property def download(self) -> DownloadWithStreamingResponse: @@ -654,8 +654,8 @@ def __init__(self, pcaps: AsyncPCAPs) -> None: ) @cached_property - def ownership(self) -> AsyncOwnershipWithStreamingResponse: - return AsyncOwnershipWithStreamingResponse(self._pcaps.ownership) + def ownership(self) -> AsyncOwnershipResourceWithStreamingResponse: + return AsyncOwnershipResourceWithStreamingResponse(self._pcaps.ownership) @cached_property def download(self) -> AsyncDownloadWithStreamingResponse: diff --git a/src/cloudflare/resources/r2/__init__.py b/src/cloudflare/resources/r2/__init__.py index 03424b10094..f467f059f12 100644 --- a/src/cloudflare/resources/r2/__init__.py +++ b/src/cloudflare/resources/r2/__init__.py @@ -9,12 +9,12 @@ AsyncR2WithStreamingResponse, ) from .sippy import ( - Sippy, - AsyncSippy, - SippyWithRawResponse, - AsyncSippyWithRawResponse, - SippyWithStreamingResponse, - AsyncSippyWithStreamingResponse, + SippyResource, + AsyncSippyResource, + SippyResourceWithRawResponse, + AsyncSippyResourceWithRawResponse, + SippyResourceWithStreamingResponse, + AsyncSippyResourceWithStreamingResponse, ) from .buckets import ( Buckets, @@ -32,12 +32,12 @@ "AsyncBucketsWithRawResponse", "BucketsWithStreamingResponse", "AsyncBucketsWithStreamingResponse", - "Sippy", - "AsyncSippy", - "SippyWithRawResponse", - "AsyncSippyWithRawResponse", - "SippyWithStreamingResponse", - "AsyncSippyWithStreamingResponse", + "SippyResource", + "AsyncSippyResource", + "SippyResourceWithRawResponse", + "AsyncSippyResourceWithRawResponse", + "SippyResourceWithStreamingResponse", + "AsyncSippyResourceWithStreamingResponse", "R2", "AsyncR2", "R2WithRawResponse", diff --git a/src/cloudflare/resources/r2/buckets.py b/src/cloudflare/resources/r2/buckets.py index 5d4c1e255cb..d9860b4d985 100644 --- a/src/cloudflare/resources/r2/buckets.py +++ b/src/cloudflare/resources/r2/buckets.py @@ -13,7 +13,7 @@ async_maybe_transform, ) from ..._compat import cached_property -from ...types.r2 import R2Bucket, bucket_list_params, bucket_create_params +from ...types.r2 import Bucket, bucket_list_params, bucket_create_params from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( to_raw_response_wrapper, @@ -52,7 +52,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> R2Bucket: + ) -> Bucket: """ Creates a new R2 bucket. @@ -89,7 +89,7 @@ def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[R2Bucket], ResultWrapper[R2Bucket]), + cast_to=cast(Type[Bucket], ResultWrapper[Bucket]), ) def list( @@ -108,7 +108,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncCursorPagination[R2Bucket]: + ) -> SyncCursorPagination[Bucket]: """ Lists all R2 buckets on your account @@ -141,7 +141,7 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/r2/buckets", - page=SyncCursorPagination[R2Bucket], + page=SyncCursorPagination[Bucket], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -159,7 +159,7 @@ def list( bucket_list_params.BucketListParams, ), ), - model=R2Bucket, + model=Bucket, ) def delete( @@ -217,7 +217,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> R2Bucket: + ) -> Bucket: """ Gets metadata for an existing R2 bucket. @@ -247,7 +247,7 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[R2Bucket], ResultWrapper[R2Bucket]), + cast_to=cast(Type[Bucket], ResultWrapper[Bucket]), ) @@ -272,7 +272,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> R2Bucket: + ) -> Bucket: """ Creates a new R2 bucket. @@ -309,7 +309,7 @@ async def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[R2Bucket], ResultWrapper[R2Bucket]), + cast_to=cast(Type[Bucket], ResultWrapper[Bucket]), ) def list( @@ -328,7 +328,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[R2Bucket, AsyncCursorPagination[R2Bucket]]: + ) -> AsyncPaginator[Bucket, AsyncCursorPagination[Bucket]]: """ Lists all R2 buckets on your account @@ -361,7 +361,7 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/r2/buckets", - page=AsyncCursorPagination[R2Bucket], + page=AsyncCursorPagination[Bucket], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -379,7 +379,7 @@ def list( bucket_list_params.BucketListParams, ), ), - model=R2Bucket, + model=Bucket, ) async def delete( @@ -437,7 +437,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> R2Bucket: + ) -> Bucket: """ Gets metadata for an existing R2 bucket. @@ -467,7 +467,7 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[R2Bucket], ResultWrapper[R2Bucket]), + cast_to=cast(Type[Bucket], ResultWrapper[Bucket]), ) diff --git a/src/cloudflare/resources/r2/r2.py b/src/cloudflare/resources/r2/r2.py index 04278e97a85..8a5eabb4409 100644 --- a/src/cloudflare/resources/r2/r2.py +++ b/src/cloudflare/resources/r2/r2.py @@ -3,12 +3,12 @@ from __future__ import annotations from .sippy import ( - Sippy, - AsyncSippy, - SippyWithRawResponse, - AsyncSippyWithRawResponse, - SippyWithStreamingResponse, - AsyncSippyWithStreamingResponse, + SippyResource, + AsyncSippyResource, + SippyResourceWithRawResponse, + AsyncSippyResourceWithRawResponse, + SippyResourceWithStreamingResponse, + AsyncSippyResourceWithStreamingResponse, ) from .buckets import ( Buckets, @@ -30,8 +30,8 @@ def buckets(self) -> Buckets: return Buckets(self._client) @cached_property - def sippy(self) -> Sippy: - return Sippy(self._client) + def sippy(self) -> SippyResource: + return SippyResource(self._client) @cached_property def with_raw_response(self) -> R2WithRawResponse: @@ -48,8 +48,8 @@ def buckets(self) -> AsyncBuckets: return AsyncBuckets(self._client) @cached_property - def sippy(self) -> AsyncSippy: - return AsyncSippy(self._client) + def sippy(self) -> AsyncSippyResource: + return AsyncSippyResource(self._client) @cached_property def with_raw_response(self) -> AsyncR2WithRawResponse: @@ -69,8 +69,8 @@ def buckets(self) -> BucketsWithRawResponse: return BucketsWithRawResponse(self._r2.buckets) @cached_property - def sippy(self) -> SippyWithRawResponse: - return SippyWithRawResponse(self._r2.sippy) + def sippy(self) -> SippyResourceWithRawResponse: + return SippyResourceWithRawResponse(self._r2.sippy) class AsyncR2WithRawResponse: @@ -82,8 +82,8 @@ def buckets(self) -> AsyncBucketsWithRawResponse: return AsyncBucketsWithRawResponse(self._r2.buckets) @cached_property - def sippy(self) -> AsyncSippyWithRawResponse: - return AsyncSippyWithRawResponse(self._r2.sippy) + def sippy(self) -> AsyncSippyResourceWithRawResponse: + return AsyncSippyResourceWithRawResponse(self._r2.sippy) class R2WithStreamingResponse: @@ -95,8 +95,8 @@ def buckets(self) -> BucketsWithStreamingResponse: return BucketsWithStreamingResponse(self._r2.buckets) @cached_property - def sippy(self) -> SippyWithStreamingResponse: - return SippyWithStreamingResponse(self._r2.sippy) + def sippy(self) -> SippyResourceWithStreamingResponse: + return SippyResourceWithStreamingResponse(self._r2.sippy) class AsyncR2WithStreamingResponse: @@ -108,5 +108,5 @@ def buckets(self) -> AsyncBucketsWithStreamingResponse: return AsyncBucketsWithStreamingResponse(self._r2.buckets) @cached_property - def sippy(self) -> AsyncSippyWithStreamingResponse: - return AsyncSippyWithStreamingResponse(self._r2.sippy) + def sippy(self) -> AsyncSippyResourceWithStreamingResponse: + return AsyncSippyResourceWithStreamingResponse(self._r2.sippy) diff --git a/src/cloudflare/resources/r2/sippy.py b/src/cloudflare/resources/r2/sippy.py index e408938f4cd..cdc525cb712 100644 --- a/src/cloudflare/resources/r2/sippy.py +++ b/src/cloudflare/resources/r2/sippy.py @@ -13,7 +13,7 @@ async_maybe_transform, ) from ..._compat import cached_property -from ...types.r2 import R2Sippy, SippyDeleteResponse, sippy_update_params +from ...types.r2 import Sippy, SippyDeleteResponse, sippy_update_params from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( to_raw_response_wrapper, @@ -26,17 +26,17 @@ make_request_options, ) -__all__ = ["Sippy", "AsyncSippy"] +__all__ = ["SippyResource", "AsyncSippyResource"] -class Sippy(SyncAPIResource): +class SippyResource(SyncAPIResource): @cached_property - def with_raw_response(self) -> SippyWithRawResponse: - return SippyWithRawResponse(self) + def with_raw_response(self) -> SippyResourceWithRawResponse: + return SippyResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> SippyWithStreamingResponse: - return SippyWithStreamingResponse(self) + def with_streaming_response(self) -> SippyResourceWithStreamingResponse: + return SippyResourceWithStreamingResponse(self) @overload def update( @@ -52,7 +52,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> R2Sippy: + ) -> Sippy: """ Sets configuration for Sippy for an existing R2 bucket. @@ -89,7 +89,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> R2Sippy: + ) -> Sippy: """ Sets configuration for Sippy for an existing R2 bucket. @@ -128,7 +128,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> R2Sippy: + ) -> Sippy: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not bucket_name: @@ -149,7 +149,7 @@ def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[R2Sippy], ResultWrapper[R2Sippy]), + cast_to=cast(Type[Sippy], ResultWrapper[Sippy]), ) def delete( @@ -207,7 +207,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> R2Sippy: + ) -> Sippy: """ Gets configuration for Sippy for an existing R2 bucket. @@ -237,18 +237,18 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[R2Sippy], ResultWrapper[R2Sippy]), + cast_to=cast(Type[Sippy], ResultWrapper[Sippy]), ) -class AsyncSippy(AsyncAPIResource): +class AsyncSippyResource(AsyncAPIResource): @cached_property - def with_raw_response(self) -> AsyncSippyWithRawResponse: - return AsyncSippyWithRawResponse(self) + def with_raw_response(self) -> AsyncSippyResourceWithRawResponse: + return AsyncSippyResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> AsyncSippyWithStreamingResponse: - return AsyncSippyWithStreamingResponse(self) + def with_streaming_response(self) -> AsyncSippyResourceWithStreamingResponse: + return AsyncSippyResourceWithStreamingResponse(self) @overload async def update( @@ -264,7 +264,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> R2Sippy: + ) -> Sippy: """ Sets configuration for Sippy for an existing R2 bucket. @@ -301,7 +301,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> R2Sippy: + ) -> Sippy: """ Sets configuration for Sippy for an existing R2 bucket. @@ -340,7 +340,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> R2Sippy: + ) -> Sippy: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not bucket_name: @@ -361,7 +361,7 @@ async def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[R2Sippy], ResultWrapper[R2Sippy]), + cast_to=cast(Type[Sippy], ResultWrapper[Sippy]), ) async def delete( @@ -419,7 +419,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> R2Sippy: + ) -> Sippy: """ Gets configuration for Sippy for an existing R2 bucket. @@ -449,12 +449,12 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[R2Sippy], ResultWrapper[R2Sippy]), + cast_to=cast(Type[Sippy], ResultWrapper[Sippy]), ) -class SippyWithRawResponse: - def __init__(self, sippy: Sippy) -> None: +class SippyResourceWithRawResponse: + def __init__(self, sippy: SippyResource) -> None: self._sippy = sippy self.update = to_raw_response_wrapper( @@ -468,8 +468,8 @@ def __init__(self, sippy: Sippy) -> None: ) -class AsyncSippyWithRawResponse: - def __init__(self, sippy: AsyncSippy) -> None: +class AsyncSippyResourceWithRawResponse: + def __init__(self, sippy: AsyncSippyResource) -> None: self._sippy = sippy self.update = async_to_raw_response_wrapper( @@ -483,8 +483,8 @@ def __init__(self, sippy: AsyncSippy) -> None: ) -class SippyWithStreamingResponse: - def __init__(self, sippy: Sippy) -> None: +class SippyResourceWithStreamingResponse: + def __init__(self, sippy: SippyResource) -> None: self._sippy = sippy self.update = to_streamed_response_wrapper( @@ -498,8 +498,8 @@ def __init__(self, sippy: Sippy) -> None: ) -class AsyncSippyWithStreamingResponse: - def __init__(self, sippy: AsyncSippy) -> None: +class AsyncSippyResourceWithStreamingResponse: + def __init__(self, sippy: AsyncSippyResource) -> None: self._sippy = sippy self.update = async_to_streamed_response_wrapper( diff --git a/src/cloudflare/resources/rate_limits.py b/src/cloudflare/resources/rate_limits.py index d87474a61af..7facb281575 100644 --- a/src/cloudflare/resources/rate_limits.py +++ b/src/cloudflare/resources/rate_limits.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Any, Type, Optional, cast +from typing import Any, Type, cast import httpx @@ -160,7 +160,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RateLimitDeleteResponse]: + ) -> RateLimitDeleteResponse: """ Deletes an existing rate limit. @@ -191,7 +191,7 @@ def delete( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[RateLimitDeleteResponse]], ResultWrapper[RateLimitDeleteResponse]), + cast_to=cast(Type[RateLimitDeleteResponse], ResultWrapper[RateLimitDeleteResponse]), ) def edit( @@ -417,7 +417,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RateLimitDeleteResponse]: + ) -> RateLimitDeleteResponse: """ Deletes an existing rate limit. @@ -448,7 +448,7 @@ async def delete( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[RateLimitDeleteResponse]], ResultWrapper[RateLimitDeleteResponse]), + cast_to=cast(Type[RateLimitDeleteResponse], ResultWrapper[RateLimitDeleteResponse]), ) async def edit( diff --git a/src/cloudflare/resources/registrar/domains.py b/src/cloudflare/resources/registrar/domains.py index 45f996fb4cd..40d5252b132 100644 --- a/src/cloudflare/resources/registrar/domains.py +++ b/src/cloudflare/resources/registrar/domains.py @@ -26,7 +26,7 @@ make_request_options, ) from ...types.shared import UnnamedSchemaRef65e3c8c1a9c4638ec25cdbbaca7165c1 -from ...types.registrar import DomainListResponse, domain_update_params +from ...types.registrar import Domain, domain_update_params __all__ = ["Domains", "AsyncDomains"] @@ -117,7 +117,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[DomainListResponse]: + ) -> SyncSinglePage[Domain]: """ List domains handled by Registrar. @@ -136,11 +136,11 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/registrar/domains", - page=SyncSinglePage[DomainListResponse], + page=SyncSinglePage[Domain], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=DomainListResponse, + model=Domain, ) def get( @@ -279,7 +279,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[DomainListResponse, AsyncSinglePage[DomainListResponse]]: + ) -> AsyncPaginator[Domain, AsyncSinglePage[Domain]]: """ List domains handled by Registrar. @@ -298,11 +298,11 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/registrar/domains", - page=AsyncSinglePage[DomainListResponse], + page=AsyncSinglePage[Domain], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=DomainListResponse, + model=Domain, ) async def get( diff --git a/src/cloudflare/resources/rules/lists/lists.py b/src/cloudflare/resources/rules/lists/lists.py index 01f7d92962f..c0152f80f77 100644 --- a/src/cloudflare/resources/rules/lists/lists.py +++ b/src/cloudflare/resources/rules/lists/lists.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Type, Optional, cast +from typing import List, Type, Optional, cast from typing_extensions import Literal import httpx @@ -30,7 +30,7 @@ ) from ...._wrappers import ResultWrapper from ....pagination import SyncSinglePage, AsyncSinglePage -from ....types.rules import ListsList, ListDeleteResponse, list_create_params, list_delete_params, list_update_params +from ....types.rules import List, ListDeleteResponse, list_create_params, list_delete_params, list_update_params from ...._base_client import ( AsyncPaginator, make_request_options, @@ -77,7 +77,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ListsList]: + ) -> Optional[List]: """ Creates a new list of the specified type. @@ -118,7 +118,7 @@ def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[ListsList]], ResultWrapper[ListsList]), + cast_to=cast(Type[Optional[List]], ResultWrapper[List]), ) def update( @@ -133,7 +133,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ListsList]: + ) -> Optional[List]: """ Updates the description of a list. @@ -166,7 +166,7 @@ def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[ListsList]], ResultWrapper[ListsList]), + cast_to=cast(Type[Optional[List]], ResultWrapper[List]), ) def list( @@ -179,7 +179,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[ListsList]: + ) -> SyncSinglePage[List]: """ Fetches all lists in the account. @@ -198,11 +198,11 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/rules/lists", - page=SyncSinglePage[ListsList], + page=SyncSinglePage[List], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=ListsList, + model=List, ) def delete( @@ -262,7 +262,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ListsList]: + ) -> Optional[List]: """ Fetches the details of a list. @@ -292,7 +292,7 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[ListsList]], ResultWrapper[ListsList]), + cast_to=cast(Type[Optional[List]], ResultWrapper[List]), ) @@ -326,7 +326,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ListsList]: + ) -> Optional[List]: """ Creates a new list of the specified type. @@ -367,7 +367,7 @@ async def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[ListsList]], ResultWrapper[ListsList]), + cast_to=cast(Type[Optional[List]], ResultWrapper[List]), ) async def update( @@ -382,7 +382,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ListsList]: + ) -> Optional[List]: """ Updates the description of a list. @@ -415,7 +415,7 @@ async def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[ListsList]], ResultWrapper[ListsList]), + cast_to=cast(Type[Optional[List]], ResultWrapper[List]), ) def list( @@ -428,7 +428,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[ListsList, AsyncSinglePage[ListsList]]: + ) -> AsyncPaginator[List, AsyncSinglePage[List]]: """ Fetches all lists in the account. @@ -447,11 +447,11 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/rules/lists", - page=AsyncSinglePage[ListsList], + page=AsyncSinglePage[List], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=ListsList, + model=List, ) async def delete( @@ -511,7 +511,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ListsList]: + ) -> Optional[List]: """ Fetches the details of a list. @@ -541,7 +541,7 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[ListsList]], ResultWrapper[ListsList]), + cast_to=cast(Type[Optional[List]], ResultWrapper[List]), ) diff --git a/src/cloudflare/resources/rum/rules.py b/src/cloudflare/resources/rum/rules.py index 721e9ca2e49..f64332ec07d 100644 --- a/src/cloudflare/resources/rum/rules.py +++ b/src/cloudflare/resources/rum/rules.py @@ -20,7 +20,7 @@ async_to_streamed_response_wrapper, ) from ..._wrappers import ResultWrapper -from ...types.rum import RUMRule, RuleListResponse, RuleDeleteResponse, rule_create_params, rule_update_params +from ...types.rum import Rule, RuleListResponse, RuleDeleteResponse, rule_create_params, rule_update_params from ..._base_client import ( make_request_options, ) @@ -52,7 +52,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RUMRule]: + ) -> Optional[Rule]: """ Creates a new rule in a Web Analytics ruleset. @@ -95,7 +95,7 @@ def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[RUMRule]], ResultWrapper[RUMRule]), + cast_to=cast(Type[Optional[Rule]], ResultWrapper[Rule]), ) def update( @@ -114,7 +114,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RUMRule]: + ) -> Optional[Rule]: """ Updates a rule in a Web Analytics ruleset. @@ -161,7 +161,7 @@ def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[RUMRule]], ResultWrapper[RUMRule]), + cast_to=cast(Type[Optional[Rule]], ResultWrapper[Rule]), ) def list( @@ -282,7 +282,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RUMRule]: + ) -> Optional[Rule]: """ Creates a new rule in a Web Analytics ruleset. @@ -325,7 +325,7 @@ async def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[RUMRule]], ResultWrapper[RUMRule]), + cast_to=cast(Type[Optional[Rule]], ResultWrapper[Rule]), ) async def update( @@ -344,7 +344,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RUMRule]: + ) -> Optional[Rule]: """ Updates a rule in a Web Analytics ruleset. @@ -391,7 +391,7 @@ async def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[RUMRule]], ResultWrapper[RUMRule]), + cast_to=cast(Type[Optional[Rule]], ResultWrapper[Rule]), ) async def list( diff --git a/src/cloudflare/resources/rum/site_info.py b/src/cloudflare/resources/rum/site_info.py index 9ecca8d2f44..f9c6184c4a6 100644 --- a/src/cloudflare/resources/rum/site_info.py +++ b/src/cloudflare/resources/rum/site_info.py @@ -22,7 +22,7 @@ ) from ..._wrappers import ResultWrapper from ...types.rum import ( - RUMSite, + Site, SiteInfoDeleteResponse, site_info_list_params, site_info_create_params, @@ -59,7 +59,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RUMSite]: + ) -> Optional[Site]: """ Creates a new Web Analytics site. @@ -100,7 +100,7 @@ def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[RUMSite]], ResultWrapper[RUMSite]), + cast_to=cast(Type[Optional[Site]], ResultWrapper[Site]), ) def update( @@ -117,7 +117,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RUMSite]: + ) -> Optional[Site]: """ Updates an existing Web Analytics site. @@ -162,7 +162,7 @@ def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[RUMSite]], ResultWrapper[RUMSite]), + cast_to=cast(Type[Optional[Site]], ResultWrapper[Site]), ) def list( @@ -178,7 +178,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncV4PagePaginationArray[RUMSite]: + ) -> SyncV4PagePaginationArray[Site]: """ Lists all Web Analytics sites of an account. @@ -203,7 +203,7 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/rum/site_info/list", - page=SyncV4PagePaginationArray[RUMSite], + page=SyncV4PagePaginationArray[Site], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -218,7 +218,7 @@ def list( site_info_list_params.SiteInfoListParams, ), ), - model=RUMSite, + model=Site, ) def delete( @@ -276,7 +276,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RUMSite]: + ) -> Optional[Site]: """ Retrieves a Web Analytics site. @@ -306,7 +306,7 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[RUMSite]], ResultWrapper[RUMSite]), + cast_to=cast(Type[Optional[Site]], ResultWrapper[Site]), ) @@ -332,7 +332,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RUMSite]: + ) -> Optional[Site]: """ Creates a new Web Analytics site. @@ -373,7 +373,7 @@ async def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[RUMSite]], ResultWrapper[RUMSite]), + cast_to=cast(Type[Optional[Site]], ResultWrapper[Site]), ) async def update( @@ -390,7 +390,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RUMSite]: + ) -> Optional[Site]: """ Updates an existing Web Analytics site. @@ -435,7 +435,7 @@ async def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[RUMSite]], ResultWrapper[RUMSite]), + cast_to=cast(Type[Optional[Site]], ResultWrapper[Site]), ) def list( @@ -451,7 +451,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[RUMSite, AsyncV4PagePaginationArray[RUMSite]]: + ) -> AsyncPaginator[Site, AsyncV4PagePaginationArray[Site]]: """ Lists all Web Analytics sites of an account. @@ -476,7 +476,7 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/rum/site_info/list", - page=AsyncV4PagePaginationArray[RUMSite], + page=AsyncV4PagePaginationArray[Site], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -491,7 +491,7 @@ def list( site_info_list_params.SiteInfoListParams, ), ), - model=RUMSite, + model=Site, ) async def delete( @@ -549,7 +549,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RUMSite]: + ) -> Optional[Site]: """ Retrieves a Web Analytics site. @@ -579,7 +579,7 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[RUMSite]], ResultWrapper[RUMSite]), + cast_to=cast(Type[Optional[Site]], ResultWrapper[Site]), ) diff --git a/src/cloudflare/resources/spectrum/analytics/events/bytimes.py b/src/cloudflare/resources/spectrum/analytics/events/bytimes.py index 3f0f8dce338..38d0c9452c5 100644 --- a/src/cloudflare/resources/spectrum/analytics/events/bytimes.py +++ b/src/cloudflare/resources/spectrum/analytics/events/bytimes.py @@ -26,7 +26,8 @@ make_request_options, ) from .....types.shared import UnnamedSchemaRef8d6a37a1e4190f86652802244d29525f -from .....types.spectrum.analytics.events import DimensionItem, bytime_get_params +from .....types.spectrum.analytics import DimensionItem +from .....types.spectrum.analytics.events import bytime_get_params __all__ = ["Bytimes", "AsyncBytimes"] diff --git a/src/cloudflare/resources/spectrum/analytics/events/summaries.py b/src/cloudflare/resources/spectrum/analytics/events/summaries.py index f06c7fb1a9d..22d2e4a0f5e 100644 --- a/src/cloudflare/resources/spectrum/analytics/events/summaries.py +++ b/src/cloudflare/resources/spectrum/analytics/events/summaries.py @@ -26,7 +26,8 @@ make_request_options, ) from .....types.shared import UnnamedSchemaRef8d6a37a1e4190f86652802244d29525f -from .....types.spectrum.analytics.events import DimensionItem, summary_get_params +from .....types.spectrum.analytics import DimensionItem +from .....types.spectrum.analytics.events import summary_get_params __all__ = ["Summaries", "AsyncSummaries"] diff --git a/src/cloudflare/resources/speed/__init__.py b/src/cloudflare/resources/speed/__init__.py index a1febc9cd40..1723e42b86d 100644 --- a/src/cloudflare/resources/speed/__init__.py +++ b/src/cloudflare/resources/speed/__init__.py @@ -25,12 +25,12 @@ AsyncTestsWithStreamingResponse, ) from .schedule import ( - Schedule, - AsyncSchedule, - ScheduleWithRawResponse, - AsyncScheduleWithRawResponse, - ScheduleWithStreamingResponse, - AsyncScheduleWithStreamingResponse, + ScheduleResource, + AsyncScheduleResource, + ScheduleResourceWithRawResponse, + AsyncScheduleResourceWithRawResponse, + ScheduleResourceWithStreamingResponse, + AsyncScheduleResourceWithStreamingResponse, ) from .availabilities import ( Availabilities, @@ -48,12 +48,12 @@ "AsyncTestsWithRawResponse", "TestsWithStreamingResponse", "AsyncTestsWithStreamingResponse", - "Schedule", - "AsyncSchedule", - "ScheduleWithRawResponse", - "AsyncScheduleWithRawResponse", - "ScheduleWithStreamingResponse", - "AsyncScheduleWithStreamingResponse", + "ScheduleResource", + "AsyncScheduleResource", + "ScheduleResourceWithRawResponse", + "AsyncScheduleResourceWithRawResponse", + "ScheduleResourceWithStreamingResponse", + "AsyncScheduleResourceWithStreamingResponse", "Availabilities", "AsyncAvailabilities", "AvailabilitiesWithRawResponse", diff --git a/src/cloudflare/resources/speed/availabilities.py b/src/cloudflare/resources/speed/availabilities.py index 1414ca6da88..bc1f15c9cae 100644 --- a/src/cloudflare/resources/speed/availabilities.py +++ b/src/cloudflare/resources/speed/availabilities.py @@ -16,7 +16,7 @@ async_to_streamed_response_wrapper, ) from ..._wrappers import ResultWrapper -from ...types.speed import ObservatoryAvailabilities +from ...types.speed import Availability from ..._base_client import ( make_request_options, ) @@ -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[ObservatoryAvailabilities]: + ) -> Optional[Availability]: """ Retrieves quota for all plans, as well as the current zone quota. @@ -69,7 +69,7 @@ def list( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[ObservatoryAvailabilities]], ResultWrapper[ObservatoryAvailabilities]), + cast_to=cast(Type[Optional[Availability]], ResultWrapper[Availability]), ) @@ -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[ObservatoryAvailabilities]: + ) -> Optional[Availability]: """ Retrieves quota for all plans, as well as the current zone quota. @@ -118,7 +118,7 @@ async def list( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[ObservatoryAvailabilities]], ResultWrapper[ObservatoryAvailabilities]), + cast_to=cast(Type[Optional[Availability]], ResultWrapper[Availability]), ) diff --git a/src/cloudflare/resources/speed/schedule.py b/src/cloudflare/resources/speed/schedule.py index 09ccbb925b1..988cffd7bcd 100644 --- a/src/cloudflare/resources/speed/schedule.py +++ b/src/cloudflare/resources/speed/schedule.py @@ -26,17 +26,17 @@ make_request_options, ) -__all__ = ["Schedule", "AsyncSchedule"] +__all__ = ["ScheduleResource", "AsyncScheduleResource"] -class Schedule(SyncAPIResource): +class ScheduleResource(SyncAPIResource): @cached_property - def with_raw_response(self) -> ScheduleWithRawResponse: - return ScheduleWithRawResponse(self) + def with_raw_response(self) -> ScheduleResourceWithRawResponse: + return ScheduleResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> ScheduleWithStreamingResponse: - return ScheduleWithStreamingResponse(self) + def with_streaming_response(self) -> ScheduleResourceWithStreamingResponse: + return ScheduleResourceWithStreamingResponse(self) def create( self, @@ -110,14 +110,14 @@ def create( ) -class AsyncSchedule(AsyncAPIResource): +class AsyncScheduleResource(AsyncAPIResource): @cached_property - def with_raw_response(self) -> AsyncScheduleWithRawResponse: - return AsyncScheduleWithRawResponse(self) + def with_raw_response(self) -> AsyncScheduleResourceWithRawResponse: + return AsyncScheduleResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> AsyncScheduleWithStreamingResponse: - return AsyncScheduleWithStreamingResponse(self) + def with_streaming_response(self) -> AsyncScheduleResourceWithStreamingResponse: + return AsyncScheduleResourceWithStreamingResponse(self) async def create( self, @@ -191,8 +191,8 @@ async def create( ) -class ScheduleWithRawResponse: - def __init__(self, schedule: Schedule) -> None: +class ScheduleResourceWithRawResponse: + def __init__(self, schedule: ScheduleResource) -> None: self._schedule = schedule self.create = to_raw_response_wrapper( @@ -200,8 +200,8 @@ def __init__(self, schedule: Schedule) -> None: ) -class AsyncScheduleWithRawResponse: - def __init__(self, schedule: AsyncSchedule) -> None: +class AsyncScheduleResourceWithRawResponse: + def __init__(self, schedule: AsyncScheduleResource) -> None: self._schedule = schedule self.create = async_to_raw_response_wrapper( @@ -209,8 +209,8 @@ def __init__(self, schedule: AsyncSchedule) -> None: ) -class ScheduleWithStreamingResponse: - def __init__(self, schedule: Schedule) -> None: +class ScheduleResourceWithStreamingResponse: + def __init__(self, schedule: ScheduleResource) -> None: self._schedule = schedule self.create = to_streamed_response_wrapper( @@ -218,8 +218,8 @@ def __init__(self, schedule: Schedule) -> None: ) -class AsyncScheduleWithStreamingResponse: - def __init__(self, schedule: AsyncSchedule) -> None: +class AsyncScheduleResourceWithStreamingResponse: + def __init__(self, schedule: AsyncScheduleResource) -> None: self._schedule = schedule self.create = async_to_streamed_response_wrapper( diff --git a/src/cloudflare/resources/speed/speed.py b/src/cloudflare/resources/speed/speed.py index 33ebf45a3d6..3254bb93122 100644 --- a/src/cloudflare/resources/speed/speed.py +++ b/src/cloudflare/resources/speed/speed.py @@ -25,8 +25,7 @@ AsyncTestsWithStreamingResponse, ) from ...types import ( - ObservatoryTrend, - ObservatorySchedule, + Trend, SpeedDeleteResponse, speed_delete_params, speed_trends_list_params, @@ -38,12 +37,12 @@ async_maybe_transform, ) from .schedule import ( - Schedule, - AsyncSchedule, - ScheduleWithRawResponse, - AsyncScheduleWithRawResponse, - ScheduleWithStreamingResponse, - AsyncScheduleWithStreamingResponse, + ScheduleResource, + AsyncScheduleResource, + ScheduleResourceWithRawResponse, + AsyncScheduleResourceWithRawResponse, + ScheduleResourceWithStreamingResponse, + AsyncScheduleResourceWithStreamingResponse, ) from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -54,6 +53,7 @@ async_to_streamed_response_wrapper, ) from ..._wrappers import ResultWrapper +from ...types.speed import Schedule from ..._base_client import ( make_request_options, ) @@ -75,8 +75,8 @@ def tests(self) -> Tests: return Tests(self._client) @cached_property - def schedule(self) -> Schedule: - return Schedule(self._client) + def schedule(self) -> ScheduleResource: + return ScheduleResource(self._client) @cached_property def availabilities(self) -> Availabilities: @@ -200,7 +200,7 @@ def schedule_get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ObservatorySchedule]: + ) -> Optional[Schedule]: """ Retrieves the test schedule for a page in a specific region. @@ -233,7 +233,7 @@ def schedule_get( query=maybe_transform({"region": region}, speed_schedule_get_params.SpeedScheduleGetParams), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[ObservatorySchedule]], ResultWrapper[ObservatorySchedule]), + cast_to=cast(Type[Optional[Schedule]], ResultWrapper[Schedule]), ) def trends_list( @@ -275,7 +275,7 @@ def trends_list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ObservatoryTrend]: + ) -> Optional[Trend]: """ Lists the core web vital metrics trend over time for a specific page. @@ -324,7 +324,7 @@ def trends_list( ), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[ObservatoryTrend]], ResultWrapper[ObservatoryTrend]), + cast_to=cast(Type[Optional[Trend]], ResultWrapper[Trend]), ) @@ -334,8 +334,8 @@ def tests(self) -> AsyncTests: return AsyncTests(self._client) @cached_property - def schedule(self) -> AsyncSchedule: - return AsyncSchedule(self._client) + def schedule(self) -> AsyncScheduleResource: + return AsyncScheduleResource(self._client) @cached_property def availabilities(self) -> AsyncAvailabilities: @@ -459,7 +459,7 @@ async def schedule_get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ObservatorySchedule]: + ) -> Optional[Schedule]: """ Retrieves the test schedule for a page in a specific region. @@ -492,7 +492,7 @@ async def schedule_get( query=await async_maybe_transform({"region": region}, speed_schedule_get_params.SpeedScheduleGetParams), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[ObservatorySchedule]], ResultWrapper[ObservatorySchedule]), + cast_to=cast(Type[Optional[Schedule]], ResultWrapper[Schedule]), ) async def trends_list( @@ -534,7 +534,7 @@ async def trends_list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ObservatoryTrend]: + ) -> Optional[Trend]: """ Lists the core web vital metrics trend over time for a specific page. @@ -583,7 +583,7 @@ async def trends_list( ), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[ObservatoryTrend]], ResultWrapper[ObservatoryTrend]), + cast_to=cast(Type[Optional[Trend]], ResultWrapper[Trend]), ) @@ -606,8 +606,8 @@ def tests(self) -> TestsWithRawResponse: return TestsWithRawResponse(self._speed.tests) @cached_property - def schedule(self) -> ScheduleWithRawResponse: - return ScheduleWithRawResponse(self._speed.schedule) + def schedule(self) -> ScheduleResourceWithRawResponse: + return ScheduleResourceWithRawResponse(self._speed.schedule) @cached_property def availabilities(self) -> AvailabilitiesWithRawResponse: @@ -637,8 +637,8 @@ def tests(self) -> AsyncTestsWithRawResponse: return AsyncTestsWithRawResponse(self._speed.tests) @cached_property - def schedule(self) -> AsyncScheduleWithRawResponse: - return AsyncScheduleWithRawResponse(self._speed.schedule) + def schedule(self) -> AsyncScheduleResourceWithRawResponse: + return AsyncScheduleResourceWithRawResponse(self._speed.schedule) @cached_property def availabilities(self) -> AsyncAvailabilitiesWithRawResponse: @@ -668,8 +668,8 @@ def tests(self) -> TestsWithStreamingResponse: return TestsWithStreamingResponse(self._speed.tests) @cached_property - def schedule(self) -> ScheduleWithStreamingResponse: - return ScheduleWithStreamingResponse(self._speed.schedule) + def schedule(self) -> ScheduleResourceWithStreamingResponse: + return ScheduleResourceWithStreamingResponse(self._speed.schedule) @cached_property def availabilities(self) -> AvailabilitiesWithStreamingResponse: @@ -699,8 +699,8 @@ def tests(self) -> AsyncTestsWithStreamingResponse: return AsyncTestsWithStreamingResponse(self._speed.tests) @cached_property - def schedule(self) -> AsyncScheduleWithStreamingResponse: - return AsyncScheduleWithStreamingResponse(self._speed.schedule) + def schedule(self) -> AsyncScheduleResourceWithStreamingResponse: + return AsyncScheduleResourceWithStreamingResponse(self._speed.schedule) @cached_property def availabilities(self) -> AsyncAvailabilitiesWithStreamingResponse: diff --git a/src/cloudflare/resources/speed/tests.py b/src/cloudflare/resources/speed/tests.py index 28407048caa..4800b3ba0ae 100644 --- a/src/cloudflare/resources/speed/tests.py +++ b/src/cloudflare/resources/speed/tests.py @@ -22,9 +22,9 @@ ) from ..._wrappers import ResultWrapper from ...types.speed import ( + Test, TestListResponse, TestDeleteResponse, - ObservatoryPageTest, test_list_params, test_create_params, test_delete_params, @@ -82,7 +82,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ObservatoryPageTest]: + ) -> Optional[Test]: """ Starts a test for a specific webpage, in a specific region. @@ -115,7 +115,7 @@ def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[ObservatoryPageTest]], ResultWrapper[ObservatoryPageTest]), + cast_to=cast(Type[Optional[Test]], ResultWrapper[Test]), ) def list( @@ -282,7 +282,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ObservatoryPageTest]: + ) -> Optional[Test]: """ Retrieves the result of a specific test. @@ -314,7 +314,7 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[ObservatoryPageTest]], ResultWrapper[ObservatoryPageTest]), + cast_to=cast(Type[Optional[Test]], ResultWrapper[Test]), ) @@ -362,7 +362,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ObservatoryPageTest]: + ) -> Optional[Test]: """ Starts a test for a specific webpage, in a specific region. @@ -395,7 +395,7 @@ async def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[ObservatoryPageTest]], ResultWrapper[ObservatoryPageTest]), + cast_to=cast(Type[Optional[Test]], ResultWrapper[Test]), ) async def list( @@ -562,7 +562,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ObservatoryPageTest]: + ) -> Optional[Test]: """ Retrieves the result of a specific test. @@ -594,7 +594,7 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[ObservatoryPageTest]], ResultWrapper[ObservatoryPageTest]), + cast_to=cast(Type[Optional[Test]], ResultWrapper[Test]), ) diff --git a/src/cloudflare/resources/ssl/__init__.py b/src/cloudflare/resources/ssl/__init__.py index 3580c169d8a..e73d6cd5e4a 100644 --- a/src/cloudflare/resources/ssl/__init__.py +++ b/src/cloudflare/resources/ssl/__init__.py @@ -25,12 +25,12 @@ AsyncUniversalWithStreamingResponse, ) from .verification import ( - Verification, - AsyncVerification, - VerificationWithRawResponse, - AsyncVerificationWithRawResponse, - VerificationWithStreamingResponse, - AsyncVerificationWithStreamingResponse, + VerificationResource, + AsyncVerificationResource, + VerificationResourceWithRawResponse, + AsyncVerificationResourceWithRawResponse, + VerificationResourceWithStreamingResponse, + AsyncVerificationResourceWithStreamingResponse, ) from .recommendations import ( Recommendations, @@ -74,12 +74,12 @@ "AsyncUniversalWithRawResponse", "UniversalWithStreamingResponse", "AsyncUniversalWithStreamingResponse", - "Verification", - "AsyncVerification", - "VerificationWithRawResponse", - "AsyncVerificationWithRawResponse", - "VerificationWithStreamingResponse", - "AsyncVerificationWithStreamingResponse", + "VerificationResource", + "AsyncVerificationResource", + "VerificationResourceWithRawResponse", + "AsyncVerificationResourceWithRawResponse", + "VerificationResourceWithStreamingResponse", + "AsyncVerificationResourceWithStreamingResponse", "SSL", "AsyncSSL", "SSLWithRawResponse", diff --git a/src/cloudflare/resources/ssl/certificate_packs/order.py b/src/cloudflare/resources/ssl/certificate_packs/order.py index 0631601c4f2..9ab85077244 100644 --- a/src/cloudflare/resources/ssl/certificate_packs/order.py +++ b/src/cloudflare/resources/ssl/certificate_packs/order.py @@ -21,10 +21,11 @@ async_to_streamed_response_wrapper, ) from ...._wrappers import ResultWrapper +from ....types.ssl import HostItem from ...._base_client import ( make_request_options, ) -from ....types.ssl.certificate_packs import HostItem, OrderCreateResponse, order_create_params +from ....types.ssl.certificate_packs import OrderCreateResponse, order_create_params __all__ = ["Order", "AsyncOrder"] diff --git a/src/cloudflare/resources/ssl/ssl.py b/src/cloudflare/resources/ssl/ssl.py index ea4a1e5d7a4..879ca6597e4 100644 --- a/src/cloudflare/resources/ssl/ssl.py +++ b/src/cloudflare/resources/ssl/ssl.py @@ -21,12 +21,12 @@ ) from ..._resource import SyncAPIResource, AsyncAPIResource from .verification import ( - Verification, - AsyncVerification, - VerificationWithRawResponse, - AsyncVerificationWithRawResponse, - VerificationWithStreamingResponse, - AsyncVerificationWithStreamingResponse, + VerificationResource, + AsyncVerificationResource, + VerificationResourceWithRawResponse, + AsyncVerificationResourceWithRawResponse, + VerificationResourceWithStreamingResponse, + AsyncVerificationResourceWithStreamingResponse, ) from .recommendations import ( Recommendations, @@ -68,8 +68,8 @@ def universal(self) -> Universal: return Universal(self._client) @cached_property - def verification(self) -> Verification: - return Verification(self._client) + def verification(self) -> VerificationResource: + return VerificationResource(self._client) @cached_property def with_raw_response(self) -> SSLWithRawResponse: @@ -98,8 +98,8 @@ def universal(self) -> AsyncUniversal: return AsyncUniversal(self._client) @cached_property - def verification(self) -> AsyncVerification: - return AsyncVerification(self._client) + def verification(self) -> AsyncVerificationResource: + return AsyncVerificationResource(self._client) @cached_property def with_raw_response(self) -> AsyncSSLWithRawResponse: @@ -131,8 +131,8 @@ def universal(self) -> UniversalWithRawResponse: return UniversalWithRawResponse(self._ssl.universal) @cached_property - def verification(self) -> VerificationWithRawResponse: - return VerificationWithRawResponse(self._ssl.verification) + def verification(self) -> VerificationResourceWithRawResponse: + return VerificationResourceWithRawResponse(self._ssl.verification) class AsyncSSLWithRawResponse: @@ -156,8 +156,8 @@ def universal(self) -> AsyncUniversalWithRawResponse: return AsyncUniversalWithRawResponse(self._ssl.universal) @cached_property - def verification(self) -> AsyncVerificationWithRawResponse: - return AsyncVerificationWithRawResponse(self._ssl.verification) + def verification(self) -> AsyncVerificationResourceWithRawResponse: + return AsyncVerificationResourceWithRawResponse(self._ssl.verification) class SSLWithStreamingResponse: @@ -181,8 +181,8 @@ def universal(self) -> UniversalWithStreamingResponse: return UniversalWithStreamingResponse(self._ssl.universal) @cached_property - def verification(self) -> VerificationWithStreamingResponse: - return VerificationWithStreamingResponse(self._ssl.verification) + def verification(self) -> VerificationResourceWithStreamingResponse: + return VerificationResourceWithStreamingResponse(self._ssl.verification) class AsyncSSLWithStreamingResponse: @@ -206,5 +206,5 @@ def universal(self) -> AsyncUniversalWithStreamingResponse: return AsyncUniversalWithStreamingResponse(self._ssl.universal) @cached_property - def verification(self) -> AsyncVerificationWithStreamingResponse: - return AsyncVerificationWithStreamingResponse(self._ssl.verification) + def verification(self) -> AsyncVerificationResourceWithStreamingResponse: + return AsyncVerificationResourceWithStreamingResponse(self._ssl.verification) diff --git a/src/cloudflare/resources/ssl/verification.py b/src/cloudflare/resources/ssl/verification.py index d5173a967d9..fbf2df8bb57 100644 --- a/src/cloudflare/resources/ssl/verification.py +++ b/src/cloudflare/resources/ssl/verification.py @@ -31,17 +31,17 @@ make_request_options, ) -__all__ = ["Verification", "AsyncVerification"] +__all__ = ["VerificationResource", "AsyncVerificationResource"] -class Verification(SyncAPIResource): +class VerificationResource(SyncAPIResource): @cached_property - def with_raw_response(self) -> VerificationWithRawResponse: - return VerificationWithRawResponse(self) + def with_raw_response(self) -> VerificationResourceWithRawResponse: + return VerificationResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> VerificationWithStreamingResponse: - return VerificationWithStreamingResponse(self) + def with_streaming_response(self) -> VerificationResourceWithStreamingResponse: + return VerificationResourceWithStreamingResponse(self) def edit( self, @@ -143,14 +143,14 @@ def get( ) -class AsyncVerification(AsyncAPIResource): +class AsyncVerificationResource(AsyncAPIResource): @cached_property - def with_raw_response(self) -> AsyncVerificationWithRawResponse: - return AsyncVerificationWithRawResponse(self) + def with_raw_response(self) -> AsyncVerificationResourceWithRawResponse: + return AsyncVerificationResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> AsyncVerificationWithStreamingResponse: - return AsyncVerificationWithStreamingResponse(self) + def with_streaming_response(self) -> AsyncVerificationResourceWithStreamingResponse: + return AsyncVerificationResourceWithStreamingResponse(self) async def edit( self, @@ -252,8 +252,8 @@ async def get( ) -class VerificationWithRawResponse: - def __init__(self, verification: Verification) -> None: +class VerificationResourceWithRawResponse: + def __init__(self, verification: VerificationResource) -> None: self._verification = verification self.edit = to_raw_response_wrapper( @@ -264,8 +264,8 @@ def __init__(self, verification: Verification) -> None: ) -class AsyncVerificationWithRawResponse: - def __init__(self, verification: AsyncVerification) -> None: +class AsyncVerificationResourceWithRawResponse: + def __init__(self, verification: AsyncVerificationResource) -> None: self._verification = verification self.edit = async_to_raw_response_wrapper( @@ -276,8 +276,8 @@ def __init__(self, verification: AsyncVerification) -> None: ) -class VerificationWithStreamingResponse: - def __init__(self, verification: Verification) -> None: +class VerificationResourceWithStreamingResponse: + def __init__(self, verification: VerificationResource) -> None: self._verification = verification self.edit = to_streamed_response_wrapper( @@ -288,8 +288,8 @@ def __init__(self, verification: Verification) -> None: ) -class AsyncVerificationWithStreamingResponse: - def __init__(self, verification: AsyncVerification) -> None: +class AsyncVerificationResourceWithStreamingResponse: + def __init__(self, verification: AsyncVerificationResource) -> None: self._verification = verification self.edit = async_to_streamed_response_wrapper( diff --git a/src/cloudflare/resources/storage/analytics.py b/src/cloudflare/resources/storage/analytics.py index e9114e594d2..8189c537371 100644 --- a/src/cloudflare/resources/storage/analytics.py +++ b/src/cloudflare/resources/storage/analytics.py @@ -23,12 +23,7 @@ from ..._base_client import ( make_request_options, ) -from ...types.storage import ( - WorkersKVSchemasResult, - WorkersKVComponentsSchemasResult, - analytics_list_params, - analytics_stored_params, -) +from ...types.storage import Schema, Components, analytics_list_params, analytics_stored_params __all__ = ["Analytics", "AsyncAnalytics"] @@ -53,7 +48,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> WorkersKVSchemasResult: + ) -> Schema: """ Retrieves Workers KV request metrics for the given account. @@ -82,7 +77,7 @@ def list( query=maybe_transform({"query": query}, analytics_list_params.AnalyticsListParams), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[WorkersKVSchemasResult], ResultWrapper[WorkersKVSchemasResult]), + cast_to=cast(Type[Schema], ResultWrapper[Schema]), ) def stored( @@ -96,7 +91,7 @@ def stored( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> WorkersKVComponentsSchemasResult: + ) -> Components: """ Retrieves Workers KV stored data metrics for the given account. @@ -125,7 +120,7 @@ def stored( query=maybe_transform({"query": query}, analytics_stored_params.AnalyticsStoredParams), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[WorkersKVComponentsSchemasResult], ResultWrapper[WorkersKVComponentsSchemasResult]), + cast_to=cast(Type[Components], ResultWrapper[Components]), ) @@ -149,7 +144,7 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> WorkersKVSchemasResult: + ) -> Schema: """ Retrieves Workers KV request metrics for the given account. @@ -178,7 +173,7 @@ async def list( query=await async_maybe_transform({"query": query}, analytics_list_params.AnalyticsListParams), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[WorkersKVSchemasResult], ResultWrapper[WorkersKVSchemasResult]), + cast_to=cast(Type[Schema], ResultWrapper[Schema]), ) async def stored( @@ -192,7 +187,7 @@ async def stored( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> WorkersKVComponentsSchemasResult: + ) -> Components: """ Retrieves Workers KV stored data metrics for the given account. @@ -221,7 +216,7 @@ async def stored( query=await async_maybe_transform({"query": query}, analytics_stored_params.AnalyticsStoredParams), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[WorkersKVComponentsSchemasResult], ResultWrapper[WorkersKVComponentsSchemasResult]), + cast_to=cast(Type[Components], ResultWrapper[Components]), ) diff --git a/src/cloudflare/resources/stream/__init__.py b/src/cloudflare/resources/stream/__init__.py index a3182ce1427..b2f9920ad15 100644 --- a/src/cloudflare/resources/stream/__init__.py +++ b/src/cloudflare/resources/stream/__init__.py @@ -1,12 +1,12 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from .clip import ( - Clip, - AsyncClip, - ClipWithRawResponse, - AsyncClipWithRawResponse, - ClipWithStreamingResponse, - AsyncClipWithStreamingResponse, + ClipResource, + AsyncClipResource, + ClipResourceWithRawResponse, + AsyncClipResourceWithRawResponse, + ClipResourceWithStreamingResponse, + AsyncClipResourceWithStreamingResponse, ) from .copy import ( Copy, @@ -126,12 +126,12 @@ "AsyncVideosWithRawResponse", "VideosWithStreamingResponse", "AsyncVideosWithStreamingResponse", - "Clip", - "AsyncClip", - "ClipWithRawResponse", - "AsyncClipWithRawResponse", - "ClipWithStreamingResponse", - "AsyncClipWithStreamingResponse", + "ClipResource", + "AsyncClipResource", + "ClipResourceWithRawResponse", + "AsyncClipResourceWithRawResponse", + "ClipResourceWithStreamingResponse", + "AsyncClipResourceWithStreamingResponse", "Copy", "AsyncCopy", "CopyWithRawResponse", diff --git a/src/cloudflare/resources/stream/audio_tracks.py b/src/cloudflare/resources/stream/audio_tracks.py index 3882d0f7d08..b1012dd8d4f 100644 --- a/src/cloudflare/resources/stream/audio_tracks.py +++ b/src/cloudflare/resources/stream/audio_tracks.py @@ -24,7 +24,7 @@ make_request_options, ) from ...types.shared import UnnamedSchemaRef602dd5f63eab958d53da61434dec08f0 -from ...types.stream import StreamAudio, AudioTrackGetResponse, audio_track_copy_params, audio_track_edit_params +from ...types.stream import Audio, AudioTrackGetResponse, audio_track_copy_params, audio_track_edit_params __all__ = ["AudioTracks", "AsyncAudioTracks"] @@ -107,7 +107,7 @@ def copy( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> StreamAudio: + ) -> Audio: """ Adds an additional audio track to a video using the provided audio track URL. @@ -151,7 +151,7 @@ def copy( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[StreamAudio], ResultWrapper[StreamAudio]), + cast_to=cast(Type[Audio], ResultWrapper[Audio]), ) def edit( @@ -168,7 +168,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> StreamAudio: + ) -> Audio: """Edits additional audio tracks on a video. Editing the default status of an audio @@ -217,7 +217,7 @@ def edit( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[StreamAudio], ResultWrapper[StreamAudio]), + cast_to=cast(Type[Audio], ResultWrapper[Audio]), ) def get( @@ -345,7 +345,7 @@ async def copy( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> StreamAudio: + ) -> Audio: """ Adds an additional audio track to a video using the provided audio track URL. @@ -389,7 +389,7 @@ async def copy( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[StreamAudio], ResultWrapper[StreamAudio]), + cast_to=cast(Type[Audio], ResultWrapper[Audio]), ) async def edit( @@ -406,7 +406,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> StreamAudio: + ) -> Audio: """Edits additional audio tracks on a video. Editing the default status of an audio @@ -455,7 +455,7 @@ async def edit( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[StreamAudio], ResultWrapper[StreamAudio]), + cast_to=cast(Type[Audio], ResultWrapper[Audio]), ) async def get( diff --git a/src/cloudflare/resources/stream/clip.py b/src/cloudflare/resources/stream/clip.py index ab85d544cfa..fa5e3aac14e 100644 --- a/src/cloudflare/resources/stream/clip.py +++ b/src/cloudflare/resources/stream/clip.py @@ -6,6 +6,7 @@ import httpx +from ...types import AllowedOriginsItem from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( maybe_transform, @@ -23,19 +24,19 @@ from ..._base_client import ( make_request_options, ) -from ...types.stream import StreamClipping, AllowedOriginsItem, clip_create_params +from ...types.stream import Clip, clip_create_params -__all__ = ["Clip", "AsyncClip"] +__all__ = ["ClipResource", "AsyncClipResource"] -class Clip(SyncAPIResource): +class ClipResource(SyncAPIResource): @cached_property - def with_raw_response(self) -> ClipWithRawResponse: - return ClipWithRawResponse(self) + def with_raw_response(self) -> ClipResourceWithRawResponse: + return ClipResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> ClipWithStreamingResponse: - return ClipWithStreamingResponse(self) + def with_streaming_response(self) -> ClipResourceWithStreamingResponse: + return ClipResourceWithStreamingResponse(self) def create( self, @@ -56,7 +57,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> StreamClipping: + ) -> Clip: """ Clips a video based on the specified start and end times provided in seconds. @@ -121,18 +122,18 @@ def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[StreamClipping], ResultWrapper[StreamClipping]), + cast_to=cast(Type[Clip], ResultWrapper[Clip]), ) -class AsyncClip(AsyncAPIResource): +class AsyncClipResource(AsyncAPIResource): @cached_property - def with_raw_response(self) -> AsyncClipWithRawResponse: - return AsyncClipWithRawResponse(self) + def with_raw_response(self) -> AsyncClipResourceWithRawResponse: + return AsyncClipResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> AsyncClipWithStreamingResponse: - return AsyncClipWithStreamingResponse(self) + def with_streaming_response(self) -> AsyncClipResourceWithStreamingResponse: + return AsyncClipResourceWithStreamingResponse(self) async def create( self, @@ -153,7 +154,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> StreamClipping: + ) -> Clip: """ Clips a video based on the specified start and end times provided in seconds. @@ -218,12 +219,12 @@ async def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[StreamClipping], ResultWrapper[StreamClipping]), + cast_to=cast(Type[Clip], ResultWrapper[Clip]), ) -class ClipWithRawResponse: - def __init__(self, clip: Clip) -> None: +class ClipResourceWithRawResponse: + def __init__(self, clip: ClipResource) -> None: self._clip = clip self.create = to_raw_response_wrapper( @@ -231,8 +232,8 @@ def __init__(self, clip: Clip) -> None: ) -class AsyncClipWithRawResponse: - def __init__(self, clip: AsyncClip) -> None: +class AsyncClipResourceWithRawResponse: + def __init__(self, clip: AsyncClipResource) -> None: self._clip = clip self.create = async_to_raw_response_wrapper( @@ -240,8 +241,8 @@ def __init__(self, clip: AsyncClip) -> None: ) -class ClipWithStreamingResponse: - def __init__(self, clip: Clip) -> None: +class ClipResourceWithStreamingResponse: + def __init__(self, clip: ClipResource) -> None: self._clip = clip self.create = to_streamed_response_wrapper( @@ -249,8 +250,8 @@ def __init__(self, clip: Clip) -> None: ) -class AsyncClipWithStreamingResponse: - def __init__(self, clip: AsyncClip) -> None: +class AsyncClipResourceWithStreamingResponse: + def __init__(self, clip: AsyncClipResource) -> None: self._clip = clip self.create = async_to_streamed_response_wrapper( diff --git a/src/cloudflare/resources/stream/copy.py b/src/cloudflare/resources/stream/copy.py index c94eb3e7f75..9e9fc8e2a02 100644 --- a/src/cloudflare/resources/stream/copy.py +++ b/src/cloudflare/resources/stream/copy.py @@ -7,7 +7,7 @@ import httpx -from ...types import StreamVideos +from ...types import Video, AllowedOriginsItem from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( maybe_transform, @@ -25,7 +25,7 @@ from ..._base_client import ( make_request_options, ) -from ...types.stream import AllowedOriginsItem, copy_create_params +from ...types.stream import copy_create_params __all__ = ["Copy", "AsyncCopy"] @@ -57,7 +57,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> StreamVideos: + ) -> Video: """ Uploads a video to Stream from a provided URL. @@ -121,7 +121,7 @@ def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[StreamVideos], ResultWrapper[StreamVideos]), + cast_to=cast(Type[Video], ResultWrapper[Video]), ) @@ -152,7 +152,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> StreamVideos: + ) -> Video: """ Uploads a video to Stream from a provided URL. @@ -216,7 +216,7 @@ async def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[StreamVideos], ResultWrapper[StreamVideos]), + cast_to=cast(Type[Video], ResultWrapper[Video]), ) diff --git a/src/cloudflare/resources/stream/direct_upload.py b/src/cloudflare/resources/stream/direct_upload.py index db7d2e013a9..293e1f20977 100644 --- a/src/cloudflare/resources/stream/direct_upload.py +++ b/src/cloudflare/resources/stream/direct_upload.py @@ -7,6 +7,7 @@ import httpx +from ...types import AllowedOriginsItem from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( maybe_transform, @@ -24,7 +25,7 @@ from ..._base_client import ( make_request_options, ) -from ...types.stream import AllowedOriginsItem, DirectUploadCreateResponse, direct_upload_create_params +from ...types.stream import DirectUploadCreateResponse, direct_upload_create_params __all__ = ["DirectUpload", "AsyncDirectUpload"] diff --git a/src/cloudflare/resources/stream/keys.py b/src/cloudflare/resources/stream/keys.py index b116cef718a..789fce22a64 100644 --- a/src/cloudflare/resources/stream/keys.py +++ b/src/cloudflare/resources/stream/keys.py @@ -24,7 +24,7 @@ make_request_options, ) from ...types.shared import UnnamedSchemaRef602dd5f63eab958d53da61434dec08f0 -from ...types.stream import StreamKeys, KeyGetResponse, key_create_params, key_delete_params +from ...types.stream import KeyGetResponse, keys, key_create_params, key_delete_params __all__ = ["Keys", "AsyncKeys"] @@ -49,7 +49,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> StreamKeys: + ) -> keys.Keys: """Creates an RSA private key in PEM and JWK formats. Key files are only displayed @@ -79,7 +79,7 @@ def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[StreamKeys], ResultWrapper[StreamKeys]), + cast_to=cast(Type[keys.Keys], ResultWrapper[keys.Keys]), ) def delete( @@ -193,7 +193,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> StreamKeys: + ) -> keys.Keys: """Creates an RSA private key in PEM and JWK formats. Key files are only displayed @@ -223,7 +223,7 @@ async def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[StreamKeys], ResultWrapper[StreamKeys]), + cast_to=cast(Type[keys.Keys], ResultWrapper[keys.Keys]), ) async def delete( diff --git a/src/cloudflare/resources/stream/live_inputs/live_inputs.py b/src/cloudflare/resources/stream/live_inputs/live_inputs.py index 5c48b0d88c3..739a91f0eb5 100644 --- a/src/cloudflare/resources/stream/live_inputs/live_inputs.py +++ b/src/cloudflare/resources/stream/live_inputs/live_inputs.py @@ -32,7 +32,7 @@ make_request_options, ) from ....types.stream import ( - StreamLiveInput, + LiveInput, LiveInputListResponse, live_input_list_params, live_input_create_params, @@ -70,7 +70,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> StreamLiveInput: + ) -> LiveInput: """ Creates a live input, and returns credentials that you or your users can use to stream live video to Cloudflare Stream. @@ -121,7 +121,7 @@ def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[StreamLiveInput], ResultWrapper[StreamLiveInput]), + cast_to=cast(Type[LiveInput], ResultWrapper[LiveInput]), ) def update( @@ -139,7 +139,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> StreamLiveInput: + ) -> LiveInput: """ Updates a specified live input. @@ -195,7 +195,7 @@ def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[StreamLiveInput], ResultWrapper[StreamLiveInput]), + cast_to=cast(Type[LiveInput], ResultWrapper[LiveInput]), ) def list( @@ -301,7 +301,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> StreamLiveInput: + ) -> LiveInput: """ Retrieves details of an existing live input. @@ -333,7 +333,7 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[StreamLiveInput], ResultWrapper[StreamLiveInput]), + cast_to=cast(Type[LiveInput], ResultWrapper[LiveInput]), ) @@ -364,7 +364,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> StreamLiveInput: + ) -> LiveInput: """ Creates a live input, and returns credentials that you or your users can use to stream live video to Cloudflare Stream. @@ -415,7 +415,7 @@ async def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[StreamLiveInput], ResultWrapper[StreamLiveInput]), + cast_to=cast(Type[LiveInput], ResultWrapper[LiveInput]), ) async def update( @@ -433,7 +433,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> StreamLiveInput: + ) -> LiveInput: """ Updates a specified live input. @@ -489,7 +489,7 @@ async def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[StreamLiveInput], ResultWrapper[StreamLiveInput]), + cast_to=cast(Type[LiveInput], ResultWrapper[LiveInput]), ) async def list( @@ -597,7 +597,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> StreamLiveInput: + ) -> LiveInput: """ Retrieves details of an existing live input. @@ -629,7 +629,7 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[StreamLiveInput], ResultWrapper[StreamLiveInput]), + cast_to=cast(Type[LiveInput], ResultWrapper[LiveInput]), ) diff --git a/src/cloudflare/resources/stream/live_inputs/outputs.py b/src/cloudflare/resources/stream/live_inputs/outputs.py index bd89a750026..e07f639d512 100644 --- a/src/cloudflare/resources/stream/live_inputs/outputs.py +++ b/src/cloudflare/resources/stream/live_inputs/outputs.py @@ -25,7 +25,7 @@ AsyncPaginator, make_request_options, ) -from ....types.stream.live_inputs import StreamOutput, output_create_params, output_delete_params, output_update_params +from ....types.stream.live_inputs import Output, output_create_params, output_delete_params, output_update_params __all__ = ["Outputs", "AsyncOutputs"] @@ -53,7 +53,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> StreamOutput: + ) -> Output: """ Creates a new output that can be used to simulcast or restream live video to other RTMP or SRT destinations. Outputs are always linked to a specific live @@ -105,7 +105,7 @@ def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[StreamOutput], ResultWrapper[StreamOutput]), + cast_to=cast(Type[Output], ResultWrapper[Output]), ) def update( @@ -121,7 +121,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> StreamOutput: + ) -> Output: """ Updates the state of an output. @@ -164,7 +164,7 @@ def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[StreamOutput], ResultWrapper[StreamOutput]), + cast_to=cast(Type[Output], ResultWrapper[Output]), ) def list( @@ -178,7 +178,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[StreamOutput]: + ) -> SyncSinglePage[Output]: """ Retrieves all outputs associated with a specified live input. @@ -203,11 +203,11 @@ def list( ) return self._get_api_list( f"/accounts/{account_id}/stream/live_inputs/{live_input_identifier}/outputs", - page=SyncSinglePage[StreamOutput], + page=SyncSinglePage[Output], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=StreamOutput, + model=Output, ) def delete( @@ -284,7 +284,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> StreamOutput: + ) -> Output: """ Creates a new output that can be used to simulcast or restream live video to other RTMP or SRT destinations. Outputs are always linked to a specific live @@ -336,7 +336,7 @@ async def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[StreamOutput], ResultWrapper[StreamOutput]), + cast_to=cast(Type[Output], ResultWrapper[Output]), ) async def update( @@ -352,7 +352,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> StreamOutput: + ) -> Output: """ Updates the state of an output. @@ -395,7 +395,7 @@ async def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[StreamOutput], ResultWrapper[StreamOutput]), + cast_to=cast(Type[Output], ResultWrapper[Output]), ) def list( @@ -409,7 +409,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[StreamOutput, AsyncSinglePage[StreamOutput]]: + ) -> AsyncPaginator[Output, AsyncSinglePage[Output]]: """ Retrieves all outputs associated with a specified live input. @@ -434,11 +434,11 @@ def list( ) return self._get_api_list( f"/accounts/{account_id}/stream/live_inputs/{live_input_identifier}/outputs", - page=AsyncSinglePage[StreamOutput], + page=AsyncSinglePage[Output], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=StreamOutput, + model=Output, ) async def delete( diff --git a/src/cloudflare/resources/stream/stream.py b/src/cloudflare/resources/stream/stream.py index d3aedd966b9..492fca9ef78 100644 --- a/src/cloudflare/resources/stream/stream.py +++ b/src/cloudflare/resources/stream/stream.py @@ -9,12 +9,12 @@ import httpx from .clip import ( - Clip, - AsyncClip, - ClipWithRawResponse, - AsyncClipWithRawResponse, - ClipWithStreamingResponse, - AsyncClipWithStreamingResponse, + ClipResource, + AsyncClipResource, + ClipResourceWithRawResponse, + AsyncClipResourceWithRawResponse, + ClipResourceWithStreamingResponse, + AsyncClipResourceWithStreamingResponse, ) from .copy import ( Copy, @@ -56,7 +56,7 @@ VideosWithStreamingResponse, AsyncVideosWithStreamingResponse, ) -from ...types import StreamVideos, stream_list_params, stream_create_params, stream_delete_params +from ...types import Video, stream_list_params, stream_create_params, stream_delete_params from ..._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven from ..._utils import ( maybe_transform, @@ -147,8 +147,8 @@ def videos(self) -> Videos: return Videos(self._client) @cached_property - def clip(self) -> Clip: - return Clip(self._client) + def clip(self) -> ClipResource: + return ClipResource(self._client) @cached_property def copy(self) -> Copy: @@ -259,7 +259,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[StreamVideos]: + ) -> SyncSinglePage[Video]: """Lists up to 1000 videos from a single request. For a specific range, refer to @@ -298,7 +298,7 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/stream", - page=SyncSinglePage[StreamVideos], + page=SyncSinglePage[Video], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -318,7 +318,7 @@ def list( stream_list_params.StreamListParams, ), ), - model=StreamVideos, + model=Video, ) def delete( @@ -375,7 +375,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> StreamVideos: + ) -> Video: """ Fetches details for a single video. @@ -405,7 +405,7 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[StreamVideos], ResultWrapper[StreamVideos]), + cast_to=cast(Type[Video], ResultWrapper[Video]), ) @@ -419,8 +419,8 @@ def videos(self) -> AsyncVideos: return AsyncVideos(self._client) @cached_property - def clip(self) -> AsyncClip: - return AsyncClip(self._client) + def clip(self) -> AsyncClipResource: + return AsyncClipResource(self._client) @cached_property def copy(self) -> AsyncCopy: @@ -531,7 +531,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[StreamVideos, AsyncSinglePage[StreamVideos]]: + ) -> AsyncPaginator[Video, AsyncSinglePage[Video]]: """Lists up to 1000 videos from a single request. For a specific range, refer to @@ -570,7 +570,7 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/stream", - page=AsyncSinglePage[StreamVideos], + page=AsyncSinglePage[Video], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -590,7 +590,7 @@ def list( stream_list_params.StreamListParams, ), ), - model=StreamVideos, + model=Video, ) async def delete( @@ -647,7 +647,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> StreamVideos: + ) -> Video: """ Fetches details for a single video. @@ -677,7 +677,7 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[StreamVideos], ResultWrapper[StreamVideos]), + cast_to=cast(Type[Video], ResultWrapper[Video]), ) @@ -707,8 +707,8 @@ def videos(self) -> VideosWithRawResponse: return VideosWithRawResponse(self._stream.videos) @cached_property - def clip(self) -> ClipWithRawResponse: - return ClipWithRawResponse(self._stream.clip) + def clip(self) -> ClipResourceWithRawResponse: + return ClipResourceWithRawResponse(self._stream.clip) @cached_property def copy(self) -> CopyWithRawResponse: @@ -777,8 +777,8 @@ def videos(self) -> AsyncVideosWithRawResponse: return AsyncVideosWithRawResponse(self._stream.videos) @cached_property - def clip(self) -> AsyncClipWithRawResponse: - return AsyncClipWithRawResponse(self._stream.clip) + def clip(self) -> AsyncClipResourceWithRawResponse: + return AsyncClipResourceWithRawResponse(self._stream.clip) @cached_property def copy(self) -> AsyncCopyWithRawResponse: @@ -847,8 +847,8 @@ def videos(self) -> VideosWithStreamingResponse: return VideosWithStreamingResponse(self._stream.videos) @cached_property - def clip(self) -> ClipWithStreamingResponse: - return ClipWithStreamingResponse(self._stream.clip) + def clip(self) -> ClipResourceWithStreamingResponse: + return ClipResourceWithStreamingResponse(self._stream.clip) @cached_property def copy(self) -> CopyWithStreamingResponse: @@ -917,8 +917,8 @@ def videos(self) -> AsyncVideosWithStreamingResponse: return AsyncVideosWithStreamingResponse(self._stream.videos) @cached_property - def clip(self) -> AsyncClipWithStreamingResponse: - return AsyncClipWithStreamingResponse(self._stream.clip) + def clip(self) -> AsyncClipResourceWithStreamingResponse: + return AsyncClipResourceWithStreamingResponse(self._stream.clip) @cached_property def copy(self) -> AsyncCopyWithStreamingResponse: diff --git a/src/cloudflare/resources/stream/watermarks.py b/src/cloudflare/resources/stream/watermarks.py index 88ecf326b40..55a2b2a0c54 100644 --- a/src/cloudflare/resources/stream/watermarks.py +++ b/src/cloudflare/resources/stream/watermarks.py @@ -29,7 +29,7 @@ UnnamedSchemaRef602dd5f63eab958d53da61434dec08f0, UnnamedSchemaRef9444735ca60712dbcf8afd832eb5716a, ) -from ...types.stream import StreamWatermarks, watermark_create_params, watermark_delete_params +from ...types.stream import Watermaks, watermark_create_params, watermark_delete_params __all__ = ["Watermarks", "AsyncWatermarks"] @@ -136,7 +136,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[StreamWatermarks]: + ) -> SyncSinglePage[Watermaks]: """ Lists all watermark profiles for an account. @@ -155,11 +155,11 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/stream/watermarks", - page=SyncSinglePage[StreamWatermarks], + page=SyncSinglePage[Watermaks], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=StreamWatermarks, + model=Watermaks, ) def delete( @@ -365,7 +365,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[StreamWatermarks, AsyncSinglePage[StreamWatermarks]]: + ) -> AsyncPaginator[Watermaks, AsyncSinglePage[Watermaks]]: """ Lists all watermark profiles for an account. @@ -384,11 +384,11 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/stream/watermarks", - page=AsyncSinglePage[StreamWatermarks], + page=AsyncSinglePage[Watermaks], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=StreamWatermarks, + model=Watermaks, ) async def delete( diff --git a/src/cloudflare/resources/subscriptions.py b/src/cloudflare/resources/subscriptions.py index 03350dcae18..5ea4121018a 100644 --- a/src/cloudflare/resources/subscriptions.py +++ b/src/cloudflare/resources/subscriptions.py @@ -8,7 +8,6 @@ import httpx from ..types import ( - SubscriptionListResponse, SubscriptionDeleteResponse, subscription_create_params, subscription_delete_params, @@ -29,6 +28,7 @@ ) from .._wrappers import ResultWrapper from ..pagination import SyncSinglePage, AsyncSinglePage +from ..types.user import Subscription from .._base_client import ( AsyncPaginator, make_request_options, @@ -198,7 +198,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[SubscriptionListResponse]: + ) -> SyncSinglePage[Subscription]: """ Lists all of an account's subscriptions. @@ -217,11 +217,11 @@ def list( raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") return self._get_api_list( f"/accounts/{account_identifier}/subscriptions", - page=SyncSinglePage[SubscriptionListResponse], + page=SyncSinglePage[Subscription], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=SubscriptionListResponse, + model=Subscription, ) def delete( @@ -477,7 +477,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[SubscriptionListResponse, AsyncSinglePage[SubscriptionListResponse]]: + ) -> AsyncPaginator[Subscription, AsyncSinglePage[Subscription]]: """ Lists all of an account's subscriptions. @@ -496,11 +496,11 @@ def list( raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") return self._get_api_list( f"/accounts/{account_identifier}/subscriptions", - page=AsyncSinglePage[SubscriptionListResponse], + page=AsyncSinglePage[Subscription], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=SubscriptionListResponse, + model=Subscription, ) async def delete( diff --git a/src/cloudflare/resources/user/__init__.py b/src/cloudflare/resources/user/__init__.py index ee1070d2216..f190d6046ea 100644 --- a/src/cloudflare/resources/user/__init__.py +++ b/src/cloudflare/resources/user/__init__.py @@ -1,12 +1,12 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from .user import ( - UserResource, - AsyncUserResource, - UserResourceWithRawResponse, - AsyncUserResourceWithRawResponse, - UserResourceWithStreamingResponse, - AsyncUserResourceWithStreamingResponse, + User, + AsyncUser, + UserWithRawResponse, + AsyncUserWithRawResponse, + UserWithStreamingResponse, + AsyncUserWithStreamingResponse, ) from .tokens import ( Tokens, @@ -122,10 +122,10 @@ "AsyncTokensWithRawResponse", "TokensWithStreamingResponse", "AsyncTokensWithStreamingResponse", - "UserResource", - "AsyncUserResource", - "UserResourceWithRawResponse", - "AsyncUserResourceWithRawResponse", - "UserResourceWithStreamingResponse", - "AsyncUserResourceWithStreamingResponse", + "User", + "AsyncUser", + "UserWithRawResponse", + "AsyncUserWithRawResponse", + "UserWithStreamingResponse", + "AsyncUserWithStreamingResponse", ] diff --git a/src/cloudflare/resources/user/firewall/access_rules.py b/src/cloudflare/resources/user/firewall/access_rules.py index e8da8412b4b..c3507d73e27 100644 --- a/src/cloudflare/resources/user/firewall/access_rules.py +++ b/src/cloudflare/resources/user/firewall/access_rules.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 @@ -27,7 +27,9 @@ make_request_options, ) from ....types.user.firewall import ( - AccessRule, + AccessRuleEditResponse, + AccessRuleListResponse, + AccessRuleCreateResponse, AccessRuleDeleteResponse, access_rule_edit_params, access_rule_list_params, @@ -59,7 +61,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[AccessRule]: + ) -> AccessRuleCreateResponse: """ Creates a new IP Access rule for all zones owned by the current user. @@ -98,7 +100,7 @@ def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[AccessRule]], ResultWrapper[AccessRule]), + cast_to=cast(Type[AccessRuleCreateResponse], ResultWrapper[AccessRuleCreateResponse]), ) def list( @@ -116,7 +118,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncV4PagePaginationArray[AccessRule]: + ) -> SyncV4PagePaginationArray[AccessRuleListResponse]: """Fetches IP Access rules of the user. You can filter the results using several @@ -141,7 +143,7 @@ def list( """ return self._get_api_list( "/user/firewall/access_rules/rules", - page=SyncV4PagePaginationArray[AccessRule], + page=SyncV4PagePaginationArray[AccessRuleListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -159,7 +161,7 @@ def list( access_rule_list_params.AccessRuleListParams, ), ), - model=AccessRule, + model=AccessRuleListResponse, ) def delete( @@ -173,7 +175,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[AccessRuleDeleteResponse]: + ) -> AccessRuleDeleteResponse: """ Deletes an IP Access rule at the user level. @@ -202,7 +204,7 @@ def delete( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[AccessRuleDeleteResponse]], ResultWrapper[AccessRuleDeleteResponse]), + cast_to=cast(Type[AccessRuleDeleteResponse], ResultWrapper[AccessRuleDeleteResponse]), ) def edit( @@ -217,7 +219,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[AccessRule]: + ) -> AccessRuleEditResponse: """Updates an IP Access rule defined at the user level. You can only update the @@ -256,7 +258,7 @@ def edit( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[AccessRule]], ResultWrapper[AccessRule]), + cast_to=cast(Type[AccessRuleEditResponse], ResultWrapper[AccessRuleEditResponse]), ) @@ -281,7 +283,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[AccessRule]: + ) -> AccessRuleCreateResponse: """ Creates a new IP Access rule for all zones owned by the current user. @@ -320,7 +322,7 @@ async def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[AccessRule]], ResultWrapper[AccessRule]), + cast_to=cast(Type[AccessRuleCreateResponse], ResultWrapper[AccessRuleCreateResponse]), ) def list( @@ -338,7 +340,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[AccessRule, AsyncV4PagePaginationArray[AccessRule]]: + ) -> AsyncPaginator[AccessRuleListResponse, AsyncV4PagePaginationArray[AccessRuleListResponse]]: """Fetches IP Access rules of the user. You can filter the results using several @@ -363,7 +365,7 @@ def list( """ return self._get_api_list( "/user/firewall/access_rules/rules", - page=AsyncV4PagePaginationArray[AccessRule], + page=AsyncV4PagePaginationArray[AccessRuleListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -381,7 +383,7 @@ def list( access_rule_list_params.AccessRuleListParams, ), ), - model=AccessRule, + model=AccessRuleListResponse, ) async def delete( @@ -395,7 +397,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[AccessRuleDeleteResponse]: + ) -> AccessRuleDeleteResponse: """ Deletes an IP Access rule at the user level. @@ -424,7 +426,7 @@ async def delete( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[AccessRuleDeleteResponse]], ResultWrapper[AccessRuleDeleteResponse]), + cast_to=cast(Type[AccessRuleDeleteResponse], ResultWrapper[AccessRuleDeleteResponse]), ) async def edit( @@ -439,7 +441,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[AccessRule]: + ) -> AccessRuleEditResponse: """Updates an IP Access rule defined at the user level. You can only update the @@ -478,7 +480,7 @@ async def edit( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[AccessRule]], ResultWrapper[AccessRule]), + cast_to=cast(Type[AccessRuleEditResponse], ResultWrapper[AccessRuleEditResponse]), ) diff --git a/src/cloudflare/resources/user/load_balancers/__init__.py b/src/cloudflare/resources/user/load_balancers/__init__.py index 53cd31b6fb2..fbc81ccc792 100644 --- a/src/cloudflare/resources/user/load_balancers/__init__.py +++ b/src/cloudflare/resources/user/load_balancers/__init__.py @@ -9,12 +9,12 @@ AsyncPoolsWithStreamingResponse, ) from .preview import ( - Preview, - AsyncPreview, - PreviewWithRawResponse, - AsyncPreviewWithRawResponse, - PreviewWithStreamingResponse, - AsyncPreviewWithStreamingResponse, + PreviewResource, + AsyncPreviewResource, + PreviewResourceWithRawResponse, + AsyncPreviewResourceWithRawResponse, + PreviewResourceWithStreamingResponse, + AsyncPreviewResourceWithStreamingResponse, ) from .monitors import ( Monitors, @@ -54,12 +54,12 @@ "AsyncPoolsWithRawResponse", "PoolsWithStreamingResponse", "AsyncPoolsWithStreamingResponse", - "Preview", - "AsyncPreview", - "PreviewWithRawResponse", - "AsyncPreviewWithRawResponse", - "PreviewWithStreamingResponse", - "AsyncPreviewWithStreamingResponse", + "PreviewResource", + "AsyncPreviewResource", + "PreviewResourceWithRawResponse", + "AsyncPreviewResourceWithRawResponse", + "PreviewResourceWithStreamingResponse", + "AsyncPreviewResourceWithStreamingResponse", "Analytics", "AsyncAnalytics", "AnalyticsWithRawResponse", diff --git a/src/cloudflare/resources/user/load_balancers/analytics/events.py b/src/cloudflare/resources/user/load_balancers/analytics/events.py index 16d130bb45c..7d778121abf 100644 --- a/src/cloudflare/resources/user/load_balancers/analytics/events.py +++ b/src/cloudflare/resources/user/load_balancers/analytics/events.py @@ -22,7 +22,8 @@ AsyncPaginator, make_request_options, ) -from .....types.user.load_balancers.analytics import LoadBalancingAnalytics, event_list_params +from .....types.user.load_balancers import Analytics +from .....types.user.load_balancers.analytics import event_list_params __all__ = ["Events", "AsyncEvents"] @@ -52,7 +53,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[LoadBalancingAnalytics]: + ) -> SyncSinglePage[Analytics]: """ List origin health changes. @@ -81,7 +82,7 @@ def list( """ return self._get_api_list( "/user/load_balancing_analytics/events", - page=SyncSinglePage[LoadBalancingAnalytics], + page=SyncSinglePage[Analytics], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -100,7 +101,7 @@ def list( event_list_params.EventListParams, ), ), - model=LoadBalancingAnalytics, + model=Analytics, ) @@ -129,7 +130,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[LoadBalancingAnalytics, AsyncSinglePage[LoadBalancingAnalytics]]: + ) -> AsyncPaginator[Analytics, AsyncSinglePage[Analytics]]: """ List origin health changes. @@ -158,7 +159,7 @@ def list( """ return self._get_api_list( "/user/load_balancing_analytics/events", - page=AsyncSinglePage[LoadBalancingAnalytics], + page=AsyncSinglePage[Analytics], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -177,7 +178,7 @@ def list( event_list_params.EventListParams, ), ), - model=LoadBalancingAnalytics, + model=Analytics, ) diff --git a/src/cloudflare/resources/user/load_balancers/load_balancers.py b/src/cloudflare/resources/user/load_balancers/load_balancers.py index b6c59991c8a..7f661fbb07f 100644 --- a/src/cloudflare/resources/user/load_balancers/load_balancers.py +++ b/src/cloudflare/resources/user/load_balancers/load_balancers.py @@ -11,12 +11,12 @@ AsyncPoolsWithStreamingResponse, ) from .preview import ( - Preview, - AsyncPreview, - PreviewWithRawResponse, - AsyncPreviewWithRawResponse, - PreviewWithStreamingResponse, - AsyncPreviewWithStreamingResponse, + PreviewResource, + AsyncPreviewResource, + PreviewResourceWithRawResponse, + AsyncPreviewResourceWithRawResponse, + PreviewResourceWithStreamingResponse, + AsyncPreviewResourceWithStreamingResponse, ) from .monitors import ( Monitors, @@ -51,8 +51,8 @@ def pools(self) -> Pools: return Pools(self._client) @cached_property - def preview(self) -> Preview: - return Preview(self._client) + def preview(self) -> PreviewResource: + return PreviewResource(self._client) @cached_property def analytics(self) -> Analytics: @@ -77,8 +77,8 @@ def pools(self) -> AsyncPools: return AsyncPools(self._client) @cached_property - def preview(self) -> AsyncPreview: - return AsyncPreview(self._client) + def preview(self) -> AsyncPreviewResource: + return AsyncPreviewResource(self._client) @cached_property def analytics(self) -> AsyncAnalytics: @@ -106,8 +106,8 @@ def pools(self) -> PoolsWithRawResponse: return PoolsWithRawResponse(self._load_balancers.pools) @cached_property - def preview(self) -> PreviewWithRawResponse: - return PreviewWithRawResponse(self._load_balancers.preview) + def preview(self) -> PreviewResourceWithRawResponse: + return PreviewResourceWithRawResponse(self._load_balancers.preview) @cached_property def analytics(self) -> AnalyticsWithRawResponse: @@ -127,8 +127,8 @@ def pools(self) -> AsyncPoolsWithRawResponse: return AsyncPoolsWithRawResponse(self._load_balancers.pools) @cached_property - def preview(self) -> AsyncPreviewWithRawResponse: - return AsyncPreviewWithRawResponse(self._load_balancers.preview) + def preview(self) -> AsyncPreviewResourceWithRawResponse: + return AsyncPreviewResourceWithRawResponse(self._load_balancers.preview) @cached_property def analytics(self) -> AsyncAnalyticsWithRawResponse: @@ -148,8 +148,8 @@ def pools(self) -> PoolsWithStreamingResponse: return PoolsWithStreamingResponse(self._load_balancers.pools) @cached_property - def preview(self) -> PreviewWithStreamingResponse: - return PreviewWithStreamingResponse(self._load_balancers.preview) + def preview(self) -> PreviewResourceWithStreamingResponse: + return PreviewResourceWithStreamingResponse(self._load_balancers.preview) @cached_property def analytics(self) -> AnalyticsWithStreamingResponse: @@ -169,8 +169,8 @@ def pools(self) -> AsyncPoolsWithStreamingResponse: return AsyncPoolsWithStreamingResponse(self._load_balancers.pools) @cached_property - def preview(self) -> AsyncPreviewWithStreamingResponse: - return AsyncPreviewWithStreamingResponse(self._load_balancers.preview) + def preview(self) -> AsyncPreviewResourceWithStreamingResponse: + return AsyncPreviewResourceWithStreamingResponse(self._load_balancers.preview) @cached_property def analytics(self) -> AsyncAnalyticsWithStreamingResponse: diff --git a/src/cloudflare/resources/user/load_balancers/pools.py b/src/cloudflare/resources/user/load_balancers/pools.py index ac4d63bee98..0df03ddaf73 100644 --- a/src/cloudflare/resources/user/load_balancers/pools.py +++ b/src/cloudflare/resources/user/load_balancers/pools.py @@ -8,6 +8,7 @@ import httpx from ....types import ( + CheckRegion, OriginParam, LoadSheddingParam, OriginSteeringParam, @@ -63,27 +64,7 @@ def create( *, name: str, origins: Iterable[OriginParam], - check_regions: Optional[ - List[ - Literal[ - "WNAM", - "ENAM", - "WEU", - "EEU", - "NSAM", - "SSAM", - "OC", - "ME", - "NAF", - "SAF", - "SAS", - "SEAS", - "NEAS", - "ALL_REGIONS", - ] - ] - ] - | NotGiven = NOT_GIVEN, + check_regions: Optional[List[CheckRegion]] | NotGiven = NOT_GIVEN, description: str | NotGiven = NOT_GIVEN, enabled: bool | NotGiven = NOT_GIVEN, latitude: float | NotGiven = NOT_GIVEN, @@ -192,27 +173,7 @@ def update( *, name: str, origins: Iterable[OriginParam], - check_regions: Optional[ - List[ - Literal[ - "WNAM", - "ENAM", - "WEU", - "EEU", - "NSAM", - "SSAM", - "OC", - "ME", - "NAF", - "SAF", - "SAS", - "SEAS", - "NEAS", - "ALL_REGIONS", - ] - ] - ] - | NotGiven = NOT_GIVEN, + check_regions: Optional[List[CheckRegion]] | NotGiven = NOT_GIVEN, description: str | NotGiven = NOT_GIVEN, enabled: bool | NotGiven = NOT_GIVEN, latitude: float | NotGiven = NOT_GIVEN, @@ -399,27 +360,7 @@ def edit( self, pool_id: str, *, - check_regions: Optional[ - List[ - Literal[ - "WNAM", - "ENAM", - "WEU", - "EEU", - "NSAM", - "SSAM", - "OC", - "ME", - "NAF", - "SAF", - "SAS", - "SEAS", - "NEAS", - "ALL_REGIONS", - ] - ] - ] - | NotGiven = NOT_GIVEN, + check_regions: Optional[List[CheckRegion]] | NotGiven = NOT_GIVEN, description: str | NotGiven = NOT_GIVEN, enabled: bool | NotGiven = NOT_GIVEN, latitude: float | NotGiven = NOT_GIVEN, @@ -781,27 +722,7 @@ async def create( *, name: str, origins: Iterable[OriginParam], - check_regions: Optional[ - List[ - Literal[ - "WNAM", - "ENAM", - "WEU", - "EEU", - "NSAM", - "SSAM", - "OC", - "ME", - "NAF", - "SAF", - "SAS", - "SEAS", - "NEAS", - "ALL_REGIONS", - ] - ] - ] - | NotGiven = NOT_GIVEN, + check_regions: Optional[List[CheckRegion]] | NotGiven = NOT_GIVEN, description: str | NotGiven = NOT_GIVEN, enabled: bool | NotGiven = NOT_GIVEN, latitude: float | NotGiven = NOT_GIVEN, @@ -910,27 +831,7 @@ async def update( *, name: str, origins: Iterable[OriginParam], - check_regions: Optional[ - List[ - Literal[ - "WNAM", - "ENAM", - "WEU", - "EEU", - "NSAM", - "SSAM", - "OC", - "ME", - "NAF", - "SAF", - "SAS", - "SEAS", - "NEAS", - "ALL_REGIONS", - ] - ] - ] - | NotGiven = NOT_GIVEN, + check_regions: Optional[List[CheckRegion]] | NotGiven = NOT_GIVEN, description: str | NotGiven = NOT_GIVEN, enabled: bool | NotGiven = NOT_GIVEN, latitude: float | NotGiven = NOT_GIVEN, @@ -1117,27 +1018,7 @@ async def edit( self, pool_id: str, *, - check_regions: Optional[ - List[ - Literal[ - "WNAM", - "ENAM", - "WEU", - "EEU", - "NSAM", - "SSAM", - "OC", - "ME", - "NAF", - "SAF", - "SAS", - "SEAS", - "NEAS", - "ALL_REGIONS", - ] - ] - ] - | NotGiven = NOT_GIVEN, + check_regions: Optional[List[CheckRegion]] | NotGiven = NOT_GIVEN, description: str | NotGiven = NOT_GIVEN, enabled: bool | NotGiven = NOT_GIVEN, latitude: float | NotGiven = NOT_GIVEN, diff --git a/src/cloudflare/resources/user/load_balancers/preview.py b/src/cloudflare/resources/user/load_balancers/preview.py index ded8823d74b..1e655e816a1 100644 --- a/src/cloudflare/resources/user/load_balancers/preview.py +++ b/src/cloudflare/resources/user/load_balancers/preview.py @@ -19,19 +19,19 @@ from ...._base_client import ( make_request_options, ) -from ....types.user.load_balancers import LoadBalancingPreview +from ....types.user.load_balancers import Preview -__all__ = ["Preview", "AsyncPreview"] +__all__ = ["PreviewResource", "AsyncPreviewResource"] -class Preview(SyncAPIResource): +class PreviewResource(SyncAPIResource): @cached_property - def with_raw_response(self) -> PreviewWithRawResponse: - return PreviewWithRawResponse(self) + def with_raw_response(self) -> PreviewResourceWithRawResponse: + return PreviewResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> PreviewWithStreamingResponse: - return PreviewWithStreamingResponse(self) + def with_streaming_response(self) -> PreviewResourceWithStreamingResponse: + return PreviewResourceWithStreamingResponse(self) def get( self, @@ -43,7 +43,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LoadBalancingPreview: + ) -> Preview: """ Get the result of a previous preview operation using the provided preview_id. @@ -67,18 +67,18 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[LoadBalancingPreview], ResultWrapper[LoadBalancingPreview]), + cast_to=cast(Type[Preview], ResultWrapper[Preview]), ) -class AsyncPreview(AsyncAPIResource): +class AsyncPreviewResource(AsyncAPIResource): @cached_property - def with_raw_response(self) -> AsyncPreviewWithRawResponse: - return AsyncPreviewWithRawResponse(self) + def with_raw_response(self) -> AsyncPreviewResourceWithRawResponse: + return AsyncPreviewResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> AsyncPreviewWithStreamingResponse: - return AsyncPreviewWithStreamingResponse(self) + def with_streaming_response(self) -> AsyncPreviewResourceWithStreamingResponse: + return AsyncPreviewResourceWithStreamingResponse(self) async def get( self, @@ -90,7 +90,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LoadBalancingPreview: + ) -> Preview: """ Get the result of a previous preview operation using the provided preview_id. @@ -114,12 +114,12 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[LoadBalancingPreview], ResultWrapper[LoadBalancingPreview]), + cast_to=cast(Type[Preview], ResultWrapper[Preview]), ) -class PreviewWithRawResponse: - def __init__(self, preview: Preview) -> None: +class PreviewResourceWithRawResponse: + def __init__(self, preview: PreviewResource) -> None: self._preview = preview self.get = to_raw_response_wrapper( @@ -127,8 +127,8 @@ def __init__(self, preview: Preview) -> None: ) -class AsyncPreviewWithRawResponse: - def __init__(self, preview: AsyncPreview) -> None: +class AsyncPreviewResourceWithRawResponse: + def __init__(self, preview: AsyncPreviewResource) -> None: self._preview = preview self.get = async_to_raw_response_wrapper( @@ -136,8 +136,8 @@ def __init__(self, preview: AsyncPreview) -> None: ) -class PreviewWithStreamingResponse: - def __init__(self, preview: Preview) -> None: +class PreviewResourceWithStreamingResponse: + def __init__(self, preview: PreviewResource) -> None: self._preview = preview self.get = to_streamed_response_wrapper( @@ -145,8 +145,8 @@ def __init__(self, preview: Preview) -> None: ) -class AsyncPreviewWithStreamingResponse: - def __init__(self, preview: AsyncPreview) -> None: +class AsyncPreviewResourceWithStreamingResponse: + def __init__(self, preview: AsyncPreviewResource) -> None: self._preview = preview self.get = async_to_streamed_response_wrapper( diff --git a/src/cloudflare/resources/user/tokens/__init__.py b/src/cloudflare/resources/user/tokens/__init__.py index f6baeff682d..e517da3e3a7 100644 --- a/src/cloudflare/resources/user/tokens/__init__.py +++ b/src/cloudflare/resources/user/tokens/__init__.py @@ -1,12 +1,12 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from .value import ( - Value, - AsyncValue, - ValueWithRawResponse, - AsyncValueWithRawResponse, - ValueWithStreamingResponse, - AsyncValueWithStreamingResponse, + ValueResource, + AsyncValueResource, + ValueResourceWithRawResponse, + AsyncValueResourceWithRawResponse, + ValueResourceWithStreamingResponse, + AsyncValueResourceWithStreamingResponse, ) from .tokens import ( Tokens, @@ -32,12 +32,12 @@ "AsyncPermissionGroupsWithRawResponse", "PermissionGroupsWithStreamingResponse", "AsyncPermissionGroupsWithStreamingResponse", - "Value", - "AsyncValue", - "ValueWithRawResponse", - "AsyncValueWithRawResponse", - "ValueWithStreamingResponse", - "AsyncValueWithStreamingResponse", + "ValueResource", + "AsyncValueResource", + "ValueResourceWithRawResponse", + "AsyncValueResourceWithRawResponse", + "ValueResourceWithStreamingResponse", + "AsyncValueResourceWithStreamingResponse", "Tokens", "AsyncTokens", "TokensWithRawResponse", diff --git a/src/cloudflare/resources/user/tokens/tokens.py b/src/cloudflare/resources/user/tokens/tokens.py index 1f65139d420..9abba1acedf 100644 --- a/src/cloudflare/resources/user/tokens/tokens.py +++ b/src/cloudflare/resources/user/tokens/tokens.py @@ -9,12 +9,12 @@ import httpx from .value import ( - Value, - AsyncValue, - ValueWithRawResponse, - AsyncValueWithRawResponse, - ValueWithStreamingResponse, - AsyncValueWithStreamingResponse, + ValueResource, + AsyncValueResource, + ValueResourceWithRawResponse, + AsyncValueResourceWithRawResponse, + ValueResourceWithStreamingResponse, + AsyncValueResourceWithStreamingResponse, ) from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ...._utils import ( @@ -32,10 +32,10 @@ from ...._wrappers import ResultWrapper from ....pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray from ....types.user import ( + PolicyParam, TokenCreateResponse, TokenDeleteResponse, TokenVerifyResponse, - PolicyWithPermissionGroupsParam, token_list_params, token_create_params, token_delete_params, @@ -64,8 +64,8 @@ def permission_groups(self) -> PermissionGroups: return PermissionGroups(self._client) @cached_property - def value(self) -> Value: - return Value(self._client) + def value(self) -> ValueResource: + return ValueResource(self._client) @cached_property def with_raw_response(self) -> TokensWithRawResponse: @@ -79,7 +79,7 @@ def create( self, *, name: str, - policies: Iterable[PolicyWithPermissionGroupsParam], + policies: Iterable[PolicyParam], condition: token_create_params.Condition | NotGiven = NOT_GIVEN, expires_on: Union[str, datetime] | NotGiven = NOT_GIVEN, not_before: Union[str, datetime] | NotGiven = NOT_GIVEN, @@ -138,7 +138,7 @@ def update( token_id: object, *, name: str, - policies: Iterable[PolicyWithPermissionGroupsParam], + policies: Iterable[PolicyParam], status: Literal["active", "disabled", "expired"], condition: token_update_params.Condition | NotGiven = NOT_GIVEN, expires_on: Union[str, datetime] | NotGiven = NOT_GIVEN, @@ -359,8 +359,8 @@ def permission_groups(self) -> AsyncPermissionGroups: return AsyncPermissionGroups(self._client) @cached_property - def value(self) -> AsyncValue: - return AsyncValue(self._client) + def value(self) -> AsyncValueResource: + return AsyncValueResource(self._client) @cached_property def with_raw_response(self) -> AsyncTokensWithRawResponse: @@ -374,7 +374,7 @@ async def create( self, *, name: str, - policies: Iterable[PolicyWithPermissionGroupsParam], + policies: Iterable[PolicyParam], condition: token_create_params.Condition | NotGiven = NOT_GIVEN, expires_on: Union[str, datetime] | NotGiven = NOT_GIVEN, not_before: Union[str, datetime] | NotGiven = NOT_GIVEN, @@ -433,7 +433,7 @@ async def update( token_id: object, *, name: str, - policies: Iterable[PolicyWithPermissionGroupsParam], + policies: Iterable[PolicyParam], status: Literal["active", "disabled", "expired"], condition: token_update_params.Condition | NotGiven = NOT_GIVEN, expires_on: Union[str, datetime] | NotGiven = NOT_GIVEN, @@ -676,8 +676,8 @@ def permission_groups(self) -> PermissionGroupsWithRawResponse: return PermissionGroupsWithRawResponse(self._tokens.permission_groups) @cached_property - def value(self) -> ValueWithRawResponse: - return ValueWithRawResponse(self._tokens.value) + def value(self) -> ValueResourceWithRawResponse: + return ValueResourceWithRawResponse(self._tokens.value) class AsyncTokensWithRawResponse: @@ -708,8 +708,8 @@ def permission_groups(self) -> AsyncPermissionGroupsWithRawResponse: return AsyncPermissionGroupsWithRawResponse(self._tokens.permission_groups) @cached_property - def value(self) -> AsyncValueWithRawResponse: - return AsyncValueWithRawResponse(self._tokens.value) + def value(self) -> AsyncValueResourceWithRawResponse: + return AsyncValueResourceWithRawResponse(self._tokens.value) class TokensWithStreamingResponse: @@ -740,8 +740,8 @@ def permission_groups(self) -> PermissionGroupsWithStreamingResponse: return PermissionGroupsWithStreamingResponse(self._tokens.permission_groups) @cached_property - def value(self) -> ValueWithStreamingResponse: - return ValueWithStreamingResponse(self._tokens.value) + def value(self) -> ValueResourceWithStreamingResponse: + return ValueResourceWithStreamingResponse(self._tokens.value) class AsyncTokensWithStreamingResponse: @@ -772,5 +772,5 @@ def permission_groups(self) -> AsyncPermissionGroupsWithStreamingResponse: return AsyncPermissionGroupsWithStreamingResponse(self._tokens.permission_groups) @cached_property - def value(self) -> AsyncValueWithStreamingResponse: - return AsyncValueWithStreamingResponse(self._tokens.value) + def value(self) -> AsyncValueResourceWithStreamingResponse: + return AsyncValueResourceWithStreamingResponse(self._tokens.value) diff --git a/src/cloudflare/resources/user/tokens/value.py b/src/cloudflare/resources/user/tokens/value.py index fda2829c384..3710dc89ca6 100644 --- a/src/cloudflare/resources/user/tokens/value.py +++ b/src/cloudflare/resources/user/tokens/value.py @@ -25,17 +25,17 @@ ) from ....types.user.tokens import value_update_params -__all__ = ["Value", "AsyncValue"] +__all__ = ["ValueResource", "AsyncValueResource"] -class Value(SyncAPIResource): +class ValueResource(SyncAPIResource): @cached_property - def with_raw_response(self) -> ValueWithRawResponse: - return ValueWithRawResponse(self) + def with_raw_response(self) -> ValueResourceWithRawResponse: + return ValueResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> ValueWithStreamingResponse: - return ValueWithStreamingResponse(self) + def with_streaming_response(self) -> ValueResourceWithStreamingResponse: + return ValueResourceWithStreamingResponse(self) def update( self, @@ -75,14 +75,14 @@ def update( ) -class AsyncValue(AsyncAPIResource): +class AsyncValueResource(AsyncAPIResource): @cached_property - def with_raw_response(self) -> AsyncValueWithRawResponse: - return AsyncValueWithRawResponse(self) + def with_raw_response(self) -> AsyncValueResourceWithRawResponse: + return AsyncValueResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> AsyncValueWithStreamingResponse: - return AsyncValueWithStreamingResponse(self) + def with_streaming_response(self) -> AsyncValueResourceWithStreamingResponse: + return AsyncValueResourceWithStreamingResponse(self) async def update( self, @@ -122,8 +122,8 @@ async def update( ) -class ValueWithRawResponse: - def __init__(self, value: Value) -> None: +class ValueResourceWithRawResponse: + def __init__(self, value: ValueResource) -> None: self._value = value self.update = to_raw_response_wrapper( @@ -131,8 +131,8 @@ def __init__(self, value: Value) -> None: ) -class AsyncValueWithRawResponse: - def __init__(self, value: AsyncValue) -> None: +class AsyncValueResourceWithRawResponse: + def __init__(self, value: AsyncValueResource) -> None: self._value = value self.update = async_to_raw_response_wrapper( @@ -140,8 +140,8 @@ def __init__(self, value: AsyncValue) -> None: ) -class ValueWithStreamingResponse: - def __init__(self, value: Value) -> None: +class ValueResourceWithStreamingResponse: + def __init__(self, value: ValueResource) -> None: self._value = value self.update = to_streamed_response_wrapper( @@ -149,8 +149,8 @@ def __init__(self, value: Value) -> None: ) -class AsyncValueWithStreamingResponse: - def __init__(self, value: AsyncValue) -> None: +class AsyncValueResourceWithStreamingResponse: + def __init__(self, value: AsyncValueResource) -> None: self._value = value self.update = async_to_streamed_response_wrapper( diff --git a/src/cloudflare/resources/user/user.py b/src/cloudflare/resources/user/user.py index 22470bb96f9..3371adbe3c5 100644 --- a/src/cloudflare/resources/user/user.py +++ b/src/cloudflare/resources/user/user.py @@ -94,10 +94,10 @@ from .firewall.firewall import Firewall, AsyncFirewall from .load_balancers.load_balancers import LoadBalancers, AsyncLoadBalancers -__all__ = ["UserResource", "AsyncUserResource"] +__all__ = ["User", "AsyncUser"] -class UserResource(SyncAPIResource): +class User(SyncAPIResource): @cached_property def audit_logs(self) -> AuditLogs: return AuditLogs(self._client) @@ -131,12 +131,12 @@ def tokens(self) -> Tokens: return Tokens(self._client) @cached_property - def with_raw_response(self) -> UserResourceWithRawResponse: - return UserResourceWithRawResponse(self) + def with_raw_response(self) -> UserWithRawResponse: + return UserWithRawResponse(self) @cached_property - def with_streaming_response(self) -> UserResourceWithStreamingResponse: - return UserResourceWithStreamingResponse(self) + def with_streaming_response(self) -> UserWithStreamingResponse: + return UserWithStreamingResponse(self) def edit( self, @@ -231,7 +231,7 @@ def get( ) -class AsyncUserResource(AsyncAPIResource): +class AsyncUser(AsyncAPIResource): @cached_property def audit_logs(self) -> AsyncAuditLogs: return AsyncAuditLogs(self._client) @@ -265,12 +265,12 @@ def tokens(self) -> AsyncTokens: return AsyncTokens(self._client) @cached_property - def with_raw_response(self) -> AsyncUserResourceWithRawResponse: - return AsyncUserResourceWithRawResponse(self) + def with_raw_response(self) -> AsyncUserWithRawResponse: + return AsyncUserWithRawResponse(self) @cached_property - def with_streaming_response(self) -> AsyncUserResourceWithStreamingResponse: - return AsyncUserResourceWithStreamingResponse(self) + def with_streaming_response(self) -> AsyncUserWithStreamingResponse: + return AsyncUserWithStreamingResponse(self) async def edit( self, @@ -365,8 +365,8 @@ async def get( ) -class UserResourceWithRawResponse: - def __init__(self, user: UserResource) -> None: +class UserWithRawResponse: + def __init__(self, user: User) -> None: self._user = user self.edit = to_raw_response_wrapper( @@ -409,8 +409,8 @@ def tokens(self) -> TokensWithRawResponse: return TokensWithRawResponse(self._user.tokens) -class AsyncUserResourceWithRawResponse: - def __init__(self, user: AsyncUserResource) -> None: +class AsyncUserWithRawResponse: + def __init__(self, user: AsyncUser) -> None: self._user = user self.edit = async_to_raw_response_wrapper( @@ -453,8 +453,8 @@ def tokens(self) -> AsyncTokensWithRawResponse: return AsyncTokensWithRawResponse(self._user.tokens) -class UserResourceWithStreamingResponse: - def __init__(self, user: UserResource) -> None: +class UserWithStreamingResponse: + def __init__(self, user: User) -> None: self._user = user self.edit = to_streamed_response_wrapper( @@ -497,8 +497,8 @@ def tokens(self) -> TokensWithStreamingResponse: return TokensWithStreamingResponse(self._user.tokens) -class AsyncUserResourceWithStreamingResponse: - def __init__(self, user: AsyncUserResource) -> None: +class AsyncUserWithStreamingResponse: + def __init__(self, user: AsyncUser) -> None: self._user = user self.edit = async_to_streamed_response_wrapper( diff --git a/src/cloudflare/resources/waiting_rooms/events/events.py b/src/cloudflare/resources/waiting_rooms/events/events.py index 28a144b780c..b752e03190e 100644 --- a/src/cloudflare/resources/waiting_rooms/events/events.py +++ b/src/cloudflare/resources/waiting_rooms/events/events.py @@ -34,8 +34,12 @@ make_request_options, ) from ....types.waiting_rooms import ( - Event, + EventGetResponse, + EventEditResponse, + EventListResponse, + EventCreateResponse, EventDeleteResponse, + EventUpdateResponse, event_edit_params, event_create_params, event_delete_params, @@ -82,7 +86,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Event: + ) -> EventCreateResponse: """Only available for the Waiting Room Advanced subscription. Creates an event for @@ -179,7 +183,7 @@ def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Event], ResultWrapper[Event]), + cast_to=cast(Type[EventCreateResponse], ResultWrapper[EventCreateResponse]), ) def update( @@ -207,7 +211,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Event: + ) -> EventUpdateResponse: """ Updates a configured event for a waiting room. @@ -300,7 +304,7 @@ def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Event], ResultWrapper[Event]), + cast_to=cast(Type[EventUpdateResponse], ResultWrapper[EventUpdateResponse]), ) def list( @@ -314,7 +318,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[Event]: + ) -> SyncSinglePage[EventListResponse]: """ Lists events for a waiting room. @@ -335,11 +339,11 @@ def list( raise ValueError(f"Expected a non-empty value for `waiting_room_id` but received {waiting_room_id!r}") return self._get_api_list( f"/zones/{zone_id}/waiting_rooms/{waiting_room_id}/events", - page=SyncSinglePage[Event], + page=SyncSinglePage[EventListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=Event, + model=EventListResponse, ) def delete( @@ -414,7 +418,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Event: + ) -> EventEditResponse: """ Patches a configured event for a waiting room. @@ -507,7 +511,7 @@ def edit( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Event], ResultWrapper[Event]), + cast_to=cast(Type[EventEditResponse], ResultWrapper[EventEditResponse]), ) def get( @@ -522,7 +526,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Event: + ) -> EventGetResponse: """ Fetches a single configured event for a waiting room. @@ -552,7 +556,7 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Event], ResultWrapper[Event]), + cast_to=cast(Type[EventGetResponse], ResultWrapper[EventGetResponse]), ) @@ -593,7 +597,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Event: + ) -> EventCreateResponse: """Only available for the Waiting Room Advanced subscription. Creates an event for @@ -690,7 +694,7 @@ async def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Event], ResultWrapper[Event]), + cast_to=cast(Type[EventCreateResponse], ResultWrapper[EventCreateResponse]), ) async def update( @@ -718,7 +722,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Event: + ) -> EventUpdateResponse: """ Updates a configured event for a waiting room. @@ -811,7 +815,7 @@ async def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Event], ResultWrapper[Event]), + cast_to=cast(Type[EventUpdateResponse], ResultWrapper[EventUpdateResponse]), ) def list( @@ -825,7 +829,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[Event, AsyncSinglePage[Event]]: + ) -> AsyncPaginator[EventListResponse, AsyncSinglePage[EventListResponse]]: """ Lists events for a waiting room. @@ -846,11 +850,11 @@ def list( raise ValueError(f"Expected a non-empty value for `waiting_room_id` but received {waiting_room_id!r}") return self._get_api_list( f"/zones/{zone_id}/waiting_rooms/{waiting_room_id}/events", - page=AsyncSinglePage[Event], + page=AsyncSinglePage[EventListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=Event, + model=EventListResponse, ) async def delete( @@ -925,7 +929,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Event: + ) -> EventEditResponse: """ Patches a configured event for a waiting room. @@ -1018,7 +1022,7 @@ async def edit( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Event], ResultWrapper[Event]), + cast_to=cast(Type[EventEditResponse], ResultWrapper[EventEditResponse]), ) async def get( @@ -1033,7 +1037,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Event: + ) -> EventGetResponse: """ Fetches a single configured event for a waiting room. @@ -1063,7 +1067,7 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Event], ResultWrapper[Event]), + cast_to=cast(Type[EventGetResponse], ResultWrapper[EventGetResponse]), ) diff --git a/src/cloudflare/resources/waiting_rooms/rules.py b/src/cloudflare/resources/waiting_rooms/rules.py index e63cfbb0a7b..65b1862a722 100644 --- a/src/cloudflare/resources/waiting_rooms/rules.py +++ b/src/cloudflare/resources/waiting_rooms/rules.py @@ -27,9 +27,9 @@ make_request_options, ) from ...types.waiting_rooms import ( + Event, RuleParam, RuleEditResponse, - RuleListResponse, RuleCreateResponse, RuleDeleteResponse, RuleUpdateResponse, @@ -173,7 +173,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[RuleListResponse]: + ) -> SyncSinglePage[Event]: """ Lists rules for a waiting room. @@ -194,11 +194,11 @@ def list( raise ValueError(f"Expected a non-empty value for `waiting_room_id` but received {waiting_room_id!r}") return self._get_api_list( f"/zones/{zone_id}/waiting_rooms/{waiting_room_id}/rules", - page=SyncSinglePage[RuleListResponse], + page=SyncSinglePage[Event], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=RuleListResponse, + model=Event, ) def delete( @@ -454,7 +454,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[RuleListResponse, AsyncSinglePage[RuleListResponse]]: + ) -> AsyncPaginator[Event, AsyncSinglePage[Event]]: """ Lists rules for a waiting room. @@ -475,11 +475,11 @@ def list( raise ValueError(f"Expected a non-empty value for `waiting_room_id` but received {waiting_room_id!r}") return self._get_api_list( f"/zones/{zone_id}/waiting_rooms/{waiting_room_id}/rules", - page=AsyncSinglePage[RuleListResponse], + page=AsyncSinglePage[Event], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=RuleListResponse, + model=Event, ) async def delete( diff --git a/src/cloudflare/resources/web3/hostnames/hostnames.py b/src/cloudflare/resources/web3/hostnames/hostnames.py index 5480f26d02b..166cdb07982 100644 --- a/src/cloudflare/resources/web3/hostnames/hostnames.py +++ b/src/cloudflare/resources/web3/hostnames/hostnames.py @@ -23,7 +23,7 @@ from ...._wrappers import ResultWrapper from ....pagination import SyncSinglePage, AsyncSinglePage from ....types.web3 import ( - DistributedWebHostname, + Hostname, HostnameDeleteResponse, hostname_edit_params, hostname_create_params, @@ -72,7 +72,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DistributedWebHostname: + ) -> Hostname: """ Create Web3 Hostname @@ -112,7 +112,7 @@ def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[DistributedWebHostname], ResultWrapper[DistributedWebHostname]), + cast_to=cast(Type[Hostname], ResultWrapper[Hostname]), ) def list( @@ -125,7 +125,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[DistributedWebHostname]: + ) -> SyncSinglePage[Hostname]: """ List Web3 Hostnames @@ -144,11 +144,11 @@ def list( raise ValueError(f"Expected a non-empty value for `zone_identifier` but received {zone_identifier!r}") return self._get_api_list( f"/zones/{zone_identifier}/web3/hostnames", - page=SyncSinglePage[DistributedWebHostname], + page=SyncSinglePage[Hostname], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=DistributedWebHostname, + model=Hostname, ) def delete( @@ -210,7 +210,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DistributedWebHostname: + ) -> Hostname: """ Edit Web3 Hostname @@ -251,7 +251,7 @@ def edit( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[DistributedWebHostname], ResultWrapper[DistributedWebHostname]), + cast_to=cast(Type[Hostname], ResultWrapper[Hostname]), ) def get( @@ -265,7 +265,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DistributedWebHostname: + ) -> Hostname: """ Web3 Hostname Details @@ -295,7 +295,7 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[DistributedWebHostname], ResultWrapper[DistributedWebHostname]), + cast_to=cast(Type[Hostname], ResultWrapper[Hostname]), ) @@ -325,7 +325,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DistributedWebHostname: + ) -> Hostname: """ Create Web3 Hostname @@ -365,7 +365,7 @@ async def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[DistributedWebHostname], ResultWrapper[DistributedWebHostname]), + cast_to=cast(Type[Hostname], ResultWrapper[Hostname]), ) def list( @@ -378,7 +378,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[DistributedWebHostname, AsyncSinglePage[DistributedWebHostname]]: + ) -> AsyncPaginator[Hostname, AsyncSinglePage[Hostname]]: """ List Web3 Hostnames @@ -397,11 +397,11 @@ def list( raise ValueError(f"Expected a non-empty value for `zone_identifier` but received {zone_identifier!r}") return self._get_api_list( f"/zones/{zone_identifier}/web3/hostnames", - page=AsyncSinglePage[DistributedWebHostname], + page=AsyncSinglePage[Hostname], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=DistributedWebHostname, + model=Hostname, ) async def delete( @@ -463,7 +463,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DistributedWebHostname: + ) -> Hostname: """ Edit Web3 Hostname @@ -504,7 +504,7 @@ async def edit( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[DistributedWebHostname], ResultWrapper[DistributedWebHostname]), + cast_to=cast(Type[Hostname], ResultWrapper[Hostname]), ) async def get( @@ -518,7 +518,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DistributedWebHostname: + ) -> Hostname: """ Web3 Hostname Details @@ -548,7 +548,7 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[DistributedWebHostname], ResultWrapper[DistributedWebHostname]), + cast_to=cast(Type[Hostname], ResultWrapper[Hostname]), ) 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 c3119b5683d..8215d3b8b4a 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 @@ -32,8 +32,8 @@ from ......_base_client import ( make_request_options, ) -from ......types.web3.hostnames.ipfs_universal_paths import DistributedWebConfigContentList, content_list_update_params -from ......types.web3.hostnames.ipfs_universal_paths.content_lists import DistributedWebConfigContentListEntryParam +from ......types.web3.hostnames.ipfs_universal_paths import ContentList, content_list_update_params +from ......types.web3.hostnames.ipfs_universal_paths.content_lists import ContentListItemParam __all__ = ["ContentLists", "AsyncContentLists"] @@ -57,14 +57,14 @@ def update( *, zone_identifier: str, action: Literal["block"], - entries: Iterable[DistributedWebConfigContentListEntryParam], + entries: Iterable[ContentListItemParam], # 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, - ) -> DistributedWebConfigContentList: + ) -> ContentList: """ Update IPFS Universal Path Gateway Content List @@ -105,7 +105,7 @@ def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[DistributedWebConfigContentList], ResultWrapper[DistributedWebConfigContentList]), + cast_to=cast(Type[ContentList], ResultWrapper[ContentList]), ) def get( @@ -119,7 +119,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DistributedWebConfigContentList: + ) -> ContentList: """ IPFS Universal Path Gateway Content List Details @@ -149,7 +149,7 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[DistributedWebConfigContentList], ResultWrapper[DistributedWebConfigContentList]), + cast_to=cast(Type[ContentList], ResultWrapper[ContentList]), ) @@ -172,14 +172,14 @@ async def update( *, zone_identifier: str, action: Literal["block"], - entries: Iterable[DistributedWebConfigContentListEntryParam], + entries: Iterable[ContentListItemParam], # 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, - ) -> DistributedWebConfigContentList: + ) -> ContentList: """ Update IPFS Universal Path Gateway Content List @@ -220,7 +220,7 @@ async def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[DistributedWebConfigContentList], ResultWrapper[DistributedWebConfigContentList]), + cast_to=cast(Type[ContentList], ResultWrapper[ContentList]), ) async def get( @@ -234,7 +234,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DistributedWebConfigContentList: + ) -> ContentList: """ IPFS Universal Path Gateway Content List Details @@ -264,7 +264,7 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[DistributedWebConfigContentList], ResultWrapper[DistributedWebConfigContentList]), + cast_to=cast(Type[ContentList], ResultWrapper[ContentList]), ) diff --git a/src/cloudflare/resources/web3/hostnames/ipfs_universal_paths/content_lists/entries.py b/src/cloudflare/resources/web3/hostnames/ipfs_universal_paths/content_lists/entries.py index 2dc1eb68012..1e2dbcf3a67 100644 --- a/src/cloudflare/resources/web3/hostnames/ipfs_universal_paths/content_lists/entries.py +++ b/src/cloudflare/resources/web3/hostnames/ipfs_universal_paths/content_lists/entries.py @@ -25,9 +25,9 @@ make_request_options, ) from ......types.web3.hostnames.ipfs_universal_paths.content_lists import ( + ContentListItem, EntryListResponse, EntryDeleteResponse, - DistributedWebConfigContentListEntry, entry_create_params, entry_delete_params, entry_update_params, @@ -59,7 +59,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DistributedWebConfigContentListEntry: + ) -> ContentListItem: """ Create IPFS Universal Path Gateway Content List Entry @@ -103,9 +103,7 @@ def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast( - Type[DistributedWebConfigContentListEntry], ResultWrapper[DistributedWebConfigContentListEntry] - ), + cast_to=cast(Type[ContentListItem], ResultWrapper[ContentListItem]), ) def update( @@ -123,7 +121,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DistributedWebConfigContentListEntry: + ) -> ContentListItem: """ Edit IPFS Universal Path Gateway Content List Entry @@ -173,9 +171,7 @@ def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast( - Type[DistributedWebConfigContentListEntry], ResultWrapper[DistributedWebConfigContentListEntry] - ), + cast_to=cast(Type[ContentListItem], ResultWrapper[ContentListItem]), ) def list( @@ -287,7 +283,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DistributedWebConfigContentListEntry: + ) -> ContentListItem: """ IPFS Universal Path Gateway Content List Entry Details @@ -323,9 +319,7 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast( - Type[DistributedWebConfigContentListEntry], ResultWrapper[DistributedWebConfigContentListEntry] - ), + cast_to=cast(Type[ContentListItem], ResultWrapper[ContentListItem]), ) @@ -352,7 +346,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DistributedWebConfigContentListEntry: + ) -> ContentListItem: """ Create IPFS Universal Path Gateway Content List Entry @@ -396,9 +390,7 @@ async def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast( - Type[DistributedWebConfigContentListEntry], ResultWrapper[DistributedWebConfigContentListEntry] - ), + cast_to=cast(Type[ContentListItem], ResultWrapper[ContentListItem]), ) async def update( @@ -416,7 +408,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DistributedWebConfigContentListEntry: + ) -> ContentListItem: """ Edit IPFS Universal Path Gateway Content List Entry @@ -466,9 +458,7 @@ async def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast( - Type[DistributedWebConfigContentListEntry], ResultWrapper[DistributedWebConfigContentListEntry] - ), + cast_to=cast(Type[ContentListItem], ResultWrapper[ContentListItem]), ) async def list( @@ -580,7 +570,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DistributedWebConfigContentListEntry: + ) -> ContentListItem: """ IPFS Universal Path Gateway Content List Entry Details @@ -616,9 +606,7 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast( - Type[DistributedWebConfigContentListEntry], ResultWrapper[DistributedWebConfigContentListEntry] - ), + cast_to=cast(Type[ContentListItem], ResultWrapper[ContentListItem]), ) diff --git a/src/cloudflare/resources/workers/domains.py b/src/cloudflare/resources/workers/domains.py index 46bb06e1977..e0857f41572 100644 --- a/src/cloudflare/resources/workers/domains.py +++ b/src/cloudflare/resources/workers/domains.py @@ -25,7 +25,7 @@ AsyncPaginator, make_request_options, ) -from ...types.workers import WorkersDomain, domain_list_params, domain_delete_params, domain_update_params +from ...types.workers import Domain, domain_list_params, domain_delete_params, domain_update_params __all__ = ["Domains", "AsyncDomains"] @@ -53,7 +53,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> WorkersDomain: + ) -> Domain: """ Attaches a Worker to a zone and hostname. @@ -94,7 +94,7 @@ def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[WorkersDomain], ResultWrapper[WorkersDomain]), + cast_to=cast(Type[Domain], ResultWrapper[Domain]), ) def list( @@ -112,7 +112,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[WorkersDomain]: + ) -> SyncSinglePage[Domain]: """ Lists all Worker Domains for an account. @@ -139,7 +139,7 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/workers/domains", - page=SyncSinglePage[WorkersDomain], + page=SyncSinglePage[Domain], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -156,7 +156,7 @@ def list( domain_list_params.DomainListParams, ), ), - model=WorkersDomain, + model=Domain, ) def delete( @@ -211,7 +211,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> WorkersDomain: + ) -> Domain: """ Gets a Worker domain. @@ -239,7 +239,7 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[WorkersDomain], ResultWrapper[WorkersDomain]), + cast_to=cast(Type[Domain], ResultWrapper[Domain]), ) @@ -266,7 +266,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> WorkersDomain: + ) -> Domain: """ Attaches a Worker to a zone and hostname. @@ -307,7 +307,7 @@ async def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[WorkersDomain], ResultWrapper[WorkersDomain]), + cast_to=cast(Type[Domain], ResultWrapper[Domain]), ) def list( @@ -325,7 +325,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[WorkersDomain, AsyncSinglePage[WorkersDomain]]: + ) -> AsyncPaginator[Domain, AsyncSinglePage[Domain]]: """ Lists all Worker Domains for an account. @@ -352,7 +352,7 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/workers/domains", - page=AsyncSinglePage[WorkersDomain], + page=AsyncSinglePage[Domain], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -369,7 +369,7 @@ def list( domain_list_params.DomainListParams, ), ), - model=WorkersDomain, + model=Domain, ) async def delete( @@ -424,7 +424,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> WorkersDomain: + ) -> Domain: """ Gets a Worker domain. @@ -452,7 +452,7 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[WorkersDomain], ResultWrapper[WorkersDomain]), + cast_to=cast(Type[Domain], ResultWrapper[Domain]), ) diff --git a/src/cloudflare/resources/workers/scripts/settings.py b/src/cloudflare/resources/workers/scripts/settings.py index 60858c133a9..0649f917b3d 100644 --- a/src/cloudflare/resources/workers/scripts/settings.py +++ b/src/cloudflare/resources/workers/scripts/settings.py @@ -23,8 +23,8 @@ from ...._base_client import ( make_request_options, ) -from ....types.workers import SettingsItem -from ....types.workers.scripts import ConsumerScriptParam, setting_edit_params +from ....types.workers import ScriptSetting +from ....types.workers.scripts import ConsumerScriptItemParam, setting_edit_params __all__ = ["Settings", "AsyncSettings"] @@ -44,14 +44,14 @@ def edit( *, account_id: str, logpush: bool | NotGiven = NOT_GIVEN, - tail_consumers: Iterable[ConsumerScriptParam] | NotGiven = NOT_GIVEN, + tail_consumers: Iterable[ConsumerScriptItemParam] | 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, - ) -> SettingsItem: + ) -> ScriptSetting: """ Patch script-level settings when using [Worker Versions](https://developers.cloudflare.com/api/operations/worker-versions-list-versions). @@ -94,7 +94,7 @@ def edit( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[SettingsItem], ResultWrapper[SettingsItem]), + cast_to=cast(Type[ScriptSetting], ResultWrapper[ScriptSetting]), ) def get( @@ -108,7 +108,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SettingsItem: + ) -> ScriptSetting: """ Get script-level settings when using [Worker Versions](https://developers.cloudflare.com/api/operations/worker-versions-list-versions). @@ -140,7 +140,7 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[SettingsItem], ResultWrapper[SettingsItem]), + cast_to=cast(Type[ScriptSetting], ResultWrapper[ScriptSetting]), ) @@ -159,14 +159,14 @@ async def edit( *, account_id: str, logpush: bool | NotGiven = NOT_GIVEN, - tail_consumers: Iterable[ConsumerScriptParam] | NotGiven = NOT_GIVEN, + tail_consumers: Iterable[ConsumerScriptItemParam] | 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, - ) -> SettingsItem: + ) -> ScriptSetting: """ Patch script-level settings when using [Worker Versions](https://developers.cloudflare.com/api/operations/worker-versions-list-versions). @@ -209,7 +209,7 @@ async def edit( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[SettingsItem], ResultWrapper[SettingsItem]), + cast_to=cast(Type[ScriptSetting], ResultWrapper[ScriptSetting]), ) async def get( @@ -223,7 +223,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SettingsItem: + ) -> ScriptSetting: """ Get script-level settings when using [Worker Versions](https://developers.cloudflare.com/api/operations/worker-versions-list-versions). @@ -255,7 +255,7 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[SettingsItem], ResultWrapper[SettingsItem]), + cast_to=cast(Type[ScriptSetting], ResultWrapper[ScriptSetting]), ) diff --git a/src/cloudflare/resources/workers/scripts/versions/settings.py b/src/cloudflare/resources/workers/scripts/versions/settings.py index 41b2bcd46ce..0e6b518fad1 100644 --- a/src/cloudflare/resources/workers/scripts/versions/settings.py +++ b/src/cloudflare/resources/workers/scripts/versions/settings.py @@ -23,7 +23,7 @@ from ....._base_client import ( make_request_options, ) -from .....types.workers.scripts.versions import SettingsItem, SettingsItemParam, setting_edit_params +from .....types.workers.scripts.versions import Settings, SettingsParam, settings, setting_edit_params __all__ = ["Settings", "AsyncSettings"] @@ -42,14 +42,14 @@ def edit( script_name: str, *, account_id: str, - settings: SettingsItemParam | NotGiven = NOT_GIVEN, + settings: SettingsParam | 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, - ) -> SettingsItem: + ) -> settings.Settings: """ Patch metadata or config, such as bindings or usage model @@ -80,7 +80,7 @@ def edit( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[SettingsItem], ResultWrapper[SettingsItem]), + cast_to=cast(Type[settings.Settings], ResultWrapper[settings.Settings]), ) def get( @@ -94,7 +94,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SettingsItem: + ) -> settings.Settings: """ Get metadata and config, such as bindings or usage model @@ -124,7 +124,7 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[SettingsItem], ResultWrapper[SettingsItem]), + cast_to=cast(Type[settings.Settings], ResultWrapper[settings.Settings]), ) @@ -142,14 +142,14 @@ async def edit( script_name: str, *, account_id: str, - settings: SettingsItemParam | NotGiven = NOT_GIVEN, + settings: SettingsParam | 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, - ) -> SettingsItem: + ) -> settings.Settings: """ Patch metadata or config, such as bindings or usage model @@ -180,7 +180,7 @@ async def edit( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[SettingsItem], ResultWrapper[SettingsItem]), + cast_to=cast(Type[settings.Settings], ResultWrapper[settings.Settings]), ) async def get( @@ -194,7 +194,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SettingsItem: + ) -> settings.Settings: """ Get metadata and config, such as bindings or usage model @@ -224,7 +224,7 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[SettingsItem], ResultWrapper[SettingsItem]), + cast_to=cast(Type[settings.Settings], ResultWrapper[settings.Settings]), ) diff --git a/src/cloudflare/resources/workers/services/environments/settings.py b/src/cloudflare/resources/workers/services/environments/settings.py index b529f86c4f0..23fb4591624 100644 --- a/src/cloudflare/resources/workers/services/environments/settings.py +++ b/src/cloudflare/resources/workers/services/environments/settings.py @@ -25,7 +25,7 @@ from ....._base_client import ( make_request_options, ) -from .....types.workers import SettingsItem, SettingsItemParam +from .....types.workers import ScriptSetting, ScriptSettingParam from .....types.workers.services.environments import setting_edit_params __all__ = ["Settings", "AsyncSettings"] @@ -48,7 +48,7 @@ def edit( service_name: str, errors: Iterable[shared_params.UnnamedSchemaRef3248f24329456e19dfa042fff9986f72], messages: Iterable[shared_params.UnnamedSchemaRef3248f24329456e19dfa042fff9986f72], - result: SettingsItemParam, + result: ScriptSettingParam, success: Literal[True], # 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. @@ -56,7 +56,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SettingsItem: + ) -> ScriptSetting: """ Patch script metadata, such as bindings @@ -101,7 +101,7 @@ def edit( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[SettingsItem], ResultWrapper[SettingsItem]), + cast_to=cast(Type[ScriptSetting], ResultWrapper[ScriptSetting]), ) def get( @@ -116,7 +116,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SettingsItem: + ) -> ScriptSetting: """ Get script settings from a worker with an environment @@ -150,7 +150,7 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[SettingsItem], ResultWrapper[SettingsItem]), + cast_to=cast(Type[ScriptSetting], ResultWrapper[ScriptSetting]), ) @@ -171,7 +171,7 @@ async def edit( service_name: str, errors: Iterable[shared_params.UnnamedSchemaRef3248f24329456e19dfa042fff9986f72], messages: Iterable[shared_params.UnnamedSchemaRef3248f24329456e19dfa042fff9986f72], - result: SettingsItemParam, + result: ScriptSettingParam, success: Literal[True], # 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. @@ -179,7 +179,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SettingsItem: + ) -> ScriptSetting: """ Patch script metadata, such as bindings @@ -224,7 +224,7 @@ async def edit( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[SettingsItem], ResultWrapper[SettingsItem]), + cast_to=cast(Type[ScriptSetting], ResultWrapper[ScriptSetting]), ) async def get( @@ -239,7 +239,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SettingsItem: + ) -> ScriptSetting: """ Get script settings from a worker with an environment @@ -273,7 +273,7 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[SettingsItem], ResultWrapper[SettingsItem]), + cast_to=cast(Type[ScriptSetting], ResultWrapper[ScriptSetting]), ) diff --git a/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/scripts.py b/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/scripts.py index b2155fc68fe..5091e6f18dc 100644 --- a/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/scripts.py +++ b/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/scripts.py @@ -49,11 +49,7 @@ make_request_options, ) from ......types.workers import Script -from ......types.workers_for_platforms.dispatch.namespaces import ( - WorkersForPlatformsNamespaceScript, - script_delete_params, - script_update_params, -) +from ......types.workers_for_platforms.dispatch.namespaces import Script, script_delete_params, script_update_params __all__ = ["Scripts", "AsyncScripts"] @@ -273,7 +269,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> WorkersForPlatformsNamespaceScript: + ) -> Script: """ Fetch information about a script uploaded to a Workers for Platforms namespace. @@ -307,7 +303,7 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[WorkersForPlatformsNamespaceScript], ResultWrapper[WorkersForPlatformsNamespaceScript]), + cast_to=cast(Type[Script], ResultWrapper[Script]), ) @@ -526,7 +522,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> WorkersForPlatformsNamespaceScript: + ) -> Script: """ Fetch information about a script uploaded to a Workers for Platforms namespace. @@ -560,7 +556,7 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[WorkersForPlatformsNamespaceScript], ResultWrapper[WorkersForPlatformsNamespaceScript]), + cast_to=cast(Type[Script], ResultWrapper[Script]), ) diff --git a/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/settings.py b/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/settings.py index 9fa6a59d8c0..ad3c6fc6905 100644 --- a/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/settings.py +++ b/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/settings.py @@ -25,7 +25,7 @@ from ......_base_client import ( make_request_options, ) -from ......types.workers import SettingsItem, SettingsItemParam +from ......types.workers import ScriptSetting, ScriptSettingParam from ......types.workers_for_platforms.dispatch.namespaces.scripts import setting_edit_params __all__ = ["Settings", "AsyncSettings"] @@ -48,7 +48,7 @@ def edit( dispatch_namespace: str, errors: Iterable[shared_params.UnnamedSchemaRef3248f24329456e19dfa042fff9986f72], messages: Iterable[shared_params.UnnamedSchemaRef3248f24329456e19dfa042fff9986f72], - result: SettingsItemParam, + result: ScriptSettingParam, success: Literal[True], # 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. @@ -56,7 +56,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SettingsItem: + ) -> ScriptSetting: """ Patch script metadata, such as bindings @@ -101,7 +101,7 @@ def edit( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[SettingsItem], ResultWrapper[SettingsItem]), + cast_to=cast(Type[ScriptSetting], ResultWrapper[ScriptSetting]), ) def get( @@ -116,7 +116,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SettingsItem: + ) -> ScriptSetting: """ Get script settings from a script uploaded to a Workers for Platforms namespace. @@ -150,7 +150,7 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[SettingsItem], ResultWrapper[SettingsItem]), + cast_to=cast(Type[ScriptSetting], ResultWrapper[ScriptSetting]), ) @@ -171,7 +171,7 @@ async def edit( dispatch_namespace: str, errors: Iterable[shared_params.UnnamedSchemaRef3248f24329456e19dfa042fff9986f72], messages: Iterable[shared_params.UnnamedSchemaRef3248f24329456e19dfa042fff9986f72], - result: SettingsItemParam, + result: ScriptSettingParam, success: Literal[True], # 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. @@ -179,7 +179,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SettingsItem: + ) -> ScriptSetting: """ Patch script metadata, such as bindings @@ -224,7 +224,7 @@ async def edit( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[SettingsItem], ResultWrapper[SettingsItem]), + cast_to=cast(Type[ScriptSetting], ResultWrapper[ScriptSetting]), ) async def get( @@ -239,7 +239,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SettingsItem: + ) -> ScriptSetting: """ Get script settings from a script uploaded to a Workers for Platforms namespace. @@ -273,7 +273,7 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[SettingsItem], ResultWrapper[SettingsItem]), + cast_to=cast(Type[ScriptSetting], ResultWrapper[ScriptSetting]), ) diff --git a/src/cloudflare/resources/zero_trust/access/applications/cas.py b/src/cloudflare/resources/zero_trust/access/applications/cas.py index dbbb5b1d8f5..66e0d503764 100644 --- a/src/cloudflare/resources/zero_trust/access/applications/cas.py +++ b/src/cloudflare/resources/zero_trust/access/applications/cas.py @@ -22,7 +22,7 @@ make_request_options, ) from .....types.shared import UnnamedSchemaRef9444735ca60712dbcf8afd832eb5716a -from .....types.zero_trust.access.applications import ZeroTrustCA, CADeleteResponse +from .....types.zero_trust.access.applications import CA, CADeleteResponse __all__ = ["CAs", "AsyncCAs"] @@ -112,7 +112,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[ZeroTrustCA]: + ) -> SyncSinglePage[CA]: """ Lists short-lived certificate CAs and their public keys. @@ -146,11 +146,11 @@ def list( account_or_zone_id = zone_id return self._get_api_list( f"/{account_or_zone}/{account_or_zone_id}/access/apps/ca", - page=SyncSinglePage[ZeroTrustCA], + page=SyncSinglePage[CA], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=ZeroTrustCA, + model=CA, ) def delete( @@ -364,7 +364,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[ZeroTrustCA, AsyncSinglePage[ZeroTrustCA]]: + ) -> AsyncPaginator[CA, AsyncSinglePage[CA]]: """ Lists short-lived certificate CAs and their public keys. @@ -398,11 +398,11 @@ def list( account_or_zone_id = zone_id return self._get_api_list( f"/{account_or_zone}/{account_or_zone_id}/access/apps/ca", - page=AsyncSinglePage[ZeroTrustCA], + page=AsyncSinglePage[CA], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=ZeroTrustCA, + model=CA, ) async def delete( diff --git a/src/cloudflare/resources/zero_trust/access/applications/policies.py b/src/cloudflare/resources/zero_trust/access/applications/policies.py index 16210b1a4ef..667bff5b526 100644 --- a/src/cloudflare/resources/zero_trust/access/applications/policies.py +++ b/src/cloudflare/resources/zero_trust/access/applications/policies.py @@ -26,11 +26,11 @@ AsyncPaginator, make_request_options, ) -from .....types.zero_trust import ExcludeItemParam, IncludeItemParam, RequireItemParam +from .....types.zero_trust import AccessRuleParam from .....types.zero_trust.access.applications import ( Policy, + ApprovalGroupParam, PolicyDeleteResponse, - ApprovalGroupItemParam, policy_create_params, policy_update_params, ) @@ -52,18 +52,18 @@ def create( uuid: str, *, decision: Literal["allow", "deny", "non_identity", "bypass"], - include: Iterable[IncludeItemParam], + include: Iterable[AccessRuleParam], name: str, account_id: str | NotGiven = NOT_GIVEN, zone_id: str | NotGiven = NOT_GIVEN, - approval_groups: Iterable[ApprovalGroupItemParam] | NotGiven = NOT_GIVEN, + approval_groups: Iterable[ApprovalGroupParam] | NotGiven = NOT_GIVEN, approval_required: bool | NotGiven = NOT_GIVEN, - exclude: Iterable[ExcludeItemParam] | NotGiven = NOT_GIVEN, + exclude: Iterable[AccessRuleParam] | NotGiven = NOT_GIVEN, isolation_required: bool | NotGiven = NOT_GIVEN, precedence: int | NotGiven = NOT_GIVEN, purpose_justification_prompt: str | NotGiven = NOT_GIVEN, purpose_justification_required: bool | NotGiven = NOT_GIVEN, - require: Iterable[RequireItemParam] | NotGiven = NOT_GIVEN, + require: Iterable[AccessRuleParam] | NotGiven = NOT_GIVEN, session_duration: 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. @@ -174,18 +174,18 @@ def update( *, uuid1: str, decision: Literal["allow", "deny", "non_identity", "bypass"], - include: Iterable[IncludeItemParam], + include: Iterable[AccessRuleParam], name: str, account_id: str | NotGiven = NOT_GIVEN, zone_id: str | NotGiven = NOT_GIVEN, - approval_groups: Iterable[ApprovalGroupItemParam] | NotGiven = NOT_GIVEN, + approval_groups: Iterable[ApprovalGroupParam] | NotGiven = NOT_GIVEN, approval_required: bool | NotGiven = NOT_GIVEN, - exclude: Iterable[ExcludeItemParam] | NotGiven = NOT_GIVEN, + exclude: Iterable[AccessRuleParam] | NotGiven = NOT_GIVEN, isolation_required: bool | NotGiven = NOT_GIVEN, precedence: int | NotGiven = NOT_GIVEN, purpose_justification_prompt: str | NotGiven = NOT_GIVEN, purpose_justification_required: bool | NotGiven = NOT_GIVEN, - require: Iterable[RequireItemParam] | NotGiven = NOT_GIVEN, + require: Iterable[AccessRuleParam] | NotGiven = NOT_GIVEN, session_duration: 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. @@ -496,18 +496,18 @@ async def create( uuid: str, *, decision: Literal["allow", "deny", "non_identity", "bypass"], - include: Iterable[IncludeItemParam], + include: Iterable[AccessRuleParam], name: str, account_id: str | NotGiven = NOT_GIVEN, zone_id: str | NotGiven = NOT_GIVEN, - approval_groups: Iterable[ApprovalGroupItemParam] | NotGiven = NOT_GIVEN, + approval_groups: Iterable[ApprovalGroupParam] | NotGiven = NOT_GIVEN, approval_required: bool | NotGiven = NOT_GIVEN, - exclude: Iterable[ExcludeItemParam] | NotGiven = NOT_GIVEN, + exclude: Iterable[AccessRuleParam] | NotGiven = NOT_GIVEN, isolation_required: bool | NotGiven = NOT_GIVEN, precedence: int | NotGiven = NOT_GIVEN, purpose_justification_prompt: str | NotGiven = NOT_GIVEN, purpose_justification_required: bool | NotGiven = NOT_GIVEN, - require: Iterable[RequireItemParam] | NotGiven = NOT_GIVEN, + require: Iterable[AccessRuleParam] | NotGiven = NOT_GIVEN, session_duration: 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. @@ -618,18 +618,18 @@ async def update( *, uuid1: str, decision: Literal["allow", "deny", "non_identity", "bypass"], - include: Iterable[IncludeItemParam], + include: Iterable[AccessRuleParam], name: str, account_id: str | NotGiven = NOT_GIVEN, zone_id: str | NotGiven = NOT_GIVEN, - approval_groups: Iterable[ApprovalGroupItemParam] | NotGiven = NOT_GIVEN, + approval_groups: Iterable[ApprovalGroupParam] | NotGiven = NOT_GIVEN, approval_required: bool | NotGiven = NOT_GIVEN, - exclude: Iterable[ExcludeItemParam] | NotGiven = NOT_GIVEN, + exclude: Iterable[AccessRuleParam] | NotGiven = NOT_GIVEN, isolation_required: bool | NotGiven = NOT_GIVEN, precedence: int | NotGiven = NOT_GIVEN, purpose_justification_prompt: str | NotGiven = NOT_GIVEN, purpose_justification_required: bool | NotGiven = NOT_GIVEN, - require: Iterable[RequireItemParam] | NotGiven = NOT_GIVEN, + require: Iterable[AccessRuleParam] | NotGiven = NOT_GIVEN, session_duration: 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. diff --git a/src/cloudflare/resources/zero_trust/access/bookmarks.py b/src/cloudflare/resources/zero_trust/access/bookmarks.py index 87b2a1cfc5a..5f60532620d 100644 --- a/src/cloudflare/resources/zero_trust/access/bookmarks.py +++ b/src/cloudflare/resources/zero_trust/access/bookmarks.py @@ -26,8 +26,8 @@ make_request_options, ) from ....types.zero_trust.access import ( - ZeroTrustBookmarks, BookmarkDeleteResponse, + bookmarks, bookmark_create_params, bookmark_delete_params, bookmark_update_params, @@ -57,7 +57,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustBookmarks: + ) -> bookmarks.Bookmarks: """ Create a new Bookmark application. @@ -86,7 +86,7 @@ def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ZeroTrustBookmarks], ResultWrapper[ZeroTrustBookmarks]), + cast_to=cast(Type[bookmarks.Bookmarks], ResultWrapper[bookmarks.Bookmarks]), ) def update( @@ -101,7 +101,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustBookmarks: + ) -> bookmarks.Bookmarks: """ Updates a configured Bookmark application. @@ -130,7 +130,7 @@ def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ZeroTrustBookmarks], ResultWrapper[ZeroTrustBookmarks]), + cast_to=cast(Type[bookmarks.Bookmarks], ResultWrapper[bookmarks.Bookmarks]), ) def list( @@ -143,7 +143,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[ZeroTrustBookmarks]: + ) -> SyncSinglePage[bookmarks.Bookmarks]: """ Lists Bookmark applications. @@ -160,11 +160,11 @@ def list( raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}") return self._get_api_list( f"/accounts/{identifier}/access/bookmarks", - page=SyncSinglePage[ZeroTrustBookmarks], + page=SyncSinglePage[bookmarks.Bookmarks], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=ZeroTrustBookmarks, + model=bookmarks.Bookmarks, ) def delete( @@ -222,7 +222,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustBookmarks: + ) -> bookmarks.Bookmarks: """ Fetches a single Bookmark application. @@ -250,7 +250,7 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ZeroTrustBookmarks], ResultWrapper[ZeroTrustBookmarks]), + cast_to=cast(Type[bookmarks.Bookmarks], ResultWrapper[bookmarks.Bookmarks]), ) @@ -275,7 +275,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustBookmarks: + ) -> bookmarks.Bookmarks: """ Create a new Bookmark application. @@ -304,7 +304,7 @@ async def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ZeroTrustBookmarks], ResultWrapper[ZeroTrustBookmarks]), + cast_to=cast(Type[bookmarks.Bookmarks], ResultWrapper[bookmarks.Bookmarks]), ) async def update( @@ -319,7 +319,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustBookmarks: + ) -> bookmarks.Bookmarks: """ Updates a configured Bookmark application. @@ -348,7 +348,7 @@ async def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ZeroTrustBookmarks], ResultWrapper[ZeroTrustBookmarks]), + cast_to=cast(Type[bookmarks.Bookmarks], ResultWrapper[bookmarks.Bookmarks]), ) def list( @@ -361,7 +361,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[ZeroTrustBookmarks, AsyncSinglePage[ZeroTrustBookmarks]]: + ) -> AsyncPaginator[bookmarks.Bookmarks, AsyncSinglePage[bookmarks.Bookmarks]]: """ Lists Bookmark applications. @@ -378,11 +378,11 @@ def list( raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}") return self._get_api_list( f"/accounts/{identifier}/access/bookmarks", - page=AsyncSinglePage[ZeroTrustBookmarks], + page=AsyncSinglePage[bookmarks.Bookmarks], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=ZeroTrustBookmarks, + model=bookmarks.Bookmarks, ) async def delete( @@ -440,7 +440,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustBookmarks: + ) -> bookmarks.Bookmarks: """ Fetches a single Bookmark application. @@ -468,7 +468,7 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ZeroTrustBookmarks], ResultWrapper[ZeroTrustBookmarks]), + cast_to=cast(Type[bookmarks.Bookmarks], ResultWrapper[bookmarks.Bookmarks]), ) diff --git a/src/cloudflare/resources/zero_trust/access/certificates/settings.py b/src/cloudflare/resources/zero_trust/access/certificates/settings.py index a9e0bab4621..a63763c5df6 100644 --- a/src/cloudflare/resources/zero_trust/access/certificates/settings.py +++ b/src/cloudflare/resources/zero_trust/access/certificates/settings.py @@ -24,9 +24,9 @@ make_request_options, ) from .....types.zero_trust.access.certificates import ( - SettingsParam, SettingGetResponse, SettingUpdateResponse, + CertificateSettingsParam, setting_update_params, ) @@ -45,7 +45,7 @@ def with_streaming_response(self) -> SettingsWithStreamingResponse: def update( self, *, - settings: Iterable[SettingsParam], + settings: Iterable[CertificateSettingsParam], account_id: str | NotGiven = NOT_GIVEN, zone_id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -167,7 +167,7 @@ def with_streaming_response(self) -> AsyncSettingsWithStreamingResponse: async def update( self, *, - settings: Iterable[SettingsParam], + settings: Iterable[CertificateSettingsParam], account_id: str | NotGiven = NOT_GIVEN, zone_id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. diff --git a/src/cloudflare/resources/zero_trust/access/custom_pages.py b/src/cloudflare/resources/zero_trust/access/custom_pages.py index 1e65a80ae45..24d82f75801 100644 --- a/src/cloudflare/resources/zero_trust/access/custom_pages.py +++ b/src/cloudflare/resources/zero_trust/access/custom_pages.py @@ -27,9 +27,9 @@ make_request_options, ) from ....types.zero_trust.access import ( - ZeroTrustCustomPage, + CustomPage, + CustomPageWithoutHTML, CustomPageDeleteResponse, - ZeroTrustCustomPageWithoutHTML, custom_page_create_params, custom_page_update_params, ) @@ -60,7 +60,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustCustomPageWithoutHTML: + ) -> CustomPageWithoutHTML: """ Create a custom page @@ -103,7 +103,7 @@ def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ZeroTrustCustomPageWithoutHTML], ResultWrapper[ZeroTrustCustomPageWithoutHTML]), + cast_to=cast(Type[CustomPageWithoutHTML], ResultWrapper[CustomPageWithoutHTML]), ) def update( @@ -121,7 +121,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustCustomPageWithoutHTML: + ) -> CustomPageWithoutHTML: """ Update a custom page @@ -168,7 +168,7 @@ def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ZeroTrustCustomPageWithoutHTML], ResultWrapper[ZeroTrustCustomPageWithoutHTML]), + cast_to=cast(Type[CustomPageWithoutHTML], ResultWrapper[CustomPageWithoutHTML]), ) def list( @@ -181,7 +181,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[ZeroTrustCustomPageWithoutHTML]: + ) -> SyncSinglePage[CustomPageWithoutHTML]: """ List custom pages @@ -200,11 +200,11 @@ def list( raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}") return self._get_api_list( f"/accounts/{identifier}/access/custom_pages", - page=SyncSinglePage[ZeroTrustCustomPageWithoutHTML], + page=SyncSinglePage[CustomPageWithoutHTML], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=ZeroTrustCustomPageWithoutHTML, + model=CustomPageWithoutHTML, ) def delete( @@ -262,7 +262,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustCustomPage: + ) -> CustomPage: """ Fetches a custom page and also returns its HTML. @@ -292,7 +292,7 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ZeroTrustCustomPage], ResultWrapper[ZeroTrustCustomPage]), + cast_to=cast(Type[CustomPage], ResultWrapper[CustomPage]), ) @@ -319,7 +319,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustCustomPageWithoutHTML: + ) -> CustomPageWithoutHTML: """ Create a custom page @@ -362,7 +362,7 @@ async def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ZeroTrustCustomPageWithoutHTML], ResultWrapper[ZeroTrustCustomPageWithoutHTML]), + cast_to=cast(Type[CustomPageWithoutHTML], ResultWrapper[CustomPageWithoutHTML]), ) async def update( @@ -380,7 +380,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustCustomPageWithoutHTML: + ) -> CustomPageWithoutHTML: """ Update a custom page @@ -427,7 +427,7 @@ async def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ZeroTrustCustomPageWithoutHTML], ResultWrapper[ZeroTrustCustomPageWithoutHTML]), + cast_to=cast(Type[CustomPageWithoutHTML], ResultWrapper[CustomPageWithoutHTML]), ) def list( @@ -440,7 +440,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[ZeroTrustCustomPageWithoutHTML, AsyncSinglePage[ZeroTrustCustomPageWithoutHTML]]: + ) -> AsyncPaginator[CustomPageWithoutHTML, AsyncSinglePage[CustomPageWithoutHTML]]: """ List custom pages @@ -459,11 +459,11 @@ def list( raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}") return self._get_api_list( f"/accounts/{identifier}/access/custom_pages", - page=AsyncSinglePage[ZeroTrustCustomPageWithoutHTML], + page=AsyncSinglePage[CustomPageWithoutHTML], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=ZeroTrustCustomPageWithoutHTML, + model=CustomPageWithoutHTML, ) async def delete( @@ -521,7 +521,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustCustomPage: + ) -> CustomPage: """ Fetches a custom page and also returns its HTML. @@ -551,7 +551,7 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ZeroTrustCustomPage], ResultWrapper[ZeroTrustCustomPage]), + cast_to=cast(Type[CustomPage], ResultWrapper[CustomPage]), ) diff --git a/src/cloudflare/resources/zero_trust/access/groups.py b/src/cloudflare/resources/zero_trust/access/groups.py index bfe3c7e0bf7..cb28d32ebf9 100644 --- a/src/cloudflare/resources/zero_trust/access/groups.py +++ b/src/cloudflare/resources/zero_trust/access/groups.py @@ -25,7 +25,7 @@ AsyncPaginator, make_request_options, ) -from ....types.zero_trust import ExcludeItemParam, IncludeItemParam, RequireItemParam +from ....types.zero_trust import AccessRuleParam from ....types.zero_trust.access import ZeroTrustGroup, GroupDeleteResponse, group_create_params, group_update_params __all__ = ["Groups", "AsyncGroups"] @@ -43,13 +43,13 @@ def with_streaming_response(self) -> GroupsWithStreamingResponse: def create( self, *, - include: Iterable[IncludeItemParam], + include: Iterable[AccessRuleParam], name: str, account_id: str | NotGiven = NOT_GIVEN, zone_id: str | NotGiven = NOT_GIVEN, - exclude: Iterable[ExcludeItemParam] | NotGiven = NOT_GIVEN, + exclude: Iterable[AccessRuleParam] | NotGiven = NOT_GIVEN, is_default: bool | NotGiven = NOT_GIVEN, - require: Iterable[RequireItemParam] | NotGiven = NOT_GIVEN, + require: Iterable[AccessRuleParam] | 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, @@ -127,13 +127,13 @@ def update( self, uuid: str, *, - include: Iterable[IncludeItemParam], + include: Iterable[AccessRuleParam], name: str, account_id: str | NotGiven = NOT_GIVEN, zone_id: str | NotGiven = NOT_GIVEN, - exclude: Iterable[ExcludeItemParam] | NotGiven = NOT_GIVEN, + exclude: Iterable[AccessRuleParam] | NotGiven = NOT_GIVEN, is_default: bool | NotGiven = NOT_GIVEN, - require: Iterable[RequireItemParam] | NotGiven = NOT_GIVEN, + require: Iterable[AccessRuleParam] | 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, @@ -396,13 +396,13 @@ def with_streaming_response(self) -> AsyncGroupsWithStreamingResponse: async def create( self, *, - include: Iterable[IncludeItemParam], + include: Iterable[AccessRuleParam], name: str, account_id: str | NotGiven = NOT_GIVEN, zone_id: str | NotGiven = NOT_GIVEN, - exclude: Iterable[ExcludeItemParam] | NotGiven = NOT_GIVEN, + exclude: Iterable[AccessRuleParam] | NotGiven = NOT_GIVEN, is_default: bool | NotGiven = NOT_GIVEN, - require: Iterable[RequireItemParam] | NotGiven = NOT_GIVEN, + require: Iterable[AccessRuleParam] | 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, @@ -480,13 +480,13 @@ async def update( self, uuid: str, *, - include: Iterable[IncludeItemParam], + include: Iterable[AccessRuleParam], name: str, account_id: str | NotGiven = NOT_GIVEN, zone_id: str | NotGiven = NOT_GIVEN, - exclude: Iterable[ExcludeItemParam] | NotGiven = NOT_GIVEN, + exclude: Iterable[AccessRuleParam] | NotGiven = NOT_GIVEN, is_default: bool | NotGiven = NOT_GIVEN, - require: Iterable[RequireItemParam] | NotGiven = NOT_GIVEN, + require: Iterable[AccessRuleParam] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, diff --git a/src/cloudflare/resources/zero_trust/access/service_tokens.py b/src/cloudflare/resources/zero_trust/access/service_tokens.py index 953e58131ec..c250ab4ce70 100644 --- a/src/cloudflare/resources/zero_trust/access/service_tokens.py +++ b/src/cloudflare/resources/zero_trust/access/service_tokens.py @@ -26,7 +26,7 @@ make_request_options, ) from ....types.zero_trust.access import ( - ZeroTrustServiceTokens, + ErviceToken, ServiceTokenCreateResponse, ServiceTokenRotateResponse, service_token_create_params, @@ -132,7 +132,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustServiceTokens: + ) -> ErviceToken: """ Updates a configured service token. @@ -190,7 +190,7 @@ def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ZeroTrustServiceTokens], ResultWrapper[ZeroTrustServiceTokens]), + cast_to=cast(Type[ErviceToken], ResultWrapper[ErviceToken]), ) def list( @@ -204,7 +204,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[ZeroTrustServiceTokens]: + ) -> SyncSinglePage[ErviceToken]: """ Lists all service tokens. @@ -238,11 +238,11 @@ def list( account_or_zone_id = zone_id return self._get_api_list( f"/{account_or_zone}/{account_or_zone_id}/access/service_tokens", - page=SyncSinglePage[ZeroTrustServiceTokens], + page=SyncSinglePage[ErviceToken], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=ZeroTrustServiceTokens, + model=ErviceToken, ) def delete( @@ -257,7 +257,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustServiceTokens: + ) -> ErviceToken: """ Deletes a service token. @@ -302,7 +302,7 @@ def delete( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ZeroTrustServiceTokens], ResultWrapper[ZeroTrustServiceTokens]), + cast_to=cast(Type[ErviceToken], ResultWrapper[ErviceToken]), ) def refresh( @@ -316,7 +316,7 @@ def refresh( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustServiceTokens: + ) -> ErviceToken: """ Refreshes the expiration of a service token. @@ -346,7 +346,7 @@ def refresh( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ZeroTrustServiceTokens], ResultWrapper[ZeroTrustServiceTokens]), + cast_to=cast(Type[ErviceToken], ResultWrapper[ErviceToken]), ) def rotate( @@ -490,7 +490,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustServiceTokens: + ) -> ErviceToken: """ Updates a configured service token. @@ -548,7 +548,7 @@ async def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ZeroTrustServiceTokens], ResultWrapper[ZeroTrustServiceTokens]), + cast_to=cast(Type[ErviceToken], ResultWrapper[ErviceToken]), ) def list( @@ -562,7 +562,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[ZeroTrustServiceTokens, AsyncSinglePage[ZeroTrustServiceTokens]]: + ) -> AsyncPaginator[ErviceToken, AsyncSinglePage[ErviceToken]]: """ Lists all service tokens. @@ -596,11 +596,11 @@ def list( account_or_zone_id = zone_id return self._get_api_list( f"/{account_or_zone}/{account_or_zone_id}/access/service_tokens", - page=AsyncSinglePage[ZeroTrustServiceTokens], + page=AsyncSinglePage[ErviceToken], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=ZeroTrustServiceTokens, + model=ErviceToken, ) async def delete( @@ -615,7 +615,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustServiceTokens: + ) -> ErviceToken: """ Deletes a service token. @@ -660,7 +660,7 @@ async def delete( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ZeroTrustServiceTokens], ResultWrapper[ZeroTrustServiceTokens]), + cast_to=cast(Type[ErviceToken], ResultWrapper[ErviceToken]), ) async def refresh( @@ -674,7 +674,7 @@ async def refresh( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustServiceTokens: + ) -> ErviceToken: """ Refreshes the expiration of a service token. @@ -704,7 +704,7 @@ async def refresh( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ZeroTrustServiceTokens], ResultWrapper[ZeroTrustServiceTokens]), + cast_to=cast(Type[ErviceToken], ResultWrapper[ErviceToken]), ) async def rotate( diff --git a/src/cloudflare/resources/zero_trust/access/tags.py b/src/cloudflare/resources/zero_trust/access/tags.py index 0bfece83082..6add42d46dd 100644 --- a/src/cloudflare/resources/zero_trust/access/tags.py +++ b/src/cloudflare/resources/zero_trust/access/tags.py @@ -25,7 +25,7 @@ AsyncPaginator, make_request_options, ) -from ....types.zero_trust.access import ZeroTrustTag, TagDeleteResponse, tag_create_params, tag_update_params +from ....types.zero_trust.access import Tag, TagDeleteResponse, tag_create_params, tag_update_params __all__ = ["Tags", "AsyncTags"] @@ -50,7 +50,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustTag: + ) -> Tag: """ Create a tag @@ -79,7 +79,7 @@ def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ZeroTrustTag], ResultWrapper[ZeroTrustTag]), + cast_to=cast(Type[Tag], ResultWrapper[Tag]), ) def update( @@ -94,7 +94,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustTag: + ) -> Tag: """ Update a tag @@ -127,7 +127,7 @@ def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ZeroTrustTag], ResultWrapper[ZeroTrustTag]), + cast_to=cast(Type[Tag], ResultWrapper[Tag]), ) def list( @@ -140,7 +140,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[ZeroTrustTag]: + ) -> SyncSinglePage[Tag]: """ List tags @@ -159,11 +159,11 @@ def list( raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}") return self._get_api_list( f"/accounts/{identifier}/access/tags", - page=SyncSinglePage[ZeroTrustTag], + page=SyncSinglePage[Tag], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=ZeroTrustTag, + model=Tag, ) def delete( @@ -221,7 +221,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustTag: + ) -> Tag: """ Get a tag @@ -251,7 +251,7 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ZeroTrustTag], ResultWrapper[ZeroTrustTag]), + cast_to=cast(Type[Tag], ResultWrapper[Tag]), ) @@ -275,7 +275,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustTag: + ) -> Tag: """ Create a tag @@ -304,7 +304,7 @@ async def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ZeroTrustTag], ResultWrapper[ZeroTrustTag]), + cast_to=cast(Type[Tag], ResultWrapper[Tag]), ) async def update( @@ -319,7 +319,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustTag: + ) -> Tag: """ Update a tag @@ -352,7 +352,7 @@ async def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ZeroTrustTag], ResultWrapper[ZeroTrustTag]), + cast_to=cast(Type[Tag], ResultWrapper[Tag]), ) def list( @@ -365,7 +365,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[ZeroTrustTag, AsyncSinglePage[ZeroTrustTag]]: + ) -> AsyncPaginator[Tag, AsyncSinglePage[Tag]]: """ List tags @@ -384,11 +384,11 @@ def list( raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}") return self._get_api_list( f"/accounts/{identifier}/access/tags", - page=AsyncSinglePage[ZeroTrustTag], + page=AsyncSinglePage[Tag], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=ZeroTrustTag, + model=Tag, ) async def delete( @@ -446,7 +446,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustTag: + ) -> Tag: """ Get a tag @@ -476,7 +476,7 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ZeroTrustTag], ResultWrapper[ZeroTrustTag]), + cast_to=cast(Type[Tag], ResultWrapper[Tag]), ) 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 851f87f1182..b84609d9f63 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 ZeroTrustIdentity +from .....types.zero_trust.access.users import Identity __all__ = ["LastSeenIdentity", "AsyncLastSeenIdentity"] @@ -44,7 +44,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustIdentity: + ) -> Identity: """ Get last seen identity for a single user. @@ -74,7 +74,7 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ZeroTrustIdentity], ResultWrapper[ZeroTrustIdentity]), + cast_to=cast(Type[Identity], ResultWrapper[Identity]), ) @@ -98,7 +98,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustIdentity: + ) -> Identity: """ Get last seen identity for a single user. @@ -128,7 +128,7 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ZeroTrustIdentity], ResultWrapper[ZeroTrustIdentity]), + cast_to=cast(Type[Identity], ResultWrapper[Identity]), ) diff --git a/src/cloudflare/resources/zero_trust/access/users/users.py b/src/cloudflare/resources/zero_trust/access/users/users.py index 0d656b5f90b..04e0097f8f3 100644 --- a/src/cloudflare/resources/zero_trust/access/users/users.py +++ b/src/cloudflare/resources/zero_trust/access/users/users.py @@ -42,7 +42,7 @@ LastSeenIdentityWithStreamingResponse, AsyncLastSeenIdentityWithStreamingResponse, ) -from .....types.zero_trust.access import ZeroTrustUsers +from .....types.zero_trust.access import User __all__ = ["Users", "AsyncUsers"] @@ -78,7 +78,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[ZeroTrustUsers]: + ) -> SyncSinglePage[User]: """ Gets a list of users for an account. @@ -97,11 +97,11 @@ def list( raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}") return self._get_api_list( f"/accounts/{identifier}/access/users", - page=SyncSinglePage[ZeroTrustUsers], + page=SyncSinglePage[User], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=ZeroTrustUsers, + model=User, ) @@ -136,7 +136,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[ZeroTrustUsers, AsyncSinglePage[ZeroTrustUsers]]: + ) -> AsyncPaginator[User, AsyncSinglePage[User]]: """ Gets a list of users for an account. @@ -155,11 +155,11 @@ def list( raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}") return self._get_api_list( f"/accounts/{identifier}/access/users", - page=AsyncSinglePage[ZeroTrustUsers], + page=AsyncSinglePage[User], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=ZeroTrustUsers, + model=User, ) diff --git a/src/cloudflare/resources/zero_trust/devices/devices.py b/src/cloudflare/resources/zero_trust/devices/devices.py index cc274f86c18..c1c1da4fd30 100644 --- a/src/cloudflare/resources/zero_trust/devices/devices.py +++ b/src/cloudflare/resources/zero_trust/devices/devices.py @@ -88,7 +88,7 @@ from ....types.shared import UnnamedSchemaRef9444735ca60712dbcf8afd832eb5716a from .posture.posture import Posture, AsyncPosture from .policies.policies import Policies, AsyncPolicies -from ....types.zero_trust import ZeroTrustDevices +from ....types.zero_trust import Device __all__ = ["Devices", "AsyncDevices"] @@ -144,7 +144,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[ZeroTrustDevices]: + ) -> SyncSinglePage[Device]: """ Fetches a list of enrolled devices. @@ -161,11 +161,11 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/devices", - page=SyncSinglePage[ZeroTrustDevices], + page=SyncSinglePage[Device], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=ZeroTrustDevices, + model=Device, ) def get( @@ -267,7 +267,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[ZeroTrustDevices, AsyncSinglePage[ZeroTrustDevices]]: + ) -> AsyncPaginator[Device, AsyncSinglePage[Device]]: """ Fetches a list of enrolled devices. @@ -284,11 +284,11 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/devices", - page=AsyncSinglePage[ZeroTrustDevices], + page=AsyncSinglePage[Device], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=ZeroTrustDevices, + model=Device, ) async def get( diff --git a/src/cloudflare/resources/zero_trust/devices/dex_tests.py b/src/cloudflare/resources/zero_trust/devices/dex_tests.py index 3e3f26aada0..5af117cd7ea 100644 --- a/src/cloudflare/resources/zero_trust/devices/dex_tests.py +++ b/src/cloudflare/resources/zero_trust/devices/dex_tests.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Type, Optional, cast +from typing import Type, Iterable, Optional, cast import httpx @@ -54,6 +54,8 @@ def create( interval: str, name: str, description: str | NotGiven = NOT_GIVEN, + target_policies: Iterable[dex_test_create_params.TargetPolicy] | NotGiven = NOT_GIVEN, + targeted: bool | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -76,6 +78,8 @@ def create( description: Additional details about the test. + target_policies: Device settings profiles targeted by this test + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -95,6 +99,8 @@ def create( "interval": interval, "name": name, "description": description, + "target_policies": target_policies, + "targeted": targeted, }, dex_test_create_params.DEXTestCreateParams, ), @@ -118,6 +124,8 @@ def update( interval: str, name: str, description: str | NotGiven = NOT_GIVEN, + target_policies: Iterable[dex_test_update_params.TargetPolicy] | NotGiven = NOT_GIVEN, + targeted: bool | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -142,6 +150,8 @@ def update( description: Additional details about the test. + target_policies: Device settings profiles targeted by this test + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -163,6 +173,8 @@ def update( "interval": interval, "name": name, "description": description, + "target_policies": target_policies, + "targeted": targeted, }, dex_test_update_params.DEXTestUpdateParams, ), @@ -315,6 +327,8 @@ async def create( interval: str, name: str, description: str | NotGiven = NOT_GIVEN, + target_policies: Iterable[dex_test_create_params.TargetPolicy] | NotGiven = NOT_GIVEN, + targeted: bool | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -337,6 +351,8 @@ async def create( description: Additional details about the test. + target_policies: Device settings profiles targeted by this test + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -356,6 +372,8 @@ async def create( "interval": interval, "name": name, "description": description, + "target_policies": target_policies, + "targeted": targeted, }, dex_test_create_params.DEXTestCreateParams, ), @@ -379,6 +397,8 @@ async def update( interval: str, name: str, description: str | NotGiven = NOT_GIVEN, + target_policies: Iterable[dex_test_update_params.TargetPolicy] | NotGiven = NOT_GIVEN, + targeted: bool | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -403,6 +423,8 @@ async def update( description: Additional details about the test. + target_policies: Device settings profiles targeted by this test + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -424,6 +446,8 @@ async def update( "interval": interval, "name": name, "description": description, + "target_policies": target_policies, + "targeted": targeted, }, dex_test_update_params.DEXTestUpdateParams, ), diff --git a/src/cloudflare/resources/zero_trust/devices/networks.py b/src/cloudflare/resources/zero_trust/devices/networks.py index cab24a18c8c..c954991bfdd 100644 --- a/src/cloudflare/resources/zero_trust/devices/networks.py +++ b/src/cloudflare/resources/zero_trust/devices/networks.py @@ -27,7 +27,7 @@ make_request_options, ) from ....types.zero_trust.devices import ( - DeviceManagedNetworks, + Network, NetworkDeleteResponse, network_create_params, network_delete_params, @@ -59,7 +59,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[DeviceManagedNetworks]: + ) -> Optional[Network]: """ Creates a new device managed network. @@ -98,7 +98,7 @@ def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[DeviceManagedNetworks]], ResultWrapper[DeviceManagedNetworks]), + cast_to=cast(Type[Optional[Network]], ResultWrapper[Network]), ) def update( @@ -115,7 +115,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[DeviceManagedNetworks]: + ) -> Optional[Network]: """ Updates a configured device managed network. @@ -158,7 +158,7 @@ def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[DeviceManagedNetworks]], ResultWrapper[DeviceManagedNetworks]), + cast_to=cast(Type[Optional[Network]], ResultWrapper[Network]), ) def list( @@ -171,7 +171,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[DeviceManagedNetworks]: + ) -> SyncSinglePage[Network]: """ Fetches a list of managed networks for an account. @@ -188,11 +188,11 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/devices/networks", - page=SyncSinglePage[DeviceManagedNetworks], + page=SyncSinglePage[Network], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=DeviceManagedNetworks, + model=Network, ) def delete( @@ -251,7 +251,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[DeviceManagedNetworks]: + ) -> Optional[Network]: """ Fetches details for a single managed network. @@ -279,7 +279,7 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[DeviceManagedNetworks]], ResultWrapper[DeviceManagedNetworks]), + cast_to=cast(Type[Optional[Network]], ResultWrapper[Network]), ) @@ -305,7 +305,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[DeviceManagedNetworks]: + ) -> Optional[Network]: """ Creates a new device managed network. @@ -344,7 +344,7 @@ async def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[DeviceManagedNetworks]], ResultWrapper[DeviceManagedNetworks]), + cast_to=cast(Type[Optional[Network]], ResultWrapper[Network]), ) async def update( @@ -361,7 +361,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[DeviceManagedNetworks]: + ) -> Optional[Network]: """ Updates a configured device managed network. @@ -404,7 +404,7 @@ async def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[DeviceManagedNetworks]], ResultWrapper[DeviceManagedNetworks]), + cast_to=cast(Type[Optional[Network]], ResultWrapper[Network]), ) def list( @@ -417,7 +417,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[DeviceManagedNetworks, AsyncSinglePage[DeviceManagedNetworks]]: + ) -> AsyncPaginator[Network, AsyncSinglePage[Network]]: """ Fetches a list of managed networks for an account. @@ -434,11 +434,11 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/devices/networks", - page=AsyncSinglePage[DeviceManagedNetworks], + page=AsyncSinglePage[Network], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=DeviceManagedNetworks, + model=Network, ) async def delete( @@ -497,7 +497,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[DeviceManagedNetworks]: + ) -> Optional[Network]: """ Fetches details for a single managed network. @@ -525,7 +525,7 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[DeviceManagedNetworks]], ResultWrapper[DeviceManagedNetworks]), + cast_to=cast(Type[Optional[Network]], ResultWrapper[Network]), ) diff --git a/src/cloudflare/resources/zero_trust/devices/policies/excludes.py b/src/cloudflare/resources/zero_trust/devices/policies/excludes.py index 9ee1ea2922b..48c32546fbe 100644 --- a/src/cloudflare/resources/zero_trust/devices/policies/excludes.py +++ b/src/cloudflare/resources/zero_trust/devices/policies/excludes.py @@ -26,10 +26,10 @@ make_request_options, ) from .....types.zero_trust.devices.policies import ( - DevicesSplitTunnel, ExcludeGetResponse, + SplitTunnelExclude, ExcludeUpdateResponse, - DevicesSplitTunnelParam, + SplitTunnelExcludeParam, exclude_update_params, ) @@ -49,7 +49,7 @@ def update( self, *, account_id: str, - body: Iterable[DevicesSplitTunnelParam], + body: Iterable[SplitTunnelExcludeParam], # 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, @@ -94,7 +94,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[DevicesSplitTunnel]: + ) -> SyncSinglePage[SplitTunnelExclude]: """ Fetches the list of routes excluded from the WARP client's tunnel. @@ -111,11 +111,11 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/devices/policy/exclude", - page=SyncSinglePage[DevicesSplitTunnel], + page=SyncSinglePage[SplitTunnelExclude], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=DevicesSplitTunnel, + model=SplitTunnelExclude, ) def get( @@ -175,7 +175,7 @@ async def update( self, *, account_id: str, - body: Iterable[DevicesSplitTunnelParam], + body: Iterable[SplitTunnelExcludeParam], # 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, @@ -220,7 +220,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[DevicesSplitTunnel, AsyncSinglePage[DevicesSplitTunnel]]: + ) -> AsyncPaginator[SplitTunnelExclude, AsyncSinglePage[SplitTunnelExclude]]: """ Fetches the list of routes excluded from the WARP client's tunnel. @@ -237,11 +237,11 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/devices/policy/exclude", - page=AsyncSinglePage[DevicesSplitTunnel], + page=AsyncSinglePage[SplitTunnelExclude], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=DevicesSplitTunnel, + model=SplitTunnelExclude, ) async def get( diff --git a/src/cloudflare/resources/zero_trust/devices/policies/fallback_domains.py b/src/cloudflare/resources/zero_trust/devices/policies/fallback_domains.py index 4c968946186..bf60c6b6aea 100644 --- a/src/cloudflare/resources/zero_trust/devices/policies/fallback_domains.py +++ b/src/cloudflare/resources/zero_trust/devices/policies/fallback_domains.py @@ -26,9 +26,9 @@ make_request_options, ) from .....types.zero_trust.devices.policies import ( - DevicesFallbackDomain, + FallbackDomain, + FallbackDomainParam, FallbackDomainGetResponse, - DevicesFallbackDomainParam, FallbackDomainUpdateResponse, fallback_domain_update_params, ) @@ -50,7 +50,7 @@ def update( policy_id: str, *, account_id: str, - body: Iterable[DevicesFallbackDomainParam], + body: Iterable[FallbackDomainParam], # 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, @@ -102,7 +102,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[DevicesFallbackDomain]: + ) -> SyncSinglePage[FallbackDomain]: """Fetches a list of domains to bypass Gateway DNS resolution. These domains will @@ -121,11 +121,11 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/devices/policy/fallback_domains", - page=SyncSinglePage[DevicesFallbackDomain], + page=SyncSinglePage[FallbackDomain], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=DevicesFallbackDomain, + model=FallbackDomain, ) def get( @@ -187,7 +187,7 @@ async def update( policy_id: str, *, account_id: str, - body: Iterable[DevicesFallbackDomainParam], + body: Iterable[FallbackDomainParam], # 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, @@ -239,7 +239,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[DevicesFallbackDomain, AsyncSinglePage[DevicesFallbackDomain]]: + ) -> AsyncPaginator[FallbackDomain, AsyncSinglePage[FallbackDomain]]: """Fetches a list of domains to bypass Gateway DNS resolution. These domains will @@ -258,11 +258,11 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/devices/policy/fallback_domains", - page=AsyncSinglePage[DevicesFallbackDomain], + page=AsyncSinglePage[FallbackDomain], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=DevicesFallbackDomain, + model=FallbackDomain, ) async def get( diff --git a/src/cloudflare/resources/zero_trust/devices/policies/includes.py b/src/cloudflare/resources/zero_trust/devices/policies/includes.py index 7a6d7b9880b..52cdeed86c6 100644 --- a/src/cloudflare/resources/zero_trust/devices/policies/includes.py +++ b/src/cloudflare/resources/zero_trust/devices/policies/includes.py @@ -27,9 +27,9 @@ ) from .....types.zero_trust.devices.policies import ( IncludeGetResponse, + SplitTunnelInclude, IncludeUpdateResponse, - DevicesSplitTunnelInclude, - DevicesSplitTunnelIncludeParam, + SplitTunnelIncludeParam, include_update_params, ) @@ -49,7 +49,7 @@ def update( self, *, account_id: str, - body: Iterable[DevicesSplitTunnelIncludeParam], + body: Iterable[SplitTunnelIncludeParam], # 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, @@ -94,7 +94,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[DevicesSplitTunnelInclude]: + ) -> SyncSinglePage[SplitTunnelInclude]: """ Fetches the list of routes included in the WARP client's tunnel. @@ -111,11 +111,11 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/devices/policy/include", - page=SyncSinglePage[DevicesSplitTunnelInclude], + page=SyncSinglePage[SplitTunnelInclude], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=DevicesSplitTunnelInclude, + model=SplitTunnelInclude, ) def get( @@ -175,7 +175,7 @@ async def update( self, *, account_id: str, - body: Iterable[DevicesSplitTunnelIncludeParam], + body: Iterable[SplitTunnelIncludeParam], # 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, @@ -220,7 +220,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[DevicesSplitTunnelInclude, AsyncSinglePage[DevicesSplitTunnelInclude]]: + ) -> AsyncPaginator[SplitTunnelInclude, AsyncSinglePage[SplitTunnelInclude]]: """ Fetches the list of routes included in the WARP client's tunnel. @@ -237,11 +237,11 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/devices/policy/include", - page=AsyncSinglePage[DevicesSplitTunnelInclude], + page=AsyncSinglePage[SplitTunnelInclude], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=DevicesSplitTunnelInclude, + model=SplitTunnelInclude, ) async def get( diff --git a/src/cloudflare/resources/zero_trust/devices/policies/policies.py b/src/cloudflare/resources/zero_trust/devices/policies/policies.py index 72b179eadb2..667500cf35a 100644 --- a/src/cloudflare/resources/zero_trust/devices/policies/policies.py +++ b/src/cloudflare/resources/zero_trust/devices/policies/policies.py @@ -58,8 +58,8 @@ AsyncFallbackDomainsWithStreamingResponse, ) from .....types.zero_trust.devices import ( + SettingsPolicy, PolicyDeleteResponse, - DevicesDeviceSettingsPolicy, policy_edit_params, policy_create_params, policy_delete_params, @@ -120,7 +120,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[DevicesDeviceSettingsPolicy]: + ) -> Optional[SettingsPolicy]: """ Creates a device settings profile to be applied to certain devices matching the criteria. @@ -207,7 +207,7 @@ def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[DevicesDeviceSettingsPolicy]], ResultWrapper[DevicesDeviceSettingsPolicy]), + cast_to=cast(Type[Optional[SettingsPolicy]], ResultWrapper[SettingsPolicy]), ) def list( @@ -220,7 +220,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[DevicesDeviceSettingsPolicy]: + ) -> SyncSinglePage[SettingsPolicy]: """ Fetches a list of the device settings profiles for an account. @@ -237,11 +237,11 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/devices/policies", - page=SyncSinglePage[DevicesDeviceSettingsPolicy], + page=SyncSinglePage[SettingsPolicy], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=DevicesDeviceSettingsPolicy, + model=SettingsPolicy, ) def delete( @@ -315,7 +315,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[DevicesDeviceSettingsPolicy]: + ) -> Optional[SettingsPolicy]: """ Updates a configured device settings profile. @@ -395,7 +395,7 @@ def edit( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[DevicesDeviceSettingsPolicy]], ResultWrapper[DevicesDeviceSettingsPolicy]), + cast_to=cast(Type[Optional[SettingsPolicy]], ResultWrapper[SettingsPolicy]), ) def get( @@ -409,7 +409,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[DevicesDeviceSettingsPolicy]: + ) -> Optional[SettingsPolicy]: """ Fetches a device settings profile by ID. @@ -437,7 +437,7 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[DevicesDeviceSettingsPolicy]], ResultWrapper[DevicesDeviceSettingsPolicy]), + cast_to=cast(Type[Optional[SettingsPolicy]], ResultWrapper[SettingsPolicy]), ) @@ -493,7 +493,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[DevicesDeviceSettingsPolicy]: + ) -> Optional[SettingsPolicy]: """ Creates a device settings profile to be applied to certain devices matching the criteria. @@ -580,7 +580,7 @@ async def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[DevicesDeviceSettingsPolicy]], ResultWrapper[DevicesDeviceSettingsPolicy]), + cast_to=cast(Type[Optional[SettingsPolicy]], ResultWrapper[SettingsPolicy]), ) def list( @@ -593,7 +593,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[DevicesDeviceSettingsPolicy, AsyncSinglePage[DevicesDeviceSettingsPolicy]]: + ) -> AsyncPaginator[SettingsPolicy, AsyncSinglePage[SettingsPolicy]]: """ Fetches a list of the device settings profiles for an account. @@ -610,11 +610,11 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/devices/policies", - page=AsyncSinglePage[DevicesDeviceSettingsPolicy], + page=AsyncSinglePage[SettingsPolicy], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=DevicesDeviceSettingsPolicy, + model=SettingsPolicy, ) async def delete( @@ -688,7 +688,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[DevicesDeviceSettingsPolicy]: + ) -> Optional[SettingsPolicy]: """ Updates a configured device settings profile. @@ -768,7 +768,7 @@ async def edit( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[DevicesDeviceSettingsPolicy]], ResultWrapper[DevicesDeviceSettingsPolicy]), + cast_to=cast(Type[Optional[SettingsPolicy]], ResultWrapper[SettingsPolicy]), ) async def get( @@ -782,7 +782,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[DevicesDeviceSettingsPolicy]: + ) -> Optional[SettingsPolicy]: """ Fetches a device settings profile by ID. @@ -810,7 +810,7 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[DevicesDeviceSettingsPolicy]], ResultWrapper[DevicesDeviceSettingsPolicy]), + cast_to=cast(Type[Optional[SettingsPolicy]], ResultWrapper[SettingsPolicy]), ) diff --git a/src/cloudflare/resources/zero_trust/devices/settings.py b/src/cloudflare/resources/zero_trust/devices/settings.py index 8fb8a01800d..646b20f3cf4 100644 --- a/src/cloudflare/resources/zero_trust/devices/settings.py +++ b/src/cloudflare/resources/zero_trust/devices/settings.py @@ -23,7 +23,7 @@ from ...._base_client import ( make_request_options, ) -from ....types.zero_trust.devices import ZeroTrustAccountDeviceSettings, setting_update_params +from ....types.zero_trust.devices import DeviceSettings, setting_update_params __all__ = ["Settings", "AsyncSettings"] @@ -51,7 +51,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ZeroTrustAccountDeviceSettings]: + ) -> Optional[DeviceSettings]: """ Updates the current device settings for a Zero Trust account. @@ -92,7 +92,7 @@ def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[ZeroTrustAccountDeviceSettings]], ResultWrapper[ZeroTrustAccountDeviceSettings]), + cast_to=cast(Type[Optional[DeviceSettings]], ResultWrapper[DeviceSettings]), ) def list( @@ -105,7 +105,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ZeroTrustAccountDeviceSettings]: + ) -> Optional[DeviceSettings]: """ Describes the current device settings for a Zero Trust account. @@ -129,7 +129,7 @@ def list( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[ZeroTrustAccountDeviceSettings]], ResultWrapper[ZeroTrustAccountDeviceSettings]), + cast_to=cast(Type[Optional[DeviceSettings]], ResultWrapper[DeviceSettings]), ) @@ -156,7 +156,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ZeroTrustAccountDeviceSettings]: + ) -> Optional[DeviceSettings]: """ Updates the current device settings for a Zero Trust account. @@ -197,7 +197,7 @@ async def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[ZeroTrustAccountDeviceSettings]], ResultWrapper[ZeroTrustAccountDeviceSettings]), + cast_to=cast(Type[Optional[DeviceSettings]], ResultWrapper[DeviceSettings]), ) async def list( @@ -210,7 +210,7 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ZeroTrustAccountDeviceSettings]: + ) -> Optional[DeviceSettings]: """ Describes the current device settings for a Zero Trust account. @@ -234,7 +234,7 @@ async def list( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[ZeroTrustAccountDeviceSettings]], ResultWrapper[ZeroTrustAccountDeviceSettings]), + cast_to=cast(Type[Optional[DeviceSettings]], ResultWrapper[DeviceSettings]), ) diff --git a/src/cloudflare/resources/zero_trust/dex/fleet_status/devices.py b/src/cloudflare/resources/zero_trust/dex/fleet_status/devices.py index 77db3cfd041..92606b4f12f 100644 --- a/src/cloudflare/resources/zero_trust/dex/fleet_status/devices.py +++ b/src/cloudflare/resources/zero_trust/dex/fleet_status/devices.py @@ -21,7 +21,7 @@ AsyncPaginator, make_request_options, ) -from .....types.zero_trust.dex.fleet_status import Device, device_list_params +from .....types.zero_trust.dex.fleet_status import DeviceListResponse, device_list_params __all__ = ["Devices", "AsyncDevices"] @@ -57,7 +57,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncV4PagePaginationArray[Device]: + ) -> SyncV4PagePaginationArray[DeviceListResponse]: """ List details for devices using WARP @@ -96,7 +96,7 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/dex/fleet-status/devices", - page=SyncV4PagePaginationArray[Device], + page=SyncV4PagePaginationArray[DeviceListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -119,7 +119,7 @@ def list( device_list_params.DeviceListParams, ), ), - model=Device, + model=DeviceListResponse, ) @@ -154,7 +154,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[Device, AsyncV4PagePaginationArray[Device]]: + ) -> AsyncPaginator[DeviceListResponse, AsyncV4PagePaginationArray[DeviceListResponse]]: """ List details for devices using WARP @@ -193,7 +193,7 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/dex/fleet-status/devices", - page=AsyncV4PagePaginationArray[Device], + page=AsyncV4PagePaginationArray[DeviceListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -216,7 +216,7 @@ def list( device_list_params.DeviceListParams, ), ), - model=Device, + model=DeviceListResponse, ) diff --git a/src/cloudflare/resources/zero_trust/dex/traceroute_test_results/__init__.py b/src/cloudflare/resources/zero_trust/dex/traceroute_test_results/__init__.py index 29ddac57979..3c5c1852114 100644 --- a/src/cloudflare/resources/zero_trust/dex/traceroute_test_results/__init__.py +++ b/src/cloudflare/resources/zero_trust/dex/traceroute_test_results/__init__.py @@ -1,12 +1,12 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from .network_path import ( - NetworkPath, - AsyncNetworkPath, - NetworkPathWithRawResponse, - AsyncNetworkPathWithRawResponse, - NetworkPathWithStreamingResponse, - AsyncNetworkPathWithStreamingResponse, + NetworkPathResource, + AsyncNetworkPathResource, + NetworkPathResourceWithRawResponse, + AsyncNetworkPathResourceWithRawResponse, + NetworkPathResourceWithStreamingResponse, + AsyncNetworkPathResourceWithStreamingResponse, ) from .traceroute_test_results import ( TracerouteTestResults, @@ -18,12 +18,12 @@ ) __all__ = [ - "NetworkPath", - "AsyncNetworkPath", - "NetworkPathWithRawResponse", - "AsyncNetworkPathWithRawResponse", - "NetworkPathWithStreamingResponse", - "AsyncNetworkPathWithStreamingResponse", + "NetworkPathResource", + "AsyncNetworkPathResource", + "NetworkPathResourceWithRawResponse", + "AsyncNetworkPathResourceWithRawResponse", + "NetworkPathResourceWithStreamingResponse", + "AsyncNetworkPathResourceWithStreamingResponse", "TracerouteTestResults", "AsyncTracerouteTestResults", "TracerouteTestResultsWithRawResponse", diff --git a/src/cloudflare/resources/zero_trust/dex/traceroute_test_results/network_path.py b/src/cloudflare/resources/zero_trust/dex/traceroute_test_results/network_path.py index 4fd8606ae6f..c43708ea300 100644 --- a/src/cloudflare/resources/zero_trust/dex/traceroute_test_results/network_path.py +++ b/src/cloudflare/resources/zero_trust/dex/traceroute_test_results/network_path.py @@ -19,19 +19,19 @@ from ....._base_client import ( make_request_options, ) -from .....types.zero_trust.dex.traceroute_test_results import TracerouteTestResultNetworkPath +from .....types.zero_trust.dex.traceroute_test_results import NetworkPath -__all__ = ["NetworkPath", "AsyncNetworkPath"] +__all__ = ["NetworkPathResource", "AsyncNetworkPathResource"] -class NetworkPath(SyncAPIResource): +class NetworkPathResource(SyncAPIResource): @cached_property - def with_raw_response(self) -> NetworkPathWithRawResponse: - return NetworkPathWithRawResponse(self) + def with_raw_response(self) -> NetworkPathResourceWithRawResponse: + return NetworkPathResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> NetworkPathWithStreamingResponse: - return NetworkPathWithStreamingResponse(self) + def with_streaming_response(self) -> NetworkPathResourceWithStreamingResponse: + return NetworkPathResourceWithStreamingResponse(self) def get( self, @@ -44,7 +44,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TracerouteTestResultNetworkPath: + ) -> NetworkPath: """ Get a breakdown of hops and performance metrics for a specific traceroute test run @@ -73,18 +73,18 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[TracerouteTestResultNetworkPath], ResultWrapper[TracerouteTestResultNetworkPath]), + cast_to=cast(Type[NetworkPath], ResultWrapper[NetworkPath]), ) -class AsyncNetworkPath(AsyncAPIResource): +class AsyncNetworkPathResource(AsyncAPIResource): @cached_property - def with_raw_response(self) -> AsyncNetworkPathWithRawResponse: - return AsyncNetworkPathWithRawResponse(self) + def with_raw_response(self) -> AsyncNetworkPathResourceWithRawResponse: + return AsyncNetworkPathResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> AsyncNetworkPathWithStreamingResponse: - return AsyncNetworkPathWithStreamingResponse(self) + def with_streaming_response(self) -> AsyncNetworkPathResourceWithStreamingResponse: + return AsyncNetworkPathResourceWithStreamingResponse(self) async def get( self, @@ -97,7 +97,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TracerouteTestResultNetworkPath: + ) -> NetworkPath: """ Get a breakdown of hops and performance metrics for a specific traceroute test run @@ -126,12 +126,12 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[TracerouteTestResultNetworkPath], ResultWrapper[TracerouteTestResultNetworkPath]), + cast_to=cast(Type[NetworkPath], ResultWrapper[NetworkPath]), ) -class NetworkPathWithRawResponse: - def __init__(self, network_path: NetworkPath) -> None: +class NetworkPathResourceWithRawResponse: + def __init__(self, network_path: NetworkPathResource) -> None: self._network_path = network_path self.get = to_raw_response_wrapper( @@ -139,8 +139,8 @@ def __init__(self, network_path: NetworkPath) -> None: ) -class AsyncNetworkPathWithRawResponse: - def __init__(self, network_path: AsyncNetworkPath) -> None: +class AsyncNetworkPathResourceWithRawResponse: + def __init__(self, network_path: AsyncNetworkPathResource) -> None: self._network_path = network_path self.get = async_to_raw_response_wrapper( @@ -148,8 +148,8 @@ def __init__(self, network_path: AsyncNetworkPath) -> None: ) -class NetworkPathWithStreamingResponse: - def __init__(self, network_path: NetworkPath) -> None: +class NetworkPathResourceWithStreamingResponse: + def __init__(self, network_path: NetworkPathResource) -> None: self._network_path = network_path self.get = to_streamed_response_wrapper( @@ -157,8 +157,8 @@ def __init__(self, network_path: NetworkPath) -> None: ) -class AsyncNetworkPathWithStreamingResponse: - def __init__(self, network_path: AsyncNetworkPath) -> None: +class AsyncNetworkPathResourceWithStreamingResponse: + def __init__(self, network_path: AsyncNetworkPathResource) -> None: self._network_path = network_path self.get = async_to_streamed_response_wrapper( diff --git a/src/cloudflare/resources/zero_trust/dex/traceroute_test_results/traceroute_test_results.py b/src/cloudflare/resources/zero_trust/dex/traceroute_test_results/traceroute_test_results.py index 6b536de666a..ee43d4e01ba 100644 --- a/src/cloudflare/resources/zero_trust/dex/traceroute_test_results/traceroute_test_results.py +++ b/src/cloudflare/resources/zero_trust/dex/traceroute_test_results/traceroute_test_results.py @@ -4,12 +4,12 @@ from ....._compat import cached_property from .network_path import ( - NetworkPath, - AsyncNetworkPath, - NetworkPathWithRawResponse, - AsyncNetworkPathWithRawResponse, - NetworkPathWithStreamingResponse, - AsyncNetworkPathWithStreamingResponse, + NetworkPathResource, + AsyncNetworkPathResource, + NetworkPathResourceWithRawResponse, + AsyncNetworkPathResourceWithRawResponse, + NetworkPathResourceWithStreamingResponse, + AsyncNetworkPathResourceWithStreamingResponse, ) from ....._resource import SyncAPIResource, AsyncAPIResource @@ -18,8 +18,8 @@ class TracerouteTestResults(SyncAPIResource): @cached_property - def network_path(self) -> NetworkPath: - return NetworkPath(self._client) + def network_path(self) -> NetworkPathResource: + return NetworkPathResource(self._client) @cached_property def with_raw_response(self) -> TracerouteTestResultsWithRawResponse: @@ -32,8 +32,8 @@ def with_streaming_response(self) -> TracerouteTestResultsWithStreamingResponse: class AsyncTracerouteTestResults(AsyncAPIResource): @cached_property - def network_path(self) -> AsyncNetworkPath: - return AsyncNetworkPath(self._client) + def network_path(self) -> AsyncNetworkPathResource: + return AsyncNetworkPathResource(self._client) @cached_property def with_raw_response(self) -> AsyncTracerouteTestResultsWithRawResponse: @@ -49,8 +49,8 @@ def __init__(self, traceroute_test_results: TracerouteTestResults) -> None: self._traceroute_test_results = traceroute_test_results @cached_property - def network_path(self) -> NetworkPathWithRawResponse: - return NetworkPathWithRawResponse(self._traceroute_test_results.network_path) + def network_path(self) -> NetworkPathResourceWithRawResponse: + return NetworkPathResourceWithRawResponse(self._traceroute_test_results.network_path) class AsyncTracerouteTestResultsWithRawResponse: @@ -58,8 +58,8 @@ def __init__(self, traceroute_test_results: AsyncTracerouteTestResults) -> None: self._traceroute_test_results = traceroute_test_results @cached_property - def network_path(self) -> AsyncNetworkPathWithRawResponse: - return AsyncNetworkPathWithRawResponse(self._traceroute_test_results.network_path) + def network_path(self) -> AsyncNetworkPathResourceWithRawResponse: + return AsyncNetworkPathResourceWithRawResponse(self._traceroute_test_results.network_path) class TracerouteTestResultsWithStreamingResponse: @@ -67,8 +67,8 @@ def __init__(self, traceroute_test_results: TracerouteTestResults) -> None: self._traceroute_test_results = traceroute_test_results @cached_property - def network_path(self) -> NetworkPathWithStreamingResponse: - return NetworkPathWithStreamingResponse(self._traceroute_test_results.network_path) + def network_path(self) -> NetworkPathResourceWithStreamingResponse: + return NetworkPathResourceWithStreamingResponse(self._traceroute_test_results.network_path) class AsyncTracerouteTestResultsWithStreamingResponse: @@ -76,5 +76,5 @@ def __init__(self, traceroute_test_results: AsyncTracerouteTestResults) -> None: self._traceroute_test_results = traceroute_test_results @cached_property - def network_path(self) -> AsyncNetworkPathWithStreamingResponse: - return AsyncNetworkPathWithStreamingResponse(self._traceroute_test_results.network_path) + def network_path(self) -> AsyncNetworkPathResourceWithStreamingResponse: + return AsyncNetworkPathResourceWithStreamingResponse(self._traceroute_test_results.network_path) diff --git a/src/cloudflare/resources/zero_trust/dex/traceroute_tests.py b/src/cloudflare/resources/zero_trust/dex/traceroute_tests.py index f2375b652d0..bb6fecece28 100644 --- a/src/cloudflare/resources/zero_trust/dex/traceroute_tests.py +++ b/src/cloudflare/resources/zero_trust/dex/traceroute_tests.py @@ -25,9 +25,9 @@ make_request_options, ) from ....types.zero_trust.dex import ( - TracerouteDetails, - TracerouteTestNetworkPath, - TracerouteDetailsPercentiles, + Traceroute, + NetworkPath, + TracerouteTestPercentilesResponse, traceroute_test_get_params, traceroute_test_percentiles_params, traceroute_test_network_path_params, @@ -61,7 +61,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TracerouteDetails: + ) -> Traceroute: """ Get test details and aggregate performance metrics for an traceroute test for a given time period between 1 hour and 7 days. @@ -112,7 +112,7 @@ def get( ), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[TracerouteDetails], ResultWrapper[TracerouteDetails]), + cast_to=cast(Type[Traceroute], ResultWrapper[Traceroute]), ) def network_path( @@ -130,7 +130,7 @@ def network_path( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TracerouteTestNetworkPath: + ) -> NetworkPath: """ Get a breakdown of metrics by hop for individual traceroute test runs @@ -175,7 +175,7 @@ def network_path( ), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[TracerouteTestNetworkPath], ResultWrapper[TracerouteTestNetworkPath]), + cast_to=cast(Type[NetworkPath], ResultWrapper[NetworkPath]), ) def percentiles( @@ -193,7 +193,7 @@ def percentiles( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TracerouteDetailsPercentiles: + ) -> TracerouteTestPercentilesResponse: """ Get percentiles for a traceroute test for a given time period between 1 hour and 7 days. @@ -241,7 +241,7 @@ def percentiles( ), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[TracerouteDetailsPercentiles], ResultWrapper[TracerouteDetailsPercentiles]), + cast_to=cast(Type[TracerouteTestPercentilesResponse], ResultWrapper[TracerouteTestPercentilesResponse]), ) @@ -270,7 +270,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TracerouteDetails: + ) -> Traceroute: """ Get test details and aggregate performance metrics for an traceroute test for a given time period between 1 hour and 7 days. @@ -321,7 +321,7 @@ async def get( ), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[TracerouteDetails], ResultWrapper[TracerouteDetails]), + cast_to=cast(Type[Traceroute], ResultWrapper[Traceroute]), ) async def network_path( @@ -339,7 +339,7 @@ async def network_path( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TracerouteTestNetworkPath: + ) -> NetworkPath: """ Get a breakdown of metrics by hop for individual traceroute test runs @@ -384,7 +384,7 @@ async def network_path( ), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[TracerouteTestNetworkPath], ResultWrapper[TracerouteTestNetworkPath]), + cast_to=cast(Type[NetworkPath], ResultWrapper[NetworkPath]), ) async def percentiles( @@ -402,7 +402,7 @@ async def percentiles( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TracerouteDetailsPercentiles: + ) -> TracerouteTestPercentilesResponse: """ Get percentiles for a traceroute test for a given time period between 1 hour and 7 days. @@ -450,7 +450,7 @@ async def percentiles( ), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[TracerouteDetailsPercentiles], ResultWrapper[TracerouteDetailsPercentiles]), + cast_to=cast(Type[TracerouteTestPercentilesResponse], ResultWrapper[TracerouteTestPercentilesResponse]), ) diff --git a/src/cloudflare/resources/zero_trust/dlp/payload_logs.py b/src/cloudflare/resources/zero_trust/dlp/payload_logs.py index 75e2f192d88..f8284726097 100644 --- a/src/cloudflare/resources/zero_trust/dlp/payload_logs.py +++ b/src/cloudflare/resources/zero_trust/dlp/payload_logs.py @@ -23,7 +23,7 @@ from ...._base_client import ( make_request_options, ) -from ....types.zero_trust.dlp import UnnamedSchemaRefE31ff4936b1b42746e8cb62bbc87f2e5, payload_log_update_params +from ....types.zero_trust.dlp import PayloadLogGetResponse, PayloadLogUpdateResponse, payload_log_update_params __all__ = ["PayloadLogs", "AsyncPayloadLogs"] @@ -48,7 +48,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[UnnamedSchemaRefE31ff4936b1b42746e8cb62bbc87f2e5]: + ) -> PayloadLogUpdateResponse: """ Updates the DLP payload log settings for this account. @@ -77,10 +77,7 @@ def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast( - Type[Optional[UnnamedSchemaRefE31ff4936b1b42746e8cb62bbc87f2e5]], - ResultWrapper[UnnamedSchemaRefE31ff4936b1b42746e8cb62bbc87f2e5], - ), + cast_to=cast(Type[PayloadLogUpdateResponse], ResultWrapper[PayloadLogUpdateResponse]), ) def get( @@ -93,7 +90,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[UnnamedSchemaRefE31ff4936b1b42746e8cb62bbc87f2e5]: + ) -> PayloadLogGetResponse: """ Gets the current DLP payload log settings for this account. @@ -119,10 +116,7 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast( - Type[Optional[UnnamedSchemaRefE31ff4936b1b42746e8cb62bbc87f2e5]], - ResultWrapper[UnnamedSchemaRefE31ff4936b1b42746e8cb62bbc87f2e5], - ), + cast_to=cast(Type[PayloadLogGetResponse], ResultWrapper[PayloadLogGetResponse]), ) @@ -146,7 +140,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[UnnamedSchemaRefE31ff4936b1b42746e8cb62bbc87f2e5]: + ) -> PayloadLogUpdateResponse: """ Updates the DLP payload log settings for this account. @@ -177,10 +171,7 @@ async def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast( - Type[Optional[UnnamedSchemaRefE31ff4936b1b42746e8cb62bbc87f2e5]], - ResultWrapper[UnnamedSchemaRefE31ff4936b1b42746e8cb62bbc87f2e5], - ), + cast_to=cast(Type[PayloadLogUpdateResponse], ResultWrapper[PayloadLogUpdateResponse]), ) async def get( @@ -193,7 +184,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[UnnamedSchemaRefE31ff4936b1b42746e8cb62bbc87f2e5]: + ) -> PayloadLogGetResponse: """ Gets the current DLP payload log settings for this account. @@ -219,10 +210,7 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast( - Type[Optional[UnnamedSchemaRefE31ff4936b1b42746e8cb62bbc87f2e5]], - ResultWrapper[UnnamedSchemaRefE31ff4936b1b42746e8cb62bbc87f2e5], - ), + cast_to=cast(Type[PayloadLogGetResponse], ResultWrapper[PayloadLogGetResponse]), ) diff --git a/src/cloudflare/resources/zero_trust/dlp/profiles/profiles.py b/src/cloudflare/resources/zero_trust/dlp/profiles/profiles.py index 7d9dea916f2..1b097c806e4 100644 --- a/src/cloudflare/resources/zero_trust/dlp/profiles/profiles.py +++ b/src/cloudflare/resources/zero_trust/dlp/profiles/profiles.py @@ -37,7 +37,7 @@ AsyncPaginator, make_request_options, ) -from .....types.zero_trust.dlp import DLPProfile, ProfileGetResponse +from .....types.zero_trust.dlp import Profile, ProfileGetResponse __all__ = ["Profiles", "AsyncProfiles"] @@ -69,7 +69,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[DLPProfile]: + ) -> SyncSinglePage[Profile]: """ Lists all DLP profiles in an account. @@ -88,11 +88,11 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/dlp/profiles", - page=SyncSinglePage[DLPProfile], + page=SyncSinglePage[Profile], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=cast(Any, DLPProfile), # Union types cannot be passed in as arguments in the type system + model=cast(Any, Profile), # Union types cannot be passed in as arguments in the type system ) def get( @@ -173,7 +173,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[DLPProfile, AsyncSinglePage[DLPProfile]]: + ) -> AsyncPaginator[Profile, AsyncSinglePage[Profile]]: """ Lists all DLP profiles in an account. @@ -192,11 +192,11 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/dlp/profiles", - page=AsyncSinglePage[DLPProfile], + page=AsyncSinglePage[Profile], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=cast(Any, DLPProfile), # Union types cannot be passed in as arguments in the type system + model=cast(Any, Profile), # Union types cannot be passed in as arguments in the type system ) async def get( diff --git a/src/cloudflare/resources/zero_trust/gateway/app_types.py b/src/cloudflare/resources/zero_trust/gateway/app_types.py index c7b75140620..890582a30dd 100644 --- a/src/cloudflare/resources/zero_trust/gateway/app_types.py +++ b/src/cloudflare/resources/zero_trust/gateway/app_types.py @@ -20,7 +20,7 @@ AsyncPaginator, make_request_options, ) -from ....types.zero_trust.gateway import ZeroTrustGatewayAppTypes +from ....types.zero_trust.gateway import AppType __all__ = ["AppTypes", "AsyncAppTypes"] @@ -44,7 +44,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[ZeroTrustGatewayAppTypes]: + ) -> SyncSinglePage[AppType]: """ Fetches all application and application type mappings. @@ -63,13 +63,11 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/gateway/app_types", - page=SyncSinglePage[ZeroTrustGatewayAppTypes], + page=SyncSinglePage[AppType], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=cast( - Any, ZeroTrustGatewayAppTypes - ), # Union types cannot be passed in as arguments in the type system + model=cast(Any, AppType), # Union types cannot be passed in as arguments in the type system ) @@ -92,7 +90,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[ZeroTrustGatewayAppTypes, AsyncSinglePage[ZeroTrustGatewayAppTypes]]: + ) -> AsyncPaginator[AppType, AsyncSinglePage[AppType]]: """ Fetches all application and application type mappings. @@ -111,13 +109,11 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/gateway/app_types", - page=AsyncSinglePage[ZeroTrustGatewayAppTypes], + page=AsyncSinglePage[AppType], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=cast( - Any, ZeroTrustGatewayAppTypes - ), # Union types cannot be passed in as arguments in the type system + model=cast(Any, AppType), # Union types cannot be passed in as arguments in the type system ) diff --git a/src/cloudflare/resources/zero_trust/gateway/audit_ssh_settings.py b/src/cloudflare/resources/zero_trust/gateway/audit_ssh_settings.py index 281c53afc38..2114b496244 100644 --- a/src/cloudflare/resources/zero_trust/gateway/audit_ssh_settings.py +++ b/src/cloudflare/resources/zero_trust/gateway/audit_ssh_settings.py @@ -23,7 +23,7 @@ from ...._base_client import ( make_request_options, ) -from ....types.zero_trust.gateway import ZeroTrustGatewaySettings, audit_ssh_setting_update_params +from ....types.zero_trust.gateway import GatewaySettings, audit_ssh_setting_update_params __all__ = ["AuditSSHSettings", "AsyncAuditSSHSettings"] @@ -49,7 +49,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustGatewaySettings: + ) -> GatewaySettings: """ Updates Zero Trust Audit SSH settings. @@ -84,7 +84,7 @@ def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ZeroTrustGatewaySettings], ResultWrapper[ZeroTrustGatewaySettings]), + cast_to=cast(Type[GatewaySettings], ResultWrapper[GatewaySettings]), ) def get( @@ -97,7 +97,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustGatewaySettings: + ) -> GatewaySettings: """ Get all Zero Trust Audit SSH settings for an account. @@ -121,7 +121,7 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ZeroTrustGatewaySettings], ResultWrapper[ZeroTrustGatewaySettings]), + cast_to=cast(Type[GatewaySettings], ResultWrapper[GatewaySettings]), ) @@ -146,7 +146,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustGatewaySettings: + ) -> GatewaySettings: """ Updates Zero Trust Audit SSH settings. @@ -181,7 +181,7 @@ async def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ZeroTrustGatewaySettings], ResultWrapper[ZeroTrustGatewaySettings]), + cast_to=cast(Type[GatewaySettings], ResultWrapper[GatewaySettings]), ) async def get( @@ -194,7 +194,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustGatewaySettings: + ) -> GatewaySettings: """ Get all Zero Trust Audit SSH settings for an account. @@ -218,7 +218,7 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ZeroTrustGatewaySettings], ResultWrapper[ZeroTrustGatewaySettings]), + cast_to=cast(Type[GatewaySettings], ResultWrapper[GatewaySettings]), ) diff --git a/src/cloudflare/resources/zero_trust/gateway/categories.py b/src/cloudflare/resources/zero_trust/gateway/categories.py index 430e44ef82f..d76bcc4f71b 100644 --- a/src/cloudflare/resources/zero_trust/gateway/categories.py +++ b/src/cloudflare/resources/zero_trust/gateway/categories.py @@ -18,7 +18,7 @@ AsyncPaginator, make_request_options, ) -from ....types.zero_trust.gateway import ZeroTrustGatewayCategories +from ....types.zero_trust.gateway import Category __all__ = ["Categories", "AsyncCategories"] @@ -42,7 +42,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[ZeroTrustGatewayCategories]: + ) -> SyncSinglePage[Category]: """ Fetches a list of all categories. @@ -61,11 +61,11 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/gateway/categories", - page=SyncSinglePage[ZeroTrustGatewayCategories], + page=SyncSinglePage[Category], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=ZeroTrustGatewayCategories, + model=Category, ) @@ -88,7 +88,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[ZeroTrustGatewayCategories, AsyncSinglePage[ZeroTrustGatewayCategories]]: + ) -> AsyncPaginator[Category, AsyncSinglePage[Category]]: """ Fetches a list of all categories. @@ -107,11 +107,11 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/gateway/categories", - page=AsyncSinglePage[ZeroTrustGatewayCategories], + page=AsyncSinglePage[Category], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=ZeroTrustGatewayCategories, + model=Category, ) diff --git a/src/cloudflare/resources/zero_trust/gateway/lists/lists.py b/src/cloudflare/resources/zero_trust/gateway/lists/lists.py index d2244e658f6..22937f9f47b 100644 --- a/src/cloudflare/resources/zero_trust/gateway/lists/lists.py +++ b/src/cloudflare/resources/zero_trust/gateway/lists/lists.py @@ -37,12 +37,13 @@ from .....types.shared import UnnamedSchemaRef9444735ca60712dbcf8afd832eb5716a from .....types.zero_trust.gateway import ( ListCreateResponse, - ZeroTrustGatewayLists, + lists, list_edit_params, list_create_params, list_delete_params, list_update_params, ) +from .....types.zero_trust.gateway.lists import ListsItemParam __all__ = ["Lists", "AsyncLists"] @@ -67,7 +68,7 @@ def create( name: str, type: Literal["SERIAL", "URL", "DOMAIN", "EMAIL", "IP"], description: str | NotGiven = NOT_GIVEN, - items: Iterable[list_create_params.Item] | NotGiven = NOT_GIVEN, + items: Iterable[ListsItemParam] | 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, @@ -131,7 +132,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustGatewayLists: + ) -> lists.Lists: """ Updates a configured Zero Trust list. @@ -170,7 +171,7 @@ def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ZeroTrustGatewayLists], ResultWrapper[ZeroTrustGatewayLists]), + cast_to=cast(Type[lists.Lists], ResultWrapper[lists.Lists]), ) def list( @@ -183,7 +184,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[ZeroTrustGatewayLists]: + ) -> SyncSinglePage[lists.Lists]: """ Fetches all Zero Trust lists for an account. @@ -200,11 +201,11 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/gateway/lists", - page=SyncSinglePage[ZeroTrustGatewayLists], + page=SyncSinglePage[lists.Lists], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=ZeroTrustGatewayLists, + model=lists.Lists, ) def delete( @@ -261,7 +262,7 @@ def edit( list_id: str, *, account_id: str, - append: Iterable[list_edit_params.Append] | NotGiven = NOT_GIVEN, + append: Iterable[ListsItemParam] | NotGiven = NOT_GIVEN, remove: List[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. @@ -269,7 +270,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustGatewayLists: + ) -> lists.Lists: """ Appends or removes an item from a configured Zero Trust list. @@ -308,7 +309,7 @@ def edit( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ZeroTrustGatewayLists], ResultWrapper[ZeroTrustGatewayLists]), + cast_to=cast(Type[lists.Lists], ResultWrapper[lists.Lists]), ) def get( @@ -322,7 +323,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustGatewayLists: + ) -> lists.Lists: """ Fetches a single Zero Trust list. @@ -350,7 +351,7 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ZeroTrustGatewayLists], ResultWrapper[ZeroTrustGatewayLists]), + cast_to=cast(Type[lists.Lists], ResultWrapper[lists.Lists]), ) @@ -374,7 +375,7 @@ async def create( name: str, type: Literal["SERIAL", "URL", "DOMAIN", "EMAIL", "IP"], description: str | NotGiven = NOT_GIVEN, - items: Iterable[list_create_params.Item] | NotGiven = NOT_GIVEN, + items: Iterable[ListsItemParam] | 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, @@ -438,7 +439,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustGatewayLists: + ) -> lists.Lists: """ Updates a configured Zero Trust list. @@ -477,7 +478,7 @@ async def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ZeroTrustGatewayLists], ResultWrapper[ZeroTrustGatewayLists]), + cast_to=cast(Type[lists.Lists], ResultWrapper[lists.Lists]), ) def list( @@ -490,7 +491,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[ZeroTrustGatewayLists, AsyncSinglePage[ZeroTrustGatewayLists]]: + ) -> AsyncPaginator[lists.Lists, AsyncSinglePage[lists.Lists]]: """ Fetches all Zero Trust lists for an account. @@ -507,11 +508,11 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/gateway/lists", - page=AsyncSinglePage[ZeroTrustGatewayLists], + page=AsyncSinglePage[lists.Lists], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=ZeroTrustGatewayLists, + model=lists.Lists, ) async def delete( @@ -568,7 +569,7 @@ async def edit( list_id: str, *, account_id: str, - append: Iterable[list_edit_params.Append] | NotGiven = NOT_GIVEN, + append: Iterable[ListsItemParam] | NotGiven = NOT_GIVEN, remove: List[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. @@ -576,7 +577,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustGatewayLists: + ) -> lists.Lists: """ Appends or removes an item from a configured Zero Trust list. @@ -615,7 +616,7 @@ async def edit( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ZeroTrustGatewayLists], ResultWrapper[ZeroTrustGatewayLists]), + cast_to=cast(Type[lists.Lists], ResultWrapper[lists.Lists]), ) async def get( @@ -629,7 +630,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustGatewayLists: + ) -> lists.Lists: """ Fetches a single Zero Trust list. @@ -657,7 +658,7 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ZeroTrustGatewayLists], ResultWrapper[ZeroTrustGatewayLists]), + cast_to=cast(Type[lists.Lists], ResultWrapper[lists.Lists]), ) diff --git a/src/cloudflare/resources/zero_trust/gateway/locations.py b/src/cloudflare/resources/zero_trust/gateway/locations.py index 546815b3fa0..2b37346c366 100644 --- a/src/cloudflare/resources/zero_trust/gateway/locations.py +++ b/src/cloudflare/resources/zero_trust/gateway/locations.py @@ -27,8 +27,8 @@ ) from ....types.shared import UnnamedSchemaRef9444735ca60712dbcf8afd832eb5716a from ....types.zero_trust.gateway import ( - NetworkItemParam, - locations, + Location, + LocationNetworkParam, location_create_params, location_delete_params, location_update_params, @@ -53,14 +53,14 @@ def create( name: str, client_default: bool | NotGiven = NOT_GIVEN, ecs_support: bool | NotGiven = NOT_GIVEN, - networks: Iterable[NetworkItemParam] | NotGiven = NOT_GIVEN, + networks: Iterable[LocationNetworkParam] | 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, - ) -> locations.Locations: + ) -> Location: """ Creates a new Zero Trust Gateway location. @@ -101,7 +101,7 @@ def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[locations.Locations], ResultWrapper[locations.Locations]), + cast_to=cast(Type[Location], ResultWrapper[Location]), ) def update( @@ -112,14 +112,14 @@ def update( name: str, client_default: bool | NotGiven = NOT_GIVEN, ecs_support: bool | NotGiven = NOT_GIVEN, - networks: Iterable[NetworkItemParam] | NotGiven = NOT_GIVEN, + networks: Iterable[LocationNetworkParam] | 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, - ) -> locations.Locations: + ) -> Location: """ Updates a configured Zero Trust Gateway location. @@ -162,7 +162,7 @@ def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[locations.Locations], ResultWrapper[locations.Locations]), + cast_to=cast(Type[Location], ResultWrapper[Location]), ) def list( @@ -175,7 +175,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[locations.Locations]: + ) -> SyncSinglePage[Location]: """ Fetches Zero Trust Gateway locations for an account. @@ -192,11 +192,11 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/gateway/locations", - page=SyncSinglePage[locations.Locations], + page=SyncSinglePage[Location], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=locations.Locations, + model=Location, ) def delete( @@ -257,7 +257,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> locations.Locations: + ) -> Location: """ Fetches a single Zero Trust Gateway location. @@ -283,7 +283,7 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[locations.Locations], ResultWrapper[locations.Locations]), + cast_to=cast(Type[Location], ResultWrapper[Location]), ) @@ -303,14 +303,14 @@ async def create( name: str, client_default: bool | NotGiven = NOT_GIVEN, ecs_support: bool | NotGiven = NOT_GIVEN, - networks: Iterable[NetworkItemParam] | NotGiven = NOT_GIVEN, + networks: Iterable[LocationNetworkParam] | 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, - ) -> locations.Locations: + ) -> Location: """ Creates a new Zero Trust Gateway location. @@ -351,7 +351,7 @@ async def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[locations.Locations], ResultWrapper[locations.Locations]), + cast_to=cast(Type[Location], ResultWrapper[Location]), ) async def update( @@ -362,14 +362,14 @@ async def update( name: str, client_default: bool | NotGiven = NOT_GIVEN, ecs_support: bool | NotGiven = NOT_GIVEN, - networks: Iterable[NetworkItemParam] | NotGiven = NOT_GIVEN, + networks: Iterable[LocationNetworkParam] | 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, - ) -> locations.Locations: + ) -> Location: """ Updates a configured Zero Trust Gateway location. @@ -412,7 +412,7 @@ async def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[locations.Locations], ResultWrapper[locations.Locations]), + cast_to=cast(Type[Location], ResultWrapper[Location]), ) def list( @@ -425,7 +425,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[locations.Locations, AsyncSinglePage[locations.Locations]]: + ) -> AsyncPaginator[Location, AsyncSinglePage[Location]]: """ Fetches Zero Trust Gateway locations for an account. @@ -442,11 +442,11 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/gateway/locations", - page=AsyncSinglePage[locations.Locations], + page=AsyncSinglePage[Location], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=locations.Locations, + model=Location, ) async def delete( @@ -507,7 +507,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> locations.Locations: + ) -> Location: """ Fetches a single Zero Trust Gateway location. @@ -533,7 +533,7 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[locations.Locations], ResultWrapper[locations.Locations]), + cast_to=cast(Type[Location], ResultWrapper[Location]), ) diff --git a/src/cloudflare/resources/zero_trust/gateway/logging.py b/src/cloudflare/resources/zero_trust/gateway/logging.py index ec484fe73a8..e64fdcc6852 100644 --- a/src/cloudflare/resources/zero_trust/gateway/logging.py +++ b/src/cloudflare/resources/zero_trust/gateway/logging.py @@ -24,7 +24,7 @@ make_request_options, ) from ....types.zero_trust.gateway import ( - ZeroTrustGatewayGatewayAccountLoggingSettings, + LoggingSetting, UnnamedSchemaRefE86eeb84b7e922c35cfb0031a6309f7bParam, logging_update_params, ) @@ -53,7 +53,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustGatewayGatewayAccountLoggingSettings: + ) -> LoggingSetting: """ Updates logging settings for the current Zero Trust account. @@ -89,10 +89,7 @@ def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast( - Type[ZeroTrustGatewayGatewayAccountLoggingSettings], - ResultWrapper[ZeroTrustGatewayGatewayAccountLoggingSettings], - ), + cast_to=cast(Type[LoggingSetting], ResultWrapper[LoggingSetting]), ) def get( @@ -105,7 +102,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustGatewayGatewayAccountLoggingSettings: + ) -> LoggingSetting: """ Fetches the current logging settings for Zero Trust account. @@ -129,10 +126,7 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast( - Type[ZeroTrustGatewayGatewayAccountLoggingSettings], - ResultWrapper[ZeroTrustGatewayGatewayAccountLoggingSettings], - ), + cast_to=cast(Type[LoggingSetting], ResultWrapper[LoggingSetting]), ) @@ -157,7 +151,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustGatewayGatewayAccountLoggingSettings: + ) -> LoggingSetting: """ Updates logging settings for the current Zero Trust account. @@ -193,10 +187,7 @@ async def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast( - Type[ZeroTrustGatewayGatewayAccountLoggingSettings], - ResultWrapper[ZeroTrustGatewayGatewayAccountLoggingSettings], - ), + cast_to=cast(Type[LoggingSetting], ResultWrapper[LoggingSetting]), ) async def get( @@ -209,7 +200,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustGatewayGatewayAccountLoggingSettings: + ) -> LoggingSetting: """ Fetches the current logging settings for Zero Trust account. @@ -233,10 +224,7 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast( - Type[ZeroTrustGatewayGatewayAccountLoggingSettings], - ResultWrapper[ZeroTrustGatewayGatewayAccountLoggingSettings], - ), + cast_to=cast(Type[LoggingSetting], ResultWrapper[LoggingSetting]), ) diff --git a/src/cloudflare/resources/zero_trust/gateway/proxy_endpoints.py b/src/cloudflare/resources/zero_trust/gateway/proxy_endpoints.py index 63b5de15080..6eccf082188 100644 --- a/src/cloudflare/resources/zero_trust/gateway/proxy_endpoints.py +++ b/src/cloudflare/resources/zero_trust/gateway/proxy_endpoints.py @@ -27,8 +27,8 @@ ) from ....types.shared import UnnamedSchemaRef9444735ca60712dbcf8afd832eb5716a from ....types.zero_trust.gateway import ( + ProxyEndpoint, GatewayIPsItem, - ZeroTrustGatewayProxyEndpoints, proxy_endpoint_edit_params, proxy_endpoint_create_params, proxy_endpoint_delete_params, @@ -58,7 +58,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustGatewayProxyEndpoints: + ) -> ProxyEndpoint: """ Creates a new Zero Trust Gateway proxy endpoint. @@ -93,7 +93,7 @@ def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ZeroTrustGatewayProxyEndpoints], ResultWrapper[ZeroTrustGatewayProxyEndpoints]), + cast_to=cast(Type[ProxyEndpoint], ResultWrapper[ProxyEndpoint]), ) def list( @@ -106,7 +106,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[ZeroTrustGatewayProxyEndpoints]: + ) -> SyncSinglePage[ProxyEndpoint]: """ Fetches a single Zero Trust Gateway proxy endpoint. @@ -123,11 +123,11 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/gateway/proxy_endpoints", - page=SyncSinglePage[ZeroTrustGatewayProxyEndpoints], + page=SyncSinglePage[ProxyEndpoint], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=ZeroTrustGatewayProxyEndpoints, + model=ProxyEndpoint, ) def delete( @@ -190,7 +190,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustGatewayProxyEndpoints: + ) -> ProxyEndpoint: """ Updates a configured Zero Trust Gateway proxy endpoint. @@ -227,7 +227,7 @@ def edit( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ZeroTrustGatewayProxyEndpoints], ResultWrapper[ZeroTrustGatewayProxyEndpoints]), + cast_to=cast(Type[ProxyEndpoint], ResultWrapper[ProxyEndpoint]), ) def get( @@ -241,7 +241,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustGatewayProxyEndpoints: + ) -> ProxyEndpoint: """ Fetches all Zero Trust Gateway proxy endpoints for an account. @@ -267,7 +267,7 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ZeroTrustGatewayProxyEndpoints], ResultWrapper[ZeroTrustGatewayProxyEndpoints]), + cast_to=cast(Type[ProxyEndpoint], ResultWrapper[ProxyEndpoint]), ) @@ -292,7 +292,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustGatewayProxyEndpoints: + ) -> ProxyEndpoint: """ Creates a new Zero Trust Gateway proxy endpoint. @@ -327,7 +327,7 @@ async def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ZeroTrustGatewayProxyEndpoints], ResultWrapper[ZeroTrustGatewayProxyEndpoints]), + cast_to=cast(Type[ProxyEndpoint], ResultWrapper[ProxyEndpoint]), ) def list( @@ -340,7 +340,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[ZeroTrustGatewayProxyEndpoints, AsyncSinglePage[ZeroTrustGatewayProxyEndpoints]]: + ) -> AsyncPaginator[ProxyEndpoint, AsyncSinglePage[ProxyEndpoint]]: """ Fetches a single Zero Trust Gateway proxy endpoint. @@ -357,11 +357,11 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/gateway/proxy_endpoints", - page=AsyncSinglePage[ZeroTrustGatewayProxyEndpoints], + page=AsyncSinglePage[ProxyEndpoint], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=ZeroTrustGatewayProxyEndpoints, + model=ProxyEndpoint, ) async def delete( @@ -424,7 +424,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustGatewayProxyEndpoints: + ) -> ProxyEndpoint: """ Updates a configured Zero Trust Gateway proxy endpoint. @@ -461,7 +461,7 @@ async def edit( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ZeroTrustGatewayProxyEndpoints], ResultWrapper[ZeroTrustGatewayProxyEndpoints]), + cast_to=cast(Type[ProxyEndpoint], ResultWrapper[ProxyEndpoint]), ) async def get( @@ -475,7 +475,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustGatewayProxyEndpoints: + ) -> ProxyEndpoint: """ Fetches all Zero Trust Gateway proxy endpoints for an account. @@ -501,7 +501,7 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ZeroTrustGatewayProxyEndpoints], ResultWrapper[ZeroTrustGatewayProxyEndpoints]), + cast_to=cast(Type[ProxyEndpoint], ResultWrapper[ProxyEndpoint]), ) diff --git a/src/cloudflare/resources/zero_trust/gateway/rules.py b/src/cloudflare/resources/zero_trust/gateway/rules.py index 5f5f05573b0..438db292820 100644 --- a/src/cloudflare/resources/zero_trust/gateway/rules.py +++ b/src/cloudflare/resources/zero_trust/gateway/rules.py @@ -28,10 +28,10 @@ ) from ....types.shared import UnnamedSchemaRef9444735ca60712dbcf8afd832eb5716a from ....types.zero_trust.gateway import ( - FitlerItem, + Rule, + GatewayFilter, ScheduleParam, - RuleSettingsParam, - ZeroTrustGatewayRules, + RuleSettingParam, rule_create_params, rule_delete_params, rule_update_params, @@ -74,10 +74,10 @@ def create( description: str | NotGiven = NOT_GIVEN, device_posture: str | NotGiven = NOT_GIVEN, enabled: bool | NotGiven = NOT_GIVEN, - filters: List[FitlerItem] | NotGiven = NOT_GIVEN, + filters: List[GatewayFilter] | NotGiven = NOT_GIVEN, identity: str | NotGiven = NOT_GIVEN, precedence: int | NotGiven = NOT_GIVEN, - rule_settings: RuleSettingsParam | NotGiven = NOT_GIVEN, + rule_settings: RuleSettingParam | NotGiven = NOT_GIVEN, schedule: ScheduleParam | NotGiven = NOT_GIVEN, traffic: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -86,7 +86,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustGatewayRules: + ) -> Rule: """ Creates a new Zero Trust Gateway rule. @@ -153,7 +153,7 @@ def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ZeroTrustGatewayRules], ResultWrapper[ZeroTrustGatewayRules]), + cast_to=cast(Type[Rule], ResultWrapper[Rule]), ) def update( @@ -182,10 +182,10 @@ def update( description: str | NotGiven = NOT_GIVEN, device_posture: str | NotGiven = NOT_GIVEN, enabled: bool | NotGiven = NOT_GIVEN, - filters: List[FitlerItem] | NotGiven = NOT_GIVEN, + filters: List[GatewayFilter] | NotGiven = NOT_GIVEN, identity: str | NotGiven = NOT_GIVEN, precedence: int | NotGiven = NOT_GIVEN, - rule_settings: RuleSettingsParam | NotGiven = NOT_GIVEN, + rule_settings: RuleSettingParam | NotGiven = NOT_GIVEN, schedule: ScheduleParam | NotGiven = NOT_GIVEN, traffic: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -194,7 +194,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustGatewayRules: + ) -> Rule: """ Updates a configured Zero Trust Gateway rule. @@ -265,7 +265,7 @@ def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ZeroTrustGatewayRules], ResultWrapper[ZeroTrustGatewayRules]), + cast_to=cast(Type[Rule], ResultWrapper[Rule]), ) def list( @@ -278,7 +278,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[ZeroTrustGatewayRules]: + ) -> SyncSinglePage[Rule]: """ Fetches the Zero Trust Gateway rules for an account. @@ -295,11 +295,11 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/gateway/rules", - page=SyncSinglePage[ZeroTrustGatewayRules], + page=SyncSinglePage[Rule], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=ZeroTrustGatewayRules, + model=Rule, ) def delete( @@ -362,7 +362,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustGatewayRules: + ) -> Rule: """ Fetches a single Zero Trust Gateway rule. @@ -390,7 +390,7 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ZeroTrustGatewayRules], ResultWrapper[ZeroTrustGatewayRules]), + cast_to=cast(Type[Rule], ResultWrapper[Rule]), ) @@ -428,10 +428,10 @@ async def create( description: str | NotGiven = NOT_GIVEN, device_posture: str | NotGiven = NOT_GIVEN, enabled: bool | NotGiven = NOT_GIVEN, - filters: List[FitlerItem] | NotGiven = NOT_GIVEN, + filters: List[GatewayFilter] | NotGiven = NOT_GIVEN, identity: str | NotGiven = NOT_GIVEN, precedence: int | NotGiven = NOT_GIVEN, - rule_settings: RuleSettingsParam | NotGiven = NOT_GIVEN, + rule_settings: RuleSettingParam | NotGiven = NOT_GIVEN, schedule: ScheduleParam | NotGiven = NOT_GIVEN, traffic: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -440,7 +440,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustGatewayRules: + ) -> Rule: """ Creates a new Zero Trust Gateway rule. @@ -507,7 +507,7 @@ async def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ZeroTrustGatewayRules], ResultWrapper[ZeroTrustGatewayRules]), + cast_to=cast(Type[Rule], ResultWrapper[Rule]), ) async def update( @@ -536,10 +536,10 @@ async def update( description: str | NotGiven = NOT_GIVEN, device_posture: str | NotGiven = NOT_GIVEN, enabled: bool | NotGiven = NOT_GIVEN, - filters: List[FitlerItem] | NotGiven = NOT_GIVEN, + filters: List[GatewayFilter] | NotGiven = NOT_GIVEN, identity: str | NotGiven = NOT_GIVEN, precedence: int | NotGiven = NOT_GIVEN, - rule_settings: RuleSettingsParam | NotGiven = NOT_GIVEN, + rule_settings: RuleSettingParam | NotGiven = NOT_GIVEN, schedule: ScheduleParam | NotGiven = NOT_GIVEN, traffic: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -548,7 +548,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustGatewayRules: + ) -> Rule: """ Updates a configured Zero Trust Gateway rule. @@ -619,7 +619,7 @@ async def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ZeroTrustGatewayRules], ResultWrapper[ZeroTrustGatewayRules]), + cast_to=cast(Type[Rule], ResultWrapper[Rule]), ) def list( @@ -632,7 +632,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[ZeroTrustGatewayRules, AsyncSinglePage[ZeroTrustGatewayRules]]: + ) -> AsyncPaginator[Rule, AsyncSinglePage[Rule]]: """ Fetches the Zero Trust Gateway rules for an account. @@ -649,11 +649,11 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/gateway/rules", - page=AsyncSinglePage[ZeroTrustGatewayRules], + page=AsyncSinglePage[Rule], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=ZeroTrustGatewayRules, + model=Rule, ) async def delete( @@ -716,7 +716,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustGatewayRules: + ) -> Rule: """ Fetches a single Zero Trust Gateway rule. @@ -744,7 +744,7 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ZeroTrustGatewayRules], ResultWrapper[ZeroTrustGatewayRules]), + cast_to=cast(Type[Rule], ResultWrapper[Rule]), ) diff --git a/src/cloudflare/resources/zero_trust/identity_providers.py b/src/cloudflare/resources/zero_trust/identity_providers.py index b6eb7f37575..b2c7b20c9c8 100644 --- a/src/cloudflare/resources/zero_trust/identity_providers.py +++ b/src/cloudflare/resources/zero_trust/identity_providers.py @@ -27,8 +27,8 @@ make_request_options, ) from ...types.zero_trust import ( + IdentityProvider, GenericOAuthConfigParam, - ZeroTrustIdentityProviders, IdentityProviderListResponse, IdentityProviderDeleteResponse, UnnamedSchemaRef9ab84e842cdf571c8f3898648bcdabcb, @@ -65,7 +65,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustIdentityProviders: + ) -> IdentityProvider: """ Adds a new identity provider to Access. @@ -113,7 +113,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustIdentityProviders: + ) -> IdentityProvider: """ Adds a new identity provider to Access. @@ -161,7 +161,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustIdentityProviders: + ) -> IdentityProvider: """ Adds a new identity provider to Access. @@ -209,7 +209,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustIdentityProviders: + ) -> IdentityProvider: """ Adds a new identity provider to Access. @@ -257,7 +257,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustIdentityProviders: + ) -> IdentityProvider: """ Adds a new identity provider to Access. @@ -305,7 +305,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustIdentityProviders: + ) -> IdentityProvider: """ Adds a new identity provider to Access. @@ -353,7 +353,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustIdentityProviders: + ) -> IdentityProvider: """ Adds a new identity provider to Access. @@ -401,7 +401,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustIdentityProviders: + ) -> IdentityProvider: """ Adds a new identity provider to Access. @@ -449,7 +449,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustIdentityProviders: + ) -> IdentityProvider: """ Adds a new identity provider to Access. @@ -497,7 +497,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustIdentityProviders: + ) -> IdentityProvider: """ Adds a new identity provider to Access. @@ -545,7 +545,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustIdentityProviders: + ) -> IdentityProvider: """ Adds a new identity provider to Access. @@ -593,7 +593,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustIdentityProviders: + ) -> IdentityProvider: """ Adds a new identity provider to Access. @@ -641,7 +641,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustIdentityProviders: + ) -> IdentityProvider: """ Adds a new identity provider to Access. @@ -689,7 +689,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustIdentityProviders: + ) -> IdentityProvider: """ Adds a new identity provider to Access. @@ -762,7 +762,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustIdentityProviders: + ) -> IdentityProvider: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not zone_id: @@ -779,7 +779,7 @@ def create( account_or_zone = "zones" account_or_zone_id = zone_id return cast( - ZeroTrustIdentityProviders, + IdentityProvider, self._post( f"/{account_or_zone}/{account_or_zone_id}/access/identity_providers", body=maybe_transform( @@ -799,7 +799,7 @@ def create( post_parser=ResultWrapper._unwrapper, ), cast_to=cast( - Any, ResultWrapper[ZeroTrustIdentityProviders] + Any, ResultWrapper[IdentityProvider] ), # Union types cannot be passed in as arguments in the type system ), ) @@ -821,7 +821,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustIdentityProviders: + ) -> IdentityProvider: """ Updates a configured identity provider. @@ -872,7 +872,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustIdentityProviders: + ) -> IdentityProvider: """ Updates a configured identity provider. @@ -923,7 +923,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustIdentityProviders: + ) -> IdentityProvider: """ Updates a configured identity provider. @@ -974,7 +974,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustIdentityProviders: + ) -> IdentityProvider: """ Updates a configured identity provider. @@ -1025,7 +1025,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustIdentityProviders: + ) -> IdentityProvider: """ Updates a configured identity provider. @@ -1076,7 +1076,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustIdentityProviders: + ) -> IdentityProvider: """ Updates a configured identity provider. @@ -1127,7 +1127,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustIdentityProviders: + ) -> IdentityProvider: """ Updates a configured identity provider. @@ -1178,7 +1178,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustIdentityProviders: + ) -> IdentityProvider: """ Updates a configured identity provider. @@ -1229,7 +1229,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustIdentityProviders: + ) -> IdentityProvider: """ Updates a configured identity provider. @@ -1280,7 +1280,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustIdentityProviders: + ) -> IdentityProvider: """ Updates a configured identity provider. @@ -1331,7 +1331,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustIdentityProviders: + ) -> IdentityProvider: """ Updates a configured identity provider. @@ -1382,7 +1382,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustIdentityProviders: + ) -> IdentityProvider: """ Updates a configured identity provider. @@ -1433,7 +1433,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustIdentityProviders: + ) -> IdentityProvider: """ Updates a configured identity provider. @@ -1484,7 +1484,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustIdentityProviders: + ) -> IdentityProvider: """ Updates a configured identity provider. @@ -1560,7 +1560,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustIdentityProviders: + ) -> IdentityProvider: if not uuid: raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}") if not account_id: @@ -1579,7 +1579,7 @@ def update( account_or_zone = "zones" account_or_zone_id = zone_id return cast( - ZeroTrustIdentityProviders, + IdentityProvider, self._put( f"/{account_or_zone}/{account_or_zone_id}/access/identity_providers/{uuid}", body=maybe_transform( @@ -1599,7 +1599,7 @@ def update( post_parser=ResultWrapper._unwrapper, ), cast_to=cast( - Any, ResultWrapper[ZeroTrustIdentityProviders] + Any, ResultWrapper[IdentityProvider] ), # Union types cannot be passed in as arguments in the type system ), ) @@ -1730,7 +1730,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustIdentityProviders: + ) -> IdentityProvider: """ Fetches a configured identity provider. @@ -1767,7 +1767,7 @@ def get( account_or_zone = "zones" account_or_zone_id = zone_id return cast( - ZeroTrustIdentityProviders, + IdentityProvider, self._get( f"/{account_or_zone}/{account_or_zone_id}/access/identity_providers/{uuid}", options=make_request_options( @@ -1778,7 +1778,7 @@ def get( post_parser=ResultWrapper._unwrapper, ), cast_to=cast( - Any, ResultWrapper[ZeroTrustIdentityProviders] + Any, ResultWrapper[IdentityProvider] ), # Union types cannot be passed in as arguments in the type system ), ) @@ -1809,7 +1809,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustIdentityProviders: + ) -> IdentityProvider: """ Adds a new identity provider to Access. @@ -1857,7 +1857,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustIdentityProviders: + ) -> IdentityProvider: """ Adds a new identity provider to Access. @@ -1905,7 +1905,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustIdentityProviders: + ) -> IdentityProvider: """ Adds a new identity provider to Access. @@ -1953,7 +1953,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustIdentityProviders: + ) -> IdentityProvider: """ Adds a new identity provider to Access. @@ -2001,7 +2001,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustIdentityProviders: + ) -> IdentityProvider: """ Adds a new identity provider to Access. @@ -2049,7 +2049,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustIdentityProviders: + ) -> IdentityProvider: """ Adds a new identity provider to Access. @@ -2097,7 +2097,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustIdentityProviders: + ) -> IdentityProvider: """ Adds a new identity provider to Access. @@ -2145,7 +2145,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustIdentityProviders: + ) -> IdentityProvider: """ Adds a new identity provider to Access. @@ -2193,7 +2193,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustIdentityProviders: + ) -> IdentityProvider: """ Adds a new identity provider to Access. @@ -2241,7 +2241,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustIdentityProviders: + ) -> IdentityProvider: """ Adds a new identity provider to Access. @@ -2289,7 +2289,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustIdentityProviders: + ) -> IdentityProvider: """ Adds a new identity provider to Access. @@ -2337,7 +2337,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustIdentityProviders: + ) -> IdentityProvider: """ Adds a new identity provider to Access. @@ -2385,7 +2385,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustIdentityProviders: + ) -> IdentityProvider: """ Adds a new identity provider to Access. @@ -2433,7 +2433,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustIdentityProviders: + ) -> IdentityProvider: """ Adds a new identity provider to Access. @@ -2506,7 +2506,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustIdentityProviders: + ) -> IdentityProvider: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not zone_id: @@ -2523,7 +2523,7 @@ async def create( account_or_zone = "zones" account_or_zone_id = zone_id return cast( - ZeroTrustIdentityProviders, + IdentityProvider, await self._post( f"/{account_or_zone}/{account_or_zone_id}/access/identity_providers", body=await async_maybe_transform( @@ -2543,7 +2543,7 @@ async def create( post_parser=ResultWrapper._unwrapper, ), cast_to=cast( - Any, ResultWrapper[ZeroTrustIdentityProviders] + Any, ResultWrapper[IdentityProvider] ), # Union types cannot be passed in as arguments in the type system ), ) @@ -2565,7 +2565,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustIdentityProviders: + ) -> IdentityProvider: """ Updates a configured identity provider. @@ -2616,7 +2616,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustIdentityProviders: + ) -> IdentityProvider: """ Updates a configured identity provider. @@ -2667,7 +2667,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustIdentityProviders: + ) -> IdentityProvider: """ Updates a configured identity provider. @@ -2718,7 +2718,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustIdentityProviders: + ) -> IdentityProvider: """ Updates a configured identity provider. @@ -2769,7 +2769,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustIdentityProviders: + ) -> IdentityProvider: """ Updates a configured identity provider. @@ -2820,7 +2820,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustIdentityProviders: + ) -> IdentityProvider: """ Updates a configured identity provider. @@ -2871,7 +2871,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustIdentityProviders: + ) -> IdentityProvider: """ Updates a configured identity provider. @@ -2922,7 +2922,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustIdentityProviders: + ) -> IdentityProvider: """ Updates a configured identity provider. @@ -2973,7 +2973,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustIdentityProviders: + ) -> IdentityProvider: """ Updates a configured identity provider. @@ -3024,7 +3024,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustIdentityProviders: + ) -> IdentityProvider: """ Updates a configured identity provider. @@ -3075,7 +3075,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustIdentityProviders: + ) -> IdentityProvider: """ Updates a configured identity provider. @@ -3126,7 +3126,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustIdentityProviders: + ) -> IdentityProvider: """ Updates a configured identity provider. @@ -3177,7 +3177,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustIdentityProviders: + ) -> IdentityProvider: """ Updates a configured identity provider. @@ -3228,7 +3228,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustIdentityProviders: + ) -> IdentityProvider: """ Updates a configured identity provider. @@ -3304,7 +3304,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustIdentityProviders: + ) -> IdentityProvider: if not uuid: raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}") if not account_id: @@ -3323,7 +3323,7 @@ async def update( account_or_zone = "zones" account_or_zone_id = zone_id return cast( - ZeroTrustIdentityProviders, + IdentityProvider, await self._put( f"/{account_or_zone}/{account_or_zone_id}/access/identity_providers/{uuid}", body=await async_maybe_transform( @@ -3343,7 +3343,7 @@ async def update( post_parser=ResultWrapper._unwrapper, ), cast_to=cast( - Any, ResultWrapper[ZeroTrustIdentityProviders] + Any, ResultWrapper[IdentityProvider] ), # Union types cannot be passed in as arguments in the type system ), ) @@ -3474,7 +3474,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustIdentityProviders: + ) -> IdentityProvider: """ Fetches a configured identity provider. @@ -3511,7 +3511,7 @@ async def get( account_or_zone = "zones" account_or_zone_id = zone_id return cast( - ZeroTrustIdentityProviders, + IdentityProvider, await self._get( f"/{account_or_zone}/{account_or_zone_id}/access/identity_providers/{uuid}", options=make_request_options( @@ -3522,7 +3522,7 @@ async def get( post_parser=ResultWrapper._unwrapper, ), cast_to=cast( - Any, ResultWrapper[ZeroTrustIdentityProviders] + Any, ResultWrapper[IdentityProvider] ), # Union types cannot be passed in as arguments in the type system ), ) diff --git a/src/cloudflare/resources/zero_trust/networks/routes/ips.py b/src/cloudflare/resources/zero_trust/networks/routes/ips.py index 6afdcc378db..0d1984e507a 100644 --- a/src/cloudflare/resources/zero_trust/networks/routes/ips.py +++ b/src/cloudflare/resources/zero_trust/networks/routes/ips.py @@ -23,7 +23,7 @@ from ....._base_client import ( make_request_options, ) -from .....types.zero_trust.networks import TunnelTeamnet +from .....types.zero_trust.networks import Teamnet from .....types.zero_trust.networks.routes import ip_get_params __all__ = ["IPs", "AsyncIPs"] @@ -50,7 +50,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TunnelTeamnet: + ) -> Teamnet: """ Fetches routes that contain the given IP address. @@ -83,7 +83,7 @@ def get( query=maybe_transform({"virtual_network_id": virtual_network_id}, ip_get_params.IPGetParams), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[TunnelTeamnet], ResultWrapper[TunnelTeamnet]), + cast_to=cast(Type[Teamnet], ResultWrapper[Teamnet]), ) @@ -108,7 +108,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TunnelTeamnet: + ) -> Teamnet: """ Fetches routes that contain the given IP address. @@ -143,7 +143,7 @@ async def get( ), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[TunnelTeamnet], ResultWrapper[TunnelTeamnet]), + cast_to=cast(Type[Teamnet], ResultWrapper[Teamnet]), ) diff --git a/src/cloudflare/resources/zero_trust/networks/routes/networks.py b/src/cloudflare/resources/zero_trust/networks/routes/networks.py index 7bb1e774588..80738fd806c 100644 --- a/src/cloudflare/resources/zero_trust/networks/routes/networks.py +++ b/src/cloudflare/resources/zero_trust/networks/routes/networks.py @@ -24,7 +24,7 @@ from ....._base_client import ( make_request_options, ) -from .....types.zero_trust.networks import TunnelRoute +from .....types.zero_trust.networks import Route from .....types.zero_trust.networks.routes import network_create_params, network_delete_params __all__ = ["Networks", "AsyncNetworks"] @@ -52,7 +52,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TunnelRoute: + ) -> Route: """Routes a private network through a Cloudflare Tunnel. The CIDR in @@ -97,7 +97,7 @@ def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[TunnelRoute], ResultWrapper[TunnelRoute]), + cast_to=cast(Type[Route], ResultWrapper[Route]), ) def delete( @@ -114,7 +114,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TunnelRoute: + ) -> Route: """Deletes a private network route from an account. The CIDR in @@ -165,7 +165,7 @@ def delete( ), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[TunnelRoute], ResultWrapper[TunnelRoute]), + cast_to=cast(Type[Route], ResultWrapper[Route]), ) def edit( @@ -179,7 +179,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TunnelRoute: + ) -> Route: """Updates an existing private network route in an account. The CIDR in @@ -211,7 +211,7 @@ def edit( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[TunnelRoute], ResultWrapper[TunnelRoute]), + cast_to=cast(Type[Route], ResultWrapper[Route]), ) @@ -237,7 +237,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TunnelRoute: + ) -> Route: """Routes a private network through a Cloudflare Tunnel. The CIDR in @@ -282,7 +282,7 @@ async def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[TunnelRoute], ResultWrapper[TunnelRoute]), + cast_to=cast(Type[Route], ResultWrapper[Route]), ) async def delete( @@ -299,7 +299,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TunnelRoute: + ) -> Route: """Deletes a private network route from an account. The CIDR in @@ -350,7 +350,7 @@ async def delete( ), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[TunnelRoute], ResultWrapper[TunnelRoute]), + cast_to=cast(Type[Route], ResultWrapper[Route]), ) async def edit( @@ -364,7 +364,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TunnelRoute: + ) -> Route: """Updates an existing private network route in an account. The CIDR in @@ -396,7 +396,7 @@ async def edit( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[TunnelRoute], ResultWrapper[TunnelRoute]), + cast_to=cast(Type[Route], ResultWrapper[Route]), ) diff --git a/src/cloudflare/resources/zero_trust/networks/routes/routes.py b/src/cloudflare/resources/zero_trust/networks/routes/routes.py index c45d9d4d1bf..4b2cd2f269c 100644 --- a/src/cloudflare/resources/zero_trust/networks/routes/routes.py +++ b/src/cloudflare/resources/zero_trust/networks/routes/routes.py @@ -42,13 +42,7 @@ AsyncPaginator, make_request_options, ) -from .....types.zero_trust.networks import ( - TunnelRoute, - TunnelTeamnet, - route_edit_params, - route_list_params, - route_create_params, -) +from .....types.zero_trust.networks import Route, Teamnet, route_edit_params, route_list_params, route_create_params __all__ = ["Routes", "AsyncRoutes"] @@ -83,7 +77,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TunnelRoute: + ) -> Route: """ Routes a private network through a Cloudflare Tunnel. @@ -125,7 +119,7 @@ def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[TunnelRoute], ResultWrapper[TunnelRoute]), + cast_to=cast(Type[Route], ResultWrapper[Route]), ) def list( @@ -149,7 +143,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncV4PagePaginationArray[TunnelTeamnet]: + ) -> SyncV4PagePaginationArray[Teamnet]: """ Lists and filters private network routes in an account. @@ -194,7 +188,7 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/teamnet/routes", - page=SyncV4PagePaginationArray[TunnelTeamnet], + page=SyncV4PagePaginationArray[Teamnet], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -217,7 +211,7 @@ def list( route_list_params.RouteListParams, ), ), - model=TunnelTeamnet, + model=Teamnet, ) def delete( @@ -231,7 +225,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TunnelRoute: + ) -> Route: """ Deletes a private network route from an account. @@ -261,7 +255,7 @@ def delete( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[TunnelRoute], ResultWrapper[TunnelRoute]), + cast_to=cast(Type[Route], ResultWrapper[Route]), ) def edit( @@ -280,7 +274,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TunnelRoute: + ) -> Route: """Updates an existing private network route in an account. The fields that are @@ -334,7 +328,7 @@ def edit( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[TunnelRoute], ResultWrapper[TunnelRoute]), + cast_to=cast(Type[Route], ResultWrapper[Route]), ) @@ -368,7 +362,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TunnelRoute: + ) -> Route: """ Routes a private network through a Cloudflare Tunnel. @@ -410,7 +404,7 @@ async def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[TunnelRoute], ResultWrapper[TunnelRoute]), + cast_to=cast(Type[Route], ResultWrapper[Route]), ) def list( @@ -434,7 +428,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[TunnelTeamnet, AsyncV4PagePaginationArray[TunnelTeamnet]]: + ) -> AsyncPaginator[Teamnet, AsyncV4PagePaginationArray[Teamnet]]: """ Lists and filters private network routes in an account. @@ -479,7 +473,7 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/teamnet/routes", - page=AsyncV4PagePaginationArray[TunnelTeamnet], + page=AsyncV4PagePaginationArray[Teamnet], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -502,7 +496,7 @@ def list( route_list_params.RouteListParams, ), ), - model=TunnelTeamnet, + model=Teamnet, ) async def delete( @@ -516,7 +510,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TunnelRoute: + ) -> Route: """ Deletes a private network route from an account. @@ -546,7 +540,7 @@ async def delete( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[TunnelRoute], ResultWrapper[TunnelRoute]), + cast_to=cast(Type[Route], ResultWrapper[Route]), ) async def edit( @@ -565,7 +559,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TunnelRoute: + ) -> Route: """Updates an existing private network route in an account. The fields that are @@ -619,7 +613,7 @@ async def edit( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[TunnelRoute], ResultWrapper[TunnelRoute]), + cast_to=cast(Type[Route], ResultWrapper[Route]), ) diff --git a/src/cloudflare/resources/zero_trust/networks/virtual_networks.py b/src/cloudflare/resources/zero_trust/networks/virtual_networks.py index 1064af591b5..b1ad4a34f41 100644 --- a/src/cloudflare/resources/zero_trust/networks/virtual_networks.py +++ b/src/cloudflare/resources/zero_trust/networks/virtual_networks.py @@ -27,7 +27,7 @@ ) from ....types.shared import UnnamedSchemaRef65e3c8c1a9c4638ec25cdbbaca7165c1 from ....types.zero_trust.networks import ( - TunnelVirtualNetwork, + VirtualNetwork, virtual_network_edit_params, virtual_network_list_params, virtual_network_create_params, @@ -122,7 +122,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[TunnelVirtualNetwork]: + ) -> SyncSinglePage[VirtualNetwork]: """ Lists and filters virtual networks in an account. @@ -153,7 +153,7 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/teamnet/virtual_networks", - page=SyncSinglePage[TunnelVirtualNetwork], + page=SyncSinglePage[VirtualNetwork], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -170,7 +170,7 @@ def list( virtual_network_list_params.VirtualNetworkListParams, ), ), - model=TunnelVirtualNetwork, + model=VirtualNetwork, ) def delete( @@ -376,7 +376,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[TunnelVirtualNetwork, AsyncSinglePage[TunnelVirtualNetwork]]: + ) -> AsyncPaginator[VirtualNetwork, AsyncSinglePage[VirtualNetwork]]: """ Lists and filters virtual networks in an account. @@ -407,7 +407,7 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/teamnet/virtual_networks", - page=AsyncSinglePage[TunnelVirtualNetwork], + page=AsyncSinglePage[VirtualNetwork], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -424,7 +424,7 @@ def list( virtual_network_list_params.VirtualNetworkListParams, ), ), - model=TunnelVirtualNetwork, + model=VirtualNetwork, ) async def delete( diff --git a/src/cloudflare/resources/zero_trust/organizations.py b/src/cloudflare/resources/zero_trust/organizations.py index e22fa4341e5..beb3ac973dd 100644 --- a/src/cloudflare/resources/zero_trust/organizations.py +++ b/src/cloudflare/resources/zero_trust/organizations.py @@ -25,8 +25,8 @@ ) from ...types.zero_trust import ( LoginDesignParam, - ZeroTrustOrganizations, OrganizationRevokeUsersResponse, + organizations, organization_create_params, organization_update_params, organization_revoke_users_params, @@ -65,7 +65,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustOrganizations: + ) -> organizations.Organizations: """ Sets up a Zero Trust organization for your account or zone. @@ -148,7 +148,7 @@ def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ZeroTrustOrganizations], ResultWrapper[ZeroTrustOrganizations]), + cast_to=cast(Type[organizations.Organizations], ResultWrapper[organizations.Organizations]), ) def update( @@ -173,7 +173,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustOrganizations: + ) -> organizations.Organizations: """ Updates the configuration for your Zero Trust organization. @@ -257,7 +257,7 @@ def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ZeroTrustOrganizations], ResultWrapper[ZeroTrustOrganizations]), + cast_to=cast(Type[organizations.Organizations], ResultWrapper[organizations.Organizations]), ) def list( @@ -271,7 +271,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustOrganizations: + ) -> organizations.Organizations: """ Returns the configuration for your Zero Trust organization. @@ -312,7 +312,7 @@ def list( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ZeroTrustOrganizations], ResultWrapper[ZeroTrustOrganizations]), + cast_to=cast(Type[organizations.Organizations], ResultWrapper[organizations.Organizations]), ) def revoke_users( @@ -407,7 +407,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustOrganizations: + ) -> organizations.Organizations: """ Sets up a Zero Trust organization for your account or zone. @@ -490,7 +490,7 @@ async def create( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ZeroTrustOrganizations], ResultWrapper[ZeroTrustOrganizations]), + cast_to=cast(Type[organizations.Organizations], ResultWrapper[organizations.Organizations]), ) async def update( @@ -515,7 +515,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustOrganizations: + ) -> organizations.Organizations: """ Updates the configuration for your Zero Trust organization. @@ -599,7 +599,7 @@ async def update( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ZeroTrustOrganizations], ResultWrapper[ZeroTrustOrganizations]), + cast_to=cast(Type[organizations.Organizations], ResultWrapper[organizations.Organizations]), ) async def list( @@ -613,7 +613,7 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ZeroTrustOrganizations: + ) -> organizations.Organizations: """ Returns the configuration for your Zero Trust organization. @@ -654,7 +654,7 @@ async def list( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[ZeroTrustOrganizations], ResultWrapper[ZeroTrustOrganizations]), + cast_to=cast(Type[organizations.Organizations], ResultWrapper[organizations.Organizations]), ) async def revoke_users( diff --git a/src/cloudflare/resources/zero_trust/tunnels/connectors.py b/src/cloudflare/resources/zero_trust/tunnels/connectors.py index 39c7c2ff689..a45efec17fb 100644 --- a/src/cloudflare/resources/zero_trust/tunnels/connectors.py +++ b/src/cloudflare/resources/zero_trust/tunnels/connectors.py @@ -19,7 +19,7 @@ from ...._base_client import ( make_request_options, ) -from ....types.zero_trust.tunnels import TunnelTunnelClient +from ....types.zero_trust.tunnels import Client __all__ = ["Connectors", "AsyncConnectors"] @@ -45,7 +45,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TunnelTunnelClient: + ) -> Client: """ Fetches connector and connection details for a Cloudflare Tunnel. @@ -79,7 +79,7 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[TunnelTunnelClient], ResultWrapper[TunnelTunnelClient]), + cast_to=cast(Type[Client], ResultWrapper[Client]), ) @@ -104,7 +104,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TunnelTunnelClient: + ) -> Client: """ Fetches connector and connection details for a Cloudflare Tunnel. @@ -138,7 +138,7 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[TunnelTunnelClient], ResultWrapper[TunnelTunnelClient]), + cast_to=cast(Type[Client], ResultWrapper[Client]), ) diff --git a/src/cloudflare/resources/zones/holds.py b/src/cloudflare/resources/zones/holds.py index b8bc2956194..6e6e1596991 100644 --- a/src/cloudflare/resources/zones/holds.py +++ b/src/cloudflare/resources/zones/holds.py @@ -20,7 +20,7 @@ async_to_streamed_response_wrapper, ) from ..._wrappers import ResultWrapper -from ...types.zones import UnnamedSchemaRef45004a9444b6da9f88158ed2fb9a5820, hold_create_params, hold_delete_params +from ...types.zones import ZoneHold, hold_create_params, hold_delete_params from ..._base_client import ( make_request_options, ) @@ -48,7 +48,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> UnnamedSchemaRef45004a9444b6da9f88158ed2fb9a5820: + ) -> ZoneHold: """ Enforce a zone hold on the zone, blocking the creation and activation of zones with this zone's hostname. @@ -81,10 +81,7 @@ def create( query=maybe_transform({"include_subdomains": include_subdomains}, hold_create_params.HoldCreateParams), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast( - Type[UnnamedSchemaRef45004a9444b6da9f88158ed2fb9a5820], - ResultWrapper[UnnamedSchemaRef45004a9444b6da9f88158ed2fb9a5820], - ), + cast_to=cast(Type[ZoneHold], ResultWrapper[ZoneHold]), ) def delete( @@ -98,7 +95,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[UnnamedSchemaRef45004a9444b6da9f88158ed2fb9a5820]: + ) -> Optional[ZoneHold]: """ Stop enforcement of a zone hold on the zone, permanently or temporarily, allowing the creation and activation of zones with this zone's hostname. @@ -130,10 +127,7 @@ def delete( query=maybe_transform({"hold_after": hold_after}, hold_delete_params.HoldDeleteParams), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast( - Type[Optional[UnnamedSchemaRef45004a9444b6da9f88158ed2fb9a5820]], - ResultWrapper[UnnamedSchemaRef45004a9444b6da9f88158ed2fb9a5820], - ), + cast_to=cast(Type[Optional[ZoneHold]], ResultWrapper[ZoneHold]), ) def get( @@ -146,7 +140,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> UnnamedSchemaRef45004a9444b6da9f88158ed2fb9a5820: + ) -> ZoneHold: """ Retrieve whether the zone is subject to a zone hold, and metadata about the hold. @@ -173,10 +167,7 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast( - Type[UnnamedSchemaRef45004a9444b6da9f88158ed2fb9a5820], - ResultWrapper[UnnamedSchemaRef45004a9444b6da9f88158ed2fb9a5820], - ), + cast_to=cast(Type[ZoneHold], ResultWrapper[ZoneHold]), ) @@ -200,7 +191,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> UnnamedSchemaRef45004a9444b6da9f88158ed2fb9a5820: + ) -> ZoneHold: """ Enforce a zone hold on the zone, blocking the creation and activation of zones with this zone's hostname. @@ -235,10 +226,7 @@ async def create( ), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast( - Type[UnnamedSchemaRef45004a9444b6da9f88158ed2fb9a5820], - ResultWrapper[UnnamedSchemaRef45004a9444b6da9f88158ed2fb9a5820], - ), + cast_to=cast(Type[ZoneHold], ResultWrapper[ZoneHold]), ) async def delete( @@ -252,7 +240,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[UnnamedSchemaRef45004a9444b6da9f88158ed2fb9a5820]: + ) -> Optional[ZoneHold]: """ Stop enforcement of a zone hold on the zone, permanently or temporarily, allowing the creation and activation of zones with this zone's hostname. @@ -284,10 +272,7 @@ async def delete( query=await async_maybe_transform({"hold_after": hold_after}, hold_delete_params.HoldDeleteParams), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast( - Type[Optional[UnnamedSchemaRef45004a9444b6da9f88158ed2fb9a5820]], - ResultWrapper[UnnamedSchemaRef45004a9444b6da9f88158ed2fb9a5820], - ), + cast_to=cast(Type[Optional[ZoneHold]], ResultWrapper[ZoneHold]), ) async def get( @@ -300,7 +285,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> UnnamedSchemaRef45004a9444b6da9f88158ed2fb9a5820: + ) -> ZoneHold: """ Retrieve whether the zone is subject to a zone hold, and metadata about the hold. @@ -327,10 +312,7 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast( - Type[UnnamedSchemaRef45004a9444b6da9f88158ed2fb9a5820], - ResultWrapper[UnnamedSchemaRef45004a9444b6da9f88158ed2fb9a5820], - ), + cast_to=cast(Type[ZoneHold], ResultWrapper[ZoneHold]), ) diff --git a/src/cloudflare/resources/zones/subscriptions.py b/src/cloudflare/resources/zones/subscriptions.py index 6d7444c1493..27788c9c5e0 100644 --- a/src/cloudflare/resources/zones/subscriptions.py +++ b/src/cloudflare/resources/zones/subscriptions.py @@ -22,7 +22,8 @@ ) from ..._wrappers import ResultWrapper from ...pagination import SyncSinglePage, AsyncSinglePage -from ...types.zones import SubscriptionListResponse, subscription_create_params +from ...types.user import Subscription +from ...types.zones import subscription_create_params from ..._base_client import ( AsyncPaginator, make_request_options, @@ -118,7 +119,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[SubscriptionListResponse]: + ) -> SyncSinglePage[Subscription]: """ Lists all of an account's subscriptions. @@ -137,11 +138,11 @@ def list( raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") return self._get_api_list( f"/accounts/{account_identifier}/subscriptions", - page=SyncSinglePage[SubscriptionListResponse], + page=SyncSinglePage[Subscription], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=SubscriptionListResponse, + model=Subscription, ) def get( @@ -275,7 +276,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[SubscriptionListResponse, AsyncSinglePage[SubscriptionListResponse]]: + ) -> AsyncPaginator[Subscription, AsyncSinglePage[Subscription]]: """ Lists all of an account's subscriptions. @@ -294,11 +295,11 @@ def list( raise ValueError(f"Expected a non-empty value for `account_identifier` but received {account_identifier!r}") return self._get_api_list( f"/accounts/{account_identifier}/subscriptions", - page=AsyncSinglePage[SubscriptionListResponse], + page=AsyncSinglePage[Subscription], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=SubscriptionListResponse, + model=Subscription, ) async def get( diff --git a/src/cloudflare/types/__init__.py b/src/cloudflare/types/__init__.py index e43ad70ffdd..a179e75a5e1 100644 --- a/src/cloudflare/types/__init__.py +++ b/src/cloudflare/types/__init__.py @@ -2,12 +2,15 @@ from __future__ import annotations +from .d1 import D1 as D1 from .dns import DNS as DNS from .ips import IPs as IPs -from .ssl import SSL as SSL +from .info import Info as Info from .pcap import PCAP as PCAP from .zone import Zone as Zone -from .action import Action as Action +from .route import Route as Route +from .trend import Trend as Trend +from .video import Video as Video from .dnssec import DNSSEC as DNSSEC from .filter import Filter as Filter from .header import Header as Header @@ -34,59 +37,64 @@ UnnamedSchemaRefB92f86eb861cd3dee83c40884802fda6 as UnnamedSchemaRefB92f86eb861cd3dee83c40884802fda6, UnnamedSchemaRefCc2ac1a037e5d6702fc77b3bcb527854 as UnnamedSchemaRefCc2ac1a037e5d6702fc77b3bcb527854, UnnamedSchemaRefD8600eb4758b3ae35607a0327bcd691b as UnnamedSchemaRefD8600eb4758b3ae35607a0327bcd691b, - UnnamedSchemaRefDfef9380cb53cc7d4bda9f75e109d7a2 as UnnamedSchemaRefDfef9380cb53cc7d4bda9f75e109d7a2, UnnamedSchemaRefE7c61ebe06ebfc3861ae8b9db4ba152b as UnnamedSchemaRefE7c61ebe06ebfc3861ae8b9db4ba152b, UnnamedSchemaRefEc4d85c3d1bcc6b3b7e99c199ae99846 as UnnamedSchemaRefEc4d85c3d1bcc6b3b7e99c199ae99846, UnnamedSchemaRefEe1e79edcb234d14c4dd266880f2fd24 as UnnamedSchemaRefEe1e79edcb234d14c4dd266880f2fd24, - UnnamedSchemaRefFb1dc8bb871d835b75bd0c2f50bd8572 as UnnamedSchemaRefFb1dc8bb871d835b75bd0c2f50bd8572, ) +from .submit import Submit as Submit +from .targes import Targes as Targes from .tunnel import Tunnel as Tunnel from .account import Account as Account from .binding import Binding as Binding from .ruleset import Ruleset as Ruleset +from .setting import Setting as Setting from .snippet import Snippet as Snippet from .edge_ips import EdgeIPs as EdgeIPs +from .hostname import Hostname as Hostname from .log_rule import LogRule as LogRule +from .settings import Settings as Settings from .calls_app import CallsApp as CallsApp from .component import Component as Component from .dns_param import DNSParam as DNSParam from .host_item import HostItem as HostItem from .page_rule import PageRule as PageRule +from .rate_plan import RatePlan as RatePlan from .skip_rule import SkipRule as SkipRule from .block_rule import BlockRule as BlockRule from .d1_binding import D1Binding as D1Binding +from .hyperdrive import Hyperdrive as Hyperdrive from .membership import Membership as Membership from .origin_dns import OriginDNS as OriginDNS from .r2_binding import R2Binding as R2Binding from .rules_item import RulesItem as RulesItem -from .url_target import URLTarget as URLTarget -from .action_item import ActionItem as ActionItem from .healthcheck import Healthcheck as Healthcheck from .jdcloud_ips import JDCloudIPs as JDCloudIPs -from .origin_item import OriginItem as OriginItem from .origin_port import OriginPort as OriginPort -from .action_param import ActionParam as ActionParam +from .route_param import RouteParam as RouteParam from .check_region import CheckRegion as CheckRegion from .execute_rule import ExecuteRule as ExecuteRule from .filter_param import FilterParam as FilterParam from .header_param import HeaderParam as HeaderParam from .health_check import HealthCheck as HealthCheck -from .methods_item import MethodsItem as MethodsItem from .origin_param import OriginParam as OriginParam from .request_rule import RequestRule as RequestRule +from .targes_param import TargesParam as TargesParam from .tunnel_param import TunnelParam as TunnelParam from .waiting_room import WaitingRoom as WaitingRoom +from .binding_param import BindingParam as BindingParam +from .configuration import Configuration as Configuration from .load_balancer import LoadBalancer as LoadBalancer from .load_shedding import LoadShedding as LoadShedding -from .stream_videos import StreamVideos as StreamVideos +from .request_model import RequestModel as RequestModel from .edge_ips_param import EdgeIPsParam as EdgeIPsParam -from .email_settings import EmailSettings as EmailSettings from .filter_options import FilterOptions as FilterOptions +from .hostname_param import HostnameParam as HostnameParam from .ip_list_params import IPListParams as IPListParams from .labeled_region import LabeledRegion as LabeledRegion from .log_rule_param import LogRuleParam as LogRuleParam from .migration_step import MigrationStep as MigrationStep -from .firewall_filter import FirewallFilter as FirewallFilter +from .settings_param import SettingsParam as SettingsParam +from .custom_hostname import CustomHostname as CustomHostname from .origin_steering import OriginSteering as OriginSteering from .random_steering import RandomSteering as RandomSteering from .service_binding import ServiceBinding as ServiceBinding @@ -103,21 +111,15 @@ from .user_edit_params import UserEditParams as UserEditParams from .zone_edit_params import ZoneEditParams as ZoneEditParams from .zone_list_params import ZoneListParams as ZoneListParams -from .action_item_param import ActionItemParam as ActionItemParam -from .check_region_item import CheckRegionItem as CheckRegionItem from .cookie_attributes import CookieAttributes as CookieAttributes from .custom_nameserver import CustomNameserver as CustomNameserver from .lighthouse_report import LighthouseReport as LighthouseReport from .location_strategy import LocationStrategy as LocationStrategy from .mtls_cert_binding import MTLSCERTBinding as MTLSCERTBinding -from .observatory_trend import ObservatoryTrend as ObservatoryTrend -from .origin_item_param import OriginItemParam as OriginItemParam from .origin_port_param import OriginPortParam as OriginPortParam from .pcap_get_response import PCAPGetResponse as PCAPGetResponse -from .request_list_item import RequestListItem as RequestListItem from .stepped_migration import SteppedMigration as SteppedMigration -from .targes_item_param import TargesItemParam as TargesItemParam -from .tcp_configuration import TcpConfiguration as TcpConfiguration +from .tcp_configuration import TCPConfiguration as TCPConfiguration from .cache_purge_params import CachePurgeParams as CachePurgeParams from .call_create_params import CallCreateParams as CallCreateParams from .call_update_params import CallUpdateParams as CallUpdateParams @@ -137,24 +139,27 @@ from .zone_create_params import ZoneCreateParams as ZoneCreateParams from .account_list_params import AccountListParams as AccountListParams from .available_rate_plan import AvailableRatePlan as AvailableRatePlan +from .configuration_param import ConfigurationParam as ConfigurationParam +from .filter_get_response import FilterGetResponse as FilterGetResponse +from .keyless_certificate import KeylessCertificate as KeylessCertificate from .load_shedding_param import LoadSheddingParam as LoadSheddingParam from .notification_filter import NotificationFilter as NotificationFilter -from .page_shield_setting import PageShieldSetting as PageShieldSetting from .queue_create_params import QueueCreateParams as QueueCreateParams from .queue_delete_params import QueueDeleteParams as QueueDeleteParams from .queue_list_response import QueueListResponse as QueueListResponse from .queue_update_params import QueueUpdateParams as QueueUpdateParams +from .request_model_param import RequestModelParam as RequestModelParam from .speed_delete_params import SpeedDeleteParams as SpeedDeleteParams from .allowed_origins_item import AllowedOriginsItem as AllowedOriginsItem from .cache_purge_response import CachePurgeResponse as CachePurgeResponse from .dnssec_delete_params import DNSSECDeleteParams as DNSSECDeleteParams from .filter_create_params import FilterCreateParams as FilterCreateParams from .filter_delete_params import FilterDeleteParams as FilterDeleteParams +from .filter_list_response import FilterListResponse as FilterListResponse from .filter_options_param import FilterOptionsParam as FilterOptionsParam from .filter_update_params import FilterUpdateParams as FilterUpdateParams from .kv_namespace_binding import KVNamespaceBinding as KVNamespaceBinding from .migration_step_param import MigrationStepParam as MigrationStepParam -from .observatory_schedule import ObservatorySchedule as ObservatorySchedule from .pagerule_edit_params import PageruleEditParams as PageruleEditParams from .pagerule_list_params import PageruleListParams as PageruleListParams from .pcap_create_response import PCAPCreateResponse as PCAPCreateResponse @@ -180,6 +185,8 @@ from .additional_routes_item import AdditionalRoutesItem as AdditionalRoutesItem from .durable_object_binding import DurableObjectBinding as DurableObjectBinding from .filter_create_response import FilterCreateResponse as FilterCreateResponse +from .filter_delete_response import FilterDeleteResponse as FilterDeleteResponse +from .filter_update_response import FilterUpdateResponse as FilterUpdateResponse from .geo_restrictions_param import GeoRestrictionsParam as GeoRestrictionsParam from .membership_list_params import MembershipListParams as MembershipListParams from .pagerule_create_params import PageruleCreateParams as PageruleCreateParams @@ -192,16 +199,13 @@ from .audit_log_list_response import AuditLogListResponse as AuditLogListResponse from .cookie_attributes_param import CookieAttributesParam as CookieAttributesParam from .healthcheck_edit_params import HealthcheckEditParams as HealthcheckEditParams -from .intel_phishing_url_info import IntelPhishingURLInfo as IntelPhishingURLInfo from .location_strategy_param import LocationStrategyParam as LocationStrategyParam from .mtls_cert_binding_param import MTLSCERTBindingParam as MTLSCERTBindingParam -from .mtls_certificate_update import MTLSCertificateUpdate as MTLSCertificateUpdate from .placement_configuration import PlacementConfiguration as PlacementConfiguration -from .request_list_item_param import RequestListItemParam as RequestListItemParam from .ruleset_create_response import RulesetCreateResponse as RulesetCreateResponse from .ruleset_update_response import RulesetUpdateResponse as RulesetUpdateResponse from .stepped_migration_param import SteppedMigrationParam as SteppedMigrationParam -from .tcp_configuration_param import TcpConfigurationParam as TcpConfigurationParam +from .tcp_configuration_param import TCPConfigurationParam as TCPConfigurationParam from .url_scanner_scan_params import URLScannerScanParams as URLScannerScanParams from .http_configuration_param import HTTPConfigurationParam as HTTPConfigurationParam from .membership_delete_params import MembershipDeleteParams as MembershipDeleteParams @@ -215,7 +219,6 @@ from .healthcheck_create_params import HealthcheckCreateParams as HealthcheckCreateParams from .healthcheck_delete_params import HealthcheckDeleteParams as HealthcheckDeleteParams from .healthcheck_update_params import HealthcheckUpdateParams as HealthcheckUpdateParams -from .intel_phishing_url_submit import IntelPhishingURLSubmit as IntelPhishingURLSubmit from .load_balancer_edit_params import LoadBalancerEditParams as LoadBalancerEditParams from .notification_filter_param import NotificationFilterParam as NotificationFilterParam from .page_shield_update_params import PageShieldUpdateParams as PageShieldUpdateParams @@ -229,7 +232,6 @@ from .subscription_configuration import SubscriptionConfiguration as SubscriptionConfiguration from .subscription_create_params import SubscriptionCreateParams as SubscriptionCreateParams from .subscription_delete_params import SubscriptionDeleteParams as SubscriptionDeleteParams -from .subscription_list_response import SubscriptionListResponse as SubscriptionListResponse from .subscription_update_params import SubscriptionUpdateParams as SubscriptionUpdateParams from .waiting_room_create_params import WaitingRoomCreateParams as WaitingRoomCreateParams from .waiting_room_delete_params import WaitingRoomDeleteParams as WaitingRoomDeleteParams @@ -250,10 +252,8 @@ from .additional_routes_item_param import AdditionalRoutesItemParam as AdditionalRoutesItemParam from .bot_fight_mode_configuration import BotFightModeConfiguration as BotFightModeConfiguration from .bot_management_update_params import BotManagementUpdateParams as BotManagementUpdateParams -from .custom_hostname_get_response import CustomHostnameGetResponse as CustomHostnameGetResponse from .durable_object_binding_param import DurableObjectBindingParam as DurableObjectBindingParam from .email_routing_disable_params import EmailRoutingDisableParams as EmailRoutingDisableParams -from .keyless_certificate_hostname import KeylessCertificateHostname as KeylessCertificateHostname from .managed_header_edit_response import ManagedHeaderEditResponse as ManagedHeaderEditResponse from .managed_header_list_response import ManagedHeaderListResponse as ManagedHeaderListResponse from .subscription_delete_response import SubscriptionDeleteResponse as SubscriptionDeleteResponse @@ -262,8 +262,6 @@ from .warp_connector_delete_params import WARPConnectorDeleteParams as WARPConnectorDeleteParams from .custom_hostname_create_params import CustomHostnameCreateParams as CustomHostnameCreateParams from .custom_hostname_delete_params import CustomHostnameDeleteParams as CustomHostnameDeleteParams -from .custom_hostname_edit_response import CustomHostnameEditResponse as CustomHostnameEditResponse -from .custom_hostname_list_response import CustomHostnameListResponse as CustomHostnameListResponse from .load_balancer_delete_response import LoadBalancerDeleteResponse as LoadBalancerDeleteResponse from .placement_configuration_param import PlacementConfigurationParam as PlacementConfigurationParam from .warp_connector_token_response import WARPConnectorTokenResponse as WARPConnectorTokenResponse @@ -276,7 +274,7 @@ from .mtls_certificate_create_params import MTLSCertificateCreateParams as MTLSCertificateCreateParams from .mtls_certificate_delete_params import MTLSCertificateDeleteParams as MTLSCertificateDeleteParams from .url_normalization_get_response import URLNormalizationGetResponse as URLNormalizationGetResponse -from .custom_hostname_create_response import CustomHostnameCreateResponse as CustomHostnameCreateResponse +from .zone_authenticated_origin_pull import ZoneAuthenticatedOriginPull as ZoneAuthenticatedOriginPull from .custom_nameserver_create_params import CustomNameserverCreateParams as CustomNameserverCreateParams from .custom_nameserver_delete_params import CustomNameserverDeleteParams as CustomNameserverDeleteParams from .custom_nameserver_verify_params import CustomNameserverVerifyParams as CustomNameserverVerifyParams @@ -287,6 +285,7 @@ from .custom_certificate_create_params import CustomCertificateCreateParams as CustomCertificateCreateParams from .custom_certificate_delete_params import CustomCertificateDeleteParams as CustomCertificateDeleteParams from .dispatch_namespace_binding_param import DispatchNamespaceBindingParam as DispatchNamespaceBindingParam +from .mtls_certificate_create_response import MTLSCertificateCreateResponse as MTLSCertificateCreateResponse from .custom_nameserver_verify_response import CustomNameserverVerifyResponse as CustomNameserverVerifyResponse from .keyless_certificate_create_params import KeylessCertificateCreateParams as KeylessCertificateCreateParams from .keyless_certificate_delete_params import KeylessCertificateDeleteParams as KeylessCertificateDeleteParams @@ -298,7 +297,6 @@ from .origin_ca_certificate_delete_params import OriginCACertificateDeleteParams as OriginCACertificateDeleteParams from .origin_tls_client_auth_create_params import OriginTLSClientAuthCreateParams as OriginTLSClientAuthCreateParams from .origin_tls_client_auth_delete_params import OriginTLSClientAuthDeleteParams as OriginTLSClientAuthDeleteParams -from .origin_tls_client_auth_list_response import OriginTLSClientAuthListResponse as OriginTLSClientAuthListResponse from .custom_nameserver_availabilty_response import ( CustomNameserverAvailabiltyResponse as CustomNameserverAvailabiltyResponse, ) diff --git a/src/cloudflare/types/accounts/__init__.py b/src/cloudflare/types/accounts/__init__.py index 9082dab5ab6..eba2b6a8969 100644 --- a/src/cloudflare/types/accounts/__init__.py +++ b/src/cloudflare/types/accounts/__init__.py @@ -4,8 +4,9 @@ from .role import Role as Role from .member import Member as Member -from .member_with_code import MemberWithCode as MemberWithCode +from .member_role import MemberRole as MemberRole from .permission_grant import PermissionGrant as PermissionGrant +from .member_role_param import MemberRoleParam as MemberRoleParam from .member_list_params import MemberListParams as MemberListParams from .member_create_params import MemberCreateParams as MemberCreateParams from .member_delete_params import MemberDeleteParams as MemberDeleteParams @@ -13,3 +14,4 @@ from .member_update_params import MemberUpdateParams as MemberUpdateParams from .member_delete_response import MemberDeleteResponse as MemberDeleteResponse from .permission_grant_param import PermissionGrantParam as PermissionGrantParam +from .member_with_invite_code import MemberWithInviteCode as MemberWithInviteCode diff --git a/src/cloudflare/types/accounts/member.py b/src/cloudflare/types/accounts/member.py index 3aee13498fb..c357dd2a41f 100644 --- a/src/cloudflare/types/accounts/member.py +++ b/src/cloudflare/types/accounts/member.py @@ -3,22 +3,9 @@ from typing import List, Optional from ..._models import BaseModel -from ..user.tokens import Permission +from .member_role import MemberRole -__all__ = ["Member", "Role", "User"] - - -class Role(BaseModel): - id: str - """Role identifier tag.""" - - description: str - """Description of role's permissions.""" - - name: str - """Role name.""" - - permissions: Permission +__all__ = ["Member", "User"] class User(BaseModel): @@ -45,7 +32,7 @@ class Member(BaseModel): id: str """Membership identifier tag.""" - roles: List[Role] + roles: List[MemberRole] """Roles assigned to this member.""" status: object diff --git a/src/cloudflare/types/accounts/member_role.py b/src/cloudflare/types/accounts/member_role.py new file mode 100644 index 00000000000..c0532541089 --- /dev/null +++ b/src/cloudflare/types/accounts/member_role.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + + +from ..._models import BaseModel +from ..user.tokens import Permission + +__all__ = ["MemberRole"] + + +class MemberRole(BaseModel): + id: str + """Role identifier tag.""" + + description: str + """Description of role's permissions.""" + + name: str + """Role name.""" + + permissions: Permission diff --git a/src/cloudflare/types/accounts/member_role_param.py b/src/cloudflare/types/accounts/member_role_param.py new file mode 100644 index 00000000000..70bce379300 --- /dev/null +++ b/src/cloudflare/types/accounts/member_role_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["MemberRoleParam"] + + +class MemberRoleParam(TypedDict, total=False): + id: Required[str] + """Role identifier tag.""" diff --git a/src/cloudflare/types/accounts/member_update_params.py b/src/cloudflare/types/accounts/member_update_params.py index 69867eb443e..fa8bc46954b 100644 --- a/src/cloudflare/types/accounts/member_update_params.py +++ b/src/cloudflare/types/accounts/member_update_params.py @@ -5,16 +5,13 @@ from typing import Iterable from typing_extensions import Required, TypedDict -__all__ = ["MemberUpdateParams", "Role"] +from .member_role_param import MemberRoleParam + +__all__ = ["MemberUpdateParams"] class MemberUpdateParams(TypedDict, total=False): account_id: Required[object] - roles: Required[Iterable[Role]] + roles: Required[Iterable[MemberRoleParam]] """Roles assigned to this member.""" - - -class Role(TypedDict, total=False): - id: Required[str] - """Role identifier tag.""" diff --git a/src/cloudflare/types/accounts/member_with_code.py b/src/cloudflare/types/accounts/member_with_invite_code.py similarity index 71% rename from src/cloudflare/types/accounts/member_with_code.py rename to src/cloudflare/types/accounts/member_with_invite_code.py index 573cf9c8108..7584f6b2c26 100644 --- a/src/cloudflare/types/accounts/member_with_code.py +++ b/src/cloudflare/types/accounts/member_with_invite_code.py @@ -3,22 +3,9 @@ from typing import List, Optional from ..._models import BaseModel -from ..user.tokens import Permission +from .member_role import MemberRole -__all__ = ["MemberWithCode", "Role", "User"] - - -class Role(BaseModel): - id: str - """Role identifier tag.""" - - description: str - """Description of role's permissions.""" - - name: str - """Role name.""" - - permissions: Permission +__all__ = ["MemberWithInviteCode", "User"] class User(BaseModel): @@ -41,11 +28,11 @@ class User(BaseModel): """ -class MemberWithCode(BaseModel): +class MemberWithInviteCode(BaseModel): id: str """Membership identifier tag.""" - roles: List[Role] + roles: List[MemberRole] """Roles assigned to this member.""" status: object diff --git a/src/cloudflare/types/accounts/role.py b/src/cloudflare/types/accounts/role.py index 85afa978780..110550db3a8 100644 --- a/src/cloudflare/types/accounts/role.py +++ b/src/cloudflare/types/accounts/role.py @@ -3,6 +3,7 @@ from typing import List from ..._models import BaseModel +from ..user.tokens import PermissionItem __all__ = ["Role"] @@ -17,5 +18,5 @@ class Role(BaseModel): name: str """Role Name.""" - permissions: List[str] + permissions: List[PermissionItem] """Access permissions for this User.""" diff --git a/src/cloudflare/types/action.py b/src/cloudflare/types/action.py deleted file mode 100644 index 4379bc4630b..00000000000 --- a/src/cloudflare/types/action.py +++ /dev/null @@ -1,45 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional -from typing_extensions import Literal - -from .._models import BaseModel - -__all__ = ["Action", "Response"] - - -class Response(BaseModel): - body: Optional[str] = None - """The response body to return. - - The value must conform to the configured content type. - """ - - content_type: Optional[str] = None - """The content type of the body. - - Must be one of the following: `text/plain`, `text/xml`, or `application/json`. - """ - - -class Action(BaseModel): - mode: Optional[Literal["simulate", "ban", "challenge", "js_challenge", "managed_challenge"]] = None - """The action to perform.""" - - response: Optional[Response] = None - """A custom content type and reponse to return when the threshold is exceeded. - - The custom response configured in this object will override the custom error for - the zone. This object is optional. Notes: If you omit this object, Cloudflare - will use the default HTML error page. If "mode" is "challenge", - "managed_challenge", or "js_challenge", Cloudflare will use the zone challenge - pages and you should not provide the "response" object. - """ - - timeout: Optional[float] = None - """The time in seconds during which Cloudflare will perform the mitigation action. - - Must be an integer value greater than or equal to the period. Notes: If "mode" - is "challenge", "managed_challenge", or "js_challenge", Cloudflare will use the - zone's Challenge Passage time and you should not provide this value. - """ diff --git a/src/cloudflare/types/action_param.py b/src/cloudflare/types/action_param.py deleted file mode 100644 index 4f585b7105d..00000000000 --- a/src/cloudflare/types/action_param.py +++ /dev/null @@ -1,44 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Literal, TypedDict - -__all__ = ["ActionParam", "Response"] - - -class Response(TypedDict, total=False): - body: str - """The response body to return. - - The value must conform to the configured content type. - """ - - content_type: str - """The content type of the body. - - Must be one of the following: `text/plain`, `text/xml`, or `application/json`. - """ - - -class ActionParam(TypedDict, total=False): - mode: Literal["simulate", "ban", "challenge", "js_challenge", "managed_challenge"] - """The action to perform.""" - - response: Response - """A custom content type and reponse to return when the threshold is exceeded. - - The custom response configured in this object will override the custom error for - the zone. This object is optional. Notes: If you omit this object, Cloudflare - will use the default HTML error page. If "mode" is "challenge", - "managed_challenge", or "js_challenge", Cloudflare will use the zone challenge - pages and you should not provide the "response" object. - """ - - timeout: float - """The time in seconds during which Cloudflare will perform the mitigation action. - - Must be an integer value greater than or equal to the period. Notes: If "mode" - is "challenge", "managed_challenge", or "js_challenge", Cloudflare will use the - zone's Challenge Passage time and you should not provide this value. - """ diff --git a/src/cloudflare/types/addressing/__init__.py b/src/cloudflare/types/addressing/__init__.py index 506808a48cb..569b643f832 100644 --- a/src/cloudflare/types/addressing/__init__.py +++ b/src/cloudflare/types/addressing/__init__.py @@ -2,14 +2,14 @@ from __future__ import annotations +from .prefix import Prefix as Prefix +from .address_map import AddressMap as AddressMap from .prefix_edit_params import PrefixEditParams as PrefixEditParams from .prefix_create_params import PrefixCreateParams as PrefixCreateParams from .prefix_delete_params import PrefixDeleteParams as PrefixDeleteParams from .service_list_response import ServiceListResponse as ServiceListResponse from .address_map_edit_params import AddressMapEditParams as AddressMapEditParams -from .addressing_address_maps import AddressingAddressMaps as AddressingAddressMaps from .address_map_get_response import AddressMapGetResponse as AddressMapGetResponse -from .addressing_ipam_prefixes import AddressingIpamPrefixes as AddressingIpamPrefixes from .address_map_create_params import AddressMapCreateParams as AddressMapCreateParams from .address_map_delete_params import AddressMapDeleteParams as AddressMapDeleteParams from .loa_document_create_params import LOADocumentCreateParams as LOADocumentCreateParams diff --git a/src/cloudflare/types/addressing/addressing_address_maps.py b/src/cloudflare/types/addressing/address_map.py similarity index 94% rename from src/cloudflare/types/addressing/addressing_address_maps.py rename to src/cloudflare/types/addressing/address_map.py index e7e702be5a0..dff7660e50c 100644 --- a/src/cloudflare/types/addressing/addressing_address_maps.py +++ b/src/cloudflare/types/addressing/address_map.py @@ -5,10 +5,10 @@ from ..._models import BaseModel -__all__ = ["AddressingAddressMaps"] +__all__ = ["AddressMap"] -class AddressingAddressMaps(BaseModel): +class AddressMap(BaseModel): id: Optional[str] = None """Identifier""" diff --git a/src/cloudflare/types/addressing/addressing_ipam_prefixes.py b/src/cloudflare/types/addressing/prefix.py similarity index 95% rename from src/cloudflare/types/addressing/addressing_ipam_prefixes.py rename to src/cloudflare/types/addressing/prefix.py index c9d6c5c31df..9dd12947704 100644 --- a/src/cloudflare/types/addressing/addressing_ipam_prefixes.py +++ b/src/cloudflare/types/addressing/prefix.py @@ -5,10 +5,10 @@ from ..._models import BaseModel -__all__ = ["AddressingIpamPrefixes"] +__all__ = ["Prefix"] -class AddressingIpamPrefixes(BaseModel): +class Prefix(BaseModel): id: Optional[str] = None """Identifier""" diff --git a/src/cloudflare/types/addressing/prefixes/__init__.py b/src/cloudflare/types/addressing/prefixes/__init__.py index 085cfcba5b2..220f1b64757 100644 --- a/src/cloudflare/types/addressing/prefixes/__init__.py +++ b/src/cloudflare/types/addressing/prefixes/__init__.py @@ -2,7 +2,7 @@ from __future__ import annotations +from .delegations import Delegations as Delegations from .delegation_create_params import DelegationCreateParams as DelegationCreateParams from .delegation_delete_params import DelegationDeleteParams as DelegationDeleteParams from .delegation_delete_response import DelegationDeleteResponse as DelegationDeleteResponse -from .addressing_ipam_delegations import AddressingIpamDelegations as AddressingIpamDelegations diff --git a/src/cloudflare/types/addressing/prefixes/bgp/__init__.py b/src/cloudflare/types/addressing/prefixes/bgp/__init__.py index c5d887f81aa..fc8e6fe6b97 100644 --- a/src/cloudflare/types/addressing/prefixes/bgp/__init__.py +++ b/src/cloudflare/types/addressing/prefixes/bgp/__init__.py @@ -2,10 +2,11 @@ from __future__ import annotations +from .bgp_prefix import BGPPrefix as BGPPrefix +from .service_binding import ServiceBinding as ServiceBinding from .prefix_edit_params import PrefixEditParams as PrefixEditParams from .status_edit_params import StatusEditParams as StatusEditParams from .status_get_response import StatusGetResponse as StatusGetResponse from .status_edit_response import StatusEditResponse as StatusEditResponse from .binding_create_params import BindingCreateParams as BindingCreateParams -from .addressing_service_binding import AddressingServiceBinding as AddressingServiceBinding -from .addressing_ipam_bgp_prefixes import AddressingIpamBGPPrefixes as AddressingIpamBGPPrefixes +from .service_binding_param import ServiceBindingParam as ServiceBindingParam diff --git a/src/cloudflare/types/addressing/prefixes/bgp/addressing_ipam_bgp_prefixes.py b/src/cloudflare/types/addressing/prefixes/bgp/bgp_prefix.py similarity index 93% rename from src/cloudflare/types/addressing/prefixes/bgp/addressing_ipam_bgp_prefixes.py rename to src/cloudflare/types/addressing/prefixes/bgp/bgp_prefix.py index a934a70a4c8..d9eecdf9d89 100644 --- a/src/cloudflare/types/addressing/prefixes/bgp/addressing_ipam_bgp_prefixes.py +++ b/src/cloudflare/types/addressing/prefixes/bgp/bgp_prefix.py @@ -5,7 +5,7 @@ from ....._models import BaseModel -__all__ = ["AddressingIpamBGPPrefixes", "BGPSignalOpts", "OnDemand"] +__all__ = ["BGPPrefix", "BGPSignalOpts", "OnDemand"] class BGPSignalOpts(BaseModel): @@ -48,7 +48,7 @@ class OnDemand(BaseModel): """ -class AddressingIpamBGPPrefixes(BaseModel): +class BGPPrefix(BaseModel): id: Optional[str] = None """Identifier""" diff --git a/src/cloudflare/types/addressing/prefixes/bgp/addressing_service_binding.py b/src/cloudflare/types/addressing/prefixes/bgp/service_binding.py similarity index 90% rename from src/cloudflare/types/addressing/prefixes/bgp/addressing_service_binding.py rename to src/cloudflare/types/addressing/prefixes/bgp/service_binding.py index 9b1317efb32..505f89b7c2e 100644 --- a/src/cloudflare/types/addressing/prefixes/bgp/addressing_service_binding.py +++ b/src/cloudflare/types/addressing/prefixes/bgp/service_binding.py @@ -5,7 +5,7 @@ from ....._models import BaseModel -__all__ = ["AddressingServiceBinding", "Provisioning"] +__all__ = ["ServiceBinding", "Provisioning"] class Provisioning(BaseModel): @@ -16,7 +16,7 @@ class Provisioning(BaseModel): """ -class AddressingServiceBinding(BaseModel): +class ServiceBinding(BaseModel): id: Optional[str] = None """Identifier""" diff --git a/src/cloudflare/types/addressing/prefixes/bgp/service_binding_param.py b/src/cloudflare/types/addressing/prefixes/bgp/service_binding_param.py new file mode 100644 index 00000000000..3dd61ede1cb --- /dev/null +++ b/src/cloudflare/types/addressing/prefixes/bgp/service_binding_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, TypedDict + +__all__ = ["ServiceBindingParam", "Provisioning"] + + +class Provisioning(TypedDict, total=False): + state: Literal["provisioning", "active"] + """ + When a binding has been deployed to a majority of Cloudflare datacenters, the + binding will become active and can be used with its associated service. + """ + + +class ServiceBindingParam(TypedDict, total=False): + cidr: str + """IP Prefix in Classless Inter-Domain Routing format.""" + + provisioning: Provisioning + """Status of a Service Binding's deployment to the Cloudflare network""" + + service_id: str + """Identifier""" + + service_name: str + """Name of a service running on the Cloudflare network""" diff --git a/src/cloudflare/types/addressing/prefixes/addressing_ipam_delegations.py b/src/cloudflare/types/addressing/prefixes/delegations.py similarity index 88% rename from src/cloudflare/types/addressing/prefixes/addressing_ipam_delegations.py rename to src/cloudflare/types/addressing/prefixes/delegations.py index a60c2ff07a3..8a2d2d8fea8 100644 --- a/src/cloudflare/types/addressing/prefixes/addressing_ipam_delegations.py +++ b/src/cloudflare/types/addressing/prefixes/delegations.py @@ -5,10 +5,10 @@ from ...._models import BaseModel -__all__ = ["AddressingIpamDelegations"] +__all__ = ["Delegations"] -class AddressingIpamDelegations(BaseModel): +class Delegations(BaseModel): id: Optional[str] = None """Delegation identifier tag.""" diff --git a/src/cloudflare/types/alerting/__init__.py b/src/cloudflare/types/alerting/__init__.py index 96634d18a8a..0b385df93b7 100644 --- a/src/cloudflare/types/alerting/__init__.py +++ b/src/cloudflare/types/alerting/__init__.py @@ -2,12 +2,13 @@ from __future__ import annotations -from .filters import Filters as Filters -from .policies import Policies as Policies -from .mechanisms import Mechanisms as Mechanisms -from .filters_param import FiltersParam as FiltersParam -from .alerting_history import AlertingHistory as AlertingHistory -from .mechanisms_param import MechanismsParam as MechanismsParam +from .filter import Filter as Filter +from .policy import Policy as Policy +from .history import History as History +from .mechanism import Mechanism as Mechanism +from .filter_param import FilterParam as FilterParam +from .policy_param import PolicyParam as PolicyParam +from .mechanism_param import MechanismParam as MechanismParam from .history_list_params import HistoryListParams as HistoryListParams from .policy_create_params import PolicyCreateParams as PolicyCreateParams from .policy_update_params import PolicyUpdateParams as PolicyUpdateParams diff --git a/src/cloudflare/types/alerting/destinations/__init__.py b/src/cloudflare/types/alerting/destinations/__init__.py index 01c529883fd..727eaa8ac42 100644 --- a/src/cloudflare/types/alerting/destinations/__init__.py +++ b/src/cloudflare/types/alerting/destinations/__init__.py @@ -2,8 +2,8 @@ from __future__ import annotations +from .webhooks import Webhooks as Webhooks from .pagerduty import Pagerduty as Pagerduty -from .alerting_webhooks import AlertingWebhooks as AlertingWebhooks from .eligible_get_response import EligibleGetResponse as EligibleGetResponse from .webhook_create_params import WebhookCreateParams as WebhookCreateParams from .webhook_update_params import WebhookUpdateParams as WebhookUpdateParams diff --git a/src/cloudflare/types/alerting/destinations/alerting_webhooks.py b/src/cloudflare/types/alerting/destinations/webhooks.py similarity index 95% rename from src/cloudflare/types/alerting/destinations/alerting_webhooks.py rename to src/cloudflare/types/alerting/destinations/webhooks.py index a2dc5b27d59..36fb89342c0 100644 --- a/src/cloudflare/types/alerting/destinations/alerting_webhooks.py +++ b/src/cloudflare/types/alerting/destinations/webhooks.py @@ -6,10 +6,10 @@ from ...._models import BaseModel -__all__ = ["AlertingWebhooks"] +__all__ = ["Webhooks"] -class AlertingWebhooks(BaseModel): +class Webhooks(BaseModel): id: Optional[str] = None """The unique identifier of a webhook""" diff --git a/src/cloudflare/types/alerting/filters.py b/src/cloudflare/types/alerting/filter.py similarity index 98% rename from src/cloudflare/types/alerting/filters.py rename to src/cloudflare/types/alerting/filter.py index 03f9104611c..698d92331be 100644 --- a/src/cloudflare/types/alerting/filters.py +++ b/src/cloudflare/types/alerting/filter.py @@ -5,10 +5,10 @@ from ..._models import BaseModel -__all__ = ["Filters"] +__all__ = ["Filter"] -class Filters(BaseModel): +class Filter(BaseModel): actions: Optional[List[str]] = None """Usage depends on specific alert type""" diff --git a/src/cloudflare/types/alerting/filters_param.py b/src/cloudflare/types/alerting/filter_param.py similarity index 98% rename from src/cloudflare/types/alerting/filters_param.py rename to src/cloudflare/types/alerting/filter_param.py index 8fa29b2146d..12665020ea4 100644 --- a/src/cloudflare/types/alerting/filters_param.py +++ b/src/cloudflare/types/alerting/filter_param.py @@ -5,10 +5,10 @@ from typing import List from typing_extensions import Literal, TypedDict -__all__ = ["FiltersParam"] +__all__ = ["FilterParam"] -class FiltersParam(TypedDict, total=False): +class FilterParam(TypedDict, total=False): actions: List[str] """Usage depends on specific alert type""" diff --git a/src/cloudflare/types/alerting/alerting_history.py b/src/cloudflare/types/alerting/history.py similarity index 94% rename from src/cloudflare/types/alerting/alerting_history.py rename to src/cloudflare/types/alerting/history.py index ad3d675fe48..15b1b63b5ec 100644 --- a/src/cloudflare/types/alerting/alerting_history.py +++ b/src/cloudflare/types/alerting/history.py @@ -6,10 +6,10 @@ from ..._models import BaseModel -__all__ = ["AlertingHistory"] +__all__ = ["History"] -class AlertingHistory(BaseModel): +class History(BaseModel): id: Optional[str] = None """UUID""" diff --git a/src/cloudflare/types/alerting/mechanisms.py b/src/cloudflare/types/alerting/mechanism.py similarity index 63% rename from src/cloudflare/types/alerting/mechanisms.py rename to src/cloudflare/types/alerting/mechanism.py index b1f8a37d232..583c4b38651 100644 --- a/src/cloudflare/types/alerting/mechanisms.py +++ b/src/cloudflare/types/alerting/mechanism.py @@ -4,12 +4,12 @@ from ..._models import BaseModel -__all__ = ["Mechanisms", "MechanismsItem"] +__all__ = ["Mechanism", "MechanismItem"] -class MechanismsItem(BaseModel): +class MechanismItem(BaseModel): id: Union[str, str, None] = None """UUID""" -Mechanisms = Dict[str, List[MechanismsItem]] +Mechanism = Dict[str, List[MechanismItem]] diff --git a/src/cloudflare/types/alerting/mechanisms_param.py b/src/cloudflare/types/alerting/mechanism_param.py similarity index 60% rename from src/cloudflare/types/alerting/mechanisms_param.py rename to src/cloudflare/types/alerting/mechanism_param.py index 2fbf9784513..7124a33e3b7 100644 --- a/src/cloudflare/types/alerting/mechanisms_param.py +++ b/src/cloudflare/types/alerting/mechanism_param.py @@ -5,12 +5,12 @@ from typing import Dict, Union, Iterable from typing_extensions import TypedDict -__all__ = ["MechanismsParam", "MechanismsParamItem"] +__all__ = ["MechanismParam", "MechanismParamItem"] -class MechanismsParamItem(TypedDict, total=False): +class MechanismParamItem(TypedDict, total=False): id: Union[str, str] """UUID""" -MechanismsParam = Dict[str, Iterable[MechanismsParamItem]] +MechanismParam = Dict[str, Iterable[MechanismParamItem]] diff --git a/src/cloudflare/types/alerting/policies.py b/src/cloudflare/types/alerting/policy.py similarity index 94% rename from src/cloudflare/types/alerting/policies.py rename to src/cloudflare/types/alerting/policy.py index 9c1d7e611ba..3c760fb16cc 100644 --- a/src/cloudflare/types/alerting/policies.py +++ b/src/cloudflare/types/alerting/policy.py @@ -4,14 +4,14 @@ from datetime import datetime from typing_extensions import Literal -from .filters import Filters +from .filter import Filter from ..._models import BaseModel -from .mechanisms import Mechanisms +from .mechanism import Mechanism -__all__ = ["Policies"] +__all__ = ["Policy"] -class Policies(BaseModel): +class Policy(BaseModel): id: Optional[str] = None """The unique identifier of a notification policy""" @@ -88,14 +88,14 @@ class Policies(BaseModel): enabled: Optional[bool] = None """Whether or not the Notification policy is enabled.""" - filters: Optional[Filters] = None + filters: Optional[Filter] = None """ Optional filters that allow you to be alerted only on a subset of events for that alert type based on some criteria. This is only available for select alert types. See alert type documentation for more details. """ - mechanisms: Optional[Mechanisms] = None + mechanisms: Optional[Mechanism] = None """List of IDs that will be used when dispatching a notification. IDs for email type will be the email address. diff --git a/src/cloudflare/types/alerting/policy_create_params.py b/src/cloudflare/types/alerting/policy_create_params.py index 4427f7d5c9a..b4f04d5443a 100644 --- a/src/cloudflare/types/alerting/policy_create_params.py +++ b/src/cloudflare/types/alerting/policy_create_params.py @@ -4,8 +4,8 @@ from typing_extensions import Literal, Required, TypedDict -from .filters_param import FiltersParam -from .mechanisms_param import MechanismsParam +from .filter_param import FilterParam +from .mechanism_param import MechanismParam __all__ = ["PolicyCreateParams"] @@ -82,7 +82,7 @@ class PolicyCreateParams(TypedDict, total=False): enabled: Required[bool] """Whether or not the Notification policy is enabled.""" - mechanisms: Required[MechanismsParam] + mechanisms: Required[MechanismParam] """List of IDs that will be used when dispatching a notification. IDs for email type will be the email address. @@ -94,7 +94,7 @@ class PolicyCreateParams(TypedDict, total=False): description: str """Optional description for the Notification policy.""" - filters: FiltersParam + filters: FilterParam """ Optional filters that allow you to be alerted only on a subset of events for that alert type based on some criteria. This is only available for select alert diff --git a/src/cloudflare/types/alerting/policy_param.py b/src/cloudflare/types/alerting/policy_param.py new file mode 100644 index 00000000000..5a414759d04 --- /dev/null +++ b/src/cloudflare/types/alerting/policy_param.py @@ -0,0 +1,97 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, TypedDict + +from .filter_param import FilterParam +from .mechanism_param import MechanismParam + +__all__ = ["PolicyParam"] + + +class PolicyParam(TypedDict, total=False): + alert_type: Literal[ + "access_custom_certificate_expiration_type", + "advanced_ddos_attack_l4_alert", + "advanced_ddos_attack_l7_alert", + "advanced_http_alert_error", + "bgp_hijack_notification", + "billing_usage_alert", + "block_notification_block_removed", + "block_notification_new_block", + "block_notification_review_rejected", + "brand_protection_alert", + "brand_protection_digest", + "clickhouse_alert_fw_anomaly", + "clickhouse_alert_fw_ent_anomaly", + "custom_ssl_certificate_event_type", + "dedicated_ssl_certificate_event_type", + "dos_attack_l4", + "dos_attack_l7", + "expiring_service_token_alert", + "failing_logpush_job_disabled_alert", + "fbm_auto_advertisement", + "fbm_dosd_attack", + "fbm_volumetric_attack", + "health_check_status_notification", + "hostname_aop_custom_certificate_expiration_type", + "http_alert_edge_error", + "http_alert_origin_error", + "incident_alert", + "load_balancing_health_alert", + "load_balancing_pool_enablement_alert", + "logo_match_alert", + "magic_tunnel_health_check_event", + "maintenance_event_notification", + "mtls_certificate_store_certificate_expiration_type", + "pages_event_alert", + "radar_notification", + "real_origin_monitoring", + "scriptmonitor_alert_new_code_change_detections", + "scriptmonitor_alert_new_hosts", + "scriptmonitor_alert_new_malicious_hosts", + "scriptmonitor_alert_new_malicious_scripts", + "scriptmonitor_alert_new_malicious_url", + "scriptmonitor_alert_new_max_length_resource_url", + "scriptmonitor_alert_new_resources", + "secondary_dns_all_primaries_failing", + "secondary_dns_primaries_failing", + "secondary_dns_zone_successfully_updated", + "secondary_dns_zone_validation_warning", + "sentinel_alert", + "stream_live_notifications", + "traffic_anomalies_alert", + "tunnel_health_event", + "tunnel_update_event", + "universal_ssl_event_type", + "web_analytics_metrics_update", + "zone_aop_custom_certificate_expiration_type", + ] + """Refers to which event will trigger a Notification dispatch. + + You can use the endpoint to get available alert types which then will give you a + list of possible values. + """ + + description: str + """Optional description for the Notification policy.""" + + enabled: bool + """Whether or not the Notification policy is enabled.""" + + filters: FilterParam + """ + Optional filters that allow you to be alerted only on a subset of events for + that alert type based on some criteria. This is only available for select alert + types. See alert type documentation for more details. + """ + + mechanisms: MechanismParam + """List of IDs that will be used when dispatching a notification. + + IDs for email type will be the email address. + """ + + name: str + """Name of the policy.""" diff --git a/src/cloudflare/types/alerting/policy_update_params.py b/src/cloudflare/types/alerting/policy_update_params.py index 0aff9faf028..7d1258c2bc5 100644 --- a/src/cloudflare/types/alerting/policy_update_params.py +++ b/src/cloudflare/types/alerting/policy_update_params.py @@ -4,8 +4,8 @@ from typing_extensions import Literal, Required, TypedDict -from .filters_param import FiltersParam -from .mechanisms_param import MechanismsParam +from .filter_param import FilterParam +from .mechanism_param import MechanismParam __all__ = ["PolicyUpdateParams"] @@ -83,14 +83,14 @@ class PolicyUpdateParams(TypedDict, total=False): enabled: bool """Whether or not the Notification policy is enabled.""" - filters: FiltersParam + filters: FilterParam """ Optional filters that allow you to be alerted only on a subset of events for that alert type based on some criteria. This is only available for select alert types. See alert type documentation for more details. """ - mechanisms: MechanismsParam + mechanisms: MechanismParam """List of IDs that will be used when dispatching a notification. IDs for email type will be the email address. diff --git a/src/cloudflare/types/workers/scripts/versions/binding_item_param.py b/src/cloudflare/types/binding_param.py similarity index 55% rename from src/cloudflare/types/workers/scripts/versions/binding_item_param.py rename to src/cloudflare/types/binding_param.py index 04fab12ce13..478be46927b 100644 --- a/src/cloudflare/types/workers/scripts/versions/binding_item_param.py +++ b/src/cloudflare/types/binding_param.py @@ -5,15 +5,15 @@ from typing import Union from typing_extensions import Literal, Required, TypedDict -from ....d1_binding_param import D1BindingParam -from ....r2_binding_param import R2BindingParam -from ....service_binding_param import ServiceBindingParam -from ....mtls_cert_binding_param import MTLSCERTBindingParam -from ....kv_namespace_binding_param import KVNamespaceBindingParam -from ....durable_object_binding_param import DurableObjectBindingParam -from ....dispatch_namespace_binding_param import DispatchNamespaceBindingParam +from .d1_binding_param import D1BindingParam +from .r2_binding_param import R2BindingParam +from .service_binding_param import ServiceBindingParam +from .mtls_cert_binding_param import MTLSCERTBindingParam +from .kv_namespace_binding_param import KVNamespaceBindingParam +from .durable_object_binding_param import DurableObjectBindingParam +from .dispatch_namespace_binding_param import DispatchNamespaceBindingParam -__all__ = ["BindingItemParam", "WorkersQueueBinding"] +__all__ = ["BindingParam", "WorkersQueueBinding"] class WorkersQueueBinding(TypedDict, total=False): @@ -24,7 +24,7 @@ class WorkersQueueBinding(TypedDict, total=False): """The class of resource that the binding provides.""" -BindingItemParam = Union[ +BindingParam = Union[ KVNamespaceBindingParam, ServiceBindingParam, DurableObjectBindingParam, diff --git a/src/cloudflare/types/challenges/__init__.py b/src/cloudflare/types/challenges/__init__.py index 22e66506673..86f54101327 100644 --- a/src/cloudflare/types/challenges/__init__.py +++ b/src/cloudflare/types/challenges/__init__.py @@ -2,10 +2,10 @@ from __future__ import annotations -from .challenges_widget import ChallengesWidget as ChallengesWidget +from .widget import Widget as Widget +from .widget_domain import WidgetDomain as WidgetDomain +from .widget_domain_item import WidgetDomainItem as WidgetDomainItem from .widget_list_params import WidgetListParams as WidgetListParams from .widget_create_params import WidgetCreateParams as WidgetCreateParams from .widget_update_params import WidgetUpdateParams as WidgetUpdateParams -from .challenges_widget_list import ChallengesWidgetList as ChallengesWidgetList -from .challenges_widget_list_item import ChallengesWidgetListItem as ChallengesWidgetListItem from .widget_rotate_secret_params import WidgetRotateSecretParams as WidgetRotateSecretParams diff --git a/src/cloudflare/types/challenges/challenges_widget_list_item.py b/src/cloudflare/types/challenges/challenges_widget_list_item.py deleted file mode 100644 index fcc5472ccc8..00000000000 --- a/src/cloudflare/types/challenges/challenges_widget_list_item.py +++ /dev/null @@ -1,6 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -__all__ = ["ChallengesWidgetListItem"] - -ChallengesWidgetListItem = str diff --git a/src/cloudflare/types/challenges/challenges_widget.py b/src/cloudflare/types/challenges/widget.py similarity index 91% rename from src/cloudflare/types/challenges/challenges_widget.py rename to src/cloudflare/types/challenges/widget.py index 25dd3a000ad..06a4a3ace0f 100644 --- a/src/cloudflare/types/challenges/challenges_widget.py +++ b/src/cloudflare/types/challenges/widget.py @@ -5,11 +5,12 @@ from typing_extensions import Literal from ..._models import BaseModel +from .widget_domain_item import WidgetDomainItem -__all__ = ["ChallengesWidget"] +__all__ = ["Widget"] -class ChallengesWidget(BaseModel): +class Widget(BaseModel): bot_fight_mode: bool """ If bot_fight_mode is set to `true`, Cloudflare issues computationally expensive @@ -25,7 +26,7 @@ class ChallengesWidget(BaseModel): created_on: datetime """When the widget was created.""" - domains: List[str] + domains: List[WidgetDomainItem] mode: Literal["non-interactive", "invisible", "managed"] """Widget Mode""" diff --git a/src/cloudflare/types/challenges/widget_create_params.py b/src/cloudflare/types/challenges/widget_create_params.py index e82e70921d5..6b2f52b0c22 100644 --- a/src/cloudflare/types/challenges/widget_create_params.py +++ b/src/cloudflare/types/challenges/widget_create_params.py @@ -5,7 +5,7 @@ from typing import List from typing_extensions import Literal, Required, TypedDict -from .challenges_widget_list_item import ChallengesWidgetListItem +from .widget_domain_item import WidgetDomainItem __all__ = ["WidgetCreateParams"] @@ -14,7 +14,7 @@ class WidgetCreateParams(TypedDict, total=False): account_id: Required[str] """Identifier""" - domains: Required[List[ChallengesWidgetListItem]] + domains: Required[List[WidgetDomainItem]] mode: Required[Literal["non-interactive", "invisible", "managed"]] """Widget Mode""" diff --git a/src/cloudflare/types/challenges/challenges_widget_list.py b/src/cloudflare/types/challenges/widget_domain.py similarity index 90% rename from src/cloudflare/types/challenges/challenges_widget_list.py rename to src/cloudflare/types/challenges/widget_domain.py index c7b05f2f592..05629ba488d 100644 --- a/src/cloudflare/types/challenges/challenges_widget_list.py +++ b/src/cloudflare/types/challenges/widget_domain.py @@ -5,11 +5,12 @@ from typing_extensions import Literal from ..._models import BaseModel +from .widget_domain_item import WidgetDomainItem -__all__ = ["ChallengesWidgetList"] +__all__ = ["WidgetDomain"] -class ChallengesWidgetList(BaseModel): +class WidgetDomain(BaseModel): bot_fight_mode: bool """ If bot_fight_mode is set to `true`, Cloudflare issues computationally expensive @@ -25,7 +26,7 @@ class ChallengesWidgetList(BaseModel): created_on: datetime """When the widget was created.""" - domains: List[str] + domains: List[WidgetDomainItem] mode: Literal["non-interactive", "invisible", "managed"] """Widget Mode""" diff --git a/src/cloudflare/types/magic_transit/colo_regions_item.py b/src/cloudflare/types/challenges/widget_domain_item.py similarity index 62% rename from src/cloudflare/types/magic_transit/colo_regions_item.py rename to src/cloudflare/types/challenges/widget_domain_item.py index e3d69f9d86e..19cc3c7d52c 100644 --- a/src/cloudflare/types/magic_transit/colo_regions_item.py +++ b/src/cloudflare/types/challenges/widget_domain_item.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -__all__ = ["ColoRegionsItem"] +__all__ = ["WidgetDomainItem"] -ColoRegionsItem = str +WidgetDomainItem = str diff --git a/src/cloudflare/types/challenges/widget_update_params.py b/src/cloudflare/types/challenges/widget_update_params.py index 5912619cb23..a26b5aa309f 100644 --- a/src/cloudflare/types/challenges/widget_update_params.py +++ b/src/cloudflare/types/challenges/widget_update_params.py @@ -5,7 +5,7 @@ from typing import List from typing_extensions import Literal, Required, TypedDict -from .challenges_widget_list_item import ChallengesWidgetListItem +from .widget_domain_item import WidgetDomainItem __all__ = ["WidgetUpdateParams"] @@ -14,7 +14,7 @@ class WidgetUpdateParams(TypedDict, total=False): account_id: Required[str] """Identifier""" - domains: Required[List[ChallengesWidgetListItem]] + domains: Required[List[WidgetDomainItem]] mode: Required[Literal["non-interactive", "invisible", "managed"]] """Widget Mode""" diff --git a/src/cloudflare/types/check_region_item.py b/src/cloudflare/types/check_region_item.py deleted file mode 100644 index b5339cb1042..00000000000 --- a/src/cloudflare/types/check_region_item.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal - -__all__ = ["CheckRegionItem"] - -CheckRegionItem = Literal[ - "WNAM", "ENAM", "WEU", "EEU", "NSAM", "SSAM", "OC", "ME", "NAF", "SAF", "IN", "SEAS", "NEAS", "ALL_REGIONS" -] diff --git a/src/cloudflare/types/cloudforce_one/__init__.py b/src/cloudflare/types/cloudforce_one/__init__.py index 91aa0651ad2..0283b84c64d 100644 --- a/src/cloudflare/types/cloudforce_one/__init__.py +++ b/src/cloudflare/types/cloudforce_one/__init__.py @@ -2,11 +2,11 @@ from __future__ import annotations +from .item import Item as Item +from .quota import Quota as Quota +from .list_item import ListItem as ListItem +from .request_types import RequestTypes as RequestTypes +from .request_constants import RequestConstants as RequestConstants from .request_list_params import RequestListParams as RequestListParams -from .cloudforce_one_quota import CloudforceOneQuota as CloudforceOneQuota from .request_create_params import RequestCreateParams as RequestCreateParams from .request_update_params import RequestUpdateParams as RequestUpdateParams -from .cloudforce_one_request_item import CloudforceOneRequestItem as CloudforceOneRequestItem -from .cloudforce_one_request_types import CloudforceOneRequestTypes as CloudforceOneRequestTypes -from .cloudforce_one_request_constants import CloudforceOneRequestConstants as CloudforceOneRequestConstants -from .cloudforce_one_request_list_item import CloudforceOneRequestListItem as CloudforceOneRequestListItem diff --git a/src/cloudflare/types/cloudforce_one/cloudforce_one_request_item.py b/src/cloudflare/types/cloudforce_one/item.py similarity index 92% rename from src/cloudflare/types/cloudforce_one/cloudforce_one_request_item.py rename to src/cloudflare/types/cloudforce_one/item.py index 4734f68a35e..fc01fe5c174 100644 --- a/src/cloudflare/types/cloudforce_one/cloudforce_one_request_item.py +++ b/src/cloudflare/types/cloudforce_one/item.py @@ -6,10 +6,10 @@ from ..._models import BaseModel -__all__ = ["CloudforceOneRequestItem"] +__all__ = ["Item"] -class CloudforceOneRequestItem(BaseModel): +class Item(BaseModel): id: str """UUID""" diff --git a/src/cloudflare/types/cloudforce_one/cloudforce_one_request_list_item.py b/src/cloudflare/types/cloudforce_one/list_item.py similarity index 92% rename from src/cloudflare/types/cloudforce_one/cloudforce_one_request_list_item.py rename to src/cloudflare/types/cloudforce_one/list_item.py index 6cbd9f40e6b..99703584af8 100644 --- a/src/cloudflare/types/cloudforce_one/cloudforce_one_request_list_item.py +++ b/src/cloudflare/types/cloudforce_one/list_item.py @@ -6,10 +6,10 @@ from ..._models import BaseModel -__all__ = ["CloudforceOneRequestListItem"] +__all__ = ["ListItem"] -class CloudforceOneRequestListItem(BaseModel): +class ListItem(BaseModel): id: str """UUID""" diff --git a/src/cloudflare/types/cloudforce_one/cloudforce_one_quota.py b/src/cloudflare/types/cloudforce_one/quota.py similarity index 89% rename from src/cloudflare/types/cloudforce_one/cloudforce_one_quota.py rename to src/cloudflare/types/cloudforce_one/quota.py index 10e6d58bab8..8eff78bfcc5 100644 --- a/src/cloudflare/types/cloudforce_one/cloudforce_one_quota.py +++ b/src/cloudflare/types/cloudforce_one/quota.py @@ -5,10 +5,10 @@ from ..._models import BaseModel -__all__ = ["CloudforceOneQuota"] +__all__ = ["Quota"] -class CloudforceOneQuota(BaseModel): +class Quota(BaseModel): anniversary_date: Optional[datetime] = None """Anniversary date is when annual quota limit is refresh""" diff --git a/src/cloudflare/types/cloudforce_one/cloudforce_one_request_constants.py b/src/cloudflare/types/cloudforce_one/request_constants.py similarity index 83% rename from src/cloudflare/types/cloudforce_one/cloudforce_one_request_constants.py rename to src/cloudflare/types/cloudforce_one/request_constants.py index ccdf718a635..d3679f51cdd 100644 --- a/src/cloudflare/types/cloudforce_one/cloudforce_one_request_constants.py +++ b/src/cloudflare/types/cloudforce_one/request_constants.py @@ -5,10 +5,10 @@ from ..._models import BaseModel -__all__ = ["CloudforceOneRequestConstants"] +__all__ = ["RequestConstants"] -class CloudforceOneRequestConstants(BaseModel): +class RequestConstants(BaseModel): priority: Optional[List[Literal["routine", "high", "urgent"]]] = None status: Optional[List[Literal["open", "accepted", "reported", "approved", "completed", "declined"]]] = None diff --git a/src/cloudflare/types/pagerules/zone_pagerule_settings.py b/src/cloudflare/types/cloudforce_one/request_types.py similarity index 61% rename from src/cloudflare/types/pagerules/zone_pagerule_settings.py rename to src/cloudflare/types/cloudforce_one/request_types.py index d7c22fbd6ed..829b4ebe664 100644 --- a/src/cloudflare/types/pagerules/zone_pagerule_settings.py +++ b/src/cloudflare/types/cloudforce_one/request_types.py @@ -2,6 +2,6 @@ from typing import List -__all__ = ["ZonePageruleSettings"] +__all__ = ["RequestTypes"] -ZonePageruleSettings = List[object] +RequestTypes = List[str] diff --git a/src/cloudflare/types/cloudforce_one/requests/__init__.py b/src/cloudflare/types/cloudforce_one/requests/__init__.py index e0b1c0a3abb..9b414b8a739 100644 --- a/src/cloudflare/types/cloudforce_one/requests/__init__.py +++ b/src/cloudflare/types/cloudforce_one/requests/__init__.py @@ -2,11 +2,12 @@ from __future__ import annotations +from .message import Message as Message +from .priority import Priority as Priority +from .label_item import LabelItem as LabelItem from .message_get_params import MessageGetParams as MessageGetParams from .message_get_response import MessageGetResponse as MessageGetResponse from .message_create_params import MessageCreateParams as MessageCreateParams from .message_update_params import MessageUpdateParams as MessageUpdateParams from .priority_create_params import PriorityCreateParams as PriorityCreateParams from .priority_update_params import PriorityUpdateParams as PriorityUpdateParams -from .cloudforce_one_priority_item import CloudforceOnePriorityItem as CloudforceOnePriorityItem -from .cloudforce_one_request_message_item import CloudforceOneRequestMessageItem as CloudforceOneRequestMessageItem diff --git a/src/cloudflare/types/user/tokens/token_value.py b/src/cloudflare/types/cloudforce_one/requests/label_item.py similarity index 67% rename from src/cloudflare/types/user/tokens/token_value.py rename to src/cloudflare/types/cloudforce_one/requests/label_item.py index 8087bf31b1e..99a073e7d4e 100644 --- a/src/cloudflare/types/user/tokens/token_value.py +++ b/src/cloudflare/types/cloudforce_one/requests/label_item.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -__all__ = ["TokenValue"] +__all__ = ["LabelItem"] -TokenValue = str +LabelItem = str diff --git a/src/cloudflare/types/cloudforce_one/requests/cloudforce_one_request_message_item.py b/src/cloudflare/types/cloudforce_one/requests/message.py similarity index 84% rename from src/cloudflare/types/cloudforce_one/requests/cloudforce_one_request_message_item.py rename to src/cloudflare/types/cloudforce_one/requests/message.py index 0b5b47381ee..b36882e68c4 100644 --- a/src/cloudflare/types/cloudforce_one/requests/cloudforce_one_request_message_item.py +++ b/src/cloudflare/types/cloudforce_one/requests/message.py @@ -5,10 +5,10 @@ from ...._models import BaseModel -__all__ = ["CloudforceOneRequestMessageItem"] +__all__ = ["Message"] -class CloudforceOneRequestMessageItem(BaseModel): +class Message(BaseModel): id: int """Message ID""" diff --git a/src/cloudflare/types/cloudforce_one/requests/message_get_response.py b/src/cloudflare/types/cloudforce_one/requests/message_get_response.py index e793f236d52..52f2c5cf762 100644 --- a/src/cloudflare/types/cloudforce_one/requests/message_get_response.py +++ b/src/cloudflare/types/cloudforce_one/requests/message_get_response.py @@ -2,8 +2,8 @@ from typing import List -from .cloudforce_one_request_message_item import CloudforceOneRequestMessageItem +from .message import Message __all__ = ["MessageGetResponse"] -MessageGetResponse = List[CloudforceOneRequestMessageItem] +MessageGetResponse = List[Message] diff --git a/src/cloudflare/types/cloudforce_one/requests/cloudforce_one_priority_item.py b/src/cloudflare/types/cloudforce_one/requests/priority.py similarity index 84% rename from src/cloudflare/types/cloudforce_one/requests/cloudforce_one_priority_item.py rename to src/cloudflare/types/cloudforce_one/requests/priority.py index 3d57a3099e1..4fb3e719e81 100644 --- a/src/cloudflare/types/cloudforce_one/requests/cloudforce_one_priority_item.py +++ b/src/cloudflare/types/cloudforce_one/requests/priority.py @@ -5,18 +5,19 @@ from typing_extensions import Literal from ...._models import BaseModel +from .label_item import LabelItem -__all__ = ["CloudforceOnePriorityItem"] +__all__ = ["Priority"] -class CloudforceOnePriorityItem(BaseModel): +class Priority(BaseModel): id: str """UUID""" created: datetime """Priority creation time""" - labels: List[str] + labels: List[LabelItem] """List of labels""" priority: int diff --git a/src/cloudflare/types/cloudforce_one/requests/priority_create_params.py b/src/cloudflare/types/cloudforce_one/requests/priority_create_params.py index 15f32c8e6e4..71b6e46fabc 100644 --- a/src/cloudflare/types/cloudforce_one/requests/priority_create_params.py +++ b/src/cloudflare/types/cloudforce_one/requests/priority_create_params.py @@ -5,11 +5,13 @@ from typing import List from typing_extensions import Literal, Required, TypedDict +from .label_item import LabelItem + __all__ = ["PriorityCreateParams"] class PriorityCreateParams(TypedDict, total=False): - labels: Required[List[str]] + labels: Required[List[LabelItem]] """List of labels""" priority: Required[int] diff --git a/src/cloudflare/types/cloudforce_one/requests/priority_update_params.py b/src/cloudflare/types/cloudforce_one/requests/priority_update_params.py index 9b6663753ac..0f4ddd03f01 100644 --- a/src/cloudflare/types/cloudforce_one/requests/priority_update_params.py +++ b/src/cloudflare/types/cloudforce_one/requests/priority_update_params.py @@ -5,6 +5,8 @@ from typing import List from typing_extensions import Literal, Required, TypedDict +from .label_item import LabelItem + __all__ = ["PriorityUpdateParams"] @@ -12,7 +14,7 @@ class PriorityUpdateParams(TypedDict, total=False): account_identifier: Required[str] """Identifier""" - labels: Required[List[str]] + labels: Required[List[LabelItem]] """List of labels""" priority: Required[int] diff --git a/src/cloudflare/types/configuration.py b/src/cloudflare/types/configuration.py new file mode 100644 index 00000000000..918055bd6cb --- /dev/null +++ b/src/cloudflare/types/configuration.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .._models import BaseModel + +__all__ = ["Configuration"] + + +class Configuration(BaseModel): + password: str + """The password required to access your origin database. + + This value is write-only and never returned by the API. + """ diff --git a/src/cloudflare/types/configuration_param.py b/src/cloudflare/types/configuration_param.py new file mode 100644 index 00000000000..03636c6abd8 --- /dev/null +++ b/src/cloudflare/types/configuration_param.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["ConfigurationParam"] + + +class ConfigurationParam(TypedDict, total=False): + password: Required[str] + """The password required to access your origin database. + + This value is write-only and never returned by the API. + """ diff --git a/src/cloudflare/types/custom_certificate.py b/src/cloudflare/types/custom_certificate.py index 18476cff9f3..13070e06d2e 100644 --- a/src/cloudflare/types/custom_certificate.py +++ b/src/cloudflare/types/custom_certificate.py @@ -6,7 +6,7 @@ from .._models import BaseModel from .geo_restrictions import GeoRestrictions -from .keyless_certificate_hostname import KeylessCertificateHostname +from .keyless_certificate import KeylessCertificate from .unnamed_schema_ref_16aca57bde2963201c7e6e895436c1c1 import UnnamedSchemaRef16aca57bde2963201c7e6e895436c1c1 __all__ = ["CustomCertificate"] @@ -66,7 +66,7 @@ class CustomCertificate(BaseModel): for optimal performance. """ - keyless_server: Optional[KeylessCertificateHostname] = None + keyless_server: Optional[KeylessCertificate] = None policy: Optional[str] = None """ diff --git a/src/cloudflare/types/ssl.py b/src/cloudflare/types/custom_hostname.py similarity index 60% rename from src/cloudflare/types/ssl.py rename to src/cloudflare/types/custom_hostname.py index 952e7708259..1b8f4d4d1a7 100644 --- a/src/cloudflare/types/ssl.py +++ b/src/cloudflare/types/custom_hostname.py @@ -9,10 +9,46 @@ from .unnamed_schema_ref_16aca57bde2963201c7e6e895436c1c1 import UnnamedSchemaRef16aca57bde2963201c7e6e895436c1c1 from .unnamed_schema_ref_78adb375f06c6d462dd92b99e2ecf510 import UnnamedSchemaRef78adb375f06c6d462dd92b99e2ecf510 -__all__ = ["SSL", "Settings", "ValidationError", "ValidationRecord"] +__all__ = [ + "CustomHostname", + "CustomMetadata", + "OwnershipVerification", + "OwnershipVerificationHTTP", + "SSL", + "SSLSettings", + "SSLValidationError", + "SSLValidationRecord", +] -class Settings(BaseModel): +class CustomMetadata(BaseModel): + key: Optional[str] = None + """Unique metadata for this hostname.""" + + +class OwnershipVerification(BaseModel): + name: Optional[str] = None + """DNS Name for record.""" + + type: Optional[Literal["txt"]] = None + """DNS Record type.""" + + value: Optional[str] = None + """Content for the record.""" + + +class OwnershipVerificationHTTP(BaseModel): + http_body: Optional[str] = None + """Token to be served.""" + + http_url: Optional[str] = None + """ + The HTTP URL that will be checked during custom hostname verification and where + the customer should host the token. + """ + + +class SSLSettings(BaseModel): ciphers: Optional[List[str]] = None """An allowlist of ciphers for TLS termination. @@ -32,12 +68,12 @@ class Settings(BaseModel): """Whether or not TLS 1.3 is enabled.""" -class ValidationError(BaseModel): +class SSLValidationError(BaseModel): message: Optional[str] = None """A domain validation error.""" -class ValidationRecord(BaseModel): +class SSLValidationRecord(BaseModel): emails: Optional[List[object]] = None """ The set of email addresses that the certificate authority (CA) will use to @@ -105,7 +141,7 @@ class SSL(BaseModel): serial_number: Optional[str] = None """The serial number on a custom uploaded certificate.""" - settings: Optional[Settings] = None + settings: Optional[SSLSettings] = None """SSL specific settings.""" signature: Optional[str] = None @@ -147,13 +183,79 @@ class SSL(BaseModel): uploaded_on: Optional[datetime] = None """The time the custom certificate was uploaded.""" - validation_errors: Optional[List[ValidationError]] = None + validation_errors: Optional[List[SSLValidationError]] = None """ Domain validation errors that have been received by the certificate authority (CA). """ - validation_records: Optional[List[ValidationRecord]] = None + validation_records: Optional[List[SSLValidationRecord]] = None wildcard: Optional[bool] = None """Indicates whether the certificate covers a wildcard.""" + + +class CustomHostname(BaseModel): + id: Optional[str] = None + """Identifier""" + + created_at: Optional[datetime] = None + """This is the time the hostname was created.""" + + custom_metadata: Optional[CustomMetadata] = None + """These are per-hostname (customer) settings.""" + + custom_origin_server: Optional[str] = None + """ + a valid hostname that’s been added to your DNS zone as an A, AAAA, or CNAME + record. + """ + + custom_origin_sni: Optional[str] = None + """ + A hostname that will be sent to your custom origin server as SNI for TLS + handshake. This can be a valid subdomain of the zone or custom origin server + name or the string ':request_host_header:' which will cause the host header in + the request to be used as SNI. Not configurable with default/fallback origin + server. + """ + + hostname: Optional[str] = None + """The custom hostname that will point to your hostname via CNAME.""" + + ownership_verification: Optional[OwnershipVerification] = None + """This is a record which can be placed to activate a hostname.""" + + ownership_verification_http: Optional[OwnershipVerificationHTTP] = None + """ + This presents the token to be served by the given http url to activate a + hostname. + """ + + ssl: Optional[SSL] = None + """SSL properties for the custom hostname.""" + + status: Optional[ + Literal[ + "active", + "pending", + "active_redeploying", + "moved", + "pending_deletion", + "deleted", + "pending_blocked", + "pending_migration", + "pending_provisioned", + "test_pending", + "test_active", + "test_active_apex", + "test_blocked", + "test_failed", + "provisioned", + "blocked", + ] + ] = None + """Status of the hostname's activation.""" + + verification_errors: Optional[List[object]] = None + """These are errors that were encountered while trying to activate a hostname.""" diff --git a/src/cloudflare/types/custom_hostname_create_response.py b/src/cloudflare/types/custom_hostname_create_response.py deleted file mode 100644 index 5cfc2e42a29..00000000000 --- a/src/cloudflare/types/custom_hostname_create_response.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - - -from .ssl import SSL -from .._models import BaseModel - -__all__ = ["CustomHostnameCreateResponse"] - - -class CustomHostnameCreateResponse(BaseModel): - id: str - """Identifier""" - - hostname: str - """The custom hostname that will point to your hostname via CNAME.""" - - ssl: SSL - """SSL properties for the custom hostname.""" diff --git a/src/cloudflare/types/custom_hostname_edit_response.py b/src/cloudflare/types/custom_hostname_edit_response.py deleted file mode 100644 index 345ce00cada..00000000000 --- a/src/cloudflare/types/custom_hostname_edit_response.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - - -from .ssl import SSL -from .._models import BaseModel - -__all__ = ["CustomHostnameEditResponse"] - - -class CustomHostnameEditResponse(BaseModel): - id: str - """Identifier""" - - hostname: str - """The custom hostname that will point to your hostname via CNAME.""" - - ssl: SSL - """SSL properties for the custom hostname.""" diff --git a/src/cloudflare/types/custom_hostname_get_response.py b/src/cloudflare/types/custom_hostname_get_response.py deleted file mode 100644 index b3fdc712778..00000000000 --- a/src/cloudflare/types/custom_hostname_get_response.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - - -from .ssl import SSL -from .._models import BaseModel - -__all__ = ["CustomHostnameGetResponse"] - - -class CustomHostnameGetResponse(BaseModel): - id: str - """Identifier""" - - hostname: str - """The custom hostname that will point to your hostname via CNAME.""" - - ssl: SSL - """SSL properties for the custom hostname.""" diff --git a/src/cloudflare/types/custom_hostname_list_response.py b/src/cloudflare/types/custom_hostname_list_response.py deleted file mode 100644 index 8b443e4f0c3..00000000000 --- a/src/cloudflare/types/custom_hostname_list_response.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - - -from .ssl import SSL -from .._models import BaseModel - -__all__ = ["CustomHostnameListResponse"] - - -class CustomHostnameListResponse(BaseModel): - id: str - """Identifier""" - - hostname: str - """The custom hostname that will point to your hostname via CNAME.""" - - ssl: SSL - """SSL properties for the custom hostname.""" diff --git a/src/cloudflare/types/d1/__init__.py b/src/cloudflare/types/d1/__init__.py index a442960eab2..ee8808412aa 100644 --- a/src/cloudflare/types/d1/__init__.py +++ b/src/cloudflare/types/d1/__init__.py @@ -2,10 +2,11 @@ from __future__ import annotations -from .d1_query_result import D1QueryResult as D1QueryResult -from .d1_create_database import D1CreateDatabase as D1CreateDatabase -from .d1_database_details import D1DatabaseDetails as D1DatabaseDetails +from .d1 import D1 as D1 +from .query_result import QueryResult as QueryResult from .database_list_params import DatabaseListParams as DatabaseListParams from .database_query_params import DatabaseQueryParams as DatabaseQueryParams from .database_create_params import DatabaseCreateParams as DatabaseCreateParams +from .database_list_response import DatabaseListResponse as DatabaseListResponse from .database_query_response import DatabaseQueryResponse as DatabaseQueryResponse +from .database_create_response import DatabaseCreateResponse as DatabaseCreateResponse diff --git a/src/cloudflare/types/d1/d1_database_details.py b/src/cloudflare/types/d1/d1.py similarity index 87% rename from src/cloudflare/types/d1/d1_database_details.py rename to src/cloudflare/types/d1/d1.py index e467c17dd8a..8db6a1dcb3f 100644 --- a/src/cloudflare/types/d1/d1_database_details.py +++ b/src/cloudflare/types/d1/d1.py @@ -4,10 +4,10 @@ from ..._models import BaseModel -__all__ = ["D1DatabaseDetails"] +__all__ = ["D1"] -class D1DatabaseDetails(BaseModel): +class D1(BaseModel): created_at: Optional[str] = None """Specifies the timestamp the resource was created as an ISO8601 string.""" diff --git a/src/cloudflare/types/d1/database_create_response.py b/src/cloudflare/types/d1/database_create_response.py new file mode 100644 index 00000000000..5f5715433e1 --- /dev/null +++ b/src/cloudflare/types/d1/database_create_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel + +__all__ = ["DatabaseCreateResponse"] + + +class DatabaseCreateResponse(BaseModel): + created_at: Optional[str] = None + """Specifies the timestamp the resource was created as an ISO8601 string.""" + + name: Optional[str] = None + + uuid: Optional[str] = None + + version: Optional[str] = None diff --git a/src/cloudflare/types/d1/d1_create_database.py b/src/cloudflare/types/d1/database_list_response.py similarity index 83% rename from src/cloudflare/types/d1/d1_create_database.py rename to src/cloudflare/types/d1/database_list_response.py index 7d947edf15a..5ecb1b94674 100644 --- a/src/cloudflare/types/d1/d1_create_database.py +++ b/src/cloudflare/types/d1/database_list_response.py @@ -4,10 +4,10 @@ from ..._models import BaseModel -__all__ = ["D1CreateDatabase"] +__all__ = ["DatabaseListResponse"] -class D1CreateDatabase(BaseModel): +class DatabaseListResponse(BaseModel): created_at: Optional[str] = None """Specifies the timestamp the resource was created as an ISO8601 string.""" diff --git a/src/cloudflare/types/d1/database_query_response.py b/src/cloudflare/types/d1/database_query_response.py index a0d2bd0a256..4e2d7a949cd 100644 --- a/src/cloudflare/types/d1/database_query_response.py +++ b/src/cloudflare/types/d1/database_query_response.py @@ -2,8 +2,8 @@ from typing import List -from .d1_query_result import D1QueryResult +from .query_result import QueryResult __all__ = ["DatabaseQueryResponse"] -DatabaseQueryResponse = List[D1QueryResult] +DatabaseQueryResponse = List[QueryResult] diff --git a/src/cloudflare/types/d1/d1_query_result.py b/src/cloudflare/types/d1/query_result.py similarity index 89% rename from src/cloudflare/types/d1/d1_query_result.py rename to src/cloudflare/types/d1/query_result.py index 1e70eade791..7b6447cd084 100644 --- a/src/cloudflare/types/d1/d1_query_result.py +++ b/src/cloudflare/types/d1/query_result.py @@ -4,7 +4,7 @@ from ..._models import BaseModel -__all__ = ["D1QueryResult", "Meta"] +__all__ = ["QueryResult", "Meta"] class Meta(BaseModel): @@ -23,7 +23,7 @@ class Meta(BaseModel): size_after: Optional[float] = None -class D1QueryResult(BaseModel): +class QueryResult(BaseModel): meta: Optional[Meta] = None results: Optional[List[object]] = None diff --git a/src/cloudflare/types/diagnostics/__init__.py b/src/cloudflare/types/diagnostics/__init__.py index 9e8661dc088..94d7a66c1ee 100644 --- a/src/cloudflare/types/diagnostics/__init__.py +++ b/src/cloudflare/types/diagnostics/__init__.py @@ -2,6 +2,6 @@ from __future__ import annotations +from .traceroute import Traceroute as Traceroute from .traceroute_create_params import TracerouteCreateParams as TracerouteCreateParams from .traceroute_create_response import TracerouteCreateResponse as TracerouteCreateResponse -from .magic_transit_target_result import MagicTransitTargetResult as MagicTransitTargetResult diff --git a/src/cloudflare/types/diagnostics/magic_transit_target_result.py b/src/cloudflare/types/diagnostics/traceroute.py similarity index 95% rename from src/cloudflare/types/diagnostics/magic_transit_target_result.py rename to src/cloudflare/types/diagnostics/traceroute.py index 668dce7698b..d8af2e15cbc 100644 --- a/src/cloudflare/types/diagnostics/magic_transit_target_result.py +++ b/src/cloudflare/types/diagnostics/traceroute.py @@ -5,7 +5,7 @@ from ..._models import BaseModel -__all__ = ["MagicTransitTargetResult", "Colo", "ColoColo", "ColoHop", "ColoHopNode"] +__all__ = ["Traceroute", "Colo", "ColoColo", "ColoHop", "ColoHopNode"] class ColoColo(BaseModel): @@ -86,7 +86,7 @@ class Colo(BaseModel): """Total time of traceroute in ms.""" -class MagicTransitTargetResult(BaseModel): +class Traceroute(BaseModel): colos: Optional[List[Colo]] = None target: Optional[str] = None diff --git a/src/cloudflare/types/diagnostics/traceroute_create_response.py b/src/cloudflare/types/diagnostics/traceroute_create_response.py index 790033096aa..388d43add11 100644 --- a/src/cloudflare/types/diagnostics/traceroute_create_response.py +++ b/src/cloudflare/types/diagnostics/traceroute_create_response.py @@ -2,8 +2,8 @@ from typing import List -from .magic_transit_target_result import MagicTransitTargetResult +from .traceroute import Traceroute __all__ = ["TracerouteCreateResponse"] -TracerouteCreateResponse = List[MagicTransitTargetResult] +TracerouteCreateResponse = List[Traceroute] diff --git a/src/cloudflare/types/dns/__init__.py b/src/cloudflare/types/dns/__init__.py index 8caa3149394..a861bde5fbf 100644 --- a/src/cloudflare/types/dns/__init__.py +++ b/src/cloudflare/types/dns/__init__.py @@ -5,6 +5,7 @@ from .ttl import TTL as TTL from .record import Record as Record from .a_record import ARecord as ARecord +from .firewall import Firewall as Firewall from .ds_record import DSRecord as DSRecord from .mx_record import MXRecord as MXRecord from .ns_record import NSRecord as NSRecord @@ -20,7 +21,6 @@ from .svcb_record import SVCBRecord as SVCBRecord from .tlsa_record import TLSARecord as TLSARecord from .cname_record import CNAMERecord as CNAMERecord -from .dns_firewall import DNSFirewall as DNSFirewall from .https_record import HTTPSRecord as HTTPSRecord from .naptr_record import NAPTRRecord as NAPTRRecord from .sshfp_record import SSHFPRecord as SSHFPRecord diff --git a/src/cloudflare/types/dns/a_record.py b/src/cloudflare/types/dns/a_record.py index 2ae0c167b7f..0e9c70d175c 100644 --- a/src/cloudflare/types/dns/a_record.py +++ b/src/cloudflare/types/dns/a_record.py @@ -6,6 +6,7 @@ from .ttl import TTL from ..._models import BaseModel +from .record_tags_item import RecordTagsItem from .unnamed_schema_ref_1391721bdb8938d5420a8bc738a44deb import UnnamedSchemaRef1391721bdb8938d5420a8bc738a44deb __all__ = ["ARecord"] @@ -54,7 +55,7 @@ class ARecord(BaseModel): Cloudflare. """ - tags: Optional[List[str]] = None + tags: Optional[List[RecordTagsItem]] = None """Custom tags for the DNS record. This field has no effect on DNS responses.""" ttl: Optional[TTL] = None diff --git a/src/cloudflare/types/dns/aaaa_record.py b/src/cloudflare/types/dns/aaaa_record.py index 6f1beb5aac3..8fbd7c41acf 100644 --- a/src/cloudflare/types/dns/aaaa_record.py +++ b/src/cloudflare/types/dns/aaaa_record.py @@ -6,6 +6,7 @@ from .ttl import TTL from ..._models import BaseModel +from .record_tags_item import RecordTagsItem from .unnamed_schema_ref_1391721bdb8938d5420a8bc738a44deb import UnnamedSchemaRef1391721bdb8938d5420a8bc738a44deb __all__ = ["AAAARecord"] @@ -54,7 +55,7 @@ class AAAARecord(BaseModel): Cloudflare. """ - tags: Optional[List[str]] = None + tags: Optional[List[RecordTagsItem]] = None """Custom tags for the DNS record. This field has no effect on DNS responses.""" ttl: Optional[TTL] = None diff --git a/src/cloudflare/types/dns/analytics/__init__.py b/src/cloudflare/types/dns/analytics/__init__.py index c738816d7fd..e80651539e2 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 import Report as Report from .report_get_params import ReportGetParams as ReportGetParams -from .dns_analytics_report import DNSAnalyticsReport as DNSAnalyticsReport diff --git a/src/cloudflare/types/dns/analytics/dns_analytics_report.py b/src/cloudflare/types/dns/analytics/report.py similarity index 95% rename from src/cloudflare/types/dns/analytics/dns_analytics_report.py rename to src/cloudflare/types/dns/analytics/report.py index bbbc8881e5d..e5210e54879 100644 --- a/src/cloudflare/types/dns/analytics/dns_analytics_report.py +++ b/src/cloudflare/types/dns/analytics/report.py @@ -6,7 +6,7 @@ from ...._models import BaseModel from ...unnamed_schema_ref_6595695ff25b0614667b25f66b7bbaba import UnnamedSchemaRef6595695ff25b0614667b25f66b7bbaba -__all__ = ["DNSAnalyticsReport", "Query"] +__all__ = ["Report", "Query"] class Query(BaseModel): @@ -35,7 +35,7 @@ class Query(BaseModel): """ -class DNSAnalyticsReport(BaseModel): +class Report(BaseModel): data: List[UnnamedSchemaRef6595695ff25b0614667b25f66b7bbaba] """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 96ec042fabd..61b971c4642 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 .by_time import ByTime as ByTime from .bytime_get_params import BytimeGetParams as BytimeGetParams -from .dns_analytics_report_by_time import DNSAnalyticsReportByTime as DNSAnalyticsReportByTime diff --git a/src/cloudflare/types/dns/analytics/reports/dns_analytics_report_by_time.py b/src/cloudflare/types/dns/analytics/reports/by_time.py similarity index 95% rename from src/cloudflare/types/dns/analytics/reports/dns_analytics_report_by_time.py rename to src/cloudflare/types/dns/analytics/reports/by_time.py index a88f08c062a..138f5e3338b 100644 --- a/src/cloudflare/types/dns/analytics/reports/dns_analytics_report_by_time.py +++ b/src/cloudflare/types/dns/analytics/reports/by_time.py @@ -7,7 +7,7 @@ from ....unnamed_schema_ref_65be9614de145bf4a58d0fddf46df7ca import UnnamedSchemaRef65be9614de145bf4a58d0fddf46df7ca from ....unnamed_schema_ref_85b45d163202bbab7456da6b346d9fe2 import UnnamedSchemaRef85b45d163202bbab7456da6b346d9fe2 -__all__ = ["DNSAnalyticsReportByTime", "Data"] +__all__ = ["ByTime", "Data"] class Data(BaseModel): @@ -24,7 +24,7 @@ class Data(BaseModel): """ -class DNSAnalyticsReportByTime(BaseModel): +class ByTime(BaseModel): data: List[Data] """Array with one row per combination of dimension values.""" diff --git a/src/cloudflare/types/dns/caa_record.py b/src/cloudflare/types/dns/caa_record.py index 86d10cdffb8..78bd2086a5b 100644 --- a/src/cloudflare/types/dns/caa_record.py +++ b/src/cloudflare/types/dns/caa_record.py @@ -6,6 +6,7 @@ from .ttl import TTL from ..._models import BaseModel +from .record_tags_item import RecordTagsItem from .unnamed_schema_ref_1391721bdb8938d5420a8bc738a44deb import UnnamedSchemaRef1391721bdb8938d5420a8bc738a44deb __all__ = ["CAARecord", "Data"] @@ -62,7 +63,7 @@ class CAARecord(BaseModel): proxiable: Optional[bool] = None """Whether the record can be proxied by Cloudflare or not.""" - tags: Optional[List[str]] = None + tags: Optional[List[RecordTagsItem]] = None """Custom tags for the DNS record. This field has no effect on DNS responses.""" ttl: Optional[TTL] = None diff --git a/src/cloudflare/types/dns/cert_record.py b/src/cloudflare/types/dns/cert_record.py index b2d02beea48..969866ac8dc 100644 --- a/src/cloudflare/types/dns/cert_record.py +++ b/src/cloudflare/types/dns/cert_record.py @@ -6,6 +6,7 @@ from .ttl import TTL from ..._models import BaseModel +from .record_tags_item import RecordTagsItem from .unnamed_schema_ref_1391721bdb8938d5420a8bc738a44deb import UnnamedSchemaRef1391721bdb8938d5420a8bc738a44deb __all__ = ["CERTRecord", "Data"] @@ -65,7 +66,7 @@ class CERTRecord(BaseModel): proxiable: Optional[bool] = None """Whether the record can be proxied by Cloudflare or not.""" - tags: Optional[List[str]] = None + tags: Optional[List[RecordTagsItem]] = None """Custom tags for the DNS record. This field has no effect on DNS responses.""" ttl: Optional[TTL] = None diff --git a/src/cloudflare/types/dns/cname_record.py b/src/cloudflare/types/dns/cname_record.py index b4d9158c6ae..0ec12580416 100644 --- a/src/cloudflare/types/dns/cname_record.py +++ b/src/cloudflare/types/dns/cname_record.py @@ -6,6 +6,7 @@ from .ttl import TTL from ..._models import BaseModel +from .record_tags_item import RecordTagsItem from .unnamed_schema_ref_1391721bdb8938d5420a8bc738a44deb import UnnamedSchemaRef1391721bdb8938d5420a8bc738a44deb __all__ = ["CNAMERecord"] @@ -54,7 +55,7 @@ class CNAMERecord(BaseModel): Cloudflare. """ - tags: Optional[List[str]] = None + tags: Optional[List[RecordTagsItem]] = None """Custom tags for the DNS record. This field has no effect on DNS responses.""" ttl: Optional[TTL] = None diff --git a/src/cloudflare/types/dns/dnskey_record.py b/src/cloudflare/types/dns/dnskey_record.py index 61a7443d9bd..f7e8e7c495c 100644 --- a/src/cloudflare/types/dns/dnskey_record.py +++ b/src/cloudflare/types/dns/dnskey_record.py @@ -6,6 +6,7 @@ from .ttl import TTL from ..._models import BaseModel +from .record_tags_item import RecordTagsItem from .unnamed_schema_ref_1391721bdb8938d5420a8bc738a44deb import UnnamedSchemaRef1391721bdb8938d5420a8bc738a44deb __all__ = ["DNSKEYRecord", "Data"] @@ -65,7 +66,7 @@ class DNSKEYRecord(BaseModel): proxiable: Optional[bool] = None """Whether the record can be proxied by Cloudflare or not.""" - tags: Optional[List[str]] = None + tags: Optional[List[RecordTagsItem]] = None """Custom tags for the DNS record. This field has no effect on DNS responses.""" ttl: Optional[TTL] = None diff --git a/src/cloudflare/types/dns/ds_record.py b/src/cloudflare/types/dns/ds_record.py index 1839e6d89ac..69302b27198 100644 --- a/src/cloudflare/types/dns/ds_record.py +++ b/src/cloudflare/types/dns/ds_record.py @@ -6,6 +6,7 @@ from .ttl import TTL from ..._models import BaseModel +from .record_tags_item import RecordTagsItem from .unnamed_schema_ref_1391721bdb8938d5420a8bc738a44deb import UnnamedSchemaRef1391721bdb8938d5420a8bc738a44deb __all__ = ["DSRecord", "Data"] @@ -65,7 +66,7 @@ class DSRecord(BaseModel): proxiable: Optional[bool] = None """Whether the record can be proxied by Cloudflare or not.""" - tags: Optional[List[str]] = None + tags: Optional[List[RecordTagsItem]] = None """Custom tags for the DNS record. This field has no effect on DNS responses.""" ttl: Optional[TTL] = None diff --git a/src/cloudflare/types/dns/firewall/__init__.py b/src/cloudflare/types/dns/firewall/__init__.py index f8ee8b14b1c..1e446ac36d1 100644 --- a/src/cloudflare/types/dns/firewall/__init__.py +++ b/src/cloudflare/types/dns/firewall/__init__.py @@ -1,3 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from __future__ import annotations + +from .firewall import Firewall as Firewall diff --git a/src/cloudflare/types/dns/dns_firewall.py b/src/cloudflare/types/dns/firewall/firewall.py similarity index 76% rename from src/cloudflare/types/dns/dns_firewall.py rename to src/cloudflare/types/dns/firewall/firewall.py index 0980990ab55..4c0d9ddc17b 100644 --- a/src/cloudflare/types/dns/dns_firewall.py +++ b/src/cloudflare/types/dns/firewall/firewall.py @@ -1,22 +1,24 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Union, Optional +from typing import List, Optional from datetime import datetime -from ..._models import BaseModel -from .attack_mitigation import AttackMitigation +from ...._models import BaseModel +from ..attack_mitigation import AttackMitigation +from ..firewall_ips_item import FirewallIPsItem +from ..upstream_ips_items import UpstreamIPsItems -__all__ = ["DNSFirewall"] +__all__ = ["Firewall"] -class DNSFirewall(BaseModel): +class Firewall(BaseModel): id: str """Identifier""" deprecate_any_requests: bool """Deprecate the response to ANY requests.""" - dns_firewall_ips: List[Union[str, str]] + dns_firewall_ips: List[FirewallIPsItem] ecs_fallback: bool """Forward client IP (resolver) subnet if no EDNS Client Subnet is sent.""" @@ -33,7 +35,7 @@ class DNSFirewall(BaseModel): name: str """DNS Firewall Cluster Name.""" - upstream_ips: List[Union[str, str]] + upstream_ips: List[UpstreamIPsItems] attack_mitigation: Optional[AttackMitigation] = None """Attack mitigation settings.""" diff --git a/src/cloudflare/types/dns/https_record.py b/src/cloudflare/types/dns/https_record.py index 732ea6acd00..0e253e95093 100644 --- a/src/cloudflare/types/dns/https_record.py +++ b/src/cloudflare/types/dns/https_record.py @@ -6,6 +6,7 @@ from .ttl import TTL from ..._models import BaseModel +from .record_tags_item import RecordTagsItem from .unnamed_schema_ref_1391721bdb8938d5420a8bc738a44deb import UnnamedSchemaRef1391721bdb8938d5420a8bc738a44deb __all__ = ["HTTPSRecord", "Data"] @@ -62,7 +63,7 @@ class HTTPSRecord(BaseModel): proxiable: Optional[bool] = None """Whether the record can be proxied by Cloudflare or not.""" - tags: Optional[List[str]] = None + tags: Optional[List[RecordTagsItem]] = None """Custom tags for the DNS record. This field has no effect on DNS responses.""" ttl: Optional[TTL] = None diff --git a/src/cloudflare/types/dns/loc_record.py b/src/cloudflare/types/dns/loc_record.py index 4b85d150b88..847bde1d396 100644 --- a/src/cloudflare/types/dns/loc_record.py +++ b/src/cloudflare/types/dns/loc_record.py @@ -6,6 +6,7 @@ from .ttl import TTL from ..._models import BaseModel +from .record_tags_item import RecordTagsItem from .unnamed_schema_ref_1391721bdb8938d5420a8bc738a44deb import UnnamedSchemaRef1391721bdb8938d5420a8bc738a44deb __all__ = ["LOCRecord", "Data"] @@ -89,7 +90,7 @@ class LOCRecord(BaseModel): proxiable: Optional[bool] = None """Whether the record can be proxied by Cloudflare or not.""" - tags: Optional[List[str]] = None + tags: Optional[List[RecordTagsItem]] = None """Custom tags for the DNS record. This field has no effect on DNS responses.""" ttl: Optional[TTL] = None diff --git a/src/cloudflare/types/dns/mx_record.py b/src/cloudflare/types/dns/mx_record.py index 86b7bda5e2f..4914d226458 100644 --- a/src/cloudflare/types/dns/mx_record.py +++ b/src/cloudflare/types/dns/mx_record.py @@ -6,6 +6,7 @@ from .ttl import TTL from ..._models import BaseModel +from .record_tags_item import RecordTagsItem from .unnamed_schema_ref_1391721bdb8938d5420a8bc738a44deb import UnnamedSchemaRef1391721bdb8938d5420a8bc738a44deb __all__ = ["MXRecord"] @@ -54,7 +55,7 @@ class MXRecord(BaseModel): proxiable: Optional[bool] = None """Whether the record can be proxied by Cloudflare or not.""" - tags: Optional[List[str]] = None + tags: Optional[List[RecordTagsItem]] = None """Custom tags for the DNS record. This field has no effect on DNS responses.""" ttl: Optional[TTL] = None diff --git a/src/cloudflare/types/dns/naptr_record.py b/src/cloudflare/types/dns/naptr_record.py index ca6204e84d3..1b5c7f29e5c 100644 --- a/src/cloudflare/types/dns/naptr_record.py +++ b/src/cloudflare/types/dns/naptr_record.py @@ -6,6 +6,7 @@ from .ttl import TTL from ..._models import BaseModel +from .record_tags_item import RecordTagsItem from .unnamed_schema_ref_1391721bdb8938d5420a8bc738a44deb import UnnamedSchemaRef1391721bdb8938d5420a8bc738a44deb __all__ = ["NAPTRRecord", "Data"] @@ -71,7 +72,7 @@ class NAPTRRecord(BaseModel): proxiable: Optional[bool] = None """Whether the record can be proxied by Cloudflare or not.""" - tags: Optional[List[str]] = None + tags: Optional[List[RecordTagsItem]] = None """Custom tags for the DNS record. This field has no effect on DNS responses.""" ttl: Optional[TTL] = None diff --git a/src/cloudflare/types/dns/ns_record.py b/src/cloudflare/types/dns/ns_record.py index 1142e6d2b4c..52ab440654f 100644 --- a/src/cloudflare/types/dns/ns_record.py +++ b/src/cloudflare/types/dns/ns_record.py @@ -6,6 +6,7 @@ from .ttl import TTL from ..._models import BaseModel +from .record_tags_item import RecordTagsItem from .unnamed_schema_ref_1391721bdb8938d5420a8bc738a44deb import UnnamedSchemaRef1391721bdb8938d5420a8bc738a44deb __all__ = ["NSRecord"] @@ -48,7 +49,7 @@ class NSRecord(BaseModel): proxiable: Optional[bool] = None """Whether the record can be proxied by Cloudflare or not.""" - tags: Optional[List[str]] = None + tags: Optional[List[RecordTagsItem]] = None """Custom tags for the DNS record. This field has no effect on DNS responses.""" ttl: Optional[TTL] = None diff --git a/src/cloudflare/types/dns/ptr_record.py b/src/cloudflare/types/dns/ptr_record.py index 3e4fc3747f3..49778bfc7ae 100644 --- a/src/cloudflare/types/dns/ptr_record.py +++ b/src/cloudflare/types/dns/ptr_record.py @@ -6,6 +6,7 @@ from .ttl import TTL from ..._models import BaseModel +from .record_tags_item import RecordTagsItem from .unnamed_schema_ref_1391721bdb8938d5420a8bc738a44deb import UnnamedSchemaRef1391721bdb8938d5420a8bc738a44deb __all__ = ["PTRRecord"] @@ -48,7 +49,7 @@ class PTRRecord(BaseModel): proxiable: Optional[bool] = None """Whether the record can be proxied by Cloudflare or not.""" - tags: Optional[List[str]] = None + tags: Optional[List[RecordTagsItem]] = None """Custom tags for the DNS record. This field has no effect on DNS responses.""" ttl: Optional[TTL] = None diff --git a/src/cloudflare/types/dns/smimea_record.py b/src/cloudflare/types/dns/smimea_record.py index 1fb2faa2fd1..91ffb1df024 100644 --- a/src/cloudflare/types/dns/smimea_record.py +++ b/src/cloudflare/types/dns/smimea_record.py @@ -6,6 +6,7 @@ from .ttl import TTL from ..._models import BaseModel +from .record_tags_item import RecordTagsItem from .unnamed_schema_ref_1391721bdb8938d5420a8bc738a44deb import UnnamedSchemaRef1391721bdb8938d5420a8bc738a44deb __all__ = ["SMIMEARecord", "Data"] @@ -65,7 +66,7 @@ class SMIMEARecord(BaseModel): proxiable: Optional[bool] = None """Whether the record can be proxied by Cloudflare or not.""" - tags: Optional[List[str]] = None + tags: Optional[List[RecordTagsItem]] = None """Custom tags for the DNS record. This field has no effect on DNS responses.""" ttl: Optional[TTL] = None diff --git a/src/cloudflare/types/dns/srv_record.py b/src/cloudflare/types/dns/srv_record.py index 6a411dd9a60..4b26735fae6 100644 --- a/src/cloudflare/types/dns/srv_record.py +++ b/src/cloudflare/types/dns/srv_record.py @@ -6,6 +6,7 @@ from .ttl import TTL from ..._models import BaseModel +from .record_tags_item import RecordTagsItem from .unnamed_schema_ref_1391721bdb8938d5420a8bc738a44deb import UnnamedSchemaRef1391721bdb8938d5420a8bc738a44deb __all__ = ["SRVRecord", "Data"] @@ -97,7 +98,7 @@ class SRVRecord(BaseModel): proxiable: Optional[bool] = None """Whether the record can be proxied by Cloudflare or not.""" - tags: Optional[List[str]] = None + tags: Optional[List[RecordTagsItem]] = None """Custom tags for the DNS record. This field has no effect on DNS responses.""" ttl: Optional[TTL] = None diff --git a/src/cloudflare/types/dns/sshfp_record.py b/src/cloudflare/types/dns/sshfp_record.py index d31385e414c..c4ed036e016 100644 --- a/src/cloudflare/types/dns/sshfp_record.py +++ b/src/cloudflare/types/dns/sshfp_record.py @@ -6,6 +6,7 @@ from .ttl import TTL from ..._models import BaseModel +from .record_tags_item import RecordTagsItem from .unnamed_schema_ref_1391721bdb8938d5420a8bc738a44deb import UnnamedSchemaRef1391721bdb8938d5420a8bc738a44deb __all__ = ["SSHFPRecord", "Data"] @@ -62,7 +63,7 @@ class SSHFPRecord(BaseModel): proxiable: Optional[bool] = None """Whether the record can be proxied by Cloudflare or not.""" - tags: Optional[List[str]] = None + tags: Optional[List[RecordTagsItem]] = None """Custom tags for the DNS record. This field has no effect on DNS responses.""" ttl: Optional[TTL] = None diff --git a/src/cloudflare/types/dns/svcb_record.py b/src/cloudflare/types/dns/svcb_record.py index 1cbf3e2f2ca..41a7ee70628 100644 --- a/src/cloudflare/types/dns/svcb_record.py +++ b/src/cloudflare/types/dns/svcb_record.py @@ -6,6 +6,7 @@ from .ttl import TTL from ..._models import BaseModel +from .record_tags_item import RecordTagsItem from .unnamed_schema_ref_1391721bdb8938d5420a8bc738a44deb import UnnamedSchemaRef1391721bdb8938d5420a8bc738a44deb __all__ = ["SVCBRecord", "Data"] @@ -62,7 +63,7 @@ class SVCBRecord(BaseModel): proxiable: Optional[bool] = None """Whether the record can be proxied by Cloudflare or not.""" - tags: Optional[List[str]] = None + tags: Optional[List[RecordTagsItem]] = None """Custom tags for the DNS record. This field has no effect on DNS responses.""" ttl: Optional[TTL] = None diff --git a/src/cloudflare/types/dns/tlsa_record.py b/src/cloudflare/types/dns/tlsa_record.py index ae7990ce6c5..dc37a64bca1 100644 --- a/src/cloudflare/types/dns/tlsa_record.py +++ b/src/cloudflare/types/dns/tlsa_record.py @@ -6,6 +6,7 @@ from .ttl import TTL from ..._models import BaseModel +from .record_tags_item import RecordTagsItem from .unnamed_schema_ref_1391721bdb8938d5420a8bc738a44deb import UnnamedSchemaRef1391721bdb8938d5420a8bc738a44deb __all__ = ["TLSARecord", "Data"] @@ -65,7 +66,7 @@ class TLSARecord(BaseModel): proxiable: Optional[bool] = None """Whether the record can be proxied by Cloudflare or not.""" - tags: Optional[List[str]] = None + tags: Optional[List[RecordTagsItem]] = None """Custom tags for the DNS record. This field has no effect on DNS responses.""" ttl: Optional[TTL] = None diff --git a/src/cloudflare/types/dns/txt_record.py b/src/cloudflare/types/dns/txt_record.py index 9dfa1cf24f4..ce0ab434044 100644 --- a/src/cloudflare/types/dns/txt_record.py +++ b/src/cloudflare/types/dns/txt_record.py @@ -6,6 +6,7 @@ from .ttl import TTL from ..._models import BaseModel +from .record_tags_item import RecordTagsItem from .unnamed_schema_ref_1391721bdb8938d5420a8bc738a44deb import UnnamedSchemaRef1391721bdb8938d5420a8bc738a44deb __all__ = ["TXTRecord"] @@ -48,7 +49,7 @@ class TXTRecord(BaseModel): proxiable: Optional[bool] = None """Whether the record can be proxied by Cloudflare or not.""" - tags: Optional[List[str]] = None + tags: Optional[List[RecordTagsItem]] = None """Custom tags for the DNS record. This field has no effect on DNS responses.""" ttl: Optional[TTL] = None diff --git a/src/cloudflare/types/dns/uri_record.py b/src/cloudflare/types/dns/uri_record.py index 9e665d096cf..b55d0ee1dba 100644 --- a/src/cloudflare/types/dns/uri_record.py +++ b/src/cloudflare/types/dns/uri_record.py @@ -6,6 +6,7 @@ from .ttl import TTL from ..._models import BaseModel +from .record_tags_item import RecordTagsItem from .unnamed_schema_ref_1391721bdb8938d5420a8bc738a44deb import UnnamedSchemaRef1391721bdb8938d5420a8bc738a44deb __all__ = ["URIRecord", "Data"] @@ -65,7 +66,7 @@ class URIRecord(BaseModel): proxiable: Optional[bool] = None """Whether the record can be proxied by Cloudflare or not.""" - tags: Optional[List[str]] = None + tags: Optional[List[RecordTagsItem]] = None """Custom tags for the DNS record. This field has no effect on DNS responses.""" ttl: Optional[TTL] = None diff --git a/src/cloudflare/types/durable_objects/__init__.py b/src/cloudflare/types/durable_objects/__init__.py index 6688d0304a5..c2e170ca3ca 100644 --- a/src/cloudflare/types/durable_objects/__init__.py +++ b/src/cloudflare/types/durable_objects/__init__.py @@ -2,4 +2,4 @@ from __future__ import annotations -from .durable_object_namespace import DurableObjectNamespace as DurableObjectNamespace +from .namespace import Namespace as Namespace diff --git a/src/cloudflare/types/durable_objects/durable_object_namespace.py b/src/cloudflare/types/durable_objects/namespace.py similarity index 82% rename from src/cloudflare/types/durable_objects/durable_object_namespace.py rename to src/cloudflare/types/durable_objects/namespace.py index 689a67b66f6..930c338d76a 100644 --- a/src/cloudflare/types/durable_objects/durable_object_namespace.py +++ b/src/cloudflare/types/durable_objects/namespace.py @@ -6,10 +6,10 @@ from ..._models import BaseModel -__all__ = ["DurableObjectNamespace"] +__all__ = ["Namespace"] -class DurableObjectNamespace(BaseModel): +class Namespace(BaseModel): id: Optional[object] = None class_: Optional[object] = FieldInfo(alias="class", default=None) diff --git a/src/cloudflare/types/email_routing/__init__.py b/src/cloudflare/types/email_routing/__init__.py index 352efbd5c72..54f454abe15 100644 --- a/src/cloudflare/types/email_routing/__init__.py +++ b/src/cloudflare/types/email_routing/__init__.py @@ -3,21 +3,16 @@ from __future__ import annotations from .action import Action as Action +from .address import Address as Address from .matcher import Matcher as Matcher +from .dns_record import DNSRecord as DNSRecord from .email_rule import EmailRule as EmailRule -from .properties import Properties as Properties -from .action_item import ActionItem as ActionItem from .action_param import ActionParam as ActionParam -from .matcher_item import MatcherItem as MatcherItem from .matcher_param import MatcherParam as MatcherParam from .dns_get_response import DNSGetResponse as DNSGetResponse -from .email_dns_record import EmailDNSRecord as EmailDNSRecord from .email_rule_param import EmailRuleParam as EmailRuleParam from .rule_list_params import RuleListParams as RuleListParams -from .action_item_param import ActionItemParam as ActionItemParam -from .matcher_item_param import MatcherItemParam as MatcherItemParam from .rule_create_params import RuleCreateParams as RuleCreateParams from .rule_update_params import RuleUpdateParams as RuleUpdateParams from .address_list_params import AddressListParams as AddressListParams -from .destination_address import DestinationAddress as DestinationAddress from .address_create_params import AddressCreateParams as AddressCreateParams diff --git a/src/cloudflare/types/email_routing/action_item.py b/src/cloudflare/types/email_routing/action_item.py deleted file mode 100644 index 056c53bfaeb..00000000000 --- a/src/cloudflare/types/email_routing/action_item.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import Literal - -from ..._models import BaseModel - -__all__ = ["ActionItem"] - - -class ActionItem(BaseModel): - type: Literal["drop", "forward", "worker"] - """Type of supported action.""" - - value: List[str] diff --git a/src/cloudflare/types/email_routing/action_item_param.py b/src/cloudflare/types/email_routing/action_item_param.py deleted file mode 100644 index 009a6cb82d7..00000000000 --- a/src/cloudflare/types/email_routing/action_item_param.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List -from typing_extensions import Literal, Required, TypedDict - -__all__ = ["ActionItemParam"] - - -class ActionItemParam(TypedDict, total=False): - type: Required[Literal["drop", "forward", "worker"]] - """Type of supported action.""" - - value: Required[List[str]] diff --git a/src/cloudflare/types/email_routing/destination_address.py b/src/cloudflare/types/email_routing/address.py similarity index 92% rename from src/cloudflare/types/email_routing/destination_address.py rename to src/cloudflare/types/email_routing/address.py index 2c4b7ecebcc..7e7a82d980a 100644 --- a/src/cloudflare/types/email_routing/destination_address.py +++ b/src/cloudflare/types/email_routing/address.py @@ -5,10 +5,10 @@ from ..._models import BaseModel -__all__ = ["DestinationAddress"] +__all__ = ["Address"] -class DestinationAddress(BaseModel): +class Address(BaseModel): id: Optional[str] = None """Destination address identifier.""" diff --git a/src/cloudflare/types/email_routing/dns_get_response.py b/src/cloudflare/types/email_routing/dns_get_response.py index 8ddb372052b..9f15c755fa3 100644 --- a/src/cloudflare/types/email_routing/dns_get_response.py +++ b/src/cloudflare/types/email_routing/dns_get_response.py @@ -2,8 +2,8 @@ from typing import List -from .email_dns_record import EmailDNSRecord +from .dns_record import DNSRecord __all__ = ["DNSGetResponse"] -DNSGetResponse = List[EmailDNSRecord] +DNSGetResponse = List[DNSRecord] diff --git a/src/cloudflare/types/email_routing/email_dns_record.py b/src/cloudflare/types/email_routing/dns_record.py similarity index 94% rename from src/cloudflare/types/email_routing/email_dns_record.py rename to src/cloudflare/types/email_routing/dns_record.py index c997907012b..92b600ce404 100644 --- a/src/cloudflare/types/email_routing/email_dns_record.py +++ b/src/cloudflare/types/email_routing/dns_record.py @@ -5,10 +5,10 @@ from ..._models import BaseModel -__all__ = ["EmailDNSRecord"] +__all__ = ["DNSRecord"] -class EmailDNSRecord(BaseModel): +class DNSRecord(BaseModel): content: Optional[str] = None """DNS record content.""" diff --git a/src/cloudflare/types/email_routing/matcher_item.py b/src/cloudflare/types/email_routing/matcher_item.py deleted file mode 100644 index 8e573ed7f84..00000000000 --- a/src/cloudflare/types/email_routing/matcher_item.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal - -from ..._models import BaseModel - -__all__ = ["MatcherItem"] - - -class MatcherItem(BaseModel): - field: Literal["to"] - """Field for type matcher.""" - - type: Literal["literal"] - """Type of matcher.""" - - value: str - """Value for matcher.""" diff --git a/src/cloudflare/types/email_routing/matcher_item_param.py b/src/cloudflare/types/email_routing/matcher_item_param.py deleted file mode 100644 index acf20477a4b..00000000000 --- a/src/cloudflare/types/email_routing/matcher_item_param.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Literal, Required, TypedDict - -__all__ = ["MatcherItemParam"] - - -class MatcherItemParam(TypedDict, total=False): - field: Required[Literal["to"]] - """Field for type matcher.""" - - type: Required[Literal["literal"]] - """Type of matcher.""" - - value: Required[str] - """Value for matcher.""" diff --git a/src/cloudflare/types/email_routing/rule_update_params.py b/src/cloudflare/types/email_routing/rule_update_params.py index 080583ff5d7..3ed26c999ab 100644 --- a/src/cloudflare/types/email_routing/rule_update_params.py +++ b/src/cloudflare/types/email_routing/rule_update_params.py @@ -5,8 +5,8 @@ from typing import Iterable from typing_extensions import Literal, Required, TypedDict -from .action_item_param import ActionItemParam -from .matcher_item_param import MatcherItemParam +from .action_param import ActionParam +from .matcher_param import MatcherParam __all__ = ["RuleUpdateParams"] @@ -15,10 +15,10 @@ class RuleUpdateParams(TypedDict, total=False): zone_identifier: Required[str] """Identifier""" - actions: Required[Iterable[ActionItemParam]] + actions: Required[Iterable[ActionParam]] """List actions patterns.""" - matchers: Required[Iterable[MatcherItemParam]] + matchers: Required[Iterable[MatcherParam]] """Matching patterns to forward to your actions.""" enabled: Literal[True, False] diff --git a/src/cloudflare/types/email_routing/rules/__init__.py b/src/cloudflare/types/email_routing/rules/__init__.py index 26568d50a94..82fb04b4ffb 100644 --- a/src/cloudflare/types/email_routing/rules/__init__.py +++ b/src/cloudflare/types/email_routing/rules/__init__.py @@ -2,9 +2,10 @@ from __future__ import annotations -from .action import Action as Action -from .matcher import Matcher as Matcher -from .action_param import ActionParam as ActionParam -from .matcher_param import MatcherParam as MatcherParam -from .email_catch_all_rule import EmailCatchAllRule as EmailCatchAllRule +from .catch_all_action import CatchAllAction as CatchAllAction +from .catch_all_matcher import CatchAllMatcher as CatchAllMatcher +from .catch_all_action_param import CatchAllActionParam as CatchAllActionParam +from .catch_all_get_response import CatchAllGetResponse as CatchAllGetResponse +from .catch_all_matcher_param import CatchAllMatcherParam as CatchAllMatcherParam from .catch_all_update_params import CatchAllUpdateParams as CatchAllUpdateParams +from .catch_all_update_response import CatchAllUpdateResponse as CatchAllUpdateResponse diff --git a/src/cloudflare/types/email_routing/rules/action.py b/src/cloudflare/types/email_routing/rules/catch_all_action.py similarity index 84% rename from src/cloudflare/types/email_routing/rules/action.py rename to src/cloudflare/types/email_routing/rules/catch_all_action.py index 7a4a7763452..bfd4485f68d 100644 --- a/src/cloudflare/types/email_routing/rules/action.py +++ b/src/cloudflare/types/email_routing/rules/catch_all_action.py @@ -5,10 +5,10 @@ from ...._models import BaseModel -__all__ = ["Action"] +__all__ = ["CatchAllAction"] -class Action(BaseModel): +class CatchAllAction(BaseModel): type: Literal["drop", "forward", "worker"] """Type of action for catch-all rule.""" diff --git a/src/cloudflare/types/email_routing/rules/action_param.py b/src/cloudflare/types/email_routing/rules/catch_all_action_param.py similarity index 79% rename from src/cloudflare/types/email_routing/rules/action_param.py rename to src/cloudflare/types/email_routing/rules/catch_all_action_param.py index f999e1ead64..832c3457bcb 100644 --- a/src/cloudflare/types/email_routing/rules/action_param.py +++ b/src/cloudflare/types/email_routing/rules/catch_all_action_param.py @@ -5,10 +5,10 @@ from typing import List from typing_extensions import Literal, Required, TypedDict -__all__ = ["ActionParam"] +__all__ = ["CatchAllActionParam"] -class ActionParam(TypedDict, total=False): +class CatchAllActionParam(TypedDict, total=False): type: Required[Literal["drop", "forward", "worker"]] """Type of action for catch-all rule.""" diff --git a/src/cloudflare/types/email_routing/rules/email_catch_all_rule.py b/src/cloudflare/types/email_routing/rules/catch_all_get_response.py similarity index 70% rename from src/cloudflare/types/email_routing/rules/email_catch_all_rule.py rename to src/cloudflare/types/email_routing/rules/catch_all_get_response.py index 0bc34c7ecca..4f25a25dbac 100644 --- a/src/cloudflare/types/email_routing/rules/email_catch_all_rule.py +++ b/src/cloudflare/types/email_routing/rules/catch_all_get_response.py @@ -3,24 +3,24 @@ from typing import List, Optional from typing_extensions import Literal -from .action import Action -from .matcher import Matcher from ...._models import BaseModel +from .catch_all_action import CatchAllAction +from .catch_all_matcher import CatchAllMatcher -__all__ = ["EmailCatchAllRule"] +__all__ = ["CatchAllGetResponse"] -class EmailCatchAllRule(BaseModel): +class CatchAllGetResponse(BaseModel): id: Optional[str] = None """Routing rule identifier.""" - actions: Optional[List[Action]] = None + actions: Optional[List[CatchAllAction]] = None """List actions for the catch-all routing rule.""" enabled: Optional[Literal[True, False]] = None """Routing rule status.""" - matchers: Optional[List[Matcher]] = None + matchers: Optional[List[CatchAllMatcher]] = None """List of matchers for the catch-all routing rule.""" name: Optional[str] = None diff --git a/src/cloudflare/types/email_routing/rules/matcher.py b/src/cloudflare/types/email_routing/rules/catch_all_matcher.py similarity index 78% rename from src/cloudflare/types/email_routing/rules/matcher.py rename to src/cloudflare/types/email_routing/rules/catch_all_matcher.py index 272463c5133..982ed202d06 100644 --- a/src/cloudflare/types/email_routing/rules/matcher.py +++ b/src/cloudflare/types/email_routing/rules/catch_all_matcher.py @@ -4,9 +4,9 @@ from ...._models import BaseModel -__all__ = ["Matcher"] +__all__ = ["CatchAllMatcher"] -class Matcher(BaseModel): +class CatchAllMatcher(BaseModel): type: Literal["all"] """Type of matcher. Default is 'all'.""" diff --git a/src/cloudflare/types/email_routing/rules/matcher_param.py b/src/cloudflare/types/email_routing/rules/catch_all_matcher_param.py similarity index 75% rename from src/cloudflare/types/email_routing/rules/matcher_param.py rename to src/cloudflare/types/email_routing/rules/catch_all_matcher_param.py index 1cadb071f75..d22950c2d68 100644 --- a/src/cloudflare/types/email_routing/rules/matcher_param.py +++ b/src/cloudflare/types/email_routing/rules/catch_all_matcher_param.py @@ -4,9 +4,9 @@ from typing_extensions import Literal, Required, TypedDict -__all__ = ["MatcherParam"] +__all__ = ["CatchAllMatcherParam"] -class MatcherParam(TypedDict, total=False): +class CatchAllMatcherParam(TypedDict, total=False): type: Required[Literal["all"]] """Type of matcher. Default is 'all'.""" diff --git a/src/cloudflare/types/email_routing/rules/catch_all_update_params.py b/src/cloudflare/types/email_routing/rules/catch_all_update_params.py index b6c43d46a87..a4841b1995d 100644 --- a/src/cloudflare/types/email_routing/rules/catch_all_update_params.py +++ b/src/cloudflare/types/email_routing/rules/catch_all_update_params.py @@ -5,17 +5,17 @@ from typing import Iterable from typing_extensions import Literal, Required, TypedDict -from .action_param import ActionParam -from .matcher_param import MatcherParam +from .catch_all_action_param import CatchAllActionParam +from .catch_all_matcher_param import CatchAllMatcherParam __all__ = ["CatchAllUpdateParams"] class CatchAllUpdateParams(TypedDict, total=False): - actions: Required[Iterable[ActionParam]] + actions: Required[Iterable[CatchAllActionParam]] """List actions for the catch-all routing rule.""" - matchers: Required[Iterable[MatcherParam]] + matchers: Required[Iterable[CatchAllMatcherParam]] """List of matchers for the catch-all routing rule.""" enabled: Literal[True, False] diff --git a/src/cloudflare/types/email_routing/properties.py b/src/cloudflare/types/email_routing/rules/catch_all_update_response.py similarity index 53% rename from src/cloudflare/types/email_routing/properties.py rename to src/cloudflare/types/email_routing/rules/catch_all_update_response.py index 852c9051b10..8380ed3b15f 100644 --- a/src/cloudflare/types/email_routing/properties.py +++ b/src/cloudflare/types/email_routing/rules/catch_all_update_response.py @@ -3,31 +3,28 @@ from typing import List, Optional from typing_extensions import Literal -from ..._models import BaseModel -from .action_item import ActionItem -from .matcher_item import MatcherItem +from ...._models import BaseModel +from .catch_all_action import CatchAllAction +from .catch_all_matcher import CatchAllMatcher -__all__ = ["Properties"] +__all__ = ["CatchAllUpdateResponse"] -class Properties(BaseModel): +class CatchAllUpdateResponse(BaseModel): id: Optional[str] = None """Routing rule identifier.""" - actions: Optional[List[ActionItem]] = None - """List actions patterns.""" + actions: Optional[List[CatchAllAction]] = None + """List actions for the catch-all routing rule.""" enabled: Optional[Literal[True, False]] = None """Routing rule status.""" - matchers: Optional[List[MatcherItem]] = None - """Matching patterns to forward to your actions.""" + matchers: Optional[List[CatchAllMatcher]] = None + """List of matchers for the catch-all routing rule.""" name: Optional[str] = None """Routing rule name.""" - priority: Optional[float] = None - """Priority of the routing rule.""" - tag: Optional[str] = None """Routing rule tag. (Deprecated, replaced by routing rule identifier)""" diff --git a/src/cloudflare/types/filter_create_response.py b/src/cloudflare/types/filter_create_response.py index 410ac59aed1..5700d2e070d 100644 --- a/src/cloudflare/types/filter_create_response.py +++ b/src/cloudflare/types/filter_create_response.py @@ -1,9 +1,31 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List +from typing import List, Optional -from .firewall_filter import FirewallFilter +from .._models import BaseModel -__all__ = ["FilterCreateResponse"] +__all__ = ["FilterCreateResponse", "FilterCreateResponseItem"] -FilterCreateResponse = List[FirewallFilter] + +class FilterCreateResponseItem(BaseModel): + id: str + """The unique identifier of the filter.""" + + expression: str + """The filter expression. + + For more information, refer to + [Expressions](https://developers.cloudflare.com/ruleset-engine/rules-language/expressions/). + """ + + paused: bool + """When true, indicates that the filter is currently paused.""" + + description: Optional[str] = None + """An informative summary of the filter.""" + + ref: Optional[str] = None + """A short reference tag. Allows you to select related filters.""" + + +FilterCreateResponse = List[FilterCreateResponseItem] diff --git a/src/cloudflare/types/filter_delete_response.py b/src/cloudflare/types/filter_delete_response.py new file mode 100644 index 00000000000..5f5cd5b9737 --- /dev/null +++ b/src/cloudflare/types/filter_delete_response.py @@ -0,0 +1,28 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from .._models import BaseModel + +__all__ = ["FilterDeleteResponse"] + + +class FilterDeleteResponse(BaseModel): + id: str + """The unique identifier of the filter.""" + + description: Optional[str] = None + """An informative summary of the filter.""" + + expression: Optional[str] = None + """The filter expression. + + For more information, refer to + [Expressions](https://developers.cloudflare.com/ruleset-engine/rules-language/expressions/). + """ + + paused: Optional[bool] = None + """When true, indicates that the filter is currently paused.""" + + ref: Optional[str] = None + """A short reference tag. Allows you to select related filters.""" diff --git a/src/cloudflare/types/firewall_filter.py b/src/cloudflare/types/filter_get_response.py similarity index 91% rename from src/cloudflare/types/firewall_filter.py rename to src/cloudflare/types/filter_get_response.py index 5114c5f9346..b1011f73835 100644 --- a/src/cloudflare/types/firewall_filter.py +++ b/src/cloudflare/types/filter_get_response.py @@ -4,10 +4,10 @@ from .._models import BaseModel -__all__ = ["FirewallFilter"] +__all__ = ["FilterGetResponse"] -class FirewallFilter(BaseModel): +class FilterGetResponse(BaseModel): id: Optional[str] = None """The unique identifier of the filter.""" diff --git a/src/cloudflare/types/filter_list_response.py b/src/cloudflare/types/filter_list_response.py new file mode 100644 index 00000000000..4373811c96c --- /dev/null +++ b/src/cloudflare/types/filter_list_response.py @@ -0,0 +1,28 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from .._models import BaseModel + +__all__ = ["FilterListResponse"] + + +class FilterListResponse(BaseModel): + id: str + """The unique identifier of the filter.""" + + expression: str + """The filter expression. + + For more information, refer to + [Expressions](https://developers.cloudflare.com/ruleset-engine/rules-language/expressions/). + """ + + paused: bool + """When true, indicates that the filter is currently paused.""" + + description: Optional[str] = None + """An informative summary of the filter.""" + + ref: Optional[str] = None + """A short reference tag. Allows you to select related filters.""" diff --git a/src/cloudflare/types/filter_update_response.py b/src/cloudflare/types/filter_update_response.py new file mode 100644 index 00000000000..65d4ba3246c --- /dev/null +++ b/src/cloudflare/types/filter_update_response.py @@ -0,0 +1,28 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from .._models import BaseModel + +__all__ = ["FilterUpdateResponse"] + + +class FilterUpdateResponse(BaseModel): + id: Optional[str] = None + """The unique identifier of the filter.""" + + description: Optional[str] = None + """An informative summary of the filter.""" + + expression: Optional[str] = None + """The filter expression. + + For more information, refer to + [Expressions](https://developers.cloudflare.com/ruleset-engine/rules-language/expressions/). + """ + + paused: Optional[bool] = None + """When true, indicates that the filter is currently paused.""" + + ref: Optional[str] = None + """A short reference tag. Allows you to select related filters.""" diff --git a/src/cloudflare/types/firewall/__init__.py b/src/cloudflare/types/firewall/__init__.py index 9d0faf3be4f..1722de26aed 100644 --- a/src/cloudflare/types/firewall/__init__.py +++ b/src/cloudflare/types/firewall/__init__.py @@ -2,22 +2,30 @@ from __future__ import annotations +from .rule import Rule as Rule +from .lockdown import Lockdown as Lockdown +from .urls_item import URLsItem as URLsItem +from .rule_param import RuleParam as RuleParam +from .configuration import Configuration as Configuration +from .products_item import ProductsItem as ProductsItem +from .deleted_filter import DeletedFilter as DeletedFilter from .rule_get_params import RuleGetParams as RuleGetParams +from .ip_configuration import IPConfiguration as IPConfiguration from .rule_edit_params import RuleEditParams as RuleEditParams from .rule_list_params import RuleListParams as RuleListParams +from .cidr_configuration import CIDRConfiguration as CIDRConfiguration from .rule_create_params import RuleCreateParams as RuleCreateParams from .rule_delete_params import RuleDeleteParams as RuleDeleteParams from .rule_edit_response import RuleEditResponse as RuleEditResponse from .rule_update_params import RuleUpdateParams as RuleUpdateParams +from .configuration_param import ConfigurationParam as ConfigurationParam from .ua_rule_list_params import UARuleListParams as UARuleListParams -from .firewall_filter_rule import FirewallFilterRule as FirewallFilterRule from .lockdown_list_params import LockdownListParams as LockdownListParams from .rule_create_response import RuleCreateResponse as RuleCreateResponse from .ua_rule_create_params import UARuleCreateParams as UARuleCreateParams from .ua_rule_delete_params import UARuleDeleteParams as UARuleDeleteParams from .ua_rule_list_response import UARuleListResponse as UARuleListResponse from .ua_rule_update_params import UARuleUpdateParams as UARuleUpdateParams -from .firewall_zone_lockdown import FirewallZoneLockdown as FirewallZoneLockdown from .lockdown_create_params import LockdownCreateParams as LockdownCreateParams from .lockdown_delete_params import LockdownDeleteParams as LockdownDeleteParams from .lockdown_update_params import LockdownUpdateParams as LockdownUpdateParams @@ -28,6 +36,3 @@ from .access_rule_create_params import AccessRuleCreateParams as AccessRuleCreateParams from .access_rule_delete_params import AccessRuleDeleteParams as AccessRuleDeleteParams from .access_rule_delete_response import AccessRuleDeleteResponse as AccessRuleDeleteResponse -from .unnamed_schema_ref_ab48d2d33259c9107401d174735701c7 import ( - UnnamedSchemaRefAb48d2d33259c9107401d174735701c7 as UnnamedSchemaRefAb48d2d33259c9107401d174735701c7, -) diff --git a/src/cloudflare/types/firewall/access_rule_create_params.py b/src/cloudflare/types/firewall/access_rule_create_params.py index 966be8e8632..f44dc067590 100644 --- a/src/cloudflare/types/firewall/access_rule_create_params.py +++ b/src/cloudflare/types/firewall/access_rule_create_params.py @@ -8,11 +8,11 @@ __all__ = [ "AccessRuleCreateParams", "Configuration", - "ConfigurationLegacyJhsIPConfiguration", - "ConfigurationLegacyJhsIPV6Configuration", - "ConfigurationLegacyJhsCIDRConfiguration", - "ConfigurationLegacyJhsASNConfiguration", - "ConfigurationLegacyJhsCountryConfiguration", + "ConfigurationFirewallIPConfiguration", + "ConfigurationFirewallIPV6Configuration", + "ConfigurationFirewallCIDRConfiguration", + "ConfigurationFirewallASNConfiguration", + "ConfigurationFirewallCountryConfiguration", ] @@ -35,7 +35,7 @@ class AccessRuleCreateParams(TypedDict, total=False): """ -class ConfigurationLegacyJhsIPConfiguration(TypedDict, total=False): +class ConfigurationFirewallIPConfiguration(TypedDict, total=False): target: Literal["ip"] """The configuration target. @@ -49,7 +49,7 @@ class ConfigurationLegacyJhsIPConfiguration(TypedDict, total=False): """ -class ConfigurationLegacyJhsIPV6Configuration(TypedDict, total=False): +class ConfigurationFirewallIPV6Configuration(TypedDict, total=False): target: Literal["ip6"] """The configuration target. @@ -60,7 +60,7 @@ class ConfigurationLegacyJhsIPV6Configuration(TypedDict, total=False): """The IPv6 address to match.""" -class ConfigurationLegacyJhsCIDRConfiguration(TypedDict, total=False): +class ConfigurationFirewallCIDRConfiguration(TypedDict, total=False): target: Literal["ip_range"] """The configuration target. @@ -76,7 +76,7 @@ class ConfigurationLegacyJhsCIDRConfiguration(TypedDict, total=False): """ -class ConfigurationLegacyJhsASNConfiguration(TypedDict, total=False): +class ConfigurationFirewallASNConfiguration(TypedDict, total=False): target: Literal["asn"] """The configuration target. @@ -88,7 +88,7 @@ class ConfigurationLegacyJhsASNConfiguration(TypedDict, total=False): """The AS number to match.""" -class ConfigurationLegacyJhsCountryConfiguration(TypedDict, total=False): +class ConfigurationFirewallCountryConfiguration(TypedDict, total=False): target: Literal["country"] """The configuration target. @@ -104,9 +104,9 @@ class ConfigurationLegacyJhsCountryConfiguration(TypedDict, total=False): Configuration = Union[ - ConfigurationLegacyJhsIPConfiguration, - ConfigurationLegacyJhsIPV6Configuration, - ConfigurationLegacyJhsCIDRConfiguration, - ConfigurationLegacyJhsASNConfiguration, - ConfigurationLegacyJhsCountryConfiguration, + ConfigurationFirewallIPConfiguration, + ConfigurationFirewallIPV6Configuration, + ConfigurationFirewallCIDRConfiguration, + ConfigurationFirewallASNConfiguration, + ConfigurationFirewallCountryConfiguration, ] diff --git a/src/cloudflare/types/firewall/access_rule_edit_params.py b/src/cloudflare/types/firewall/access_rule_edit_params.py index dc3b0726194..056027feceb 100644 --- a/src/cloudflare/types/firewall/access_rule_edit_params.py +++ b/src/cloudflare/types/firewall/access_rule_edit_params.py @@ -8,11 +8,11 @@ __all__ = [ "AccessRuleEditParams", "Configuration", - "ConfigurationLegacyJhsIPConfiguration", - "ConfigurationLegacyJhsIPV6Configuration", - "ConfigurationLegacyJhsCIDRConfiguration", - "ConfigurationLegacyJhsASNConfiguration", - "ConfigurationLegacyJhsCountryConfiguration", + "ConfigurationFirewallIPConfiguration", + "ConfigurationFirewallIPV6Configuration", + "ConfigurationFirewallCIDRConfiguration", + "ConfigurationFirewallASNConfiguration", + "ConfigurationFirewallCountryConfiguration", ] @@ -35,7 +35,7 @@ class AccessRuleEditParams(TypedDict, total=False): """ -class ConfigurationLegacyJhsIPConfiguration(TypedDict, total=False): +class ConfigurationFirewallIPConfiguration(TypedDict, total=False): target: Literal["ip"] """The configuration target. @@ -49,7 +49,7 @@ class ConfigurationLegacyJhsIPConfiguration(TypedDict, total=False): """ -class ConfigurationLegacyJhsIPV6Configuration(TypedDict, total=False): +class ConfigurationFirewallIPV6Configuration(TypedDict, total=False): target: Literal["ip6"] """The configuration target. @@ -60,7 +60,7 @@ class ConfigurationLegacyJhsIPV6Configuration(TypedDict, total=False): """The IPv6 address to match.""" -class ConfigurationLegacyJhsCIDRConfiguration(TypedDict, total=False): +class ConfigurationFirewallCIDRConfiguration(TypedDict, total=False): target: Literal["ip_range"] """The configuration target. @@ -76,7 +76,7 @@ class ConfigurationLegacyJhsCIDRConfiguration(TypedDict, total=False): """ -class ConfigurationLegacyJhsASNConfiguration(TypedDict, total=False): +class ConfigurationFirewallASNConfiguration(TypedDict, total=False): target: Literal["asn"] """The configuration target. @@ -88,7 +88,7 @@ class ConfigurationLegacyJhsASNConfiguration(TypedDict, total=False): """The AS number to match.""" -class ConfigurationLegacyJhsCountryConfiguration(TypedDict, total=False): +class ConfigurationFirewallCountryConfiguration(TypedDict, total=False): target: Literal["country"] """The configuration target. @@ -104,9 +104,9 @@ class ConfigurationLegacyJhsCountryConfiguration(TypedDict, total=False): Configuration = Union[ - ConfigurationLegacyJhsIPConfiguration, - ConfigurationLegacyJhsIPV6Configuration, - ConfigurationLegacyJhsCIDRConfiguration, - ConfigurationLegacyJhsASNConfiguration, - ConfigurationLegacyJhsCountryConfiguration, + ConfigurationFirewallIPConfiguration, + ConfigurationFirewallIPV6Configuration, + ConfigurationFirewallCIDRConfiguration, + ConfigurationFirewallASNConfiguration, + ConfigurationFirewallCountryConfiguration, ] diff --git a/src/cloudflare/types/firewall/cidr_configuration.py b/src/cloudflare/types/firewall/cidr_configuration.py new file mode 100644 index 00000000000..928eeb86bbe --- /dev/null +++ b/src/cloudflare/types/firewall/cidr_configuration.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["CIDRConfiguration"] + + +class CIDRConfiguration(BaseModel): + target: Optional[Literal["ip_range"]] = None + """The configuration target. + + You must set the target to `ip_range` when specifying an IP address range in the + Zone Lockdown rule. + """ + + value: Optional[str] = None + """The IP address range to match. You can only use prefix lengths `/16` and `/24`.""" diff --git a/src/cloudflare/types/firewall/configuration.py b/src/cloudflare/types/firewall/configuration.py new file mode 100644 index 00000000000..edf0ec8773d --- /dev/null +++ b/src/cloudflare/types/firewall/configuration.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union + +from .ip_configuration import IPConfiguration +from .cidr_configuration import CIDRConfiguration + +__all__ = ["Configuration"] + +Configuration = Union[IPConfiguration, CIDRConfiguration] diff --git a/src/cloudflare/types/firewall/configuration_param.py b/src/cloudflare/types/firewall/configuration_param.py new file mode 100644 index 00000000000..42714f49d38 --- /dev/null +++ b/src/cloudflare/types/firewall/configuration_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union + +from .ip_configuration import IPConfiguration +from .cidr_configuration import CIDRConfiguration + +__all__ = ["ConfigurationParam"] + +ConfigurationParam = Union[IPConfiguration, CIDRConfiguration] diff --git a/src/cloudflare/types/firewall/deleted_filter.py b/src/cloudflare/types/firewall/deleted_filter.py new file mode 100644 index 00000000000..2172524a4be --- /dev/null +++ b/src/cloudflare/types/firewall/deleted_filter.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from ..._models import BaseModel + +__all__ = ["DeletedFilter"] + + +class DeletedFilter(BaseModel): + id: str + """The unique identifier of the filter.""" + + deleted: bool + """When true, indicates that the firewall rule was deleted.""" diff --git a/src/cloudflare/types/firewall/firewall_zone_lockdown.py b/src/cloudflare/types/firewall/firewall_zone_lockdown.py deleted file mode 100644 index 0beb83e03fa..00000000000 --- a/src/cloudflare/types/firewall/firewall_zone_lockdown.py +++ /dev/null @@ -1,75 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from datetime import datetime -from typing_extensions import Literal - -from ..._models import BaseModel - -__all__ = [ - "FirewallZoneLockdown", - "Configurations", - "ConfigurationsLegacyJhsSchemasIPConfiguration", - "ConfigurationsLegacyJhsSchemasCIDRConfiguration", -] - - -class ConfigurationsLegacyJhsSchemasIPConfiguration(BaseModel): - target: Optional[Literal["ip"]] = None - """The configuration target. - - You must set the target to `ip` when specifying an IP address in the Zone - Lockdown rule. - """ - - value: Optional[str] = None - """The IP address to match. - - This address will be compared to the IP address of incoming requests. - """ - - -class ConfigurationsLegacyJhsSchemasCIDRConfiguration(BaseModel): - target: Optional[Literal["ip_range"]] = None - """The configuration target. - - You must set the target to `ip_range` when specifying an IP address range in the - Zone Lockdown rule. - """ - - value: Optional[str] = None - """The IP address range to match. You can only use prefix lengths `/16` and `/24`.""" - - -Configurations = Union[ConfigurationsLegacyJhsSchemasIPConfiguration, ConfigurationsLegacyJhsSchemasCIDRConfiguration] - - -class FirewallZoneLockdown(BaseModel): - id: str - """The unique identifier of the Zone Lockdown rule.""" - - configurations: Configurations - """ - A list of IP addresses or CIDR ranges that will be allowed to access the URLs - specified in the Zone Lockdown rule. You can include any number of `ip` or - `ip_range` configurations. - """ - - created_on: datetime - """The timestamp of when the rule was created.""" - - description: str - """An informative summary of the rule.""" - - modified_on: datetime - """The timestamp of when the rule was last modified.""" - - paused: bool - """When true, indicates that the rule is currently paused.""" - - urls: List[str] - """The URLs to include in the rule definition. - - You can use wildcards. Each entered URL will be escaped before use, which means - you can only use simple wildcard patterns. - """ diff --git a/src/cloudflare/types/firewall/ip_configuration.py b/src/cloudflare/types/firewall/ip_configuration.py new file mode 100644 index 00000000000..a6ab1f0305c --- /dev/null +++ b/src/cloudflare/types/firewall/ip_configuration.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["IPConfiguration"] + + +class IPConfiguration(BaseModel): + target: Optional[Literal["ip"]] = None + """The configuration target. + + You must set the target to `ip` when specifying an IP address in the Zone + Lockdown rule. + """ + + value: Optional[str] = None + """The IP address to match. + + This address will be compared to the IP address of incoming requests. + """ diff --git a/src/cloudflare/types/firewall/lockdown.py b/src/cloudflare/types/firewall/lockdown.py new file mode 100644 index 00000000000..2298b87f9b9 --- /dev/null +++ b/src/cloudflare/types/firewall/lockdown.py @@ -0,0 +1,41 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from datetime import datetime + +from ..._models import BaseModel +from .urls_item import URLsItem +from .configuration import Configuration + +__all__ = ["Lockdown"] + + +class Lockdown(BaseModel): + id: str + """The unique identifier of the Zone Lockdown rule.""" + + configurations: Configuration + """ + A list of IP addresses or CIDR ranges that will be allowed to access the URLs + specified in the Zone Lockdown rule. You can include any number of `ip` or + `ip_range` configurations. + """ + + created_on: datetime + """The timestamp of when the rule was created.""" + + description: str + """An informative summary of the rule.""" + + modified_on: datetime + """The timestamp of when the rule was last modified.""" + + paused: bool + """When true, indicates that the rule is currently paused.""" + + urls: List[URLsItem] + """The URLs to include in the rule definition. + + You can use wildcards. Each entered URL will be escaped before use, which means + you can only use simple wildcard patterns. + """ diff --git a/src/cloudflare/types/firewall/products_item.py b/src/cloudflare/types/firewall/products_item.py new file mode 100644 index 00000000000..15349aeb56c --- /dev/null +++ b/src/cloudflare/types/firewall/products_item.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +__all__ = ["ProductsItem"] + +ProductsItem = Literal["zoneLockdown", "uaBlock", "bic", "hot", "securityLevel", "rateLimit", "waf"] diff --git a/src/cloudflare/types/firewall/firewall_filter_rule.py b/src/cloudflare/types/firewall/rule.py similarity index 53% rename from src/cloudflare/types/firewall/firewall_filter_rule.py rename to src/cloudflare/types/firewall/rule.py index 7eb9ce5b485..d203996a9fd 100644 --- a/src/cloudflare/types/firewall/firewall_filter_rule.py +++ b/src/cloudflare/types/firewall/rule.py @@ -1,15 +1,40 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import List, Union, Optional from typing_extensions import Literal from ..._models import BaseModel -from .unnamed_schema_ref_ab48d2d33259c9107401d174735701c7 import UnnamedSchemaRefAb48d2d33259c9107401d174735701c7 +from .products_item import ProductsItem +from .deleted_filter import DeletedFilter -__all__ = ["FirewallFilterRule"] +__all__ = ["Rule", "Filter", "FilterFirewallFilter"] -class FirewallFilterRule(BaseModel): +class FilterFirewallFilter(BaseModel): + id: Optional[str] = None + """The unique identifier of the filter.""" + + description: Optional[str] = None + """An informative summary of the filter.""" + + expression: Optional[str] = None + """The filter expression. + + For more information, refer to + [Expressions](https://developers.cloudflare.com/ruleset-engine/rules-language/expressions/). + """ + + paused: Optional[bool] = None + """When true, indicates that the filter is currently paused.""" + + ref: Optional[str] = None + """A short reference tag. Allows you to select related filters.""" + + +Filter = Union[FilterFirewallFilter, DeletedFilter] + + +class Rule(BaseModel): id: Optional[str] = None """The unique identifier of the firewall rule.""" @@ -24,7 +49,7 @@ class FirewallFilterRule(BaseModel): description: Optional[str] = None """An informative summary of the firewall rule.""" - filter: Optional[UnnamedSchemaRefAb48d2d33259c9107401d174735701c7] = None + filter: Optional[Filter] = None paused: Optional[bool] = None """When true, indicates that the firewall rule is currently paused.""" @@ -37,9 +62,7 @@ class FirewallFilterRule(BaseModel): processed before rules without a priority. """ - products: Optional[ - List[Literal["zoneLockdown", "uaBlock", "bic", "hot", "securityLevel", "rateLimit", "waf"]] - ] = None + products: Optional[List[ProductsItem]] = None ref: Optional[str] = None """A short reference tag. Allows you to select related firewall rules.""" diff --git a/src/cloudflare/types/firewall/rule_create_response.py b/src/cloudflare/types/firewall/rule_create_response.py index 78a21420c26..3d4d151f293 100644 --- a/src/cloudflare/types/firewall/rule_create_response.py +++ b/src/cloudflare/types/firewall/rule_create_response.py @@ -2,8 +2,8 @@ from typing import List -from .firewall_filter_rule import FirewallFilterRule +from .rule import Rule __all__ = ["RuleCreateResponse"] -RuleCreateResponse = List[FirewallFilterRule] +RuleCreateResponse = List[Rule] diff --git a/src/cloudflare/types/firewall/rule_edit_response.py b/src/cloudflare/types/firewall/rule_edit_response.py index 7fbd5ba92a9..70ce8c60fcf 100644 --- a/src/cloudflare/types/firewall/rule_edit_response.py +++ b/src/cloudflare/types/firewall/rule_edit_response.py @@ -2,8 +2,8 @@ from typing import List -from .firewall_filter_rule import FirewallFilterRule +from .rule import Rule __all__ = ["RuleEditResponse"] -RuleEditResponse = List[FirewallFilterRule] +RuleEditResponse = List[Rule] diff --git a/src/cloudflare/types/firewall/rule_param.py b/src/cloudflare/types/firewall/rule_param.py new file mode 100644 index 00000000000..bcf9e886b79 --- /dev/null +++ b/src/cloudflare/types/firewall/rule_param.py @@ -0,0 +1,61 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Union +from typing_extensions import Literal, TypedDict + +from .products_item import ProductsItem +from .deleted_filter import DeletedFilter + +__all__ = ["RuleParam", "Filter", "FilterFirewallFilter"] + + +class FilterFirewallFilter(TypedDict, total=False): + description: str + """An informative summary of the filter.""" + + expression: str + """The filter expression. + + For more information, refer to + [Expressions](https://developers.cloudflare.com/ruleset-engine/rules-language/expressions/). + """ + + paused: bool + """When true, indicates that the filter is currently paused.""" + + ref: str + """A short reference tag. Allows you to select related filters.""" + + +Filter = Union[FilterFirewallFilter, DeletedFilter] + + +class RuleParam(TypedDict, total=False): + action: Literal["block", "challenge", "js_challenge", "managed_challenge", "allow", "log", "bypass"] + """The action to apply to a matched request. + + The `log` action is only available on an Enterprise plan. + """ + + description: str + """An informative summary of the firewall rule.""" + + filter: Filter + + paused: bool + """When true, indicates that the firewall rule is currently paused.""" + + priority: float + """The priority of the rule. + + Optional value used to define the processing order. A lower number indicates a + higher priority. If not provided, rules with a defined priority will be + processed before rules without a priority. + """ + + products: List[ProductsItem] + + ref: str + """A short reference tag. Allows you to select related firewall rules.""" diff --git a/src/cloudflare/types/firewall/unnamed_schema_ref_ab48d2d33259c9107401d174735701c7.py b/src/cloudflare/types/firewall/unnamed_schema_ref_ab48d2d33259c9107401d174735701c7.py deleted file mode 100644 index cd8da2d5511..00000000000 --- a/src/cloudflare/types/firewall/unnamed_schema_ref_ab48d2d33259c9107401d174735701c7.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union - -from ..._models import BaseModel -from ..firewall_filter import FirewallFilter - -__all__ = ["UnnamedSchemaRefAb48d2d33259c9107401d174735701c7", "LegacyJhsDeletedFilter"] - - -class LegacyJhsDeletedFilter(BaseModel): - id: str - """The unique identifier of the filter.""" - - deleted: bool - """When true, indicates that the firewall rule was deleted.""" - - -UnnamedSchemaRefAb48d2d33259c9107401d174735701c7 = Union[FirewallFilter, LegacyJhsDeletedFilter] diff --git a/src/cloudflare/types/workers/scripts/versions/tags_item.py b/src/cloudflare/types/firewall/urls_item.py similarity index 70% rename from src/cloudflare/types/workers/scripts/versions/tags_item.py rename to src/cloudflare/types/firewall/urls_item.py index f9a5a6350ce..21c1dceedb4 100644 --- a/src/cloudflare/types/workers/scripts/versions/tags_item.py +++ b/src/cloudflare/types/firewall/urls_item.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -__all__ = ["TagsItem"] +__all__ = ["URLsItem"] -TagsItem = str +URLsItem = str diff --git a/src/cloudflare/types/firewall/waf/__init__.py b/src/cloudflare/types/firewall/waf/__init__.py index 420c10ae3c2..3637793489f 100644 --- a/src/cloudflare/types/firewall/waf/__init__.py +++ b/src/cloudflare/types/firewall/waf/__init__.py @@ -2,7 +2,10 @@ from __future__ import annotations -from .waf_override import WAFOverride as WAFOverride +from .rules import Rules as Rules +from .override import Override as Override +from .urls_items import URLsItems as URLsItems +from .rewrite_action import RewriteAction as RewriteAction from .package_list_params import PackageListParams as PackageListParams from .override_list_params import OverrideListParams as OverrideListParams from .package_get_response import PackageGetResponse as PackageGetResponse diff --git a/src/cloudflare/types/firewall/waf/waf_override.py b/src/cloudflare/types/firewall/waf/override.py similarity index 74% rename from src/cloudflare/types/firewall/waf/waf_override.py rename to src/cloudflare/types/firewall/waf/override.py index 528ee51f3b4..382bbf9536d 100644 --- a/src/cloudflare/types/firewall/waf/waf_override.py +++ b/src/cloudflare/types/firewall/waf/override.py @@ -1,28 +1,16 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Dict, List, Optional -from typing_extensions import Literal +from .rules import Rules from ...._models import BaseModel +from .urls_items import URLsItems +from .rewrite_action import RewriteAction -__all__ = ["WAFOverride", "RewriteAction"] +__all__ = ["Override"] -class RewriteAction(BaseModel): - block: Optional[Literal["challenge", "block", "simulate", "disable", "default"]] = None - """The WAF rule action to apply.""" - - challenge: Optional[str] = None - - default: Optional[str] = None - - disable: Optional[Literal["challenge", "block", "simulate", "disable", "default"]] = None - """The WAF rule action to apply.""" - - simulate: Optional[str] = None - - -class WAFOverride(BaseModel): +class Override(BaseModel): id: Optional[str] = None """The unique identifier of the WAF override.""" @@ -54,7 +42,7 @@ class WAFOverride(BaseModel): by the action configured in this object. """ - rules: Optional[Dict[str, Literal["challenge", "block", "simulate", "disable", "default"]]] = None + rules: Optional[Rules] = None """An object that allows you to override the action of specific WAF rules. Each key of this object must be the ID of a WAF rule, and each value must be a @@ -63,7 +51,7 @@ class WAFOverride(BaseModel): override, you must provide a `groups` object or a `rules` object. """ - urls: Optional[List[str]] = None + urls: Optional[List[URLsItems]] = None """The URLs to include in the current WAF override. You can use wildcards. Each entered URL will be escaped before use, which means diff --git a/src/cloudflare/types/firewall/waf/package_get_response.py b/src/cloudflare/types/firewall/waf/package_get_response.py index 11d4523e795..630f062115f 100644 --- a/src/cloudflare/types/firewall/waf/package_get_response.py +++ b/src/cloudflare/types/firewall/waf/package_get_response.py @@ -6,10 +6,10 @@ from ...shared import UnnamedSchemaRef8d6a37a1e4190f86652802244d29525f, UnnamedSchemaRef3248f24329456e19dfa042fff9986f72 from ...._models import BaseModel -__all__ = ["PackageGetResponse", "LegacyJhsAPIResponseSingle", "Result"] +__all__ = ["PackageGetResponse", "FirewallAPIResponseSingle", "Result"] -class LegacyJhsAPIResponseSingle(BaseModel): +class FirewallAPIResponseSingle(BaseModel): errors: List[UnnamedSchemaRef3248f24329456e19dfa042fff9986f72] messages: List[UnnamedSchemaRef3248f24329456e19dfa042fff9986f72] @@ -24,4 +24,4 @@ class Result(BaseModel): result: Optional[object] = None -PackageGetResponse = Union[LegacyJhsAPIResponseSingle, Result] +PackageGetResponse = Union[FirewallAPIResponseSingle, Result] diff --git a/src/cloudflare/types/firewall/waf/package_list_response.py b/src/cloudflare/types/firewall/waf/package_list_response.py index c71cccdc335..76b79e5a6f7 100644 --- a/src/cloudflare/types/firewall/waf/package_list_response.py +++ b/src/cloudflare/types/firewall/waf/package_list_response.py @@ -8,16 +8,16 @@ __all__ = [ "PackageListResponse", - "LegacyJhsAPIResponseCollection", - "LegacyJhsAPIResponseCollectionResultInfo", + "FirewallAPIResponseCollection", + "FirewallAPIResponseCollectionResultInfo", "Result", "ResultResult", - "ResultResultLegacyJhsPackageDefinition", - "ResultResultLegacyJhsAnomalyPackage", + "ResultResultFirewallPackageDefinition", + "ResultResultFirewallAnomalyPackage", ] -class LegacyJhsAPIResponseCollectionResultInfo(BaseModel): +class FirewallAPIResponseCollectionResultInfo(BaseModel): count: Optional[float] = None """Total number of results for the requested service""" @@ -31,7 +31,7 @@ class LegacyJhsAPIResponseCollectionResultInfo(BaseModel): """Total results available without any search parameters""" -class LegacyJhsAPIResponseCollection(BaseModel): +class FirewallAPIResponseCollection(BaseModel): errors: List[UnnamedSchemaRef3248f24329456e19dfa042fff9986f72] messages: List[UnnamedSchemaRef3248f24329456e19dfa042fff9986f72] @@ -41,12 +41,12 @@ class LegacyJhsAPIResponseCollection(BaseModel): success: Literal[True] """Whether the API call was successful""" - result_info: Optional[LegacyJhsAPIResponseCollectionResultInfo] = None + result_info: Optional[FirewallAPIResponseCollectionResultInfo] = None -class ResultResultLegacyJhsPackageDefinition(BaseModel): +class ResultResultFirewallPackageDefinition(BaseModel): id: str - """The unique identifier of a WAF package.""" + """Identifier""" description: str """A summary of the purpose/function of the WAF package.""" @@ -77,9 +77,9 @@ class ResultResultLegacyJhsPackageDefinition(BaseModel): """ -class ResultResultLegacyJhsAnomalyPackage(BaseModel): +class ResultResultFirewallAnomalyPackage(BaseModel): id: str - """The unique identifier of a WAF package.""" + """Identifier""" description: str """A summary of the purpose/function of the WAF package.""" @@ -110,11 +110,11 @@ class ResultResultLegacyJhsAnomalyPackage(BaseModel): """ -ResultResult = Union[ResultResultLegacyJhsPackageDefinition, ResultResultLegacyJhsAnomalyPackage] +ResultResult = Union[ResultResultFirewallPackageDefinition, ResultResultFirewallAnomalyPackage] class Result(BaseModel): result: Optional[List[ResultResult]] = None -PackageListResponse = Union[LegacyJhsAPIResponseCollection, Result] +PackageListResponse = Union[FirewallAPIResponseCollection, Result] diff --git a/src/cloudflare/types/firewall/waf/packages/__init__.py b/src/cloudflare/types/firewall/waf/packages/__init__.py index fa173a0e10f..4d6a16fdfd2 100644 --- a/src/cloudflare/types/firewall/waf/packages/__init__.py +++ b/src/cloudflare/types/firewall/waf/packages/__init__.py @@ -2,13 +2,14 @@ from __future__ import annotations +from .rule import Rule as Rule +from .group import Group as Group +from .rule_param import RuleParam as RuleParam from .rule_edit_params import RuleEditParams as RuleEditParams from .rule_list_params import RuleListParams as RuleListParams from .group_edit_params import GroupEditParams as GroupEditParams from .group_list_params import GroupListParams as GroupListParams from .rule_edit_response import RuleEditResponse as RuleEditResponse -from .waf_managed_rules_rule import WAFManagedRulesRule as WAFManagedRulesRule -from .waf_managed_rules_group import WAFManagedRulesGroup as WAFManagedRulesGroup from .unnamed_schema_ref_532d8b97684c9032dd36bae8acddebf5 import ( UnnamedSchemaRef532d8b97684c9032dd36bae8acddebf5 as UnnamedSchemaRef532d8b97684c9032dd36bae8acddebf5, ) diff --git a/src/cloudflare/types/firewall/waf/packages/waf_managed_rules_group.py b/src/cloudflare/types/firewall/waf/packages/group.py similarity index 93% rename from src/cloudflare/types/firewall/waf/packages/waf_managed_rules_group.py rename to src/cloudflare/types/firewall/waf/packages/group.py index 66b01dffd10..56484bdd5b8 100644 --- a/src/cloudflare/types/firewall/waf/packages/waf_managed_rules_group.py +++ b/src/cloudflare/types/firewall/waf/packages/group.py @@ -5,10 +5,10 @@ from ....._models import BaseModel -__all__ = ["WAFManagedRulesGroup"] +__all__ = ["Group"] -class WAFManagedRulesGroup(BaseModel): +class Group(BaseModel): id: str """The unique identifier of the rule group.""" diff --git a/src/cloudflare/types/firewall/waf/packages/waf_managed_rules_rule.py b/src/cloudflare/types/firewall/waf/packages/rule.py similarity index 94% rename from src/cloudflare/types/firewall/waf/packages/waf_managed_rules_rule.py rename to src/cloudflare/types/firewall/waf/packages/rule.py index 4be24ec2409..59e522be3b5 100644 --- a/src/cloudflare/types/firewall/waf/packages/waf_managed_rules_rule.py +++ b/src/cloudflare/types/firewall/waf/packages/rule.py @@ -7,7 +7,7 @@ from .unnamed_schema_ref_532d8b97684c9032dd36bae8acddebf5 import UnnamedSchemaRef532d8b97684c9032dd36bae8acddebf5 __all__ = [ - "WAFManagedRulesRule", + "Rule", "WAFManagedRulesAnomalyRule", "WAFManagedRulesTraditionalDenyRule", "WAFManagedRulesTraditionalAllowRule", @@ -100,6 +100,4 @@ class WAFManagedRulesTraditionalAllowRule(BaseModel): """The order in which the individual WAF rule is executed within its rule group.""" -WAFManagedRulesRule = Union[ - WAFManagedRulesAnomalyRule, WAFManagedRulesTraditionalDenyRule, WAFManagedRulesTraditionalAllowRule -] +Rule = Union[WAFManagedRulesAnomalyRule, WAFManagedRulesTraditionalDenyRule, WAFManagedRulesTraditionalAllowRule] diff --git a/src/cloudflare/types/firewall/waf/packages/rule_param.py b/src/cloudflare/types/firewall/waf/packages/rule_param.py new file mode 100644 index 00000000000..bc8426dd3f1 --- /dev/null +++ b/src/cloudflare/types/firewall/waf/packages/rule_param.py @@ -0,0 +1,42 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Literal, Required, TypedDict + +__all__ = [ + "RuleParam", + "WAFManagedRulesAnomalyRule", + "WAFManagedRulesTraditionalDenyRule", + "WAFManagedRulesTraditionalAllowRule", +] + + +class WAFManagedRulesAnomalyRule(TypedDict, total=False): + mode: Required[Literal["on", "off"]] + """When set to `on`, the current WAF rule will be used when evaluating the request. + + Applies to anomaly detection WAF rules. + """ + + +class WAFManagedRulesTraditionalDenyRule(TypedDict, total=False): + mode: Required[Literal["default", "disable", "simulate", "block", "challenge"]] + """The action that the current WAF rule will perform when triggered. + + Applies to traditional (deny) WAF rules. + """ + + +class WAFManagedRulesTraditionalAllowRule(TypedDict, total=False): + default_mode: Required[object] + + mode: Required[Literal["on", "off"]] + """When set to `on`, the current rule will be used when evaluating the request. + + Applies to traditional (allow) WAF rules. + """ + + +RuleParam = Union[WAFManagedRulesAnomalyRule, WAFManagedRulesTraditionalDenyRule, WAFManagedRulesTraditionalAllowRule] diff --git a/src/cloudflare/types/firewall/waf/rewrite_action.py b/src/cloudflare/types/firewall/waf/rewrite_action.py new file mode 100644 index 00000000000..489bc26641a --- /dev/null +++ b/src/cloudflare/types/firewall/waf/rewrite_action.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["RewriteAction"] + + +class RewriteAction(BaseModel): + block: Optional[Literal["challenge", "block", "simulate", "disable", "default"]] = None + """The WAF rule action to apply.""" + + challenge: Optional[str] = None + + default: Optional[str] = None + + disable: Optional[Literal["challenge", "block", "simulate", "disable", "default"]] = None + """The WAF rule action to apply.""" + + simulate: Optional[str] = None diff --git a/src/cloudflare/types/firewall/waf/rules.py b/src/cloudflare/types/firewall/waf/rules.py new file mode 100644 index 00000000000..280b7e5402c --- /dev/null +++ b/src/cloudflare/types/firewall/waf/rules.py @@ -0,0 +1,8 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict +from typing_extensions import Literal + +__all__ = ["Rules"] + +Rules = Dict[str, Literal["challenge", "block", "simulate", "disable", "default"]] diff --git a/src/cloudflare/types/magic_transit/colo_names_item.py b/src/cloudflare/types/firewall/waf/urls_items.py similarity index 64% rename from src/cloudflare/types/magic_transit/colo_names_item.py rename to src/cloudflare/types/firewall/waf/urls_items.py index 274c403afb8..69ec082e1de 100644 --- a/src/cloudflare/types/magic_transit/colo_names_item.py +++ b/src/cloudflare/types/firewall/waf/urls_items.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -__all__ = ["ColoNamesItem"] +__all__ = ["URLsItems"] -ColoNamesItem = str +URLsItems = str diff --git a/src/cloudflare/types/healthcheck.py b/src/cloudflare/types/healthcheck.py index 2d73201fcc2..671d71fc0a6 100644 --- a/src/cloudflare/types/healthcheck.py +++ b/src/cloudflare/types/healthcheck.py @@ -5,7 +5,8 @@ from typing_extensions import Literal from .._models import BaseModel -from .tcp_configuration import TcpConfiguration +from .check_region import CheckRegion +from .tcp_configuration import TCPConfiguration from .http_configuration import HTTPConfiguration __all__ = ["Healthcheck"] @@ -18,26 +19,7 @@ class Healthcheck(BaseModel): address: Optional[str] = None """The hostname or IP address of the origin server to run health checks on.""" - check_regions: Optional[ - List[ - Literal[ - "WNAM", - "ENAM", - "WEU", - "EEU", - "NSAM", - "SSAM", - "OC", - "ME", - "NAF", - "SAF", - "IN", - "SEAS", - "NEAS", - "ALL_REGIONS", - ] - ] - ] = None + check_regions: Optional[List[CheckRegion]] = None """A list of regions from which to run health checks. Null means Cloudflare will pick a default region. @@ -93,7 +75,7 @@ class Healthcheck(BaseModel): suspended: Optional[bool] = None """If suspended, no health checks are sent to the origin.""" - tcp_config: Optional[TcpConfiguration] = None + tcp_config: Optional[TCPConfiguration] = None """Parameters specific to TCP health check.""" timeout: Optional[int] = None diff --git a/src/cloudflare/types/healthcheck_create_params.py b/src/cloudflare/types/healthcheck_create_params.py index e2da93f2dac..9fcf2a0f5ce 100644 --- a/src/cloudflare/types/healthcheck_create_params.py +++ b/src/cloudflare/types/healthcheck_create_params.py @@ -6,8 +6,8 @@ from typing_extensions import Required, Annotated, TypedDict from .._utils import PropertyInfo -from .check_region_item import CheckRegionItem -from .tcp_configuration_param import TcpConfigurationParam +from .check_region import CheckRegion +from .tcp_configuration_param import TCPConfigurationParam from .http_configuration_param import HTTPConfigurationParam __all__ = ["HealthcheckCreateParams"] @@ -26,7 +26,7 @@ class HealthcheckCreateParams(TypedDict, total=False): Only alphanumeric characters, hyphens and underscores are allowed. """ - check_regions: Optional[List[CheckRegionItem]] + check_regions: Optional[List[CheckRegion]] """A list of regions from which to run health checks. Null means Cloudflare will pick a default region. @@ -66,7 +66,7 @@ class HealthcheckCreateParams(TypedDict, total=False): suspended: bool """If suspended, no health checks are sent to the origin.""" - tcp_config: Optional[TcpConfigurationParam] + tcp_config: Optional[TCPConfigurationParam] """Parameters specific to TCP health check.""" healthcheck_timeout: Annotated[int, PropertyInfo(alias="timeout")] diff --git a/src/cloudflare/types/healthcheck_edit_params.py b/src/cloudflare/types/healthcheck_edit_params.py index f7850ed5b47..8656849de64 100644 --- a/src/cloudflare/types/healthcheck_edit_params.py +++ b/src/cloudflare/types/healthcheck_edit_params.py @@ -6,8 +6,8 @@ from typing_extensions import Required, Annotated, TypedDict from .._utils import PropertyInfo -from .check_region_item import CheckRegionItem -from .tcp_configuration_param import TcpConfigurationParam +from .check_region import CheckRegion +from .tcp_configuration_param import TCPConfigurationParam from .http_configuration_param import HTTPConfigurationParam __all__ = ["HealthcheckEditParams"] @@ -26,7 +26,7 @@ class HealthcheckEditParams(TypedDict, total=False): Only alphanumeric characters, hyphens and underscores are allowed. """ - check_regions: Optional[List[CheckRegionItem]] + check_regions: Optional[List[CheckRegion]] """A list of regions from which to run health checks. Null means Cloudflare will pick a default region. @@ -66,7 +66,7 @@ class HealthcheckEditParams(TypedDict, total=False): suspended: bool """If suspended, no health checks are sent to the origin.""" - tcp_config: Optional[TcpConfigurationParam] + tcp_config: Optional[TCPConfigurationParam] """Parameters specific to TCP health check.""" healthcheck_timeout: Annotated[int, PropertyInfo(alias="timeout")] diff --git a/src/cloudflare/types/healthcheck_update_params.py b/src/cloudflare/types/healthcheck_update_params.py index 3222c0ab4f8..271a9f66ca7 100644 --- a/src/cloudflare/types/healthcheck_update_params.py +++ b/src/cloudflare/types/healthcheck_update_params.py @@ -6,8 +6,8 @@ from typing_extensions import Required, Annotated, TypedDict from .._utils import PropertyInfo -from .check_region_item import CheckRegionItem -from .tcp_configuration_param import TcpConfigurationParam +from .check_region import CheckRegion +from .tcp_configuration_param import TCPConfigurationParam from .http_configuration_param import HTTPConfigurationParam __all__ = ["HealthcheckUpdateParams"] @@ -26,7 +26,7 @@ class HealthcheckUpdateParams(TypedDict, total=False): Only alphanumeric characters, hyphens and underscores are allowed. """ - check_regions: Optional[List[CheckRegionItem]] + check_regions: Optional[List[CheckRegion]] """A list of regions from which to run health checks. Null means Cloudflare will pick a default region. @@ -66,7 +66,7 @@ class HealthcheckUpdateParams(TypedDict, total=False): suspended: bool """If suspended, no health checks are sent to the origin.""" - tcp_config: Optional[TcpConfigurationParam] + tcp_config: Optional[TCPConfigurationParam] """Parameters specific to TCP health check.""" healthcheck_timeout: Annotated[int, PropertyInfo(alias="timeout")] diff --git a/src/cloudflare/types/healthchecks/preview_create_params.py b/src/cloudflare/types/healthchecks/preview_create_params.py index 2a860ad6eab..e9ad814ec7d 100644 --- a/src/cloudflare/types/healthchecks/preview_create_params.py +++ b/src/cloudflare/types/healthchecks/preview_create_params.py @@ -6,8 +6,8 @@ from typing_extensions import Required, Annotated, TypedDict from ..._utils import PropertyInfo -from .check_region_item import CheckRegionItem -from ..tcp_configuration_param import TcpConfigurationParam +from ..check_region import CheckRegion +from ..tcp_configuration_param import TCPConfigurationParam from ..http_configuration_param import HTTPConfigurationParam __all__ = ["PreviewCreateParams"] @@ -26,7 +26,7 @@ class PreviewCreateParams(TypedDict, total=False): Only alphanumeric characters, hyphens and underscores are allowed. """ - check_regions: Optional[List[CheckRegionItem]] + check_regions: Optional[List[CheckRegion]] """A list of regions from which to run health checks. Null means Cloudflare will pick a default region. @@ -66,7 +66,7 @@ class PreviewCreateParams(TypedDict, total=False): suspended: bool """If suspended, no health checks are sent to the origin.""" - tcp_config: Optional[TcpConfigurationParam] + tcp_config: Optional[TCPConfigurationParam] """Parameters specific to TCP health check.""" healthcheck_timeout: Annotated[int, PropertyInfo(alias="timeout")] diff --git a/src/cloudflare/types/keyless_certificate_hostname.py b/src/cloudflare/types/hostname.py similarity index 92% rename from src/cloudflare/types/keyless_certificate_hostname.py rename to src/cloudflare/types/hostname.py index 98c5a77f170..a4e440379c1 100644 --- a/src/cloudflare/types/keyless_certificate_hostname.py +++ b/src/cloudflare/types/hostname.py @@ -7,10 +7,10 @@ from .tunnel import Tunnel from .._models import BaseModel -__all__ = ["KeylessCertificateHostname"] +__all__ = ["Hostname"] -class KeylessCertificateHostname(BaseModel): +class Hostname(BaseModel): id: str """Keyless certificate identifier tag.""" diff --git a/src/cloudflare/types/hostname_param.py b/src/cloudflare/types/hostname_param.py new file mode 100644 index 00000000000..338408aac8b --- /dev/null +++ b/src/cloudflare/types/hostname_param.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .tunnel_param import TunnelParam + +__all__ = ["HostnameParam"] + + +class HostnameParam(TypedDict, total=False): + host: Required[str] + """The keyless SSL name.""" + + port: Required[float] + """ + The keyless SSL port used to communicate between Cloudflare and the client's + Keyless SSL server. + """ + + tunnel: TunnelParam + """Configuration for using Keyless SSL through a Cloudflare Tunnel""" diff --git a/src/cloudflare/types/hyperdrive/__init__.py b/src/cloudflare/types/hyperdrive/__init__.py index 91e983052a0..dea31023f50 100644 --- a/src/cloudflare/types/hyperdrive/__init__.py +++ b/src/cloudflare/types/hyperdrive/__init__.py @@ -4,10 +4,5 @@ from .hyperdrive import Hyperdrive as Hyperdrive from .config_edit_params import ConfigEditParams as ConfigEditParams -from .config_get_response import ConfigGetResponse as ConfigGetResponse from .config_create_params import ConfigCreateParams as ConfigCreateParams -from .config_edit_response import ConfigEditResponse as ConfigEditResponse -from .config_list_response import ConfigListResponse as ConfigListResponse from .config_update_params import ConfigUpdateParams as ConfigUpdateParams -from .config_create_response import ConfigCreateResponse as ConfigCreateResponse -from .config_update_response import ConfigUpdateResponse as ConfigUpdateResponse diff --git a/src/cloudflare/types/hyperdrive/config_create_params.py b/src/cloudflare/types/hyperdrive/config_create_params.py index ae81de287dd..10244dcb06d 100644 --- a/src/cloudflare/types/hyperdrive/config_create_params.py +++ b/src/cloudflare/types/hyperdrive/config_create_params.py @@ -4,7 +4,9 @@ from typing_extensions import Required, TypedDict -__all__ = ["ConfigCreateParams", "Origin"] +from ..configuration_param import ConfigurationParam + +__all__ = ["ConfigCreateParams"] class ConfigCreateParams(TypedDict, total=False): @@ -13,12 +15,4 @@ class ConfigCreateParams(TypedDict, total=False): name: Required[object] - origin: Required[Origin] - - -class Origin(TypedDict, total=False): - password: Required[str] - """The password required to access your origin database. - - This value is write-only and never returned by the API. - """ + origin: Required[ConfigurationParam] diff --git a/src/cloudflare/types/hyperdrive/config_create_response.py b/src/cloudflare/types/hyperdrive/config_create_response.py deleted file mode 100644 index 8409b436a8b..00000000000 --- a/src/cloudflare/types/hyperdrive/config_create_response.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel - -__all__ = ["ConfigCreateResponse"] - - -class ConfigCreateResponse(BaseModel): - id: Optional[str] = None - """Identifier""" diff --git a/src/cloudflare/types/hyperdrive/config_edit_params.py b/src/cloudflare/types/hyperdrive/config_edit_params.py index 1fb0ab38a87..e3343c427f7 100644 --- a/src/cloudflare/types/hyperdrive/config_edit_params.py +++ b/src/cloudflare/types/hyperdrive/config_edit_params.py @@ -4,19 +4,13 @@ from typing_extensions import Required, TypedDict -__all__ = ["ConfigEditParams", "Origin"] +from ..configuration_param import ConfigurationParam + +__all__ = ["ConfigEditParams"] class ConfigEditParams(TypedDict, total=False): account_id: Required[str] """Identifier""" - origin: Origin - - -class Origin(TypedDict, total=False): - password: Required[str] - """The password required to access your origin database. - - This value is write-only and never returned by the API. - """ + origin: ConfigurationParam diff --git a/src/cloudflare/types/hyperdrive/config_edit_response.py b/src/cloudflare/types/hyperdrive/config_edit_response.py deleted file mode 100644 index 7a226e1c000..00000000000 --- a/src/cloudflare/types/hyperdrive/config_edit_response.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel - -__all__ = ["ConfigEditResponse"] - - -class ConfigEditResponse(BaseModel): - id: Optional[str] = None - """Identifier""" diff --git a/src/cloudflare/types/hyperdrive/config_get_response.py b/src/cloudflare/types/hyperdrive/config_get_response.py deleted file mode 100644 index 1710b571915..00000000000 --- a/src/cloudflare/types/hyperdrive/config_get_response.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel - -__all__ = ["ConfigGetResponse"] - - -class ConfigGetResponse(BaseModel): - id: Optional[str] = None - """Identifier""" diff --git a/src/cloudflare/types/hyperdrive/config_list_response.py b/src/cloudflare/types/hyperdrive/config_list_response.py deleted file mode 100644 index 7721424cc22..00000000000 --- a/src/cloudflare/types/hyperdrive/config_list_response.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel - -__all__ = ["ConfigListResponse"] - - -class ConfigListResponse(BaseModel): - id: Optional[str] = None - """Identifier""" diff --git a/src/cloudflare/types/hyperdrive/config_update_params.py b/src/cloudflare/types/hyperdrive/config_update_params.py index 220b3407fec..a38d5864ca1 100644 --- a/src/cloudflare/types/hyperdrive/config_update_params.py +++ b/src/cloudflare/types/hyperdrive/config_update_params.py @@ -4,7 +4,9 @@ from typing_extensions import Required, TypedDict -__all__ = ["ConfigUpdateParams", "Origin"] +from ..configuration_param import ConfigurationParam + +__all__ = ["ConfigUpdateParams"] class ConfigUpdateParams(TypedDict, total=False): @@ -13,12 +15,4 @@ class ConfigUpdateParams(TypedDict, total=False): name: Required[object] - origin: Required[Origin] - - -class Origin(TypedDict, total=False): - password: Required[str] - """The password required to access your origin database. - - This value is write-only and never returned by the API. - """ + origin: Required[ConfigurationParam] diff --git a/src/cloudflare/types/hyperdrive/config_update_response.py b/src/cloudflare/types/hyperdrive/config_update_response.py deleted file mode 100644 index 9d542f87178..00000000000 --- a/src/cloudflare/types/hyperdrive/config_update_response.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel - -__all__ = ["ConfigUpdateResponse"] - - -class ConfigUpdateResponse(BaseModel): - id: Optional[str] = None - """Identifier""" diff --git a/src/cloudflare/types/images/v1/__init__.py b/src/cloudflare/types/images/v1/__init__.py index 77dc4a66e03..0c36bab12ea 100644 --- a/src/cloudflare/types/images/v1/__init__.py +++ b/src/cloudflare/types/images/v1/__init__.py @@ -2,10 +2,12 @@ from __future__ import annotations -from .v1_image_variant import V1ImageVariant as V1ImageVariant -from .images_image_keys import ImagesImageKeys as ImagesImageKeys -from .v1_image_variants import V1ImageVariants as V1ImageVariants -from .images_images_stats import ImagesImagesStats as ImagesImagesStats +from .key import Key as Key +from .stat import Stat as Stat +from .variant import Variant as Variant from .variant_edit_params import VariantEditParams as VariantEditParams +from .variant_get_response import VariantGetResponse as VariantGetResponse from .variant_create_params import VariantCreateParams as VariantCreateParams from .variant_delete_params import VariantDeleteParams as VariantDeleteParams +from .variant_edit_response import VariantEditResponse as VariantEditResponse +from .variant_create_response import VariantCreateResponse as VariantCreateResponse diff --git a/src/cloudflare/types/images/v1/images_image_keys.py b/src/cloudflare/types/images/v1/key.py similarity index 55% rename from src/cloudflare/types/images/v1/images_image_keys.py rename to src/cloudflare/types/images/v1/key.py index 835cab41a42..628cc46d9e5 100644 --- a/src/cloudflare/types/images/v1/images_image_keys.py +++ b/src/cloudflare/types/images/v1/key.py @@ -4,16 +4,8 @@ from ...._models import BaseModel -__all__ = ["ImagesImageKeys", "Key"] +__all__ = ["Key"] class Key(BaseModel): - name: Optional[str] = None - """Key name.""" - - value: Optional[str] = None - """Key value.""" - - -class ImagesImageKeys(BaseModel): keys: Optional[List[Key]] = None diff --git a/src/cloudflare/types/images/v1/images_images_stats.py b/src/cloudflare/types/images/v1/stat.py similarity index 82% rename from src/cloudflare/types/images/v1/images_images_stats.py rename to src/cloudflare/types/images/v1/stat.py index f6733a931cd..71ae800bb98 100644 --- a/src/cloudflare/types/images/v1/images_images_stats.py +++ b/src/cloudflare/types/images/v1/stat.py @@ -4,7 +4,7 @@ from ...._models import BaseModel -__all__ = ["ImagesImagesStats", "Count"] +__all__ = ["Stat", "Count"] class Count(BaseModel): @@ -15,5 +15,5 @@ class Count(BaseModel): """Cloudflare Images current usage.""" -class ImagesImagesStats(BaseModel): +class Stat(BaseModel): count: Optional[Count] = None diff --git a/src/cloudflare/types/images/v1/v1_image_variants.py b/src/cloudflare/types/images/v1/variant.py similarity index 91% rename from src/cloudflare/types/images/v1/v1_image_variants.py rename to src/cloudflare/types/images/v1/variant.py index 6d19fc03cf9..c2796655888 100644 --- a/src/cloudflare/types/images/v1/v1_image_variants.py +++ b/src/cloudflare/types/images/v1/variant.py @@ -7,7 +7,7 @@ from ...._models import BaseModel -__all__ = ["V1ImageVariants", "Variants", "VariantsHero", "VariantsHeroOptions"] +__all__ = ["Variant", "Variants", "VariantsHero", "VariantsHeroOptions"] class VariantsHeroOptions(BaseModel): @@ -44,5 +44,5 @@ class Variants(BaseModel): hero: Optional[VariantsHero] = None -class V1ImageVariants(BaseModel): +class Variant(BaseModel): variants: Optional[Variants] = None diff --git a/src/cloudflare/types/images/v1/variant_create_response.py b/src/cloudflare/types/images/v1/variant_create_response.py new file mode 100644 index 00000000000..723ef2b90f6 --- /dev/null +++ b/src/cloudflare/types/images/v1/variant_create_response.py @@ -0,0 +1,44 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from ...._models import BaseModel + +__all__ = ["VariantCreateResponse", "Variant", "VariantOptions"] + + +class VariantOptions(BaseModel): + fit: Literal["scale-down", "contain", "cover", "crop", "pad"] + """ + The fit property describes how the width and height dimensions should be + interpreted. + """ + + height: float + """Maximum height in image pixels.""" + + metadata: Literal["keep", "copyright", "none"] + """What EXIF data should be preserved in the output image.""" + + width: float + """Maximum width in image pixels.""" + + +class Variant(BaseModel): + id: str + + options: VariantOptions + """Allows you to define image resizing sizes for different use cases.""" + + never_require_signed_urls: Optional[bool] = FieldInfo(alias="neverRequireSignedURLs", default=None) + """ + Indicates whether the variant can access an image without a signature, + regardless of image access control. + """ + + +class VariantCreateResponse(BaseModel): + variant: Optional[Variant] = None diff --git a/src/cloudflare/types/images/v1/variant_edit_response.py b/src/cloudflare/types/images/v1/variant_edit_response.py new file mode 100644 index 00000000000..64d25e4b9ee --- /dev/null +++ b/src/cloudflare/types/images/v1/variant_edit_response.py @@ -0,0 +1,44 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from ...._models import BaseModel + +__all__ = ["VariantEditResponse", "Variant", "VariantOptions"] + + +class VariantOptions(BaseModel): + fit: Literal["scale-down", "contain", "cover", "crop", "pad"] + """ + The fit property describes how the width and height dimensions should be + interpreted. + """ + + height: float + """Maximum height in image pixels.""" + + metadata: Literal["keep", "copyright", "none"] + """What EXIF data should be preserved in the output image.""" + + width: float + """Maximum width in image pixels.""" + + +class Variant(BaseModel): + id: str + + options: VariantOptions + """Allows you to define image resizing sizes for different use cases.""" + + never_require_signed_urls: Optional[bool] = FieldInfo(alias="neverRequireSignedURLs", default=None) + """ + Indicates whether the variant can access an image without a signature, + regardless of image access control. + """ + + +class VariantEditResponse(BaseModel): + variant: Optional[Variant] = None diff --git a/src/cloudflare/types/images/v1/v1_image_variant.py b/src/cloudflare/types/images/v1/variant_get_response.py similarity index 91% rename from src/cloudflare/types/images/v1/v1_image_variant.py rename to src/cloudflare/types/images/v1/variant_get_response.py index adcbc3dd87d..add794835e3 100644 --- a/src/cloudflare/types/images/v1/v1_image_variant.py +++ b/src/cloudflare/types/images/v1/variant_get_response.py @@ -7,7 +7,7 @@ from ...._models import BaseModel -__all__ = ["V1ImageVariant", "Variant", "VariantOptions"] +__all__ = ["VariantGetResponse", "Variant", "VariantOptions"] class VariantOptions(BaseModel): @@ -40,5 +40,5 @@ class Variant(BaseModel): """ -class V1ImageVariant(BaseModel): +class VariantGetResponse(BaseModel): variant: Optional[Variant] = None diff --git a/src/cloudflare/types/images/v1_create_params.py b/src/cloudflare/types/images/v1_create_params.py index a093cf419e5..ede7cddf3e8 100644 --- a/src/cloudflare/types/images/v1_create_params.py +++ b/src/cloudflare/types/images/v1_create_params.py @@ -2,26 +2,32 @@ from __future__ import annotations -from typing import Union -from typing_extensions import Required, TypedDict +from typing_extensions import Required, Annotated, TypedDict -__all__ = ["V1CreateParams", "ImagesImageUploadViaFile", "ImagesImageUploadViaURL"] +from ..._utils import PropertyInfo +__all__ = ["V1CreateParams"] -class ImagesImageUploadViaFile(TypedDict, total=False): + +class V1CreateParams(TypedDict, total=False): account_id: Required[str] """Account identifier tag.""" - file: Required[object] - """An image binary data.""" + file: object + """An image binary data. Only needed when type is uploading a file.""" + metadata: object + """User modifiable key-value store. -class ImagesImageUploadViaURL(TypedDict, total=False): - account_id: Required[str] - """Account identifier tag.""" + Can use used for keeping references to another system of record for managing + images. + """ - url: Required[str] - """A URL to fetch an image from origin.""" + require_signed_urls: Annotated[bool, PropertyInfo(alias="requireSignedURLs")] + """Indicates whether the image requires a signature token for the access.""" + url: str + """A URL to fetch an image from origin. -V1CreateParams = Union[ImagesImageUploadViaFile, ImagesImageUploadViaURL] + Only needed when type is uploading from a URL. + """ diff --git a/src/cloudflare/types/intel_phishing_url_info.py b/src/cloudflare/types/info.py similarity index 95% rename from src/cloudflare/types/intel_phishing_url_info.py rename to src/cloudflare/types/info.py index 557492516bb..8f0c1a5dfc8 100644 --- a/src/cloudflare/types/intel_phishing_url_info.py +++ b/src/cloudflare/types/info.py @@ -10,10 +10,10 @@ from .unnamed_schema_ref_209db30ed499548152d6f3bccf720b54 import UnnamedSchemaRef209db30ed499548152d6f3bccf720b54 from .unnamed_schema_ref_a64e2a18a86750b6bd72cdf37ecfd869 import UnnamedSchemaRefA64e2a18a86750b6bd72cdf37ecfd869 -__all__ = ["IntelPhishingURLInfo"] +__all__ = ["Info"] -class IntelPhishingURLInfo(BaseModel): +class Info(BaseModel): categorizations: Optional[List[UnnamedSchemaRef209db30ed499548152d6f3bccf720b54]] = None """List of categorizations applied to this submission.""" diff --git a/src/cloudflare/types/intel/__init__.py b/src/cloudflare/types/intel/__init__.py index 2f466c3ebd2..c6dd533c08b 100644 --- a/src/cloudflare/types/intel/__init__.py +++ b/src/cloudflare/types/intel/__init__.py @@ -2,20 +2,21 @@ from __future__ import annotations -from .intel_asn import IntelASN as IntelASN -from .intel_whois import IntelWhois as IntelWhois -from .intel_domain import IntelDomain as IntelDomain -from .intel_ip_list import IntelIPList as IntelIPList +from .ip import IP as IP +from .asn import ASN as ASN +from .dns import DNS as DNS +from .whois import Whois as Whois +from .domain import Domain as Domain +from .ip_list import IPList as IPList +from .dns_param import DNSParam as DNSParam from .ip_get_params import IPGetParams as IPGetParams +from .sinkhole_item import SinkholeItem as SinkholeItem from .dns_get_params import DNSGetParams as DNSGetParams +from .domain_history import DomainHistory as DomainHistory from .ip_get_response import IPGetResponse as IPGetResponse -from .intel_schemas_ip import IntelSchemasIP as IntelSchemasIP from .whois_get_params import WhoisGetParams as WhoisGetParams from .domain_get_params import DomainGetParams as DomainGetParams -from .intel_sinkhole_item import IntelSinkholeItem as IntelSinkholeItem -from .intel_domain_history import IntelDomainHistory as IntelDomainHistory from .ip_list_get_response import IPListGetResponse as IPListGetResponse -from .intel_passive_dns_by_ip import IntelPassiveDNSByIP as IntelPassiveDNSByIP 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 diff --git a/src/cloudflare/types/intel/asn/__init__.py b/src/cloudflare/types/intel/asn/__init__.py index 4ea670523ed..f13f192c8e5 100644 --- a/src/cloudflare/types/intel/asn/__init__.py +++ b/src/cloudflare/types/intel/asn/__init__.py @@ -2,4 +2,5 @@ from __future__ import annotations +from .asn import ASN as ASN from .subnet_get_response import SubnetGetResponse as SubnetGetResponse diff --git a/src/cloudflare/types/intel/intel_asn.py b/src/cloudflare/types/intel/asn/asn.py similarity index 70% rename from src/cloudflare/types/intel/intel_asn.py rename to src/cloudflare/types/intel/asn/asn.py index dece910c602..6604efb8690 100644 --- a/src/cloudflare/types/intel/intel_asn.py +++ b/src/cloudflare/types/intel/asn/asn.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -__all__ = ["IntelASN"] +__all__ = ["ASN"] -IntelASN = int +ASN = int diff --git a/src/cloudflare/types/intel/asn/subnet_get_response.py b/src/cloudflare/types/intel/asn/subnet_get_response.py index cb54964edf4..5b81210a143 100644 --- a/src/cloudflare/types/intel/asn/subnet_get_response.py +++ b/src/cloudflare/types/intel/asn/subnet_get_response.py @@ -2,14 +2,15 @@ from typing import List, Optional +from cloudflare.types.intel import ASN + from ...._models import BaseModel -from ..intel_asn import IntelASN __all__ = ["SubnetGetResponse"] class SubnetGetResponse(BaseModel): - asn: Optional[IntelASN] = None + asn: Optional[ASN] = None count: Optional[float] = None """Total results returned based on your search parameters.""" diff --git a/src/cloudflare/types/intel/attack_surface_report/__init__.py b/src/cloudflare/types/intel/attack_surface_report/__init__.py index 304920d5c67..6f1047ed7b8 100644 --- a/src/cloudflare/types/intel/attack_surface_report/__init__.py +++ b/src/cloudflare/types/intel/attack_surface_report/__init__.py @@ -2,6 +2,10 @@ from __future__ import annotations +from .product import Product as Product +from .subject import Subject as Subject +from .issue_type import IssueType as IssueType +from .issue_class import IssueClass as IssueClass from .issue_list_params import IssueListParams as IssueListParams from .issue_type_params import IssueTypeParams as IssueTypeParams from .issue_class_params import IssueClassParams as IssueClassParams @@ -9,6 +13,7 @@ from .issue_type_response import IssueTypeResponse as IssueTypeResponse from .issue_class_response import IssueClassResponse as IssueClassResponse from .issue_dismiss_params import IssueDismissParams as IssueDismissParams +from .severity_query_param import SeverityQueryParam as SeverityQueryParam from .issue_severity_params import IssueSeverityParams as IssueSeverityParams from .issue_severity_response import IssueSeverityResponse as IssueSeverityResponse from .issue_type_get_response import IssueTypeGetResponse as IssueTypeGetResponse diff --git a/src/cloudflare/types/intel/attack_surface_report/issue_class.py b/src/cloudflare/types/intel/attack_surface_report/issue_class.py new file mode 100644 index 00000000000..e8d11cc6298 --- /dev/null +++ b/src/cloudflare/types/intel/attack_surface_report/issue_class.py @@ -0,0 +1,6 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +__all__ = ["IssueClass"] + +IssueClass = str diff --git a/src/cloudflare/types/intel/attack_surface_report/issue_class_params.py b/src/cloudflare/types/intel/attack_surface_report/issue_class_params.py index 8d958c86f63..254ce8f9fc8 100644 --- a/src/cloudflare/types/intel/attack_surface_report/issue_class_params.py +++ b/src/cloudflare/types/intel/attack_surface_report/issue_class_params.py @@ -3,9 +3,14 @@ from __future__ import annotations from typing import List -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict +from .product import Product +from .subject import Subject from ...._utils import PropertyInfo +from .issue_type import IssueType +from .issue_class import IssueClass +from .severity_query_param import SeverityQueryParam __all__ = ["IssueClassParams"] @@ -16,41 +21,22 @@ class IssueClassParams(TypedDict, total=False): dismissed: bool - issue_class: List[str] + issue_class: List[IssueClass] - issue_class_neq: Annotated[List[str], PropertyInfo(alias="issue_class~neq")] + issue_class_neq: Annotated[List[IssueClass], PropertyInfo(alias="issue_class~neq")] - issue_type: List[ - Literal[ - "compliance_violation", - "email_security", - "exposed_infrastructure", - "insecure_configuration", - "weak_authentication", - ] - ] + issue_type: List[IssueType] - issue_type_neq: Annotated[ - List[ - Literal[ - "compliance_violation", - "email_security", - "exposed_infrastructure", - "insecure_configuration", - "weak_authentication", - ] - ], - PropertyInfo(alias="issue_type~neq"), - ] + issue_type_neq: Annotated[List[IssueType], PropertyInfo(alias="issue_type~neq")] - product: List[str] + product: List[Product] - product_neq: Annotated[List[str], PropertyInfo(alias="product~neq")] + product_neq: Annotated[List[Product], PropertyInfo(alias="product~neq")] - severity: List[Literal["low", "moderate", "critical"]] + severity: List[SeverityQueryParam] - severity_neq: Annotated[List[Literal["low", "moderate", "critical"]], PropertyInfo(alias="severity~neq")] + severity_neq: Annotated[List[SeverityQueryParam], PropertyInfo(alias="severity~neq")] - subject: List[str] + subject: List[Subject] - subject_neq: Annotated[List[str], PropertyInfo(alias="subject~neq")] + subject_neq: Annotated[List[Subject], PropertyInfo(alias="subject~neq")] diff --git a/src/cloudflare/types/intel/attack_surface_report/issue_list_params.py b/src/cloudflare/types/intel/attack_surface_report/issue_list_params.py index e458be134b1..930d5970317 100644 --- a/src/cloudflare/types/intel/attack_surface_report/issue_list_params.py +++ b/src/cloudflare/types/intel/attack_surface_report/issue_list_params.py @@ -3,9 +3,14 @@ from __future__ import annotations from typing import List -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict +from .product import Product +from .subject import Subject from ...._utils import PropertyInfo +from .issue_type import IssueType +from .issue_class import IssueClass +from .severity_query_param import SeverityQueryParam __all__ = ["IssueListParams"] @@ -16,32 +21,13 @@ class IssueListParams(TypedDict, total=False): dismissed: bool - issue_class: List[str] - - issue_class_neq: Annotated[List[str], PropertyInfo(alias="issue_class~neq")] - - issue_type: List[ - Literal[ - "compliance_violation", - "email_security", - "exposed_infrastructure", - "insecure_configuration", - "weak_authentication", - ] - ] - - issue_type_neq: Annotated[ - List[ - Literal[ - "compliance_violation", - "email_security", - "exposed_infrastructure", - "insecure_configuration", - "weak_authentication", - ] - ], - PropertyInfo(alias="issue_type~neq"), - ] + issue_class: List[IssueClass] + + issue_class_neq: Annotated[List[IssueClass], PropertyInfo(alias="issue_class~neq")] + + issue_type: List[IssueType] + + issue_type_neq: Annotated[List[IssueType], PropertyInfo(alias="issue_type~neq")] page: int """Current page within paginated list of results""" @@ -49,14 +35,14 @@ class IssueListParams(TypedDict, total=False): per_page: int """Number of results per page of results""" - product: List[str] + product: List[Product] - product_neq: Annotated[List[str], PropertyInfo(alias="product~neq")] + product_neq: Annotated[List[Product], PropertyInfo(alias="product~neq")] - severity: List[Literal["low", "moderate", "critical"]] + severity: List[SeverityQueryParam] - severity_neq: Annotated[List[Literal["low", "moderate", "critical"]], PropertyInfo(alias="severity~neq")] + severity_neq: Annotated[List[SeverityQueryParam], PropertyInfo(alias="severity~neq")] - subject: List[str] + subject: List[Subject] - subject_neq: Annotated[List[str], PropertyInfo(alias="subject~neq")] + subject_neq: Annotated[List[Subject], PropertyInfo(alias="subject~neq")] diff --git a/src/cloudflare/types/intel/attack_surface_report/issue_severity_params.py b/src/cloudflare/types/intel/attack_surface_report/issue_severity_params.py index db21c03c8af..3d007ae8548 100644 --- a/src/cloudflare/types/intel/attack_surface_report/issue_severity_params.py +++ b/src/cloudflare/types/intel/attack_surface_report/issue_severity_params.py @@ -3,9 +3,14 @@ from __future__ import annotations from typing import List -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict +from .product import Product +from .subject import Subject from ...._utils import PropertyInfo +from .issue_type import IssueType +from .issue_class import IssueClass +from .severity_query_param import SeverityQueryParam __all__ = ["IssueSeverityParams"] @@ -16,41 +21,22 @@ class IssueSeverityParams(TypedDict, total=False): dismissed: bool - issue_class: List[str] + issue_class: List[IssueClass] - issue_class_neq: Annotated[List[str], PropertyInfo(alias="issue_class~neq")] + issue_class_neq: Annotated[List[IssueClass], PropertyInfo(alias="issue_class~neq")] - issue_type: List[ - Literal[ - "compliance_violation", - "email_security", - "exposed_infrastructure", - "insecure_configuration", - "weak_authentication", - ] - ] + issue_type: List[IssueType] - issue_type_neq: Annotated[ - List[ - Literal[ - "compliance_violation", - "email_security", - "exposed_infrastructure", - "insecure_configuration", - "weak_authentication", - ] - ], - PropertyInfo(alias="issue_type~neq"), - ] + issue_type_neq: Annotated[List[IssueType], PropertyInfo(alias="issue_type~neq")] - product: List[str] + product: List[Product] - product_neq: Annotated[List[str], PropertyInfo(alias="product~neq")] + product_neq: Annotated[List[Product], PropertyInfo(alias="product~neq")] - severity: List[Literal["low", "moderate", "critical"]] + severity: List[SeverityQueryParam] - severity_neq: Annotated[List[Literal["low", "moderate", "critical"]], PropertyInfo(alias="severity~neq")] + severity_neq: Annotated[List[SeverityQueryParam], PropertyInfo(alias="severity~neq")] - subject: List[str] + subject: List[Subject] - subject_neq: Annotated[List[str], PropertyInfo(alias="subject~neq")] + subject_neq: Annotated[List[Subject], PropertyInfo(alias="subject~neq")] diff --git a/src/cloudflare/types/intel/attack_surface_report/issue_type.py b/src/cloudflare/types/intel/attack_surface_report/issue_type.py new file mode 100644 index 00000000000..72d55104624 --- /dev/null +++ b/src/cloudflare/types/intel/attack_surface_report/issue_type.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +__all__ = ["IssueType"] + +IssueType = Literal[ + "compliance_violation", "email_security", "exposed_infrastructure", "insecure_configuration", "weak_authentication" +] diff --git a/src/cloudflare/types/intel/attack_surface_report/issue_type_params.py b/src/cloudflare/types/intel/attack_surface_report/issue_type_params.py index 93c67ac4fc7..eba61869bb0 100644 --- a/src/cloudflare/types/intel/attack_surface_report/issue_type_params.py +++ b/src/cloudflare/types/intel/attack_surface_report/issue_type_params.py @@ -3,9 +3,14 @@ from __future__ import annotations from typing import List -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict +from .product import Product +from .subject import Subject from ...._utils import PropertyInfo +from .issue_type import IssueType +from .issue_class import IssueClass +from .severity_query_param import SeverityQueryParam __all__ = ["IssueTypeParams"] @@ -16,41 +21,22 @@ class IssueTypeParams(TypedDict, total=False): dismissed: bool - issue_class: List[str] + issue_class: List[IssueClass] - issue_class_neq: Annotated[List[str], PropertyInfo(alias="issue_class~neq")] + issue_class_neq: Annotated[List[IssueClass], PropertyInfo(alias="issue_class~neq")] - issue_type: List[ - Literal[ - "compliance_violation", - "email_security", - "exposed_infrastructure", - "insecure_configuration", - "weak_authentication", - ] - ] + issue_type: List[IssueType] - issue_type_neq: Annotated[ - List[ - Literal[ - "compliance_violation", - "email_security", - "exposed_infrastructure", - "insecure_configuration", - "weak_authentication", - ] - ], - PropertyInfo(alias="issue_type~neq"), - ] + issue_type_neq: Annotated[List[IssueType], PropertyInfo(alias="issue_type~neq")] - product: List[str] + product: List[Product] - product_neq: Annotated[List[str], PropertyInfo(alias="product~neq")] + product_neq: Annotated[List[Product], PropertyInfo(alias="product~neq")] - severity: List[Literal["low", "moderate", "critical"]] + severity: List[SeverityQueryParam] - severity_neq: Annotated[List[Literal["low", "moderate", "critical"]], PropertyInfo(alias="severity~neq")] + severity_neq: Annotated[List[SeverityQueryParam], PropertyInfo(alias="severity~neq")] - subject: List[str] + subject: List[Subject] - subject_neq: Annotated[List[str], PropertyInfo(alias="subject~neq")] + subject_neq: Annotated[List[Subject], PropertyInfo(alias="subject~neq")] diff --git a/src/cloudflare/types/intel/attack_surface_report/product.py b/src/cloudflare/types/intel/attack_surface_report/product.py new file mode 100644 index 00000000000..ba20d559294 --- /dev/null +++ b/src/cloudflare/types/intel/attack_surface_report/product.py @@ -0,0 +1,6 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +__all__ = ["Product"] + +Product = str diff --git a/src/cloudflare/types/methods_item.py b/src/cloudflare/types/intel/attack_surface_report/severity_query_param.py similarity index 54% rename from src/cloudflare/types/methods_item.py rename to src/cloudflare/types/intel/attack_surface_report/severity_query_param.py index 95a428b9935..cd208c07b4b 100644 --- a/src/cloudflare/types/methods_item.py +++ b/src/cloudflare/types/intel/attack_surface_report/severity_query_param.py @@ -2,6 +2,6 @@ from typing_extensions import Literal -__all__ = ["MethodsItem"] +__all__ = ["SeverityQueryParam"] -MethodsItem = Literal["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "_ALL_"] +SeverityQueryParam = Literal["low", "moderate", "critical"] diff --git a/src/cloudflare/types/intel/attack_surface_report/subject.py b/src/cloudflare/types/intel/attack_surface_report/subject.py new file mode 100644 index 00000000000..c19ba96927e --- /dev/null +++ b/src/cloudflare/types/intel/attack_surface_report/subject.py @@ -0,0 +1,6 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +__all__ = ["Subject"] + +Subject = str diff --git a/src/cloudflare/types/intel/intel_passive_dns_by_ip.py b/src/cloudflare/types/intel/dns.py similarity index 90% rename from src/cloudflare/types/intel/intel_passive_dns_by_ip.py rename to src/cloudflare/types/intel/dns.py index 7079757a074..ee5e780fe49 100644 --- a/src/cloudflare/types/intel/intel_passive_dns_by_ip.py +++ b/src/cloudflare/types/intel/dns.py @@ -5,10 +5,10 @@ from ..._models import BaseModel from .unnamed_schema_ref_b5e16cee4f32382c294201aedb9fc050 import UnnamedSchemaRefB5e16cee4f32382c294201aedb9fc050 -__all__ = ["IntelPassiveDNSByIP"] +__all__ = ["DNS"] -class IntelPassiveDNSByIP(BaseModel): +class DNS(BaseModel): count: Optional[float] = None """Total results returned based on your search parameters.""" diff --git a/src/cloudflare/types/intel/dns_param.py b/src/cloudflare/types/intel/dns_param.py new file mode 100644 index 00000000000..d7b876e03c3 --- /dev/null +++ b/src/cloudflare/types/intel/dns_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import TypedDict + +from .unnamed_schema_ref_b5e16cee4f32382c294201aedb9fc050 import UnnamedSchemaRefB5e16cee4f32382c294201aedb9fc050 + +__all__ = ["DNSParam"] + + +class DNSParam(TypedDict, total=False): + count: float + """Total results returned based on your search parameters.""" + + page: float + """Current page within paginated list of results.""" + + per_page: float + """Number of results per page of results.""" + + reverse_records: Iterable[UnnamedSchemaRefB5e16cee4f32382c294201aedb9fc050] + """Reverse DNS look-ups observed during the time period.""" diff --git a/src/cloudflare/types/intel/intel_domain.py b/src/cloudflare/types/intel/domain.py similarity index 97% rename from src/cloudflare/types/intel/intel_domain.py rename to src/cloudflare/types/intel/domain.py index ab9536fd001..843c1adf8f9 100644 --- a/src/cloudflare/types/intel/intel_domain.py +++ b/src/cloudflare/types/intel/domain.py @@ -5,7 +5,7 @@ from ..._models import BaseModel __all__ = [ - "IntelDomain", + "Domain", "AdditionalInformation", "Application", "InheritedContentCategory", @@ -52,7 +52,7 @@ class ResolvesToRef(BaseModel): """IP address or domain name.""" -class IntelDomain(BaseModel): +class Domain(BaseModel): additional_information: Optional[AdditionalInformation] = None """Additional information related to the host name.""" diff --git a/src/cloudflare/types/intel/intel_domain_history.py b/src/cloudflare/types/intel/domain_history.py similarity index 82% rename from src/cloudflare/types/intel/intel_domain_history.py rename to src/cloudflare/types/intel/domain_history.py index abba234fee9..a490b4770ff 100644 --- a/src/cloudflare/types/intel/intel_domain_history.py +++ b/src/cloudflare/types/intel/domain_history.py @@ -5,7 +5,7 @@ from ..._models import BaseModel -__all__ = ["IntelDomainHistory", "Categorization"] +__all__ = ["DomainHistory", "Categorization"] class Categorization(BaseModel): @@ -16,7 +16,7 @@ class Categorization(BaseModel): start: Optional[date] = None -class IntelDomainHistory(BaseModel): +class DomainHistory(BaseModel): categorizations: Optional[List[Categorization]] = None domain: Optional[str] = None diff --git a/src/cloudflare/types/intel/domain_history_get_response.py b/src/cloudflare/types/intel/domain_history_get_response.py index 6e2c2c8e216..e3b3c3bd1b3 100644 --- a/src/cloudflare/types/intel/domain_history_get_response.py +++ b/src/cloudflare/types/intel/domain_history_get_response.py @@ -2,8 +2,8 @@ from typing import List -from .intel_domain_history import IntelDomainHistory +from .domain_history import DomainHistory __all__ = ["DomainHistoryGetResponse"] -DomainHistoryGetResponse = List[IntelDomainHistory] +DomainHistoryGetResponse = List[DomainHistory] diff --git a/src/cloudflare/types/intel/intel_schemas_ip.py b/src/cloudflare/types/intel/ip.py similarity index 90% rename from src/cloudflare/types/intel/intel_schemas_ip.py rename to src/cloudflare/types/intel/ip.py index 188cb5e7d4a..ae1ebd501ab 100644 --- a/src/cloudflare/types/intel/intel_schemas_ip.py +++ b/src/cloudflare/types/intel/ip.py @@ -5,7 +5,7 @@ from ..._models import BaseModel -__all__ = ["IntelSchemasIP", "BelongsToRef"] +__all__ = ["IP", "BelongsToRef"] class BelongsToRef(BaseModel): @@ -21,7 +21,7 @@ class BelongsToRef(BaseModel): value: Optional[str] = None -class IntelSchemasIP(BaseModel): +class IP(BaseModel): belongs_to_ref: Optional[BelongsToRef] = None """ Specifies a reference to the autonomous systems (AS) that the IP address belongs diff --git a/src/cloudflare/types/intel/ip_get_response.py b/src/cloudflare/types/intel/ip_get_response.py index 0eef2333efe..74a42e28125 100644 --- a/src/cloudflare/types/intel/ip_get_response.py +++ b/src/cloudflare/types/intel/ip_get_response.py @@ -2,8 +2,8 @@ from typing import List -from .intel_schemas_ip import IntelSchemasIP +from .ip import IP __all__ = ["IPGetResponse"] -IPGetResponse = List[IntelSchemasIP] +IPGetResponse = List[IP] diff --git a/src/cloudflare/types/intel/intel_ip_list.py b/src/cloudflare/types/intel/ip_list.py similarity index 81% rename from src/cloudflare/types/intel/intel_ip_list.py rename to src/cloudflare/types/intel/ip_list.py index f8c905d374f..2eccd1107b0 100644 --- a/src/cloudflare/types/intel/intel_ip_list.py +++ b/src/cloudflare/types/intel/ip_list.py @@ -4,10 +4,10 @@ from ..._models import BaseModel -__all__ = ["IntelIPList"] +__all__ = ["IPList"] -class IntelIPList(BaseModel): +class IPList(BaseModel): id: Optional[int] = None description: Optional[str] = None diff --git a/src/cloudflare/types/intel/ip_list_get_response.py b/src/cloudflare/types/intel/ip_list_get_response.py index 415cb89e45d..f87a5210833 100644 --- a/src/cloudflare/types/intel/ip_list_get_response.py +++ b/src/cloudflare/types/intel/ip_list_get_response.py @@ -2,8 +2,8 @@ from typing import List -from .intel_ip_list import IntelIPList +from .ip_list import IPList __all__ = ["IPListGetResponse"] -IPListGetResponse = List[IntelIPList] +IPListGetResponse = List[IPList] diff --git a/src/cloudflare/types/intel/intel_sinkhole_item.py b/src/cloudflare/types/intel/sinkhole_item.py similarity index 92% rename from src/cloudflare/types/intel/intel_sinkhole_item.py rename to src/cloudflare/types/intel/sinkhole_item.py index 98ddc704596..94eccecb8ff 100644 --- a/src/cloudflare/types/intel/intel_sinkhole_item.py +++ b/src/cloudflare/types/intel/sinkhole_item.py @@ -5,10 +5,10 @@ from ..._models import BaseModel -__all__ = ["IntelSinkholeItem"] +__all__ = ["SinkholeItem"] -class IntelSinkholeItem(BaseModel): +class SinkholeItem(BaseModel): id: Optional[int] = None """The unique identifier for the sinkhole""" diff --git a/src/cloudflare/types/intel/intel_whois.py b/src/cloudflare/types/intel/whois.py similarity index 91% rename from src/cloudflare/types/intel/intel_whois.py rename to src/cloudflare/types/intel/whois.py index 6348407623d..f852e72a745 100644 --- a/src/cloudflare/types/intel/intel_whois.py +++ b/src/cloudflare/types/intel/whois.py @@ -5,10 +5,10 @@ from ..._models import BaseModel -__all__ = ["IntelWhois"] +__all__ = ["Whois"] -class IntelWhois(BaseModel): +class Whois(BaseModel): created_date: Optional[date] = None domain: Optional[str] = None diff --git a/src/cloudflare/types/keyless_certificate.py b/src/cloudflare/types/keyless_certificate.py new file mode 100644 index 00000000000..4f29750056d --- /dev/null +++ b/src/cloudflare/types/keyless_certificate.py @@ -0,0 +1,48 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime +from typing_extensions import Literal + +from .tunnel import Tunnel +from .._models import BaseModel + +__all__ = ["KeylessCertificate"] + + +class KeylessCertificate(BaseModel): + id: str + """Keyless certificate identifier tag.""" + + created_on: datetime + """When the Keyless SSL was created.""" + + enabled: bool + """Whether or not the Keyless SSL is on or off.""" + + host: str + """The keyless SSL name.""" + + modified_on: datetime + """When the Keyless SSL was last modified.""" + + name: str + """The keyless SSL name.""" + + permissions: List[object] + """ + Available permissions for the Keyless SSL for the current user requesting the + item. + """ + + port: float + """ + The keyless SSL port used to communicate between Cloudflare and the client's + Keyless SSL server. + """ + + status: Literal["active", "deleted"] + """Status of the Keyless SSL.""" + + tunnel: Optional[Tunnel] = None + """Configuration for using Keyless SSL through a Cloudflare Tunnel""" diff --git a/src/cloudflare/types/kv/__init__.py b/src/cloudflare/types/kv/__init__.py index 9d607e5f2ec..0bcbeb679d0 100644 --- a/src/cloudflare/types/kv/__init__.py +++ b/src/cloudflare/types/kv/__init__.py @@ -2,7 +2,7 @@ from __future__ import annotations -from .workers_kv_namespace import WorkersKVNamespace as WorkersKVNamespace +from .namespace import Namespace as Namespace from .namespace_list_params import NamespaceListParams as NamespaceListParams from .namespace_create_params import NamespaceCreateParams as NamespaceCreateParams from .namespace_delete_params import NamespaceDeleteParams as NamespaceDeleteParams diff --git a/src/cloudflare/types/kv/workers_kv_namespace.py b/src/cloudflare/types/kv/namespace.py similarity index 87% rename from src/cloudflare/types/kv/workers_kv_namespace.py rename to src/cloudflare/types/kv/namespace.py index 1b98e28f558..cac0817cd75 100644 --- a/src/cloudflare/types/kv/workers_kv_namespace.py +++ b/src/cloudflare/types/kv/namespace.py @@ -4,10 +4,10 @@ from ..._models import BaseModel -__all__ = ["WorkersKVNamespace"] +__all__ = ["Namespace"] -class WorkersKVNamespace(BaseModel): +class Namespace(BaseModel): id: str """Namespace identifier tag.""" diff --git a/src/cloudflare/types/kv/namespaces/__init__.py b/src/cloudflare/types/kv/namespaces/__init__.py index 0af88dac553..c7e0d3b76ae 100644 --- a/src/cloudflare/types/kv/namespaces/__init__.py +++ b/src/cloudflare/types/kv/namespaces/__init__.py @@ -2,7 +2,7 @@ from __future__ import annotations -from .workers_kv_key import WorkersKVKey as WorkersKVKey +from .key import Key as Key from .key_list_params import KeyListParams as KeyListParams from .bulk_delete_params import BulkDeleteParams as BulkDeleteParams from .bulk_update_params import BulkUpdateParams as BulkUpdateParams diff --git a/src/cloudflare/types/kv/namespaces/workers_kv_key.py b/src/cloudflare/types/kv/namespaces/key.py similarity index 91% rename from src/cloudflare/types/kv/namespaces/workers_kv_key.py rename to src/cloudflare/types/kv/namespaces/key.py index ff696e08b12..604b5d06192 100644 --- a/src/cloudflare/types/kv/namespaces/workers_kv_key.py +++ b/src/cloudflare/types/kv/namespaces/key.py @@ -4,10 +4,10 @@ from ...._models import BaseModel -__all__ = ["WorkersKVKey"] +__all__ = ["Key"] -class WorkersKVKey(BaseModel): +class Key(BaseModel): name: str """A key's name. diff --git a/src/cloudflare/types/load_balancer.py b/src/cloudflare/types/load_balancer.py index 777a4493cf9..e91d343495b 100644 --- a/src/cloudflare/types/load_balancer.py +++ b/src/cloudflare/types/load_balancer.py @@ -5,221 +5,14 @@ from typing_extensions import Literal from .._models import BaseModel +from .rules_item import RulesItem from .random_steering import RandomSteering from .adaptive_routing import AdaptiveRouting from .location_strategy import LocationStrategy +from .default_pools_item import DefaultPoolsItem from .session_affinity_attributes import SessionAffinityAttributes -__all__ = ["LoadBalancer", "Rule", "RuleFixedResponse", "RuleOverrides"] - - -class RuleFixedResponse(BaseModel): - content_type: Optional[str] = None - """The http 'Content-Type' header to include in the response.""" - - location: Optional[str] = None - """The http 'Location' header to include in the response.""" - - message_body: Optional[str] = None - """Text to include as the http body.""" - - status_code: Optional[int] = None - """The http status code to respond with.""" - - -class RuleOverrides(BaseModel): - adaptive_routing: Optional[AdaptiveRouting] = None - """ - Controls features that modify the routing of requests to pools and origins in - response to dynamic conditions, such as during the interval between active - health monitoring requests. For example, zero-downtime failover occurs - immediately when an origin becomes unavailable due to HTTP 521, 522, or 523 - response codes. If there is another healthy origin in the same pool, the request - is retried once against this alternate origin. - """ - - country_pools: Optional[object] = None - """ - A mapping of country codes to a list of pool IDs (ordered by their failover - priority) for the given country. Any country not explicitly defined will fall - back to using the corresponding region_pool mapping if it exists else to - default_pools. - """ - - default_pools: Optional[List[str]] = None - """A list of pool IDs ordered by their failover priority. - - Pools defined here are used by default, or when region_pools are not configured - for a given region. - """ - - fallback_pool: Optional[object] = None - """The pool ID to use when all other pools are detected as unhealthy.""" - - location_strategy: Optional[LocationStrategy] = None - """Controls location-based steering for non-proxied requests. - - See `steering_policy` to learn how steering is affected. - """ - - pop_pools: Optional[object] = None - """ - (Enterprise only): A mapping of Cloudflare PoP identifiers to a list of pool IDs - (ordered by their failover priority) for the PoP (datacenter). Any PoPs not - explicitly defined will fall back to using the corresponding country_pool, then - region_pool mapping if it exists else to default_pools. - """ - - random_steering: Optional[RandomSteering] = None - """Configures pool weights. - - - `steering_policy="random"`: A random pool is selected with probability - proportional to pool weights. - - `steering_policy="least_outstanding_requests"`: Use pool weights to scale each - pool's outstanding requests. - - `steering_policy="least_connections"`: Use pool weights to scale each pool's - open connections. - """ - - region_pools: Optional[object] = None - """ - A mapping of region codes to a list of pool IDs (ordered by their failover - priority) for the given region. Any regions not explicitly defined will fall - back to using default_pools. - """ - - session_affinity: Optional[Literal["none", "cookie", "ip_cookie", "header", '""']] = None - """ - Specifies the type of session affinity the load balancer should use unless - specified as `"none"` or "" (default). The supported types are: - - - `"cookie"`: On the first request to a proxied load balancer, a cookie is - generated, encoding information of which origin the request will be forwarded - to. Subsequent requests, by the same client to the same load balancer, will be - sent to the origin server the cookie encodes, for the duration of the cookie - and as long as the origin server remains healthy. If the cookie has expired or - the origin server is unhealthy, then a new origin server is calculated and - used. - - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin - selection is stable and based on the client's ip address. - - `"header"`: On the first request to a proxied load balancer, a session key - based on the configured HTTP headers (see - `session_affinity_attributes.headers`) is generated, encoding the request - headers used for storing in the load balancer session state which origin the - request will be forwarded to. Subsequent requests to the load balancer with - the same headers will be sent to the same origin server, for the duration of - the session and as long as the origin server remains healthy. If the session - has been idle for the duration of `session_affinity_ttl` seconds or the origin - server is unhealthy, then a new origin server is calculated and used. See - `headers` in `session_affinity_attributes` for additional required - configuration. - """ - - session_affinity_attributes: Optional[SessionAffinityAttributes] = None - """Configures attributes for session affinity.""" - - session_affinity_ttl: Optional[float] = None - """Time, in seconds, until a client's session expires after being created. - - Once the expiry time has been reached, subsequent requests may get sent to a - different origin server. The accepted ranges per `session_affinity` policy are: - - - `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used - unless explicitly set. The accepted range of values is between [1800, 604800]. - - `"header"`: The current default of 1800 seconds will be used unless explicitly - set. The accepted range of values is between [30, 3600]. Note: With session - affinity by header, sessions only expire after they haven't been used for the - number of seconds specified. - """ - - steering_policy: Optional[ - Literal[ - "off", - "geo", - "random", - "dynamic_latency", - "proximity", - "least_outstanding_requests", - "least_connections", - '""', - ] - ] = None - """Steering Policy for this load balancer. - - - `"off"`: Use `default_pools`. - - `"geo"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied - requests, the country for `country_pools` is determined by - `location_strategy`. - - `"random"`: Select a pool randomly. - - `"dynamic_latency"`: Use round trip time to select the closest pool in - default_pools (requires pool health checks). - - `"proximity"`: Use the pools' latitude and longitude to select the closest - pool using the Cloudflare PoP location for proxied requests or the location - determined by `location_strategy` for non-proxied requests. - - `"least_outstanding_requests"`: Select a pool by taking into consideration - `random_steering` weights, as well as each pool's number of outstanding - requests. Pools with more pending requests are weighted proportionately less - relative to others. - - `"least_connections"`: Select a pool by taking into consideration - `random_steering` weights, as well as each pool's number of open connections. - Pools with more open connections are weighted proportionately less relative to - others. Supported for HTTP/1 and HTTP/2 connections. - - `""`: Will map to `"geo"` if you use - `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`. - """ - - ttl: Optional[float] = None - """ - Time to live (TTL) of the DNS entry for the IP address returned by this load - balancer. This only applies to gray-clouded (unproxied) load balancers. - """ - - -class Rule(BaseModel): - condition: Optional[str] = None - """The condition expressions to evaluate. - - If the condition evaluates to true, the overrides or fixed_response in this rule - will be applied. An empty condition is always true. For more details on - condition expressions, please see - https://developers.cloudflare.com/load-balancing/understand-basics/load-balancing-rules/expressions. - """ - - disabled: Optional[bool] = None - """Disable this specific rule. - - It will no longer be evaluated by this load balancer. - """ - - fixed_response: Optional[RuleFixedResponse] = None - """ - A collection of fields used to directly respond to the eyeball instead of - routing to a pool. If a fixed_response is supplied the rule will be marked as - terminates. - """ - - name: Optional[str] = None - """Name of this rule. Only used for human readability.""" - - overrides: Optional[RuleOverrides] = None - """ - A collection of overrides to apply to the load balancer when this rule's - condition is true. All fields are optional. - """ - - priority: Optional[int] = None - """The order in which rules should be executed in relation to each other. - - Lower values are executed first. Values do not need to be sequential. If no - value is provided for any rule the array order of the rules field will be used - to assign a priority. - """ - - terminates: Optional[bool] = None - """ - If this rule's condition is true, this causes rule evaluation to stop after - processing this rule. - """ +__all__ = ["LoadBalancer"] class LoadBalancer(BaseModel): @@ -245,7 +38,7 @@ class LoadBalancer(BaseModel): created_on: Optional[datetime] = None - default_pools: Optional[List[str]] = None + default_pools: Optional[List[DefaultPoolsItem]] = None """A list of pool IDs ordered by their failover priority. Pools defined here are used by default, or when region_pools are not configured @@ -305,7 +98,7 @@ class LoadBalancer(BaseModel): back to using default_pools. """ - rules: Optional[List[Rule]] = None + rules: Optional[List[RulesItem]] = None """ BETA Field Not General Access: A list of rules for this load balancer to execute. diff --git a/src/cloudflare/types/load_balancers/pool_create_params.py b/src/cloudflare/types/load_balancers/pool_create_params.py index 845e853eb58..6b0270d5ca9 100644 --- a/src/cloudflare/types/load_balancers/pool_create_params.py +++ b/src/cloudflare/types/load_balancers/pool_create_params.py @@ -5,7 +5,7 @@ from typing import Iterable, Optional from typing_extensions import Required, TypedDict -from ..origin_item_param import OriginItemParam +from ..origin_param import OriginParam from ..load_shedding_param import LoadSheddingParam from ..origin_steering_param import OriginSteeringParam from ..notification_filter_param import NotificationFilterParam @@ -23,7 +23,7 @@ class PoolCreateParams(TypedDict, total=False): Only alphanumeric characters, hyphens, and underscores are allowed. """ - origins: Required[Iterable[OriginItemParam]] + origins: Required[Iterable[OriginParam]] """The list of origins within this pool. Traffic directed at this pool is balanced across all currently healthy origins, diff --git a/src/cloudflare/types/load_balancers/pool_edit_params.py b/src/cloudflare/types/load_balancers/pool_edit_params.py index 6aa91f2955b..bddc6c9b3e7 100644 --- a/src/cloudflare/types/load_balancers/pool_edit_params.py +++ b/src/cloudflare/types/load_balancers/pool_edit_params.py @@ -5,8 +5,8 @@ from typing import List, Iterable, Optional from typing_extensions import Required, TypedDict -from .check_region import CheckRegion -from ..origin_item_param import OriginItemParam +from ..check_region import CheckRegion +from ..origin_param import OriginParam from ..load_shedding_param import LoadSheddingParam from ..origin_steering_param import OriginSteeringParam from ..notification_filter_param import NotificationFilterParam @@ -91,7 +91,7 @@ class PoolEditParams(TypedDict, total=False): affinity. """ - origins: Iterable[OriginItemParam] + origins: Iterable[OriginParam] """The list of origins within this pool. Traffic directed at this pool is balanced across all currently healthy origins, diff --git a/src/cloudflare/types/load_balancers/pool_update_params.py b/src/cloudflare/types/load_balancers/pool_update_params.py index d03d8aa4615..9d9e88531a0 100644 --- a/src/cloudflare/types/load_balancers/pool_update_params.py +++ b/src/cloudflare/types/load_balancers/pool_update_params.py @@ -5,8 +5,8 @@ from typing import List, Iterable, Optional from typing_extensions import Required, TypedDict -from .check_region import CheckRegion -from ..origin_item_param import OriginItemParam +from ..check_region import CheckRegion +from ..origin_param import OriginParam from ..load_shedding_param import LoadSheddingParam from ..origin_steering_param import OriginSteeringParam from ..notification_filter_param import NotificationFilterParam @@ -24,7 +24,7 @@ class PoolUpdateParams(TypedDict, total=False): Only alphanumeric characters, hyphens, and underscores are allowed. """ - origins: Required[Iterable[OriginItemParam]] + origins: Required[Iterable[OriginParam]] """The list of origins within this pool. Traffic directed at this pool is balanced across all currently healthy origins, diff --git a/src/cloudflare/types/magic_network_monitoring/__init__.py b/src/cloudflare/types/magic_network_monitoring/__init__.py index 7bbc46e326e..8af07e130f3 100644 --- a/src/cloudflare/types/magic_network_monitoring/__init__.py +++ b/src/cloudflare/types/magic_network_monitoring/__init__.py @@ -4,12 +4,13 @@ from .rule import Rule as Rule from .rule_param import RuleParam as RuleParam +from .configuration import Configuration as Configuration from .rule_edit_params import RuleEditParams as RuleEditParams from .config_edit_params import ConfigEditParams as ConfigEditParams from .rule_create_params import RuleCreateParams as RuleCreateParams from .rule_delete_params import RuleDeleteParams as RuleDeleteParams from .rule_update_params import RuleUpdateParams as RuleUpdateParams +from .configuration_param import ConfigurationParam as ConfigurationParam from .config_create_params import ConfigCreateParams as ConfigCreateParams from .config_delete_params import ConfigDeleteParams as ConfigDeleteParams from .config_update_params import ConfigUpdateParams as ConfigUpdateParams -from .magic_network_monitoring_config import MagicNetworkMonitoringConfig as MagicNetworkMonitoringConfig diff --git a/src/cloudflare/types/magic_network_monitoring/magic_network_monitoring_config.py b/src/cloudflare/types/magic_network_monitoring/configuration.py similarity index 81% rename from src/cloudflare/types/magic_network_monitoring/magic_network_monitoring_config.py rename to src/cloudflare/types/magic_network_monitoring/configuration.py index a4ca28cadd3..46f5e0a2d83 100644 --- a/src/cloudflare/types/magic_network_monitoring/magic_network_monitoring_config.py +++ b/src/cloudflare/types/magic_network_monitoring/configuration.py @@ -4,10 +4,10 @@ from ..._models import BaseModel -__all__ = ["MagicNetworkMonitoringConfig"] +__all__ = ["Configuration"] -class MagicNetworkMonitoringConfig(BaseModel): +class Configuration(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/configuration_param.py b/src/cloudflare/types/magic_network_monitoring/configuration_param.py new file mode 100644 index 00000000000..d44a0fc3d86 --- /dev/null +++ b/src/cloudflare/types/magic_network_monitoring/configuration_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List +from typing_extensions import Required, TypedDict + +__all__ = ["ConfigurationParam"] + + +class ConfigurationParam(TypedDict, total=False): + default_sampling: Required[float] + """Fallback sampling rate of flow messages being sent in packets per second. + + This should match the packet sampling rate configured on the router. + """ + + name: Required[str] + """The account name.""" + + router_ips: Required[List[str]] diff --git a/src/cloudflare/types/magic_network_monitoring/rules/__init__.py b/src/cloudflare/types/magic_network_monitoring/rules/__init__.py index 2f0e64c69fe..776662f22d8 100644 --- a/src/cloudflare/types/magic_network_monitoring/rules/__init__.py +++ b/src/cloudflare/types/magic_network_monitoring/rules/__init__.py @@ -2,7 +2,5 @@ from __future__ import annotations +from .advertisement import Advertisement as Advertisement from .advertisement_edit_params import AdvertisementEditParams as AdvertisementEditParams -from .magic_network_monitoring_rule_advertisable import ( - MagicNetworkMonitoringRuleAdvertisable as MagicNetworkMonitoringRuleAdvertisable, -) diff --git a/src/cloudflare/types/magic_network_monitoring/rules/magic_network_monitoring_rule_advertisable.py b/src/cloudflare/types/magic_network_monitoring/rules/advertisement.py similarity index 79% rename from src/cloudflare/types/magic_network_monitoring/rules/magic_network_monitoring_rule_advertisable.py rename to src/cloudflare/types/magic_network_monitoring/rules/advertisement.py index c672e0dbe6d..145c988ae89 100644 --- a/src/cloudflare/types/magic_network_monitoring/rules/magic_network_monitoring_rule_advertisable.py +++ b/src/cloudflare/types/magic_network_monitoring/rules/advertisement.py @@ -4,10 +4,10 @@ from ...._models import BaseModel -__all__ = ["MagicNetworkMonitoringRuleAdvertisable"] +__all__ = ["Advertisement"] -class MagicNetworkMonitoringRuleAdvertisable(BaseModel): +class Advertisement(BaseModel): automatic_advertisement: Optional[bool] = None """ Toggle on if you would like Cloudflare to automatically advertise the IP diff --git a/src/cloudflare/types/magic_transit/__init__.py b/src/cloudflare/types/magic_transit/__init__.py index 90983657a6f..85cd0161678 100644 --- a/src/cloudflare/types/magic_transit/__init__.py +++ b/src/cloudflare/types/magic_transit/__init__.py @@ -4,12 +4,12 @@ from .site import Site as Site from .scope import Scope as Scope +from .colo_name import ColoName as ColoName +from .colo_region import ColoRegion as ColoRegion from .scope_param import ScopeParam as ScopeParam from .psk_metadata import PSKMetadata as PSKMetadata from .site_location import SiteLocation as SiteLocation -from .colo_names_item import ColoNamesItem as ColoNamesItem from .site_list_params import SiteListParams as SiteListParams -from .colo_regions_item import ColoRegionsItem as ColoRegionsItem from .site_get_response import SiteGetResponse as SiteGetResponse from .route_empty_params import RouteEmptyParams as RouteEmptyParams from .route_get_response import RouteGetResponse as RouteGetResponse diff --git a/src/cloudflare/types/magic_transit/colo_name.py b/src/cloudflare/types/magic_transit/colo_name.py new file mode 100644 index 00000000000..b4bd707a7aa --- /dev/null +++ b/src/cloudflare/types/magic_transit/colo_name.py @@ -0,0 +1,6 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +__all__ = ["ColoName"] + +ColoName = str diff --git a/src/cloudflare/types/magic_transit/colo_region.py b/src/cloudflare/types/magic_transit/colo_region.py new file mode 100644 index 00000000000..fdc27731a22 --- /dev/null +++ b/src/cloudflare/types/magic_transit/colo_region.py @@ -0,0 +1,6 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +__all__ = ["ColoRegion"] + +ColoRegion = str diff --git a/src/cloudflare/types/magic_transit/scope.py b/src/cloudflare/types/magic_transit/scope.py index 69284135b60..13359e19bdd 100644 --- a/src/cloudflare/types/magic_transit/scope.py +++ b/src/cloudflare/types/magic_transit/scope.py @@ -3,15 +3,15 @@ from typing import List, Optional from ..._models import BaseModel -from .colo_names_item import ColoNamesItem -from .colo_regions_item import ColoRegionsItem +from .colo_name import ColoName +from .colo_region import ColoRegion __all__ = ["Scope"] class Scope(BaseModel): - colo_names: Optional[List[ColoNamesItem]] = None + colo_names: Optional[List[ColoName]] = None """List of colo names for the ECMP scope.""" - colo_regions: Optional[List[ColoRegionsItem]] = None + colo_regions: Optional[List[ColoRegion]] = None """List of colo regions for the ECMP scope.""" diff --git a/src/cloudflare/types/magic_transit/scope_param.py b/src/cloudflare/types/magic_transit/scope_param.py index 4f359cd969d..16d4eef753c 100644 --- a/src/cloudflare/types/magic_transit/scope_param.py +++ b/src/cloudflare/types/magic_transit/scope_param.py @@ -5,15 +5,15 @@ from typing import List from typing_extensions import TypedDict -from .colo_names_item import ColoNamesItem -from .colo_regions_item import ColoRegionsItem +from .colo_name import ColoName +from .colo_region import ColoRegion __all__ = ["ScopeParam"] class ScopeParam(TypedDict, total=False): - colo_names: List[ColoNamesItem] + colo_names: List[ColoName] """List of colo names for the ECMP scope.""" - colo_regions: List[ColoRegionsItem] + colo_regions: List[ColoRegion] """List of colo regions for the ECMP scope.""" diff --git a/src/cloudflare/types/magic_transit/sites/__init__.py b/src/cloudflare/types/magic_transit/sites/__init__.py index b6662da7fe0..d38c3edc689 100644 --- a/src/cloudflare/types/magic_transit/sites/__init__.py +++ b/src/cloudflare/types/magic_transit/sites/__init__.py @@ -26,7 +26,6 @@ from .lan_delete_params import LANDeleteParams as LANDeleteParams from .lan_list_response import LANListResponse as LANListResponse from .lan_update_params import LANUpdateParams as LANUpdateParams -from .static_addressing import StaticAddressing as StaticAddressing from .wan_create_params import WANCreateParams as WANCreateParams from .wan_delete_params import WANDeleteParams as WANDeleteParams from .wan_list_response import WANListResponse as WANListResponse @@ -41,8 +40,11 @@ from .wan_create_response import WANCreateResponse as WANCreateResponse from .wan_delete_response import WANDeleteResponse as WANDeleteResponse from .wan_update_response import WANUpdateResponse as WANUpdateResponse +from .lan_static_addressing import LANStaticAddressing as LANStaticAddressing +from .wan_static_addressing import WANStaticAddressing as WANStaticAddressing from .acl_configuration_param import ACLConfigurationParam as ACLConfigurationParam -from .static_addressing_param import StaticAddressingParam as StaticAddressingParam +from .lan_static_addressing_param import LANStaticAddressingParam as LANStaticAddressingParam +from .wan_static_addressing_param import WANStaticAddressingParam as WANStaticAddressingParam from .unnamed_schema_ref_87fa9e5fe9f6b8d607be1df57340d916 import ( UnnamedSchemaRef87fa9e5fe9f6b8d607be1df57340d916 as UnnamedSchemaRef87fa9e5fe9f6b8d607be1df57340d916, ) diff --git a/src/cloudflare/types/magic_transit/sites/lan.py b/src/cloudflare/types/magic_transit/sites/lan.py index fab939f9362..da2d71ada09 100644 --- a/src/cloudflare/types/magic_transit/sites/lan.py +++ b/src/cloudflare/types/magic_transit/sites/lan.py @@ -5,7 +5,7 @@ from .nat import Nat from ...._models import BaseModel from .routed_subnet import RoutedSubnet -from .static_addressing import StaticAddressing +from .lan_static_addressing import LANStaticAddressing __all__ = ["LAN"] @@ -31,7 +31,7 @@ class LAN(BaseModel): site_id: Optional[str] = None """Identifier""" - static_addressing: Optional[StaticAddressing] = None + static_addressing: Optional[LANStaticAddressing] = None """ If the site is not configured in high availability mode, this configuration is optional (if omitted, use DHCP). However, if in high availability mode, diff --git a/src/cloudflare/types/magic_transit/sites/lan_create_params.py b/src/cloudflare/types/magic_transit/sites/lan_create_params.py index 36e6cbb128b..0dd95aa37de 100644 --- a/src/cloudflare/types/magic_transit/sites/lan_create_params.py +++ b/src/cloudflare/types/magic_transit/sites/lan_create_params.py @@ -7,7 +7,7 @@ from .nat_param import NatParam from .routed_subnet_param import RoutedSubnetParam -from .static_addressing_param import StaticAddressingParam +from .lan_static_addressing_param import LANStaticAddressingParam __all__ = ["LANCreateParams", "LAN"] @@ -37,7 +37,7 @@ class LAN(TypedDict, total=False): routed_subnets: Iterable[RoutedSubnetParam] - static_addressing: StaticAddressingParam + static_addressing: LANStaticAddressingParam """ If the site is not configured in high availability mode, this configuration is optional (if omitted, use DHCP). However, if in high availability mode, diff --git a/src/cloudflare/types/magic_transit/sites/static_addressing.py b/src/cloudflare/types/magic_transit/sites/lan_static_addressing.py similarity index 89% rename from src/cloudflare/types/magic_transit/sites/static_addressing.py rename to src/cloudflare/types/magic_transit/sites/lan_static_addressing.py index 7844247f4d9..31801ab8533 100644 --- a/src/cloudflare/types/magic_transit/sites/static_addressing.py +++ b/src/cloudflare/types/magic_transit/sites/lan_static_addressing.py @@ -6,10 +6,10 @@ from .dhcp_relay import DHCPRelay from .dhcp_server import DHCPServer -__all__ = ["StaticAddressing"] +__all__ = ["LANStaticAddressing"] -class StaticAddressing(BaseModel): +class LANStaticAddressing(BaseModel): address: str """A valid CIDR notation representing an IP range.""" diff --git a/src/cloudflare/types/magic_transit/sites/static_addressing_param.py b/src/cloudflare/types/magic_transit/sites/lan_static_addressing_param.py similarity index 86% rename from src/cloudflare/types/magic_transit/sites/static_addressing_param.py rename to src/cloudflare/types/magic_transit/sites/lan_static_addressing_param.py index 05f1265253b..779724c0fcb 100644 --- a/src/cloudflare/types/magic_transit/sites/static_addressing_param.py +++ b/src/cloudflare/types/magic_transit/sites/lan_static_addressing_param.py @@ -7,10 +7,10 @@ from .dhcp_relay_param import DHCPRelayParam from .dhcp_server_param import DHCPServerParam -__all__ = ["StaticAddressingParam"] +__all__ = ["LANStaticAddressingParam"] -class StaticAddressingParam(TypedDict, total=False): +class LANStaticAddressingParam(TypedDict, total=False): address: Required[str] """A valid CIDR notation representing an IP range.""" diff --git a/src/cloudflare/types/magic_transit/sites/lan_update_params.py b/src/cloudflare/types/magic_transit/sites/lan_update_params.py index 87ec85ac085..6254d89bcc8 100644 --- a/src/cloudflare/types/magic_transit/sites/lan_update_params.py +++ b/src/cloudflare/types/magic_transit/sites/lan_update_params.py @@ -7,7 +7,7 @@ from .nat_param import NatParam from .routed_subnet_param import RoutedSubnetParam -from .static_addressing_param import StaticAddressingParam +from .lan_static_addressing_param import LANStaticAddressingParam __all__ = ["LANUpdateParams", "LAN"] @@ -31,7 +31,7 @@ class LAN(TypedDict, total=False): routed_subnets: Iterable[RoutedSubnetParam] - static_addressing: StaticAddressingParam + static_addressing: LANStaticAddressingParam """ If the site is not configured in high availability mode, this configuration is optional (if omitted, use DHCP). However, if in high availability mode, diff --git a/src/cloudflare/types/magic_transit/sites/wan.py b/src/cloudflare/types/magic_transit/sites/wan.py index 325f0783ea4..bf4969efd20 100644 --- a/src/cloudflare/types/magic_transit/sites/wan.py +++ b/src/cloudflare/types/magic_transit/sites/wan.py @@ -3,7 +3,7 @@ from typing import Optional from ...._models import BaseModel -from .static_addressing import StaticAddressing +from .wan_static_addressing import WANStaticAddressing __all__ = ["WAN"] @@ -22,7 +22,7 @@ class WAN(BaseModel): site_id: Optional[str] = None """Identifier""" - static_addressing: Optional[StaticAddressing] = None + static_addressing: Optional[WANStaticAddressing] = None """(optional) if omitted, use DHCP. Submit secondary_address when site is in high availability mode. diff --git a/src/cloudflare/types/magic_transit/sites/wan_create_params.py b/src/cloudflare/types/magic_transit/sites/wan_create_params.py index 1c0f6b095f1..a1fc6a2a4aa 100644 --- a/src/cloudflare/types/magic_transit/sites/wan_create_params.py +++ b/src/cloudflare/types/magic_transit/sites/wan_create_params.py @@ -4,7 +4,7 @@ from typing_extensions import Required, TypedDict -from .static_addressing_param import StaticAddressingParam +from .wan_static_addressing_param import WANStaticAddressingParam __all__ = ["WANCreateParams", "WAN"] @@ -26,7 +26,7 @@ class WAN(TypedDict, total=False): priority: int - static_addressing: StaticAddressingParam + static_addressing: WANStaticAddressingParam """(optional) if omitted, use DHCP. Submit secondary_address when site is in high availability mode. diff --git a/src/cloudflare/types/magic_transit/sites/wan_static_addressing.py b/src/cloudflare/types/magic_transit/sites/wan_static_addressing.py new file mode 100644 index 00000000000..ffa5b4c1235 --- /dev/null +++ b/src/cloudflare/types/magic_transit/sites/wan_static_addressing.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ...._models import BaseModel + +__all__ = ["WANStaticAddressing"] + + +class WANStaticAddressing(BaseModel): + address: str + """A valid CIDR notation representing an IP range.""" + + gateway_address: str + """A valid IPv4 address.""" + + secondary_address: Optional[str] = None + """A valid CIDR notation representing an IP range.""" diff --git a/src/cloudflare/types/magic_transit/sites/wan_static_addressing_param.py b/src/cloudflare/types/magic_transit/sites/wan_static_addressing_param.py new file mode 100644 index 00000000000..273de37cf61 --- /dev/null +++ b/src/cloudflare/types/magic_transit/sites/wan_static_addressing_param.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["WANStaticAddressingParam"] + + +class WANStaticAddressingParam(TypedDict, total=False): + address: Required[str] + """A valid CIDR notation representing an IP range.""" + + gateway_address: Required[str] + """A valid IPv4 address.""" + + secondary_address: str + """A valid CIDR notation representing an IP range.""" diff --git a/src/cloudflare/types/magic_transit/sites/wan_update_params.py b/src/cloudflare/types/magic_transit/sites/wan_update_params.py index 9599e185066..531a41472a8 100644 --- a/src/cloudflare/types/magic_transit/sites/wan_update_params.py +++ b/src/cloudflare/types/magic_transit/sites/wan_update_params.py @@ -4,7 +4,7 @@ from typing_extensions import Required, TypedDict -from .static_addressing_param import StaticAddressingParam +from .wan_static_addressing_param import WANStaticAddressingParam __all__ = ["WANUpdateParams", "WAN"] @@ -26,7 +26,7 @@ class WAN(TypedDict, total=False): priority: int - static_addressing: StaticAddressingParam + static_addressing: WANStaticAddressingParam """(optional) if omitted, use DHCP. Submit secondary_address when site is in high availability mode. diff --git a/src/cloudflare/types/managed_header_edit_params.py b/src/cloudflare/types/managed_header_edit_params.py index 1b9cd231193..a9bf71d9c3c 100644 --- a/src/cloudflare/types/managed_header_edit_params.py +++ b/src/cloudflare/types/managed_header_edit_params.py @@ -5,7 +5,7 @@ from typing import Iterable from typing_extensions import Required, TypedDict -from .request_list_item_param import RequestListItemParam +from .request_model_param import RequestModelParam __all__ = ["ManagedHeaderEditParams"] @@ -14,6 +14,6 @@ class ManagedHeaderEditParams(TypedDict, total=False): zone_id: Required[str] """Identifier""" - managed_request_headers: Required[Iterable[RequestListItemParam]] + managed_request_headers: Required[Iterable[RequestModelParam]] - managed_response_headers: Required[Iterable[RequestListItemParam]] + managed_response_headers: Required[Iterable[RequestModelParam]] diff --git a/src/cloudflare/types/managed_header_list_response.py b/src/cloudflare/types/managed_header_list_response.py index d8208593f40..ed206d7d561 100644 --- a/src/cloudflare/types/managed_header_list_response.py +++ b/src/cloudflare/types/managed_header_list_response.py @@ -3,12 +3,12 @@ from typing import List, Optional from .._models import BaseModel -from .request_list_item import RequestListItem +from .request_model import RequestModel __all__ = ["ManagedHeaderListResponse"] class ManagedHeaderListResponse(BaseModel): - managed_request_headers: Optional[List[RequestListItem]] = None + managed_request_headers: Optional[List[RequestModel]] = None - managed_response_headers: Optional[List[RequestListItem]] = None + managed_response_headers: Optional[List[RequestModel]] = None diff --git a/src/cloudflare/types/mtls_certificate_update.py b/src/cloudflare/types/mtls_certificate_create_response.py similarity index 92% rename from src/cloudflare/types/mtls_certificate_update.py rename to src/cloudflare/types/mtls_certificate_create_response.py index 47561988572..ed93644d273 100644 --- a/src/cloudflare/types/mtls_certificate_update.py +++ b/src/cloudflare/types/mtls_certificate_create_response.py @@ -5,10 +5,10 @@ from .._models import BaseModel -__all__ = ["MTLSCertificateUpdate"] +__all__ = ["MTLSCertificateCreateResponse"] -class MTLSCertificateUpdate(BaseModel): +class MTLSCertificateCreateResponse(BaseModel): id: Optional[str] = None """Identifier""" diff --git a/src/cloudflare/types/mtls_certificates/__init__.py b/src/cloudflare/types/mtls_certificates/__init__.py index 7ccb696e0db..fda57c250bd 100644 --- a/src/cloudflare/types/mtls_certificates/__init__.py +++ b/src/cloudflare/types/mtls_certificates/__init__.py @@ -3,4 +3,4 @@ from __future__ import annotations from .association_get_response import AssociationGetResponse as AssociationGetResponse -from .mtls_certificate_asssociation import MTLSCertificateAsssociation as MTLSCertificateAsssociation +from .certificate_asssociation import CertificateAsssociation as CertificateAsssociation diff --git a/src/cloudflare/types/mtls_certificates/association_get_response.py b/src/cloudflare/types/mtls_certificates/association_get_response.py index c2b31a396fe..6775dff66cb 100644 --- a/src/cloudflare/types/mtls_certificates/association_get_response.py +++ b/src/cloudflare/types/mtls_certificates/association_get_response.py @@ -2,8 +2,8 @@ from typing import List -from .mtls_certificate_asssociation import MTLSCertificateAsssociation +from .certificate_asssociation import CertificateAsssociation __all__ = ["AssociationGetResponse"] -AssociationGetResponse = List[MTLSCertificateAsssociation] +AssociationGetResponse = List[CertificateAsssociation] diff --git a/src/cloudflare/types/mtls_certificates/mtls_certificate_asssociation.py b/src/cloudflare/types/mtls_certificates/certificate_asssociation.py similarity index 78% rename from src/cloudflare/types/mtls_certificates/mtls_certificate_asssociation.py rename to src/cloudflare/types/mtls_certificates/certificate_asssociation.py index 80f6c8444a8..e3c5c30a5dc 100644 --- a/src/cloudflare/types/mtls_certificates/mtls_certificate_asssociation.py +++ b/src/cloudflare/types/mtls_certificates/certificate_asssociation.py @@ -4,10 +4,10 @@ from ..._models import BaseModel -__all__ = ["MTLSCertificateAsssociation"] +__all__ = ["CertificateAsssociation"] -class MTLSCertificateAsssociation(BaseModel): +class CertificateAsssociation(BaseModel): service: Optional[str] = None """The service using the certificate.""" diff --git a/src/cloudflare/types/origin_item.py b/src/cloudflare/types/origin_item.py deleted file mode 100644 index c93fc2ad04a..00000000000 --- a/src/cloudflare/types/origin_item.py +++ /dev/null @@ -1,59 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional -from datetime import datetime - -from .header import Header -from .._models import BaseModel - -__all__ = ["OriginItem"] - - -class OriginItem(BaseModel): - address: Optional[str] = None - """ - The IP address (IPv4 or IPv6) of the origin, or its publicly addressable - hostname. Hostnames entered here should resolve directly to the origin, and not - be a hostname proxied by Cloudflare. To set an internal/reserved address, - virtual_network_id must also be set. - """ - - disabled_at: Optional[datetime] = None - """This field shows up only if the origin is disabled. - - This field is set with the time the origin was disabled. - """ - - enabled: Optional[bool] = None - """Whether to enable (the default) this origin within the pool. - - Disabled origins will not receive traffic and are excluded from health checks. - The origin will only be disabled for the current pool. - """ - - header: Optional[Header] = None - """The request header is used to pass additional information with an HTTP request. - - Currently supported header is 'Host'. - """ - - name: Optional[str] = None - """A human-identifiable name for the origin.""" - - virtual_network_id: Optional[str] = None - """The virtual network subnet ID the origin belongs in. - - Virtual network must also belong to the account. - """ - - weight: Optional[float] = None - """The weight of this origin relative to other origins in the pool. - - Based on the configured weight the total traffic is distributed among origins - within the pool. - - - `origin_steering.policy="least_outstanding_requests"`: Use weight to scale the - origin's outstanding requests. - - `origin_steering.policy="least_connections"`: Use weight to scale the origin's - open connections. - """ diff --git a/src/cloudflare/types/origin_item_param.py b/src/cloudflare/types/origin_item_param.py deleted file mode 100644 index cda4d44dadd..00000000000 --- a/src/cloudflare/types/origin_item_param.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .header_param import HeaderParam - -__all__ = ["OriginItemParam"] - - -class OriginItemParam(TypedDict, total=False): - address: str - """ - The IP address (IPv4 or IPv6) of the origin, or its publicly addressable - hostname. Hostnames entered here should resolve directly to the origin, and not - be a hostname proxied by Cloudflare. To set an internal/reserved address, - virtual_network_id must also be set. - """ - - enabled: bool - """Whether to enable (the default) this origin within the pool. - - Disabled origins will not receive traffic and are excluded from health checks. - The origin will only be disabled for the current pool. - """ - - header: HeaderParam - """The request header is used to pass additional information with an HTTP request. - - Currently supported header is 'Host'. - """ - - name: str - """A human-identifiable name for the origin.""" - - virtual_network_id: str - """The virtual network subnet ID the origin belongs in. - - Virtual network must also belong to the account. - """ - - weight: float - """The weight of this origin relative to other origins in the pool. - - Based on the configured weight the total traffic is distributed among origins - within the pool. - - - `origin_steering.policy="least_outstanding_requests"`: Use weight to scale the - origin's outstanding requests. - - `origin_steering.policy="least_connections"`: Use weight to scale the origin's - open connections. - """ diff --git a/src/cloudflare/types/origin_tls_client_auth/__init__.py b/src/cloudflare/types/origin_tls_client_auth/__init__.py index 18468c84971..46472fc8374 100644 --- a/src/cloudflare/types/origin_tls_client_auth/__init__.py +++ b/src/cloudflare/types/origin_tls_client_auth/__init__.py @@ -2,9 +2,10 @@ from __future__ import annotations +from .id import ID as ID from .setting_get_response import SettingGetResponse as SettingGetResponse from .setting_update_params import SettingUpdateParams as SettingUpdateParams from .hostname_update_params import HostnameUpdateParams as HostnameUpdateParams from .setting_update_response import SettingUpdateResponse as SettingUpdateResponse from .hostname_update_response import HostnameUpdateResponse as HostnameUpdateResponse -from .origin_tls_client_certificate_id import OriginTLSClientCertificateID as OriginTLSClientCertificateID +from .authenticated_origin_pull import AuthenticatedOriginPull as AuthenticatedOriginPull diff --git a/src/cloudflare/types/origin_tls_client_auth/authenticated_origin_pull.py b/src/cloudflare/types/origin_tls_client_auth/authenticated_origin_pull.py new file mode 100644 index 00000000000..97dc2c8e6e8 --- /dev/null +++ b/src/cloudflare/types/origin_tls_client_auth/authenticated_origin_pull.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel + +__all__ = ["AuthenticatedOriginPull"] + + +class AuthenticatedOriginPull(BaseModel): + id: Optional[str] = None + """Identifier""" + + cert_id: Optional[str] = None + """Identifier""" + + certificate: Optional[str] = None + """The hostname certificate.""" + + enabled: Optional[bool] = None + """Indicates whether hostname-level authenticated origin pulls is enabled. + + A null value voids the association. + """ + + hostname: Optional[str] = None + """ + The hostname on the origin for which the client certificate uploaded will be + used. + """ + + private_key: Optional[str] = None + """The hostname certificate's private key.""" diff --git a/src/cloudflare/types/origin_tls_client_auth/hostname_update_response.py b/src/cloudflare/types/origin_tls_client_auth/hostname_update_response.py index f2bcb7c8e29..912106c9ff3 100644 --- a/src/cloudflare/types/origin_tls_client_auth/hostname_update_response.py +++ b/src/cloudflare/types/origin_tls_client_auth/hostname_update_response.py @@ -2,8 +2,8 @@ from typing import List -from .origin_tls_client_certificate_id import OriginTLSClientCertificateID +from .authenticated_origin_pull import AuthenticatedOriginPull __all__ = ["HostnameUpdateResponse"] -HostnameUpdateResponse = List[OriginTLSClientCertificateID] +HostnameUpdateResponse = List[AuthenticatedOriginPull] diff --git a/src/cloudflare/types/origin_tls_client_auth/hostnames/__init__.py b/src/cloudflare/types/origin_tls_client_auth/hostnames/__init__.py index 90b2e5b2d36..c10ec3bd2a1 100644 --- a/src/cloudflare/types/origin_tls_client_auth/hostnames/__init__.py +++ b/src/cloudflare/types/origin_tls_client_auth/hostnames/__init__.py @@ -2,6 +2,6 @@ from __future__ import annotations +from .certificate import Certificate as Certificate from .certificate_create_params import CertificateCreateParams as CertificateCreateParams from .certificate_delete_params import CertificateDeleteParams as CertificateDeleteParams -from .origin_tls_client_certificate import OriginTLSClientCertificate as OriginTLSClientCertificate diff --git a/src/cloudflare/types/origin_tls_client_auth/hostnames/origin_tls_client_certificate.py b/src/cloudflare/types/origin_tls_client_auth/hostnames/certificate.py similarity index 93% rename from src/cloudflare/types/origin_tls_client_auth/hostnames/origin_tls_client_certificate.py rename to src/cloudflare/types/origin_tls_client_auth/hostnames/certificate.py index da2f2cdabd2..0886c50caba 100644 --- a/src/cloudflare/types/origin_tls_client_auth/hostnames/origin_tls_client_certificate.py +++ b/src/cloudflare/types/origin_tls_client_auth/hostnames/certificate.py @@ -6,10 +6,10 @@ from ...._models import BaseModel -__all__ = ["OriginTLSClientCertificate"] +__all__ = ["Certificate"] -class OriginTLSClientCertificate(BaseModel): +class Certificate(BaseModel): id: Optional[str] = None """Identifier""" diff --git a/src/cloudflare/types/origin_tls_client_auth/origin_tls_client_certificate_id.py b/src/cloudflare/types/origin_tls_client_auth/id.py similarity index 95% rename from src/cloudflare/types/origin_tls_client_auth/origin_tls_client_certificate_id.py rename to src/cloudflare/types/origin_tls_client_auth/id.py index 192cccdcc2c..f88df713fdf 100644 --- a/src/cloudflare/types/origin_tls_client_auth/origin_tls_client_certificate_id.py +++ b/src/cloudflare/types/origin_tls_client_auth/id.py @@ -6,10 +6,10 @@ from ..._models import BaseModel -__all__ = ["OriginTLSClientCertificateID"] +__all__ = ["ID"] -class OriginTLSClientCertificateID(BaseModel): +class ID(BaseModel): cert_id: Optional[str] = None """Identifier""" diff --git a/src/cloudflare/types/page_rule.py b/src/cloudflare/types/page_rule.py index 73c52697266..2f6d75e96a0 100644 --- a/src/cloudflare/types/page_rule.py +++ b/src/cloudflare/types/page_rule.py @@ -5,8 +5,8 @@ from typing_extensions import Literal from .route import Route +from .targes import Targes from .._models import BaseModel -from .url_target import URLTarget __all__ = ["PageRule"] @@ -39,5 +39,5 @@ class PageRule(BaseModel): status: Literal["active", "disabled"] """The status of the Page Rule.""" - targets: List[URLTarget] + targets: List[Targes] """The rule targets to evaluate on each request.""" diff --git a/src/cloudflare/types/page_shield/__init__.py b/src/cloudflare/types/page_shield/__init__.py index f9203122f82..e0cb731ced5 100644 --- a/src/cloudflare/types/page_shield/__init__.py +++ b/src/cloudflare/types/page_shield/__init__.py @@ -2,11 +2,12 @@ from __future__ import annotations -from .page_shield_policy import PageShieldPolicy as PageShieldPolicy -from .page_shield_script import PageShieldScript as PageShieldScript +from .policy import Policy as Policy +from .script import Script as Script +from .connection import Connection as Connection +from .policy_param import PolicyParam as PolicyParam from .script_list_params import ScriptListParams as ScriptListParams from .script_get_response import ScriptGetResponse as ScriptGetResponse from .policy_create_params import PolicyCreateParams as PolicyCreateParams from .policy_update_params import PolicyUpdateParams as PolicyUpdateParams from .connection_list_params import ConnectionListParams as ConnectionListParams -from .page_shield_connection import PageShieldConnection as PageShieldConnection diff --git a/src/cloudflare/types/page_shield/page_shield_connection.py b/src/cloudflare/types/page_shield/connection.py similarity index 88% rename from src/cloudflare/types/page_shield/page_shield_connection.py rename to src/cloudflare/types/page_shield/connection.py index 537e4ffbeeb..e89e575b52a 100644 --- a/src/cloudflare/types/page_shield/page_shield_connection.py +++ b/src/cloudflare/types/page_shield/connection.py @@ -4,10 +4,10 @@ from ..._models import BaseModel -__all__ = ["PageShieldConnection"] +__all__ = ["Connection"] -class PageShieldConnection(BaseModel): +class Connection(BaseModel): id: Optional[str] = None added_at: Optional[str] = None diff --git a/src/cloudflare/types/page_shield/page_shield_policy.py b/src/cloudflare/types/page_shield/policy.py similarity index 92% rename from src/cloudflare/types/page_shield/page_shield_policy.py rename to src/cloudflare/types/page_shield/policy.py index fccbaf01403..3f838d934c7 100644 --- a/src/cloudflare/types/page_shield/page_shield_policy.py +++ b/src/cloudflare/types/page_shield/policy.py @@ -5,10 +5,10 @@ from ..._models import BaseModel -__all__ = ["PageShieldPolicy"] +__all__ = ["Policy"] -class PageShieldPolicy(BaseModel): +class Policy(BaseModel): id: Optional[str] = None """The ID of the policy""" diff --git a/src/cloudflare/types/page_shield/policy_param.py b/src/cloudflare/types/page_shield/policy_param.py new file mode 100644 index 00000000000..5e2c5c140ae --- /dev/null +++ b/src/cloudflare/types/page_shield/policy_param.py @@ -0,0 +1,30 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, TypedDict + +__all__ = ["PolicyParam"] + + +class PolicyParam(TypedDict, total=False): + id: str + """The ID of the policy""" + + action: Literal["allow", "log"] + """The action to take if the expression matches""" + + description: str + """A description for the policy""" + + enabled: bool + """Whether the policy is enabled""" + + expression: str + """ + The expression which must match for the policy to be applied, using the + Cloudflare Firewall rule expression syntax + """ + + value: str + """The policy which will be applied""" diff --git a/src/cloudflare/types/page_shield/page_shield_script.py b/src/cloudflare/types/page_shield/script.py similarity index 92% rename from src/cloudflare/types/page_shield/page_shield_script.py rename to src/cloudflare/types/page_shield/script.py index 57848e2af1d..60d4a295f50 100644 --- a/src/cloudflare/types/page_shield/page_shield_script.py +++ b/src/cloudflare/types/page_shield/script.py @@ -4,10 +4,10 @@ from ..._models import BaseModel -__all__ = ["PageShieldScript"] +__all__ = ["Script"] -class PageShieldScript(BaseModel): +class Script(BaseModel): id: Optional[str] = None added_at: Optional[str] = None diff --git a/src/cloudflare/types/pagerule_create_params.py b/src/cloudflare/types/pagerule_create_params.py index 3a98784ee56..c55654e839b 100644 --- a/src/cloudflare/types/pagerule_create_params.py +++ b/src/cloudflare/types/pagerule_create_params.py @@ -5,8 +5,8 @@ from typing import Iterable from typing_extensions import Literal, Required, TypedDict -from .action_item_param import ActionItemParam -from .targes_item_param import TargesItemParam +from .route_param import RouteParam +from .targes_param import TargesParam __all__ = ["PageruleCreateParams"] @@ -15,13 +15,13 @@ class PageruleCreateParams(TypedDict, total=False): zone_id: Required[str] """Identifier""" - actions: Required[Iterable[ActionItemParam]] + actions: Required[Iterable[RouteParam]] """The set of actions to perform if the targets of this rule match the request. Actions can redirect to another URL or override settings, but not both. """ - targets: Required[Iterable[TargesItemParam]] + targets: Required[Iterable[TargesParam]] """The rule targets to evaluate on each request.""" priority: int diff --git a/src/cloudflare/types/pagerule_edit_params.py b/src/cloudflare/types/pagerule_edit_params.py index ea47589eed2..5e7ad93b14c 100644 --- a/src/cloudflare/types/pagerule_edit_params.py +++ b/src/cloudflare/types/pagerule_edit_params.py @@ -5,8 +5,8 @@ from typing import Iterable from typing_extensions import Literal, Required, TypedDict -from .action_item_param import ActionItemParam -from .targes_item_param import TargesItemParam +from .route_param import RouteParam +from .targes_param import TargesParam __all__ = ["PageruleEditParams"] @@ -15,7 +15,7 @@ class PageruleEditParams(TypedDict, total=False): zone_id: Required[str] """Identifier""" - actions: Iterable[ActionItemParam] + actions: Iterable[RouteParam] """The set of actions to perform if the targets of this rule match the request. Actions can redirect to another URL or override settings, but not both. @@ -33,5 +33,5 @@ class PageruleEditParams(TypedDict, total=False): status: Literal["active", "disabled"] """The status of the Page Rule.""" - targets: Iterable[TargesItemParam] + targets: Iterable[TargesParam] """The rule targets to evaluate on each request.""" diff --git a/src/cloudflare/types/pagerule_update_params.py b/src/cloudflare/types/pagerule_update_params.py index 3c3826b8293..0a94354ed61 100644 --- a/src/cloudflare/types/pagerule_update_params.py +++ b/src/cloudflare/types/pagerule_update_params.py @@ -5,8 +5,8 @@ from typing import Iterable from typing_extensions import Literal, Required, TypedDict -from .action_item_param import ActionItemParam -from .targes_item_param import TargesItemParam +from .route_param import RouteParam +from .targes_param import TargesParam __all__ = ["PageruleUpdateParams"] @@ -15,13 +15,13 @@ class PageruleUpdateParams(TypedDict, total=False): zone_id: Required[str] """Identifier""" - actions: Required[Iterable[ActionItemParam]] + actions: Required[Iterable[RouteParam]] """The set of actions to perform if the targets of this rule match the request. Actions can redirect to another URL or override settings, but not both. """ - targets: Required[Iterable[TargesItemParam]] + targets: Required[Iterable[TargesParam]] """The rule targets to evaluate on each request.""" priority: int diff --git a/src/cloudflare/types/pagerules/__init__.py b/src/cloudflare/types/pagerules/__init__.py index b6c34e2640a..edc29b2cce6 100644 --- a/src/cloudflare/types/pagerules/__init__.py +++ b/src/cloudflare/types/pagerules/__init__.py @@ -2,4 +2,4 @@ from __future__ import annotations -from .zone_pagerule_settings import ZonePageruleSettings as ZonePageruleSettings +from .setting_list_response import SettingListResponse as SettingListResponse diff --git a/src/cloudflare/types/cloudforce_one/cloudforce_one_request_types.py b/src/cloudflare/types/pagerules/setting_list_response.py similarity index 59% rename from src/cloudflare/types/cloudforce_one/cloudforce_one_request_types.py rename to src/cloudflare/types/pagerules/setting_list_response.py index b419fd21be8..d186c559fe3 100644 --- a/src/cloudflare/types/cloudforce_one/cloudforce_one_request_types.py +++ b/src/cloudflare/types/pagerules/setting_list_response.py @@ -2,6 +2,6 @@ from typing import List -__all__ = ["CloudforceOneRequestTypes"] +__all__ = ["SettingListResponse"] -CloudforceOneRequestTypes = List[str] +SettingListResponse = List[object] diff --git a/src/cloudflare/types/pcap.py b/src/cloudflare/types/pcap.py index f2867bb3729..9ca480589fc 100644 --- a/src/cloudflare/types/pcap.py +++ b/src/cloudflare/types/pcap.py @@ -13,28 +13,6 @@ class PCAP(BaseModel): id: Optional[str] = None """The ID for the packet capture.""" - byte_limit: Optional[float] = None - """The maximum number of bytes to capture. - - This field only applies to `full` packet captures. - """ - - colo_name: Optional[str] = None - """The name of the data center used for the packet capture. - - This can be a specific colo (ord02) or a multi-colo name (ORD). This field only - applies to `full` packet captures. - """ - - destination_conf: Optional[str] = None - """The full URI for the bucket. This field only applies to `full` packet captures.""" - - error_message: Optional[str] = None - """An error message that describes why the packet capture failed. - - This field only applies to `full` packet captures. - """ - filter_v1: Optional[Filter] = None """The packet capture filter. When this field is empty, all packets are captured.""" diff --git a/src/cloudflare/types/pcap_create_response.py b/src/cloudflare/types/pcap_create_response.py index f36ae654a87..d572d6dd09f 100644 --- a/src/cloudflare/types/pcap_create_response.py +++ b/src/cloudflare/types/pcap_create_response.py @@ -7,13 +7,35 @@ from .filter import Filter from .._models import BaseModel -__all__ = ["PCAPCreateResponse", "MagicVisibilityPCAPsResponseSimple"] +__all__ = ["PCAPCreateResponse", "MagicVisibilityPCAPsResponseFull"] -class MagicVisibilityPCAPsResponseSimple(BaseModel): +class MagicVisibilityPCAPsResponseFull(BaseModel): id: Optional[str] = None """The ID for the packet capture.""" + byte_limit: Optional[float] = None + """The maximum number of bytes to capture. + + This field only applies to `full` packet captures. + """ + + colo_name: Optional[str] = None + """The name of the data center used for the packet capture. + + This can be a specific colo (ord02) or a multi-colo name (ORD). This field only + applies to `full` packet captures. + """ + + destination_conf: Optional[str] = None + """The full URI for the bucket. This field only applies to `full` packet captures.""" + + error_message: Optional[str] = None + """An error message that describes why the packet capture failed. + + This field only applies to `full` packet captures. + """ + filter_v1: Optional[Filter] = None """The packet capture filter. When this field is empty, all packets are captured.""" @@ -41,4 +63,4 @@ class MagicVisibilityPCAPsResponseSimple(BaseModel): """ -PCAPCreateResponse = Union[MagicVisibilityPCAPsResponseSimple, PCAP] +PCAPCreateResponse = Union[PCAP, MagicVisibilityPCAPsResponseFull] diff --git a/src/cloudflare/types/pcap_get_response.py b/src/cloudflare/types/pcap_get_response.py index 5ec77aa1840..0bd3141b7cf 100644 --- a/src/cloudflare/types/pcap_get_response.py +++ b/src/cloudflare/types/pcap_get_response.py @@ -7,13 +7,35 @@ from .filter import Filter from .._models import BaseModel -__all__ = ["PCAPGetResponse", "MagicVisibilityPCAPsResponseSimple"] +__all__ = ["PCAPGetResponse", "MagicVisibilityPCAPsResponseFull"] -class MagicVisibilityPCAPsResponseSimple(BaseModel): +class MagicVisibilityPCAPsResponseFull(BaseModel): id: Optional[str] = None """The ID for the packet capture.""" + byte_limit: Optional[float] = None + """The maximum number of bytes to capture. + + This field only applies to `full` packet captures. + """ + + colo_name: Optional[str] = None + """The name of the data center used for the packet capture. + + This can be a specific colo (ord02) or a multi-colo name (ORD). This field only + applies to `full` packet captures. + """ + + destination_conf: Optional[str] = None + """The full URI for the bucket. This field only applies to `full` packet captures.""" + + error_message: Optional[str] = None + """An error message that describes why the packet capture failed. + + This field only applies to `full` packet captures. + """ + filter_v1: Optional[Filter] = None """The packet capture filter. When this field is empty, all packets are captured.""" @@ -41,4 +63,4 @@ class MagicVisibilityPCAPsResponseSimple(BaseModel): """ -PCAPGetResponse = Union[MagicVisibilityPCAPsResponseSimple, PCAP] +PCAPGetResponse = Union[PCAP, MagicVisibilityPCAPsResponseFull] diff --git a/src/cloudflare/types/pcap_list_response.py b/src/cloudflare/types/pcap_list_response.py index 631aa3e47e3..6ffa39f90f9 100644 --- a/src/cloudflare/types/pcap_list_response.py +++ b/src/cloudflare/types/pcap_list_response.py @@ -7,13 +7,35 @@ from .filter import Filter from .._models import BaseModel -__all__ = ["PCAPListResponse", "MagicVisibilityPCAPsResponseSimple"] +__all__ = ["PCAPListResponse", "MagicVisibilityPCAPsResponseFull"] -class MagicVisibilityPCAPsResponseSimple(BaseModel): +class MagicVisibilityPCAPsResponseFull(BaseModel): id: Optional[str] = None """The ID for the packet capture.""" + byte_limit: Optional[float] = None + """The maximum number of bytes to capture. + + This field only applies to `full` packet captures. + """ + + colo_name: Optional[str] = None + """The name of the data center used for the packet capture. + + This can be a specific colo (ord02) or a multi-colo name (ORD). This field only + applies to `full` packet captures. + """ + + destination_conf: Optional[str] = None + """The full URI for the bucket. This field only applies to `full` packet captures.""" + + error_message: Optional[str] = None + """An error message that describes why the packet capture failed. + + This field only applies to `full` packet captures. + """ + filter_v1: Optional[Filter] = None """The packet capture filter. When this field is empty, all packets are captured.""" @@ -41,4 +63,4 @@ class MagicVisibilityPCAPsResponseSimple(BaseModel): """ -PCAPListResponse = Union[MagicVisibilityPCAPsResponseSimple, PCAP] +PCAPListResponse = Union[PCAP, MagicVisibilityPCAPsResponseFull] diff --git a/src/cloudflare/types/pcaps/__init__.py b/src/cloudflare/types/pcaps/__init__.py index 5357e816d6f..48f330a9b1a 100644 --- a/src/cloudflare/types/pcaps/__init__.py +++ b/src/cloudflare/types/pcaps/__init__.py @@ -2,7 +2,7 @@ from __future__ import annotations +from .ownership import Ownership as Ownership from .ownership_get_response import OwnershipGetResponse as OwnershipGetResponse from .ownership_create_params import OwnershipCreateParams as OwnershipCreateParams from .ownership_validate_params import OwnershipValidateParams as OwnershipValidateParams -from .magic_visibility_pcaps_ownership import MagicVisibilityPCAPsOwnership as MagicVisibilityPCAPsOwnership diff --git a/src/cloudflare/types/pcaps/magic_visibility_pcaps_ownership.py b/src/cloudflare/types/pcaps/ownership.py similarity index 89% rename from src/cloudflare/types/pcaps/magic_visibility_pcaps_ownership.py rename to src/cloudflare/types/pcaps/ownership.py index c5d731fba7a..2373d88a8dc 100644 --- a/src/cloudflare/types/pcaps/magic_visibility_pcaps_ownership.py +++ b/src/cloudflare/types/pcaps/ownership.py @@ -5,10 +5,10 @@ from ..._models import BaseModel -__all__ = ["MagicVisibilityPCAPsOwnership"] +__all__ = ["Ownership"] -class MagicVisibilityPCAPsOwnership(BaseModel): +class Ownership(BaseModel): id: str """The bucket ID associated with the packet captures API.""" diff --git a/src/cloudflare/types/pcaps/ownership_get_response.py b/src/cloudflare/types/pcaps/ownership_get_response.py index 20cef9bfb08..69cf682a9cf 100644 --- a/src/cloudflare/types/pcaps/ownership_get_response.py +++ b/src/cloudflare/types/pcaps/ownership_get_response.py @@ -2,8 +2,8 @@ from typing import List -from .magic_visibility_pcaps_ownership import MagicVisibilityPCAPsOwnership +from .ownership import Ownership __all__ = ["OwnershipGetResponse"] -OwnershipGetResponse = List[MagicVisibilityPCAPsOwnership] +OwnershipGetResponse = List[Ownership] diff --git a/src/cloudflare/types/r2/__init__.py b/src/cloudflare/types/r2/__init__.py index 56c6f2118e1..ebdaa8b7682 100644 --- a/src/cloudflare/types/r2/__init__.py +++ b/src/cloudflare/types/r2/__init__.py @@ -2,8 +2,8 @@ from __future__ import annotations -from .r2_sippy import R2Sippy as R2Sippy -from .r2_bucket import R2Bucket as R2Bucket +from .sippy import Sippy as Sippy +from .bucket import Bucket as Bucket from .bucket_list_params import BucketListParams as BucketListParams from .sippy_update_params import SippyUpdateParams as SippyUpdateParams from .bucket_create_params import BucketCreateParams as BucketCreateParams diff --git a/src/cloudflare/types/r2/r2_bucket.py b/src/cloudflare/types/r2/bucket.py similarity index 89% rename from src/cloudflare/types/r2/r2_bucket.py rename to src/cloudflare/types/r2/bucket.py index a85cfe4df01..d473140b23d 100644 --- a/src/cloudflare/types/r2/r2_bucket.py +++ b/src/cloudflare/types/r2/bucket.py @@ -5,10 +5,10 @@ from ..._models import BaseModel -__all__ = ["R2Bucket"] +__all__ = ["Bucket"] -class R2Bucket(BaseModel): +class Bucket(BaseModel): creation_date: Optional[str] = None """Creation timestamp""" diff --git a/src/cloudflare/types/r2/r2_sippy.py b/src/cloudflare/types/r2/sippy.py similarity index 94% rename from src/cloudflare/types/r2/r2_sippy.py rename to src/cloudflare/types/r2/sippy.py index a496acbc962..2d210744028 100644 --- a/src/cloudflare/types/r2/r2_sippy.py +++ b/src/cloudflare/types/r2/sippy.py @@ -8,7 +8,7 @@ from ..._models import BaseModel from .unnamed_schema_ref_6430970563db310f19d39aafe3debd27 import UnnamedSchemaRef6430970563db310f19d39aafe3debd27 -__all__ = ["R2Sippy", "Destination", "Source"] +__all__ = ["Sippy", "Destination", "Source"] class Destination(BaseModel): @@ -33,7 +33,7 @@ class Source(BaseModel): """Region where the bucket resides (AWS only)""" -class R2Sippy(BaseModel): +class Sippy(BaseModel): destination: Optional[Destination] = None """Details about the configured destination bucket""" diff --git a/src/cloudflare/types/rate_limit_list_response.py b/src/cloudflare/types/rate_limit_list_response.py index 95d8559f6cf..c1a4bb3d143 100644 --- a/src/cloudflare/types/rate_limit_list_response.py +++ b/src/cloudflare/types/rate_limit_list_response.py @@ -3,11 +3,55 @@ from typing import List, Optional from typing_extensions import Literal -from .action import Action from .._models import BaseModel -from .methods_item import MethodsItem -__all__ = ["RateLimitListResponse", "Bypass", "Match", "MatchHeader", "MatchRequest", "MatchResponse"] +__all__ = [ + "RateLimitListResponse", + "Action", + "ActionResponse", + "Bypass", + "Match", + "MatchHeader", + "MatchRequest", + "MatchResponse", +] + + +class ActionResponse(BaseModel): + body: Optional[str] = None + """The response body to return. + + The value must conform to the configured content type. + """ + + content_type: Optional[str] = None + """The content type of the body. + + Must be one of the following: `text/plain`, `text/xml`, or `application/json`. + """ + + +class Action(BaseModel): + mode: Optional[Literal["simulate", "ban", "challenge", "js_challenge", "managed_challenge"]] = None + """The action to perform.""" + + response: Optional[ActionResponse] = None + """A custom content type and reponse to return when the threshold is exceeded. + + The custom response configured in this object will override the custom error for + the zone. This object is optional. Notes: If you omit this object, Cloudflare + will use the default HTML error page. If "mode" is "challenge", + "managed_challenge", or "js_challenge", Cloudflare will use the zone challenge + pages and you should not provide the "response" object. + """ + + timeout: Optional[float] = None + """The time in seconds during which Cloudflare will perform the mitigation action. + + Must be an integer value greater than or equal to the period. Notes: If "mode" + is "challenge", "managed_challenge", or "js_challenge", Cloudflare will use the + zone's Challenge Passage time and you should not provide this value. + """ class Bypass(BaseModel): @@ -29,7 +73,7 @@ class MatchHeader(BaseModel): class MatchRequest(BaseModel): - methods: Optional[List[MethodsItem]] = None + methods: Optional[List[Literal["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "_ALL_"]]] = None """The HTTP methods to match. You can specify a subset (for example, `['POST','PUT']`) or all methods diff --git a/src/cloudflare/types/rate_plan.py b/src/cloudflare/types/rate_plan.py new file mode 100644 index 00000000000..e98c7044d5b --- /dev/null +++ b/src/cloudflare/types/rate_plan.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from typing_extensions import Literal + +from .._models import BaseModel +from .component import Component + +__all__ = ["RatePlan"] + + +class RatePlan(BaseModel): + id: Optional[str] = None + """Plan identifier tag.""" + + components: Optional[List[Component]] = None + """Array of available components values for the plan.""" + + currency: Optional[str] = None + """The monetary unit in which pricing information is displayed.""" + + duration: Optional[float] = None + """The duration of the plan subscription.""" + + frequency: Optional[Literal["weekly", "monthly", "quarterly", "yearly"]] = None + """The frequency at which you will be billed for this plan.""" + + name: Optional[str] = None + """The plan name.""" diff --git a/src/cloudflare/types/rate_plan_get_response.py b/src/cloudflare/types/rate_plan_get_response.py index d39850cbeac..727b482778e 100644 --- a/src/cloudflare/types/rate_plan_get_response.py +++ b/src/cloudflare/types/rate_plan_get_response.py @@ -1,32 +1,9 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional -from typing_extensions import Literal +from typing import List -from .._models import BaseModel -from .component import Component +from .rate_plan import RatePlan -__all__ = ["RatePlanGetResponse", "RatePlanGetResponseItem"] +__all__ = ["RatePlanGetResponse"] - -class RatePlanGetResponseItem(BaseModel): - id: Optional[str] = None - """Plan identifier tag.""" - - components: Optional[List[Component]] = None - """Array of available components values for the plan.""" - - currency: Optional[str] = None - """The monetary unit in which pricing information is displayed.""" - - duration: Optional[float] = None - """The duration of the plan subscription.""" - - frequency: Optional[Literal["weekly", "monthly", "quarterly", "yearly"]] = None - """The frequency at which you will be billed for this plan.""" - - name: Optional[str] = None - """The plan name.""" - - -RatePlanGetResponse = List[RatePlanGetResponseItem] +RatePlanGetResponse = List[RatePlan] diff --git a/src/cloudflare/types/registrar/__init__.py b/src/cloudflare/types/registrar/__init__.py index 599e2068201..d6102a096f4 100644 --- a/src/cloudflare/types/registrar/__init__.py +++ b/src/cloudflare/types/registrar/__init__.py @@ -2,5 +2,5 @@ from __future__ import annotations -from .domain_list_response import DomainListResponse as DomainListResponse +from .domain import Domain as Domain from .domain_update_params import DomainUpdateParams as DomainUpdateParams diff --git a/src/cloudflare/types/registrar/domain_list_response.py b/src/cloudflare/types/registrar/domain.py similarity index 96% rename from src/cloudflare/types/registrar/domain_list_response.py rename to src/cloudflare/types/registrar/domain.py index 7dbde7dd61a..90b0ed07a47 100644 --- a/src/cloudflare/types/registrar/domain_list_response.py +++ b/src/cloudflare/types/registrar/domain.py @@ -5,7 +5,7 @@ from ..._models import BaseModel -__all__ = ["DomainListResponse", "RegistrantContact", "TransferIn"] +__all__ = ["Domain", "RegistrantContact", "TransferIn"] class RegistrantContact(BaseModel): @@ -69,7 +69,7 @@ class TransferIn(BaseModel): """Domain is unlocked at the foreign registrar.""" -class DomainListResponse(BaseModel): +class Domain(BaseModel): id: Optional[str] = None """Domain identifier.""" diff --git a/src/cloudflare/types/request_list_item.py b/src/cloudflare/types/request_model.py similarity index 83% rename from src/cloudflare/types/request_list_item.py rename to src/cloudflare/types/request_model.py index 213f2cb5d0d..29753dd83e6 100644 --- a/src/cloudflare/types/request_list_item.py +++ b/src/cloudflare/types/request_model.py @@ -4,10 +4,10 @@ from .._models import BaseModel -__all__ = ["RequestListItem"] +__all__ = ["RequestModel"] -class RequestListItem(BaseModel): +class RequestModel(BaseModel): id: Optional[str] = None """Human-readable identifier of the Managed Transform.""" diff --git a/src/cloudflare/types/request_list_item_param.py b/src/cloudflare/types/request_model_param.py similarity index 78% rename from src/cloudflare/types/request_list_item_param.py rename to src/cloudflare/types/request_model_param.py index 8d43e49158f..d207b5bf111 100644 --- a/src/cloudflare/types/request_list_item_param.py +++ b/src/cloudflare/types/request_model_param.py @@ -4,10 +4,10 @@ from typing_extensions import TypedDict -__all__ = ["RequestListItemParam"] +__all__ = ["RequestModelParam"] -class RequestListItemParam(TypedDict, total=False): +class RequestModelParam(TypedDict, total=False): id: str """Human-readable identifier of the Managed Transform.""" diff --git a/src/cloudflare/types/action_item.py b/src/cloudflare/types/route.py similarity index 92% rename from src/cloudflare/types/action_item.py rename to src/cloudflare/types/route.py index b780d0e68ec..35dce363644 100644 --- a/src/cloudflare/types/action_item.py +++ b/src/cloudflare/types/route.py @@ -6,7 +6,7 @@ from .._models import BaseModel -__all__ = ["ActionItem", "Value"] +__all__ = ["Route", "Value"] class Value(BaseModel): @@ -20,7 +20,7 @@ class Value(BaseModel): """ -class ActionItem(BaseModel): +class Route(BaseModel): modified_on: Optional[datetime] = None """The timestamp of when the override was last modified.""" diff --git a/src/cloudflare/types/action_item_param.py b/src/cloudflare/types/route_param.py similarity index 86% rename from src/cloudflare/types/action_item_param.py rename to src/cloudflare/types/route_param.py index bc8039cd4fa..3182d9be53a 100644 --- a/src/cloudflare/types/action_item_param.py +++ b/src/cloudflare/types/route_param.py @@ -4,7 +4,7 @@ from typing_extensions import Literal, TypedDict -__all__ = ["ActionItemParam", "Value"] +__all__ = ["RouteParam", "Value"] class Value(TypedDict, total=False): @@ -18,7 +18,7 @@ class Value(TypedDict, total=False): """ -class ActionItemParam(TypedDict, total=False): +class RouteParam(TypedDict, total=False): name: Literal["forward_url"] """The type of route.""" diff --git a/src/cloudflare/types/rules/__init__.py b/src/cloudflare/types/rules/__init__.py index 24f42f87715..5afdefca7d7 100644 --- a/src/cloudflare/types/rules/__init__.py +++ b/src/cloudflare/types/rules/__init__.py @@ -2,9 +2,9 @@ from __future__ import annotations +from .list import List as List from .hostname import Hostname as Hostname from .redirect import Redirect as Redirect -from .lists_list import ListsList as ListsList from .hostname_param import HostnameParam as HostnameParam from .redirect_param import RedirectParam as RedirectParam from .list_create_params import ListCreateParams as ListCreateParams diff --git a/src/cloudflare/types/rules/lists_list.py b/src/cloudflare/types/rules/list.py similarity index 93% rename from src/cloudflare/types/rules/lists_list.py rename to src/cloudflare/types/rules/list.py index 17255b5fa7d..d5e6b46e413 100644 --- a/src/cloudflare/types/rules/lists_list.py +++ b/src/cloudflare/types/rules/list.py @@ -1,14 +1,14 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import List, Optional from typing_extensions import Literal from ..._models import BaseModel -__all__ = ["ListsList"] +__all__ = ["List"] -class ListsList(BaseModel): +class List(BaseModel): id: Optional[str] = None """The unique ID of the list.""" diff --git a/src/cloudflare/types/rum/__init__.py b/src/cloudflare/types/rum/__init__.py index 353cacb011f..89c2c91d40d 100644 --- a/src/cloudflare/types/rum/__init__.py +++ b/src/cloudflare/types/rum/__init__.py @@ -2,8 +2,9 @@ from __future__ import annotations -from .rum_rule import RUMRule as RUMRule -from .rum_site import RUMSite as RUMSite +from .rule import Rule as Rule +from .site import Site as Site +from .rule_param import RuleParam as RuleParam from .rule_create_params import RuleCreateParams as RuleCreateParams from .rule_list_response import RuleListResponse as RuleListResponse from .rule_update_params import RuleUpdateParams as RuleUpdateParams diff --git a/src/cloudflare/types/rum/rum_rule.py b/src/cloudflare/types/rum/rule.py similarity index 93% rename from src/cloudflare/types/rum/rum_rule.py rename to src/cloudflare/types/rum/rule.py index b6b43189c9f..c6badaed59e 100644 --- a/src/cloudflare/types/rum/rum_rule.py +++ b/src/cloudflare/types/rum/rule.py @@ -5,10 +5,10 @@ from ..._models import BaseModel -__all__ = ["RUMRule"] +__all__ = ["Rule"] -class RUMRule(BaseModel): +class Rule(BaseModel): id: Optional[str] = None """The Web Analytics rule identifier.""" diff --git a/src/cloudflare/types/rum/rule_list_response.py b/src/cloudflare/types/rum/rule_list_response.py index 3d8f03f0d73..cc6140acc51 100644 --- a/src/cloudflare/types/rum/rule_list_response.py +++ b/src/cloudflare/types/rum/rule_list_response.py @@ -2,7 +2,7 @@ from typing import List, Optional -from .rum_rule import RUMRule +from .rule import Rule from ..._models import BaseModel __all__ = ["RuleListResponse", "Ruleset"] @@ -22,7 +22,7 @@ class Ruleset(BaseModel): class RuleListResponse(BaseModel): - rules: Optional[List[RUMRule]] = None + rules: Optional[List[Rule]] = None """A list of rules.""" ruleset: Optional[Ruleset] = None diff --git a/src/cloudflare/types/rum/rule_param.py b/src/cloudflare/types/rum/rule_param.py new file mode 100644 index 00000000000..e05e452db5a --- /dev/null +++ b/src/cloudflare/types/rum/rule_param.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List +from typing_extensions import TypedDict + +__all__ = ["RuleParam"] + + +class RuleParam(TypedDict, total=False): + id: str + """The Web Analytics rule identifier.""" + + host: str + """The hostname the rule will be applied to.""" + + inclusive: bool + """Whether the rule includes or excludes traffic from being measured.""" + + is_paused: bool + """Whether the rule is paused or not.""" + + paths: List[str] + """The paths the rule will be applied to.""" + + priority: float diff --git a/src/cloudflare/types/rum/rum_site.py b/src/cloudflare/types/rum/site.py similarity index 88% rename from src/cloudflare/types/rum/rum_site.py rename to src/cloudflare/types/rum/site.py index 0aece867ff9..84ccdae3e2b 100644 --- a/src/cloudflare/types/rum/rum_site.py +++ b/src/cloudflare/types/rum/site.py @@ -3,10 +3,10 @@ from typing import List, Optional from datetime import datetime -from .rum_rule import RUMRule +from .rule import Rule from ..._models import BaseModel -__all__ = ["RUMSite", "Ruleset"] +__all__ = ["Site", "Ruleset"] class Ruleset(BaseModel): @@ -22,7 +22,7 @@ class Ruleset(BaseModel): """The zone identifier.""" -class RUMSite(BaseModel): +class Site(BaseModel): auto_install: Optional[bool] = None """ If enabled, the JavaScript snippet is automatically injected for orange-clouded @@ -31,7 +31,7 @@ class RUMSite(BaseModel): created: Optional[datetime] = None - rules: Optional[List[RUMRule]] = None + rules: Optional[List[Rule]] = None """A list of rules.""" ruleset: Optional[Ruleset] = None diff --git a/src/cloudflare/types/page_shield_setting.py b/src/cloudflare/types/setting.py similarity index 90% rename from src/cloudflare/types/page_shield_setting.py rename to src/cloudflare/types/setting.py index 4fd8f319791..fc42f6b0f75 100644 --- a/src/cloudflare/types/page_shield_setting.py +++ b/src/cloudflare/types/setting.py @@ -4,10 +4,10 @@ from .._models import BaseModel -__all__ = ["PageShieldSetting"] +__all__ = ["Setting"] -class PageShieldSetting(BaseModel): +class Setting(BaseModel): enabled: Optional[bool] = None """When true, indicates that Page Shield is enabled.""" diff --git a/src/cloudflare/types/email_settings.py b/src/cloudflare/types/settings.py similarity index 94% rename from src/cloudflare/types/email_settings.py rename to src/cloudflare/types/settings.py index 496f13c71e2..c9aecbe081b 100644 --- a/src/cloudflare/types/email_settings.py +++ b/src/cloudflare/types/settings.py @@ -6,10 +6,10 @@ from .._models import BaseModel -__all__ = ["EmailSettings"] +__all__ = ["Settings"] -class EmailSettings(BaseModel): +class Settings(BaseModel): id: Optional[str] = None """Email Routing settings identifier.""" diff --git a/src/cloudflare/types/settings_param.py b/src/cloudflare/types/settings_param.py new file mode 100644 index 00000000000..21b777e24f3 --- /dev/null +++ b/src/cloudflare/types/settings_param.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, TypedDict + +__all__ = ["SettingsParam"] + + +class SettingsParam(TypedDict, total=False): + enabled: Literal[True, False] + """State of the zone settings for Email Routing.""" + + skip_wizard: Literal[True, False] + """Flag to check if the user skipped the configuration wizard.""" diff --git a/src/cloudflare/types/shared/__init__.py b/src/cloudflare/types/shared/__init__.py index c2f99b43c8a..61089ccc32b 100644 --- a/src/cloudflare/types/shared/__init__.py +++ b/src/cloudflare/types/shared/__init__.py @@ -61,9 +61,6 @@ from .unnamed_schema_ref_d8600eb4758b3ae35607a0327bcd691b import ( UnnamedSchemaRefD8600eb4758b3ae35607a0327bcd691b as UnnamedSchemaRefD8600eb4758b3ae35607a0327bcd691b, ) -from .unnamed_schema_ref_dfef9380cb53cc7d4bda9f75e109d7a2 import ( - UnnamedSchemaRefDfef9380cb53cc7d4bda9f75e109d7a2 as UnnamedSchemaRefDfef9380cb53cc7d4bda9f75e109d7a2, -) from .unnamed_schema_ref_e7c61ebe06ebfc3861ae8b9db4ba152b import ( UnnamedSchemaRefE7c61ebe06ebfc3861ae8b9db4ba152b as UnnamedSchemaRefE7c61ebe06ebfc3861ae8b9db4ba152b, ) @@ -73,6 +70,3 @@ from .unnamed_schema_ref_ee1e79edcb234d14c4dd266880f2fd24 import ( UnnamedSchemaRefEe1e79edcb234d14c4dd266880f2fd24 as UnnamedSchemaRefEe1e79edcb234d14c4dd266880f2fd24, ) -from .unnamed_schema_ref_fb1dc8bb871d835b75bd0c2f50bd8572 import ( - UnnamedSchemaRefFb1dc8bb871d835b75bd0c2f50bd8572 as UnnamedSchemaRefFb1dc8bb871d835b75bd0c2f50bd8572, -) diff --git a/src/cloudflare/types/shared/unnamed_schema_ref_b92f86eb861cd3dee83c40884802fda6.py b/src/cloudflare/types/shared/unnamed_schema_ref_b92f86eb861cd3dee83c40884802fda6.py index 98679a1842e..6bc03e0780d 100644 --- a/src/cloudflare/types/shared/unnamed_schema_ref_b92f86eb861cd3dee83c40884802fda6.py +++ b/src/cloudflare/types/shared/unnamed_schema_ref_b92f86eb861cd3dee83c40884802fda6.py @@ -2,10 +2,10 @@ from typing import List, Optional from datetime import datetime -from typing_extensions import Literal from ..origin import Origin from ..._models import BaseModel +from ..check_region import CheckRegion from ..load_shedding import LoadShedding from ..origin_steering import OriginSteering from ..notification_filter import NotificationFilter @@ -16,26 +16,7 @@ class UnnamedSchemaRefB92f86eb861cd3dee83c40884802fda6(BaseModel): id: Optional[str] = None - check_regions: Optional[ - List[ - Literal[ - "WNAM", - "ENAM", - "WEU", - "EEU", - "NSAM", - "SSAM", - "OC", - "ME", - "NAF", - "SAF", - "SAS", - "SEAS", - "NEAS", - "ALL_REGIONS", - ] - ] - ] = None + check_regions: Optional[List[CheckRegion]] = None """A list of regions from which to run health checks. Null means every Cloudflare data center. diff --git a/src/cloudflare/types/shared/unnamed_schema_ref_dfef9380cb53cc7d4bda9f75e109d7a2.py b/src/cloudflare/types/shared/unnamed_schema_ref_dfef9380cb53cc7d4bda9f75e109d7a2.py deleted file mode 100644 index 4b1f393ad27..00000000000 --- a/src/cloudflare/types/shared/unnamed_schema_ref_dfef9380cb53cc7d4bda9f75e109d7a2.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -__all__ = ["UnnamedSchemaRefDfef9380cb53cc7d4bda9f75e109d7a2"] - -UnnamedSchemaRefDfef9380cb53cc7d4bda9f75e109d7a2 = List[object] diff --git a/src/cloudflare/types/shared/unnamed_schema_ref_fb1dc8bb871d835b75bd0c2f50bd8572.py b/src/cloudflare/types/shared/unnamed_schema_ref_fb1dc8bb871d835b75bd0c2f50bd8572.py deleted file mode 100644 index 2ea16391c01..00000000000 --- a/src/cloudflare/types/shared/unnamed_schema_ref_fb1dc8bb871d835b75bd0c2f50bd8572.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel - -__all__ = ["UnnamedSchemaRefFb1dc8bb871d835b75bd0c2f50bd8572"] - - -class UnnamedSchemaRefFb1dc8bb871d835b75bd0c2f50bd8572(BaseModel): - id: Optional[str] = None - """UUID""" diff --git a/src/cloudflare/types/spectrum/analytics/events/bytime_get_params.py b/src/cloudflare/types/spectrum/analytics/events/bytime_get_params.py index c0d49bf304a..6e404625314 100644 --- a/src/cloudflare/types/spectrum/analytics/events/bytime_get_params.py +++ b/src/cloudflare/types/spectrum/analytics/events/bytime_get_params.py @@ -7,7 +7,7 @@ from typing_extensions import Literal, Annotated, TypedDict from ....._utils import PropertyInfo -from .dimension_item import DimensionItem +from ..dimension_item import DimensionItem __all__ = ["BytimeGetParams"] diff --git a/src/cloudflare/types/spectrum/analytics/events/summary_get_params.py b/src/cloudflare/types/spectrum/analytics/events/summary_get_params.py index 38eb79aaf85..5f360a59c32 100644 --- a/src/cloudflare/types/spectrum/analytics/events/summary_get_params.py +++ b/src/cloudflare/types/spectrum/analytics/events/summary_get_params.py @@ -7,7 +7,7 @@ from typing_extensions import Literal, Annotated, TypedDict from ....._utils import PropertyInfo -from .dimension_item import DimensionItem +from ..dimension_item import DimensionItem __all__ = ["SummaryGetParams"] diff --git a/src/cloudflare/types/speed/__init__.py b/src/cloudflare/types/speed/__init__.py index 86dea078f40..73ab8bfd4e3 100644 --- a/src/cloudflare/types/speed/__init__.py +++ b/src/cloudflare/types/speed/__init__.py @@ -2,13 +2,15 @@ from __future__ import annotations +from .test import Test as Test +from .schedule import Schedule as Schedule +from .availability import Availability as Availability +from .schedule_param import ScheduleParam as ScheduleParam from .test_list_params import TestListParams as TestListParams from .page_list_response import PageListResponse as PageListResponse from .test_create_params import TestCreateParams as TestCreateParams from .test_delete_params import TestDeleteParams as TestDeleteParams from .test_list_response import TestListResponse as TestListResponse from .test_delete_response import TestDeleteResponse as TestDeleteResponse -from .observatory_page_test import ObservatoryPageTest as ObservatoryPageTest from .schedule_create_params import ScheduleCreateParams as ScheduleCreateParams from .schedule_create_response import ScheduleCreateResponse as ScheduleCreateResponse -from .observatory_availabilities import ObservatoryAvailabilities as ObservatoryAvailabilities diff --git a/src/cloudflare/types/speed/observatory_availabilities.py b/src/cloudflare/types/speed/availability.py similarity index 92% rename from src/cloudflare/types/speed/observatory_availabilities.py rename to src/cloudflare/types/speed/availability.py index ed4bb645891..1ea04f635fd 100644 --- a/src/cloudflare/types/speed/observatory_availabilities.py +++ b/src/cloudflare/types/speed/availability.py @@ -7,7 +7,7 @@ from ..._models import BaseModel from ..labeled_region import LabeledRegion -__all__ = ["ObservatoryAvailabilities", "Quota"] +__all__ = ["Availability", "Quota"] class Quota(BaseModel): @@ -27,7 +27,7 @@ class Quota(BaseModel): """The number of schedules available per plan.""" -class ObservatoryAvailabilities(BaseModel): +class Availability(BaseModel): quota: Optional[Quota] = None regions: Optional[List[LabeledRegion]] = None diff --git a/src/cloudflare/types/speed/page_list_response.py b/src/cloudflare/types/speed/page_list_response.py index 955aad40bd3..627a6773f1c 100644 --- a/src/cloudflare/types/speed/page_list_response.py +++ b/src/cloudflare/types/speed/page_list_response.py @@ -5,9 +5,9 @@ from pydantic import Field as FieldInfo +from .test import Test from ..._models import BaseModel from ..labeled_region import LabeledRegion -from .observatory_page_test import ObservatoryPageTest __all__ = ["PageListResponse"] @@ -19,7 +19,7 @@ class PageListResponse(BaseModel): schedule_frequency: Optional[Literal["DAILY", "WEEKLY"]] = FieldInfo(alias="scheduleFrequency", default=None) """The frequency of the test.""" - tests: Optional[List[ObservatoryPageTest]] = None + tests: Optional[List[Test]] = None url: Optional[str] = None """A URL.""" diff --git a/src/cloudflare/types/observatory_schedule.py b/src/cloudflare/types/speed/schedule.py similarity index 90% rename from src/cloudflare/types/observatory_schedule.py rename to src/cloudflare/types/speed/schedule.py index cfd5118c6aa..42ae4c52008 100644 --- a/src/cloudflare/types/observatory_schedule.py +++ b/src/cloudflare/types/speed/schedule.py @@ -3,12 +3,12 @@ from typing import Optional from typing_extensions import Literal -from .._models import BaseModel +from ..._models import BaseModel -__all__ = ["ObservatorySchedule"] +__all__ = ["Schedule"] -class ObservatorySchedule(BaseModel): +class Schedule(BaseModel): frequency: Optional[Literal["DAILY", "WEEKLY"]] = None """The frequency of the test.""" diff --git a/src/cloudflare/types/speed/schedule_create_response.py b/src/cloudflare/types/speed/schedule_create_response.py index 9c9eb38b426..50ef4d668ed 100644 --- a/src/cloudflare/types/speed/schedule_create_response.py +++ b/src/cloudflare/types/speed/schedule_create_response.py @@ -2,15 +2,15 @@ from typing import Optional +from .test import Test +from .schedule import Schedule from ..._models import BaseModel -from ..observatory_schedule import ObservatorySchedule -from .observatory_page_test import ObservatoryPageTest __all__ = ["ScheduleCreateResponse"] class ScheduleCreateResponse(BaseModel): - schedule: Optional[ObservatorySchedule] = None + schedule: Optional[Schedule] = None """The test schedule.""" - test: Optional[ObservatoryPageTest] = None + test: Optional[Test] = None diff --git a/src/cloudflare/types/speed/schedule_param.py b/src/cloudflare/types/speed/schedule_param.py new file mode 100644 index 00000000000..0b2f7bb2059 --- /dev/null +++ b/src/cloudflare/types/speed/schedule_param.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, TypedDict + +__all__ = ["ScheduleParam"] + + +class ScheduleParam(TypedDict, total=False): + frequency: Literal["DAILY", "WEEKLY"] + """The frequency of the test.""" + + region: Literal[ + "asia-east1", + "asia-northeast1", + "asia-northeast2", + "asia-south1", + "asia-southeast1", + "australia-southeast1", + "europe-north1", + "europe-southwest1", + "europe-west1", + "europe-west2", + "europe-west3", + "europe-west4", + "europe-west8", + "europe-west9", + "me-west1", + "southamerica-east1", + "us-central1", + "us-east1", + "us-east4", + "us-south1", + "us-west1", + ] + """A test region.""" + + url: str + """A URL.""" diff --git a/src/cloudflare/types/speed/observatory_page_test.py b/src/cloudflare/types/speed/test.py similarity index 93% rename from src/cloudflare/types/speed/observatory_page_test.py rename to src/cloudflare/types/speed/test.py index e85b2570eda..959dadbb56b 100644 --- a/src/cloudflare/types/speed/observatory_page_test.py +++ b/src/cloudflare/types/speed/test.py @@ -10,10 +10,11 @@ from ..labeled_region import LabeledRegion from ..lighthouse_report import LighthouseReport -__all__ = ["ObservatoryPageTest"] +__all__ = ["Test"] -class ObservatoryPageTest(BaseModel): +class Test(BaseModel): + __test__ = False id: Optional[str] = None """UUID""" diff --git a/src/cloudflare/types/ssl/__init__.py b/src/cloudflare/types/ssl/__init__.py index fdb511a7524..6eacc7d5f8e 100644 --- a/src/cloudflare/types/ssl/__init__.py +++ b/src/cloudflare/types/ssl/__init__.py @@ -3,9 +3,9 @@ from __future__ import annotations from .host_item import HostItem as HostItem +from .verification import Verification as Verification from .analyze_create_params import AnalyzeCreateParams as AnalyzeCreateParams from .verification_get_params import VerificationGetParams as VerificationGetParams -from .tls_verification_setting import TLSVerificationSetting as TLSVerificationSetting from .verification_edit_params import VerificationEditParams as VerificationEditParams from .verification_get_response import VerificationGetResponse as VerificationGetResponse from .verification_edit_response import VerificationEditResponse as VerificationEditResponse diff --git a/src/cloudflare/types/ssl/certificate_packs/order_create_params.py b/src/cloudflare/types/ssl/certificate_packs/order_create_params.py index 9cd543e4a7d..2ffbea17c53 100644 --- a/src/cloudflare/types/ssl/certificate_packs/order_create_params.py +++ b/src/cloudflare/types/ssl/certificate_packs/order_create_params.py @@ -5,7 +5,7 @@ from typing import List from typing_extensions import Literal, Required, TypedDict -from .host_item import HostItem +from ..host_item import HostItem __all__ = ["OrderCreateParams"] diff --git a/src/cloudflare/types/ssl/certificate_packs/order_create_response.py b/src/cloudflare/types/ssl/certificate_packs/order_create_response.py index 92d34995c69..f663f78d544 100644 --- a/src/cloudflare/types/ssl/certificate_packs/order_create_response.py +++ b/src/cloudflare/types/ssl/certificate_packs/order_create_response.py @@ -3,8 +3,8 @@ from typing import List, Optional from typing_extensions import Literal -from .host_item import HostItem from ...._models import BaseModel +from ..host_item import HostItem __all__ = ["OrderCreateResponse"] diff --git a/src/cloudflare/types/ssl/tls_verification_setting.py b/src/cloudflare/types/ssl/verification.py similarity index 93% rename from src/cloudflare/types/ssl/tls_verification_setting.py rename to src/cloudflare/types/ssl/verification.py index 0435f6f6e22..deae77ca45f 100644 --- a/src/cloudflare/types/ssl/tls_verification_setting.py +++ b/src/cloudflare/types/ssl/verification.py @@ -5,7 +5,7 @@ from ..._models import BaseModel -__all__ = ["TLSVerificationSetting", "VerificationInfo"] +__all__ = ["Verification", "VerificationInfo"] class VerificationInfo(BaseModel): @@ -16,7 +16,7 @@ class VerificationInfo(BaseModel): """Target of CNAME record.""" -class TLSVerificationSetting(BaseModel): +class Verification(BaseModel): certificate_status: Literal[ "initializing", "authorizing", "active", "expired", "issuing", "timing_out", "pending_deployment" ] diff --git a/src/cloudflare/types/ssl/verification_get_response.py b/src/cloudflare/types/ssl/verification_get_response.py index 7d6fe83cab4..d273404bc2f 100644 --- a/src/cloudflare/types/ssl/verification_get_response.py +++ b/src/cloudflare/types/ssl/verification_get_response.py @@ -2,8 +2,8 @@ from typing import List -from .tls_verification_setting import TLSVerificationSetting +from .verification import Verification __all__ = ["VerificationGetResponse"] -VerificationGetResponse = List[TLSVerificationSetting] +VerificationGetResponse = List[Verification] diff --git a/src/cloudflare/types/storage/__init__.py b/src/cloudflare/types/storage/__init__.py index 29bae3427c3..b650d0931cd 100644 --- a/src/cloudflare/types/storage/__init__.py +++ b/src/cloudflare/types/storage/__init__.py @@ -2,10 +2,10 @@ from __future__ import annotations +from .schema import Schema as Schema +from .components import Components as Components from .analytics_list_params import AnalyticsListParams as AnalyticsListParams from .analytics_stored_params import AnalyticsStoredParams as AnalyticsStoredParams -from .workers_kv_schemas_result import WorkersKVSchemasResult as WorkersKVSchemasResult -from .workers_kv_components_schemas_result import WorkersKVComponentsSchemasResult as WorkersKVComponentsSchemasResult from .unnamed_schema_ref_608bee5065f7314d6fa572b89a1910f7 import ( UnnamedSchemaRef608bee5065f7314d6fa572b89a1910f7 as UnnamedSchemaRef608bee5065f7314d6fa572b89a1910f7, ) diff --git a/src/cloudflare/types/storage/workers_kv_schemas_result.py b/src/cloudflare/types/storage/components.py similarity index 96% rename from src/cloudflare/types/storage/workers_kv_schemas_result.py rename to src/cloudflare/types/storage/components.py index 67cf2e07334..0f3b0d26ed5 100644 --- a/src/cloudflare/types/storage/workers_kv_schemas_result.py +++ b/src/cloudflare/types/storage/components.py @@ -6,7 +6,7 @@ from ..._models import BaseModel from .unnamed_schema_ref_608bee5065f7314d6fa572b89a1910f7 import UnnamedSchemaRef608bee5065f7314d6fa572b89a1910f7 -__all__ = ["WorkersKVSchemasResult", "Query"] +__all__ = ["Components", "Query"] class Query(BaseModel): @@ -52,7 +52,7 @@ class Query(BaseModel): """End of time interval to query, defaults to current time.""" -class WorkersKVSchemasResult(BaseModel): +class Components(BaseModel): data: Optional[List[UnnamedSchemaRef608bee5065f7314d6fa572b89a1910f7]] = None data_lag: float diff --git a/src/cloudflare/types/storage/workers_kv_components_schemas_result.py b/src/cloudflare/types/storage/schema.py similarity index 95% rename from src/cloudflare/types/storage/workers_kv_components_schemas_result.py rename to src/cloudflare/types/storage/schema.py index ad98a78df86..130988ee763 100644 --- a/src/cloudflare/types/storage/workers_kv_components_schemas_result.py +++ b/src/cloudflare/types/storage/schema.py @@ -6,7 +6,7 @@ from ..._models import BaseModel from .unnamed_schema_ref_608bee5065f7314d6fa572b89a1910f7 import UnnamedSchemaRef608bee5065f7314d6fa572b89a1910f7 -__all__ = ["WorkersKVComponentsSchemasResult", "Query"] +__all__ = ["Schema", "Query"] class Query(BaseModel): @@ -52,7 +52,7 @@ class Query(BaseModel): """End of time interval to query, defaults to current time.""" -class WorkersKVComponentsSchemasResult(BaseModel): +class Schema(BaseModel): data: Optional[List[UnnamedSchemaRef608bee5065f7314d6fa572b89a1910f7]] = None data_lag: float diff --git a/src/cloudflare/types/stream/__init__.py b/src/cloudflare/types/stream/__init__.py index 3f6894afd92..7f01aa18ba2 100644 --- a/src/cloudflare/types/stream/__init__.py +++ b/src/cloudflare/types/stream/__init__.py @@ -2,15 +2,15 @@ from __future__ import annotations -from .stream_keys import StreamKeys as StreamKeys -from .stream_audio import StreamAudio as StreamAudio -from .stream_captions import StreamCaptions as StreamCaptions -from .stream_clipping import StreamClipping as StreamClipping +from .clip import Clip as Clip +from .keys import Keys as Keys +from .audio import Audio as Audio +from .caption import Caption as Caption +from .watermaks import Watermaks as Watermaks +from .live_input import LiveInput as LiveInput from .key_get_response import KeyGetResponse as KeyGetResponse from .key_create_params import KeyCreateParams as KeyCreateParams from .key_delete_params import KeyDeleteParams as KeyDeleteParams -from .stream_live_input import StreamLiveInput as StreamLiveInput -from .stream_watermarks import StreamWatermarks as StreamWatermarks from .clip_create_params import ClipCreateParams as ClipCreateParams from .copy_create_params import CopyCreateParams as CopyCreateParams from .embed_get_response import EmbedGetResponse as EmbedGetResponse diff --git a/src/cloudflare/types/stream/stream_audio.py b/src/cloudflare/types/stream/audio.py similarity index 92% rename from src/cloudflare/types/stream/stream_audio.py rename to src/cloudflare/types/stream/audio.py index 2b90d9a8d8e..d3f241ce3f3 100644 --- a/src/cloudflare/types/stream/stream_audio.py +++ b/src/cloudflare/types/stream/audio.py @@ -5,10 +5,10 @@ from ..._models import BaseModel -__all__ = ["StreamAudio"] +__all__ = ["Audio"] -class StreamAudio(BaseModel): +class Audio(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_get_response.py b/src/cloudflare/types/stream/audio_track_get_response.py index 893a4995463..63d138912a2 100644 --- a/src/cloudflare/types/stream/audio_track_get_response.py +++ b/src/cloudflare/types/stream/audio_track_get_response.py @@ -2,8 +2,8 @@ from typing import List -from .stream_audio import StreamAudio +from .audio import Audio __all__ = ["AudioTrackGetResponse"] -AudioTrackGetResponse = List[StreamAudio] +AudioTrackGetResponse = List[Audio] diff --git a/src/cloudflare/types/stream/stream_captions.py b/src/cloudflare/types/stream/caption.py similarity index 84% rename from src/cloudflare/types/stream/stream_captions.py rename to src/cloudflare/types/stream/caption.py index 4239fffd3a2..4fc03b8b2f4 100644 --- a/src/cloudflare/types/stream/stream_captions.py +++ b/src/cloudflare/types/stream/caption.py @@ -4,10 +4,10 @@ from ..._models import BaseModel -__all__ = ["StreamCaptions"] +__all__ = ["Caption"] -class StreamCaptions(BaseModel): +class Caption(BaseModel): label: Optional[str] = None """The language label displayed in the native language to users.""" diff --git a/src/cloudflare/types/stream/caption_get_response.py b/src/cloudflare/types/stream/caption_get_response.py index 9a78fc893b2..dac0ff81d99 100644 --- a/src/cloudflare/types/stream/caption_get_response.py +++ b/src/cloudflare/types/stream/caption_get_response.py @@ -2,8 +2,8 @@ from typing import List -from .stream_captions import StreamCaptions +from .caption import Caption __all__ = ["CaptionGetResponse"] -CaptionGetResponse = List[StreamCaptions] +CaptionGetResponse = List[Caption] diff --git a/src/cloudflare/types/stream/stream_clipping.py b/src/cloudflare/types/stream/clip.py similarity index 95% rename from src/cloudflare/types/stream/stream_clipping.py rename to src/cloudflare/types/stream/clip.py index f91915ca2d3..ec82d0e9eea 100644 --- a/src/cloudflare/types/stream/stream_clipping.py +++ b/src/cloudflare/types/stream/clip.py @@ -7,9 +7,9 @@ from pydantic import Field as FieldInfo from ..._models import BaseModel -from .allowed_origins_item import AllowedOriginsItem +from ..allowed_origins_item import AllowedOriginsItem -__all__ = ["StreamClipping", "Playback", "Watermark"] +__all__ = ["Clip", "Playback", "Watermark"] class Playback(BaseModel): @@ -25,7 +25,7 @@ class Watermark(BaseModel): """The unique identifier for the watermark profile.""" -class StreamClipping(BaseModel): +class Clip(BaseModel): allowed_origins: Optional[List[AllowedOriginsItem]] = FieldInfo(alias="allowedOrigins", default=None) """Lists the origins allowed to display the video. diff --git a/src/cloudflare/types/stream/clip_create_params.py b/src/cloudflare/types/stream/clip_create_params.py index 7a257d65874..04a3f99713e 100644 --- a/src/cloudflare/types/stream/clip_create_params.py +++ b/src/cloudflare/types/stream/clip_create_params.py @@ -6,7 +6,7 @@ from typing_extensions import Required, Annotated, TypedDict from ..._utils import PropertyInfo -from .allowed_origins_item import AllowedOriginsItem +from ..allowed_origins_item import AllowedOriginsItem __all__ = ["ClipCreateParams", "Watermark"] diff --git a/src/cloudflare/types/stream/copy_create_params.py b/src/cloudflare/types/stream/copy_create_params.py index 36438c8d206..7851cf8680f 100644 --- a/src/cloudflare/types/stream/copy_create_params.py +++ b/src/cloudflare/types/stream/copy_create_params.py @@ -7,7 +7,7 @@ from typing_extensions import Required, Annotated, TypedDict from ..._utils import PropertyInfo -from .allowed_origins_item import AllowedOriginsItem +from ..allowed_origins_item import AllowedOriginsItem __all__ = ["CopyCreateParams", "Watermark"] diff --git a/src/cloudflare/types/stream/direct_upload_create_params.py b/src/cloudflare/types/stream/direct_upload_create_params.py index e486b394e1b..8d18be5e888 100644 --- a/src/cloudflare/types/stream/direct_upload_create_params.py +++ b/src/cloudflare/types/stream/direct_upload_create_params.py @@ -7,7 +7,7 @@ from typing_extensions import Required, Annotated, TypedDict from ..._utils import PropertyInfo -from .allowed_origins_item import AllowedOriginsItem +from ..allowed_origins_item import AllowedOriginsItem __all__ = ["DirectUploadCreateParams", "Watermark"] diff --git a/src/cloudflare/types/stream/direct_upload_create_response.py b/src/cloudflare/types/stream/direct_upload_create_response.py index c43a4ae00c3..e97cb77b598 100644 --- a/src/cloudflare/types/stream/direct_upload_create_response.py +++ b/src/cloudflare/types/stream/direct_upload_create_response.py @@ -6,7 +6,7 @@ from pydantic import Field as FieldInfo from ..._models import BaseModel -from .stream_watermarks import StreamWatermarks +from .watermaks import Watermaks __all__ = ["DirectUploadCreateResponse"] @@ -29,4 +29,4 @@ class DirectUploadCreateResponse(BaseModel): `HTTP POST multipart/form-data` request. """ - watermark: Optional[StreamWatermarks] = None + watermark: Optional[Watermaks] = None diff --git a/src/cloudflare/types/stream/stream_keys.py b/src/cloudflare/types/stream/keys.py similarity index 89% rename from src/cloudflare/types/stream/stream_keys.py rename to src/cloudflare/types/stream/keys.py index 28d692daf6b..f638edbc213 100644 --- a/src/cloudflare/types/stream/stream_keys.py +++ b/src/cloudflare/types/stream/keys.py @@ -5,10 +5,10 @@ from ..._models import BaseModel -__all__ = ["StreamKeys"] +__all__ = ["Keys"] -class StreamKeys(BaseModel): +class Keys(BaseModel): id: Optional[str] = None """Identifier""" diff --git a/src/cloudflare/types/stream/stream_live_input.py b/src/cloudflare/types/stream/live_input.py similarity index 97% rename from src/cloudflare/types/stream/stream_live_input.py rename to src/cloudflare/types/stream/live_input.py index fe07b2e299c..9d9834cec1a 100644 --- a/src/cloudflare/types/stream/stream_live_input.py +++ b/src/cloudflare/types/stream/live_input.py @@ -8,7 +8,7 @@ from ..._models import BaseModel -__all__ = ["StreamLiveInput", "Recording", "Rtmps", "RtmpsPlayback", "Srt", "SrtPlayback", "WebRtc", "WebRtcPlayback"] +__all__ = ["LiveInput", "Recording", "Rtmps", "RtmpsPlayback", "Srt", "SrtPlayback", "WebRtc", "WebRtcPlayback"] class Recording(BaseModel): @@ -90,7 +90,7 @@ class WebRtcPlayback(BaseModel): """The URL used to play live video over WebRTC.""" -class StreamLiveInput(BaseModel): +class LiveInput(BaseModel): created: Optional[datetime] = None """The date and time the live input was created.""" diff --git a/src/cloudflare/types/stream/live_inputs/__init__.py b/src/cloudflare/types/stream/live_inputs/__init__.py index 3d784502914..e8063b8b859 100644 --- a/src/cloudflare/types/stream/live_inputs/__init__.py +++ b/src/cloudflare/types/stream/live_inputs/__init__.py @@ -2,7 +2,7 @@ from __future__ import annotations -from .stream_output import StreamOutput as StreamOutput +from .output import Output as Output from .output_create_params import OutputCreateParams as OutputCreateParams from .output_delete_params import OutputDeleteParams as OutputDeleteParams from .output_update_params import OutputUpdateParams as OutputUpdateParams diff --git a/src/cloudflare/types/stream/live_inputs/stream_output.py b/src/cloudflare/types/stream/live_inputs/output.py similarity index 93% rename from src/cloudflare/types/stream/live_inputs/stream_output.py rename to src/cloudflare/types/stream/live_inputs/output.py index eb78f4fe309..bc47dd26d9d 100644 --- a/src/cloudflare/types/stream/live_inputs/stream_output.py +++ b/src/cloudflare/types/stream/live_inputs/output.py @@ -6,10 +6,10 @@ from ...._models import BaseModel -__all__ = ["StreamOutput"] +__all__ = ["Output"] -class StreamOutput(BaseModel): +class Output(BaseModel): enabled: Optional[bool] = None """ When enabled, live video streamed to the associated live input will be sent to diff --git a/src/cloudflare/types/stream/stream_watermarks.py b/src/cloudflare/types/stream/watermaks.py similarity index 96% rename from src/cloudflare/types/stream/stream_watermarks.py rename to src/cloudflare/types/stream/watermaks.py index c90c31654e5..a06de1f764a 100644 --- a/src/cloudflare/types/stream/stream_watermarks.py +++ b/src/cloudflare/types/stream/watermaks.py @@ -7,10 +7,10 @@ from ..._models import BaseModel -__all__ = ["StreamWatermarks"] +__all__ = ["Watermaks"] -class StreamWatermarks(BaseModel): +class Watermaks(BaseModel): created: Optional[datetime] = None """The date and a time a watermark profile was created.""" diff --git a/src/cloudflare/types/intel_phishing_url_submit.py b/src/cloudflare/types/submit.py similarity index 92% rename from src/cloudflare/types/intel_phishing_url_submit.py rename to src/cloudflare/types/submit.py index 9647ce9ab7f..31aecae76b2 100644 --- a/src/cloudflare/types/intel_phishing_url_submit.py +++ b/src/cloudflare/types/submit.py @@ -7,10 +7,10 @@ from .unnamed_schema_ref_767c0981cf47f45f0c766253dbd18669 import UnnamedSchemaRef767c0981cf47f45f0c766253dbd18669 from .unnamed_schema_ref_39419d70e2399b28b15cd660afd342fb import UnnamedSchemaRef39419d70e2399b28b15cd660afd342fb -__all__ = ["IntelPhishingURLSubmit"] +__all__ = ["Submit"] -class IntelPhishingURLSubmit(BaseModel): +class Submit(BaseModel): excluded_urls: Optional[List[UnnamedSchemaRef767c0981cf47f45f0c766253dbd18669]] = None """ URLs that were excluded from scanning because their domain is in our no-scan diff --git a/src/cloudflare/types/subscription_list_response.py b/src/cloudflare/types/subscription_list_response.py deleted file mode 100644 index 88d6c34f983..00000000000 --- a/src/cloudflare/types/subscription_list_response.py +++ /dev/null @@ -1,96 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional -from datetime import datetime -from typing_extensions import Literal - -from .._models import BaseModel - -__all__ = ["SubscriptionListResponse", "App", "ComponentValue", "RatePlan", "Zone"] - - -class App(BaseModel): - install_id: Optional[str] = None - """app install id.""" - - -class ComponentValue(BaseModel): - default: Optional[float] = None - """The default amount assigned.""" - - name: Optional[str] = None - """The name of the component value.""" - - price: Optional[float] = None - """The unit price for the component value.""" - - value: Optional[float] = None - """The amount of the component value assigned.""" - - -class RatePlan(BaseModel): - id: Optional[str] = None - """The ID of the rate plan.""" - - currency: Optional[str] = None - """The currency applied to the rate plan subscription.""" - - externally_managed: Optional[bool] = None - """Whether this rate plan is managed externally from Cloudflare.""" - - is_contract: Optional[bool] = None - """Whether a rate plan is enterprise-based (or newly adopted term contract).""" - - public_name: Optional[str] = None - """The full name of the rate plan.""" - - scope: Optional[str] = None - """The scope that this rate plan applies to.""" - - sets: Optional[List[str]] = None - """The list of sets this rate plan applies to.""" - - -class Zone(BaseModel): - id: Optional[str] = None - """Identifier""" - - name: Optional[str] = None - """The domain name""" - - -class SubscriptionListResponse(BaseModel): - id: Optional[str] = None - """Subscription identifier tag.""" - - app: Optional[App] = None - - component_values: Optional[List[ComponentValue]] = None - """The list of add-ons subscribed to.""" - - currency: Optional[str] = None - """The monetary unit in which pricing information is displayed.""" - - current_period_end: Optional[datetime] = None - """The end of the current period and also when the next billing is due.""" - - current_period_start: Optional[datetime] = None - """When the current billing period started. - - May match initial_period_start if this is the first period. - """ - - frequency: Optional[Literal["weekly", "monthly", "quarterly", "yearly"]] = None - """How often the subscription is renewed automatically.""" - - price: Optional[float] = None - """The price of the subscription that will be billed, in US dollars.""" - - rate_plan: Optional[RatePlan] = 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[Zone] = None - """A simple zone object. May have null properties if not a zone subscription.""" diff --git a/src/cloudflare/types/url_target.py b/src/cloudflare/types/targes.py similarity index 77% rename from src/cloudflare/types/url_target.py rename to src/cloudflare/types/targes.py index 9b60c83f2a9..c3d68ecdcee 100644 --- a/src/cloudflare/types/url_target.py +++ b/src/cloudflare/types/targes.py @@ -1,11 +1,10 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional from typing_extensions import Literal from .._models import BaseModel -__all__ = ["URLTarget", "Constraint"] +__all__ = ["Targes", "Constraint"] class Constraint(BaseModel): @@ -21,9 +20,9 @@ class Constraint(BaseModel): """ -class URLTarget(BaseModel): - constraint: Optional[Constraint] = None +class Targes(BaseModel): + constraint: Constraint """String constraint.""" - target: Optional[Literal["url"]] = None + target: Literal["url"] """A target based on the URL of the request.""" diff --git a/src/cloudflare/types/targes_item_param.py b/src/cloudflare/types/targes_param.py similarity index 89% rename from src/cloudflare/types/targes_item_param.py rename to src/cloudflare/types/targes_param.py index fba6edc5019..903dd2c5d74 100644 --- a/src/cloudflare/types/targes_item_param.py +++ b/src/cloudflare/types/targes_param.py @@ -4,7 +4,7 @@ from typing_extensions import Literal, Required, TypedDict -__all__ = ["TargesItemParam", "Constraint"] +__all__ = ["TargesParam", "Constraint"] class Constraint(TypedDict, total=False): @@ -20,7 +20,7 @@ class Constraint(TypedDict, total=False): """ -class TargesItemParam(TypedDict, total=False): +class TargesParam(TypedDict, total=False): constraint: Required[Constraint] """String constraint.""" diff --git a/src/cloudflare/types/tcp_configuration.py b/src/cloudflare/types/tcp_configuration.py index 02690584f1f..7424759e961 100644 --- a/src/cloudflare/types/tcp_configuration.py +++ b/src/cloudflare/types/tcp_configuration.py @@ -5,10 +5,10 @@ from .._models import BaseModel -__all__ = ["TcpConfiguration"] +__all__ = ["TCPConfiguration"] -class TcpConfiguration(BaseModel): +class TCPConfiguration(BaseModel): method: Optional[Literal["connection_established"]] = None """The TCP connection method to use for the health check.""" diff --git a/src/cloudflare/types/tcp_configuration_param.py b/src/cloudflare/types/tcp_configuration_param.py index 75f087131e5..edbb9a4cf5d 100644 --- a/src/cloudflare/types/tcp_configuration_param.py +++ b/src/cloudflare/types/tcp_configuration_param.py @@ -4,10 +4,10 @@ from typing_extensions import Literal, TypedDict -__all__ = ["TcpConfigurationParam"] +__all__ = ["TCPConfigurationParam"] -class TcpConfigurationParam(TypedDict, total=False): +class TCPConfigurationParam(TypedDict, total=False): method: Literal["connection_established"] """The TCP connection method to use for the health check.""" diff --git a/src/cloudflare/types/observatory_trend.py b/src/cloudflare/types/trend.py similarity index 93% rename from src/cloudflare/types/observatory_trend.py rename to src/cloudflare/types/trend.py index f8a7b2590bf..d6aa839751f 100644 --- a/src/cloudflare/types/observatory_trend.py +++ b/src/cloudflare/types/trend.py @@ -6,10 +6,10 @@ from .._models import BaseModel -__all__ = ["ObservatoryTrend"] +__all__ = ["Trend"] -class ObservatoryTrend(BaseModel): +class Trend(BaseModel): cls: Optional[List[Optional[float]]] = None """Cumulative Layout Shift trend.""" diff --git a/src/cloudflare/types/user/__init__.py b/src/cloudflare/types/user/__init__.py index 49a489ac3fc..0244395a013 100644 --- a/src/cloudflare/types/user/__init__.py +++ b/src/cloudflare/types/user/__init__.py @@ -2,9 +2,11 @@ from __future__ import annotations -from .user import User as User from .invite import Invite as Invite +from .policy import Policy as Policy from .organization import Organization as Organization +from .policy_param import PolicyParam as PolicyParam +from .subscription import Subscription as Subscription from .cidr_list_item import CIDRListItem as CIDRListItem from .token_list_params import TokenListParams as TokenListParams from .invite_edit_params import InviteEditParams as InviteEditParams @@ -24,4 +26,3 @@ from .subscription_update_params import SubscriptionUpdateParams as SubscriptionUpdateParams from .organization_delete_response import OrganizationDeleteResponse as OrganizationDeleteResponse from .subscription_delete_response import SubscriptionDeleteResponse as SubscriptionDeleteResponse -from .policy_with_permission_groups_param import PolicyWithPermissionGroupsParam as PolicyWithPermissionGroupsParam diff --git a/src/cloudflare/types/user/firewall/__init__.py b/src/cloudflare/types/user/firewall/__init__.py index b18b56db6ab..24180bdaf21 100644 --- a/src/cloudflare/types/user/firewall/__init__.py +++ b/src/cloudflare/types/user/firewall/__init__.py @@ -2,9 +2,11 @@ from __future__ import annotations -from .access_rule import AccessRule as AccessRule from .access_rule_edit_params import AccessRuleEditParams as AccessRuleEditParams from .access_rule_list_params import AccessRuleListParams as AccessRuleListParams from .access_rule_create_params import AccessRuleCreateParams as AccessRuleCreateParams from .access_rule_delete_params import AccessRuleDeleteParams as AccessRuleDeleteParams +from .access_rule_edit_response import AccessRuleEditResponse as AccessRuleEditResponse +from .access_rule_list_response import AccessRuleListResponse as AccessRuleListResponse +from .access_rule_create_response import AccessRuleCreateResponse as AccessRuleCreateResponse from .access_rule_delete_response import AccessRuleDeleteResponse as AccessRuleDeleteResponse diff --git a/src/cloudflare/types/user/firewall/access_rule_create_params.py b/src/cloudflare/types/user/firewall/access_rule_create_params.py index 8ea7233a043..d41c682a558 100644 --- a/src/cloudflare/types/user/firewall/access_rule_create_params.py +++ b/src/cloudflare/types/user/firewall/access_rule_create_params.py @@ -8,11 +8,11 @@ __all__ = [ "AccessRuleCreateParams", "Configuration", - "ConfigurationLegacyJhsIPConfiguration", - "ConfigurationLegacyJhsIPV6Configuration", - "ConfigurationLegacyJhsCIDRConfiguration", - "ConfigurationLegacyJhsASNConfiguration", - "ConfigurationLegacyJhsCountryConfiguration", + "ConfigurationFirewallIPConfiguration", + "ConfigurationFirewallIPV6Configuration", + "ConfigurationFirewallCIDRConfiguration", + "ConfigurationFirewallASNConfiguration", + "ConfigurationFirewallCountryConfiguration", ] @@ -29,7 +29,7 @@ class AccessRuleCreateParams(TypedDict, total=False): """ -class ConfigurationLegacyJhsIPConfiguration(TypedDict, total=False): +class ConfigurationFirewallIPConfiguration(TypedDict, total=False): target: Literal["ip"] """The configuration target. @@ -43,7 +43,7 @@ class ConfigurationLegacyJhsIPConfiguration(TypedDict, total=False): """ -class ConfigurationLegacyJhsIPV6Configuration(TypedDict, total=False): +class ConfigurationFirewallIPV6Configuration(TypedDict, total=False): target: Literal["ip6"] """The configuration target. @@ -54,7 +54,7 @@ class ConfigurationLegacyJhsIPV6Configuration(TypedDict, total=False): """The IPv6 address to match.""" -class ConfigurationLegacyJhsCIDRConfiguration(TypedDict, total=False): +class ConfigurationFirewallCIDRConfiguration(TypedDict, total=False): target: Literal["ip_range"] """The configuration target. @@ -70,7 +70,7 @@ class ConfigurationLegacyJhsCIDRConfiguration(TypedDict, total=False): """ -class ConfigurationLegacyJhsASNConfiguration(TypedDict, total=False): +class ConfigurationFirewallASNConfiguration(TypedDict, total=False): target: Literal["asn"] """The configuration target. @@ -82,7 +82,7 @@ class ConfigurationLegacyJhsASNConfiguration(TypedDict, total=False): """The AS number to match.""" -class ConfigurationLegacyJhsCountryConfiguration(TypedDict, total=False): +class ConfigurationFirewallCountryConfiguration(TypedDict, total=False): target: Literal["country"] """The configuration target. @@ -98,9 +98,9 @@ class ConfigurationLegacyJhsCountryConfiguration(TypedDict, total=False): Configuration = Union[ - ConfigurationLegacyJhsIPConfiguration, - ConfigurationLegacyJhsIPV6Configuration, - ConfigurationLegacyJhsCIDRConfiguration, - ConfigurationLegacyJhsASNConfiguration, - ConfigurationLegacyJhsCountryConfiguration, + ConfigurationFirewallIPConfiguration, + ConfigurationFirewallIPV6Configuration, + ConfigurationFirewallCIDRConfiguration, + ConfigurationFirewallASNConfiguration, + ConfigurationFirewallCountryConfiguration, ] diff --git a/src/cloudflare/types/user/firewall/access_rule_create_response.py b/src/cloudflare/types/user/firewall/access_rule_create_response.py new file mode 100644 index 00000000000..43f8d5047f7 --- /dev/null +++ b/src/cloudflare/types/user/firewall/access_rule_create_response.py @@ -0,0 +1,119 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from datetime import datetime +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = [ + "AccessRuleCreateResponse", + "Configuration", + "ConfigurationFirewallIPConfiguration", + "ConfigurationFirewallIPV6Configuration", + "ConfigurationFirewallCIDRConfiguration", + "ConfigurationFirewallASNConfiguration", + "ConfigurationFirewallCountryConfiguration", +] + + +class ConfigurationFirewallIPConfiguration(BaseModel): + target: Optional[Literal["ip"]] = None + """The configuration target. + + You must set the target to `ip` when specifying an IP address in the rule. + """ + + value: Optional[str] = None + """The IP address to match. + + This address will be compared to the IP address of incoming requests. + """ + + +class ConfigurationFirewallIPV6Configuration(BaseModel): + target: Optional[Literal["ip6"]] = None + """The configuration target. + + You must set the target to `ip6` when specifying an IPv6 address in the rule. + """ + + value: Optional[str] = None + """The IPv6 address to match.""" + + +class ConfigurationFirewallCIDRConfiguration(BaseModel): + target: Optional[Literal["ip_range"]] = None + """The configuration target. + + You must set the target to `ip_range` when specifying an IP address range in the + rule. + """ + + value: Optional[str] = None + """The IP address range to match. + + You can only use prefix lengths `/16` and `/24` for IPv4 ranges, and prefix + lengths `/32`, `/48`, and `/64` for IPv6 ranges. + """ + + +class ConfigurationFirewallASNConfiguration(BaseModel): + target: Optional[Literal["asn"]] = None + """The configuration target. + + You must set the target to `asn` when specifying an Autonomous System Number + (ASN) in the rule. + """ + + value: Optional[str] = None + """The AS number to match.""" + + +class ConfigurationFirewallCountryConfiguration(BaseModel): + target: Optional[Literal["country"]] = None + """The configuration target. + + You must set the target to `country` when specifying a country code in the rule. + """ + + value: Optional[str] = None + """The two-letter ISO-3166-1 alpha-2 code to match. + + For more information, refer to + [IP Access rules: Parameters](https://developers.cloudflare.com/waf/tools/ip-access-rules/parameters/#country). + """ + + +Configuration = Union[ + ConfigurationFirewallIPConfiguration, + ConfigurationFirewallIPV6Configuration, + ConfigurationFirewallCIDRConfiguration, + ConfigurationFirewallASNConfiguration, + ConfigurationFirewallCountryConfiguration, +] + + +class AccessRuleCreateResponse(BaseModel): + id: str + """The unique identifier of the IP Access rule.""" + + allowed_modes: List[Literal["block", "challenge", "whitelist", "js_challenge", "managed_challenge"]] + """The available actions that a rule can apply to a matched request.""" + + configuration: Configuration + """The rule configuration.""" + + mode: Literal["block", "challenge", "whitelist", "js_challenge", "managed_challenge"] + """The action to apply to a matched request.""" + + created_on: Optional[datetime] = None + """The timestamp of when the rule was created.""" + + modified_on: Optional[datetime] = None + """The timestamp of when the rule was last modified.""" + + notes: Optional[str] = None + """ + An informative summary of the rule, typically used as a reminder or explanation. + """ diff --git a/src/cloudflare/types/user/firewall/access_rule.py b/src/cloudflare/types/user/firewall/access_rule_edit_response.py similarity index 77% rename from src/cloudflare/types/user/firewall/access_rule.py rename to src/cloudflare/types/user/firewall/access_rule_edit_response.py index 23ce5c90f5b..b3fc8cfa92d 100644 --- a/src/cloudflare/types/user/firewall/access_rule.py +++ b/src/cloudflare/types/user/firewall/access_rule_edit_response.py @@ -7,17 +7,17 @@ from ...._models import BaseModel __all__ = [ - "AccessRule", + "AccessRuleEditResponse", "Configuration", - "ConfigurationLegacyJhsIPConfiguration", - "ConfigurationLegacyJhsIPV6Configuration", - "ConfigurationLegacyJhsCIDRConfiguration", - "ConfigurationLegacyJhsASNConfiguration", - "ConfigurationLegacyJhsCountryConfiguration", + "ConfigurationFirewallIPConfiguration", + "ConfigurationFirewallIPV6Configuration", + "ConfigurationFirewallCIDRConfiguration", + "ConfigurationFirewallASNConfiguration", + "ConfigurationFirewallCountryConfiguration", ] -class ConfigurationLegacyJhsIPConfiguration(BaseModel): +class ConfigurationFirewallIPConfiguration(BaseModel): target: Optional[Literal["ip"]] = None """The configuration target. @@ -31,7 +31,7 @@ class ConfigurationLegacyJhsIPConfiguration(BaseModel): """ -class ConfigurationLegacyJhsIPV6Configuration(BaseModel): +class ConfigurationFirewallIPV6Configuration(BaseModel): target: Optional[Literal["ip6"]] = None """The configuration target. @@ -42,7 +42,7 @@ class ConfigurationLegacyJhsIPV6Configuration(BaseModel): """The IPv6 address to match.""" -class ConfigurationLegacyJhsCIDRConfiguration(BaseModel): +class ConfigurationFirewallCIDRConfiguration(BaseModel): target: Optional[Literal["ip_range"]] = None """The configuration target. @@ -58,7 +58,7 @@ class ConfigurationLegacyJhsCIDRConfiguration(BaseModel): """ -class ConfigurationLegacyJhsASNConfiguration(BaseModel): +class ConfigurationFirewallASNConfiguration(BaseModel): target: Optional[Literal["asn"]] = None """The configuration target. @@ -70,7 +70,7 @@ class ConfigurationLegacyJhsASNConfiguration(BaseModel): """The AS number to match.""" -class ConfigurationLegacyJhsCountryConfiguration(BaseModel): +class ConfigurationFirewallCountryConfiguration(BaseModel): target: Optional[Literal["country"]] = None """The configuration target. @@ -86,15 +86,15 @@ class ConfigurationLegacyJhsCountryConfiguration(BaseModel): Configuration = Union[ - ConfigurationLegacyJhsIPConfiguration, - ConfigurationLegacyJhsIPV6Configuration, - ConfigurationLegacyJhsCIDRConfiguration, - ConfigurationLegacyJhsASNConfiguration, - ConfigurationLegacyJhsCountryConfiguration, + ConfigurationFirewallIPConfiguration, + ConfigurationFirewallIPV6Configuration, + ConfigurationFirewallCIDRConfiguration, + ConfigurationFirewallASNConfiguration, + ConfigurationFirewallCountryConfiguration, ] -class AccessRule(BaseModel): +class AccessRuleEditResponse(BaseModel): id: str """The unique identifier of the IP Access rule.""" diff --git a/src/cloudflare/types/user/firewall/access_rule_list_response.py b/src/cloudflare/types/user/firewall/access_rule_list_response.py new file mode 100644 index 00000000000..14271781c43 --- /dev/null +++ b/src/cloudflare/types/user/firewall/access_rule_list_response.py @@ -0,0 +1,119 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from datetime import datetime +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = [ + "AccessRuleListResponse", + "Configuration", + "ConfigurationFirewallIPConfiguration", + "ConfigurationFirewallIPV6Configuration", + "ConfigurationFirewallCIDRConfiguration", + "ConfigurationFirewallASNConfiguration", + "ConfigurationFirewallCountryConfiguration", +] + + +class ConfigurationFirewallIPConfiguration(BaseModel): + target: Optional[Literal["ip"]] = None + """The configuration target. + + You must set the target to `ip` when specifying an IP address in the rule. + """ + + value: Optional[str] = None + """The IP address to match. + + This address will be compared to the IP address of incoming requests. + """ + + +class ConfigurationFirewallIPV6Configuration(BaseModel): + target: Optional[Literal["ip6"]] = None + """The configuration target. + + You must set the target to `ip6` when specifying an IPv6 address in the rule. + """ + + value: Optional[str] = None + """The IPv6 address to match.""" + + +class ConfigurationFirewallCIDRConfiguration(BaseModel): + target: Optional[Literal["ip_range"]] = None + """The configuration target. + + You must set the target to `ip_range` when specifying an IP address range in the + rule. + """ + + value: Optional[str] = None + """The IP address range to match. + + You can only use prefix lengths `/16` and `/24` for IPv4 ranges, and prefix + lengths `/32`, `/48`, and `/64` for IPv6 ranges. + """ + + +class ConfigurationFirewallASNConfiguration(BaseModel): + target: Optional[Literal["asn"]] = None + """The configuration target. + + You must set the target to `asn` when specifying an Autonomous System Number + (ASN) in the rule. + """ + + value: Optional[str] = None + """The AS number to match.""" + + +class ConfigurationFirewallCountryConfiguration(BaseModel): + target: Optional[Literal["country"]] = None + """The configuration target. + + You must set the target to `country` when specifying a country code in the rule. + """ + + value: Optional[str] = None + """The two-letter ISO-3166-1 alpha-2 code to match. + + For more information, refer to + [IP Access rules: Parameters](https://developers.cloudflare.com/waf/tools/ip-access-rules/parameters/#country). + """ + + +Configuration = Union[ + ConfigurationFirewallIPConfiguration, + ConfigurationFirewallIPV6Configuration, + ConfigurationFirewallCIDRConfiguration, + ConfigurationFirewallASNConfiguration, + ConfigurationFirewallCountryConfiguration, +] + + +class AccessRuleListResponse(BaseModel): + id: str + """The unique identifier of the IP Access rule.""" + + allowed_modes: List[Literal["block", "challenge", "whitelist", "js_challenge", "managed_challenge"]] + """The available actions that a rule can apply to a matched request.""" + + configuration: Configuration + """The rule configuration.""" + + mode: Literal["block", "challenge", "whitelist", "js_challenge", "managed_challenge"] + """The action to apply to a matched request.""" + + created_on: Optional[datetime] = None + """The timestamp of when the rule was created.""" + + modified_on: Optional[datetime] = None + """The timestamp of when the rule was last modified.""" + + notes: Optional[str] = None + """ + An informative summary of the rule, typically used as a reminder or explanation. + """ diff --git a/src/cloudflare/types/user/load_balancers/__init__.py b/src/cloudflare/types/user/load_balancers/__init__.py index d1764e4e11b..07c7f78ad8c 100644 --- a/src/cloudflare/types/user/load_balancers/__init__.py +++ b/src/cloudflare/types/user/load_balancers/__init__.py @@ -4,6 +4,8 @@ from .pool import Pool as Pool from .monitor import Monitor as Monitor +from .preview import Preview as Preview +from .analytics import Analytics as Analytics from .pool_edit_params import PoolEditParams as PoolEditParams from .pool_list_params import PoolListParams as PoolListParams from .pool_create_params import PoolCreateParams as PoolCreateParams @@ -17,7 +19,6 @@ from .monitor_delete_params import MonitorDeleteParams as MonitorDeleteParams from .monitor_update_params import MonitorUpdateParams as MonitorUpdateParams from .pool_preview_response import PoolPreviewResponse as PoolPreviewResponse -from .load_balancing_preview import LoadBalancingPreview as LoadBalancingPreview from .monitor_preview_params import MonitorPreviewParams as MonitorPreviewParams from .monitor_delete_response import MonitorDeleteResponse as MonitorDeleteResponse from .monitor_preview_response import MonitorPreviewResponse as MonitorPreviewResponse diff --git a/src/cloudflare/types/user/load_balancers/analytics/__init__.py b/src/cloudflare/types/user/load_balancers/analytics/__init__.py index 6e17e38c1cd..6767325e064 100644 --- a/src/cloudflare/types/user/load_balancers/analytics/__init__.py +++ b/src/cloudflare/types/user/load_balancers/analytics/__init__.py @@ -2,5 +2,5 @@ from __future__ import annotations +from .analytics import Analytics as Analytics from .event_list_params import EventListParams as EventListParams -from .load_balancing_analytics import LoadBalancingAnalytics as LoadBalancingAnalytics diff --git a/src/cloudflare/types/user/load_balancers/analytics/load_balancing_analytics.py b/src/cloudflare/types/user/load_balancers/analytics/analytics.py similarity index 81% rename from src/cloudflare/types/user/load_balancers/analytics/load_balancing_analytics.py rename to src/cloudflare/types/user/load_balancers/analytics/analytics.py index a1995d5ec68..3fd256d3791 100644 --- a/src/cloudflare/types/user/load_balancers/analytics/load_balancing_analytics.py +++ b/src/cloudflare/types/user/load_balancers/analytics/analytics.py @@ -5,10 +5,10 @@ from ....._models import BaseModel -__all__ = ["LoadBalancingAnalytics"] +__all__ = ["Analytics"] -class LoadBalancingAnalytics(BaseModel): +class Analytics(BaseModel): id: Optional[int] = None origins: Optional[List[object]] = None diff --git a/src/cloudflare/types/user/load_balancers/load_balancing_preview.py b/src/cloudflare/types/user/load_balancers/load_balancing_preview.py deleted file mode 100644 index 6ab9378796f..00000000000 --- a/src/cloudflare/types/user/load_balancers/load_balancing_preview.py +++ /dev/null @@ -1,30 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List, Optional - -from ...._models import BaseModel - -__all__ = [ - "LoadBalancingPreview", - "LoadBalancingPreviewItem", - "LoadBalancingPreviewItemOriginLoadBalancingPreviewItemOriginItem", -] - - -class LoadBalancingPreviewItemOriginLoadBalancingPreviewItemOriginItem(BaseModel): - failure_reason: Optional[str] = None - - healthy: Optional[bool] = None - - response_code: Optional[float] = None - - rtt: Optional[str] = None - - -class LoadBalancingPreviewItem(BaseModel): - healthy: Optional[bool] = None - - origins: Optional[List[Dict[str, LoadBalancingPreviewItemOriginLoadBalancingPreviewItemOriginItem]]] = None - - -LoadBalancingPreview = Dict[str, LoadBalancingPreviewItem] diff --git a/src/cloudflare/types/user/load_balancers/pool.py b/src/cloudflare/types/user/load_balancers/pool.py index c255acf23dd..4083c2a1157 100644 --- a/src/cloudflare/types/user/load_balancers/pool.py +++ b/src/cloudflare/types/user/load_balancers/pool.py @@ -2,10 +2,10 @@ from typing import List, Optional from datetime import datetime -from typing_extensions import Literal from ...origin import Origin from ...._models import BaseModel +from ...check_region import CheckRegion from ...load_shedding import LoadShedding from ...origin_steering import OriginSteering from ...notification_filter import NotificationFilter @@ -16,26 +16,7 @@ class Pool(BaseModel): id: Optional[str] = None - check_regions: Optional[ - List[ - Literal[ - "WNAM", - "ENAM", - "WEU", - "EEU", - "NSAM", - "SSAM", - "OC", - "ME", - "NAF", - "SAF", - "SAS", - "SEAS", - "NEAS", - "ALL_REGIONS", - ] - ] - ] = None + check_regions: Optional[List[CheckRegion]] = None """A list of regions from which to run health checks. Null means every Cloudflare data center. diff --git a/src/cloudflare/types/user/load_balancers/pool_create_params.py b/src/cloudflare/types/user/load_balancers/pool_create_params.py index e3a595de245..a0c396a2c2c 100644 --- a/src/cloudflare/types/user/load_balancers/pool_create_params.py +++ b/src/cloudflare/types/user/load_balancers/pool_create_params.py @@ -3,8 +3,9 @@ from __future__ import annotations from typing import List, Iterable, Optional -from typing_extensions import Literal, Required, TypedDict +from typing_extensions import Required, TypedDict +from ...check_region import CheckRegion from ...origin_param import OriginParam from ...load_shedding_param import LoadSheddingParam from ...origin_steering_param import OriginSteeringParam @@ -27,26 +28,7 @@ class PoolCreateParams(TypedDict, total=False): provided the pool itself is healthy. """ - check_regions: Optional[ - List[ - Literal[ - "WNAM", - "ENAM", - "WEU", - "EEU", - "NSAM", - "SSAM", - "OC", - "ME", - "NAF", - "SAF", - "SAS", - "SEAS", - "NEAS", - "ALL_REGIONS", - ] - ] - ] + check_regions: Optional[List[CheckRegion]] """A list of regions from which to run health checks. Null means every Cloudflare data center. diff --git a/src/cloudflare/types/user/load_balancers/pool_edit_params.py b/src/cloudflare/types/user/load_balancers/pool_edit_params.py index 3109737efa0..68cf3f9eda0 100644 --- a/src/cloudflare/types/user/load_balancers/pool_edit_params.py +++ b/src/cloudflare/types/user/load_balancers/pool_edit_params.py @@ -3,8 +3,9 @@ from __future__ import annotations from typing import List, Iterable, Optional -from typing_extensions import Literal, TypedDict +from typing_extensions import TypedDict +from ...check_region import CheckRegion from ...origin_param import OriginParam from ...load_shedding_param import LoadSheddingParam from ...origin_steering_param import OriginSteeringParam @@ -14,26 +15,7 @@ class PoolEditParams(TypedDict, total=False): - check_regions: Optional[ - List[ - Literal[ - "WNAM", - "ENAM", - "WEU", - "EEU", - "NSAM", - "SSAM", - "OC", - "ME", - "NAF", - "SAF", - "SAS", - "SEAS", - "NEAS", - "ALL_REGIONS", - ] - ] - ] + check_regions: Optional[List[CheckRegion]] """A list of regions from which to run health checks. Null means every Cloudflare data center. diff --git a/src/cloudflare/types/user/load_balancers/pool_update_params.py b/src/cloudflare/types/user/load_balancers/pool_update_params.py index 3d6f82bcd17..0ffbd0a79eb 100644 --- a/src/cloudflare/types/user/load_balancers/pool_update_params.py +++ b/src/cloudflare/types/user/load_balancers/pool_update_params.py @@ -3,8 +3,9 @@ from __future__ import annotations from typing import List, Iterable, Optional -from typing_extensions import Literal, Required, TypedDict +from typing_extensions import Required, TypedDict +from ...check_region import CheckRegion from ...origin_param import OriginParam from ...load_shedding_param import LoadSheddingParam from ...origin_steering_param import OriginSteeringParam @@ -27,26 +28,7 @@ class PoolUpdateParams(TypedDict, total=False): provided the pool itself is healthy. """ - check_regions: Optional[ - List[ - Literal[ - "WNAM", - "ENAM", - "WEU", - "EEU", - "NSAM", - "SSAM", - "OC", - "ME", - "NAF", - "SAF", - "SAS", - "SEAS", - "NEAS", - "ALL_REGIONS", - ] - ] - ] + check_regions: Optional[List[CheckRegion]] """A list of regions from which to run health checks. Null means every Cloudflare data center. diff --git a/src/cloudflare/types/user/load_balancers/preview.py b/src/cloudflare/types/user/load_balancers/preview.py new file mode 100644 index 00000000000..d27357a1346 --- /dev/null +++ b/src/cloudflare/types/user/load_balancers/preview.py @@ -0,0 +1,26 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List, Optional + +from ...._models import BaseModel + +__all__ = ["Preview", "PreviewItem", "PreviewItemOriginPreviewItemOriginItem"] + + +class PreviewItemOriginPreviewItemOriginItem(BaseModel): + failure_reason: Optional[str] = None + + healthy: Optional[bool] = None + + response_code: Optional[float] = None + + rtt: Optional[str] = None + + +class PreviewItem(BaseModel): + healthy: Optional[bool] = None + + origins: Optional[List[Dict[str, PreviewItemOriginPreviewItemOriginItem]]] = None + + +Preview = Dict[str, PreviewItem] diff --git a/src/cloudflare/types/user/organization.py b/src/cloudflare/types/user/organization.py index bd59f71e4b1..5ad136e7c52 100644 --- a/src/cloudflare/types/user/organization.py +++ b/src/cloudflare/types/user/organization.py @@ -3,6 +3,7 @@ from typing import List, Optional from typing_extensions import Literal +from .tokens import PermissionItem from ..._models import BaseModel __all__ = ["Organization"] @@ -15,7 +16,7 @@ class Organization(BaseModel): name: Optional[str] = None """Organization name.""" - permissions: Optional[List[str]] = None + permissions: Optional[List[PermissionItem]] = None """Access permissions for this User.""" roles: Optional[List[str]] = None diff --git a/src/cloudflare/types/user/policy.py b/src/cloudflare/types/user/policy.py new file mode 100644 index 00000000000..02bb3290430 --- /dev/null +++ b/src/cloudflare/types/user/policy.py @@ -0,0 +1,30 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["Policy", "PermissionGroup"] + + +class PermissionGroup(BaseModel): + id: str + """Identifier of the group.""" + + name: Optional[str] = None + """Name of the group.""" + + +class Policy(BaseModel): + id: str + """Policy identifier.""" + + effect: Literal["allow", "deny"] + """Allow or deny operations against the resources.""" + + permission_groups: List[PermissionGroup] + """A set of permission groups that are specified to the policy.""" + + resources: object + """A list of resource names that the policy applies to.""" diff --git a/src/cloudflare/types/user/policy_with_permission_groups_param.py b/src/cloudflare/types/user/policy_param.py similarity index 82% rename from src/cloudflare/types/user/policy_with_permission_groups_param.py rename to src/cloudflare/types/user/policy_param.py index 0d65a08e843..d9f62820fe7 100644 --- a/src/cloudflare/types/user/policy_with_permission_groups_param.py +++ b/src/cloudflare/types/user/policy_param.py @@ -5,14 +5,14 @@ from typing import Iterable from typing_extensions import Literal, Required, TypedDict -__all__ = ["PolicyWithPermissionGroupsParam", "PermissionGroup"] +__all__ = ["PolicyParam", "PermissionGroup"] class PermissionGroup(TypedDict, total=False): pass -class PolicyWithPermissionGroupsParam(TypedDict, total=False): +class PolicyParam(TypedDict, total=False): effect: Required[Literal["allow", "deny"]] """Allow or deny operations against the resources.""" diff --git a/src/cloudflare/types/zones/subscription_list_response.py b/src/cloudflare/types/user/subscription.py similarity index 95% rename from src/cloudflare/types/zones/subscription_list_response.py rename to src/cloudflare/types/user/subscription.py index 7ba0172a53f..ff12f3e5414 100644 --- a/src/cloudflare/types/zones/subscription_list_response.py +++ b/src/cloudflare/types/user/subscription.py @@ -6,7 +6,7 @@ from ..._models import BaseModel -__all__ = ["SubscriptionListResponse", "App", "ComponentValue", "RatePlan", "Zone"] +__all__ = ["Subscription", "App", "ComponentValue", "RatePlan", "Zone"] class App(BaseModel): @@ -59,7 +59,7 @@ class Zone(BaseModel): """The domain name""" -class SubscriptionListResponse(BaseModel): +class Subscription(BaseModel): id: Optional[str] = None """Subscription identifier tag.""" diff --git a/src/cloudflare/types/user/subscription_get_response.py b/src/cloudflare/types/user/subscription_get_response.py index 47a3a862044..fa83d5ed88c 100644 --- a/src/cloudflare/types/user/subscription_get_response.py +++ b/src/cloudflare/types/user/subscription_get_response.py @@ -1,106 +1,9 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional -from datetime import datetime -from typing_extensions import Literal +from typing import List -from ..._models import BaseModel +from .subscription import Subscription -__all__ = [ - "SubscriptionGetResponse", - "SubscriptionGetResponseItem", - "SubscriptionGetResponseItemApp", - "SubscriptionGetResponseItemComponentValue", - "SubscriptionGetResponseItemRatePlan", - "SubscriptionGetResponseItemZone", -] +__all__ = ["SubscriptionGetResponse"] - -class SubscriptionGetResponseItemApp(BaseModel): - install_id: Optional[str] = None - """app install id.""" - - -class SubscriptionGetResponseItemComponentValue(BaseModel): - default: Optional[float] = None - """The default amount assigned.""" - - name: Optional[str] = None - """The name of the component value.""" - - price: Optional[float] = None - """The unit price for the component value.""" - - value: Optional[float] = None - """The amount of the component value assigned.""" - - -class SubscriptionGetResponseItemRatePlan(BaseModel): - id: Optional[str] = None - """The ID of the rate plan.""" - - currency: Optional[str] = None - """The currency applied to the rate plan subscription.""" - - externally_managed: Optional[bool] = None - """Whether this rate plan is managed externally from Cloudflare.""" - - is_contract: Optional[bool] = None - """Whether a rate plan is enterprise-based (or newly adopted term contract).""" - - public_name: Optional[str] = None - """The full name of the rate plan.""" - - scope: Optional[str] = None - """The scope that this rate plan applies to.""" - - sets: Optional[List[str]] = None - """The list of sets this rate plan applies to.""" - - -class SubscriptionGetResponseItemZone(BaseModel): - id: Optional[str] = None - """Identifier""" - - name: Optional[str] = None - """The domain name""" - - -class SubscriptionGetResponseItem(BaseModel): - id: Optional[str] = None - """Subscription identifier tag.""" - - app: Optional[SubscriptionGetResponseItemApp] = None - - component_values: Optional[List[SubscriptionGetResponseItemComponentValue]] = None - """The list of add-ons subscribed to.""" - - currency: Optional[str] = None - """The monetary unit in which pricing information is displayed.""" - - current_period_end: Optional[datetime] = None - """The end of the current period and also when the next billing is due.""" - - current_period_start: Optional[datetime] = None - """When the current billing period started. - - May match initial_period_start if this is the first period. - """ - - frequency: Optional[Literal["weekly", "monthly", "quarterly", "yearly"]] = None - """How often the subscription is renewed automatically.""" - - price: Optional[float] = None - """The price of the subscription that will be billed, in US dollars.""" - - 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[SubscriptionGetResponseItemZone] = None - """A simple zone object. May have null properties if not a zone subscription.""" - - -SubscriptionGetResponse = List[SubscriptionGetResponseItem] +SubscriptionGetResponse = List[Subscription] diff --git a/src/cloudflare/types/user/token_create_params.py b/src/cloudflare/types/user/token_create_params.py index 0b34dbbb206..95f658e91fd 100644 --- a/src/cloudflare/types/user/token_create_params.py +++ b/src/cloudflare/types/user/token_create_params.py @@ -7,8 +7,8 @@ from typing_extensions import Required, Annotated, TypedDict from ..._utils import PropertyInfo +from .policy_param import PolicyParam from .cidr_list_item import CIDRListItem -from .policy_with_permission_groups_param import PolicyWithPermissionGroupsParam __all__ = ["TokenCreateParams", "Condition", "ConditionRequestIP"] @@ -17,7 +17,7 @@ class TokenCreateParams(TypedDict, total=False): name: Required[str] """Token name.""" - policies: Required[Iterable[PolicyWithPermissionGroupsParam]] + policies: Required[Iterable[PolicyParam]] """List of access policies assigned to the token.""" condition: Condition diff --git a/src/cloudflare/types/user/token_create_response.py b/src/cloudflare/types/user/token_create_response.py index 45701a4c3f1..76e11c0f97f 100644 --- a/src/cloudflare/types/user/token_create_response.py +++ b/src/cloudflare/types/user/token_create_response.py @@ -2,12 +2,12 @@ from typing import Optional -from .tokens import TokenValue +from .tokens import Value from ..._models import BaseModel __all__ = ["TokenCreateResponse"] class TokenCreateResponse(BaseModel): - value: Optional[TokenValue] = None + value: Optional[Value] = None """The token value.""" diff --git a/src/cloudflare/types/user/token_update_params.py b/src/cloudflare/types/user/token_update_params.py index dfd5bc0e192..402708cb53e 100644 --- a/src/cloudflare/types/user/token_update_params.py +++ b/src/cloudflare/types/user/token_update_params.py @@ -7,8 +7,8 @@ from typing_extensions import Literal, Required, Annotated, TypedDict from ..._utils import PropertyInfo +from .policy_param import PolicyParam from .cidr_list_item import CIDRListItem -from .policy_with_permission_groups_param import PolicyWithPermissionGroupsParam __all__ = ["TokenUpdateParams", "Condition", "ConditionRequestIP"] @@ -17,7 +17,7 @@ class TokenUpdateParams(TypedDict, total=False): name: Required[str] """Token name.""" - policies: Required[Iterable[PolicyWithPermissionGroupsParam]] + policies: Required[Iterable[PolicyParam]] """List of access policies assigned to the token.""" status: Required[Literal["active", "disabled", "expired"]] diff --git a/src/cloudflare/types/user/tokens/__init__.py b/src/cloudflare/types/user/tokens/__init__.py index 6a39f3034a5..be8d7045793 100644 --- a/src/cloudflare/types/user/tokens/__init__.py +++ b/src/cloudflare/types/user/tokens/__init__.py @@ -2,8 +2,8 @@ from __future__ import annotations +from .value import Value as Value from .permission import Permission as Permission -from .token_value import TokenValue as TokenValue from .permission_item import PermissionItem as PermissionItem from .permission_param import PermissionParam as PermissionParam from .value_update_params import ValueUpdateParams as ValueUpdateParams diff --git a/src/cloudflare/types/user/tokens/value.py b/src/cloudflare/types/user/tokens/value.py new file mode 100644 index 00000000000..669b0678918 --- /dev/null +++ b/src/cloudflare/types/user/tokens/value.py @@ -0,0 +1,6 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +__all__ = ["Value"] + +Value = str diff --git a/src/cloudflare/types/user/user.py b/src/cloudflare/types/user/user.py deleted file mode 100644 index 1e5679f21a7..00000000000 --- a/src/cloudflare/types/user/user.py +++ /dev/null @@ -1,48 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel - -__all__ = ["User"] - - -class User(BaseModel): - address: str - """Address.""" - - city: str - """City.""" - - country: Optional[str] = None - """The country in which the user lives.""" - - first_name: Optional[str] = None - """User's first name""" - - last_name: Optional[str] = None - """User's last name""" - - organization: str - """Name of organization.""" - - phone: Optional[str] = None - """User's telephone number""" - - state: str - """State.""" - - zip: Optional[str] = None - """The zipcode or postal code where the user lives.""" - - id: Optional[str] = None - """Contact Identifier.""" - - address2: Optional[str] = None - """Optional address line for unit, floor, suite, etc.""" - - email: Optional[str] = None - """The contact email address of the user.""" - - fax: Optional[str] = None - """Contact fax number.""" diff --git a/src/cloudflare/types/stream_videos.py b/src/cloudflare/types/video.py similarity index 95% rename from src/cloudflare/types/stream_videos.py rename to src/cloudflare/types/video.py index 681515079c6..2a04b40c33f 100644 --- a/src/cloudflare/types/stream_videos.py +++ b/src/cloudflare/types/video.py @@ -6,10 +6,11 @@ from pydantic import Field as FieldInfo -from .stream import StreamWatermarks +from .stream import Watermaks from .._models import BaseModel +from .allowed_origins_item import AllowedOriginsItem -__all__ = ["StreamVideos", "Input", "Playback", "Status"] +__all__ = ["Video", "Input", "Playback", "Status"] class Input(BaseModel): @@ -60,8 +61,8 @@ class Status(BaseModel): """Specifies the processing status for all quality levels for a video.""" -class StreamVideos(BaseModel): - allowed_origins: Optional[List[str]] = FieldInfo(alias="allowedOrigins", default=None) +class Video(BaseModel): + allowed_origins: Optional[List[AllowedOriginsItem]] = FieldInfo(alias="allowedOrigins", default=None) """Lists the origins allowed to display the video. Enter allowed origin domains in an array and use `*` for wildcard subdomains. @@ -176,4 +177,4 @@ class StreamVideos(BaseModel): uploads. """ - watermark: Optional[StreamWatermarks] = None + watermark: Optional[Watermaks] = None diff --git a/src/cloudflare/types/waiting_room.py b/src/cloudflare/types/waiting_room.py index 574540414ac..dd9fd838b28 100644 --- a/src/cloudflare/types/waiting_room.py +++ b/src/cloudflare/types/waiting_room.py @@ -6,32 +6,15 @@ from .._models import BaseModel from .cookie_attributes import CookieAttributes +from .additional_routes_item import AdditionalRoutesItem -__all__ = ["WaitingRoom", "AdditionalRoute"] - - -class AdditionalRoute(BaseModel): - host: Optional[str] = None - """The hostname to which this waiting room will be applied (no wildcards). - - The hostname must be the primary domain, subdomain, or custom hostname (if using - SSL for SaaS) of this zone. Please do not include the scheme (http:// or - https://). - """ - - path: Optional[str] = None - """Sets the path within the host to enable the waiting room on. - - The waiting room will be enabled for all subpaths as well. If there are two - waiting rooms on the same subpath, the waiting room for the most specific path - will be chosen. Wildcards and query parameters are not supported. - """ +__all__ = ["WaitingRoom"] class WaitingRoom(BaseModel): id: Optional[str] = None - additional_routes: Optional[List[AdditionalRoute]] = None + additional_routes: Optional[List[AdditionalRoutesItem]] = None """Only available for the Waiting Room Advanced subscription. Additional hostname and path combinations to which this waiting room will be diff --git a/src/cloudflare/types/waiting_rooms/__init__.py b/src/cloudflare/types/waiting_rooms/__init__.py index 0381189606a..f38db69334d 100644 --- a/src/cloudflare/types/waiting_rooms/__init__.py +++ b/src/cloudflare/types/waiting_rooms/__init__.py @@ -7,13 +7,15 @@ from .rule_param import RuleParam as RuleParam from .rule_edit_params import RuleEditParams as RuleEditParams from .event_edit_params import EventEditParams as EventEditParams +from .event_get_response import EventGetResponse as EventGetResponse from .rule_create_params import RuleCreateParams as RuleCreateParams from .rule_delete_params import RuleDeleteParams as RuleDeleteParams from .rule_edit_response import RuleEditResponse as RuleEditResponse -from .rule_list_response import RuleListResponse as RuleListResponse from .rule_update_params import RuleUpdateParams as RuleUpdateParams from .event_create_params import EventCreateParams as EventCreateParams from .event_delete_params import EventDeleteParams as EventDeleteParams +from .event_edit_response import EventEditResponse as EventEditResponse +from .event_list_response import EventListResponse as EventListResponse from .event_update_params import EventUpdateParams as EventUpdateParams from .page_preview_params import PagePreviewParams as PagePreviewParams from .setting_edit_params import SettingEditParams as SettingEditParams @@ -22,7 +24,9 @@ from .rule_delete_response import RuleDeleteResponse as RuleDeleteResponse from .rule_update_response import RuleUpdateResponse as RuleUpdateResponse from .setting_get_response import SettingGetResponse as SettingGetResponse +from .event_create_response import EventCreateResponse as EventCreateResponse from .event_delete_response import EventDeleteResponse as EventDeleteResponse +from .event_update_response import EventUpdateResponse as EventUpdateResponse from .page_preview_response import PagePreviewResponse as PagePreviewResponse from .setting_edit_response import SettingEditResponse as SettingEditResponse from .setting_update_params import SettingUpdateParams as SettingUpdateParams diff --git a/src/cloudflare/types/waiting_rooms/event.py b/src/cloudflare/types/waiting_rooms/event.py index 682983566d1..f3da0011a31 100644 --- a/src/cloudflare/types/waiting_rooms/event.py +++ b/src/cloudflare/types/waiting_rooms/event.py @@ -2,6 +2,7 @@ from typing import Optional from datetime import datetime +from typing_extensions import Literal from ..._models import BaseModel @@ -10,88 +11,21 @@ class Event(BaseModel): id: Optional[str] = None + """The ID of the rule.""" - created_on: Optional[datetime] = None - - custom_page_html: Optional[str] = None - """ - If set, the event will override the waiting room's `custom_page_html` property - while it is active. If null, the event will inherit it. - """ + action: Optional[Literal["bypass_waiting_room"]] = None + """The action to take when the expression matches.""" description: Optional[str] = None - """A note that you can use to add more details about the event.""" - - disable_session_renewal: Optional[bool] = None - """ - If set, the event will override the waiting room's `disable_session_renewal` - property while it is active. If null, the event will inherit it. - """ - - event_end_time: Optional[str] = None - """An ISO 8601 timestamp that marks the end of the event.""" - - event_start_time: Optional[str] = None - """An ISO 8601 timestamp that marks the start of the event. - - At this time, queued users will be processed with the event's configuration. The - start time must be at least one minute before `event_end_time`. - """ - - modified_on: Optional[datetime] = None - - name: Optional[str] = None - """A unique name to identify the event. - - Only alphanumeric characters, hyphens and underscores are allowed. - """ - - new_users_per_minute: Optional[int] = None - """ - If set, the event will override the waiting room's `new_users_per_minute` - property while it is active. If null, the event will inherit it. This can only - be set if the event's `total_active_users` property is also set. - """ - - prequeue_start_time: Optional[str] = None - """ - An ISO 8601 timestamp that marks when to begin queueing all users before the - event starts. The prequeue must start at least five minutes before - `event_start_time`. - """ - - queueing_method: Optional[str] = None - """ - If set, the event will override the waiting room's `queueing_method` property - while it is active. If null, the event will inherit it. - """ - - session_duration: Optional[int] = None - """ - If set, the event will override the waiting room's `session_duration` property - while it is active. If null, the event will inherit it. - """ + """The description of the rule.""" - shuffle_at_event_start: Optional[bool] = None - """ - If enabled, users in the prequeue will be shuffled randomly at the - `event_start_time`. Requires that `prequeue_start_time` is not null. This is - useful for situations when many users will join the event prequeue at the same - time and you want to shuffle them to ensure fairness. Naturally, it makes the - most sense to enable this feature when the `queueing_method` during the event - respects ordering such as **fifo**, or else the shuffling may be unnecessary. - """ + enabled: Optional[bool] = None + """When set to true, the rule is enabled.""" - suspended: Optional[bool] = None - """Suspends or allows an event. + expression: Optional[str] = None + """Criteria defining when there is a match for the current rule.""" - If set to `true`, the event is ignored and traffic will be handled based on the - waiting room configuration. - """ + last_updated: Optional[datetime] = None - total_active_users: Optional[int] = None - """ - If set, the event will override the waiting room's `total_active_users` property - while it is active. If null, the event will inherit it. This can only be set if - the event's `new_users_per_minute` property is also set. - """ + version: Optional[str] = None + """The version of the rule.""" diff --git a/src/cloudflare/types/waiting_rooms/event_create_response.py b/src/cloudflare/types/waiting_rooms/event_create_response.py new file mode 100644 index 00000000000..385d39f6b58 --- /dev/null +++ b/src/cloudflare/types/waiting_rooms/event_create_response.py @@ -0,0 +1,97 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime + +from ..._models import BaseModel + +__all__ = ["EventCreateResponse"] + + +class EventCreateResponse(BaseModel): + id: Optional[str] = None + + created_on: Optional[datetime] = None + + custom_page_html: Optional[str] = None + """ + If set, the event will override the waiting room's `custom_page_html` property + while it is active. If null, the event will inherit it. + """ + + description: Optional[str] = None + """A note that you can use to add more details about the event.""" + + disable_session_renewal: Optional[bool] = None + """ + If set, the event will override the waiting room's `disable_session_renewal` + property while it is active. If null, the event will inherit it. + """ + + event_end_time: Optional[str] = None + """An ISO 8601 timestamp that marks the end of the event.""" + + event_start_time: Optional[str] = None + """An ISO 8601 timestamp that marks the start of the event. + + At this time, queued users will be processed with the event's configuration. The + start time must be at least one minute before `event_end_time`. + """ + + modified_on: Optional[datetime] = None + + name: Optional[str] = None + """A unique name to identify the event. + + Only alphanumeric characters, hyphens and underscores are allowed. + """ + + new_users_per_minute: Optional[int] = None + """ + If set, the event will override the waiting room's `new_users_per_minute` + property while it is active. If null, the event will inherit it. This can only + be set if the event's `total_active_users` property is also set. + """ + + prequeue_start_time: Optional[str] = None + """ + An ISO 8601 timestamp that marks when to begin queueing all users before the + event starts. The prequeue must start at least five minutes before + `event_start_time`. + """ + + queueing_method: Optional[str] = None + """ + If set, the event will override the waiting room's `queueing_method` property + while it is active. If null, the event will inherit it. + """ + + session_duration: Optional[int] = None + """ + If set, the event will override the waiting room's `session_duration` property + while it is active. If null, the event will inherit it. + """ + + shuffle_at_event_start: Optional[bool] = None + """ + If enabled, users in the prequeue will be shuffled randomly at the + `event_start_time`. Requires that `prequeue_start_time` is not null. This is + useful for situations when many users will join the event prequeue at the same + time and you want to shuffle them to ensure fairness. Naturally, it makes the + most sense to enable this feature when the `queueing_method` during the event + respects ordering such as **fifo**, or else the shuffling may be unnecessary. + """ + + suspended: Optional[bool] = None + """Suspends or allows an event. + + If set to `true`, the event is ignored and traffic will be handled based on the + waiting room configuration. + """ + + total_active_users: Optional[int] = None + """ + If set, the event will override the waiting room's `total_active_users` property + while it is active. If null, the event will inherit it. This can only be set if + the event's `new_users_per_minute` property is also set. + """ diff --git a/src/cloudflare/types/waiting_rooms/event_edit_response.py b/src/cloudflare/types/waiting_rooms/event_edit_response.py new file mode 100644 index 00000000000..84aa7e40b8c --- /dev/null +++ b/src/cloudflare/types/waiting_rooms/event_edit_response.py @@ -0,0 +1,97 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime + +from ..._models import BaseModel + +__all__ = ["EventEditResponse"] + + +class EventEditResponse(BaseModel): + id: Optional[str] = None + + created_on: Optional[datetime] = None + + custom_page_html: Optional[str] = None + """ + If set, the event will override the waiting room's `custom_page_html` property + while it is active. If null, the event will inherit it. + """ + + description: Optional[str] = None + """A note that you can use to add more details about the event.""" + + disable_session_renewal: Optional[bool] = None + """ + If set, the event will override the waiting room's `disable_session_renewal` + property while it is active. If null, the event will inherit it. + """ + + event_end_time: Optional[str] = None + """An ISO 8601 timestamp that marks the end of the event.""" + + event_start_time: Optional[str] = None + """An ISO 8601 timestamp that marks the start of the event. + + At this time, queued users will be processed with the event's configuration. The + start time must be at least one minute before `event_end_time`. + """ + + modified_on: Optional[datetime] = None + + name: Optional[str] = None + """A unique name to identify the event. + + Only alphanumeric characters, hyphens and underscores are allowed. + """ + + new_users_per_minute: Optional[int] = None + """ + If set, the event will override the waiting room's `new_users_per_minute` + property while it is active. If null, the event will inherit it. This can only + be set if the event's `total_active_users` property is also set. + """ + + prequeue_start_time: Optional[str] = None + """ + An ISO 8601 timestamp that marks when to begin queueing all users before the + event starts. The prequeue must start at least five minutes before + `event_start_time`. + """ + + queueing_method: Optional[str] = None + """ + If set, the event will override the waiting room's `queueing_method` property + while it is active. If null, the event will inherit it. + """ + + session_duration: Optional[int] = None + """ + If set, the event will override the waiting room's `session_duration` property + while it is active. If null, the event will inherit it. + """ + + shuffle_at_event_start: Optional[bool] = None + """ + If enabled, users in the prequeue will be shuffled randomly at the + `event_start_time`. Requires that `prequeue_start_time` is not null. This is + useful for situations when many users will join the event prequeue at the same + time and you want to shuffle them to ensure fairness. Naturally, it makes the + most sense to enable this feature when the `queueing_method` during the event + respects ordering such as **fifo**, or else the shuffling may be unnecessary. + """ + + suspended: Optional[bool] = None + """Suspends or allows an event. + + If set to `true`, the event is ignored and traffic will be handled based on the + waiting room configuration. + """ + + total_active_users: Optional[int] = None + """ + If set, the event will override the waiting room's `total_active_users` property + while it is active. If null, the event will inherit it. This can only be set if + the event's `new_users_per_minute` property is also set. + """ diff --git a/src/cloudflare/types/waiting_rooms/events/event.py b/src/cloudflare/types/waiting_rooms/event_get_response.py similarity index 89% rename from src/cloudflare/types/waiting_rooms/events/event.py rename to src/cloudflare/types/waiting_rooms/event_get_response.py index 8a1ff6eb04e..c40a9b2c1ef 100644 --- a/src/cloudflare/types/waiting_rooms/events/event.py +++ b/src/cloudflare/types/waiting_rooms/event_get_response.py @@ -1,28 +1,17 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Optional +from datetime import datetime -from ...._models import BaseModel +from ..._models import BaseModel -__all__ = ["Event"] +__all__ = ["EventGetResponse"] -class Event(BaseModel): - event_end_time: str - """An ISO 8601 timestamp that marks the end of the event.""" +class EventGetResponse(BaseModel): + id: Optional[str] = None - event_start_time: str - """An ISO 8601 timestamp that marks the start of the event. - - At this time, queued users will be processed with the event's configuration. The - start time must be at least one minute before `event_end_time`. - """ - - name: str - """A unique name to identify the event. - - Only alphanumeric characters, hyphens and underscores are allowed. - """ + created_on: Optional[datetime] = None custom_page_html: Optional[str] = None """ @@ -39,6 +28,24 @@ class Event(BaseModel): property while it is active. If null, the event will inherit it. """ + event_end_time: Optional[str] = None + """An ISO 8601 timestamp that marks the end of the event.""" + + event_start_time: Optional[str] = None + """An ISO 8601 timestamp that marks the start of the event. + + At this time, queued users will be processed with the event's configuration. The + start time must be at least one minute before `event_end_time`. + """ + + modified_on: Optional[datetime] = None + + name: Optional[str] = None + """A unique name to identify the event. + + Only alphanumeric characters, hyphens and underscores are allowed. + """ + new_users_per_minute: Optional[int] = None """ If set, the event will override the waiting room's `new_users_per_minute` diff --git a/src/cloudflare/types/waiting_rooms/event_list_response.py b/src/cloudflare/types/waiting_rooms/event_list_response.py new file mode 100644 index 00000000000..67cf2ead70a --- /dev/null +++ b/src/cloudflare/types/waiting_rooms/event_list_response.py @@ -0,0 +1,97 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime + +from ..._models import BaseModel + +__all__ = ["EventListResponse"] + + +class EventListResponse(BaseModel): + id: Optional[str] = None + + created_on: Optional[datetime] = None + + custom_page_html: Optional[str] = None + """ + If set, the event will override the waiting room's `custom_page_html` property + while it is active. If null, the event will inherit it. + """ + + description: Optional[str] = None + """A note that you can use to add more details about the event.""" + + disable_session_renewal: Optional[bool] = None + """ + If set, the event will override the waiting room's `disable_session_renewal` + property while it is active. If null, the event will inherit it. + """ + + event_end_time: Optional[str] = None + """An ISO 8601 timestamp that marks the end of the event.""" + + event_start_time: Optional[str] = None + """An ISO 8601 timestamp that marks the start of the event. + + At this time, queued users will be processed with the event's configuration. The + start time must be at least one minute before `event_end_time`. + """ + + modified_on: Optional[datetime] = None + + name: Optional[str] = None + """A unique name to identify the event. + + Only alphanumeric characters, hyphens and underscores are allowed. + """ + + new_users_per_minute: Optional[int] = None + """ + If set, the event will override the waiting room's `new_users_per_minute` + property while it is active. If null, the event will inherit it. This can only + be set if the event's `total_active_users` property is also set. + """ + + prequeue_start_time: Optional[str] = None + """ + An ISO 8601 timestamp that marks when to begin queueing all users before the + event starts. The prequeue must start at least five minutes before + `event_start_time`. + """ + + queueing_method: Optional[str] = None + """ + If set, the event will override the waiting room's `queueing_method` property + while it is active. If null, the event will inherit it. + """ + + session_duration: Optional[int] = None + """ + If set, the event will override the waiting room's `session_duration` property + while it is active. If null, the event will inherit it. + """ + + shuffle_at_event_start: Optional[bool] = None + """ + If enabled, users in the prequeue will be shuffled randomly at the + `event_start_time`. Requires that `prequeue_start_time` is not null. This is + useful for situations when many users will join the event prequeue at the same + time and you want to shuffle them to ensure fairness. Naturally, it makes the + most sense to enable this feature when the `queueing_method` during the event + respects ordering such as **fifo**, or else the shuffling may be unnecessary. + """ + + suspended: Optional[bool] = None + """Suspends or allows an event. + + If set to `true`, the event is ignored and traffic will be handled based on the + waiting room configuration. + """ + + total_active_users: Optional[int] = None + """ + If set, the event will override the waiting room's `total_active_users` property + while it is active. If null, the event will inherit it. This can only be set if + the event's `new_users_per_minute` property is also set. + """ diff --git a/src/cloudflare/types/waiting_rooms/event_update_response.py b/src/cloudflare/types/waiting_rooms/event_update_response.py new file mode 100644 index 00000000000..8f8da933825 --- /dev/null +++ b/src/cloudflare/types/waiting_rooms/event_update_response.py @@ -0,0 +1,97 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime + +from ..._models import BaseModel + +__all__ = ["EventUpdateResponse"] + + +class EventUpdateResponse(BaseModel): + id: Optional[str] = None + + created_on: Optional[datetime] = None + + custom_page_html: Optional[str] = None + """ + If set, the event will override the waiting room's `custom_page_html` property + while it is active. If null, the event will inherit it. + """ + + description: Optional[str] = None + """A note that you can use to add more details about the event.""" + + disable_session_renewal: Optional[bool] = None + """ + If set, the event will override the waiting room's `disable_session_renewal` + property while it is active. If null, the event will inherit it. + """ + + event_end_time: Optional[str] = None + """An ISO 8601 timestamp that marks the end of the event.""" + + event_start_time: Optional[str] = None + """An ISO 8601 timestamp that marks the start of the event. + + At this time, queued users will be processed with the event's configuration. The + start time must be at least one minute before `event_end_time`. + """ + + modified_on: Optional[datetime] = None + + name: Optional[str] = None + """A unique name to identify the event. + + Only alphanumeric characters, hyphens and underscores are allowed. + """ + + new_users_per_minute: Optional[int] = None + """ + If set, the event will override the waiting room's `new_users_per_minute` + property while it is active. If null, the event will inherit it. This can only + be set if the event's `total_active_users` property is also set. + """ + + prequeue_start_time: Optional[str] = None + """ + An ISO 8601 timestamp that marks when to begin queueing all users before the + event starts. The prequeue must start at least five minutes before + `event_start_time`. + """ + + queueing_method: Optional[str] = None + """ + If set, the event will override the waiting room's `queueing_method` property + while it is active. If null, the event will inherit it. + """ + + session_duration: Optional[int] = None + """ + If set, the event will override the waiting room's `session_duration` property + while it is active. If null, the event will inherit it. + """ + + shuffle_at_event_start: Optional[bool] = None + """ + If enabled, users in the prequeue will be shuffled randomly at the + `event_start_time`. Requires that `prequeue_start_time` is not null. This is + useful for situations when many users will join the event prequeue at the same + time and you want to shuffle them to ensure fairness. Naturally, it makes the + most sense to enable this feature when the `queueing_method` during the event + respects ordering such as **fifo**, or else the shuffling may be unnecessary. + """ + + suspended: Optional[bool] = None + """Suspends or allows an event. + + If set to `true`, the event is ignored and traffic will be handled based on the + waiting room configuration. + """ + + total_active_users: Optional[int] = None + """ + If set, the event will override the waiting room's `total_active_users` property + while it is active. If null, the event will inherit it. This can only be set if + the event's `new_users_per_minute` property is also set. + """ diff --git a/src/cloudflare/types/waiting_rooms/events/__init__.py b/src/cloudflare/types/waiting_rooms/events/__init__.py index fe074ed5341..4c6d7381f8d 100644 --- a/src/cloudflare/types/waiting_rooms/events/__init__.py +++ b/src/cloudflare/types/waiting_rooms/events/__init__.py @@ -2,5 +2,4 @@ from __future__ import annotations -from .event import Event as Event from .detail_get_response import DetailGetResponse as DetailGetResponse diff --git a/src/cloudflare/types/waiting_rooms/rule_create_response.py b/src/cloudflare/types/waiting_rooms/rule_create_response.py index 481b76abb1a..9fa5f472dbc 100644 --- a/src/cloudflare/types/waiting_rooms/rule_create_response.py +++ b/src/cloudflare/types/waiting_rooms/rule_create_response.py @@ -1,34 +1,9 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional -from datetime import datetime -from typing_extensions import Literal +from typing import List -from ..._models import BaseModel +from .event import Event -__all__ = ["RuleCreateResponse", "RuleCreateResponseItem"] +__all__ = ["RuleCreateResponse"] - -class RuleCreateResponseItem(BaseModel): - id: Optional[str] = None - """The ID of the rule.""" - - action: Optional[Literal["bypass_waiting_room"]] = None - """The action to take when the expression matches.""" - - description: Optional[str] = None - """The description of the rule.""" - - enabled: Optional[bool] = None - """When set to true, the rule is enabled.""" - - expression: Optional[str] = None - """Criteria defining when there is a match for the current rule.""" - - last_updated: Optional[datetime] = None - - version: Optional[str] = None - """The version of the rule.""" - - -RuleCreateResponse = List[RuleCreateResponseItem] +RuleCreateResponse = List[Event] diff --git a/src/cloudflare/types/waiting_rooms/rule_delete_response.py b/src/cloudflare/types/waiting_rooms/rule_delete_response.py index 42a598aa3a5..4230f2a0bda 100644 --- a/src/cloudflare/types/waiting_rooms/rule_delete_response.py +++ b/src/cloudflare/types/waiting_rooms/rule_delete_response.py @@ -1,34 +1,9 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional -from datetime import datetime -from typing_extensions import Literal +from typing import List -from ..._models import BaseModel +from .event import Event -__all__ = ["RuleDeleteResponse", "RuleDeleteResponseItem"] +__all__ = ["RuleDeleteResponse"] - -class RuleDeleteResponseItem(BaseModel): - id: Optional[str] = None - """The ID of the rule.""" - - action: Optional[Literal["bypass_waiting_room"]] = None - """The action to take when the expression matches.""" - - description: Optional[str] = None - """The description of the rule.""" - - enabled: Optional[bool] = None - """When set to true, the rule is enabled.""" - - expression: Optional[str] = None - """Criteria defining when there is a match for the current rule.""" - - last_updated: Optional[datetime] = None - - version: Optional[str] = None - """The version of the rule.""" - - -RuleDeleteResponse = List[RuleDeleteResponseItem] +RuleDeleteResponse = List[Event] diff --git a/src/cloudflare/types/waiting_rooms/rule_edit_response.py b/src/cloudflare/types/waiting_rooms/rule_edit_response.py index 3ab561a4f99..827278cad83 100644 --- a/src/cloudflare/types/waiting_rooms/rule_edit_response.py +++ b/src/cloudflare/types/waiting_rooms/rule_edit_response.py @@ -1,34 +1,9 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional -from datetime import datetime -from typing_extensions import Literal +from typing import List -from ..._models import BaseModel +from .event import Event -__all__ = ["RuleEditResponse", "RuleEditResponseItem"] +__all__ = ["RuleEditResponse"] - -class RuleEditResponseItem(BaseModel): - id: Optional[str] = None - """The ID of the rule.""" - - action: Optional[Literal["bypass_waiting_room"]] = None - """The action to take when the expression matches.""" - - description: Optional[str] = None - """The description of the rule.""" - - enabled: Optional[bool] = None - """When set to true, the rule is enabled.""" - - expression: Optional[str] = None - """Criteria defining when there is a match for the current rule.""" - - last_updated: Optional[datetime] = None - - version: Optional[str] = None - """The version of the rule.""" - - -RuleEditResponse = List[RuleEditResponseItem] +RuleEditResponse = List[Event] diff --git a/src/cloudflare/types/waiting_rooms/rule_list_response.py b/src/cloudflare/types/waiting_rooms/rule_list_response.py deleted file mode 100644 index d2a4643ee0e..00000000000 --- a/src/cloudflare/types/waiting_rooms/rule_list_response.py +++ /dev/null @@ -1,31 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional -from datetime import datetime -from typing_extensions import Literal - -from ..._models import BaseModel - -__all__ = ["RuleListResponse"] - - -class RuleListResponse(BaseModel): - id: Optional[str] = None - """The ID of the rule.""" - - action: Optional[Literal["bypass_waiting_room"]] = None - """The action to take when the expression matches.""" - - description: Optional[str] = None - """The description of the rule.""" - - enabled: Optional[bool] = None - """When set to true, the rule is enabled.""" - - expression: Optional[str] = None - """Criteria defining when there is a match for the current rule.""" - - last_updated: Optional[datetime] = None - - version: Optional[str] = None - """The version of the rule.""" diff --git a/src/cloudflare/types/waiting_rooms/rule_update_response.py b/src/cloudflare/types/waiting_rooms/rule_update_response.py index b67448b030f..7ff4ca9be17 100644 --- a/src/cloudflare/types/waiting_rooms/rule_update_response.py +++ b/src/cloudflare/types/waiting_rooms/rule_update_response.py @@ -1,34 +1,9 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional -from datetime import datetime -from typing_extensions import Literal +from typing import List -from ..._models import BaseModel +from .event import Event -__all__ = ["RuleUpdateResponse", "RuleUpdateResponseItem"] +__all__ = ["RuleUpdateResponse"] - -class RuleUpdateResponseItem(BaseModel): - id: Optional[str] = None - """The ID of the rule.""" - - action: Optional[Literal["bypass_waiting_room"]] = None - """The action to take when the expression matches.""" - - description: Optional[str] = None - """The description of the rule.""" - - enabled: Optional[bool] = None - """When set to true, the rule is enabled.""" - - expression: Optional[str] = None - """Criteria defining when there is a match for the current rule.""" - - last_updated: Optional[datetime] = None - - version: Optional[str] = None - """The version of the rule.""" - - -RuleUpdateResponse = List[RuleUpdateResponseItem] +RuleUpdateResponse = List[Event] diff --git a/src/cloudflare/types/web3/__init__.py b/src/cloudflare/types/web3/__init__.py index e294b32b9f0..4cf398f3222 100644 --- a/src/cloudflare/types/web3/__init__.py +++ b/src/cloudflare/types/web3/__init__.py @@ -2,8 +2,9 @@ from __future__ import annotations +from .hostname import Hostname as Hostname +from .hostname_param import HostnameParam as HostnameParam from .hostname_edit_params import HostnameEditParams as HostnameEditParams from .hostname_create_params import HostnameCreateParams as HostnameCreateParams from .hostname_delete_params import HostnameDeleteParams as HostnameDeleteParams -from .distributed_web_hostname import DistributedWebHostname as DistributedWebHostname from .hostname_delete_response import HostnameDeleteResponse as HostnameDeleteResponse diff --git a/src/cloudflare/types/web3/distributed_web_hostname.py b/src/cloudflare/types/web3/hostname.py similarity index 91% rename from src/cloudflare/types/web3/distributed_web_hostname.py rename to src/cloudflare/types/web3/hostname.py index b52e645215e..befb6b79bf1 100644 --- a/src/cloudflare/types/web3/distributed_web_hostname.py +++ b/src/cloudflare/types/web3/hostname.py @@ -6,10 +6,10 @@ from ..._models import BaseModel -__all__ = ["DistributedWebHostname"] +__all__ = ["Hostname"] -class DistributedWebHostname(BaseModel): +class Hostname(BaseModel): id: Optional[str] = None """Identifier""" diff --git a/src/cloudflare/types/web3/hostname_param.py b/src/cloudflare/types/web3/hostname_param.py new file mode 100644 index 00000000000..87d4041607d --- /dev/null +++ b/src/cloudflare/types/web3/hostname_param.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, TypedDict + +__all__ = ["HostnameParam"] + + +class HostnameParam(TypedDict, total=False): + description: str + """An optional description of the hostname.""" + + dnslink: str + """DNSLink value used if the target is ipfs.""" + + target: Literal["ethereum", "ipfs", "ipfs_universal_path"] + """Target gateway of the hostname.""" 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 d04e7354b66..c97af8e9619 100644 --- a/src/cloudflare/types/web3/hostnames/ipfs_universal_paths/__init__.py +++ b/src/cloudflare/types/web3/hostnames/ipfs_universal_paths/__init__.py @@ -2,5 +2,5 @@ from __future__ import annotations +from .content_list import ContentList as ContentList from .content_list_update_params import ContentListUpdateParams as ContentListUpdateParams -from .distributed_web_config_content_list import DistributedWebConfigContentList as DistributedWebConfigContentList diff --git a/src/cloudflare/types/web3/hostnames/ipfs_universal_paths/distributed_web_config_content_list.py b/src/cloudflare/types/web3/hostnames/ipfs_universal_paths/content_list.py similarity index 74% rename from src/cloudflare/types/web3/hostnames/ipfs_universal_paths/distributed_web_config_content_list.py rename to src/cloudflare/types/web3/hostnames/ipfs_universal_paths/content_list.py index 8151db7cbce..3585768a617 100644 --- a/src/cloudflare/types/web3/hostnames/ipfs_universal_paths/distributed_web_config_content_list.py +++ b/src/cloudflare/types/web3/hostnames/ipfs_universal_paths/content_list.py @@ -5,9 +5,9 @@ from ....._models import BaseModel -__all__ = ["DistributedWebConfigContentList"] +__all__ = ["ContentList"] -class DistributedWebConfigContentList(BaseModel): +class ContentList(BaseModel): action: Optional[Literal["block"]] = None """Behavior of the content list.""" diff --git a/src/cloudflare/types/web3/hostnames/ipfs_universal_paths/content_list_update_params.py b/src/cloudflare/types/web3/hostnames/ipfs_universal_paths/content_list_update_params.py index 3f3fa96834b..75195b864c7 100644 --- a/src/cloudflare/types/web3/hostnames/ipfs_universal_paths/content_list_update_params.py +++ b/src/cloudflare/types/web3/hostnames/ipfs_universal_paths/content_list_update_params.py @@ -5,7 +5,7 @@ from typing import Iterable from typing_extensions import Literal, Required, TypedDict -from .content_lists import DistributedWebConfigContentListEntryParam +from .content_lists import ContentListItemParam __all__ = ["ContentListUpdateParams"] @@ -17,5 +17,5 @@ class ContentListUpdateParams(TypedDict, total=False): action: Required[Literal["block"]] """Behavior of the content list.""" - entries: Required[Iterable[DistributedWebConfigContentListEntryParam]] + entries: Required[Iterable[ContentListItemParam]] """Content list entries.""" diff --git a/src/cloudflare/types/web3/hostnames/ipfs_universal_paths/content_lists/__init__.py b/src/cloudflare/types/web3/hostnames/ipfs_universal_paths/content_lists/__init__.py index 5590670fe32..781081f6147 100644 --- a/src/cloudflare/types/web3/hostnames/ipfs_universal_paths/content_lists/__init__.py +++ b/src/cloudflare/types/web3/hostnames/ipfs_universal_paths/content_lists/__init__.py @@ -2,14 +2,10 @@ from __future__ import annotations +from .content_list_item import ContentListItem as ContentListItem from .entry_create_params import EntryCreateParams as EntryCreateParams from .entry_delete_params import EntryDeleteParams as EntryDeleteParams from .entry_list_response import EntryListResponse as EntryListResponse from .entry_update_params import EntryUpdateParams as EntryUpdateParams from .entry_delete_response import EntryDeleteResponse as EntryDeleteResponse -from .distributed_web_config_content_list_entry import ( - DistributedWebConfigContentListEntry as DistributedWebConfigContentListEntry, -) -from .distributed_web_config_content_list_entry_param import ( - DistributedWebConfigContentListEntryParam as DistributedWebConfigContentListEntryParam, -) +from .content_list_item_param import ContentListItemParam as ContentListItemParam diff --git a/src/cloudflare/types/web3/hostnames/ipfs_universal_paths/content_lists/distributed_web_config_content_list_entry.py b/src/cloudflare/types/web3/hostnames/ipfs_universal_paths/content_lists/content_list_item.py similarity index 86% rename from src/cloudflare/types/web3/hostnames/ipfs_universal_paths/content_lists/distributed_web_config_content_list_entry.py rename to src/cloudflare/types/web3/hostnames/ipfs_universal_paths/content_lists/content_list_item.py index c5fce5cb602..1a9c89f76f2 100644 --- a/src/cloudflare/types/web3/hostnames/ipfs_universal_paths/content_lists/distributed_web_config_content_list_entry.py +++ b/src/cloudflare/types/web3/hostnames/ipfs_universal_paths/content_lists/content_list_item.py @@ -6,10 +6,10 @@ from ......_models import BaseModel -__all__ = ["DistributedWebConfigContentListEntry"] +__all__ = ["ContentListItem"] -class DistributedWebConfigContentListEntry(BaseModel): +class ContentListItem(BaseModel): id: Optional[str] = None """Identifier""" diff --git a/src/cloudflare/types/web3/hostnames/ipfs_universal_paths/content_lists/distributed_web_config_content_list_entry_param.py b/src/cloudflare/types/web3/hostnames/ipfs_universal_paths/content_lists/content_list_item_param.py similarity index 76% rename from src/cloudflare/types/web3/hostnames/ipfs_universal_paths/content_lists/distributed_web_config_content_list_entry_param.py rename to src/cloudflare/types/web3/hostnames/ipfs_universal_paths/content_lists/content_list_item_param.py index 807e005c31a..a5b808d4ac6 100644 --- a/src/cloudflare/types/web3/hostnames/ipfs_universal_paths/content_lists/distributed_web_config_content_list_entry_param.py +++ b/src/cloudflare/types/web3/hostnames/ipfs_universal_paths/content_lists/content_list_item_param.py @@ -4,10 +4,10 @@ from typing_extensions import Literal, TypedDict -__all__ = ["DistributedWebConfigContentListEntryParam"] +__all__ = ["ContentListItemParam"] -class DistributedWebConfigContentListEntryParam(TypedDict, total=False): +class ContentListItemParam(TypedDict, total=False): content: str """CID or content path of content to block.""" diff --git a/src/cloudflare/types/web3/hostnames/ipfs_universal_paths/content_lists/entry_list_response.py b/src/cloudflare/types/web3/hostnames/ipfs_universal_paths/content_lists/entry_list_response.py index d7b9953cb39..17a8a282add 100644 --- a/src/cloudflare/types/web3/hostnames/ipfs_universal_paths/content_lists/entry_list_response.py +++ b/src/cloudflare/types/web3/hostnames/ipfs_universal_paths/content_lists/entry_list_response.py @@ -3,11 +3,11 @@ from typing import List, Optional from ......_models import BaseModel -from .distributed_web_config_content_list_entry import DistributedWebConfigContentListEntry +from .content_list_item import ContentListItem __all__ = ["EntryListResponse"] class EntryListResponse(BaseModel): - entries: Optional[List[DistributedWebConfigContentListEntry]] = None + entries: Optional[List[ContentListItem]] = None """Content list entries.""" diff --git a/src/cloudflare/types/workers/__init__.py b/src/cloudflare/types/workers/__init__.py index 94b18cb6c48..97684f47af7 100644 --- a/src/cloudflare/types/workers/__init__.py +++ b/src/cloudflare/types/workers/__init__.py @@ -2,25 +2,24 @@ from __future__ import annotations +from .domain import Domain as Domain from .script import Script as Script -from .setting import Setting as Setting from .ai_run_params import AIRunParams as AIRunParams -from .settings_item import SettingsItem as SettingsItem from .workers_route import WorkersRoute as WorkersRoute -from .workers_domain import WorkersDomain as WorkersDomain +from .script_setting import ScriptSetting as ScriptSetting from .workers_filter import WorkersFilter as WorkersFilter from .ai_run_response import AIRunResponse as AIRunResponse from .domain_list_params import DomainListParams as DomainListParams from .route_create_params import RouteCreateParams as RouteCreateParams from .route_delete_params import RouteDeleteParams as RouteDeleteParams from .route_update_params import RouteUpdateParams as RouteUpdateParams -from .settings_item_param import SettingsItemParam as SettingsItemParam from .domain_delete_params import DomainDeleteParams as DomainDeleteParams from .domain_update_params import DomainUpdateParams as DomainUpdateParams from .filter_create_params import FilterCreateParams as FilterCreateParams from .filter_delete_params import FilterDeleteParams as FilterDeleteParams from .filter_update_params import FilterUpdateParams as FilterUpdateParams from .script_delete_params import ScriptDeleteParams as ScriptDeleteParams +from .script_setting_param import ScriptSettingParam as ScriptSettingParam from .script_update_params import ScriptUpdateParams as ScriptUpdateParams from .filter_create_response import FilterCreateResponse as FilterCreateResponse from .filter_delete_response import FilterDeleteResponse as FilterDeleteResponse diff --git a/src/cloudflare/types/workers/workers_domain.py b/src/cloudflare/types/workers/domain.py similarity index 91% rename from src/cloudflare/types/workers/workers_domain.py rename to src/cloudflare/types/workers/domain.py index aded9cc334d..81b1799627b 100644 --- a/src/cloudflare/types/workers/workers_domain.py +++ b/src/cloudflare/types/workers/domain.py @@ -4,10 +4,10 @@ from ..._models import BaseModel -__all__ = ["WorkersDomain"] +__all__ = ["Domain"] -class WorkersDomain(BaseModel): +class Domain(BaseModel): id: Optional[str] = None """Identifer of the Worker Domain.""" diff --git a/src/cloudflare/types/workers/script.py b/src/cloudflare/types/workers/script.py index 38b5900c4b9..e49f44402ba 100644 --- a/src/cloudflare/types/workers/script.py +++ b/src/cloudflare/types/workers/script.py @@ -3,7 +3,7 @@ from typing import List, Optional from datetime import datetime -from .scripts import ConsumerScript +from .scripts import ConsumerScriptItem from ..._models import BaseModel __all__ = ["Script"] @@ -31,7 +31,7 @@ class Script(BaseModel): placement_mode: Optional[str] = None """Specifies the placement mode for the Worker (e.g. 'smart').""" - tail_consumers: Optional[List[ConsumerScript]] = None + tail_consumers: Optional[List[ConsumerScriptItem]] = None """List of Workers that will consume logs from the attached Worker.""" usage_model: Optional[str] = None diff --git a/src/cloudflare/types/workers/settings_item.py b/src/cloudflare/types/workers/script_setting.py similarity index 66% rename from src/cloudflare/types/workers/settings_item.py rename to src/cloudflare/types/workers/script_setting.py index f798b9de67e..85ca6ac51fa 100644 --- a/src/cloudflare/types/workers/settings_item.py +++ b/src/cloudflare/types/workers/script_setting.py @@ -2,15 +2,15 @@ from typing import List, Optional -from .scripts import ConsumerScript +from .scripts import ConsumerScriptItem from ..._models import BaseModel -__all__ = ["SettingsItem"] +__all__ = ["ScriptSetting"] -class SettingsItem(BaseModel): +class ScriptSetting(BaseModel): logpush: Optional[bool] = None """Whether Logpush is turned on for the Worker.""" - tail_consumers: Optional[List[ConsumerScript]] = None + tail_consumers: Optional[List[ConsumerScriptItem]] = None """List of Workers that will consume logs from the attached Worker.""" diff --git a/src/cloudflare/types/workers/settings_item_param.py b/src/cloudflare/types/workers/script_setting_param.py similarity index 65% rename from src/cloudflare/types/workers/settings_item_param.py rename to src/cloudflare/types/workers/script_setting_param.py index 87d82fc1842..790a7cad8c4 100644 --- a/src/cloudflare/types/workers/settings_item_param.py +++ b/src/cloudflare/types/workers/script_setting_param.py @@ -5,14 +5,14 @@ from typing import Iterable from typing_extensions import TypedDict -from .scripts import ConsumerScriptParam +from .scripts import ConsumerScriptItemParam -__all__ = ["SettingsItemParam"] +__all__ = ["ScriptSettingParam"] -class SettingsItemParam(TypedDict, total=False): +class ScriptSettingParam(TypedDict, total=False): logpush: bool """Whether Logpush is turned on for the Worker.""" - tail_consumers: Iterable[ConsumerScriptParam] + tail_consumers: Iterable[ConsumerScriptItemParam] """List of Workers that will consume logs from the attached Worker.""" diff --git a/src/cloudflare/types/workers/script_update_params.py b/src/cloudflare/types/workers/script_update_params.py index 502f9da812e..f5cc4959ec7 100644 --- a/src/cloudflare/types/workers/script_update_params.py +++ b/src/cloudflare/types/workers/script_update_params.py @@ -5,7 +5,7 @@ from typing import List, Union, Iterable from typing_extensions import Literal, Required, Annotated, TypedDict -from .scripts import ConsumerScriptParam +from .scripts import ConsumerScriptItemParam from ..._types import FileTypes from ..._utils import PropertyInfo from ..stepped_migration_param import SteppedMigrationParam @@ -87,7 +87,7 @@ class Variant0Metadata(TypedDict, total=False): tags: List[str] """List of strings to use as tags for this Worker""" - tail_consumers: Iterable[ConsumerScriptParam] + tail_consumers: Iterable[ConsumerScriptItemParam] """List of Workers that will consume logs from the attached Worker.""" usage_model: Literal["bundled", "unbound"] diff --git a/src/cloudflare/types/workers/scripts/__init__.py b/src/cloudflare/types/workers/scripts/__init__.py index ea8837be490..55140974d38 100644 --- a/src/cloudflare/types/workers/scripts/__init__.py +++ b/src/cloudflare/types/workers/scripts/__init__.py @@ -2,16 +2,14 @@ from __future__ import annotations -from .consumer_script import ConsumerScript as ConsumerScript -from .workers_binding import WorkersBinding as WorkersBinding from .tail_get_response import TailGetResponse as TailGetResponse from .tail_create_params import TailCreateParams as TailCreateParams from .tail_delete_params import TailDeleteParams as TailDeleteParams from .setting_edit_params import SettingEditParams as SettingEditParams from .binding_get_response import BindingGetResponse as BindingGetResponse +from .consumer_script_item import ConsumerScriptItem as ConsumerScriptItem from .tail_create_response import TailCreateResponse as TailCreateResponse from .version_get_response import VersionGetResponse as VersionGetResponse -from .consumer_script_param import ConsumerScriptParam as ConsumerScriptParam from .content_update_params import ContentUpdateParams as ContentUpdateParams from .schedule_get_response import ScheduleGetResponse as ScheduleGetResponse from .version_create_params import VersionCreateParams as VersionCreateParams @@ -23,6 +21,7 @@ from .schedule_update_response import ScheduleUpdateResponse as ScheduleUpdateResponse from .usage_model_get_response import UsageModelGetResponse as UsageModelGetResponse from .usage_model_update_params import UsageModelUpdateParams as UsageModelUpdateParams +from .consumer_script_item_param import ConsumerScriptItemParam as ConsumerScriptItemParam from .deployment_create_response import DeploymentCreateResponse as DeploymentCreateResponse from .usage_model_update_response import UsageModelUpdateResponse as UsageModelUpdateResponse from .unnamed_schema_ref_c8302c265937f9d6f96fd69644e56b26 import ( diff --git a/src/cloudflare/types/workers/scripts/binding_get_response.py b/src/cloudflare/types/workers/scripts/binding_get_response.py index 92532801f20..8189c3af54d 100644 --- a/src/cloudflare/types/workers/scripts/binding_get_response.py +++ b/src/cloudflare/types/workers/scripts/binding_get_response.py @@ -1,9 +1,22 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List +from typing import List, Union +from typing_extensions import Literal -from .workers_binding import WorkersBinding +from ...._models import BaseModel +from ...kv_namespace_binding import KVNamespaceBinding -__all__ = ["BindingGetResponse"] +__all__ = ["BindingGetResponse", "BindingGetResponseItem", "BindingGetResponseItemWorkersWasmModuleBinding"] -BindingGetResponse = List[WorkersBinding] + +class BindingGetResponseItemWorkersWasmModuleBinding(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + type: Literal["wasm_module"] + """The class of resource that the binding provides.""" + + +BindingGetResponseItem = Union[KVNamespaceBinding, BindingGetResponseItemWorkersWasmModuleBinding] + +BindingGetResponse = List[BindingGetResponseItem] diff --git a/src/cloudflare/types/workers/scripts/consumer_script.py b/src/cloudflare/types/workers/scripts/consumer_script_item.py similarity index 85% rename from src/cloudflare/types/workers/scripts/consumer_script.py rename to src/cloudflare/types/workers/scripts/consumer_script_item.py index 6d933e952fc..0ad5dc53f56 100644 --- a/src/cloudflare/types/workers/scripts/consumer_script.py +++ b/src/cloudflare/types/workers/scripts/consumer_script_item.py @@ -4,10 +4,10 @@ from ...._models import BaseModel -__all__ = ["ConsumerScript"] +__all__ = ["ConsumerScriptItem"] -class ConsumerScript(BaseModel): +class ConsumerScriptItem(BaseModel): service: str """Name of Worker that is to be the consumer.""" diff --git a/src/cloudflare/types/workers/scripts/consumer_script_param.py b/src/cloudflare/types/workers/scripts/consumer_script_item_param.py similarity index 81% rename from src/cloudflare/types/workers/scripts/consumer_script_param.py rename to src/cloudflare/types/workers/scripts/consumer_script_item_param.py index 2d7996c8449..8ad0a20af42 100644 --- a/src/cloudflare/types/workers/scripts/consumer_script_param.py +++ b/src/cloudflare/types/workers/scripts/consumer_script_item_param.py @@ -4,10 +4,10 @@ from typing_extensions import Required, TypedDict -__all__ = ["ConsumerScriptParam"] +__all__ = ["ConsumerScriptItemParam"] -class ConsumerScriptParam(TypedDict, total=False): +class ConsumerScriptItemParam(TypedDict, total=False): service: Required[str] """Name of Worker that is to be the consumer.""" diff --git a/src/cloudflare/types/workers/scripts/setting_edit_params.py b/src/cloudflare/types/workers/scripts/setting_edit_params.py index 760ce3ac226..0911829f7e2 100644 --- a/src/cloudflare/types/workers/scripts/setting_edit_params.py +++ b/src/cloudflare/types/workers/scripts/setting_edit_params.py @@ -5,7 +5,7 @@ from typing import Iterable from typing_extensions import Required, TypedDict -from .consumer_script_param import ConsumerScriptParam +from .consumer_script_item_param import ConsumerScriptItemParam __all__ = ["SettingEditParams"] @@ -17,5 +17,5 @@ class SettingEditParams(TypedDict, total=False): logpush: bool """Whether Logpush is turned on for the Worker.""" - tail_consumers: Iterable[ConsumerScriptParam] + tail_consumers: Iterable[ConsumerScriptItemParam] """List of Workers that will consume logs from the attached Worker.""" diff --git a/src/cloudflare/types/workers/scripts/versions/__init__.py b/src/cloudflare/types/workers/scripts/versions/__init__.py index 7ac08f6f8b0..2ee94ead142 100644 --- a/src/cloudflare/types/workers/scripts/versions/__init__.py +++ b/src/cloudflare/types/workers/scripts/versions/__init__.py @@ -2,10 +2,8 @@ from __future__ import annotations -from .tags_item import TagsItem as TagsItem -from .binding_item import BindingItem as BindingItem -from .settings_item import SettingsItem as SettingsItem -from .binding_item_param import BindingItemParam as BindingItemParam +from .tags import Tags as Tags +from .settings import Settings as Settings +from .settings_param import SettingsParam as SettingsParam +from .compatibility_flags import CompatibilityFlags as CompatibilityFlags from .setting_edit_params import SettingEditParams as SettingEditParams -from .settings_item_param import SettingsItemParam as SettingsItemParam -from .compatibility_flags_item import CompatibilityFlagsItem as CompatibilityFlagsItem diff --git a/src/cloudflare/types/workers/scripts/versions/binding_item.py b/src/cloudflare/types/workers/scripts/versions/binding_item.py deleted file mode 100644 index 905238e9cf3..00000000000 --- a/src/cloudflare/types/workers/scripts/versions/binding_item.py +++ /dev/null @@ -1,38 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union -from typing_extensions import Literal - -from ....._models import BaseModel -from ....d1_binding import D1Binding -from ....r2_binding import R2Binding -from ....service_binding import ServiceBinding -from ....mtls_cert_binding import MTLSCERTBinding -from ....kv_namespace_binding import KVNamespaceBinding -from ....durable_object_binding import DurableObjectBinding -from ....dispatch_namespace_binding import DispatchNamespaceBinding - -__all__ = ["BindingItem", "WorkersQueueBinding"] - - -class WorkersQueueBinding(BaseModel): - name: str - """A JavaScript variable name for the binding.""" - - queue_name: str - """Name of the Queue to bind to""" - - type: Literal["queue"] - """The class of resource that the binding provides.""" - - -BindingItem = Union[ - KVNamespaceBinding, - ServiceBinding, - DurableObjectBinding, - R2Binding, - WorkersQueueBinding, - D1Binding, - DispatchNamespaceBinding, - MTLSCERTBinding, -] diff --git a/src/cloudflare/types/workers/scripts/versions/compatibility_flags.py b/src/cloudflare/types/workers/scripts/versions/compatibility_flags.py new file mode 100644 index 00000000000..c01d304f855 --- /dev/null +++ b/src/cloudflare/types/workers/scripts/versions/compatibility_flags.py @@ -0,0 +1,6 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +__all__ = ["CompatibilityFlags"] + +CompatibilityFlags = str diff --git a/src/cloudflare/types/workers/scripts/versions/compatibility_flags_item.py b/src/cloudflare/types/workers/scripts/versions/compatibility_flags_item.py deleted file mode 100644 index 0646bad417b..00000000000 --- a/src/cloudflare/types/workers/scripts/versions/compatibility_flags_item.py +++ /dev/null @@ -1,6 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -__all__ = ["CompatibilityFlagsItem"] - -CompatibilityFlagsItem = str diff --git a/src/cloudflare/types/workers/scripts/versions/setting_edit_params.py b/src/cloudflare/types/workers/scripts/versions/setting_edit_params.py index 9c77d160c30..a93a8644d1a 100644 --- a/src/cloudflare/types/workers/scripts/versions/setting_edit_params.py +++ b/src/cloudflare/types/workers/scripts/versions/setting_edit_params.py @@ -4,7 +4,7 @@ from typing_extensions import Required, TypedDict -from .settings_item_param import SettingsItemParam +from .settings_param import SettingsParam __all__ = ["SettingEditParams"] @@ -13,4 +13,4 @@ class SettingEditParams(TypedDict, total=False): account_id: Required[str] """Identifier""" - settings: SettingsItemParam + settings: SettingsParam diff --git a/src/cloudflare/types/workers/scripts/versions/settings_item.py b/src/cloudflare/types/workers/scripts/versions/settings.py similarity index 71% rename from src/cloudflare/types/workers/scripts/versions/settings_item.py rename to src/cloudflare/types/workers/scripts/versions/settings.py index 3cd27f6803a..596177c04d3 100644 --- a/src/cloudflare/types/workers/scripts/versions/settings_item.py +++ b/src/cloudflare/types/workers/scripts/versions/settings.py @@ -2,27 +2,28 @@ from typing import List, Union, Optional +from .tags import Tags +from ....binding import Binding from ....._models import BaseModel -from ....binding_item import BindingItem -from ..consumer_script import ConsumerScript +from .compatibility_flags import CompatibilityFlags from ....stepped_migration import SteppedMigration +from ..consumer_script_item import ConsumerScriptItem from ....single_step_migration import SingleStepMigration -from .compatibility_flags_item import CompatibilityFlagsItem from ....placement_configuration import PlacementConfiguration -__all__ = ["SettingsItem", "Migrations"] +__all__ = ["Settings", "Migrations"] Migrations = Union[SingleStepMigration, SteppedMigration] -class SettingsItem(BaseModel): - bindings: Optional[List[BindingItem]] = None +class Settings(BaseModel): + bindings: Optional[List[Binding]] = None """List of bindings attached to this Worker""" compatibility_date: Optional[str] = None """Opt your Worker into changes after this date""" - compatibility_flags: Optional[List[CompatibilityFlagsItem]] = None + compatibility_flags: Optional[List[CompatibilityFlags]] = None """Opt your Worker into specific changes""" logpush: Optional[bool] = None @@ -33,10 +34,10 @@ class SettingsItem(BaseModel): placement: Optional[PlacementConfiguration] = None - tags: Optional[List[str]] = None + tags: Optional[List[Tags]] = None """Tags to help you manage your Workers""" - tail_consumers: Optional[List[ConsumerScript]] = None + tail_consumers: Optional[List[ConsumerScriptItem]] = None """List of Workers that will consume logs from the attached Worker.""" usage_model: Optional[str] = None diff --git a/src/cloudflare/types/workers/scripts/versions/settings_item_param.py b/src/cloudflare/types/workers/scripts/versions/settings_param.py similarity index 72% rename from src/cloudflare/types/workers/scripts/versions/settings_item_param.py rename to src/cloudflare/types/workers/scripts/versions/settings_param.py index caed910ec0d..27d7fd8ba3d 100644 --- a/src/cloudflare/types/workers/scripts/versions/settings_item_param.py +++ b/src/cloudflare/types/workers/scripts/versions/settings_param.py @@ -5,26 +5,27 @@ from typing import List, Union, Iterable from typing_extensions import TypedDict -from ....binding_item_param import BindingItemParam -from ..consumer_script_param import ConsumerScriptParam -from .compatibility_flags_item import CompatibilityFlagsItem +from .tags import Tags +from ....binding_param import BindingParam +from .compatibility_flags import CompatibilityFlags from ....stepped_migration_param import SteppedMigrationParam +from ..consumer_script_item_param import ConsumerScriptItemParam from ....single_step_migration_param import SingleStepMigrationParam from ....placement_configuration_param import PlacementConfigurationParam -__all__ = ["SettingsItemParam", "Migrations"] +__all__ = ["SettingsParam", "Migrations"] Migrations = Union[SingleStepMigrationParam, SteppedMigrationParam] -class SettingsItemParam(TypedDict, total=False): - bindings: Iterable[BindingItemParam] +class SettingsParam(TypedDict, total=False): + bindings: Iterable[BindingParam] """List of bindings attached to this Worker""" compatibility_date: str """Opt your Worker into changes after this date""" - compatibility_flags: List[CompatibilityFlagsItem] + compatibility_flags: List[CompatibilityFlags] """Opt your Worker into specific changes""" logpush: bool @@ -35,10 +36,10 @@ class SettingsItemParam(TypedDict, total=False): placement: PlacementConfigurationParam - tags: List[str] + tags: List[Tags] """Tags to help you manage your Workers""" - tail_consumers: Iterable[ConsumerScriptParam] + tail_consumers: Iterable[ConsumerScriptItemParam] """List of Workers that will consume logs from the attached Worker.""" usage_model: str diff --git a/src/cloudflare/types/workers/scripts/versions/tags.py b/src/cloudflare/types/workers/scripts/versions/tags.py new file mode 100644 index 00000000000..d727ca1e2b0 --- /dev/null +++ b/src/cloudflare/types/workers/scripts/versions/tags.py @@ -0,0 +1,6 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +__all__ = ["Tags"] + +Tags = str diff --git a/src/cloudflare/types/workers/scripts/workers_binding.py b/src/cloudflare/types/workers/scripts/workers_binding.py deleted file mode 100644 index b0806ef017f..00000000000 --- a/src/cloudflare/types/workers/scripts/workers_binding.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union -from typing_extensions import Literal - -from ...._models import BaseModel -from ...kv_namespace_binding import KVNamespaceBinding - -__all__ = ["WorkersBinding", "WorkersWasmModuleBinding"] - - -class WorkersWasmModuleBinding(BaseModel): - name: str - """A JavaScript variable name for the binding.""" - - type: Literal["wasm_module"] - """The class of resource that the binding provides.""" - - -WorkersBinding = Union[KVNamespaceBinding, WorkersWasmModuleBinding] diff --git a/src/cloudflare/types/workers/services/environments/setting_edit_params.py b/src/cloudflare/types/workers/services/environments/setting_edit_params.py index 1628be6dd65..8328433df7d 100644 --- a/src/cloudflare/types/workers/services/environments/setting_edit_params.py +++ b/src/cloudflare/types/workers/services/environments/setting_edit_params.py @@ -6,7 +6,7 @@ from typing_extensions import Literal, Required, TypedDict from .....types import shared_params -from ...settings_item_param import SettingsItemParam +from ...script_setting_param import ScriptSettingParam __all__ = ["SettingEditParams"] @@ -22,7 +22,7 @@ class SettingEditParams(TypedDict, total=False): messages: Required[Iterable[shared_params.UnnamedSchemaRef3248f24329456e19dfa042fff9986f72]] - result: Required[SettingsItemParam] + result: Required[ScriptSettingParam] success: Required[Literal[True]] """Whether the API call was successful""" diff --git a/src/cloudflare/types/workers/setting.py b/src/cloudflare/types/workers/setting.py deleted file mode 100644 index b0c7a0ce0f5..00000000000 --- a/src/cloudflare/types/workers/setting.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import Literal - -from ..shared import UnnamedSchemaRef3248f24329456e19dfa042fff9986f72 -from ..._models import BaseModel -from .settings_item import SettingsItem - -__all__ = ["Setting"] - - -class Setting(BaseModel): - errors: List[UnnamedSchemaRef3248f24329456e19dfa042fff9986f72] - - messages: List[UnnamedSchemaRef3248f24329456e19dfa042fff9986f72] - - result: SettingsItem - - success: Literal[True] - """Whether the API call was successful""" diff --git a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/__init__.py b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/__init__.py index e80f466f64f..ce0b9cc9fcd 100644 --- a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/__init__.py +++ b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/__init__.py @@ -2,8 +2,6 @@ from __future__ import annotations +from .script import Script as Script from .script_delete_params import ScriptDeleteParams as ScriptDeleteParams from .script_update_params import ScriptUpdateParams as ScriptUpdateParams -from .workers_for_platforms_namespace_script import ( - WorkersForPlatformsNamespaceScript as WorkersForPlatformsNamespaceScript, -) diff --git a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/workers_for_platforms_namespace_script.py b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/script.py similarity index 73% rename from src/cloudflare/types/workers_for_platforms/dispatch/namespaces/workers_for_platforms_namespace_script.py rename to src/cloudflare/types/workers_for_platforms/dispatch/namespaces/script.py index b4e82c3da6b..8cdabbbabf3 100644 --- a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/workers_for_platforms_namespace_script.py +++ b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/script.py @@ -3,13 +3,13 @@ from typing import Optional from datetime import datetime -from ....workers import Script +from ....workers import script as _script from ....._models import BaseModel -__all__ = ["WorkersForPlatformsNamespaceScript"] +__all__ = ["Script"] -class WorkersForPlatformsNamespaceScript(BaseModel): +class Script(BaseModel): created_on: Optional[datetime] = None """When the script was created.""" @@ -19,4 +19,4 @@ class WorkersForPlatformsNamespaceScript(BaseModel): modified_on: Optional[datetime] = None """When the script was last modified.""" - script: Optional[Script] = None + script: Optional[_script.Script] = None diff --git a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/script_update_params.py b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/script_update_params.py index 4d37d169a81..a1abe16c98e 100644 --- a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/script_update_params.py +++ b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/script_update_params.py @@ -7,7 +7,7 @@ from ....._types import FileTypes from ....._utils import PropertyInfo -from ....workers.scripts import ConsumerScriptParam +from ....workers.scripts import ConsumerScriptItemParam from ....stepped_migration_param import SteppedMigrationParam from ....single_step_migration_param import SingleStepMigrationParam from ....placement_configuration_param import PlacementConfigurationParam @@ -82,7 +82,7 @@ class Variant0Metadata(TypedDict, total=False): tags: List[str] """List of strings to use as tags for this Worker""" - tail_consumers: Iterable[ConsumerScriptParam] + tail_consumers: Iterable[ConsumerScriptItemParam] """List of Workers that will consume logs from the attached Worker.""" usage_model: Literal["bundled", "unbound"] diff --git a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_edit_params.py b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_edit_params.py index d666b2f39e6..b3d4eb4ddb4 100644 --- a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_edit_params.py +++ b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_edit_params.py @@ -6,7 +6,7 @@ from typing_extensions import Literal, Required, TypedDict from ......types import shared_params -from .....workers import SettingsItemParam +from .....workers import ScriptSettingParam __all__ = ["SettingEditParams"] @@ -22,7 +22,7 @@ class SettingEditParams(TypedDict, total=False): messages: Required[Iterable[shared_params.UnnamedSchemaRef3248f24329456e19dfa042fff9986f72]] - result: Required[SettingsItemParam] + result: Required[ScriptSettingParam] success: Required[Literal[True]] """Whether the API call was successful""" diff --git a/src/cloudflare/types/zero_trust/__init__.py b/src/cloudflare/types/zero_trust/__init__.py index bcfce07560e..3c7eca684fa 100644 --- a/src/cloudflare/types/zero_trust/__init__.py +++ b/src/cloudflare/types/zero_trust/__init__.py @@ -2,22 +2,23 @@ from __future__ import annotations -from .rule import Rule as Rule +from .seat import Seat as Seat +from .device import Device as Device from .tunnel import Tunnel as Tunnel from .ip_rule import IPRule as IPRule from .azure_ad import AzureAd as AzureAd from .email_rule import EmailRule as EmailRule from .group_rule import GroupRule as GroupRule -from .rule_param import RuleParam as RuleParam +from .access_rule import AccessRule as AccessRule from .domain_rule import DomainRule as DomainRule from .percentiles import Percentiles as Percentiles from .country_rule import CountryRule as CountryRule -from .include_item import IncludeItem as IncludeItem from .ip_list_rule import IPListRule as IPListRule from .login_design import LoginDesign as LoginDesign from .tunnel_param import TunnelParam as TunnelParam from .everyone_rule import EveryoneRule as EveryoneRule from .ip_rule_param import IPRuleParam as IPRuleParam +from .organizations import Organizations as Organizations from .email_list_rule import EmailListRule as EmailListRule from .okta_group_rule import OktaGroupRule as OktaGroupRule from .saml_group_rule import SamlGroupRule as SamlGroupRule @@ -26,19 +27,17 @@ from .email_rule_param import EmailRuleParam as EmailRuleParam from .group_rule_param import GroupRuleParam as GroupRuleParam from .seat_edit_params import SeatEditParams as SeatEditParams -from .zero_trust_seats import ZeroTrustSeats as ZeroTrustSeats +from .access_rule_param import AccessRuleParam as AccessRuleParam from .domain_rule_param import DomainRuleParam as DomainRuleParam from .gsuite_group_rule import GsuiteGroupRule as GsuiteGroupRule +from .identity_provider import IdentityProvider as IdentityProvider from .country_rule_param import CountryRuleParam as CountryRuleParam -from .include_item_param import IncludeItemParam as IncludeItemParam from .ip_list_rule_param import IPListRuleParam as IPListRuleParam from .login_design_param import LoginDesignParam as LoginDesignParam from .seat_edit_response import SeatEditResponse as SeatEditResponse from .service_token_rule import ServiceTokenRule as ServiceTokenRule from .tunnel_edit_params import TunnelEditParams as TunnelEditParams from .tunnel_list_params import TunnelListParams as TunnelListParams -from .zero_trust_devices import ZeroTrustDevices as ZeroTrustDevices -from .device_posture_rule import DevicePostureRule as DevicePostureRule from .everyone_rule_param import EveryoneRuleParam as EveryoneRuleParam from .generic_oauth_config import GenericOAuthConfig as GenericOAuthConfig from .tunnel_create_params import TunnelCreateParams as TunnelCreateParams @@ -55,19 +54,18 @@ from .external_evaluation_rule import ExternalEvaluationRule as ExternalEvaluationRule from .github_organization_rule import GitHubOrganizationRule as GitHubOrganizationRule from .service_token_rule_param import ServiceTokenRuleParam as ServiceTokenRuleParam -from .zero_trust_organizations import ZeroTrustOrganizations as ZeroTrustOrganizations -from .device_posture_rule_param import DevicePostureRuleParam as DevicePostureRuleParam +from .access_device_posture_rule import AccessDevicePostureRule as AccessDevicePostureRule from .authentication_method_rule import AuthenticationMethodRule as AuthenticationMethodRule from .generic_oauth_config_param import GenericOAuthConfigParam as GenericOAuthConfigParam from .organization_create_params import OrganizationCreateParams as OrganizationCreateParams from .organization_update_params import OrganizationUpdateParams as OrganizationUpdateParams from .any_valid_service_token_rule import AnyValidServiceTokenRule as AnyValidServiceTokenRule -from .zero_trust_identity_providers import ZeroTrustIdentityProviders as ZeroTrustIdentityProviders from .external_evaluation_rule_param import ExternalEvaluationRuleParam as ExternalEvaluationRuleParam from .github_organization_rule_param import GitHubOrganizationRuleParam as GitHubOrganizationRuleParam from .identity_provider_create_params import IdentityProviderCreateParams as IdentityProviderCreateParams from .identity_provider_list_response import IdentityProviderListResponse as IdentityProviderListResponse from .identity_provider_update_params import IdentityProviderUpdateParams as IdentityProviderUpdateParams +from .access_device_posture_rule_param import AccessDevicePostureRuleParam as AccessDevicePostureRuleParam from .authentication_method_rule_param import AuthenticationMethodRuleParam as AuthenticationMethodRuleParam from .connectivity_setting_edit_params import ConnectivitySettingEditParams as ConnectivitySettingEditParams from .organization_revoke_users_params import OrganizationRevokeUsersParams as OrganizationRevokeUsersParams diff --git a/src/cloudflare/types/zero_trust/access/__init__.py b/src/cloudflare/types/zero_trust/access/__init__.py index d4cc12c49d4..ac4f81c8199 100644 --- a/src/cloudflare/types/zero_trust/access/__init__.py +++ b/src/cloudflare/types/zero_trust/access/__init__.py @@ -2,22 +2,23 @@ from __future__ import annotations +from .tag import Tag as Tag +from .user import User as User +from .bookmarks import Bookmarks as Bookmarks from .application import Application as Application from .certificate import Certificate as Certificate +from .custom_page import CustomPage as CustomPage from .app_id_param import AppIDParam as AppIDParam from .cors_headers import CorsHeaders as CorsHeaders +from .ervice_token import ErviceToken as ErviceToken from .saml_saas_app import SamlSaasApp as SamlSaasApp -from .zero_trust_tag import ZeroTrustTag as ZeroTrustTag from .zero_trust_group import ZeroTrustGroup as ZeroTrustGroup -from .zero_trust_users import ZeroTrustUsers as ZeroTrustUsers from .allowed_idps_item import AllowedIDPsItem as AllowedIDPsItem from .custom_pages_item import CustomPagesItem as CustomPagesItem from .key_update_params import KeyUpdateParams as KeyUpdateParams from .tag_create_params import TagCreateParams as TagCreateParams from .tag_update_params import TagUpdateParams as TagUpdateParams from .cors_headers_param import CorsHeadersParam as CorsHeadersParam -from .exclude_item_param import ExcludeItemParam as ExcludeItemParam -from .require_item_param import RequireItemParam as RequireItemParam from .group_create_params import GroupCreateParams as GroupCreateParams from .group_update_params import GroupUpdateParams as GroupUpdateParams from .saml_saas_app_param import SamlSaasAppParam as SamlSaasAppParam @@ -25,13 +26,12 @@ from .allowed_headers_item import AllowedHeadersItem as AllowedHeadersItem from .allowed_methods_item import AllowedMethodsItem as AllowedMethodsItem from .allowed_origins_item import AllowedOriginsItem as AllowedOriginsItem -from .zero_trust_bookmarks import ZeroTrustBookmarks as ZeroTrustBookmarks from .group_delete_response import GroupDeleteResponse as GroupDeleteResponse from .bookmark_create_params import BookmarkCreateParams as BookmarkCreateParams from .bookmark_delete_params import BookmarkDeleteParams as BookmarkDeleteParams from .bookmark_update_params import BookmarkUpdateParams as BookmarkUpdateParams -from .zero_trust_custom_page import ZeroTrustCustomPage as ZeroTrustCustomPage from .bookmark_delete_response import BookmarkDeleteResponse as BookmarkDeleteResponse +from .custom_page_without_html import CustomPageWithoutHTML as CustomPageWithoutHTML from .self_hosted_domains_item import SelfHostedDomainsItem as SelfHostedDomainsItem from .application_create_params import ApplicationCreateParams as ApplicationCreateParams from .application_update_params import ApplicationUpdateParams as ApplicationUpdateParams @@ -40,7 +40,6 @@ from .certificate_update_params import CertificateUpdateParams as CertificateUpdateParams from .custom_page_create_params import CustomPageCreateParams as CustomPageCreateParams from .custom_page_update_params import CustomPageUpdateParams as CustomPageUpdateParams -from .zero_trust_service_tokens import ZeroTrustServiceTokens as ZeroTrustServiceTokens from .application_delete_response import ApplicationDeleteResponse as ApplicationDeleteResponse from .certificate_delete_response import CertificateDeleteResponse as CertificateDeleteResponse from .custom_page_delete_response import CustomPageDeleteResponse as CustomPageDeleteResponse @@ -48,16 +47,3 @@ from .service_token_update_params import ServiceTokenUpdateParams as ServiceTokenUpdateParams from .service_token_create_response import ServiceTokenCreateResponse as ServiceTokenCreateResponse from .service_token_rotate_response import ServiceTokenRotateResponse as ServiceTokenRotateResponse -from .zero_trust_custom_page_without_html import ZeroTrustCustomPageWithoutHTML as ZeroTrustCustomPageWithoutHTML -from .unnamed_schema_ref_6ed9646890b9be79e16f1cfff86ec832 import ( - UnnamedSchemaRef6ed9646890b9be79e16f1cfff86ec832 as UnnamedSchemaRef6ed9646890b9be79e16f1cfff86ec832, -) -from .unnamed_schema_ref_c335ce55d4fdf132c942dfce6e45dcb9 import ( - UnnamedSchemaRefC335ce55d4fdf132c942dfce6e45dcb9 as UnnamedSchemaRefC335ce55d4fdf132c942dfce6e45dcb9, -) -from .unnamed_schema_ref_c6200e37c458aaa3c42e6e5b999bc419 import ( - UnnamedSchemaRefC6200e37c458aaa3c42e6e5b999bc419 as UnnamedSchemaRefC6200e37c458aaa3c42e6e5b999bc419, -) -from .unnamed_schema_ref_6ed9646890b9be79e16f1cfff86ec832_param import ( - UnnamedSchemaRef6ed9646890b9be79e16f1cfff86ec832Param as UnnamedSchemaRef6ed9646890b9be79e16f1cfff86ec832Param, -) diff --git a/src/cloudflare/types/zero_trust/access/applications/__init__.py b/src/cloudflare/types/zero_trust/access/applications/__init__.py index 8d451516c37..a255b04c380 100644 --- a/src/cloudflare/types/zero_trust/access/applications/__init__.py +++ b/src/cloudflare/types/zero_trust/access/applications/__init__.py @@ -2,17 +2,13 @@ from __future__ import annotations +from .ca import CA as CA from .policy import Policy as Policy -from .zero_trust_ca import ZeroTrustCA as ZeroTrustCA +from .policy_param import PolicyParam as PolicyParam +from .approval_group import ApprovalGroup as ApprovalGroup from .ca_delete_response import CADeleteResponse as CADeleteResponse -from .exclude_item_param import ExcludeItemParam as ExcludeItemParam -from .require_item_param import RequireItemParam as RequireItemParam -from .approval_group_item import ApprovalGroupItem as ApprovalGroupItem +from .approval_group_param import ApprovalGroupParam as ApprovalGroupParam from .policy_create_params import PolicyCreateParams as PolicyCreateParams from .policy_update_params import PolicyUpdateParams as PolicyUpdateParams from .policy_delete_response import PolicyDeleteResponse as PolicyDeleteResponse -from .approval_group_item_param import ApprovalGroupItemParam as ApprovalGroupItemParam from .user_policy_check_list_response import UserPolicyCheckListResponse as UserPolicyCheckListResponse -from .unnamed_schema_ref_6a02fe18089d53b52b2cd3949b717919 import ( - UnnamedSchemaRef6a02fe18089d53b52b2cd3949b717919 as UnnamedSchemaRef6a02fe18089d53b52b2cd3949b717919, -) diff --git a/src/cloudflare/types/zero_trust/access/applications/approval_group_item.py b/src/cloudflare/types/zero_trust/access/applications/approval_group.py similarity index 86% rename from src/cloudflare/types/zero_trust/access/applications/approval_group_item.py rename to src/cloudflare/types/zero_trust/access/applications/approval_group.py index fe93584c5f1..d9f57327b86 100644 --- a/src/cloudflare/types/zero_trust/access/applications/approval_group_item.py +++ b/src/cloudflare/types/zero_trust/access/applications/approval_group.py @@ -4,10 +4,10 @@ from ....._models import BaseModel -__all__ = ["ApprovalGroupItem"] +__all__ = ["ApprovalGroup"] -class ApprovalGroupItem(BaseModel): +class ApprovalGroup(BaseModel): approvals_needed: float """The number of approvals needed to obtain access.""" diff --git a/src/cloudflare/types/zero_trust/access/applications/approval_group_item_param.py b/src/cloudflare/types/zero_trust/access/applications/approval_group_param.py similarity index 83% rename from src/cloudflare/types/zero_trust/access/applications/approval_group_item_param.py rename to src/cloudflare/types/zero_trust/access/applications/approval_group_param.py index 4aeae2facb8..8428aad8822 100644 --- a/src/cloudflare/types/zero_trust/access/applications/approval_group_item_param.py +++ b/src/cloudflare/types/zero_trust/access/applications/approval_group_param.py @@ -5,10 +5,10 @@ from typing import List from typing_extensions import Required, TypedDict -__all__ = ["ApprovalGroupItemParam"] +__all__ = ["ApprovalGroupParam"] -class ApprovalGroupItemParam(TypedDict, total=False): +class ApprovalGroupParam(TypedDict, total=False): approvals_needed: Required[float] """The number of approvals needed to obtain access.""" diff --git a/src/cloudflare/types/zero_trust/access/applications/zero_trust_ca.py b/src/cloudflare/types/zero_trust/access/applications/ca.py similarity index 88% rename from src/cloudflare/types/zero_trust/access/applications/zero_trust_ca.py rename to src/cloudflare/types/zero_trust/access/applications/ca.py index ab676fbdc23..423af7ae089 100644 --- a/src/cloudflare/types/zero_trust/access/applications/zero_trust_ca.py +++ b/src/cloudflare/types/zero_trust/access/applications/ca.py @@ -4,10 +4,10 @@ from ....._models import BaseModel -__all__ = ["ZeroTrustCA"] +__all__ = ["CA"] -class ZeroTrustCA(BaseModel): +class CA(BaseModel): id: Optional[str] = None """The ID of the CA.""" diff --git a/src/cloudflare/types/zero_trust/access/applications/exclude_item_param.py b/src/cloudflare/types/zero_trust/access/applications/exclude_item_param.py deleted file mode 100644 index 4f4b225a940..00000000000 --- a/src/cloudflare/types/zero_trust/access/applications/exclude_item_param.py +++ /dev/null @@ -1,49 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union - -from ...ip_rule_param import IPRuleParam -from ...email_rule_param import EmailRuleParam -from ...group_rule_param import GroupRuleParam -from ...domain_rule_param import DomainRuleParam -from ...country_rule_param import CountryRuleParam -from ...ip_list_rule_param import IPListRuleParam -from ...everyone_rule_param import EveryoneRuleParam -from ...email_list_rule_param import EmailListRuleParam -from ...okta_group_rule_param import OktaGroupRuleParam -from ...saml_group_rule_param import SamlGroupRuleParam -from ...azure_group_rule_param import AzureGroupRuleParam -from ...certificate_rule_param import CertificateRuleParam -from ...gsuite_group_rule_param import GsuiteGroupRuleParam -from ...service_token_rule_param import ServiceTokenRuleParam -from ...device_posture_rule_param import DevicePostureRuleParam -from ...external_evaluation_rule_param import ExternalEvaluationRuleParam -from ...github_organization_rule_param import GitHubOrganizationRuleParam -from ...authentication_method_rule_param import AuthenticationMethodRuleParam -from ...any_valid_service_token_rule_param import AnyValidServiceTokenRuleParam - -__all__ = ["ExcludeItemParam"] - -ExcludeItemParam = Union[ - EmailRuleParam, - EmailListRuleParam, - DomainRuleParam, - EveryoneRuleParam, - IPRuleParam, - IPListRuleParam, - CertificateRuleParam, - GroupRuleParam, - AzureGroupRuleParam, - GitHubOrganizationRuleParam, - GsuiteGroupRuleParam, - OktaGroupRuleParam, - SamlGroupRuleParam, - ServiceTokenRuleParam, - AnyValidServiceTokenRuleParam, - ExternalEvaluationRuleParam, - CountryRuleParam, - AuthenticationMethodRuleParam, - DevicePostureRuleParam, -] diff --git a/src/cloudflare/types/zero_trust/access/applications/policy.py b/src/cloudflare/types/zero_trust/access/applications/policy.py index f214b1dcd2b..b19d148cea2 100644 --- a/src/cloudflare/types/zero_trust/access/applications/policy.py +++ b/src/cloudflare/types/zero_trust/access/applications/policy.py @@ -4,9 +4,8 @@ from datetime import datetime from typing_extensions import Literal -from ...rule import Rule from ....._models import BaseModel -from ...include_item import IncludeItem +from ...access_rule import AccessRule from .approval_group import ApprovalGroup __all__ = ["Policy"] @@ -30,13 +29,13 @@ class Policy(BaseModel): decision: Optional[Literal["allow", "deny", "non_identity", "bypass"]] = None """The action Access will take if a user matches this policy.""" - exclude: Optional[List[Rule]] = None + exclude: Optional[List[AccessRule]] = None """Rules evaluated with a NOT logical operator. To match the policy, a user cannot meet any of the Exclude rules. """ - include: Optional[List[IncludeItem]] = None + include: Optional[List[AccessRule]] = None """Rules evaluated with an OR logical operator. A user needs to meet only one of the Include rules. @@ -61,7 +60,7 @@ class Policy(BaseModel): purpose_justification_required: Optional[bool] = None """Require users to enter a justification when they log in to the application.""" - require: Optional[List[Rule]] = None + require: Optional[List[AccessRule]] = None """Rules evaluated with an AND logical operator. To match the policy, a user must meet all of the Require rules. diff --git a/src/cloudflare/types/zero_trust/access/applications/policy_create_params.py b/src/cloudflare/types/zero_trust/access/applications/policy_create_params.py index 880854fd039..4d782cdf8c0 100644 --- a/src/cloudflare/types/zero_trust/access/applications/policy_create_params.py +++ b/src/cloudflare/types/zero_trust/access/applications/policy_create_params.py @@ -5,10 +5,8 @@ from typing import Iterable from typing_extensions import Literal, Required, TypedDict -from ...exclude_item_param import ExcludeItemParam -from ...include_item_param import IncludeItemParam -from ...require_item_param import RequireItemParam -from .approval_group_item_param import ApprovalGroupItemParam +from ...access_rule_param import AccessRuleParam +from .approval_group_param import ApprovalGroupParam __all__ = ["PolicyCreateParams"] @@ -17,7 +15,7 @@ class PolicyCreateParams(TypedDict, total=False): decision: Required[Literal["allow", "deny", "non_identity", "bypass"]] """The action Access will take if a user matches this policy.""" - include: Required[Iterable[IncludeItemParam]] + include: Required[Iterable[AccessRuleParam]] """Rules evaluated with an OR logical operator. A user needs to meet only one of the Include rules. @@ -32,7 +30,7 @@ class PolicyCreateParams(TypedDict, total=False): zone_id: str """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" - approval_groups: Iterable[ApprovalGroupItemParam] + approval_groups: Iterable[ApprovalGroupParam] """Administrators who can approve a temporary authentication request.""" approval_required: bool @@ -41,7 +39,7 @@ class PolicyCreateParams(TypedDict, total=False): session. """ - exclude: Iterable[ExcludeItemParam] + exclude: Iterable[AccessRuleParam] """Rules evaluated with a NOT logical operator. To match the policy, a user cannot meet any of the Exclude rules. @@ -63,7 +61,7 @@ class PolicyCreateParams(TypedDict, total=False): purpose_justification_required: bool """Require users to enter a justification when they log in to the application.""" - require: Iterable[RequireItemParam] + require: Iterable[AccessRuleParam] """Rules evaluated with an AND logical operator. To match the policy, a user must meet all of the Require rules. diff --git a/src/cloudflare/types/zero_trust/access/applications/policy_param.py b/src/cloudflare/types/zero_trust/access/applications/policy_param.py new file mode 100644 index 00000000000..c9d3abfd454 --- /dev/null +++ b/src/cloudflare/types/zero_trust/access/applications/policy_param.py @@ -0,0 +1,69 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Literal, TypedDict + +from ...access_rule_param import AccessRuleParam +from .approval_group_param import ApprovalGroupParam + +__all__ = ["PolicyParam"] + + +class PolicyParam(TypedDict, total=False): + approval_groups: Iterable[ApprovalGroupParam] + """Administrators who can approve a temporary authentication request.""" + + approval_required: bool + """ + Requires the user to request access from an administrator at the start of each + session. + """ + + decision: Literal["allow", "deny", "non_identity", "bypass"] + """The action Access will take if a user matches this policy.""" + + exclude: Iterable[AccessRuleParam] + """Rules evaluated with a NOT logical operator. + + To match the policy, a user cannot meet any of the Exclude rules. + """ + + include: Iterable[AccessRuleParam] + """Rules evaluated with an OR logical operator. + + A user needs to meet only one of the Include rules. + """ + + isolation_required: bool + """ + Require this application to be served in an isolated browser for users matching + this policy. 'Client Web Isolation' must be on for the account in order to use + this feature. + """ + + name: str + """The name of the Access policy.""" + + precedence: int + """The order of execution for this policy. Must be unique for each policy.""" + + purpose_justification_prompt: str + """A custom message that will appear on the purpose justification screen.""" + + purpose_justification_required: bool + """Require users to enter a justification when they log in to the application.""" + + require: Iterable[AccessRuleParam] + """Rules evaluated with an AND logical operator. + + To match the policy, a user must meet all of the Require rules. + """ + + session_duration: str + """The amount of time that tokens issued for the application will be valid. + + Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), + ms, s, m, h. + """ diff --git a/src/cloudflare/types/zero_trust/access/applications/policy_update_params.py b/src/cloudflare/types/zero_trust/access/applications/policy_update_params.py index 4f5202e0f9c..6047e104f04 100644 --- a/src/cloudflare/types/zero_trust/access/applications/policy_update_params.py +++ b/src/cloudflare/types/zero_trust/access/applications/policy_update_params.py @@ -5,10 +5,8 @@ from typing import Iterable from typing_extensions import Literal, Required, TypedDict -from ...exclude_item_param import ExcludeItemParam -from ...include_item_param import IncludeItemParam -from ...require_item_param import RequireItemParam -from .approval_group_item_param import ApprovalGroupItemParam +from ...access_rule_param import AccessRuleParam +from .approval_group_param import ApprovalGroupParam __all__ = ["PolicyUpdateParams"] @@ -20,7 +18,7 @@ class PolicyUpdateParams(TypedDict, total=False): decision: Required[Literal["allow", "deny", "non_identity", "bypass"]] """The action Access will take if a user matches this policy.""" - include: Required[Iterable[IncludeItemParam]] + include: Required[Iterable[AccessRuleParam]] """Rules evaluated with an OR logical operator. A user needs to meet only one of the Include rules. @@ -35,7 +33,7 @@ class PolicyUpdateParams(TypedDict, total=False): zone_id: str """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" - approval_groups: Iterable[ApprovalGroupItemParam] + approval_groups: Iterable[ApprovalGroupParam] """Administrators who can approve a temporary authentication request.""" approval_required: bool @@ -44,7 +42,7 @@ class PolicyUpdateParams(TypedDict, total=False): session. """ - exclude: Iterable[ExcludeItemParam] + exclude: Iterable[AccessRuleParam] """Rules evaluated with a NOT logical operator. To match the policy, a user cannot meet any of the Exclude rules. @@ -66,7 +64,7 @@ class PolicyUpdateParams(TypedDict, total=False): purpose_justification_required: bool """Require users to enter a justification when they log in to the application.""" - require: Iterable[RequireItemParam] + require: Iterable[AccessRuleParam] """Rules evaluated with an AND logical operator. To match the policy, a user must meet all of the Require rules. diff --git a/src/cloudflare/types/zero_trust/access/applications/require_item_param.py b/src/cloudflare/types/zero_trust/access/applications/require_item_param.py deleted file mode 100644 index ebd8dcb73c5..00000000000 --- a/src/cloudflare/types/zero_trust/access/applications/require_item_param.py +++ /dev/null @@ -1,49 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union - -from ...ip_rule_param import IPRuleParam -from ...email_rule_param import EmailRuleParam -from ...group_rule_param import GroupRuleParam -from ...domain_rule_param import DomainRuleParam -from ...country_rule_param import CountryRuleParam -from ...ip_list_rule_param import IPListRuleParam -from ...everyone_rule_param import EveryoneRuleParam -from ...email_list_rule_param import EmailListRuleParam -from ...okta_group_rule_param import OktaGroupRuleParam -from ...saml_group_rule_param import SamlGroupRuleParam -from ...azure_group_rule_param import AzureGroupRuleParam -from ...certificate_rule_param import CertificateRuleParam -from ...gsuite_group_rule_param import GsuiteGroupRuleParam -from ...service_token_rule_param import ServiceTokenRuleParam -from ...device_posture_rule_param import DevicePostureRuleParam -from ...external_evaluation_rule_param import ExternalEvaluationRuleParam -from ...github_organization_rule_param import GitHubOrganizationRuleParam -from ...authentication_method_rule_param import AuthenticationMethodRuleParam -from ...any_valid_service_token_rule_param import AnyValidServiceTokenRuleParam - -__all__ = ["RequireItemParam"] - -RequireItemParam = Union[ - EmailRuleParam, - EmailListRuleParam, - DomainRuleParam, - EveryoneRuleParam, - IPRuleParam, - IPListRuleParam, - CertificateRuleParam, - GroupRuleParam, - AzureGroupRuleParam, - GitHubOrganizationRuleParam, - GsuiteGroupRuleParam, - OktaGroupRuleParam, - SamlGroupRuleParam, - ServiceTokenRuleParam, - AnyValidServiceTokenRuleParam, - ExternalEvaluationRuleParam, - CountryRuleParam, - AuthenticationMethodRuleParam, - DevicePostureRuleParam, -] diff --git a/src/cloudflare/types/zero_trust/access/applications/unnamed_schema_ref_6a02fe18089d53b52b2cd3949b717919.py b/src/cloudflare/types/zero_trust/access/applications/unnamed_schema_ref_6a02fe18089d53b52b2cd3949b717919.py deleted file mode 100644 index 73e9666d2ce..00000000000 --- a/src/cloudflare/types/zero_trust/access/applications/unnamed_schema_ref_6a02fe18089d53b52b2cd3949b717919.py +++ /dev/null @@ -1,11 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ....._models import BaseModel - -__all__ = ["UnnamedSchemaRef6a02fe18089d53b52b2cd3949b717919"] - - -class UnnamedSchemaRef6a02fe18089d53b52b2cd3949b717919(BaseModel): - country: Optional[str] = None diff --git a/src/cloudflare/types/zero_trust/access/applications/user_policy_check_list_response.py b/src/cloudflare/types/zero_trust/access/applications/user_policy_check_list_response.py index 38239154b26..7e0bd187b85 100644 --- a/src/cloudflare/types/zero_trust/access/applications/user_policy_check_list_response.py +++ b/src/cloudflare/types/zero_trust/access/applications/user_policy_check_list_response.py @@ -3,9 +3,8 @@ from typing import List, Optional from ....._models import BaseModel -from .unnamed_schema_ref_6a02fe18089d53b52b2cd3949b717919 import UnnamedSchemaRef6a02fe18089d53b52b2cd3949b717919 -__all__ = ["UserPolicyCheckListResponse", "AppState", "UserIdentity"] +__all__ = ["UserPolicyCheckListResponse", "AppState", "UserIdentity", "UserIdentityGeo"] class AppState(BaseModel): @@ -23,6 +22,10 @@ class AppState(BaseModel): status: Optional[str] = None +class UserIdentityGeo(BaseModel): + country: Optional[str] = None + + class UserIdentity(BaseModel): id: Optional[str] = None @@ -32,7 +35,7 @@ class UserIdentity(BaseModel): email: Optional[str] = None - geo: Optional[UnnamedSchemaRef6a02fe18089d53b52b2cd3949b717919] = None + geo: Optional[UserIdentityGeo] = None iat: Optional[int] = None diff --git a/src/cloudflare/types/zero_trust/access/zero_trust_bookmarks.py b/src/cloudflare/types/zero_trust/access/bookmarks.py similarity index 91% rename from src/cloudflare/types/zero_trust/access/zero_trust_bookmarks.py rename to src/cloudflare/types/zero_trust/access/bookmarks.py index 6ecee05ac03..5c83ddd611e 100644 --- a/src/cloudflare/types/zero_trust/access/zero_trust_bookmarks.py +++ b/src/cloudflare/types/zero_trust/access/bookmarks.py @@ -5,10 +5,10 @@ from ...._models import BaseModel -__all__ = ["ZeroTrustBookmarks"] +__all__ = ["Bookmarks"] -class ZeroTrustBookmarks(BaseModel): +class Bookmarks(BaseModel): id: Optional[str] = None """The unique identifier for the Bookmark application.""" diff --git a/src/cloudflare/types/zero_trust/access/certificate.py b/src/cloudflare/types/zero_trust/access/certificate.py index b3253158604..aa76fc9628d 100644 --- a/src/cloudflare/types/zero_trust/access/certificate.py +++ b/src/cloudflare/types/zero_trust/access/certificate.py @@ -4,6 +4,7 @@ from datetime import datetime from ...._models import BaseModel +from .associated_hostnames_item import AssociatedHostnamesItem __all__ = ["Certificate"] @@ -12,7 +13,7 @@ class Certificate(BaseModel): id: Optional[str] = None """The ID of the application that will use this certificate.""" - associated_hostnames: Optional[List[str]] = None + associated_hostnames: Optional[List[AssociatedHostnamesItem]] = None """The hostnames of the applications that will use this certificate.""" created_at: Optional[datetime] = None diff --git a/src/cloudflare/types/zero_trust/access/certificates/__init__.py b/src/cloudflare/types/zero_trust/access/certificates/__init__.py index d6124105248..2a8e492f5d5 100644 --- a/src/cloudflare/types/zero_trust/access/certificates/__init__.py +++ b/src/cloudflare/types/zero_trust/access/certificates/__init__.py @@ -2,8 +2,8 @@ from __future__ import annotations -from .settings import Settings as Settings -from .settings_param import SettingsParam as SettingsParam +from .certificate_settings import CertificateSettings as CertificateSettings from .setting_get_response import SettingGetResponse as SettingGetResponse from .setting_update_params import SettingUpdateParams as SettingUpdateParams from .setting_update_response import SettingUpdateResponse as SettingUpdateResponse +from .certificate_settings_param import CertificateSettingsParam as CertificateSettingsParam diff --git a/src/cloudflare/types/zero_trust/access/certificates/settings.py b/src/cloudflare/types/zero_trust/access/certificates/certificate_settings.py similarity index 89% rename from src/cloudflare/types/zero_trust/access/certificates/settings.py rename to src/cloudflare/types/zero_trust/access/certificates/certificate_settings.py index e53ee7b1f8d..f2307e896f0 100644 --- a/src/cloudflare/types/zero_trust/access/certificates/settings.py +++ b/src/cloudflare/types/zero_trust/access/certificates/certificate_settings.py @@ -2,10 +2,10 @@ from ....._models import BaseModel -__all__ = ["Settings"] +__all__ = ["CertificateSettings"] -class Settings(BaseModel): +class CertificateSettings(BaseModel): china_network: bool """Request client certificates for this hostname in China. diff --git a/src/cloudflare/types/zero_trust/access/certificates/settings_param.py b/src/cloudflare/types/zero_trust/access/certificates/certificate_settings_param.py similarity index 87% rename from src/cloudflare/types/zero_trust/access/certificates/settings_param.py rename to src/cloudflare/types/zero_trust/access/certificates/certificate_settings_param.py index 9563931e177..f80bcb0940e 100644 --- a/src/cloudflare/types/zero_trust/access/certificates/settings_param.py +++ b/src/cloudflare/types/zero_trust/access/certificates/certificate_settings_param.py @@ -4,10 +4,10 @@ from typing_extensions import Required, TypedDict -__all__ = ["SettingsParam"] +__all__ = ["CertificateSettingsParam"] -class SettingsParam(TypedDict, total=False): +class CertificateSettingsParam(TypedDict, total=False): china_network: Required[bool] """Request client certificates for this hostname in China. diff --git a/src/cloudflare/types/zero_trust/access/certificates/setting_get_response.py b/src/cloudflare/types/zero_trust/access/certificates/setting_get_response.py index cbe0cfab3ef..454c55986c2 100644 --- a/src/cloudflare/types/zero_trust/access/certificates/setting_get_response.py +++ b/src/cloudflare/types/zero_trust/access/certificates/setting_get_response.py @@ -2,8 +2,8 @@ from typing import List -from .settings import Settings +from .certificate_settings import CertificateSettings __all__ = ["SettingGetResponse"] -SettingGetResponse = List[Settings] +SettingGetResponse = List[CertificateSettings] diff --git a/src/cloudflare/types/zero_trust/access/certificates/setting_update_params.py b/src/cloudflare/types/zero_trust/access/certificates/setting_update_params.py index 7e9868f566b..80d05fa2e09 100644 --- a/src/cloudflare/types/zero_trust/access/certificates/setting_update_params.py +++ b/src/cloudflare/types/zero_trust/access/certificates/setting_update_params.py @@ -5,13 +5,13 @@ from typing import Iterable from typing_extensions import Required, TypedDict -from .settings_param import SettingsParam +from .certificate_settings_param import CertificateSettingsParam __all__ = ["SettingUpdateParams"] class SettingUpdateParams(TypedDict, total=False): - settings: Required[Iterable[SettingsParam]] + settings: Required[Iterable[CertificateSettingsParam]] account_id: str """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" diff --git a/src/cloudflare/types/zero_trust/access/certificates/setting_update_response.py b/src/cloudflare/types/zero_trust/access/certificates/setting_update_response.py index 9854857bba8..d3d17631972 100644 --- a/src/cloudflare/types/zero_trust/access/certificates/setting_update_response.py +++ b/src/cloudflare/types/zero_trust/access/certificates/setting_update_response.py @@ -2,8 +2,8 @@ from typing import List -from .settings import Settings +from .certificate_settings import CertificateSettings __all__ = ["SettingUpdateResponse"] -SettingUpdateResponse = List[Settings] +SettingUpdateResponse = List[CertificateSettings] diff --git a/src/cloudflare/types/zero_trust/access/zero_trust_custom_page.py b/src/cloudflare/types/zero_trust/access/custom_page.py similarity index 89% rename from src/cloudflare/types/zero_trust/access/zero_trust_custom_page.py rename to src/cloudflare/types/zero_trust/access/custom_page.py index cb9da69fd4b..4593071d37a 100644 --- a/src/cloudflare/types/zero_trust/access/zero_trust_custom_page.py +++ b/src/cloudflare/types/zero_trust/access/custom_page.py @@ -6,10 +6,10 @@ from ...._models import BaseModel -__all__ = ["ZeroTrustCustomPage"] +__all__ = ["CustomPage"] -class ZeroTrustCustomPage(BaseModel): +class CustomPage(BaseModel): custom_html: str """Custom page HTML.""" diff --git a/src/cloudflare/types/zero_trust/access/zero_trust_custom_page_without_html.py b/src/cloudflare/types/zero_trust/access/custom_page_without_html.py similarity index 85% rename from src/cloudflare/types/zero_trust/access/zero_trust_custom_page_without_html.py rename to src/cloudflare/types/zero_trust/access/custom_page_without_html.py index 3bd6d73efa2..d0aecfa61f5 100644 --- a/src/cloudflare/types/zero_trust/access/zero_trust_custom_page_without_html.py +++ b/src/cloudflare/types/zero_trust/access/custom_page_without_html.py @@ -6,10 +6,10 @@ from ...._models import BaseModel -__all__ = ["ZeroTrustCustomPageWithoutHTML"] +__all__ = ["CustomPageWithoutHTML"] -class ZeroTrustCustomPageWithoutHTML(BaseModel): +class CustomPageWithoutHTML(BaseModel): name: str """Custom page name.""" diff --git a/src/cloudflare/types/zero_trust/access/zero_trust_service_tokens.py b/src/cloudflare/types/zero_trust/access/ervice_token.py similarity index 91% rename from src/cloudflare/types/zero_trust/access/zero_trust_service_tokens.py rename to src/cloudflare/types/zero_trust/access/ervice_token.py index 7a521c84758..879f7c574e8 100644 --- a/src/cloudflare/types/zero_trust/access/zero_trust_service_tokens.py +++ b/src/cloudflare/types/zero_trust/access/ervice_token.py @@ -5,10 +5,10 @@ from ...._models import BaseModel -__all__ = ["ZeroTrustServiceTokens"] +__all__ = ["ErviceToken"] -class ZeroTrustServiceTokens(BaseModel): +class ErviceToken(BaseModel): id: Optional[object] = None """The ID of the service token.""" diff --git a/src/cloudflare/types/zero_trust/access/exclude_item_param.py b/src/cloudflare/types/zero_trust/access/exclude_item_param.py deleted file mode 100644 index 0b27058121c..00000000000 --- a/src/cloudflare/types/zero_trust/access/exclude_item_param.py +++ /dev/null @@ -1,49 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union - -from ..ip_rule_param import IPRuleParam -from ..email_rule_param import EmailRuleParam -from ..group_rule_param import GroupRuleParam -from ..domain_rule_param import DomainRuleParam -from ..country_rule_param import CountryRuleParam -from ..ip_list_rule_param import IPListRuleParam -from ..everyone_rule_param import EveryoneRuleParam -from ..email_list_rule_param import EmailListRuleParam -from ..okta_group_rule_param import OktaGroupRuleParam -from ..saml_group_rule_param import SamlGroupRuleParam -from ..azure_group_rule_param import AzureGroupRuleParam -from ..certificate_rule_param import CertificateRuleParam -from ..gsuite_group_rule_param import GsuiteGroupRuleParam -from ..service_token_rule_param import ServiceTokenRuleParam -from ..device_posture_rule_param import DevicePostureRuleParam -from ..external_evaluation_rule_param import ExternalEvaluationRuleParam -from ..github_organization_rule_param import GitHubOrganizationRuleParam -from ..authentication_method_rule_param import AuthenticationMethodRuleParam -from ..any_valid_service_token_rule_param import AnyValidServiceTokenRuleParam - -__all__ = ["ExcludeItemParam"] - -ExcludeItemParam = Union[ - EmailRuleParam, - EmailListRuleParam, - DomainRuleParam, - EveryoneRuleParam, - IPRuleParam, - IPListRuleParam, - CertificateRuleParam, - GroupRuleParam, - AzureGroupRuleParam, - GitHubOrganizationRuleParam, - GsuiteGroupRuleParam, - OktaGroupRuleParam, - SamlGroupRuleParam, - ServiceTokenRuleParam, - AnyValidServiceTokenRuleParam, - ExternalEvaluationRuleParam, - CountryRuleParam, - AuthenticationMethodRuleParam, - DevicePostureRuleParam, -] diff --git a/src/cloudflare/types/zero_trust/access/group_create_params.py b/src/cloudflare/types/zero_trust/access/group_create_params.py index d06897d8717..04c7006d842 100644 --- a/src/cloudflare/types/zero_trust/access/group_create_params.py +++ b/src/cloudflare/types/zero_trust/access/group_create_params.py @@ -5,15 +5,13 @@ from typing import Iterable from typing_extensions import Required, TypedDict -from ..exclude_item_param import ExcludeItemParam -from ..include_item_param import IncludeItemParam -from ..require_item_param import RequireItemParam +from ..access_rule_param import AccessRuleParam __all__ = ["GroupCreateParams"] class GroupCreateParams(TypedDict, total=False): - include: Required[Iterable[IncludeItemParam]] + include: Required[Iterable[AccessRuleParam]] """Rules evaluated with an OR logical operator. A user needs to meet only one of the Include rules. @@ -28,7 +26,7 @@ class GroupCreateParams(TypedDict, total=False): zone_id: str """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" - exclude: Iterable[ExcludeItemParam] + exclude: Iterable[AccessRuleParam] """Rules evaluated with a NOT logical operator. To match a policy, a user cannot meet any of the Exclude rules. @@ -37,7 +35,7 @@ class GroupCreateParams(TypedDict, total=False): is_default: bool """Whether this is the default group""" - require: Iterable[RequireItemParam] + require: Iterable[AccessRuleParam] """Rules evaluated with an AND logical operator. To match a policy, a user must meet all of the Require rules. diff --git a/src/cloudflare/types/zero_trust/access/group_update_params.py b/src/cloudflare/types/zero_trust/access/group_update_params.py index e0e28633dc3..68672edb40e 100644 --- a/src/cloudflare/types/zero_trust/access/group_update_params.py +++ b/src/cloudflare/types/zero_trust/access/group_update_params.py @@ -5,15 +5,13 @@ from typing import Iterable from typing_extensions import Required, TypedDict -from ..exclude_item_param import ExcludeItemParam -from ..include_item_param import IncludeItemParam -from ..require_item_param import RequireItemParam +from ..access_rule_param import AccessRuleParam __all__ = ["GroupUpdateParams"] class GroupUpdateParams(TypedDict, total=False): - include: Required[Iterable[IncludeItemParam]] + include: Required[Iterable[AccessRuleParam]] """Rules evaluated with an OR logical operator. A user needs to meet only one of the Include rules. @@ -28,7 +26,7 @@ class GroupUpdateParams(TypedDict, total=False): zone_id: str """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" - exclude: Iterable[ExcludeItemParam] + exclude: Iterable[AccessRuleParam] """Rules evaluated with a NOT logical operator. To match a policy, a user cannot meet any of the Exclude rules. @@ -37,7 +35,7 @@ class GroupUpdateParams(TypedDict, total=False): is_default: bool """Whether this is the default group""" - require: Iterable[RequireItemParam] + require: Iterable[AccessRuleParam] """Rules evaluated with an AND logical operator. To match a policy, a user must meet all of the Require rules. diff --git a/src/cloudflare/types/zero_trust/access/logs/__init__.py b/src/cloudflare/types/zero_trust/access/logs/__init__.py index 3877a88828f..8044ec713b3 100644 --- a/src/cloudflare/types/zero_trust/access/logs/__init__.py +++ b/src/cloudflare/types/zero_trust/access/logs/__init__.py @@ -2,5 +2,5 @@ from __future__ import annotations -from .zero_trust_access_requests import ZeroTrustAccessRequests as ZeroTrustAccessRequests +from .access_requests import AccessRequests as AccessRequests from .access_request_list_response import AccessRequestListResponse as AccessRequestListResponse diff --git a/src/cloudflare/types/zero_trust/access/logs/access_request_list_response.py b/src/cloudflare/types/zero_trust/access/logs/access_request_list_response.py index 698535e88d5..b48a60046d9 100644 --- a/src/cloudflare/types/zero_trust/access/logs/access_request_list_response.py +++ b/src/cloudflare/types/zero_trust/access/logs/access_request_list_response.py @@ -2,8 +2,8 @@ from typing import List -from .zero_trust_access_requests import ZeroTrustAccessRequests +from .access_requests import AccessRequests __all__ = ["AccessRequestListResponse"] -AccessRequestListResponse = List[ZeroTrustAccessRequests] +AccessRequestListResponse = List[AccessRequests] diff --git a/src/cloudflare/types/zero_trust/access/logs/zero_trust_access_requests.py b/src/cloudflare/types/zero_trust/access/logs/access_requests.py similarity index 92% rename from src/cloudflare/types/zero_trust/access/logs/zero_trust_access_requests.py rename to src/cloudflare/types/zero_trust/access/logs/access_requests.py index f3467107fc2..7baca33ef79 100644 --- a/src/cloudflare/types/zero_trust/access/logs/zero_trust_access_requests.py +++ b/src/cloudflare/types/zero_trust/access/logs/access_requests.py @@ -7,10 +7,10 @@ from ....._models import BaseModel -__all__ = ["ZeroTrustAccessRequests"] +__all__ = ["AccessRequests"] -class ZeroTrustAccessRequests(BaseModel): +class AccessRequests(BaseModel): action: Optional[str] = None """The event that occurred, such as a login attempt.""" diff --git a/src/cloudflare/types/zero_trust/access/require_item_param.py b/src/cloudflare/types/zero_trust/access/require_item_param.py deleted file mode 100644 index 1a36d1844ce..00000000000 --- a/src/cloudflare/types/zero_trust/access/require_item_param.py +++ /dev/null @@ -1,49 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union - -from ..ip_rule_param import IPRuleParam -from ..email_rule_param import EmailRuleParam -from ..group_rule_param import GroupRuleParam -from ..domain_rule_param import DomainRuleParam -from ..country_rule_param import CountryRuleParam -from ..ip_list_rule_param import IPListRuleParam -from ..everyone_rule_param import EveryoneRuleParam -from ..email_list_rule_param import EmailListRuleParam -from ..okta_group_rule_param import OktaGroupRuleParam -from ..saml_group_rule_param import SamlGroupRuleParam -from ..azure_group_rule_param import AzureGroupRuleParam -from ..certificate_rule_param import CertificateRuleParam -from ..gsuite_group_rule_param import GsuiteGroupRuleParam -from ..service_token_rule_param import ServiceTokenRuleParam -from ..device_posture_rule_param import DevicePostureRuleParam -from ..external_evaluation_rule_param import ExternalEvaluationRuleParam -from ..github_organization_rule_param import GitHubOrganizationRuleParam -from ..authentication_method_rule_param import AuthenticationMethodRuleParam -from ..any_valid_service_token_rule_param import AnyValidServiceTokenRuleParam - -__all__ = ["RequireItemParam"] - -RequireItemParam = Union[ - EmailRuleParam, - EmailListRuleParam, - DomainRuleParam, - EveryoneRuleParam, - IPRuleParam, - IPListRuleParam, - CertificateRuleParam, - GroupRuleParam, - AzureGroupRuleParam, - GitHubOrganizationRuleParam, - GsuiteGroupRuleParam, - OktaGroupRuleParam, - SamlGroupRuleParam, - ServiceTokenRuleParam, - AnyValidServiceTokenRuleParam, - ExternalEvaluationRuleParam, - CountryRuleParam, - AuthenticationMethodRuleParam, - DevicePostureRuleParam, -] diff --git a/src/cloudflare/types/zero_trust/access/saml_saas_app.py b/src/cloudflare/types/zero_trust/access/saml_saas_app.py index c61686fbf66..4e5b5659882 100644 --- a/src/cloudflare/types/zero_trust/access/saml_saas_app.py +++ b/src/cloudflare/types/zero_trust/access/saml_saas_app.py @@ -5,21 +5,29 @@ from typing_extensions import Literal from ...._models import BaseModel -from .unnamed_schema_ref_6ed9646890b9be79e16f1cfff86ec832 import UnnamedSchemaRef6ed9646890b9be79e16f1cfff86ec832 -from .unnamed_schema_ref_c335ce55d4fdf132c942dfce6e45dcb9 import UnnamedSchemaRefC335ce55d4fdf132c942dfce6e45dcb9 -from .unnamed_schema_ref_c6200e37c458aaa3c42e6e5b999bc419 import UnnamedSchemaRefC6200e37c458aaa3c42e6e5b999bc419 -__all__ = ["SamlSaasApp", "CustomAttributes"] +__all__ = ["SamlSaasApp", "CustomAttributes", "CustomAttributesSource"] + + +class CustomAttributesSource(BaseModel): + name: Optional[str] = None + """The name of the IdP attribute.""" class CustomAttributes(BaseModel): name: Optional[str] = None """The name of the attribute.""" - name_format: Optional[UnnamedSchemaRefC335ce55d4fdf132c942dfce6e45dcb9] = None + name_format: Optional[ + Literal[ + "urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified", + "urn:oasis:names:tc:SAML:2.0:attrname-format:basic", + "urn:oasis:names:tc:SAML:2.0:attrname-format:uri", + ] + ] = None """A globally unique name for an identity or service provider.""" - source: Optional[UnnamedSchemaRef6ed9646890b9be79e16f1cfff86ec832] = None + source: Optional[CustomAttributesSource] = None class SamlSaasApp(BaseModel): @@ -49,7 +57,7 @@ class SamlSaasApp(BaseModel): idp_entity_id: Optional[str] = None """The unique identifier for your SaaS application.""" - name_id_format: Optional[UnnamedSchemaRefC6200e37c458aaa3c42e6e5b999bc419] = None + name_id_format: Optional[Literal["id", "email"]] = None """The format of the name identifier sent to the SaaS application.""" name_id_transform_jsonata: Optional[str] = None diff --git a/src/cloudflare/types/zero_trust/access/saml_saas_app_param.py b/src/cloudflare/types/zero_trust/access/saml_saas_app_param.py index ff776bb3d81..a6773525cc7 100644 --- a/src/cloudflare/types/zero_trust/access/saml_saas_app_param.py +++ b/src/cloudflare/types/zero_trust/access/saml_saas_app_param.py @@ -4,23 +4,26 @@ from typing_extensions import Literal, TypedDict -from .unnamed_schema_ref_c335ce55d4fdf132c942dfce6e45dcb9 import UnnamedSchemaRefC335ce55d4fdf132c942dfce6e45dcb9 -from .unnamed_schema_ref_c6200e37c458aaa3c42e6e5b999bc419 import UnnamedSchemaRefC6200e37c458aaa3c42e6e5b999bc419 -from .unnamed_schema_ref_6ed9646890b9be79e16f1cfff86ec832_param import ( - UnnamedSchemaRef6ed9646890b9be79e16f1cfff86ec832Param, -) +__all__ = ["SamlSaasAppParam", "CustomAttributes", "CustomAttributesSource"] -__all__ = ["SamlSaasAppParam", "CustomAttributes"] + +class CustomAttributesSource(TypedDict, total=False): + name: str + """The name of the IdP attribute.""" class CustomAttributes(TypedDict, total=False): name: str """The name of the attribute.""" - name_format: UnnamedSchemaRefC335ce55d4fdf132c942dfce6e45dcb9 + name_format: Literal[ + "urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified", + "urn:oasis:names:tc:SAML:2.0:attrname-format:basic", + "urn:oasis:names:tc:SAML:2.0:attrname-format:uri", + ] """A globally unique name for an identity or service provider.""" - source: UnnamedSchemaRef6ed9646890b9be79e16f1cfff86ec832Param + source: CustomAttributesSource class SamlSaasAppParam(TypedDict, total=False): @@ -48,7 +51,7 @@ class SamlSaasAppParam(TypedDict, total=False): idp_entity_id: str """The unique identifier for your SaaS application.""" - name_id_format: UnnamedSchemaRefC6200e37c458aaa3c42e6e5b999bc419 + name_id_format: Literal["id", "email"] """The format of the name identifier sent to the SaaS application.""" name_id_transform_jsonata: str diff --git a/src/cloudflare/types/zero_trust/access/zero_trust_tag.py b/src/cloudflare/types/zero_trust/access/tag.py similarity index 87% rename from src/cloudflare/types/zero_trust/access/zero_trust_tag.py rename to src/cloudflare/types/zero_trust/access/tag.py index 0c6838a56ae..bf386015544 100644 --- a/src/cloudflare/types/zero_trust/access/zero_trust_tag.py +++ b/src/cloudflare/types/zero_trust/access/tag.py @@ -5,10 +5,10 @@ from ...._models import BaseModel -__all__ = ["ZeroTrustTag"] +__all__ = ["Tag"] -class ZeroTrustTag(BaseModel): +class Tag(BaseModel): name: str """The name of the tag""" diff --git a/src/cloudflare/types/zero_trust/access/unnamed_schema_ref_6ed9646890b9be79e16f1cfff86ec832.py b/src/cloudflare/types/zero_trust/access/unnamed_schema_ref_6ed9646890b9be79e16f1cfff86ec832.py deleted file mode 100644 index 6209e5a4a2a..00000000000 --- a/src/cloudflare/types/zero_trust/access/unnamed_schema_ref_6ed9646890b9be79e16f1cfff86ec832.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ...._models import BaseModel - -__all__ = ["UnnamedSchemaRef6ed9646890b9be79e16f1cfff86ec832"] - - -class UnnamedSchemaRef6ed9646890b9be79e16f1cfff86ec832(BaseModel): - name: Optional[str] = None - """The name of the IdP attribute.""" diff --git a/src/cloudflare/types/zero_trust/access/unnamed_schema_ref_6ed9646890b9be79e16f1cfff86ec832_param.py b/src/cloudflare/types/zero_trust/access/unnamed_schema_ref_6ed9646890b9be79e16f1cfff86ec832_param.py deleted file mode 100644 index bb025e42ece..00000000000 --- a/src/cloudflare/types/zero_trust/access/unnamed_schema_ref_6ed9646890b9be79e16f1cfff86ec832_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -__all__ = ["UnnamedSchemaRef6ed9646890b9be79e16f1cfff86ec832Param"] - - -class UnnamedSchemaRef6ed9646890b9be79e16f1cfff86ec832Param(TypedDict, total=False): - name: str - """The name of the IdP attribute.""" diff --git a/src/cloudflare/types/zero_trust/access/unnamed_schema_ref_c335ce55d4fdf132c942dfce6e45dcb9.py b/src/cloudflare/types/zero_trust/access/unnamed_schema_ref_c335ce55d4fdf132c942dfce6e45dcb9.py deleted file mode 100644 index ad224d9557c..00000000000 --- a/src/cloudflare/types/zero_trust/access/unnamed_schema_ref_c335ce55d4fdf132c942dfce6e45dcb9.py +++ /dev/null @@ -1,11 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal - -__all__ = ["UnnamedSchemaRefC335ce55d4fdf132c942dfce6e45dcb9"] - -UnnamedSchemaRefC335ce55d4fdf132c942dfce6e45dcb9 = Literal[ - "urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified", - "urn:oasis:names:tc:SAML:2.0:attrname-format:basic", - "urn:oasis:names:tc:SAML:2.0:attrname-format:uri", -] diff --git a/src/cloudflare/types/zero_trust/access/unnamed_schema_ref_c6200e37c458aaa3c42e6e5b999bc419.py b/src/cloudflare/types/zero_trust/access/unnamed_schema_ref_c6200e37c458aaa3c42e6e5b999bc419.py deleted file mode 100644 index bbb4cf243ef..00000000000 --- a/src/cloudflare/types/zero_trust/access/unnamed_schema_ref_c6200e37c458aaa3c42e6e5b999bc419.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal - -__all__ = ["UnnamedSchemaRefC6200e37c458aaa3c42e6e5b999bc419"] - -UnnamedSchemaRefC6200e37c458aaa3c42e6e5b999bc419 = Literal["id", "email"] diff --git a/src/cloudflare/types/zero_trust/access/zero_trust_users.py b/src/cloudflare/types/zero_trust/access/user.py similarity index 94% rename from src/cloudflare/types/zero_trust/access/zero_trust_users.py rename to src/cloudflare/types/zero_trust/access/user.py index df60d7a1ecf..93d90a73499 100644 --- a/src/cloudflare/types/zero_trust/access/zero_trust_users.py +++ b/src/cloudflare/types/zero_trust/access/user.py @@ -5,10 +5,10 @@ from ...._models import BaseModel -__all__ = ["ZeroTrustUsers"] +__all__ = ["User"] -class ZeroTrustUsers(BaseModel): +class User(BaseModel): id: Optional[str] = None """UUID""" diff --git a/src/cloudflare/types/zero_trust/access/users/__init__.py b/src/cloudflare/types/zero_trust/access/users/__init__.py index 5d2c3738998..5f23decf1fe 100644 --- a/src/cloudflare/types/zero_trust/access/users/__init__.py +++ b/src/cloudflare/types/zero_trust/access/users/__init__.py @@ -2,7 +2,7 @@ from __future__ import annotations -from .zero_trust_identity import ZeroTrustIdentity as ZeroTrustIdentity +from .identity import Identity as Identity 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 diff --git a/src/cloudflare/types/zero_trust/access/users/active_session_get_response.py b/src/cloudflare/types/zero_trust/access/users/active_session_get_response.py index 115fea2de1d..523b0f0fc48 100644 --- a/src/cloudflare/types/zero_trust/access/users/active_session_get_response.py +++ b/src/cloudflare/types/zero_trust/access/users/active_session_get_response.py @@ -5,9 +5,16 @@ from pydantic import Field as FieldInfo from ....._models import BaseModel -from ..applications import UnnamedSchemaRef6a02fe18089d53b52b2cd3949b717919 -__all__ = ["ActiveSessionGetResponse", "DeviceSessions", "DevicePosture", "DevicePostureCheck", "IDP", "MTLSAuth"] +__all__ = [ + "ActiveSessionGetResponse", + "DeviceSessions", + "DevicePosture", + "DevicePostureCheck", + "Geo", + "IDP", + "MTLSAuth", +] class DeviceSessions(BaseModel): @@ -40,6 +47,10 @@ class DevicePosture(BaseModel): type: Optional[str] = None +class Geo(BaseModel): + country: Optional[str] = None + + class IDP(BaseModel): id: Optional[str] = None @@ -73,7 +84,7 @@ class ActiveSessionGetResponse(BaseModel): email: Optional[str] = None - geo: Optional[UnnamedSchemaRef6a02fe18089d53b52b2cd3949b717919] = None + geo: Optional[Geo] = None iat: Optional[float] = None diff --git a/src/cloudflare/types/zero_trust/access/users/zero_trust_identity.py b/src/cloudflare/types/zero_trust/access/users/identity.py similarity index 85% rename from src/cloudflare/types/zero_trust/access/users/zero_trust_identity.py rename to src/cloudflare/types/zero_trust/access/users/identity.py index 2fdb32862ae..51617d2d7fc 100644 --- a/src/cloudflare/types/zero_trust/access/users/zero_trust_identity.py +++ b/src/cloudflare/types/zero_trust/access/users/identity.py @@ -5,9 +5,8 @@ from pydantic import Field as FieldInfo from ....._models import BaseModel -from ..applications import UnnamedSchemaRef6a02fe18089d53b52b2cd3949b717919 -__all__ = ["ZeroTrustIdentity", "DeviceSessions", "DevicePosture", "DevicePostureCheck", "IDP", "MTLSAuth"] +__all__ = ["Identity", "DeviceSessions", "DevicePosture", "DevicePostureCheck", "Geo", "IDP", "MTLSAuth"] class DeviceSessions(BaseModel): @@ -40,6 +39,10 @@ class DevicePosture(BaseModel): type: Optional[str] = None +class Geo(BaseModel): + country: Optional[str] = None + + class IDP(BaseModel): id: Optional[str] = None @@ -58,7 +61,7 @@ class MTLSAuth(BaseModel): cert_serial: Optional[str] = None -class ZeroTrustIdentity(BaseModel): +class Identity(BaseModel): account_id: Optional[str] = None auth_status: Optional[str] = None @@ -73,7 +76,7 @@ class ZeroTrustIdentity(BaseModel): email: Optional[str] = None - geo: Optional[UnnamedSchemaRef6a02fe18089d53b52b2cd3949b717919] = None + geo: Optional[Geo] = None iat: Optional[float] = None diff --git a/src/cloudflare/types/zero_trust/access/zero_trust_group.py b/src/cloudflare/types/zero_trust/access/zero_trust_group.py index 949eda3afc7..eae4f03b8f2 100644 --- a/src/cloudflare/types/zero_trust/access/zero_trust_group.py +++ b/src/cloudflare/types/zero_trust/access/zero_trust_group.py @@ -3,8 +3,8 @@ from typing import List, Optional from datetime import datetime -from ..rule import Rule from ...._models import BaseModel +from ..access_rule import AccessRule __all__ = ["ZeroTrustGroup"] @@ -15,19 +15,19 @@ class ZeroTrustGroup(BaseModel): created_at: Optional[datetime] = None - exclude: Optional[List[Rule]] = None + exclude: Optional[List[AccessRule]] = None """Rules evaluated with a NOT logical operator. To match a policy, a user cannot meet any of the Exclude rules. """ - include: Optional[List[Rule]] = None + include: Optional[List[AccessRule]] = None """Rules evaluated with an OR logical operator. A user needs to meet only one of the Include rules. """ - is_default: Optional[List[Rule]] = None + is_default: Optional[List[AccessRule]] = None """Rules evaluated with an AND logical operator. To match a policy, a user must meet all of the Require rules. @@ -36,7 +36,7 @@ class ZeroTrustGroup(BaseModel): name: Optional[str] = None """The name of the Access group.""" - require: Optional[List[Rule]] = None + require: Optional[List[AccessRule]] = None """Rules evaluated with an AND logical operator. To match a policy, a user must meet all of the Require rules. diff --git a/src/cloudflare/types/zero_trust/device_posture_rule.py b/src/cloudflare/types/zero_trust/access_device_posture_rule.py similarity index 73% rename from src/cloudflare/types/zero_trust/device_posture_rule.py rename to src/cloudflare/types/zero_trust/access_device_posture_rule.py index 29511f6fd1e..7465d128873 100644 --- a/src/cloudflare/types/zero_trust/device_posture_rule.py +++ b/src/cloudflare/types/zero_trust/access_device_posture_rule.py @@ -2,7 +2,7 @@ from ..._models import BaseModel -__all__ = ["DevicePostureRule", "DevicePosture"] +__all__ = ["AccessDevicePostureRule", "DevicePosture"] class DevicePosture(BaseModel): @@ -10,5 +10,5 @@ class DevicePosture(BaseModel): """The ID of a device posture integration.""" -class DevicePostureRule(BaseModel): +class AccessDevicePostureRule(BaseModel): device_posture: DevicePosture diff --git a/src/cloudflare/types/zero_trust/device_posture_rule_param.py b/src/cloudflare/types/zero_trust/access_device_posture_rule_param.py similarity index 74% rename from src/cloudflare/types/zero_trust/device_posture_rule_param.py rename to src/cloudflare/types/zero_trust/access_device_posture_rule_param.py index 751a51ee89f..d67cc39b2c3 100644 --- a/src/cloudflare/types/zero_trust/device_posture_rule_param.py +++ b/src/cloudflare/types/zero_trust/access_device_posture_rule_param.py @@ -4,7 +4,7 @@ from typing_extensions import Required, TypedDict -__all__ = ["DevicePostureRuleParam", "DevicePosture"] +__all__ = ["AccessDevicePostureRuleParam", "DevicePosture"] class DevicePosture(TypedDict, total=False): @@ -12,5 +12,5 @@ class DevicePosture(TypedDict, total=False): """The ID of a device posture integration.""" -class DevicePostureRuleParam(TypedDict, total=False): +class AccessDevicePostureRuleParam(TypedDict, total=False): device_posture: Required[DevicePosture] diff --git a/src/cloudflare/types/zero_trust/include_item.py b/src/cloudflare/types/zero_trust/access_rule.py similarity index 90% rename from src/cloudflare/types/zero_trust/include_item.py rename to src/cloudflare/types/zero_trust/access_rule.py index f8f8f80b02f..9b98f25bbd5 100644 --- a/src/cloudflare/types/zero_trust/include_item.py +++ b/src/cloudflare/types/zero_trust/access_rule.py @@ -16,15 +16,15 @@ from .certificate_rule import CertificateRule from .gsuite_group_rule import GsuiteGroupRule from .service_token_rule import ServiceTokenRule -from .device_posture_rule import DevicePostureRule from .external_evaluation_rule import ExternalEvaluationRule from .github_organization_rule import GitHubOrganizationRule +from .access_device_posture_rule import AccessDevicePostureRule from .authentication_method_rule import AuthenticationMethodRule from .any_valid_service_token_rule import AnyValidServiceTokenRule -__all__ = ["IncludeItem"] +__all__ = ["AccessRule"] -IncludeItem = Union[ +AccessRule = Union[ EmailRule, EmailListRule, DomainRule, @@ -43,5 +43,5 @@ ExternalEvaluationRule, CountryRule, AuthenticationMethodRule, - DevicePostureRule, + AccessDevicePostureRule, ] diff --git a/src/cloudflare/types/zero_trust/include_item_param.py b/src/cloudflare/types/zero_trust/access_rule_param.py similarity index 90% rename from src/cloudflare/types/zero_trust/include_item_param.py rename to src/cloudflare/types/zero_trust/access_rule_param.py index 9bdb695e9a3..fc3ade70b26 100644 --- a/src/cloudflare/types/zero_trust/include_item_param.py +++ b/src/cloudflare/types/zero_trust/access_rule_param.py @@ -18,15 +18,15 @@ from .certificate_rule_param import CertificateRuleParam from .gsuite_group_rule_param import GsuiteGroupRuleParam from .service_token_rule_param import ServiceTokenRuleParam -from .device_posture_rule_param import DevicePostureRuleParam from .external_evaluation_rule_param import ExternalEvaluationRuleParam from .github_organization_rule_param import GitHubOrganizationRuleParam +from .access_device_posture_rule_param import AccessDevicePostureRuleParam from .authentication_method_rule_param import AuthenticationMethodRuleParam from .any_valid_service_token_rule_param import AnyValidServiceTokenRuleParam -__all__ = ["IncludeItemParam"] +__all__ = ["AccessRuleParam"] -IncludeItemParam = Union[ +AccessRuleParam = Union[ EmailRuleParam, EmailListRuleParam, DomainRuleParam, @@ -45,5 +45,5 @@ ExternalEvaluationRuleParam, CountryRuleParam, AuthenticationMethodRuleParam, - DevicePostureRuleParam, + AccessDevicePostureRuleParam, ] diff --git a/src/cloudflare/types/zero_trust/zero_trust_devices.py b/src/cloudflare/types/zero_trust/device.py similarity index 96% rename from src/cloudflare/types/zero_trust/zero_trust_devices.py rename to src/cloudflare/types/zero_trust/device.py index 1be55deab17..41c7eba972d 100644 --- a/src/cloudflare/types/zero_trust/zero_trust_devices.py +++ b/src/cloudflare/types/zero_trust/device.py @@ -6,7 +6,7 @@ from ..._models import BaseModel -__all__ = ["ZeroTrustDevices", "User"] +__all__ = ["Device", "User"] class User(BaseModel): @@ -20,7 +20,7 @@ class User(BaseModel): """The enrolled device user's name.""" -class ZeroTrustDevices(BaseModel): +class Device(BaseModel): id: Optional[str] = None """Device ID.""" diff --git a/src/cloudflare/types/zero_trust/devices/__init__.py b/src/cloudflare/types/zero_trust/devices/__init__.py index 520be93cb08..a9843c04ccb 100644 --- a/src/cloudflare/types/zero_trust/devices/__init__.py +++ b/src/cloudflare/types/zero_trust/devices/__init__.py @@ -3,10 +3,13 @@ from __future__ import annotations from .input import Input as Input +from .network import Network as Network from .match_item import MatchItem as MatchItem from .input_param import InputParam as InputParam from .schema_data import SchemaData as SchemaData from .schema_http import SchemaHTTP as SchemaHTTP +from .device_settings import DeviceSettings as DeviceSettings +from .settings_policy import SettingsPolicy as SettingsPolicy from .match_item_param import MatchItemParam as MatchItemParam from .schema_data_param import SchemaDataParam as SchemaDataParam from .policy_edit_params import PolicyEditParams as PolicyEditParams @@ -25,14 +28,10 @@ from .dex_test_update_params import DEXTestUpdateParams as DEXTestUpdateParams from .policy_delete_response import PolicyDeleteResponse as PolicyDeleteResponse from .unrevoke_create_params import UnrevokeCreateParams as UnrevokeCreateParams -from .device_managed_networks import DeviceManagedNetworks as DeviceManagedNetworks from .network_delete_response import NetworkDeleteResponse as NetworkDeleteResponse from .posture_delete_response import PostureDeleteResponse as PostureDeleteResponse from .dex_test_delete_response import DEXTestDeleteResponse as DEXTestDeleteResponse -from .device_posture_rule_param import DevicePostureRuleParam as DevicePostureRuleParam from .override_code_list_response import OverrideCodeListResponse as OverrideCodeListResponse -from .devices_device_settings_policy import DevicesDeviceSettingsPolicy as DevicesDeviceSettingsPolicy -from .zero_trust_account_device_settings import ZeroTrustAccountDeviceSettings as ZeroTrustAccountDeviceSettings from .unnamed_schema_ref_34ef0ad73a63c3f76ed170adca181930 import ( UnnamedSchemaRef34ef0ad73a63c3f76ed170adca181930 as UnnamedSchemaRef34ef0ad73a63c3f76ed170adca181930, ) diff --git a/src/cloudflare/types/zero_trust/devices/device_posture_rule_param.py b/src/cloudflare/types/zero_trust/devices/device_posture_rule_param.py deleted file mode 100644 index 8c4d8389e39..00000000000 --- a/src/cloudflare/types/zero_trust/devices/device_posture_rule_param.py +++ /dev/null @@ -1,64 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Literal, TypedDict - -from .input_param import InputParam -from .match_item_param import MatchItemParam - -__all__ = ["DevicePostureRuleParam"] - - -class DevicePostureRuleParam(TypedDict, total=False): - id: str - """API UUID.""" - - description: str - """The description of the device posture rule.""" - - expiration: str - """Sets the expiration time for a posture check result. - - If empty, the result remains valid until it is overwritten by new data from the - WARP client. - """ - - input: InputParam - """The value to be checked against.""" - - match: Iterable[MatchItemParam] - """The conditions that the client must match to run the rule.""" - - name: str - """The name of the device posture rule.""" - - schedule: str - """Polling frequency for the WARP client posture check. - - Default: `5m` (poll every five minutes). Minimum: `1m`. - """ - - type: Literal[ - "file", - "application", - "tanium", - "gateway", - "warp", - "disk_encryption", - "sentinelone", - "carbonblack", - "firewall", - "os_version", - "domain_joined", - "client_certificate", - "unique_client_id", - "kolide", - "tanium_s2s", - "crowdstrike_s2s", - "intune", - "workspace_one", - "sentinelone_s2s", - ] - """The type of device posture rule.""" diff --git a/src/cloudflare/types/zero_trust/devices/zero_trust_account_device_settings.py b/src/cloudflare/types/zero_trust/devices/device_settings.py similarity index 86% rename from src/cloudflare/types/zero_trust/devices/zero_trust_account_device_settings.py rename to src/cloudflare/types/zero_trust/devices/device_settings.py index 17535b12e09..6b737b04044 100644 --- a/src/cloudflare/types/zero_trust/devices/zero_trust_account_device_settings.py +++ b/src/cloudflare/types/zero_trust/devices/device_settings.py @@ -4,10 +4,10 @@ from ...._models import BaseModel -__all__ = ["ZeroTrustAccountDeviceSettings"] +__all__ = ["DeviceSettings"] -class ZeroTrustAccountDeviceSettings(BaseModel): +class DeviceSettings(BaseModel): gateway_proxy_enabled: Optional[bool] = None """Enable gateway proxy filtering on TCP.""" diff --git a/src/cloudflare/types/zero_trust/devices/dex_test_create_params.py b/src/cloudflare/types/zero_trust/devices/dex_test_create_params.py index ec477049610..340d9d17999 100644 --- a/src/cloudflare/types/zero_trust/devices/dex_test_create_params.py +++ b/src/cloudflare/types/zero_trust/devices/dex_test_create_params.py @@ -2,11 +2,12 @@ from __future__ import annotations +from typing import Iterable from typing_extensions import Required, TypedDict from .schema_data_param import SchemaDataParam -__all__ = ["DEXTestCreateParams"] +__all__ = ["DEXTestCreateParams", "TargetPolicy"] class DEXTestCreateParams(TypedDict, total=False): @@ -29,3 +30,19 @@ class DEXTestCreateParams(TypedDict, total=False): description: str """Additional details about the test.""" + + target_policies: Iterable[TargetPolicy] + """Device settings profiles targeted by this test""" + + targeted: bool + + +class TargetPolicy(TypedDict, total=False): + id: str + """The id of the device settings profile""" + + default: bool + """Whether the profile is the account default""" + + name: str + """The name of the device settings profile""" diff --git a/src/cloudflare/types/zero_trust/devices/dex_test_update_params.py b/src/cloudflare/types/zero_trust/devices/dex_test_update_params.py index 0763dd5273b..1e09ce4d599 100644 --- a/src/cloudflare/types/zero_trust/devices/dex_test_update_params.py +++ b/src/cloudflare/types/zero_trust/devices/dex_test_update_params.py @@ -2,11 +2,12 @@ from __future__ import annotations +from typing import Iterable from typing_extensions import Required, TypedDict from .schema_data_param import SchemaDataParam -__all__ = ["DEXTestUpdateParams"] +__all__ = ["DEXTestUpdateParams", "TargetPolicy"] class DEXTestUpdateParams(TypedDict, total=False): @@ -29,3 +30,19 @@ class DEXTestUpdateParams(TypedDict, total=False): description: str """Additional details about the test.""" + + target_policies: Iterable[TargetPolicy] + """Device settings profiles targeted by this test""" + + targeted: bool + + +class TargetPolicy(TypedDict, total=False): + id: str + """The id of the device settings profile""" + + default: bool + """Whether the profile is the account default""" + + name: str + """The name of the device settings profile""" diff --git a/src/cloudflare/types/zero_trust/devices/device_managed_networks.py b/src/cloudflare/types/zero_trust/devices/network.py similarity index 92% rename from src/cloudflare/types/zero_trust/devices/device_managed_networks.py rename to src/cloudflare/types/zero_trust/devices/network.py index b0d21f88d0b..c14db25c5e8 100644 --- a/src/cloudflare/types/zero_trust/devices/device_managed_networks.py +++ b/src/cloudflare/types/zero_trust/devices/network.py @@ -5,7 +5,7 @@ from ...._models import BaseModel -__all__ = ["DeviceManagedNetworks", "Config"] +__all__ = ["Network", "Config"] class Config(BaseModel): @@ -23,7 +23,7 @@ class Config(BaseModel): """ -class DeviceManagedNetworks(BaseModel): +class Network(BaseModel): config: Optional[Config] = None """ The configuration object containing information for the WARP client to detect diff --git a/src/cloudflare/types/zero_trust/devices/network_delete_response.py b/src/cloudflare/types/zero_trust/devices/network_delete_response.py index 33c32453dee..42c17ee3722 100644 --- a/src/cloudflare/types/zero_trust/devices/network_delete_response.py +++ b/src/cloudflare/types/zero_trust/devices/network_delete_response.py @@ -2,8 +2,8 @@ from typing import List -from .device_managed_networks import DeviceManagedNetworks +from .network import Network __all__ = ["NetworkDeleteResponse"] -NetworkDeleteResponse = List[DeviceManagedNetworks] +NetworkDeleteResponse = List[Network] diff --git a/src/cloudflare/types/zero_trust/devices/policies/__init__.py b/src/cloudflare/types/zero_trust/devices/policies/__init__.py index 8e3419b0673..1534f635ab8 100644 --- a/src/cloudflare/types/zero_trust/devices/policies/__init__.py +++ b/src/cloudflare/types/zero_trust/devices/policies/__init__.py @@ -2,19 +2,19 @@ from __future__ import annotations -from .devices_split_tunnel import DevicesSplitTunnel as DevicesSplitTunnel +from .fallback_domain import FallbackDomain as FallbackDomain from .exclude_get_response import ExcludeGetResponse as ExcludeGetResponse from .include_get_response import IncludeGetResponse as IncludeGetResponse +from .split_tunnel_exclude import SplitTunnelExclude as SplitTunnelExclude +from .split_tunnel_include import SplitTunnelInclude as SplitTunnelInclude from .exclude_update_params import ExcludeUpdateParams as ExcludeUpdateParams +from .fallback_domain_param import FallbackDomainParam as FallbackDomainParam from .include_update_params import IncludeUpdateParams as IncludeUpdateParams -from .devices_fallback_domain import DevicesFallbackDomain as DevicesFallbackDomain from .exclude_update_response import ExcludeUpdateResponse as ExcludeUpdateResponse from .include_update_response import IncludeUpdateResponse as IncludeUpdateResponse -from .devices_split_tunnel_param import DevicesSplitTunnelParam as DevicesSplitTunnelParam +from .split_tunnel_exclude_param import SplitTunnelExcludeParam as SplitTunnelExcludeParam +from .split_tunnel_include_param import SplitTunnelIncludeParam as SplitTunnelIncludeParam from .default_policy_get_response import DefaultPolicyGetResponse as DefaultPolicyGetResponse -from .devices_split_tunnel_include import DevicesSplitTunnelInclude as DevicesSplitTunnelInclude from .fallback_domain_get_response import FallbackDomainGetResponse as FallbackDomainGetResponse -from .devices_fallback_domain_param import DevicesFallbackDomainParam as DevicesFallbackDomainParam from .fallback_domain_update_params import FallbackDomainUpdateParams as FallbackDomainUpdateParams from .fallback_domain_update_response import FallbackDomainUpdateResponse as FallbackDomainUpdateResponse -from .devices_split_tunnel_include_param import DevicesSplitTunnelIncludeParam as DevicesSplitTunnelIncludeParam diff --git a/src/cloudflare/types/zero_trust/devices/policies/exclude_get_response.py b/src/cloudflare/types/zero_trust/devices/policies/exclude_get_response.py index 824f866d464..98a5259c101 100644 --- a/src/cloudflare/types/zero_trust/devices/policies/exclude_get_response.py +++ b/src/cloudflare/types/zero_trust/devices/policies/exclude_get_response.py @@ -2,8 +2,8 @@ from typing import List -from .devices_split_tunnel import DevicesSplitTunnel +from .split_tunnel_exclude import SplitTunnelExclude __all__ = ["ExcludeGetResponse"] -ExcludeGetResponse = List[DevicesSplitTunnel] +ExcludeGetResponse = List[SplitTunnelExclude] diff --git a/src/cloudflare/types/zero_trust/devices/policies/exclude_update_params.py b/src/cloudflare/types/zero_trust/devices/policies/exclude_update_params.py index 41121b97c0a..21ac467a9eb 100644 --- a/src/cloudflare/types/zero_trust/devices/policies/exclude_update_params.py +++ b/src/cloudflare/types/zero_trust/devices/policies/exclude_update_params.py @@ -5,7 +5,7 @@ from typing import Iterable from typing_extensions import Required, TypedDict -from .devices_split_tunnel_param import DevicesSplitTunnelParam +from .split_tunnel_exclude_param import SplitTunnelExcludeParam __all__ = ["ExcludeUpdateParams"] @@ -13,4 +13,4 @@ class ExcludeUpdateParams(TypedDict, total=False): account_id: Required[str] - body: Required[Iterable[DevicesSplitTunnelParam]] + body: Required[Iterable[SplitTunnelExcludeParam]] diff --git a/src/cloudflare/types/zero_trust/devices/policies/exclude_update_response.py b/src/cloudflare/types/zero_trust/devices/policies/exclude_update_response.py index 4aa7da541dd..1174ff1c3ed 100644 --- a/src/cloudflare/types/zero_trust/devices/policies/exclude_update_response.py +++ b/src/cloudflare/types/zero_trust/devices/policies/exclude_update_response.py @@ -2,8 +2,8 @@ from typing import List -from .devices_split_tunnel import DevicesSplitTunnel +from .split_tunnel_exclude import SplitTunnelExclude __all__ = ["ExcludeUpdateResponse"] -ExcludeUpdateResponse = List[DevicesSplitTunnel] +ExcludeUpdateResponse = List[SplitTunnelExclude] diff --git a/src/cloudflare/types/zero_trust/devices/policies/devices_fallback_domain.py b/src/cloudflare/types/zero_trust/devices/policies/fallback_domain.py similarity index 85% rename from src/cloudflare/types/zero_trust/devices/policies/devices_fallback_domain.py rename to src/cloudflare/types/zero_trust/devices/policies/fallback_domain.py index b8779327e4f..41c5d376a14 100644 --- a/src/cloudflare/types/zero_trust/devices/policies/devices_fallback_domain.py +++ b/src/cloudflare/types/zero_trust/devices/policies/fallback_domain.py @@ -4,10 +4,10 @@ from ....._models import BaseModel -__all__ = ["DevicesFallbackDomain"] +__all__ = ["FallbackDomain"] -class DevicesFallbackDomain(BaseModel): +class FallbackDomain(BaseModel): suffix: str """The domain suffix to match when resolving locally.""" diff --git a/src/cloudflare/types/zero_trust/devices/policies/fallback_domain_get_response.py b/src/cloudflare/types/zero_trust/devices/policies/fallback_domain_get_response.py index d71cd600688..a55049118d5 100644 --- a/src/cloudflare/types/zero_trust/devices/policies/fallback_domain_get_response.py +++ b/src/cloudflare/types/zero_trust/devices/policies/fallback_domain_get_response.py @@ -2,8 +2,8 @@ from typing import List -from .devices_fallback_domain import DevicesFallbackDomain +from .fallback_domain import FallbackDomain __all__ = ["FallbackDomainGetResponse"] -FallbackDomainGetResponse = List[DevicesFallbackDomain] +FallbackDomainGetResponse = List[FallbackDomain] diff --git a/src/cloudflare/types/zero_trust/devices/policies/devices_fallback_domain_param.py b/src/cloudflare/types/zero_trust/devices/policies/fallback_domain_param.py similarity index 83% rename from src/cloudflare/types/zero_trust/devices/policies/devices_fallback_domain_param.py rename to src/cloudflare/types/zero_trust/devices/policies/fallback_domain_param.py index 41f28722cb5..67428e45afd 100644 --- a/src/cloudflare/types/zero_trust/devices/policies/devices_fallback_domain_param.py +++ b/src/cloudflare/types/zero_trust/devices/policies/fallback_domain_param.py @@ -5,10 +5,10 @@ from typing import Iterable from typing_extensions import Required, TypedDict -__all__ = ["DevicesFallbackDomainParam"] +__all__ = ["FallbackDomainParam"] -class DevicesFallbackDomainParam(TypedDict, total=False): +class FallbackDomainParam(TypedDict, total=False): suffix: Required[str] """The domain suffix to match when resolving locally.""" diff --git a/src/cloudflare/types/zero_trust/devices/policies/fallback_domain_update_params.py b/src/cloudflare/types/zero_trust/devices/policies/fallback_domain_update_params.py index acd8bbb0eb9..d88155dca61 100644 --- a/src/cloudflare/types/zero_trust/devices/policies/fallback_domain_update_params.py +++ b/src/cloudflare/types/zero_trust/devices/policies/fallback_domain_update_params.py @@ -5,7 +5,7 @@ from typing import Iterable from typing_extensions import Required, TypedDict -from .devices_fallback_domain_param import DevicesFallbackDomainParam +from .fallback_domain_param import FallbackDomainParam __all__ = ["FallbackDomainUpdateParams"] @@ -13,4 +13,4 @@ class FallbackDomainUpdateParams(TypedDict, total=False): account_id: Required[str] - body: Required[Iterable[DevicesFallbackDomainParam]] + body: Required[Iterable[FallbackDomainParam]] diff --git a/src/cloudflare/types/zero_trust/devices/policies/fallback_domain_update_response.py b/src/cloudflare/types/zero_trust/devices/policies/fallback_domain_update_response.py index 3b2c8e5b25b..6a97b5caa93 100644 --- a/src/cloudflare/types/zero_trust/devices/policies/fallback_domain_update_response.py +++ b/src/cloudflare/types/zero_trust/devices/policies/fallback_domain_update_response.py @@ -2,8 +2,8 @@ from typing import List -from .devices_fallback_domain import DevicesFallbackDomain +from .fallback_domain import FallbackDomain __all__ = ["FallbackDomainUpdateResponse"] -FallbackDomainUpdateResponse = List[DevicesFallbackDomain] +FallbackDomainUpdateResponse = List[FallbackDomain] diff --git a/src/cloudflare/types/zero_trust/devices/policies/include_get_response.py b/src/cloudflare/types/zero_trust/devices/policies/include_get_response.py index d7d9f61e972..1a09a0101a4 100644 --- a/src/cloudflare/types/zero_trust/devices/policies/include_get_response.py +++ b/src/cloudflare/types/zero_trust/devices/policies/include_get_response.py @@ -2,8 +2,8 @@ from typing import List -from .devices_split_tunnel_include import DevicesSplitTunnelInclude +from .split_tunnel_include import SplitTunnelInclude __all__ = ["IncludeGetResponse"] -IncludeGetResponse = List[DevicesSplitTunnelInclude] +IncludeGetResponse = List[SplitTunnelInclude] diff --git a/src/cloudflare/types/zero_trust/devices/policies/include_update_params.py b/src/cloudflare/types/zero_trust/devices/policies/include_update_params.py index 467152a8553..ac7f05b4141 100644 --- a/src/cloudflare/types/zero_trust/devices/policies/include_update_params.py +++ b/src/cloudflare/types/zero_trust/devices/policies/include_update_params.py @@ -5,7 +5,7 @@ from typing import Iterable from typing_extensions import Required, TypedDict -from .devices_split_tunnel_include_param import DevicesSplitTunnelIncludeParam +from .split_tunnel_include_param import SplitTunnelIncludeParam __all__ = ["IncludeUpdateParams"] @@ -13,4 +13,4 @@ class IncludeUpdateParams(TypedDict, total=False): account_id: Required[str] - body: Required[Iterable[DevicesSplitTunnelIncludeParam]] + body: Required[Iterable[SplitTunnelIncludeParam]] diff --git a/src/cloudflare/types/zero_trust/devices/policies/include_update_response.py b/src/cloudflare/types/zero_trust/devices/policies/include_update_response.py index 18529735936..c5e7d02c0d7 100644 --- a/src/cloudflare/types/zero_trust/devices/policies/include_update_response.py +++ b/src/cloudflare/types/zero_trust/devices/policies/include_update_response.py @@ -2,8 +2,8 @@ from typing import List -from .devices_split_tunnel_include import DevicesSplitTunnelInclude +from .split_tunnel_include import SplitTunnelInclude __all__ = ["IncludeUpdateResponse"] -IncludeUpdateResponse = List[DevicesSplitTunnelInclude] +IncludeUpdateResponse = List[SplitTunnelInclude] diff --git a/src/cloudflare/types/zero_trust/devices/policies/devices_split_tunnel.py b/src/cloudflare/types/zero_trust/devices/policies/split_tunnel_exclude.py similarity index 88% rename from src/cloudflare/types/zero_trust/devices/policies/devices_split_tunnel.py rename to src/cloudflare/types/zero_trust/devices/policies/split_tunnel_exclude.py index 6644d40583c..cd78772008c 100644 --- a/src/cloudflare/types/zero_trust/devices/policies/devices_split_tunnel.py +++ b/src/cloudflare/types/zero_trust/devices/policies/split_tunnel_exclude.py @@ -4,10 +4,10 @@ from ....._models import BaseModel -__all__ = ["DevicesSplitTunnel"] +__all__ = ["SplitTunnelExclude"] -class DevicesSplitTunnel(BaseModel): +class SplitTunnelExclude(BaseModel): address: str """The address in CIDR format to exclude from the tunnel. diff --git a/src/cloudflare/types/zero_trust/devices/policies/devices_split_tunnel_param.py b/src/cloudflare/types/zero_trust/devices/policies/split_tunnel_exclude_param.py similarity index 86% rename from src/cloudflare/types/zero_trust/devices/policies/devices_split_tunnel_param.py rename to src/cloudflare/types/zero_trust/devices/policies/split_tunnel_exclude_param.py index 4e506e978fa..99998a52335 100644 --- a/src/cloudflare/types/zero_trust/devices/policies/devices_split_tunnel_param.py +++ b/src/cloudflare/types/zero_trust/devices/policies/split_tunnel_exclude_param.py @@ -4,10 +4,10 @@ from typing_extensions import Required, TypedDict -__all__ = ["DevicesSplitTunnelParam"] +__all__ = ["SplitTunnelExcludeParam"] -class DevicesSplitTunnelParam(TypedDict, total=False): +class SplitTunnelExcludeParam(TypedDict, total=False): address: Required[str] """The address in CIDR format to exclude from the tunnel. diff --git a/src/cloudflare/types/zero_trust/devices/policies/devices_split_tunnel_include.py b/src/cloudflare/types/zero_trust/devices/policies/split_tunnel_include.py similarity index 86% rename from src/cloudflare/types/zero_trust/devices/policies/devices_split_tunnel_include.py rename to src/cloudflare/types/zero_trust/devices/policies/split_tunnel_include.py index c067eafb1ad..0791d7c0eda 100644 --- a/src/cloudflare/types/zero_trust/devices/policies/devices_split_tunnel_include.py +++ b/src/cloudflare/types/zero_trust/devices/policies/split_tunnel_include.py @@ -4,10 +4,10 @@ from ....._models import BaseModel -__all__ = ["DevicesSplitTunnelInclude"] +__all__ = ["SplitTunnelInclude"] -class DevicesSplitTunnelInclude(BaseModel): +class SplitTunnelInclude(BaseModel): address: str """The address in CIDR format to include in the tunnel. diff --git a/src/cloudflare/types/zero_trust/devices/policies/devices_split_tunnel_include_param.py b/src/cloudflare/types/zero_trust/devices/policies/split_tunnel_include_param.py similarity index 83% rename from src/cloudflare/types/zero_trust/devices/policies/devices_split_tunnel_include_param.py rename to src/cloudflare/types/zero_trust/devices/policies/split_tunnel_include_param.py index 85707e7270e..70474cc5f5f 100644 --- a/src/cloudflare/types/zero_trust/devices/policies/devices_split_tunnel_include_param.py +++ b/src/cloudflare/types/zero_trust/devices/policies/split_tunnel_include_param.py @@ -4,10 +4,10 @@ from typing_extensions import Required, TypedDict -__all__ = ["DevicesSplitTunnelIncludeParam"] +__all__ = ["SplitTunnelIncludeParam"] -class DevicesSplitTunnelIncludeParam(TypedDict, total=False): +class SplitTunnelIncludeParam(TypedDict, total=False): address: Required[str] """The address in CIDR format to include in the tunnel. diff --git a/src/cloudflare/types/zero_trust/devices/policy_delete_response.py b/src/cloudflare/types/zero_trust/devices/policy_delete_response.py index aecbb1e54ca..1e4273f04e7 100644 --- a/src/cloudflare/types/zero_trust/devices/policy_delete_response.py +++ b/src/cloudflare/types/zero_trust/devices/policy_delete_response.py @@ -2,8 +2,8 @@ from typing import List -from .devices_device_settings_policy import DevicesDeviceSettingsPolicy +from .settings_policy import SettingsPolicy __all__ = ["PolicyDeleteResponse"] -PolicyDeleteResponse = List[DevicesDeviceSettingsPolicy] +PolicyDeleteResponse = List[SettingsPolicy] diff --git a/src/cloudflare/types/zero_trust/devices/schema_http.py b/src/cloudflare/types/zero_trust/devices/schema_http.py index 3abe9e2f052..43e763610ff 100644 --- a/src/cloudflare/types/zero_trust/devices/schema_http.py +++ b/src/cloudflare/types/zero_trust/devices/schema_http.py @@ -1,11 +1,22 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import List, Optional from ...._models import BaseModel from .schema_data import SchemaData -__all__ = ["SchemaHTTP"] +__all__ = ["SchemaHTTP", "TargetPolicy"] + + +class TargetPolicy(BaseModel): + id: Optional[str] = None + """The id of the device settings profile""" + + default: Optional[bool] = None + """Whether the profile is the account default""" + + name: Optional[str] = None + """The name of the device settings profile""" class SchemaHTTP(BaseModel): @@ -26,3 +37,8 @@ class SchemaHTTP(BaseModel): description: Optional[str] = None """Additional details about the test.""" + + target_policies: Optional[List[TargetPolicy]] = None + """Device settings profiles targeted by this test""" + + targeted: Optional[bool] = None diff --git a/src/cloudflare/types/zero_trust/devices/devices_device_settings_policy.py b/src/cloudflare/types/zero_trust/devices/settings_policy.py similarity index 83% rename from src/cloudflare/types/zero_trust/devices/devices_device_settings_policy.py rename to src/cloudflare/types/zero_trust/devices/settings_policy.py index ddad4b60b9d..a98d84648f5 100644 --- a/src/cloudflare/types/zero_trust/devices/devices_device_settings_policy.py +++ b/src/cloudflare/types/zero_trust/devices/settings_policy.py @@ -2,10 +2,10 @@ from typing import List, Optional -from .policies import DevicesSplitTunnel, DevicesFallbackDomain, DevicesSplitTunnelInclude +from .policies import FallbackDomain, SplitTunnelExclude, SplitTunnelInclude from ...._models import BaseModel -__all__ = ["DevicesDeviceSettingsPolicy", "ServiceModeV2"] +__all__ = ["SettingsPolicy", "ServiceModeV2", "TargetTest"] class ServiceModeV2(BaseModel): @@ -16,7 +16,15 @@ class ServiceModeV2(BaseModel): """The port number when used with proxy mode.""" -class DevicesDeviceSettingsPolicy(BaseModel): +class TargetTest(BaseModel): + id: Optional[str] = None + """The id of the DEX test targeting this policy""" + + name: Optional[str] = None + """The name of the DEX test targeting this policy""" + + +class SettingsPolicy(BaseModel): allow_mode_switch: Optional[bool] = None """Whether to allow the user to switch WARP between modes.""" @@ -51,16 +59,16 @@ class DevicesDeviceSettingsPolicy(BaseModel): enabled: Optional[bool] = None """Whether the policy will be applied to matching devices.""" - exclude: Optional[List[DevicesSplitTunnel]] = None + exclude: Optional[List[SplitTunnelExclude]] = None exclude_office_ips: Optional[bool] = None """Whether to add Microsoft IPs to Split Tunnel exclusions.""" - fallback_domains: Optional[List[DevicesFallbackDomain]] = None + fallback_domains: Optional[List[FallbackDomain]] = None gateway_unique_id: Optional[str] = None - include: Optional[List[DevicesSplitTunnelInclude]] = None + include: Optional[List[SplitTunnelInclude]] = None lan_allow_minutes: Optional[float] = None """The amount of time in minutes a user is allowed access to their LAN. @@ -101,3 +109,5 @@ class DevicesDeviceSettingsPolicy(BaseModel): """ Whether to allow the user to turn off the WARP switch and disconnect the client. """ + + target_tests: Optional[List[TargetTest]] = None diff --git a/src/cloudflare/types/zero_trust/dex/__init__.py b/src/cloudflare/types/zero_trust/dex/__init__.py index 1d7616674ef..c5e2baab0f3 100644 --- a/src/cloudflare/types/zero_trust/dex/__init__.py +++ b/src/cloudflare/types/zero_trust/dex/__init__.py @@ -4,18 +4,18 @@ from .tests import Tests as Tests from .live_stat import LiveStat as LiveStat +from .traceroute import Traceroute as Traceroute from .http_details import HTTPDetails as HTTPDetails +from .network_path import NetworkPath as NetworkPath from .colo_list_params import ColoListParams as ColoListParams from .test_list_params import TestListParams as TestListParams from .test_list_response import TestListResponse as TestListResponse -from .traceroute_details import TracerouteDetails as TracerouteDetails from .http_test_get_params import HTTPTestGetParams as HTTPTestGetParams from .aggregate_time_period import AggregateTimePeriod as AggregateTimePeriod from .fleet_status_live_params import FleetStatusLiveParams as FleetStatusLiveParams from .fleet_status_live_response import FleetStatusLiveResponse as FleetStatusLiveResponse from .traceroute_test_get_params import TracerouteTestGetParams as TracerouteTestGetParams -from .traceroute_test_network_path import TracerouteTestNetworkPath as TracerouteTestNetworkPath from .fleet_status_over_time_params import FleetStatusOverTimeParams as FleetStatusOverTimeParams -from .traceroute_details_percentiles import TracerouteDetailsPercentiles as TracerouteDetailsPercentiles from .traceroute_test_percentiles_params import TracerouteTestPercentilesParams as TracerouteTestPercentilesParams from .traceroute_test_network_path_params import TracerouteTestNetworkPathParams as TracerouteTestNetworkPathParams +from .traceroute_test_percentiles_response import TracerouteTestPercentilesResponse as TracerouteTestPercentilesResponse diff --git a/src/cloudflare/types/zero_trust/dex/fleet_status/__init__.py b/src/cloudflare/types/zero_trust/dex/fleet_status/__init__.py index ee1eaaba857..62c9574d136 100644 --- a/src/cloudflare/types/zero_trust/dex/fleet_status/__init__.py +++ b/src/cloudflare/types/zero_trust/dex/fleet_status/__init__.py @@ -2,5 +2,5 @@ from __future__ import annotations -from .device import Device as Device from .device_list_params import DeviceListParams as DeviceListParams +from .device_list_response import DeviceListResponse as DeviceListResponse diff --git a/src/cloudflare/types/zero_trust/dex/fleet_status/device.py b/src/cloudflare/types/zero_trust/dex/fleet_status/device_list_response.py similarity index 91% rename from src/cloudflare/types/zero_trust/dex/fleet_status/device.py rename to src/cloudflare/types/zero_trust/dex/fleet_status/device_list_response.py index 435acd2d2b7..cc90fd794a6 100644 --- a/src/cloudflare/types/zero_trust/dex/fleet_status/device.py +++ b/src/cloudflare/types/zero_trust/dex/fleet_status/device_list_response.py @@ -6,10 +6,10 @@ from ....._models import BaseModel -__all__ = ["Device"] +__all__ = ["DeviceListResponse"] -class Device(BaseModel): +class DeviceListResponse(BaseModel): colo: str """Cloudflare colo""" diff --git a/src/cloudflare/types/zero_trust/dex/network_path.py b/src/cloudflare/types/zero_trust/dex/network_path.py new file mode 100644 index 00000000000..679f83c929a --- /dev/null +++ b/src/cloudflare/types/zero_trust/dex/network_path.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from ...._models import BaseModel + +__all__ = ["NetworkPath"] + + +class NetworkPath(BaseModel): + id: str + """API Resource UUID tag.""" + + device_name: Optional[str] = FieldInfo(alias="deviceName", default=None) + + interval: Optional[str] = None + """The interval at which the Traceroute synthetic application test is set to run.""" + + kind: Optional[Literal["traceroute"]] = None + + name: Optional[str] = None + + network_path: Optional[NetworkPath] = FieldInfo(alias="networkPath", default=None) + + url: Optional[str] = None + """The host of the Traceroute synthetic application test""" diff --git a/src/cloudflare/types/zero_trust/dex/traceroute_details.py b/src/cloudflare/types/zero_trust/dex/traceroute.py similarity index 98% rename from src/cloudflare/types/zero_trust/dex/traceroute_details.py rename to src/cloudflare/types/zero_trust/dex/traceroute.py index 553005a8aff..15dfc3204d7 100644 --- a/src/cloudflare/types/zero_trust/dex/traceroute_details.py +++ b/src/cloudflare/types/zero_trust/dex/traceroute.py @@ -10,7 +10,7 @@ from ..unnamed_schema_ref_bf9e2abcf1b78a6cab8e6e29e2228a11 import UnnamedSchemaRefBf9e2abcf1b78a6cab8e6e29e2228a11 __all__ = [ - "TracerouteDetails", + "Traceroute", "TracerouteStats", "TracerouteStatsAvailabilityPct", "TracerouteStatsAvailabilityPctSlot", @@ -128,7 +128,7 @@ class TracerouteStatsByColo(BaseModel): """Count of unique devices that have run this test in the given time period""" -class TracerouteDetails(BaseModel): +class Traceroute(BaseModel): host: str """The host of the Traceroute synthetic application test""" diff --git a/src/cloudflare/types/zero_trust/dex/traceroute_test_network_path.py b/src/cloudflare/types/zero_trust/dex/traceroute_test_network_path.py deleted file mode 100644 index ba7ab069c02..00000000000 --- a/src/cloudflare/types/zero_trust/dex/traceroute_test_network_path.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional -from typing_extensions import Literal - -from pydantic import Field as FieldInfo - -from ...._models import BaseModel - -__all__ = ["TracerouteTestNetworkPath", "NetworkPath", "NetworkPathSlot", "NetworkPathSampling"] - - -class NetworkPathSlot(BaseModel): - id: str - """API Resource UUID tag.""" - - client_to_app_rtt_ms: Optional[int] = FieldInfo(alias="clientToAppRttMs", default=None) - """Round trip time in ms of the client to app mile""" - - client_to_cf_egress_rtt_ms: Optional[int] = FieldInfo(alias="clientToCfEgressRttMs", default=None) - """Round trip time in ms of the client to Cloudflare egress mile""" - - client_to_cf_ingress_rtt_ms: Optional[int] = FieldInfo(alias="clientToCfIngressRttMs", default=None) - """Round trip time in ms of the client to Cloudflare ingress mile""" - - timestamp: str - - client_to_isp_rtt_ms: Optional[int] = FieldInfo(alias="clientToIspRttMs", default=None) - """Round trip time in ms of the client to ISP mile""" - - -class NetworkPathSampling(BaseModel): - unit: Literal["hours"] - - value: int - - -class NetworkPath(BaseModel): - slots: List[NetworkPathSlot] - - sampling: Optional[NetworkPathSampling] = None - """Specifies the sampling applied, if any, to the slots response. - - When sampled, results shown represent the first test run to the start of each - sampling interval. - """ - - -class TracerouteTestNetworkPath(BaseModel): - id: str - """API Resource UUID tag.""" - - device_name: Optional[str] = FieldInfo(alias="deviceName", default=None) - - interval: Optional[str] = None - """The interval at which the Traceroute synthetic application test is set to run.""" - - kind: Optional[Literal["traceroute"]] = None - - name: Optional[str] = None - - network_path: Optional[NetworkPath] = FieldInfo(alias="networkPath", default=None) - - url: Optional[str] = None - """The host of the Traceroute synthetic application test""" diff --git a/src/cloudflare/types/zero_trust/dex/traceroute_details_percentiles.py b/src/cloudflare/types/zero_trust/dex/traceroute_test_percentiles_response.py similarity index 83% rename from src/cloudflare/types/zero_trust/dex/traceroute_details_percentiles.py rename to src/cloudflare/types/zero_trust/dex/traceroute_test_percentiles_response.py index 11ad0d8a2da..8644cb3fbd2 100644 --- a/src/cloudflare/types/zero_trust/dex/traceroute_details_percentiles.py +++ b/src/cloudflare/types/zero_trust/dex/traceroute_test_percentiles_response.py @@ -7,10 +7,10 @@ from ...._models import BaseModel from ..percentiles import Percentiles -__all__ = ["TracerouteDetailsPercentiles"] +__all__ = ["TracerouteTestPercentilesResponse"] -class TracerouteDetailsPercentiles(BaseModel): +class TracerouteTestPercentilesResponse(BaseModel): hops_count: Optional[Percentiles] = FieldInfo(alias="hopsCount", default=None) packet_loss_pct: Optional[Percentiles] = FieldInfo(alias="packetLossPct", default=None) diff --git a/src/cloudflare/types/zero_trust/dex/traceroute_test_results/__init__.py b/src/cloudflare/types/zero_trust/dex/traceroute_test_results/__init__.py index 702f07bf442..ed98d6fa184 100644 --- a/src/cloudflare/types/zero_trust/dex/traceroute_test_results/__init__.py +++ b/src/cloudflare/types/zero_trust/dex/traceroute_test_results/__init__.py @@ -2,4 +2,4 @@ from __future__ import annotations -from .traceroute_test_result_network_path import TracerouteTestResultNetworkPath as TracerouteTestResultNetworkPath +from .network_path import NetworkPath as NetworkPath diff --git a/src/cloudflare/types/zero_trust/dex/traceroute_test_results/traceroute_test_result_network_path.py b/src/cloudflare/types/zero_trust/dex/traceroute_test_results/network_path.py similarity index 92% rename from src/cloudflare/types/zero_trust/dex/traceroute_test_results/traceroute_test_result_network_path.py rename to src/cloudflare/types/zero_trust/dex/traceroute_test_results/network_path.py index ec1fd2ed7a1..17c0f78cf28 100644 --- a/src/cloudflare/types/zero_trust/dex/traceroute_test_results/traceroute_test_result_network_path.py +++ b/src/cloudflare/types/zero_trust/dex/traceroute_test_results/network_path.py @@ -7,7 +7,7 @@ from ....._models import BaseModel -__all__ = ["TracerouteTestResultNetworkPath", "Hop", "HopLocation"] +__all__ = ["NetworkPath", "Hop", "HopLocation"] class HopLocation(BaseModel): @@ -38,7 +38,7 @@ class Hop(BaseModel): rtt_ms: Optional[int] = FieldInfo(alias="rttMs", default=None) -class TracerouteTestResultNetworkPath(BaseModel): +class NetworkPath(BaseModel): hops: List[Hop] """an array of the hops taken by the device to reach the end destination""" diff --git a/src/cloudflare/types/zero_trust/dlp/__init__.py b/src/cloudflare/types/zero_trust/dlp/__init__.py index 7665c6baccc..affc5de7787 100644 --- a/src/cloudflare/types/zero_trust/dlp/__init__.py +++ b/src/cloudflare/types/zero_trust/dlp/__init__.py @@ -3,7 +3,7 @@ from __future__ import annotations from .dataset import Dataset as Dataset -from .dlp_profile import DLPProfile as DLPProfile +from .profile import Profile as Profile from .dataset_array import DatasetArray as DatasetArray from .dataset_creation import DatasetCreation as DatasetCreation from .context_awareness import ContextAwareness as ContextAwareness @@ -13,14 +13,13 @@ from .dataset_update_params import DatasetUpdateParams as DatasetUpdateParams from .context_awareness_param import ContextAwarenessParam as ContextAwarenessParam from .pattern_validate_params import PatternValidateParams as PatternValidateParams +from .payload_log_get_response import PayloadLogGetResponse as PayloadLogGetResponse from .skip_configuration_param import SkipConfigurationParam as SkipConfigurationParam from .payload_log_update_params import PayloadLogUpdateParams as PayloadLogUpdateParams +from .payload_log_update_response import PayloadLogUpdateResponse as PayloadLogUpdateResponse from .unnamed_schema_ref_c105db122868c71badeac3b4822ad6b1 import ( UnnamedSchemaRefC105db122868c71badeac3b4822ad6b1 as UnnamedSchemaRefC105db122868c71badeac3b4822ad6b1, ) -from .unnamed_schema_ref_e31ff4936b1b42746e8cb62bbc87f2e5 import ( - UnnamedSchemaRefE31ff4936b1b42746e8cb62bbc87f2e5 as UnnamedSchemaRefE31ff4936b1b42746e8cb62bbc87f2e5, -) from .unnamed_schema_ref_e38bfdf1acf5a4bfada6779c79528bc0 import ( UnnamedSchemaRefE38bfdf1acf5a4bfada6779c79528bc0 as UnnamedSchemaRefE38bfdf1acf5a4bfada6779c79528bc0, ) diff --git a/src/cloudflare/types/zero_trust/dlp/unnamed_schema_ref_e31ff4936b1b42746e8cb62bbc87f2e5.py b/src/cloudflare/types/zero_trust/dlp/payload_log_get_response.py similarity index 59% rename from src/cloudflare/types/zero_trust/dlp/unnamed_schema_ref_e31ff4936b1b42746e8cb62bbc87f2e5.py rename to src/cloudflare/types/zero_trust/dlp/payload_log_get_response.py index 126bb2753b0..df752b6d9d3 100644 --- a/src/cloudflare/types/zero_trust/dlp/unnamed_schema_ref_e31ff4936b1b42746e8cb62bbc87f2e5.py +++ b/src/cloudflare/types/zero_trust/dlp/payload_log_get_response.py @@ -4,8 +4,8 @@ from ...._models import BaseModel -__all__ = ["UnnamedSchemaRefE31ff4936b1b42746e8cb62bbc87f2e5"] +__all__ = ["PayloadLogGetResponse"] -class UnnamedSchemaRefE31ff4936b1b42746e8cb62bbc87f2e5(BaseModel): +class PayloadLogGetResponse(BaseModel): public_key: Optional[str] = None diff --git a/src/cloudflare/types/zero_trust/dlp/payload_log_update_response.py b/src/cloudflare/types/zero_trust/dlp/payload_log_update_response.py new file mode 100644 index 00000000000..5c5fcb53bc5 --- /dev/null +++ b/src/cloudflare/types/zero_trust/dlp/payload_log_update_response.py @@ -0,0 +1,11 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ...._models import BaseModel + +__all__ = ["PayloadLogUpdateResponse"] + + +class PayloadLogUpdateResponse(BaseModel): + public_key: Optional[str] = None diff --git a/src/cloudflare/types/zero_trust/dlp/dlp_profile.py b/src/cloudflare/types/zero_trust/dlp/profile.py similarity index 88% rename from src/cloudflare/types/zero_trust/dlp/dlp_profile.py rename to src/cloudflare/types/zero_trust/dlp/profile.py index 5eab3585a64..fba9a61e7d2 100644 --- a/src/cloudflare/types/zero_trust/dlp/dlp_profile.py +++ b/src/cloudflare/types/zero_trust/dlp/profile.py @@ -7,7 +7,7 @@ from .profiles import CustomProfile, PredefinedProfile from ...._models import BaseModel -__all__ = ["DLPProfile", "DLPIntegrationProfile", "DLPIntegrationProfileEntry"] +__all__ = ["Profile", "DLPIntegrationProfile", "DLPIntegrationProfileEntry"] class DLPIntegrationProfileEntry(BaseModel): @@ -49,4 +49,4 @@ class DLPIntegrationProfile(BaseModel): updated_at: Optional[datetime] = None -DLPProfile = Union[PredefinedProfile, CustomProfile, DLPIntegrationProfile] +Profile = Union[PredefinedProfile, CustomProfile, DLPIntegrationProfile] diff --git a/src/cloudflare/types/zero_trust/gateway/__init__.py b/src/cloudflare/types/zero_trust/gateway/__init__.py index 00f317fb859..4548778b341 100644 --- a/src/cloudflare/types/zero_trust/gateway/__init__.py +++ b/src/cloudflare/types/zero_trust/gateway/__init__.py @@ -2,29 +2,36 @@ from __future__ import annotations -from .network import Network as Network +from .rule import Rule as Rule +from .lists import Lists as Lists +from .app_type import AppType as AppType +from .category import Category as Category +from .location import Location as Location from .schedule import Schedule as Schedule -from .locations import Locations as Locations -from .fitler_item import FitlerItem as FitlerItem +from .rule_param import RuleParam as RuleParam +from .rule_setting import RuleSetting as RuleSetting from .tls_settings import TLSSettings as TLSSettings from .fips_settings import FipsSettings as FipsSettings -from .rule_settings import RuleSettings as RuleSettings +from .gateway_filter import GatewayFilter as GatewayFilter +from .proxy_endpoint import ProxyEndpoint as ProxyEndpoint from .schedule_param import ScheduleParam as ScheduleParam +from .logging_setting import LoggingSetting as LoggingSetting from .gateway_ips_item import GatewayIPsItem as GatewayIPsItem +from .gateway_settings import GatewaySettings as GatewaySettings from .list_edit_params import ListEditParams as ListEditParams +from .location_network import LocationNetwork as LocationNetwork from .list_create_params import ListCreateParams as ListCreateParams from .list_delete_params import ListDeleteParams as ListDeleteParams from .list_update_params import ListUpdateParams as ListUpdateParams -from .network_item_param import NetworkItemParam as NetworkItemParam from .protocol_detection import ProtocolDetection as ProtocolDetection from .rule_create_params import RuleCreateParams as RuleCreateParams from .rule_delete_params import RuleDeleteParams as RuleDeleteParams +from .rule_setting_param import RuleSettingParam as RuleSettingParam from .rule_update_params import RuleUpdateParams as RuleUpdateParams from .tls_settings_param import TLSSettingsParam as TLSSettingsParam from .anti_virus_settings import AntiVirusSettings as AntiVirusSettings from .block_page_settings import BlockPageSettings as BlockPageSettings from .fips_settings_param import FipsSettingsParam as FipsSettingsParam -from .rule_settings_param import RuleSettingsParam as RuleSettingsParam from .list_create_response import ListCreateResponse as ListCreateResponse from .activity_log_settings import ActivityLogSettings as ActivityLogSettings from .logging_update_params import LoggingUpdateParams as LoggingUpdateParams @@ -32,13 +39,12 @@ from .body_scanning_settings import BodyScanningSettings as BodyScanningSettings from .location_create_params import LocationCreateParams as LocationCreateParams from .location_delete_params import LocationDeleteParams as LocationDeleteParams +from .location_network_param import LocationNetworkParam as LocationNetworkParam from .location_update_params import LocationUpdateParams as LocationUpdateParams from .extended_email_matching import ExtendedEmailMatching as ExtendedEmailMatching from .dns_resolver_settings_v4 import DNSResolverSettingsV4 as DNSResolverSettingsV4 from .dns_resolver_settings_v6 import DNSResolverSettingsV6 as DNSResolverSettingsV6 from .protocol_detection_param import ProtocolDetectionParam as ProtocolDetectionParam -from .zero_trust_gateway_lists import ZeroTrustGatewayLists as ZeroTrustGatewayLists -from .zero_trust_gateway_rules import ZeroTrustGatewayRules as ZeroTrustGatewayRules from .anti_virus_settings_param import AntiVirusSettingsParam as AntiVirusSettingsParam from .block_page_settings_param import BlockPageSettingsParam as BlockPageSettingsParam from .configuration_edit_params import ConfigurationEditParams as ConfigurationEditParams @@ -50,29 +56,22 @@ from .configuration_update_params import ConfigurationUpdateParams as ConfigurationUpdateParams from .custom_certificate_settings import CustomCertificateSettings as CustomCertificateSettings from .notification_settings_param import NotificationSettingsParam as NotificationSettingsParam -from .zero_trust_gateway_settings import ZeroTrustGatewaySettings as ZeroTrustGatewaySettings from .body_scanning_settings_param import BodyScanningSettingsParam as BodyScanningSettingsParam from .proxy_endpoint_create_params import ProxyEndpointCreateParams as ProxyEndpointCreateParams from .proxy_endpoint_delete_params import ProxyEndpointDeleteParams as ProxyEndpointDeleteParams -from .zero_trust_gateway_app_types import ZeroTrustGatewayAppTypes as ZeroTrustGatewayAppTypes from .configuration_update_response import ConfigurationUpdateResponse as ConfigurationUpdateResponse from .extended_email_matching_param import ExtendedEmailMatchingParam as ExtendedEmailMatchingParam -from .zero_trust_gateway_categories import ZeroTrustGatewayCategories as ZeroTrustGatewayCategories from .dns_resolver_settings_v4_param import DNSResolverSettingsV4Param as DNSResolverSettingsV4Param from .dns_resolver_settings_v6_param import DNSResolverSettingsV6Param as DNSResolverSettingsV6Param from .audit_ssh_setting_update_params import AuditSSHSettingUpdateParams as AuditSSHSettingUpdateParams from .browser_isolation_settings_param import BrowserIsolationSettingsParam as BrowserIsolationSettingsParam from .custom_certificate_settings_param import CustomCertificateSettingsParam as CustomCertificateSettingsParam -from .zero_trust_gateway_proxy_endpoints import ZeroTrustGatewayProxyEndpoints as ZeroTrustGatewayProxyEndpoints from .unnamed_schema_ref_055aaf3918bf29f81c09d394a864182e import ( UnnamedSchemaRef055aaf3918bf29f81c09d394a864182e as UnnamedSchemaRef055aaf3918bf29f81c09d394a864182e, ) from .unnamed_schema_ref_e86eeb84b7e922c35cfb0031a6309f7b import ( UnnamedSchemaRefE86eeb84b7e922c35cfb0031a6309f7b as UnnamedSchemaRefE86eeb84b7e922c35cfb0031a6309f7b, ) -from .zero_trust_gateway_gateway_account_logging_settings import ( - ZeroTrustGatewayGatewayAccountLoggingSettings as ZeroTrustGatewayGatewayAccountLoggingSettings, -) from .unnamed_schema_ref_055aaf3918bf29f81c09d394a864182e_param import ( UnnamedSchemaRef055aaf3918bf29f81c09d394a864182eParam as UnnamedSchemaRef055aaf3918bf29f81c09d394a864182eParam, ) diff --git a/src/cloudflare/types/zero_trust/gateway/zero_trust_gateway_app_types.py b/src/cloudflare/types/zero_trust/gateway/app_type.py similarity index 85% rename from src/cloudflare/types/zero_trust/gateway/zero_trust_gateway_app_types.py rename to src/cloudflare/types/zero_trust/gateway/app_type.py index bb651977018..d3c9c4dee03 100644 --- a/src/cloudflare/types/zero_trust/gateway/zero_trust_gateway_app_types.py +++ b/src/cloudflare/types/zero_trust/gateway/app_type.py @@ -5,7 +5,7 @@ from ...._models import BaseModel -__all__ = ["ZeroTrustGatewayAppTypes", "ZeroTrustGatewayApplication", "ZeroTrustGatewayApplicationType"] +__all__ = ["AppType", "ZeroTrustGatewayApplication", "ZeroTrustGatewayApplicationType"] class ZeroTrustGatewayApplication(BaseModel): @@ -42,4 +42,4 @@ class ZeroTrustGatewayApplicationType(BaseModel): """The name of the application or application type.""" -ZeroTrustGatewayAppTypes = Union[ZeroTrustGatewayApplication, ZeroTrustGatewayApplicationType] +AppType = Union[ZeroTrustGatewayApplication, ZeroTrustGatewayApplicationType] diff --git a/src/cloudflare/types/zero_trust/gateway/zero_trust_gateway_categories.py b/src/cloudflare/types/zero_trust/gateway/category.py similarity index 95% rename from src/cloudflare/types/zero_trust/gateway/zero_trust_gateway_categories.py rename to src/cloudflare/types/zero_trust/gateway/category.py index caf7453bb59..32ac136b133 100644 --- a/src/cloudflare/types/zero_trust/gateway/zero_trust_gateway_categories.py +++ b/src/cloudflare/types/zero_trust/gateway/category.py @@ -7,7 +7,7 @@ from ...._models import BaseModel -__all__ = ["ZeroTrustGatewayCategories", "Subcategory"] +__all__ = ["Category", "Subcategory"] class Subcategory(BaseModel): @@ -34,7 +34,7 @@ class Subcategory(BaseModel): """The name of the category.""" -class ZeroTrustGatewayCategories(BaseModel): +class Category(BaseModel): id: Optional[int] = None """The identifier for this category. There is only one category per ID.""" diff --git a/src/cloudflare/types/zero_trust/gateway/fitler_item.py b/src/cloudflare/types/zero_trust/gateway/gateway_filter.py similarity index 60% rename from src/cloudflare/types/zero_trust/gateway/fitler_item.py rename to src/cloudflare/types/zero_trust/gateway/gateway_filter.py index eb24f9021b6..3cf57f644ff 100644 --- a/src/cloudflare/types/zero_trust/gateway/fitler_item.py +++ b/src/cloudflare/types/zero_trust/gateway/gateway_filter.py @@ -2,6 +2,6 @@ from typing_extensions import Literal -__all__ = ["FitlerItem"] +__all__ = ["GatewayFilter"] -FitlerItem = Literal["http", "dns", "l4", "egress"] +GatewayFilter = Literal["http", "dns", "l4", "egress"] diff --git a/src/cloudflare/types/zero_trust/gateway/zero_trust_gateway_settings.py b/src/cloudflare/types/zero_trust/gateway/gateway_settings.py similarity index 82% rename from src/cloudflare/types/zero_trust/gateway/zero_trust_gateway_settings.py rename to src/cloudflare/types/zero_trust/gateway/gateway_settings.py index fb079396284..9b4982435da 100644 --- a/src/cloudflare/types/zero_trust/gateway/zero_trust_gateway_settings.py +++ b/src/cloudflare/types/zero_trust/gateway/gateway_settings.py @@ -5,10 +5,10 @@ from ...._models import BaseModel -__all__ = ["ZeroTrustGatewaySettings"] +__all__ = ["GatewaySettings"] -class ZeroTrustGatewaySettings(BaseModel): +class GatewaySettings(BaseModel): created_at: Optional[datetime] = None public_key: Optional[str] = None diff --git a/src/cloudflare/types/zero_trust/gateway/list_create_params.py b/src/cloudflare/types/zero_trust/gateway/list_create_params.py index 073d8e8b866..eda030cfb1f 100644 --- a/src/cloudflare/types/zero_trust/gateway/list_create_params.py +++ b/src/cloudflare/types/zero_trust/gateway/list_create_params.py @@ -5,7 +5,9 @@ from typing import Iterable from typing_extensions import Literal, Required, TypedDict -__all__ = ["ListCreateParams", "Item"] +from .lists import ListsItemParam + +__all__ = ["ListCreateParams"] class ListCreateParams(TypedDict, total=False): @@ -20,10 +22,5 @@ class ListCreateParams(TypedDict, total=False): description: str """The description of the list.""" - items: Iterable[Item] + items: Iterable[ListsItemParam] """The items in the list.""" - - -class Item(TypedDict, total=False): - value: str - """The value of the item in a list.""" diff --git a/src/cloudflare/types/zero_trust/gateway/list_create_response.py b/src/cloudflare/types/zero_trust/gateway/list_create_response.py index 52029e50671..547cb80ae0d 100644 --- a/src/cloudflare/types/zero_trust/gateway/list_create_response.py +++ b/src/cloudflare/types/zero_trust/gateway/list_create_response.py @@ -4,8 +4,8 @@ from datetime import datetime from typing_extensions import Literal +from .lists import ListsItem from ...._models import BaseModel -from .lists_item import ListsItem __all__ = ["ListCreateResponse"] diff --git a/src/cloudflare/types/zero_trust/gateway/list_edit_params.py b/src/cloudflare/types/zero_trust/gateway/list_edit_params.py index c5fbd71771a..ab526e35d4e 100644 --- a/src/cloudflare/types/zero_trust/gateway/list_edit_params.py +++ b/src/cloudflare/types/zero_trust/gateway/list_edit_params.py @@ -5,19 +5,16 @@ from typing import List, Iterable from typing_extensions import Required, TypedDict -__all__ = ["ListEditParams", "Append"] +from .lists import ListsItemParam + +__all__ = ["ListEditParams"] class ListEditParams(TypedDict, total=False): account_id: Required[str] - append: Iterable[Append] + append: Iterable[ListsItemParam] """The items in the list.""" remove: List[str] """A list of the item values you want to remove.""" - - -class Append(TypedDict, total=False): - value: str - """The value of the item in a list.""" diff --git a/src/cloudflare/types/zero_trust/gateway/lists/__init__.py b/src/cloudflare/types/zero_trust/gateway/lists/__init__.py index 4c5a33665c1..e0863c2f3b9 100644 --- a/src/cloudflare/types/zero_trust/gateway/lists/__init__.py +++ b/src/cloudflare/types/zero_trust/gateway/lists/__init__.py @@ -2,5 +2,7 @@ from __future__ import annotations +from .lists import Lists as Lists from .lists_item import ListsItem as ListsItem +from .lists_item_param import ListsItemParam as ListsItemParam from .item_list_response import ItemListResponse as ItemListResponse diff --git a/src/cloudflare/types/zero_trust/gateway/zero_trust_gateway_lists.py b/src/cloudflare/types/zero_trust/gateway/lists/lists.py similarity index 85% rename from src/cloudflare/types/zero_trust/gateway/zero_trust_gateway_lists.py rename to src/cloudflare/types/zero_trust/gateway/lists/lists.py index 5cbd26fb325..a8ef4ef652b 100644 --- a/src/cloudflare/types/zero_trust/gateway/zero_trust_gateway_lists.py +++ b/src/cloudflare/types/zero_trust/gateway/lists/lists.py @@ -4,12 +4,12 @@ from datetime import datetime from typing_extensions import Literal -from ...._models import BaseModel +from ....._models import BaseModel -__all__ = ["ZeroTrustGatewayLists"] +__all__ = ["Lists"] -class ZeroTrustGatewayLists(BaseModel): +class Lists(BaseModel): id: Optional[str] = None """API Resource UUID tag.""" diff --git a/src/cloudflare/types/zero_trust/gateway/lists/lists_item_param.py b/src/cloudflare/types/zero_trust/gateway/lists/lists_item_param.py new file mode 100644 index 00000000000..79f7bbdf898 --- /dev/null +++ b/src/cloudflare/types/zero_trust/gateway/lists/lists_item_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +__all__ = ["ListsItemParam"] + + +class ListsItemParam(TypedDict, total=False): + value: str + """The value of the item in a list.""" diff --git a/src/cloudflare/types/zero_trust/gateway/locations.py b/src/cloudflare/types/zero_trust/gateway/location.py similarity index 87% rename from src/cloudflare/types/zero_trust/gateway/locations.py rename to src/cloudflare/types/zero_trust/gateway/location.py index 1c4c6bfe713..cf69688dc8b 100644 --- a/src/cloudflare/types/zero_trust/gateway/locations.py +++ b/src/cloudflare/types/zero_trust/gateway/location.py @@ -3,13 +3,13 @@ from typing import List, Optional from datetime import datetime -from .network import Network from ...._models import BaseModel +from .location_network import LocationNetwork -__all__ = ["Locations"] +__all__ = ["Location"] -class Locations(BaseModel): +class Location(BaseModel): id: Optional[str] = None client_default: Optional[bool] = None @@ -36,7 +36,7 @@ class Locations(BaseModel): name: Optional[str] = None """The name of the location.""" - networks: Optional[List[Network]] = None + networks: Optional[List[LocationNetwork]] = None """A list of network ranges that requests from this location would originate from.""" updated_at: Optional[datetime] = None diff --git a/src/cloudflare/types/zero_trust/gateway/location_create_params.py b/src/cloudflare/types/zero_trust/gateway/location_create_params.py index b42133b45eb..183da6b0292 100644 --- a/src/cloudflare/types/zero_trust/gateway/location_create_params.py +++ b/src/cloudflare/types/zero_trust/gateway/location_create_params.py @@ -5,7 +5,7 @@ from typing import Iterable from typing_extensions import Required, TypedDict -from .network_item_param import NetworkItemParam +from .location_network_param import LocationNetworkParam __all__ = ["LocationCreateParams"] @@ -22,5 +22,5 @@ class LocationCreateParams(TypedDict, total=False): ecs_support: bool """True if the location needs to resolve EDNS queries.""" - networks: Iterable[NetworkItemParam] + networks: Iterable[LocationNetworkParam] """A list of network ranges that requests from this location would originate from.""" diff --git a/src/cloudflare/types/zero_trust/gateway/network.py b/src/cloudflare/types/zero_trust/gateway/location_network.py similarity index 77% rename from src/cloudflare/types/zero_trust/gateway/network.py rename to src/cloudflare/types/zero_trust/gateway/location_network.py index 2795fdda49a..7b520e22ba1 100644 --- a/src/cloudflare/types/zero_trust/gateway/network.py +++ b/src/cloudflare/types/zero_trust/gateway/location_network.py @@ -2,9 +2,9 @@ from ...._models import BaseModel -__all__ = ["Network"] +__all__ = ["LocationNetwork"] -class Network(BaseModel): +class LocationNetwork(BaseModel): network: str """The IPv4 address or IPv4 CIDR. IPv4 CIDRs are limited to a maximum of /24.""" diff --git a/src/cloudflare/types/zero_trust/gateway/network_item_param.py b/src/cloudflare/types/zero_trust/gateway/location_network_param.py similarity index 76% rename from src/cloudflare/types/zero_trust/gateway/network_item_param.py rename to src/cloudflare/types/zero_trust/gateway/location_network_param.py index 43f0305eff1..e0328ee41ca 100644 --- a/src/cloudflare/types/zero_trust/gateway/network_item_param.py +++ b/src/cloudflare/types/zero_trust/gateway/location_network_param.py @@ -4,9 +4,9 @@ from typing_extensions import Required, TypedDict -__all__ = ["NetworkItemParam"] +__all__ = ["LocationNetworkParam"] -class NetworkItemParam(TypedDict, total=False): +class LocationNetworkParam(TypedDict, total=False): network: Required[str] """The IPv4 address or IPv4 CIDR. IPv4 CIDRs are limited to a maximum of /24.""" diff --git a/src/cloudflare/types/zero_trust/gateway/location_update_params.py b/src/cloudflare/types/zero_trust/gateway/location_update_params.py index d488c8fcfe0..f563e09fa0f 100644 --- a/src/cloudflare/types/zero_trust/gateway/location_update_params.py +++ b/src/cloudflare/types/zero_trust/gateway/location_update_params.py @@ -5,7 +5,7 @@ from typing import Iterable from typing_extensions import Required, TypedDict -from .network_item_param import NetworkItemParam +from .location_network_param import LocationNetworkParam __all__ = ["LocationUpdateParams"] @@ -22,5 +22,5 @@ class LocationUpdateParams(TypedDict, total=False): ecs_support: bool """True if the location needs to resolve EDNS queries.""" - networks: Iterable[NetworkItemParam] + networks: Iterable[LocationNetworkParam] """A list of network ranges that requests from this location would originate from.""" diff --git a/src/cloudflare/types/zero_trust/gateway/zero_trust_gateway_gateway_account_logging_settings.py b/src/cloudflare/types/zero_trust/gateway/logging_setting.py similarity index 83% rename from src/cloudflare/types/zero_trust/gateway/zero_trust_gateway_gateway_account_logging_settings.py rename to src/cloudflare/types/zero_trust/gateway/logging_setting.py index c4f7e84442d..955a13aef75 100644 --- a/src/cloudflare/types/zero_trust/gateway/zero_trust_gateway_gateway_account_logging_settings.py +++ b/src/cloudflare/types/zero_trust/gateway/logging_setting.py @@ -5,10 +5,10 @@ from ...._models import BaseModel from .unnamed_schema_ref_e86eeb84b7e922c35cfb0031a6309f7b import UnnamedSchemaRefE86eeb84b7e922c35cfb0031a6309f7b -__all__ = ["ZeroTrustGatewayGatewayAccountLoggingSettings"] +__all__ = ["LoggingSetting"] -class ZeroTrustGatewayGatewayAccountLoggingSettings(BaseModel): +class LoggingSetting(BaseModel): redact_pii: Optional[bool] = None """ Redact personally identifiable information from activity logging (PII fields diff --git a/src/cloudflare/types/zero_trust/gateway/zero_trust_gateway_proxy_endpoints.py b/src/cloudflare/types/zero_trust/gateway/proxy_endpoint.py similarity index 78% rename from src/cloudflare/types/zero_trust/gateway/zero_trust_gateway_proxy_endpoints.py rename to src/cloudflare/types/zero_trust/gateway/proxy_endpoint.py index 4524e201ceb..400b190861b 100644 --- a/src/cloudflare/types/zero_trust/gateway/zero_trust_gateway_proxy_endpoints.py +++ b/src/cloudflare/types/zero_trust/gateway/proxy_endpoint.py @@ -4,16 +4,17 @@ from datetime import datetime from ...._models import BaseModel +from .gateway_ips_item import GatewayIPsItem -__all__ = ["ZeroTrustGatewayProxyEndpoints"] +__all__ = ["ProxyEndpoint"] -class ZeroTrustGatewayProxyEndpoints(BaseModel): +class ProxyEndpoint(BaseModel): id: Optional[str] = None created_at: Optional[datetime] = None - ips: Optional[List[str]] = None + ips: Optional[List[GatewayIPsItem]] = None """A list of CIDRs to restrict ingress connections.""" name: Optional[str] = None diff --git a/src/cloudflare/types/zero_trust/gateway/zero_trust_gateway_rules.py b/src/cloudflare/types/zero_trust/gateway/rule.py similarity index 89% rename from src/cloudflare/types/zero_trust/gateway/zero_trust_gateway_rules.py rename to src/cloudflare/types/zero_trust/gateway/rule.py index b2f11880e99..370988f14f5 100644 --- a/src/cloudflare/types/zero_trust/gateway/zero_trust_gateway_rules.py +++ b/src/cloudflare/types/zero_trust/gateway/rule.py @@ -6,12 +6,13 @@ from .schedule import Schedule from ...._models import BaseModel -from .rule_settings import RuleSettings +from .rule_setting import RuleSetting +from .gateway_filter import GatewayFilter -__all__ = ["ZeroTrustGatewayRules"] +__all__ = ["Rule"] -class ZeroTrustGatewayRules(BaseModel): +class Rule(BaseModel): id: Optional[str] = None """The API resource UUID.""" @@ -53,7 +54,7 @@ class ZeroTrustGatewayRules(BaseModel): enabled: Optional[bool] = None """True if the rule is enabled.""" - filters: Optional[List[Literal["http", "dns", "l4", "egress"]]] = None + filters: Optional[List[GatewayFilter]] = None """ The protocol or layer to evaluate the traffic, identity, and device posture expressions. @@ -72,7 +73,7 @@ class ZeroTrustGatewayRules(BaseModel): rules are evaluated in ascending order of this value. """ - rule_settings: Optional[RuleSettings] = None + rule_settings: Optional[RuleSetting] = None """Additional settings that modify the rule's action.""" schedule: Optional[Schedule] = None diff --git a/src/cloudflare/types/zero_trust/gateway/rule_create_params.py b/src/cloudflare/types/zero_trust/gateway/rule_create_params.py index c904b35e9e7..72298b7f6df 100644 --- a/src/cloudflare/types/zero_trust/gateway/rule_create_params.py +++ b/src/cloudflare/types/zero_trust/gateway/rule_create_params.py @@ -5,9 +5,9 @@ from typing import List from typing_extensions import Literal, Required, TypedDict -from .fitler_item import FitlerItem +from .gateway_filter import GatewayFilter from .schedule_param import ScheduleParam -from .rule_settings_param import RuleSettingsParam +from .rule_setting_param import RuleSettingParam __all__ = ["RuleCreateParams"] @@ -51,7 +51,7 @@ class RuleCreateParams(TypedDict, total=False): enabled: bool """True if the rule is enabled.""" - filters: List[FitlerItem] + filters: List[GatewayFilter] """ The protocol or layer to evaluate the traffic, identity, and device posture expressions. @@ -67,7 +67,7 @@ class RuleCreateParams(TypedDict, total=False): rules are evaluated in ascending order of this value. """ - rule_settings: RuleSettingsParam + rule_settings: RuleSettingParam """Additional settings that modify the rule's action.""" schedule: ScheduleParam diff --git a/src/cloudflare/types/zero_trust/gateway/rule_param.py b/src/cloudflare/types/zero_trust/gateway/rule_param.py new file mode 100644 index 00000000000..3dcf53e6fe0 --- /dev/null +++ b/src/cloudflare/types/zero_trust/gateway/rule_param.py @@ -0,0 +1,79 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List +from typing_extensions import Literal, TypedDict + +from .gateway_filter import GatewayFilter +from .schedule_param import ScheduleParam +from .rule_setting_param import RuleSettingParam + +__all__ = ["RuleParam"] + + +class RuleParam(TypedDict, total=False): + id: str + """The API resource UUID.""" + + action: Literal[ + "on", + "off", + "allow", + "block", + "scan", + "noscan", + "safesearch", + "ytrestricted", + "isolate", + "noisolate", + "override", + "l4_override", + "egress", + "audit_ssh", + "resolve", + ] + """ + The action to preform when the associated traffic, identity, and device posture + expressions are either absent or evaluate to `true`. + """ + + description: str + """The description of the rule.""" + + device_posture: str + """The wirefilter expression used for device posture check matching.""" + + enabled: bool + """True if the rule is enabled.""" + + filters: List[GatewayFilter] + """ + The protocol or layer to evaluate the traffic, identity, and device posture + expressions. + """ + + identity: str + """The wirefilter expression used for identity matching.""" + + name: str + """The name of the rule.""" + + precedence: int + """Precedence sets the order of your rules. + + Lower values indicate higher precedence. At each processing phase, applicable + rules are evaluated in ascending order of this value. + """ + + rule_settings: RuleSettingParam + """Additional settings that modify the rule's action.""" + + schedule: ScheduleParam + """The schedule for activating DNS policies. + + This does not apply to HTTP or network policies. + """ + + traffic: str + """The wirefilter expression used for traffic matching.""" diff --git a/src/cloudflare/types/zero_trust/gateway/rule_settings.py b/src/cloudflare/types/zero_trust/gateway/rule_setting.py similarity index 99% rename from src/cloudflare/types/zero_trust/gateway/rule_settings.py rename to src/cloudflare/types/zero_trust/gateway/rule_setting.py index b9aba976c4f..9af12528729 100644 --- a/src/cloudflare/types/zero_trust/gateway/rule_settings.py +++ b/src/cloudflare/types/zero_trust/gateway/rule_setting.py @@ -8,7 +8,7 @@ from .dns_resolver_settings_v6 import DNSResolverSettingsV6 __all__ = [ - "RuleSettings", + "RuleSetting", "AuditSSH", "BisoAdminControls", "CheckSession", @@ -107,7 +107,7 @@ class UntrustedCERT(BaseModel): """ -class RuleSettings(BaseModel): +class RuleSetting(BaseModel): add_headers: Optional[object] = None """Add custom headers to allowed requests, in the form of key-value pairs. diff --git a/src/cloudflare/types/zero_trust/gateway/rule_settings_param.py b/src/cloudflare/types/zero_trust/gateway/rule_setting_param.py similarity index 98% rename from src/cloudflare/types/zero_trust/gateway/rule_settings_param.py rename to src/cloudflare/types/zero_trust/gateway/rule_setting_param.py index 963f1b5250f..62fe1523f29 100644 --- a/src/cloudflare/types/zero_trust/gateway/rule_settings_param.py +++ b/src/cloudflare/types/zero_trust/gateway/rule_setting_param.py @@ -9,7 +9,7 @@ from .dns_resolver_settings_v6_param import DNSResolverSettingsV6Param __all__ = [ - "RuleSettingsParam", + "RuleSettingParam", "AuditSSH", "BisoAdminControls", "CheckSession", @@ -108,7 +108,7 @@ class UntrustedCERT(TypedDict, total=False): """ -class RuleSettingsParam(TypedDict, total=False): +class RuleSettingParam(TypedDict, total=False): add_headers: object """Add custom headers to allowed requests, in the form of key-value pairs. diff --git a/src/cloudflare/types/zero_trust/gateway/rule_update_params.py b/src/cloudflare/types/zero_trust/gateway/rule_update_params.py index 8a53b1ed030..eb1be8a66bf 100644 --- a/src/cloudflare/types/zero_trust/gateway/rule_update_params.py +++ b/src/cloudflare/types/zero_trust/gateway/rule_update_params.py @@ -5,9 +5,9 @@ from typing import List from typing_extensions import Literal, Required, TypedDict -from .fitler_item import FitlerItem +from .gateway_filter import GatewayFilter from .schedule_param import ScheduleParam -from .rule_settings_param import RuleSettingsParam +from .rule_setting_param import RuleSettingParam __all__ = ["RuleUpdateParams"] @@ -51,7 +51,7 @@ class RuleUpdateParams(TypedDict, total=False): enabled: bool """True if the rule is enabled.""" - filters: List[FitlerItem] + filters: List[GatewayFilter] """ The protocol or layer to evaluate the traffic, identity, and device posture expressions. @@ -67,7 +67,7 @@ class RuleUpdateParams(TypedDict, total=False): rules are evaluated in ascending order of this value. """ - rule_settings: RuleSettingsParam + rule_settings: RuleSettingParam """Additional settings that modify the rule's action.""" schedule: ScheduleParam diff --git a/src/cloudflare/types/zero_trust/zero_trust_identity_providers.py b/src/cloudflare/types/zero_trust/identity_provider.py similarity index 99% rename from src/cloudflare/types/zero_trust/zero_trust_identity_providers.py rename to src/cloudflare/types/zero_trust/identity_provider.py index b83074eb71f..895934553f9 100644 --- a/src/cloudflare/types/zero_trust/zero_trust_identity_providers.py +++ b/src/cloudflare/types/zero_trust/identity_provider.py @@ -9,7 +9,7 @@ from .unnamed_schema_ref_dd86d8b7ea73283da7b160ed3f86cae1 import UnnamedSchemaRefDd86d8b7ea73283da7b160ed3f86cae1 __all__ = [ - "ZeroTrustIdentityProviders", + "IdentityProvider", "AccessCentrify", "AccessCentrifyConfig", "AccessFacebook", @@ -570,7 +570,7 @@ class AccessOnetimepin(BaseModel): """ -ZeroTrustIdentityProviders = Union[ +IdentityProvider = Union[ AzureAd, AccessCentrify, AccessFacebook, diff --git a/src/cloudflare/types/zero_trust/networks/__init__.py b/src/cloudflare/types/zero_trust/networks/__init__.py index fc27eeba4c9..0097f431e21 100644 --- a/src/cloudflare/types/zero_trust/networks/__init__.py +++ b/src/cloudflare/types/zero_trust/networks/__init__.py @@ -2,12 +2,13 @@ from __future__ import annotations -from .tunnel_route import TunnelRoute as TunnelRoute -from .tunnel_teamnet import TunnelTeamnet as TunnelTeamnet +from .route import Route as Route +from .teamnet import Teamnet as Teamnet +from .route_param import RouteParam as RouteParam +from .virtual_network import VirtualNetwork as VirtualNetwork from .route_edit_params import RouteEditParams as RouteEditParams from .route_list_params import RouteListParams as RouteListParams from .route_create_params import RouteCreateParams as RouteCreateParams -from .tunnel_virtual_network import TunnelVirtualNetwork as TunnelVirtualNetwork from .virtual_network_edit_params import VirtualNetworkEditParams as VirtualNetworkEditParams from .virtual_network_list_params import VirtualNetworkListParams as VirtualNetworkListParams from .virtual_network_create_params import VirtualNetworkCreateParams as VirtualNetworkCreateParams diff --git a/src/cloudflare/types/zero_trust/networks/tunnel_route.py b/src/cloudflare/types/zero_trust/networks/route.py similarity index 94% rename from src/cloudflare/types/zero_trust/networks/tunnel_route.py rename to src/cloudflare/types/zero_trust/networks/route.py index b1fa6674837..b51af42cdfc 100644 --- a/src/cloudflare/types/zero_trust/networks/tunnel_route.py +++ b/src/cloudflare/types/zero_trust/networks/route.py @@ -5,10 +5,10 @@ from ...._models import BaseModel -__all__ = ["TunnelRoute"] +__all__ = ["Route"] -class TunnelRoute(BaseModel): +class Route(BaseModel): id: Optional[str] = None """UUID of the route.""" diff --git a/src/cloudflare/types/zero_trust/networks/route_param.py b/src/cloudflare/types/zero_trust/networks/route_param.py new file mode 100644 index 00000000000..d47433fe082 --- /dev/null +++ b/src/cloudflare/types/zero_trust/networks/route_param.py @@ -0,0 +1,28 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +__all__ = ["RouteParam"] + + +class RouteParam(TypedDict, total=False): + comment: str + """Optional remark describing the route.""" + + created_at: object + """Timestamp of when the route was created.""" + + network: str + """The private IPv4 or IPv6 range connected by the route, in CIDR notation.""" + + tunnel_id: object + """UUID of the Cloudflare Tunnel serving the route.""" + + virtual_network_id: object + """UUID of the Tunnel Virtual Network this route belongs to. + + If no virtual networks are configured, the route is assigned to the default + virtual network of the account. + """ diff --git a/src/cloudflare/types/zero_trust/networks/tunnel_teamnet.py b/src/cloudflare/types/zero_trust/networks/teamnet.py similarity index 95% rename from src/cloudflare/types/zero_trust/networks/tunnel_teamnet.py rename to src/cloudflare/types/zero_trust/networks/teamnet.py index e43de119e23..4624c64d4a1 100644 --- a/src/cloudflare/types/zero_trust/networks/tunnel_teamnet.py +++ b/src/cloudflare/types/zero_trust/networks/teamnet.py @@ -6,10 +6,10 @@ from ...._models import BaseModel -__all__ = ["TunnelTeamnet"] +__all__ = ["Teamnet"] -class TunnelTeamnet(BaseModel): +class Teamnet(BaseModel): id: Optional[str] = None """UUID of the route.""" diff --git a/src/cloudflare/types/zero_trust/networks/tunnel_virtual_network.py b/src/cloudflare/types/zero_trust/networks/virtual_network.py similarity index 90% rename from src/cloudflare/types/zero_trust/networks/tunnel_virtual_network.py rename to src/cloudflare/types/zero_trust/networks/virtual_network.py index fc464f5f05c..bb3493b9b39 100644 --- a/src/cloudflare/types/zero_trust/networks/tunnel_virtual_network.py +++ b/src/cloudflare/types/zero_trust/networks/virtual_network.py @@ -4,10 +4,10 @@ from ...._models import BaseModel -__all__ = ["TunnelVirtualNetwork"] +__all__ = ["VirtualNetwork"] -class TunnelVirtualNetwork(BaseModel): +class VirtualNetwork(BaseModel): id: str """UUID of the virtual network.""" diff --git a/src/cloudflare/types/zero_trust/zero_trust_organizations.py b/src/cloudflare/types/zero_trust/organizations.py similarity index 96% rename from src/cloudflare/types/zero_trust/zero_trust_organizations.py rename to src/cloudflare/types/zero_trust/organizations.py index 8969c96610b..6909c1f7992 100644 --- a/src/cloudflare/types/zero_trust/zero_trust_organizations.py +++ b/src/cloudflare/types/zero_trust/organizations.py @@ -6,7 +6,7 @@ from ..._models import BaseModel from .login_design import LoginDesign -__all__ = ["ZeroTrustOrganizations", "CustomPages"] +__all__ = ["Organizations", "CustomPages"] class CustomPages(BaseModel): @@ -20,7 +20,7 @@ class CustomPages(BaseModel): """The uid of the custom page to use when a user is denied access.""" -class ZeroTrustOrganizations(BaseModel): +class Organizations(BaseModel): allow_authenticate_via_warp: Optional[bool] = None """ When set to true, users can authenticate via WARP for any application in your diff --git a/src/cloudflare/types/zero_trust/rule.py b/src/cloudflare/types/zero_trust/rule.py deleted file mode 100644 index eeac361c2ec..00000000000 --- a/src/cloudflare/types/zero_trust/rule.py +++ /dev/null @@ -1,47 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union - -from .ip_rule import IPRule -from .email_rule import EmailRule -from .group_rule import GroupRule -from .domain_rule import DomainRule -from .country_rule import CountryRule -from .ip_list_rule import IPListRule -from .everyone_rule import EveryoneRule -from .email_list_rule import EmailListRule -from .okta_group_rule import OktaGroupRule -from .saml_group_rule import SamlGroupRule -from .azure_group_rule import AzureGroupRule -from .certificate_rule import CertificateRule -from .gsuite_group_rule import GsuiteGroupRule -from .service_token_rule import ServiceTokenRule -from .device_posture_rule import DevicePostureRule -from .external_evaluation_rule import ExternalEvaluationRule -from .github_organization_rule import GitHubOrganizationRule -from .authentication_method_rule import AuthenticationMethodRule -from .any_valid_service_token_rule import AnyValidServiceTokenRule - -__all__ = ["Rule"] - -Rule = Union[ - EmailRule, - EmailListRule, - DomainRule, - EveryoneRule, - IPRule, - IPListRule, - CertificateRule, - GroupRule, - AzureGroupRule, - GitHubOrganizationRule, - GsuiteGroupRule, - OktaGroupRule, - SamlGroupRule, - ServiceTokenRule, - AnyValidServiceTokenRule, - ExternalEvaluationRule, - CountryRule, - AuthenticationMethodRule, - DevicePostureRule, -] diff --git a/src/cloudflare/types/zero_trust/rule_param.py b/src/cloudflare/types/zero_trust/rule_param.py deleted file mode 100644 index 9f6d7d6c432..00000000000 --- a/src/cloudflare/types/zero_trust/rule_param.py +++ /dev/null @@ -1,49 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union - -from .ip_rule_param import IPRuleParam -from .email_rule_param import EmailRuleParam -from .group_rule_param import GroupRuleParam -from .domain_rule_param import DomainRuleParam -from .country_rule_param import CountryRuleParam -from .ip_list_rule_param import IPListRuleParam -from .everyone_rule_param import EveryoneRuleParam -from .email_list_rule_param import EmailListRuleParam -from .okta_group_rule_param import OktaGroupRuleParam -from .saml_group_rule_param import SamlGroupRuleParam -from .azure_group_rule_param import AzureGroupRuleParam -from .certificate_rule_param import CertificateRuleParam -from .gsuite_group_rule_param import GsuiteGroupRuleParam -from .service_token_rule_param import ServiceTokenRuleParam -from .device_posture_rule_param import DevicePostureRuleParam -from .external_evaluation_rule_param import ExternalEvaluationRuleParam -from .github_organization_rule_param import GitHubOrganizationRuleParam -from .authentication_method_rule_param import AuthenticationMethodRuleParam -from .any_valid_service_token_rule_param import AnyValidServiceTokenRuleParam - -__all__ = ["RuleParam"] - -RuleParam = Union[ - EmailRuleParam, - EmailListRuleParam, - DomainRuleParam, - EveryoneRuleParam, - IPRuleParam, - IPListRuleParam, - CertificateRuleParam, - GroupRuleParam, - AzureGroupRuleParam, - GitHubOrganizationRuleParam, - GsuiteGroupRuleParam, - OktaGroupRuleParam, - SamlGroupRuleParam, - ServiceTokenRuleParam, - AnyValidServiceTokenRuleParam, - ExternalEvaluationRuleParam, - CountryRuleParam, - AuthenticationMethodRuleParam, - DevicePostureRuleParam, -] diff --git a/src/cloudflare/types/zero_trust/zero_trust_seats.py b/src/cloudflare/types/zero_trust/seat.py similarity index 88% rename from src/cloudflare/types/zero_trust/zero_trust_seats.py rename to src/cloudflare/types/zero_trust/seat.py index 0800a49be50..bf56403a543 100644 --- a/src/cloudflare/types/zero_trust/zero_trust_seats.py +++ b/src/cloudflare/types/zero_trust/seat.py @@ -5,10 +5,10 @@ from ..._models import BaseModel -__all__ = ["ZeroTrustSeats"] +__all__ = ["Seat"] -class ZeroTrustSeats(BaseModel): +class Seat(BaseModel): access_seat: Optional[bool] = None """True if the seat is part of Access.""" diff --git a/src/cloudflare/types/zero_trust/seat_edit_response.py b/src/cloudflare/types/zero_trust/seat_edit_response.py index 17305d6920b..a29d3feb33b 100644 --- a/src/cloudflare/types/zero_trust/seat_edit_response.py +++ b/src/cloudflare/types/zero_trust/seat_edit_response.py @@ -2,8 +2,8 @@ from typing import List -from .zero_trust_seats import ZeroTrustSeats +from .seat import Seat __all__ = ["SeatEditResponse"] -SeatEditResponse = List[ZeroTrustSeats] +SeatEditResponse = List[Seat] diff --git a/src/cloudflare/types/zero_trust/tunnels/__init__.py b/src/cloudflare/types/zero_trust/tunnels/__init__.py index 7301baa06a4..761f66f8839 100644 --- a/src/cloudflare/types/zero_trust/tunnels/__init__.py +++ b/src/cloudflare/types/zero_trust/tunnels/__init__.py @@ -2,8 +2,8 @@ from __future__ import annotations +from .client import Client as Client from .token_get_response import TokenGetResponse as TokenGetResponse -from .tunnel_tunnel_client import TunnelTunnelClient as TunnelTunnelClient from .connection_get_response import ConnectionGetResponse as ConnectionGetResponse from .connection_delete_params import ConnectionDeleteParams as ConnectionDeleteParams from .management_create_params import ManagementCreateParams as ManagementCreateParams diff --git a/src/cloudflare/types/zero_trust/tunnels/tunnel_tunnel_client.py b/src/cloudflare/types/zero_trust/tunnels/client.py similarity index 96% rename from src/cloudflare/types/zero_trust/tunnels/tunnel_tunnel_client.py rename to src/cloudflare/types/zero_trust/tunnels/client.py index 5720c182f20..1c18c5ff6f2 100644 --- a/src/cloudflare/types/zero_trust/tunnels/tunnel_tunnel_client.py +++ b/src/cloudflare/types/zero_trust/tunnels/client.py @@ -5,7 +5,7 @@ from ...._models import BaseModel -__all__ = ["TunnelTunnelClient", "Conn"] +__all__ = ["Client", "Conn"] class Conn(BaseModel): @@ -39,7 +39,7 @@ class Conn(BaseModel): """UUID of the Cloudflare Tunnel connection.""" -class TunnelTunnelClient(BaseModel): +class Client(BaseModel): id: Optional[str] = None """UUID of the Cloudflare Tunnel connection.""" diff --git a/src/cloudflare/types/zero_trust/tunnels/connection_get_response.py b/src/cloudflare/types/zero_trust/tunnels/connection_get_response.py index 6bc0f6e39c0..d219ccbb0be 100644 --- a/src/cloudflare/types/zero_trust/tunnels/connection_get_response.py +++ b/src/cloudflare/types/zero_trust/tunnels/connection_get_response.py @@ -2,8 +2,8 @@ from typing import List -from .tunnel_tunnel_client import TunnelTunnelClient +from .client import Client __all__ = ["ConnectionGetResponse"] -ConnectionGetResponse = List[TunnelTunnelClient] +ConnectionGetResponse = List[Client] diff --git a/src/cloudflare/types/origin_tls_client_auth_list_response.py b/src/cloudflare/types/zone_authenticated_origin_pull.py similarity index 82% rename from src/cloudflare/types/origin_tls_client_auth_list_response.py rename to src/cloudflare/types/zone_authenticated_origin_pull.py index c29eb8c17d1..4508c09a303 100644 --- a/src/cloudflare/types/origin_tls_client_auth_list_response.py +++ b/src/cloudflare/types/zone_authenticated_origin_pull.py @@ -4,10 +4,10 @@ from .._models import BaseModel -__all__ = ["OriginTLSClientAuthListResponse"] +__all__ = ["ZoneAuthenticatedOriginPull"] -class OriginTLSClientAuthListResponse(BaseModel): +class ZoneAuthenticatedOriginPull(BaseModel): id: Optional[str] = None """Identifier""" diff --git a/src/cloudflare/types/zones/__init__.py b/src/cloudflare/types/zones/__init__.py index 016b8a4ebae..c465b007a78 100644 --- a/src/cloudflare/types/zones/__init__.py +++ b/src/cloudflare/types/zones/__init__.py @@ -2,6 +2,7 @@ from __future__ import annotations +from .zone_hold import ZoneHold as ZoneHold from .nameserver import Nameserver as Nameserver from .dns_setting import DNSSetting as DNSSetting from .nameserver_param import NameserverParam as NameserverParam @@ -9,9 +10,5 @@ from .hold_delete_params import HoldDeleteParams as HoldDeleteParams from .dns_setting_edit_params import DNSSettingEditParams as DNSSettingEditParams from .subscription_create_params import SubscriptionCreateParams as SubscriptionCreateParams -from .subscription_list_response import SubscriptionListResponse as SubscriptionListResponse from .custom_nameserver_update_params import CustomNameserverUpdateParams as CustomNameserverUpdateParams from .activation_check_trigger_response import ActivationCheckTriggerResponse as ActivationCheckTriggerResponse -from .unnamed_schema_ref_45004a9444b6da9f88158ed2fb9a5820 import ( - UnnamedSchemaRef45004a9444b6da9f88158ed2fb9a5820 as UnnamedSchemaRef45004a9444b6da9f88158ed2fb9a5820, -) diff --git a/src/cloudflare/types/zones/unnamed_schema_ref_45004a9444b6da9f88158ed2fb9a5820.py b/src/cloudflare/types/zones/zone_hold.py similarity index 67% rename from src/cloudflare/types/zones/unnamed_schema_ref_45004a9444b6da9f88158ed2fb9a5820.py rename to src/cloudflare/types/zones/zone_hold.py index 4ff409ec1bc..d56375bbb94 100644 --- a/src/cloudflare/types/zones/unnamed_schema_ref_45004a9444b6da9f88158ed2fb9a5820.py +++ b/src/cloudflare/types/zones/zone_hold.py @@ -4,10 +4,10 @@ from ..._models import BaseModel -__all__ = ["UnnamedSchemaRef45004a9444b6da9f88158ed2fb9a5820"] +__all__ = ["ZoneHold"] -class UnnamedSchemaRef45004a9444b6da9f88158ed2fb9a5820(BaseModel): +class ZoneHold(BaseModel): hold: Optional[bool] = None hold_after: Optional[str] = None diff --git a/tests/api_resources/accounts/test_members.py b/tests/api_resources/accounts/test_members.py index 37dfae5e8a1..a6b5f51d162 100644 --- a/tests/api_resources/accounts/test_members.py +++ b/tests/api_resources/accounts/test_members.py @@ -12,9 +12,9 @@ from cloudflare.pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray from cloudflare.types.accounts import ( Member, - MemberWithCode, MemberListResponse, MemberDeleteResponse, + MemberWithInviteCode, ) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -35,7 +35,7 @@ def test_method_create(self, client: Cloudflare) -> None: "3536bcfad5faccb999b47003c79917fb", ], ) - assert_matches_type(MemberWithCode, member, path=["response"]) + assert_matches_type(MemberWithInviteCode, member, path=["response"]) @pytest.mark.skip() @parametrize @@ -50,7 +50,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: ], status="accepted", ) - assert_matches_type(MemberWithCode, member, path=["response"]) + assert_matches_type(MemberWithInviteCode, member, path=["response"]) @pytest.mark.skip() @parametrize @@ -68,7 +68,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" member = response.parse() - assert_matches_type(MemberWithCode, member, path=["response"]) + assert_matches_type(MemberWithInviteCode, member, path=["response"]) @pytest.mark.skip() @parametrize @@ -86,7 +86,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" member = response.parse() - assert_matches_type(MemberWithCode, member, path=["response"]) + assert_matches_type(MemberWithInviteCode, member, path=["response"]) assert cast(Any, response.is_closed) is True @@ -315,7 +315,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: "3536bcfad5faccb999b47003c79917fb", ], ) - assert_matches_type(MemberWithCode, member, path=["response"]) + assert_matches_type(MemberWithInviteCode, member, path=["response"]) @pytest.mark.skip() @parametrize @@ -330,7 +330,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare ], status="accepted", ) - assert_matches_type(MemberWithCode, member, path=["response"]) + assert_matches_type(MemberWithInviteCode, member, path=["response"]) @pytest.mark.skip() @parametrize @@ -348,7 +348,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" member = await response.parse() - assert_matches_type(MemberWithCode, member, path=["response"]) + assert_matches_type(MemberWithInviteCode, member, path=["response"]) @pytest.mark.skip() @parametrize @@ -366,7 +366,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" member = await response.parse() - assert_matches_type(MemberWithCode, member, path=["response"]) + assert_matches_type(MemberWithInviteCode, member, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/addressing/prefixes/bgp/test_bindings.py b/tests/api_resources/addressing/prefixes/bgp/test_bindings.py index eb1d71ada3c..7681385f2e9 100644 --- a/tests/api_resources/addressing/prefixes/bgp/test_bindings.py +++ b/tests/api_resources/addressing/prefixes/bgp/test_bindings.py @@ -11,7 +11,7 @@ from tests.utils import assert_matches_type from cloudflare.pagination import SyncSinglePage, AsyncSinglePage from cloudflare.types.shared import UnnamedSchemaRefEc4d85c3d1bcc6b3b7e99c199ae99846 -from cloudflare.types.addressing.prefixes.bgp import AddressingServiceBinding +from cloudflare.types.addressing.prefixes.bgp import ServiceBinding base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -26,7 +26,7 @@ def test_method_create(self, client: Cloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AddressingServiceBinding, binding, path=["response"]) + assert_matches_type(ServiceBinding, binding, path=["response"]) @pytest.mark.skip() @parametrize @@ -37,7 +37,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: cidr="192.0.2.0/24", service_id="2db684ee7ca04e159946fd05b99e1bcd", ) - assert_matches_type(AddressingServiceBinding, binding, path=["response"]) + assert_matches_type(ServiceBinding, binding, path=["response"]) @pytest.mark.skip() @parametrize @@ -50,7 +50,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" binding = response.parse() - assert_matches_type(AddressingServiceBinding, binding, path=["response"]) + assert_matches_type(ServiceBinding, binding, path=["response"]) @pytest.mark.skip() @parametrize @@ -63,7 +63,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" binding = response.parse() - assert_matches_type(AddressingServiceBinding, binding, path=["response"]) + assert_matches_type(ServiceBinding, binding, path=["response"]) assert cast(Any, response.is_closed) is True @@ -89,7 +89,7 @@ def test_method_list(self, client: Cloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncSinglePage[AddressingServiceBinding], binding, path=["response"]) + assert_matches_type(SyncSinglePage[ServiceBinding], binding, path=["response"]) @pytest.mark.skip() @parametrize @@ -102,7 +102,7 @@ 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" binding = response.parse() - assert_matches_type(SyncSinglePage[AddressingServiceBinding], binding, path=["response"]) + assert_matches_type(SyncSinglePage[ServiceBinding], binding, path=["response"]) @pytest.mark.skip() @parametrize @@ -115,7 +115,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" binding = response.parse() - assert_matches_type(SyncSinglePage[AddressingServiceBinding], binding, path=["response"]) + assert_matches_type(SyncSinglePage[ServiceBinding], binding, path=["response"]) assert cast(Any, response.is_closed) is True @@ -206,7 +206,7 @@ def test_method_get(self, client: Cloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", prefix_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AddressingServiceBinding, binding, path=["response"]) + assert_matches_type(ServiceBinding, binding, path=["response"]) @pytest.mark.skip() @parametrize @@ -220,7 +220,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" binding = response.parse() - assert_matches_type(AddressingServiceBinding, binding, path=["response"]) + assert_matches_type(ServiceBinding, binding, path=["response"]) @pytest.mark.skip() @parametrize @@ -234,7 +234,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" binding = response.parse() - assert_matches_type(AddressingServiceBinding, binding, path=["response"]) + assert_matches_type(ServiceBinding, binding, path=["response"]) assert cast(Any, response.is_closed) is True @@ -273,7 +273,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AddressingServiceBinding, binding, path=["response"]) + assert_matches_type(ServiceBinding, binding, path=["response"]) @pytest.mark.skip() @parametrize @@ -284,7 +284,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare cidr="192.0.2.0/24", service_id="2db684ee7ca04e159946fd05b99e1bcd", ) - assert_matches_type(AddressingServiceBinding, binding, path=["response"]) + assert_matches_type(ServiceBinding, binding, path=["response"]) @pytest.mark.skip() @parametrize @@ -297,7 +297,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" binding = await response.parse() - assert_matches_type(AddressingServiceBinding, binding, path=["response"]) + assert_matches_type(ServiceBinding, binding, path=["response"]) @pytest.mark.skip() @parametrize @@ -310,7 +310,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" binding = await response.parse() - assert_matches_type(AddressingServiceBinding, binding, path=["response"]) + assert_matches_type(ServiceBinding, binding, path=["response"]) assert cast(Any, response.is_closed) is True @@ -336,7 +336,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncSinglePage[AddressingServiceBinding], binding, path=["response"]) + assert_matches_type(AsyncSinglePage[ServiceBinding], binding, path=["response"]) @pytest.mark.skip() @parametrize @@ -349,7 +349,7 @@ 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" binding = await response.parse() - assert_matches_type(AsyncSinglePage[AddressingServiceBinding], binding, path=["response"]) + assert_matches_type(AsyncSinglePage[ServiceBinding], binding, path=["response"]) @pytest.mark.skip() @parametrize @@ -362,7 +362,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" binding = await response.parse() - assert_matches_type(AsyncSinglePage[AddressingServiceBinding], binding, path=["response"]) + assert_matches_type(AsyncSinglePage[ServiceBinding], binding, path=["response"]) assert cast(Any, response.is_closed) is True @@ -453,7 +453,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", prefix_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AddressingServiceBinding, binding, path=["response"]) + assert_matches_type(ServiceBinding, binding, path=["response"]) @pytest.mark.skip() @parametrize @@ -467,7 +467,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" binding = await response.parse() - assert_matches_type(AddressingServiceBinding, binding, path=["response"]) + assert_matches_type(ServiceBinding, binding, path=["response"]) @pytest.mark.skip() @parametrize @@ -481,7 +481,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" binding = await response.parse() - assert_matches_type(AddressingServiceBinding, binding, path=["response"]) + assert_matches_type(ServiceBinding, binding, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/addressing/prefixes/bgp/test_prefixes.py b/tests/api_resources/addressing/prefixes/bgp/test_prefixes.py index 48beb73c29d..f0a7190e494 100644 --- a/tests/api_resources/addressing/prefixes/bgp/test_prefixes.py +++ b/tests/api_resources/addressing/prefixes/bgp/test_prefixes.py @@ -10,7 +10,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.pagination import SyncSinglePage, AsyncSinglePage -from cloudflare.types.addressing.prefixes.bgp import AddressingIpamBGPPrefixes +from cloudflare.types.addressing.prefixes.bgp import BGPPrefix base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -25,7 +25,7 @@ def test_method_list(self, client: Cloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncSinglePage[AddressingIpamBGPPrefixes], prefix, path=["response"]) + assert_matches_type(SyncSinglePage[BGPPrefix], prefix, path=["response"]) @pytest.mark.skip() @parametrize @@ -38,7 +38,7 @@ 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" prefix = response.parse() - assert_matches_type(SyncSinglePage[AddressingIpamBGPPrefixes], prefix, path=["response"]) + assert_matches_type(SyncSinglePage[BGPPrefix], prefix, path=["response"]) @pytest.mark.skip() @parametrize @@ -51,7 +51,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" prefix = response.parse() - assert_matches_type(SyncSinglePage[AddressingIpamBGPPrefixes], prefix, path=["response"]) + assert_matches_type(SyncSinglePage[BGPPrefix], prefix, path=["response"]) assert cast(Any, response.is_closed) is True @@ -78,7 +78,7 @@ def test_method_edit(self, client: Cloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", prefix_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AddressingIpamBGPPrefixes, prefix, path=["response"]) + assert_matches_type(BGPPrefix, prefix, path=["response"]) @pytest.mark.skip() @parametrize @@ -89,7 +89,7 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: prefix_id="023e105f4ecef8ad9ca31a8372d0c353", on_demand={"advertised": True}, ) - assert_matches_type(AddressingIpamBGPPrefixes, prefix, path=["response"]) + assert_matches_type(BGPPrefix, prefix, path=["response"]) @pytest.mark.skip() @parametrize @@ -103,7 +103,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" prefix = response.parse() - assert_matches_type(AddressingIpamBGPPrefixes, prefix, path=["response"]) + assert_matches_type(BGPPrefix, prefix, path=["response"]) @pytest.mark.skip() @parametrize @@ -117,7 +117,7 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" prefix = response.parse() - assert_matches_type(AddressingIpamBGPPrefixes, prefix, path=["response"]) + assert_matches_type(BGPPrefix, prefix, path=["response"]) assert cast(Any, response.is_closed) is True @@ -153,7 +153,7 @@ def test_method_get(self, client: Cloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", prefix_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AddressingIpamBGPPrefixes, prefix, path=["response"]) + assert_matches_type(BGPPrefix, prefix, path=["response"]) @pytest.mark.skip() @parametrize @@ -167,7 +167,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" prefix = response.parse() - assert_matches_type(AddressingIpamBGPPrefixes, prefix, path=["response"]) + assert_matches_type(BGPPrefix, prefix, path=["response"]) @pytest.mark.skip() @parametrize @@ -181,7 +181,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" prefix = response.parse() - assert_matches_type(AddressingIpamBGPPrefixes, prefix, path=["response"]) + assert_matches_type(BGPPrefix, prefix, path=["response"]) assert cast(Any, response.is_closed) is True @@ -220,7 +220,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncSinglePage[AddressingIpamBGPPrefixes], prefix, path=["response"]) + assert_matches_type(AsyncSinglePage[BGPPrefix], prefix, path=["response"]) @pytest.mark.skip() @parametrize @@ -233,7 +233,7 @@ 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" prefix = await response.parse() - assert_matches_type(AsyncSinglePage[AddressingIpamBGPPrefixes], prefix, path=["response"]) + assert_matches_type(AsyncSinglePage[BGPPrefix], prefix, path=["response"]) @pytest.mark.skip() @parametrize @@ -246,7 +246,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" prefix = await response.parse() - assert_matches_type(AsyncSinglePage[AddressingIpamBGPPrefixes], prefix, path=["response"]) + assert_matches_type(AsyncSinglePage[BGPPrefix], prefix, path=["response"]) assert cast(Any, response.is_closed) is True @@ -273,7 +273,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", prefix_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AddressingIpamBGPPrefixes, prefix, path=["response"]) + assert_matches_type(BGPPrefix, prefix, path=["response"]) @pytest.mark.skip() @parametrize @@ -284,7 +284,7 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) prefix_id="023e105f4ecef8ad9ca31a8372d0c353", on_demand={"advertised": True}, ) - assert_matches_type(AddressingIpamBGPPrefixes, prefix, path=["response"]) + assert_matches_type(BGPPrefix, prefix, path=["response"]) @pytest.mark.skip() @parametrize @@ -298,7 +298,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" prefix = await response.parse() - assert_matches_type(AddressingIpamBGPPrefixes, prefix, path=["response"]) + assert_matches_type(BGPPrefix, prefix, path=["response"]) @pytest.mark.skip() @parametrize @@ -312,7 +312,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" prefix = await response.parse() - assert_matches_type(AddressingIpamBGPPrefixes, prefix, path=["response"]) + assert_matches_type(BGPPrefix, prefix, path=["response"]) assert cast(Any, response.is_closed) is True @@ -348,7 +348,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", prefix_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AddressingIpamBGPPrefixes, prefix, path=["response"]) + assert_matches_type(BGPPrefix, prefix, path=["response"]) @pytest.mark.skip() @parametrize @@ -362,7 +362,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" prefix = await response.parse() - assert_matches_type(AddressingIpamBGPPrefixes, prefix, path=["response"]) + assert_matches_type(BGPPrefix, prefix, path=["response"]) @pytest.mark.skip() @parametrize @@ -376,7 +376,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" prefix = await response.parse() - assert_matches_type(AddressingIpamBGPPrefixes, prefix, path=["response"]) + assert_matches_type(BGPPrefix, prefix, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/addressing/prefixes/test_delegations.py b/tests/api_resources/addressing/prefixes/test_delegations.py index 2630788a5c0..cc48cc0b00b 100644 --- a/tests/api_resources/addressing/prefixes/test_delegations.py +++ b/tests/api_resources/addressing/prefixes/test_delegations.py @@ -11,8 +11,8 @@ from tests.utils import assert_matches_type from cloudflare.pagination import SyncSinglePage, AsyncSinglePage from cloudflare.types.addressing.prefixes import ( + Delegations, DelegationDeleteResponse, - AddressingIpamDelegations, ) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -30,7 +30,7 @@ def test_method_create(self, client: Cloudflare) -> None: cidr="192.0.2.0/24", delegated_account_id="b1946ac92492d2347c6235b4d2611184", ) - assert_matches_type(AddressingIpamDelegations, delegation, path=["response"]) + assert_matches_type(Delegations, delegation, path=["response"]) @pytest.mark.skip() @parametrize @@ -45,7 +45,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" delegation = response.parse() - assert_matches_type(AddressingIpamDelegations, delegation, path=["response"]) + assert_matches_type(Delegations, delegation, path=["response"]) @pytest.mark.skip() @parametrize @@ -60,7 +60,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" delegation = response.parse() - assert_matches_type(AddressingIpamDelegations, delegation, path=["response"]) + assert_matches_type(Delegations, delegation, path=["response"]) assert cast(Any, response.is_closed) is True @@ -90,7 +90,7 @@ def test_method_list(self, client: Cloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncSinglePage[AddressingIpamDelegations], delegation, path=["response"]) + assert_matches_type(SyncSinglePage[Delegations], delegation, path=["response"]) @pytest.mark.skip() @parametrize @@ -103,7 +103,7 @@ 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" delegation = response.parse() - assert_matches_type(SyncSinglePage[AddressingIpamDelegations], delegation, path=["response"]) + assert_matches_type(SyncSinglePage[Delegations], delegation, path=["response"]) @pytest.mark.skip() @parametrize @@ -116,7 +116,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" delegation = response.parse() - assert_matches_type(SyncSinglePage[AddressingIpamDelegations], delegation, path=["response"]) + assert_matches_type(SyncSinglePage[Delegations], delegation, path=["response"]) assert cast(Any, response.is_closed) is True @@ -218,7 +218,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: cidr="192.0.2.0/24", delegated_account_id="b1946ac92492d2347c6235b4d2611184", ) - assert_matches_type(AddressingIpamDelegations, delegation, path=["response"]) + assert_matches_type(Delegations, delegation, path=["response"]) @pytest.mark.skip() @parametrize @@ -233,7 +233,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" delegation = await response.parse() - assert_matches_type(AddressingIpamDelegations, delegation, path=["response"]) + assert_matches_type(Delegations, delegation, path=["response"]) @pytest.mark.skip() @parametrize @@ -248,7 +248,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" delegation = await response.parse() - assert_matches_type(AddressingIpamDelegations, delegation, path=["response"]) + assert_matches_type(Delegations, delegation, path=["response"]) assert cast(Any, response.is_closed) is True @@ -278,7 +278,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncSinglePage[AddressingIpamDelegations], delegation, path=["response"]) + assert_matches_type(AsyncSinglePage[Delegations], delegation, path=["response"]) @pytest.mark.skip() @parametrize @@ -291,7 +291,7 @@ 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" delegation = await response.parse() - assert_matches_type(AsyncSinglePage[AddressingIpamDelegations], delegation, path=["response"]) + assert_matches_type(AsyncSinglePage[Delegations], delegation, path=["response"]) @pytest.mark.skip() @parametrize @@ -304,7 +304,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" delegation = await response.parse() - assert_matches_type(AsyncSinglePage[AddressingIpamDelegations], delegation, path=["response"]) + assert_matches_type(AsyncSinglePage[Delegations], delegation, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/addressing/test_address_maps.py b/tests/api_resources/addressing/test_address_maps.py index 5c6b41662c7..a4f20ddf584 100644 --- a/tests/api_resources/addressing/test_address_maps.py +++ b/tests/api_resources/addressing/test_address_maps.py @@ -12,7 +12,7 @@ from cloudflare.pagination import SyncSinglePage, AsyncSinglePage from cloudflare.types.shared import UnnamedSchemaRef67bbb1ccdd42c3e2937b9fd19f791151 from cloudflare.types.addressing import ( - AddressingAddressMaps, + AddressMap, AddressMapGetResponse, AddressMapCreateResponse, ) @@ -81,7 +81,7 @@ def test_method_list(self, client: Cloudflare) -> None: address_map = client.addressing.address_maps.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncSinglePage[AddressingAddressMaps], address_map, path=["response"]) + assert_matches_type(SyncSinglePage[AddressMap], address_map, path=["response"]) @pytest.mark.skip() @parametrize @@ -93,7 +93,7 @@ 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" address_map = response.parse() - assert_matches_type(SyncSinglePage[AddressingAddressMaps], address_map, path=["response"]) + assert_matches_type(SyncSinglePage[AddressMap], address_map, path=["response"]) @pytest.mark.skip() @parametrize @@ -105,7 +105,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" address_map = response.parse() - assert_matches_type(SyncSinglePage[AddressingAddressMaps], address_map, path=["response"]) + assert_matches_type(SyncSinglePage[AddressMap], address_map, path=["response"]) assert cast(Any, response.is_closed) is True @@ -183,7 +183,7 @@ def test_method_edit(self, client: Cloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AddressingAddressMaps, address_map, path=["response"]) + assert_matches_type(AddressMap, address_map, path=["response"]) @pytest.mark.skip() @parametrize @@ -195,7 +195,7 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: description="My Ecommerce zones", enabled=True, ) - assert_matches_type(AddressingAddressMaps, address_map, path=["response"]) + assert_matches_type(AddressMap, address_map, path=["response"]) @pytest.mark.skip() @parametrize @@ -208,7 +208,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" address_map = response.parse() - assert_matches_type(AddressingAddressMaps, address_map, path=["response"]) + assert_matches_type(AddressMap, address_map, path=["response"]) @pytest.mark.skip() @parametrize @@ -221,7 +221,7 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" address_map = response.parse() - assert_matches_type(AddressingAddressMaps, address_map, path=["response"]) + assert_matches_type(AddressMap, address_map, path=["response"]) assert cast(Any, response.is_closed) is True @@ -354,7 +354,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: address_map = await async_client.addressing.address_maps.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncSinglePage[AddressingAddressMaps], address_map, path=["response"]) + assert_matches_type(AsyncSinglePage[AddressMap], address_map, path=["response"]) @pytest.mark.skip() @parametrize @@ -366,7 +366,7 @@ 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" address_map = await response.parse() - assert_matches_type(AsyncSinglePage[AddressingAddressMaps], address_map, path=["response"]) + assert_matches_type(AsyncSinglePage[AddressMap], address_map, path=["response"]) @pytest.mark.skip() @parametrize @@ -378,7 +378,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" address_map = await response.parse() - assert_matches_type(AsyncSinglePage[AddressingAddressMaps], address_map, path=["response"]) + assert_matches_type(AsyncSinglePage[AddressMap], address_map, path=["response"]) assert cast(Any, response.is_closed) is True @@ -456,7 +456,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AddressingAddressMaps, address_map, path=["response"]) + assert_matches_type(AddressMap, address_map, path=["response"]) @pytest.mark.skip() @parametrize @@ -468,7 +468,7 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) description="My Ecommerce zones", enabled=True, ) - assert_matches_type(AddressingAddressMaps, address_map, path=["response"]) + assert_matches_type(AddressMap, address_map, path=["response"]) @pytest.mark.skip() @parametrize @@ -481,7 +481,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" address_map = await response.parse() - assert_matches_type(AddressingAddressMaps, address_map, path=["response"]) + assert_matches_type(AddressMap, address_map, path=["response"]) @pytest.mark.skip() @parametrize @@ -494,7 +494,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" address_map = await response.parse() - assert_matches_type(AddressingAddressMaps, address_map, path=["response"]) + assert_matches_type(AddressMap, address_map, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/addressing/test_prefixes.py b/tests/api_resources/addressing/test_prefixes.py index 5ec882d319a..3ebd0a2723c 100644 --- a/tests/api_resources/addressing/test_prefixes.py +++ b/tests/api_resources/addressing/test_prefixes.py @@ -11,9 +11,7 @@ from tests.utils import assert_matches_type from cloudflare.pagination import SyncSinglePage, AsyncSinglePage from cloudflare.types.shared import UnnamedSchemaRef67bbb1ccdd42c3e2937b9fd19f791151 -from cloudflare.types.addressing import ( - AddressingIpamPrefixes, -) +from cloudflare.types.addressing import Prefix base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -30,7 +28,7 @@ def test_method_create(self, client: Cloudflare) -> None: cidr="192.0.2.0/24", loa_document_id="d933b1530bc56c9953cf8ce166da8004", ) - assert_matches_type(AddressingIpamPrefixes, prefix, path=["response"]) + assert_matches_type(Prefix, prefix, path=["response"]) @pytest.mark.skip() @parametrize @@ -45,7 +43,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" prefix = response.parse() - assert_matches_type(AddressingIpamPrefixes, prefix, path=["response"]) + assert_matches_type(Prefix, prefix, path=["response"]) @pytest.mark.skip() @parametrize @@ -60,7 +58,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" prefix = response.parse() - assert_matches_type(AddressingIpamPrefixes, prefix, path=["response"]) + assert_matches_type(Prefix, prefix, path=["response"]) assert cast(Any, response.is_closed) is True @@ -81,7 +79,7 @@ def test_method_list(self, client: Cloudflare) -> None: prefix = client.addressing.prefixes.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncSinglePage[AddressingIpamPrefixes], prefix, path=["response"]) + assert_matches_type(SyncSinglePage[Prefix], prefix, path=["response"]) @pytest.mark.skip() @parametrize @@ -93,7 +91,7 @@ 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" prefix = response.parse() - assert_matches_type(SyncSinglePage[AddressingIpamPrefixes], prefix, path=["response"]) + assert_matches_type(SyncSinglePage[Prefix], prefix, path=["response"]) @pytest.mark.skip() @parametrize @@ -105,7 +103,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" prefix = response.parse() - assert_matches_type(SyncSinglePage[AddressingIpamPrefixes], prefix, path=["response"]) + assert_matches_type(SyncSinglePage[Prefix], prefix, path=["response"]) assert cast(Any, response.is_closed) is True @@ -182,7 +180,7 @@ def test_method_edit(self, client: Cloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", description="Internal test prefix", ) - assert_matches_type(AddressingIpamPrefixes, prefix, path=["response"]) + assert_matches_type(Prefix, prefix, path=["response"]) @pytest.mark.skip() @parametrize @@ -196,7 +194,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" prefix = response.parse() - assert_matches_type(AddressingIpamPrefixes, prefix, path=["response"]) + assert_matches_type(Prefix, prefix, path=["response"]) @pytest.mark.skip() @parametrize @@ -210,7 +208,7 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" prefix = response.parse() - assert_matches_type(AddressingIpamPrefixes, prefix, path=["response"]) + assert_matches_type(Prefix, prefix, path=["response"]) assert cast(Any, response.is_closed) is True @@ -238,7 +236,7 @@ def test_method_get(self, client: Cloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AddressingIpamPrefixes, prefix, path=["response"]) + assert_matches_type(Prefix, prefix, path=["response"]) @pytest.mark.skip() @parametrize @@ -251,7 +249,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" prefix = response.parse() - assert_matches_type(AddressingIpamPrefixes, prefix, path=["response"]) + assert_matches_type(Prefix, prefix, path=["response"]) @pytest.mark.skip() @parametrize @@ -264,7 +262,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" prefix = response.parse() - assert_matches_type(AddressingIpamPrefixes, prefix, path=["response"]) + assert_matches_type(Prefix, prefix, path=["response"]) assert cast(Any, response.is_closed) is True @@ -296,7 +294,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: cidr="192.0.2.0/24", loa_document_id="d933b1530bc56c9953cf8ce166da8004", ) - assert_matches_type(AddressingIpamPrefixes, prefix, path=["response"]) + assert_matches_type(Prefix, prefix, path=["response"]) @pytest.mark.skip() @parametrize @@ -311,7 +309,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" prefix = await response.parse() - assert_matches_type(AddressingIpamPrefixes, prefix, path=["response"]) + assert_matches_type(Prefix, prefix, path=["response"]) @pytest.mark.skip() @parametrize @@ -326,7 +324,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" prefix = await response.parse() - assert_matches_type(AddressingIpamPrefixes, prefix, path=["response"]) + assert_matches_type(Prefix, prefix, path=["response"]) assert cast(Any, response.is_closed) is True @@ -347,7 +345,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: prefix = await async_client.addressing.prefixes.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncSinglePage[AddressingIpamPrefixes], prefix, path=["response"]) + assert_matches_type(AsyncSinglePage[Prefix], prefix, path=["response"]) @pytest.mark.skip() @parametrize @@ -359,7 +357,7 @@ 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" prefix = await response.parse() - assert_matches_type(AsyncSinglePage[AddressingIpamPrefixes], prefix, path=["response"]) + assert_matches_type(AsyncSinglePage[Prefix], prefix, path=["response"]) @pytest.mark.skip() @parametrize @@ -371,7 +369,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" prefix = await response.parse() - assert_matches_type(AsyncSinglePage[AddressingIpamPrefixes], prefix, path=["response"]) + assert_matches_type(AsyncSinglePage[Prefix], prefix, path=["response"]) assert cast(Any, response.is_closed) is True @@ -448,7 +446,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", description="Internal test prefix", ) - assert_matches_type(AddressingIpamPrefixes, prefix, path=["response"]) + assert_matches_type(Prefix, prefix, path=["response"]) @pytest.mark.skip() @parametrize @@ -462,7 +460,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" prefix = await response.parse() - assert_matches_type(AddressingIpamPrefixes, prefix, path=["response"]) + assert_matches_type(Prefix, prefix, path=["response"]) @pytest.mark.skip() @parametrize @@ -476,7 +474,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" prefix = await response.parse() - assert_matches_type(AddressingIpamPrefixes, prefix, path=["response"]) + assert_matches_type(Prefix, prefix, path=["response"]) assert cast(Any, response.is_closed) is True @@ -504,7 +502,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AddressingIpamPrefixes, prefix, path=["response"]) + assert_matches_type(Prefix, prefix, path=["response"]) @pytest.mark.skip() @parametrize @@ -517,7 +515,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" prefix = await response.parse() - assert_matches_type(AddressingIpamPrefixes, prefix, path=["response"]) + assert_matches_type(Prefix, prefix, path=["response"]) @pytest.mark.skip() @parametrize @@ -530,7 +528,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" prefix = await response.parse() - assert_matches_type(AddressingIpamPrefixes, prefix, path=["response"]) + assert_matches_type(Prefix, prefix, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/alerting/destinations/test_webhooks.py b/tests/api_resources/alerting/destinations/test_webhooks.py index c3a39069391..236fe7d1aae 100644 --- a/tests/api_resources/alerting/destinations/test_webhooks.py +++ b/tests/api_resources/alerting/destinations/test_webhooks.py @@ -12,7 +12,7 @@ from cloudflare.pagination import SyncSinglePage, AsyncSinglePage from cloudflare.types.shared import UnnamedSchemaRef67bbb1ccdd42c3e2937b9fd19f791151 from cloudflare.types.alerting.destinations import ( - AlertingWebhooks, + Webhooks, WebhookCreateResponse, WebhookUpdateResponse, ) @@ -164,7 +164,7 @@ def test_method_list(self, client: Cloudflare) -> None: webhook = client.alerting.destinations.webhooks.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncSinglePage[AlertingWebhooks], webhook, path=["response"]) + assert_matches_type(SyncSinglePage[Webhooks], webhook, path=["response"]) @pytest.mark.skip() @parametrize @@ -176,7 +176,7 @@ 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" webhook = response.parse() - assert_matches_type(SyncSinglePage[AlertingWebhooks], webhook, path=["response"]) + assert_matches_type(SyncSinglePage[Webhooks], webhook, path=["response"]) @pytest.mark.skip() @parametrize @@ -188,7 +188,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" webhook = response.parse() - assert_matches_type(SyncSinglePage[AlertingWebhooks], webhook, path=["response"]) + assert_matches_type(SyncSinglePage[Webhooks], webhook, path=["response"]) assert cast(Any, response.is_closed) is True @@ -259,7 +259,7 @@ def test_method_get(self, client: Cloudflare) -> None: "b115d5ec-15c6-41ee-8b76-92c449b5227b", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AlertingWebhooks, webhook, path=["response"]) + assert_matches_type(Webhooks, webhook, path=["response"]) @pytest.mark.skip() @parametrize @@ -272,7 +272,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" webhook = response.parse() - assert_matches_type(AlertingWebhooks, webhook, path=["response"]) + assert_matches_type(Webhooks, webhook, path=["response"]) @pytest.mark.skip() @parametrize @@ -285,7 +285,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" webhook = response.parse() - assert_matches_type(AlertingWebhooks, webhook, path=["response"]) + assert_matches_type(Webhooks, webhook, path=["response"]) assert cast(Any, response.is_closed) is True @@ -449,7 +449,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: webhook = await async_client.alerting.destinations.webhooks.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncSinglePage[AlertingWebhooks], webhook, path=["response"]) + assert_matches_type(AsyncSinglePage[Webhooks], webhook, path=["response"]) @pytest.mark.skip() @parametrize @@ -461,7 +461,7 @@ 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" webhook = await response.parse() - assert_matches_type(AsyncSinglePage[AlertingWebhooks], webhook, path=["response"]) + assert_matches_type(AsyncSinglePage[Webhooks], webhook, path=["response"]) @pytest.mark.skip() @parametrize @@ -473,7 +473,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" webhook = await response.parse() - assert_matches_type(AsyncSinglePage[AlertingWebhooks], webhook, path=["response"]) + assert_matches_type(AsyncSinglePage[Webhooks], webhook, path=["response"]) assert cast(Any, response.is_closed) is True @@ -544,7 +544,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: "b115d5ec-15c6-41ee-8b76-92c449b5227b", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AlertingWebhooks, webhook, path=["response"]) + assert_matches_type(Webhooks, webhook, path=["response"]) @pytest.mark.skip() @parametrize @@ -557,7 +557,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" webhook = await response.parse() - assert_matches_type(AlertingWebhooks, webhook, path=["response"]) + assert_matches_type(Webhooks, webhook, path=["response"]) @pytest.mark.skip() @parametrize @@ -570,7 +570,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" webhook = await response.parse() - assert_matches_type(AlertingWebhooks, webhook, path=["response"]) + assert_matches_type(Webhooks, webhook, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/alerting/test_history.py b/tests/api_resources/alerting/test_history.py index 7fe38ffcb56..3ed58bbf83c 100644 --- a/tests/api_resources/alerting/test_history.py +++ b/tests/api_resources/alerting/test_history.py @@ -11,7 +11,7 @@ from tests.utils import assert_matches_type from cloudflare._utils import parse_datetime from cloudflare.pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray -from cloudflare.types.alerting import AlertingHistory +from cloudflare.types.alerting import History base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -25,7 +25,7 @@ def test_method_list(self, client: Cloudflare) -> None: history = client.alerting.history.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncV4PagePaginationArray[AlertingHistory], history, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[History], history, path=["response"]) @pytest.mark.skip() @parametrize @@ -37,7 +37,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: per_page=5, since=parse_datetime("2022-05-19T20:29:58.679897Z"), ) - assert_matches_type(SyncV4PagePaginationArray[AlertingHistory], history, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[History], history, path=["response"]) @pytest.mark.skip() @parametrize @@ -49,7 +49,7 @@ 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" history = response.parse() - assert_matches_type(SyncV4PagePaginationArray[AlertingHistory], history, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[History], history, path=["response"]) @pytest.mark.skip() @parametrize @@ -61,7 +61,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" history = response.parse() - assert_matches_type(SyncV4PagePaginationArray[AlertingHistory], history, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[History], history, path=["response"]) assert cast(Any, response.is_closed) is True @@ -83,7 +83,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: history = await async_client.alerting.history.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncV4PagePaginationArray[AlertingHistory], history, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[History], history, path=["response"]) @pytest.mark.skip() @parametrize @@ -95,7 +95,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) per_page=5, since=parse_datetime("2022-05-19T20:29:58.679897Z"), ) - assert_matches_type(AsyncV4PagePaginationArray[AlertingHistory], history, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[History], history, path=["response"]) @pytest.mark.skip() @parametrize @@ -107,7 +107,7 @@ 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" history = await response.parse() - assert_matches_type(AsyncV4PagePaginationArray[AlertingHistory], history, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[History], history, path=["response"]) @pytest.mark.skip() @parametrize @@ -119,7 +119,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" history = await response.parse() - assert_matches_type(AsyncV4PagePaginationArray[AlertingHistory], history, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[History], history, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/alerting/test_policies.py b/tests/api_resources/alerting/test_policies.py index 47b38f7d628..092ebc86c15 100644 --- a/tests/api_resources/alerting/test_policies.py +++ b/tests/api_resources/alerting/test_policies.py @@ -12,7 +12,7 @@ from cloudflare.pagination import SyncSinglePage, AsyncSinglePage from cloudflare.types.shared import UnnamedSchemaRef67bbb1ccdd42c3e2937b9fd19f791151 from cloudflare.types.alerting import ( - Policies, + Policy, PolicyCreateResponse, PolicyUpdateResponse, ) @@ -274,7 +274,7 @@ def test_method_list(self, client: Cloudflare) -> None: policy = client.alerting.policies.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncSinglePage[Policies], policy, path=["response"]) + assert_matches_type(SyncSinglePage[Policy], policy, path=["response"]) @pytest.mark.skip() @parametrize @@ -286,7 +286,7 @@ 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" policy = response.parse() - assert_matches_type(SyncSinglePage[Policies], policy, path=["response"]) + assert_matches_type(SyncSinglePage[Policy], policy, path=["response"]) @pytest.mark.skip() @parametrize @@ -298,7 +298,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = response.parse() - assert_matches_type(SyncSinglePage[Policies], policy, path=["response"]) + assert_matches_type(SyncSinglePage[Policy], policy, path=["response"]) assert cast(Any, response.is_closed) is True @@ -369,7 +369,7 @@ def test_method_get(self, client: Cloudflare) -> None: "0da2b59e-f118-439d-8097-bdfb215203c9", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Policies, policy, path=["response"]) + assert_matches_type(Policy, policy, path=["response"]) @pytest.mark.skip() @parametrize @@ -382,7 +382,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = response.parse() - assert_matches_type(Policies, policy, path=["response"]) + assert_matches_type(Policy, policy, path=["response"]) @pytest.mark.skip() @parametrize @@ -395,7 +395,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = response.parse() - assert_matches_type(Policies, policy, path=["response"]) + assert_matches_type(Policy, policy, path=["response"]) assert cast(Any, response.is_closed) is True @@ -669,7 +669,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: policy = await async_client.alerting.policies.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncSinglePage[Policies], policy, path=["response"]) + assert_matches_type(AsyncSinglePage[Policy], policy, path=["response"]) @pytest.mark.skip() @parametrize @@ -681,7 +681,7 @@ 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" policy = await response.parse() - assert_matches_type(AsyncSinglePage[Policies], policy, path=["response"]) + assert_matches_type(AsyncSinglePage[Policy], policy, path=["response"]) @pytest.mark.skip() @parametrize @@ -693,7 +693,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = await response.parse() - assert_matches_type(AsyncSinglePage[Policies], policy, path=["response"]) + assert_matches_type(AsyncSinglePage[Policy], policy, path=["response"]) assert cast(Any, response.is_closed) is True @@ -764,7 +764,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: "0da2b59e-f118-439d-8097-bdfb215203c9", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Policies, policy, path=["response"]) + assert_matches_type(Policy, policy, path=["response"]) @pytest.mark.skip() @parametrize @@ -777,7 +777,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = await response.parse() - assert_matches_type(Policies, policy, path=["response"]) + assert_matches_type(Policy, policy, path=["response"]) @pytest.mark.skip() @parametrize @@ -790,7 +790,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = await response.parse() - assert_matches_type(Policies, policy, path=["response"]) + assert_matches_type(Policy, policy, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/challenges/test_widgets.py b/tests/api_resources/challenges/test_widgets.py index 9a6efa429ee..ed9bb81dabb 100644 --- a/tests/api_resources/challenges/test_widgets.py +++ b/tests/api_resources/challenges/test_widgets.py @@ -11,8 +11,8 @@ from tests.utils import assert_matches_type from cloudflare.pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray from cloudflare.types.challenges import ( - ChallengesWidget, - ChallengesWidgetList, + Widget, + WidgetDomain, ) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -30,7 +30,7 @@ def test_method_create(self, client: Cloudflare) -> None: mode="invisible", name="blog.cloudflare.com login form", ) - assert_matches_type(Optional[ChallengesWidget], widget, path=["response"]) + assert_matches_type(Optional[Widget], widget, path=["response"]) @pytest.mark.skip() @parametrize @@ -49,7 +49,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: offlabel=False, region="world", ) - assert_matches_type(Optional[ChallengesWidget], widget, path=["response"]) + assert_matches_type(Optional[Widget], widget, path=["response"]) @pytest.mark.skip() @parametrize @@ -64,7 +64,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" widget = response.parse() - assert_matches_type(Optional[ChallengesWidget], widget, path=["response"]) + assert_matches_type(Optional[Widget], widget, path=["response"]) @pytest.mark.skip() @parametrize @@ -79,7 +79,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" widget = response.parse() - assert_matches_type(Optional[ChallengesWidget], widget, path=["response"]) + assert_matches_type(Optional[Widget], widget, path=["response"]) assert cast(Any, response.is_closed) is True @@ -104,7 +104,7 @@ def test_method_update(self, client: Cloudflare) -> None: mode="invisible", name="blog.cloudflare.com login form", ) - assert_matches_type(Optional[ChallengesWidget], widget, path=["response"]) + assert_matches_type(Optional[Widget], widget, path=["response"]) @pytest.mark.skip() @parametrize @@ -119,7 +119,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: clearance_level="interactive", offlabel=False, ) - assert_matches_type(Optional[ChallengesWidget], widget, path=["response"]) + assert_matches_type(Optional[Widget], widget, path=["response"]) @pytest.mark.skip() @parametrize @@ -135,7 +135,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" widget = response.parse() - assert_matches_type(Optional[ChallengesWidget], widget, path=["response"]) + assert_matches_type(Optional[Widget], widget, path=["response"]) @pytest.mark.skip() @parametrize @@ -151,7 +151,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" widget = response.parse() - assert_matches_type(Optional[ChallengesWidget], widget, path=["response"]) + assert_matches_type(Optional[Widget], widget, path=["response"]) assert cast(Any, response.is_closed) is True @@ -182,7 +182,7 @@ def test_method_list(self, client: Cloudflare) -> None: widget = client.challenges.widgets.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncV4PagePaginationArray[ChallengesWidgetList], widget, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[WidgetDomain], widget, path=["response"]) @pytest.mark.skip() @parametrize @@ -194,7 +194,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: page=1, per_page=5, ) - assert_matches_type(SyncV4PagePaginationArray[ChallengesWidgetList], widget, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[WidgetDomain], widget, path=["response"]) @pytest.mark.skip() @parametrize @@ -206,7 +206,7 @@ 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" widget = response.parse() - assert_matches_type(SyncV4PagePaginationArray[ChallengesWidgetList], widget, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[WidgetDomain], widget, path=["response"]) @pytest.mark.skip() @parametrize @@ -218,7 +218,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" widget = response.parse() - assert_matches_type(SyncV4PagePaginationArray[ChallengesWidgetList], widget, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[WidgetDomain], widget, path=["response"]) assert cast(Any, response.is_closed) is True @@ -237,7 +237,7 @@ def test_method_delete(self, client: Cloudflare) -> None: "0x4AAF00AAAABn0R22HWm-YUc", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[ChallengesWidget], widget, path=["response"]) + assert_matches_type(Optional[Widget], widget, path=["response"]) @pytest.mark.skip() @parametrize @@ -250,7 +250,7 @@ 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" widget = response.parse() - assert_matches_type(Optional[ChallengesWidget], widget, path=["response"]) + assert_matches_type(Optional[Widget], widget, path=["response"]) @pytest.mark.skip() @parametrize @@ -263,7 +263,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" widget = response.parse() - assert_matches_type(Optional[ChallengesWidget], widget, path=["response"]) + assert_matches_type(Optional[Widget], widget, path=["response"]) assert cast(Any, response.is_closed) is True @@ -289,7 +289,7 @@ def test_method_get(self, client: Cloudflare) -> None: "0x4AAF00AAAABn0R22HWm-YUc", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[ChallengesWidget], widget, path=["response"]) + assert_matches_type(Optional[Widget], widget, path=["response"]) @pytest.mark.skip() @parametrize @@ -302,7 +302,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" widget = response.parse() - assert_matches_type(Optional[ChallengesWidget], widget, path=["response"]) + assert_matches_type(Optional[Widget], widget, path=["response"]) @pytest.mark.skip() @parametrize @@ -315,7 +315,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" widget = response.parse() - assert_matches_type(Optional[ChallengesWidget], widget, path=["response"]) + assert_matches_type(Optional[Widget], widget, path=["response"]) assert cast(Any, response.is_closed) is True @@ -341,7 +341,7 @@ def test_method_rotate_secret(self, client: Cloudflare) -> None: "0x4AAF00AAAABn0R22HWm-YUc", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[ChallengesWidget], widget, path=["response"]) + assert_matches_type(Optional[Widget], widget, path=["response"]) @pytest.mark.skip() @parametrize @@ -351,7 +351,7 @@ def test_method_rotate_secret_with_all_params(self, client: Cloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", invalidate_immediately=True, ) - assert_matches_type(Optional[ChallengesWidget], widget, path=["response"]) + assert_matches_type(Optional[Widget], widget, path=["response"]) @pytest.mark.skip() @parametrize @@ -364,7 +364,7 @@ def test_raw_response_rotate_secret(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" widget = response.parse() - assert_matches_type(Optional[ChallengesWidget], widget, path=["response"]) + assert_matches_type(Optional[Widget], widget, path=["response"]) @pytest.mark.skip() @parametrize @@ -377,7 +377,7 @@ def test_streaming_response_rotate_secret(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" widget = response.parse() - assert_matches_type(Optional[ChallengesWidget], widget, path=["response"]) + assert_matches_type(Optional[Widget], widget, path=["response"]) assert cast(Any, response.is_closed) is True @@ -409,7 +409,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: mode="invisible", name="blog.cloudflare.com login form", ) - assert_matches_type(Optional[ChallengesWidget], widget, path=["response"]) + assert_matches_type(Optional[Widget], widget, path=["response"]) @pytest.mark.skip() @parametrize @@ -428,7 +428,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare offlabel=False, region="world", ) - assert_matches_type(Optional[ChallengesWidget], widget, path=["response"]) + assert_matches_type(Optional[Widget], widget, path=["response"]) @pytest.mark.skip() @parametrize @@ -443,7 +443,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" widget = await response.parse() - assert_matches_type(Optional[ChallengesWidget], widget, path=["response"]) + assert_matches_type(Optional[Widget], widget, path=["response"]) @pytest.mark.skip() @parametrize @@ -458,7 +458,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" widget = await response.parse() - assert_matches_type(Optional[ChallengesWidget], widget, path=["response"]) + assert_matches_type(Optional[Widget], widget, path=["response"]) assert cast(Any, response.is_closed) is True @@ -483,7 +483,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: mode="invisible", name="blog.cloudflare.com login form", ) - assert_matches_type(Optional[ChallengesWidget], widget, path=["response"]) + assert_matches_type(Optional[Widget], widget, path=["response"]) @pytest.mark.skip() @parametrize @@ -498,7 +498,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare clearance_level="interactive", offlabel=False, ) - assert_matches_type(Optional[ChallengesWidget], widget, path=["response"]) + assert_matches_type(Optional[Widget], widget, path=["response"]) @pytest.mark.skip() @parametrize @@ -514,7 +514,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" widget = await response.parse() - assert_matches_type(Optional[ChallengesWidget], widget, path=["response"]) + assert_matches_type(Optional[Widget], widget, path=["response"]) @pytest.mark.skip() @parametrize @@ -530,7 +530,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" widget = await response.parse() - assert_matches_type(Optional[ChallengesWidget], widget, path=["response"]) + assert_matches_type(Optional[Widget], widget, path=["response"]) assert cast(Any, response.is_closed) is True @@ -561,7 +561,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: widget = await async_client.challenges.widgets.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncV4PagePaginationArray[ChallengesWidgetList], widget, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[WidgetDomain], widget, path=["response"]) @pytest.mark.skip() @parametrize @@ -573,7 +573,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) page=1, per_page=5, ) - assert_matches_type(AsyncV4PagePaginationArray[ChallengesWidgetList], widget, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[WidgetDomain], widget, path=["response"]) @pytest.mark.skip() @parametrize @@ -585,7 +585,7 @@ 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" widget = await response.parse() - assert_matches_type(AsyncV4PagePaginationArray[ChallengesWidgetList], widget, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[WidgetDomain], widget, path=["response"]) @pytest.mark.skip() @parametrize @@ -597,7 +597,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" widget = await response.parse() - assert_matches_type(AsyncV4PagePaginationArray[ChallengesWidgetList], widget, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[WidgetDomain], widget, path=["response"]) assert cast(Any, response.is_closed) is True @@ -616,7 +616,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: "0x4AAF00AAAABn0R22HWm-YUc", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[ChallengesWidget], widget, path=["response"]) + assert_matches_type(Optional[Widget], widget, path=["response"]) @pytest.mark.skip() @parametrize @@ -629,7 +629,7 @@ 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" widget = await response.parse() - assert_matches_type(Optional[ChallengesWidget], widget, path=["response"]) + assert_matches_type(Optional[Widget], widget, path=["response"]) @pytest.mark.skip() @parametrize @@ -642,7 +642,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" widget = await response.parse() - assert_matches_type(Optional[ChallengesWidget], widget, path=["response"]) + assert_matches_type(Optional[Widget], widget, path=["response"]) assert cast(Any, response.is_closed) is True @@ -668,7 +668,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: "0x4AAF00AAAABn0R22HWm-YUc", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[ChallengesWidget], widget, path=["response"]) + assert_matches_type(Optional[Widget], widget, path=["response"]) @pytest.mark.skip() @parametrize @@ -681,7 +681,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" widget = await response.parse() - assert_matches_type(Optional[ChallengesWidget], widget, path=["response"]) + assert_matches_type(Optional[Widget], widget, path=["response"]) @pytest.mark.skip() @parametrize @@ -694,7 +694,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" widget = await response.parse() - assert_matches_type(Optional[ChallengesWidget], widget, path=["response"]) + assert_matches_type(Optional[Widget], widget, path=["response"]) assert cast(Any, response.is_closed) is True @@ -720,7 +720,7 @@ async def test_method_rotate_secret(self, async_client: AsyncCloudflare) -> None "0x4AAF00AAAABn0R22HWm-YUc", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[ChallengesWidget], widget, path=["response"]) + assert_matches_type(Optional[Widget], widget, path=["response"]) @pytest.mark.skip() @parametrize @@ -730,7 +730,7 @@ async def test_method_rotate_secret_with_all_params(self, async_client: AsyncClo account_id="023e105f4ecef8ad9ca31a8372d0c353", invalidate_immediately=True, ) - assert_matches_type(Optional[ChallengesWidget], widget, path=["response"]) + assert_matches_type(Optional[Widget], widget, path=["response"]) @pytest.mark.skip() @parametrize @@ -743,7 +743,7 @@ async def test_raw_response_rotate_secret(self, async_client: AsyncCloudflare) - assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" widget = await response.parse() - assert_matches_type(Optional[ChallengesWidget], widget, path=["response"]) + assert_matches_type(Optional[Widget], widget, path=["response"]) @pytest.mark.skip() @parametrize @@ -756,7 +756,7 @@ async def test_streaming_response_rotate_secret(self, async_client: AsyncCloudfl assert response.http_request.headers.get("X-Stainless-Lang") == "python" widget = await response.parse() - assert_matches_type(Optional[ChallengesWidget], widget, path=["response"]) + assert_matches_type(Optional[Widget], widget, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/cloudforce_one/requests/test_message.py b/tests/api_resources/cloudforce_one/requests/test_message.py index 42ab6318a54..500306ca56b 100644 --- a/tests/api_resources/cloudforce_one/requests/test_message.py +++ b/tests/api_resources/cloudforce_one/requests/test_message.py @@ -12,8 +12,8 @@ from cloudflare._utils import parse_datetime from cloudflare.types.shared import UnnamedSchemaRefEc4d85c3d1bcc6b3b7e99c199ae99846 from cloudflare.types.cloudforce_one.requests import ( + Message, MessageGetResponse, - CloudforceOneRequestMessageItem, ) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -29,7 +29,7 @@ def test_method_create(self, client: Cloudflare) -> None: "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(CloudforceOneRequestMessageItem, message, path=["response"]) + assert_matches_type(Message, message, path=["response"]) @pytest.mark.skip() @parametrize @@ -39,7 +39,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: account_identifier="023e105f4ecef8ad9ca31a8372d0c353", content="Can you elaborate on the type of DoS that occurred?", ) - assert_matches_type(CloudforceOneRequestMessageItem, message, path=["response"]) + assert_matches_type(Message, message, path=["response"]) @pytest.mark.skip() @parametrize @@ -52,7 +52,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" message = response.parse() - assert_matches_type(CloudforceOneRequestMessageItem, message, path=["response"]) + assert_matches_type(Message, message, path=["response"]) @pytest.mark.skip() @parametrize @@ -65,7 +65,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" message = response.parse() - assert_matches_type(CloudforceOneRequestMessageItem, message, path=["response"]) + assert_matches_type(Message, message, path=["response"]) assert cast(Any, response.is_closed) is True @@ -92,7 +92,7 @@ def test_method_update(self, client: Cloudflare) -> None: account_identifier="023e105f4ecef8ad9ca31a8372d0c353", request_identifier="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", ) - assert_matches_type(CloudforceOneRequestMessageItem, message, path=["response"]) + assert_matches_type(Message, message, path=["response"]) @pytest.mark.skip() @parametrize @@ -107,7 +107,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: summary="DoS attack", tlp="clear", ) - assert_matches_type(CloudforceOneRequestMessageItem, message, path=["response"]) + assert_matches_type(Message, message, path=["response"]) @pytest.mark.skip() @parametrize @@ -121,7 +121,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" message = response.parse() - assert_matches_type(CloudforceOneRequestMessageItem, message, path=["response"]) + assert_matches_type(Message, message, path=["response"]) @pytest.mark.skip() @parametrize @@ -135,7 +135,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" message = response.parse() - assert_matches_type(CloudforceOneRequestMessageItem, message, path=["response"]) + assert_matches_type(Message, message, path=["response"]) assert cast(Any, response.is_closed) is True @@ -301,7 +301,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(CloudforceOneRequestMessageItem, message, path=["response"]) + assert_matches_type(Message, message, path=["response"]) @pytest.mark.skip() @parametrize @@ -311,7 +311,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare account_identifier="023e105f4ecef8ad9ca31a8372d0c353", content="Can you elaborate on the type of DoS that occurred?", ) - assert_matches_type(CloudforceOneRequestMessageItem, message, path=["response"]) + assert_matches_type(Message, message, path=["response"]) @pytest.mark.skip() @parametrize @@ -324,7 +324,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" message = await response.parse() - assert_matches_type(CloudforceOneRequestMessageItem, message, path=["response"]) + assert_matches_type(Message, message, path=["response"]) @pytest.mark.skip() @parametrize @@ -337,7 +337,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" message = await response.parse() - assert_matches_type(CloudforceOneRequestMessageItem, message, path=["response"]) + assert_matches_type(Message, message, path=["response"]) assert cast(Any, response.is_closed) is True @@ -364,7 +364,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: account_identifier="023e105f4ecef8ad9ca31a8372d0c353", request_identifier="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", ) - assert_matches_type(CloudforceOneRequestMessageItem, message, path=["response"]) + assert_matches_type(Message, message, path=["response"]) @pytest.mark.skip() @parametrize @@ -379,7 +379,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare summary="DoS attack", tlp="clear", ) - assert_matches_type(CloudforceOneRequestMessageItem, message, path=["response"]) + assert_matches_type(Message, message, path=["response"]) @pytest.mark.skip() @parametrize @@ -393,7 +393,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" message = await response.parse() - assert_matches_type(CloudforceOneRequestMessageItem, message, path=["response"]) + assert_matches_type(Message, message, path=["response"]) @pytest.mark.skip() @parametrize @@ -407,7 +407,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" message = await response.parse() - assert_matches_type(CloudforceOneRequestMessageItem, message, path=["response"]) + assert_matches_type(Message, message, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/cloudforce_one/requests/test_priority.py b/tests/api_resources/cloudforce_one/requests/test_priority.py index 2ea9e29ad9f..6e4b70bc1b9 100644 --- a/tests/api_resources/cloudforce_one/requests/test_priority.py +++ b/tests/api_resources/cloudforce_one/requests/test_priority.py @@ -10,10 +10,8 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.types.shared import UnnamedSchemaRefEc4d85c3d1bcc6b3b7e99c199ae99846 -from cloudflare.types.cloudforce_one import CloudforceOneQuota, CloudforceOneRequestItem -from cloudflare.types.cloudforce_one.requests import ( - CloudforceOnePriorityItem, -) +from cloudflare.types.cloudforce_one import Item, Quota +from cloudflare.types.cloudforce_one.requests import Priority base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -31,7 +29,7 @@ def test_method_create(self, client: Cloudflare) -> None: requirement="DoS attacks carried out by CVEs", tlp="clear", ) - assert_matches_type(CloudforceOnePriorityItem, priority, path=["response"]) + assert_matches_type(Priority, priority, path=["response"]) @pytest.mark.skip() @parametrize @@ -47,7 +45,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" priority = response.parse() - assert_matches_type(CloudforceOnePriorityItem, priority, path=["response"]) + assert_matches_type(Priority, priority, path=["response"]) @pytest.mark.skip() @parametrize @@ -63,7 +61,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" priority = response.parse() - assert_matches_type(CloudforceOnePriorityItem, priority, path=["response"]) + assert_matches_type(Priority, priority, path=["response"]) assert cast(Any, response.is_closed) is True @@ -90,7 +88,7 @@ def test_method_update(self, client: Cloudflare) -> None: requirement="DoS attacks carried out by CVEs", tlp="clear", ) - assert_matches_type(CloudforceOneRequestItem, priority, path=["response"]) + assert_matches_type(Item, priority, path=["response"]) @pytest.mark.skip() @parametrize @@ -107,7 +105,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" priority = response.parse() - assert_matches_type(CloudforceOneRequestItem, priority, path=["response"]) + assert_matches_type(Item, priority, path=["response"]) @pytest.mark.skip() @parametrize @@ -124,7 +122,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" priority = response.parse() - assert_matches_type(CloudforceOneRequestItem, priority, path=["response"]) + assert_matches_type(Item, priority, path=["response"]) assert cast(Any, response.is_closed) is True @@ -210,7 +208,7 @@ def test_method_get(self, client: Cloudflare) -> None: "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(CloudforceOneRequestItem, priority, path=["response"]) + assert_matches_type(Item, priority, path=["response"]) @pytest.mark.skip() @parametrize @@ -223,7 +221,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" priority = response.parse() - assert_matches_type(CloudforceOneRequestItem, priority, path=["response"]) + assert_matches_type(Item, priority, path=["response"]) @pytest.mark.skip() @parametrize @@ -236,7 +234,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" priority = response.parse() - assert_matches_type(CloudforceOneRequestItem, priority, path=["response"]) + assert_matches_type(Item, priority, path=["response"]) assert cast(Any, response.is_closed) is True @@ -261,7 +259,7 @@ def test_method_quota(self, client: Cloudflare) -> None: priority = client.cloudforce_one.requests.priority.quota( "023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(CloudforceOneQuota, priority, path=["response"]) + assert_matches_type(Quota, priority, path=["response"]) @pytest.mark.skip() @parametrize @@ -273,7 +271,7 @@ def test_raw_response_quota(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" priority = response.parse() - assert_matches_type(CloudforceOneQuota, priority, path=["response"]) + assert_matches_type(Quota, priority, path=["response"]) @pytest.mark.skip() @parametrize @@ -285,7 +283,7 @@ def test_streaming_response_quota(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" priority = response.parse() - assert_matches_type(CloudforceOneQuota, priority, path=["response"]) + assert_matches_type(Quota, priority, path=["response"]) assert cast(Any, response.is_closed) is True @@ -311,7 +309,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: requirement="DoS attacks carried out by CVEs", tlp="clear", ) - assert_matches_type(CloudforceOnePriorityItem, priority, path=["response"]) + assert_matches_type(Priority, priority, path=["response"]) @pytest.mark.skip() @parametrize @@ -327,7 +325,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" priority = await response.parse() - assert_matches_type(CloudforceOnePriorityItem, priority, path=["response"]) + assert_matches_type(Priority, priority, path=["response"]) @pytest.mark.skip() @parametrize @@ -343,7 +341,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" priority = await response.parse() - assert_matches_type(CloudforceOnePriorityItem, priority, path=["response"]) + assert_matches_type(Priority, priority, path=["response"]) assert cast(Any, response.is_closed) is True @@ -370,7 +368,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: requirement="DoS attacks carried out by CVEs", tlp="clear", ) - assert_matches_type(CloudforceOneRequestItem, priority, path=["response"]) + assert_matches_type(Item, priority, path=["response"]) @pytest.mark.skip() @parametrize @@ -387,7 +385,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" priority = await response.parse() - assert_matches_type(CloudforceOneRequestItem, priority, path=["response"]) + assert_matches_type(Item, priority, path=["response"]) @pytest.mark.skip() @parametrize @@ -404,7 +402,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" priority = await response.parse() - assert_matches_type(CloudforceOneRequestItem, priority, path=["response"]) + assert_matches_type(Item, priority, path=["response"]) assert cast(Any, response.is_closed) is True @@ -490,7 +488,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(CloudforceOneRequestItem, priority, path=["response"]) + assert_matches_type(Item, priority, path=["response"]) @pytest.mark.skip() @parametrize @@ -503,7 +501,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" priority = await response.parse() - assert_matches_type(CloudforceOneRequestItem, priority, path=["response"]) + assert_matches_type(Item, priority, path=["response"]) @pytest.mark.skip() @parametrize @@ -516,7 +514,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" priority = await response.parse() - assert_matches_type(CloudforceOneRequestItem, priority, path=["response"]) + assert_matches_type(Item, priority, path=["response"]) assert cast(Any, response.is_closed) is True @@ -541,7 +539,7 @@ async def test_method_quota(self, async_client: AsyncCloudflare) -> None: priority = await async_client.cloudforce_one.requests.priority.quota( "023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(CloudforceOneQuota, priority, path=["response"]) + assert_matches_type(Quota, priority, path=["response"]) @pytest.mark.skip() @parametrize @@ -553,7 +551,7 @@ async def test_raw_response_quota(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" priority = await response.parse() - assert_matches_type(CloudforceOneQuota, priority, path=["response"]) + assert_matches_type(Quota, priority, path=["response"]) @pytest.mark.skip() @parametrize @@ -565,7 +563,7 @@ async def test_streaming_response_quota(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" priority = await response.parse() - assert_matches_type(CloudforceOneQuota, priority, path=["response"]) + assert_matches_type(Quota, priority, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/cloudforce_one/test_requests.py b/tests/api_resources/cloudforce_one/test_requests.py index af671c41b00..cb6cb0b78aa 100644 --- a/tests/api_resources/cloudforce_one/test_requests.py +++ b/tests/api_resources/cloudforce_one/test_requests.py @@ -13,11 +13,11 @@ from cloudflare.pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray from cloudflare.types.shared import UnnamedSchemaRefEc4d85c3d1bcc6b3b7e99c199ae99846 from cloudflare.types.cloudforce_one import ( - CloudforceOneQuota, - CloudforceOneRequestItem, - CloudforceOneRequestTypes, - CloudforceOneRequestListItem, - CloudforceOneRequestConstants, + Item, + Quota, + ListItem, + RequestTypes, + RequestConstants, ) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -32,7 +32,7 @@ def test_method_create(self, client: Cloudflare) -> None: request = client.cloudforce_one.requests.create( "023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(CloudforceOneRequestItem, request, path=["response"]) + assert_matches_type(Item, request, path=["response"]) @pytest.mark.skip() @parametrize @@ -45,7 +45,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: summary="DoS attack", tlp="clear", ) - assert_matches_type(CloudforceOneRequestItem, request, path=["response"]) + assert_matches_type(Item, request, path=["response"]) @pytest.mark.skip() @parametrize @@ -57,7 +57,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" request = response.parse() - assert_matches_type(CloudforceOneRequestItem, request, path=["response"]) + assert_matches_type(Item, request, path=["response"]) @pytest.mark.skip() @parametrize @@ -69,7 +69,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" request = response.parse() - assert_matches_type(CloudforceOneRequestItem, request, path=["response"]) + assert_matches_type(Item, request, path=["response"]) assert cast(Any, response.is_closed) is True @@ -88,7 +88,7 @@ def test_method_update(self, client: Cloudflare) -> None: "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(CloudforceOneRequestItem, request, path=["response"]) + assert_matches_type(Item, request, path=["response"]) @pytest.mark.skip() @parametrize @@ -102,7 +102,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: summary="DoS attack", tlp="clear", ) - assert_matches_type(CloudforceOneRequestItem, request, path=["response"]) + assert_matches_type(Item, request, path=["response"]) @pytest.mark.skip() @parametrize @@ -115,7 +115,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" request = response.parse() - assert_matches_type(CloudforceOneRequestItem, request, path=["response"]) + assert_matches_type(Item, request, path=["response"]) @pytest.mark.skip() @parametrize @@ -128,7 +128,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" request = response.parse() - assert_matches_type(CloudforceOneRequestItem, request, path=["response"]) + assert_matches_type(Item, request, path=["response"]) assert cast(Any, response.is_closed) is True @@ -155,7 +155,7 @@ def test_method_list(self, client: Cloudflare) -> None: page=0, per_page=10, ) - assert_matches_type(SyncV4PagePaginationArray[CloudforceOneRequestListItem], request, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[ListItem], request, path=["response"]) @pytest.mark.skip() @parametrize @@ -173,7 +173,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: sort_order="asc", status="open", ) - assert_matches_type(SyncV4PagePaginationArray[CloudforceOneRequestListItem], request, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[ListItem], request, path=["response"]) @pytest.mark.skip() @parametrize @@ -187,7 +187,7 @@ 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" request = response.parse() - assert_matches_type(SyncV4PagePaginationArray[CloudforceOneRequestListItem], request, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[ListItem], request, path=["response"]) @pytest.mark.skip() @parametrize @@ -201,7 +201,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" request = response.parse() - assert_matches_type(SyncV4PagePaginationArray[CloudforceOneRequestListItem], request, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[ListItem], request, path=["response"]) assert cast(Any, response.is_closed) is True @@ -273,7 +273,7 @@ def test_method_constants(self, client: Cloudflare) -> None: request = client.cloudforce_one.requests.constants( "023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(CloudforceOneRequestConstants, request, path=["response"]) + assert_matches_type(RequestConstants, request, path=["response"]) @pytest.mark.skip() @parametrize @@ -285,7 +285,7 @@ def test_raw_response_constants(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" request = response.parse() - assert_matches_type(CloudforceOneRequestConstants, request, path=["response"]) + assert_matches_type(RequestConstants, request, path=["response"]) @pytest.mark.skip() @parametrize @@ -297,7 +297,7 @@ def test_streaming_response_constants(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" request = response.parse() - assert_matches_type(CloudforceOneRequestConstants, request, path=["response"]) + assert_matches_type(RequestConstants, request, path=["response"]) assert cast(Any, response.is_closed) is True @@ -316,7 +316,7 @@ def test_method_get(self, client: Cloudflare) -> None: "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(CloudforceOneRequestItem, request, path=["response"]) + assert_matches_type(Item, request, path=["response"]) @pytest.mark.skip() @parametrize @@ -329,7 +329,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" request = response.parse() - assert_matches_type(CloudforceOneRequestItem, request, path=["response"]) + assert_matches_type(Item, request, path=["response"]) @pytest.mark.skip() @parametrize @@ -342,7 +342,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" request = response.parse() - assert_matches_type(CloudforceOneRequestItem, request, path=["response"]) + assert_matches_type(Item, request, path=["response"]) assert cast(Any, response.is_closed) is True @@ -367,7 +367,7 @@ def test_method_quota(self, client: Cloudflare) -> None: request = client.cloudforce_one.requests.quota( "023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(CloudforceOneQuota, request, path=["response"]) + assert_matches_type(Quota, request, path=["response"]) @pytest.mark.skip() @parametrize @@ -379,7 +379,7 @@ def test_raw_response_quota(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" request = response.parse() - assert_matches_type(CloudforceOneQuota, request, path=["response"]) + assert_matches_type(Quota, request, path=["response"]) @pytest.mark.skip() @parametrize @@ -391,7 +391,7 @@ def test_streaming_response_quota(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" request = response.parse() - assert_matches_type(CloudforceOneQuota, request, path=["response"]) + assert_matches_type(Quota, request, path=["response"]) assert cast(Any, response.is_closed) is True @@ -409,7 +409,7 @@ def test_method_types(self, client: Cloudflare) -> None: request = client.cloudforce_one.requests.types( "023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(CloudforceOneRequestTypes, request, path=["response"]) + assert_matches_type(RequestTypes, request, path=["response"]) @pytest.mark.skip() @parametrize @@ -421,7 +421,7 @@ def test_raw_response_types(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" request = response.parse() - assert_matches_type(CloudforceOneRequestTypes, request, path=["response"]) + assert_matches_type(RequestTypes, request, path=["response"]) @pytest.mark.skip() @parametrize @@ -433,7 +433,7 @@ def test_streaming_response_types(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" request = response.parse() - assert_matches_type(CloudforceOneRequestTypes, request, path=["response"]) + assert_matches_type(RequestTypes, request, path=["response"]) assert cast(Any, response.is_closed) is True @@ -455,7 +455,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: request = await async_client.cloudforce_one.requests.create( "023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(CloudforceOneRequestItem, request, path=["response"]) + assert_matches_type(Item, request, path=["response"]) @pytest.mark.skip() @parametrize @@ -468,7 +468,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare summary="DoS attack", tlp="clear", ) - assert_matches_type(CloudforceOneRequestItem, request, path=["response"]) + assert_matches_type(Item, request, path=["response"]) @pytest.mark.skip() @parametrize @@ -480,7 +480,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" request = await response.parse() - assert_matches_type(CloudforceOneRequestItem, request, path=["response"]) + assert_matches_type(Item, request, path=["response"]) @pytest.mark.skip() @parametrize @@ -492,7 +492,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" request = await response.parse() - assert_matches_type(CloudforceOneRequestItem, request, path=["response"]) + assert_matches_type(Item, request, path=["response"]) assert cast(Any, response.is_closed) is True @@ -511,7 +511,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(CloudforceOneRequestItem, request, path=["response"]) + assert_matches_type(Item, request, path=["response"]) @pytest.mark.skip() @parametrize @@ -525,7 +525,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare summary="DoS attack", tlp="clear", ) - assert_matches_type(CloudforceOneRequestItem, request, path=["response"]) + assert_matches_type(Item, request, path=["response"]) @pytest.mark.skip() @parametrize @@ -538,7 +538,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" request = await response.parse() - assert_matches_type(CloudforceOneRequestItem, request, path=["response"]) + assert_matches_type(Item, request, path=["response"]) @pytest.mark.skip() @parametrize @@ -551,7 +551,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" request = await response.parse() - assert_matches_type(CloudforceOneRequestItem, request, path=["response"]) + assert_matches_type(Item, request, path=["response"]) assert cast(Any, response.is_closed) is True @@ -578,7 +578,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: page=0, per_page=10, ) - assert_matches_type(AsyncV4PagePaginationArray[CloudforceOneRequestListItem], request, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[ListItem], request, path=["response"]) @pytest.mark.skip() @parametrize @@ -596,7 +596,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) sort_order="asc", status="open", ) - assert_matches_type(AsyncV4PagePaginationArray[CloudforceOneRequestListItem], request, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[ListItem], request, path=["response"]) @pytest.mark.skip() @parametrize @@ -610,7 +610,7 @@ 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" request = await response.parse() - assert_matches_type(AsyncV4PagePaginationArray[CloudforceOneRequestListItem], request, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[ListItem], request, path=["response"]) @pytest.mark.skip() @parametrize @@ -624,7 +624,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" request = await response.parse() - assert_matches_type(AsyncV4PagePaginationArray[CloudforceOneRequestListItem], request, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[ListItem], request, path=["response"]) assert cast(Any, response.is_closed) is True @@ -696,7 +696,7 @@ async def test_method_constants(self, async_client: AsyncCloudflare) -> None: request = await async_client.cloudforce_one.requests.constants( "023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(CloudforceOneRequestConstants, request, path=["response"]) + assert_matches_type(RequestConstants, request, path=["response"]) @pytest.mark.skip() @parametrize @@ -708,7 +708,7 @@ async def test_raw_response_constants(self, async_client: AsyncCloudflare) -> No assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" request = await response.parse() - assert_matches_type(CloudforceOneRequestConstants, request, path=["response"]) + assert_matches_type(RequestConstants, request, path=["response"]) @pytest.mark.skip() @parametrize @@ -720,7 +720,7 @@ async def test_streaming_response_constants(self, async_client: AsyncCloudflare) assert response.http_request.headers.get("X-Stainless-Lang") == "python" request = await response.parse() - assert_matches_type(CloudforceOneRequestConstants, request, path=["response"]) + assert_matches_type(RequestConstants, request, path=["response"]) assert cast(Any, response.is_closed) is True @@ -739,7 +739,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(CloudforceOneRequestItem, request, path=["response"]) + assert_matches_type(Item, request, path=["response"]) @pytest.mark.skip() @parametrize @@ -752,7 +752,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" request = await response.parse() - assert_matches_type(CloudforceOneRequestItem, request, path=["response"]) + assert_matches_type(Item, request, path=["response"]) @pytest.mark.skip() @parametrize @@ -765,7 +765,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" request = await response.parse() - assert_matches_type(CloudforceOneRequestItem, request, path=["response"]) + assert_matches_type(Item, request, path=["response"]) assert cast(Any, response.is_closed) is True @@ -790,7 +790,7 @@ async def test_method_quota(self, async_client: AsyncCloudflare) -> None: request = await async_client.cloudforce_one.requests.quota( "023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(CloudforceOneQuota, request, path=["response"]) + assert_matches_type(Quota, request, path=["response"]) @pytest.mark.skip() @parametrize @@ -802,7 +802,7 @@ async def test_raw_response_quota(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" request = await response.parse() - assert_matches_type(CloudforceOneQuota, request, path=["response"]) + assert_matches_type(Quota, request, path=["response"]) @pytest.mark.skip() @parametrize @@ -814,7 +814,7 @@ async def test_streaming_response_quota(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" request = await response.parse() - assert_matches_type(CloudforceOneQuota, request, path=["response"]) + assert_matches_type(Quota, request, path=["response"]) assert cast(Any, response.is_closed) is True @@ -832,7 +832,7 @@ async def test_method_types(self, async_client: AsyncCloudflare) -> None: request = await async_client.cloudforce_one.requests.types( "023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(CloudforceOneRequestTypes, request, path=["response"]) + assert_matches_type(RequestTypes, request, path=["response"]) @pytest.mark.skip() @parametrize @@ -844,7 +844,7 @@ async def test_raw_response_types(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" request = await response.parse() - assert_matches_type(CloudforceOneRequestTypes, request, path=["response"]) + assert_matches_type(RequestTypes, request, path=["response"]) @pytest.mark.skip() @parametrize @@ -856,7 +856,7 @@ async def test_streaming_response_types(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" request = await response.parse() - assert_matches_type(CloudforceOneRequestTypes, request, path=["response"]) + assert_matches_type(RequestTypes, request, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/d1/test_database.py b/tests/api_resources/d1/test_database.py index f0bca2b765f..4d7bc71ae02 100644 --- a/tests/api_resources/d1/test_database.py +++ b/tests/api_resources/d1/test_database.py @@ -9,10 +9,11 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type +from cloudflare.types import D1 from cloudflare.types.d1 import ( - D1CreateDatabase, - D1DatabaseDetails, + DatabaseListResponse, DatabaseQueryResponse, + DatabaseCreateResponse, ) from cloudflare.pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray from cloudflare.types.shared import UnnamedSchemaRef9444735ca60712dbcf8afd832eb5716a @@ -30,7 +31,7 @@ def test_method_create(self, client: Cloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", name="my-database", ) - assert_matches_type(D1CreateDatabase, database, path=["response"]) + assert_matches_type(DatabaseCreateResponse, database, path=["response"]) @pytest.mark.skip() @parametrize @@ -43,7 +44,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" database = response.parse() - assert_matches_type(D1CreateDatabase, database, path=["response"]) + assert_matches_type(DatabaseCreateResponse, database, path=["response"]) @pytest.mark.skip() @parametrize @@ -56,7 +57,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" database = response.parse() - assert_matches_type(D1CreateDatabase, database, path=["response"]) + assert_matches_type(DatabaseCreateResponse, database, path=["response"]) assert cast(Any, response.is_closed) is True @@ -75,7 +76,7 @@ def test_method_list(self, client: Cloudflare) -> None: database = client.d1.database.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncV4PagePaginationArray[D1CreateDatabase], database, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[DatabaseListResponse], database, path=["response"]) @pytest.mark.skip() @parametrize @@ -86,7 +87,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: page=1, per_page=10, ) - assert_matches_type(SyncV4PagePaginationArray[D1CreateDatabase], database, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[DatabaseListResponse], database, path=["response"]) @pytest.mark.skip() @parametrize @@ -98,7 +99,7 @@ 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" database = response.parse() - assert_matches_type(SyncV4PagePaginationArray[D1CreateDatabase], database, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[DatabaseListResponse], database, path=["response"]) @pytest.mark.skip() @parametrize @@ -110,7 +111,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" database = response.parse() - assert_matches_type(SyncV4PagePaginationArray[D1CreateDatabase], database, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[DatabaseListResponse], database, path=["response"]) assert cast(Any, response.is_closed) is True @@ -181,7 +182,7 @@ def test_method_get(self, client: Cloudflare) -> None: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", account_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(D1DatabaseDetails, database, path=["response"]) + assert_matches_type(D1, database, path=["response"]) @pytest.mark.skip() @parametrize @@ -194,7 +195,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" database = response.parse() - assert_matches_type(D1DatabaseDetails, database, path=["response"]) + assert_matches_type(D1, database, path=["response"]) @pytest.mark.skip() @parametrize @@ -207,7 +208,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" database = response.parse() - assert_matches_type(D1DatabaseDetails, database, path=["response"]) + assert_matches_type(D1, database, path=["response"]) assert cast(Any, response.is_closed) is True @@ -305,7 +306,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", name="my-database", ) - assert_matches_type(D1CreateDatabase, database, path=["response"]) + assert_matches_type(DatabaseCreateResponse, database, path=["response"]) @pytest.mark.skip() @parametrize @@ -318,7 +319,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" database = await response.parse() - assert_matches_type(D1CreateDatabase, database, path=["response"]) + assert_matches_type(DatabaseCreateResponse, database, path=["response"]) @pytest.mark.skip() @parametrize @@ -331,7 +332,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" database = await response.parse() - assert_matches_type(D1CreateDatabase, database, path=["response"]) + assert_matches_type(DatabaseCreateResponse, database, path=["response"]) assert cast(Any, response.is_closed) is True @@ -350,7 +351,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: database = await async_client.d1.database.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncV4PagePaginationArray[D1CreateDatabase], database, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[DatabaseListResponse], database, path=["response"]) @pytest.mark.skip() @parametrize @@ -361,7 +362,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) page=1, per_page=10, ) - assert_matches_type(AsyncV4PagePaginationArray[D1CreateDatabase], database, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[DatabaseListResponse], database, path=["response"]) @pytest.mark.skip() @parametrize @@ -373,7 +374,7 @@ 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" database = await response.parse() - assert_matches_type(AsyncV4PagePaginationArray[D1CreateDatabase], database, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[DatabaseListResponse], database, path=["response"]) @pytest.mark.skip() @parametrize @@ -385,7 +386,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" database = await response.parse() - assert_matches_type(AsyncV4PagePaginationArray[D1CreateDatabase], database, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[DatabaseListResponse], database, path=["response"]) assert cast(Any, response.is_closed) is True @@ -456,7 +457,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", account_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(D1DatabaseDetails, database, path=["response"]) + assert_matches_type(D1, database, path=["response"]) @pytest.mark.skip() @parametrize @@ -469,7 +470,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" database = await response.parse() - assert_matches_type(D1DatabaseDetails, database, path=["response"]) + assert_matches_type(D1, database, path=["response"]) @pytest.mark.skip() @parametrize @@ -482,7 +483,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" database = await response.parse() - assert_matches_type(D1DatabaseDetails, database, path=["response"]) + assert_matches_type(D1, database, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/dns/analytics/reports/test_bytimes.py b/tests/api_resources/dns/analytics/reports/test_bytimes.py index ddd7f707f9d..b8511b80776 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 DNSAnalyticsReportByTime +from cloudflare.types.dns.analytics.reports import ByTime base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -24,7 +24,7 @@ def test_method_get(self, client: Cloudflare) -> None: bytime = client.dns.analytics.reports.bytimes.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(DNSAnalyticsReportByTime, bytime, path=["response"]) + assert_matches_type(ByTime, bytime, path=["response"]) @pytest.mark.skip() @parametrize @@ -40,7 +40,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None: time_delta="hour", until=parse_datetime("2023-11-11T13:00:00Z"), ) - assert_matches_type(DNSAnalyticsReportByTime, bytime, path=["response"]) + assert_matches_type(ByTime, bytime, path=["response"]) @pytest.mark.skip() @parametrize @@ -52,7 +52,7 @@ def test_raw_response_get(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(DNSAnalyticsReportByTime, bytime, path=["response"]) + assert_matches_type(ByTime, bytime, path=["response"]) @pytest.mark.skip() @parametrize @@ -64,7 +64,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" bytime = response.parse() - assert_matches_type(DNSAnalyticsReportByTime, bytime, path=["response"]) + assert_matches_type(ByTime, bytime, path=["response"]) assert cast(Any, response.is_closed) is True @@ -86,7 +86,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: bytime = await async_client.dns.analytics.reports.bytimes.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(DNSAnalyticsReportByTime, bytime, path=["response"]) + assert_matches_type(ByTime, bytime, path=["response"]) @pytest.mark.skip() @parametrize @@ -102,7 +102,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) - time_delta="hour", until=parse_datetime("2023-11-11T13:00:00Z"), ) - assert_matches_type(DNSAnalyticsReportByTime, bytime, path=["response"]) + assert_matches_type(ByTime, bytime, path=["response"]) @pytest.mark.skip() @parametrize @@ -114,7 +114,7 @@ async def test_raw_response_get(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(DNSAnalyticsReportByTime, bytime, path=["response"]) + assert_matches_type(ByTime, bytime, path=["response"]) @pytest.mark.skip() @parametrize @@ -126,7 +126,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" bytime = await response.parse() - assert_matches_type(DNSAnalyticsReportByTime, bytime, path=["response"]) + assert_matches_type(ByTime, bytime, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/dns/analytics/test_reports.py b/tests/api_resources/dns/analytics/test_reports.py index 2667a082de7..de2a91d12a3 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 DNSAnalyticsReport +from cloudflare.types.dns.analytics import Report base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -24,7 +24,7 @@ def test_method_get(self, client: Cloudflare) -> None: report = client.dns.analytics.reports.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(DNSAnalyticsReport, report, path=["response"]) + assert_matches_type(Report, report, path=["response"]) @pytest.mark.skip() @parametrize @@ -39,7 +39,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None: sort="+responseCode,-queryName", until=parse_datetime("2023-11-11T13:00:00Z"), ) - assert_matches_type(DNSAnalyticsReport, report, path=["response"]) + assert_matches_type(Report, report, path=["response"]) @pytest.mark.skip() @parametrize @@ -51,7 +51,7 @@ def test_raw_response_get(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(DNSAnalyticsReport, report, path=["response"]) + assert_matches_type(Report, report, path=["response"]) @pytest.mark.skip() @parametrize @@ -63,7 +63,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" report = response.parse() - assert_matches_type(DNSAnalyticsReport, report, path=["response"]) + assert_matches_type(Report, report, path=["response"]) assert cast(Any, response.is_closed) is True @@ -85,7 +85,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: report = await async_client.dns.analytics.reports.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(DNSAnalyticsReport, report, path=["response"]) + assert_matches_type(Report, report, path=["response"]) @pytest.mark.skip() @parametrize @@ -100,7 +100,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) - sort="+responseCode,-queryName", until=parse_datetime("2023-11-11T13:00:00Z"), ) - assert_matches_type(DNSAnalyticsReport, report, path=["response"]) + assert_matches_type(Report, report, path=["response"]) @pytest.mark.skip() @parametrize @@ -112,7 +112,7 @@ async def test_raw_response_get(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(DNSAnalyticsReport, report, path=["response"]) + assert_matches_type(Report, report, path=["response"]) @pytest.mark.skip() @parametrize @@ -124,7 +124,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" report = await response.parse() - assert_matches_type(DNSAnalyticsReport, report, path=["response"]) + assert_matches_type(Report, report, path=["response"]) assert cast(Any, response.is_closed) is True 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 a2d0f8a7b6d..d12af1f3dfb 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.analytics.reports import DNSAnalyticsReportByTime +from cloudflare.types.dns.analytics.reports import ByTime base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -25,7 +25,7 @@ def test_method_get(self, client: Cloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(DNSAnalyticsReportByTime, bytime, path=["response"]) + assert_matches_type(ByTime, bytime, path=["response"]) @pytest.mark.skip() @parametrize @@ -42,7 +42,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None: time_delta="hour", until=parse_datetime("2023-11-11T13:00:00Z"), ) - assert_matches_type(DNSAnalyticsReportByTime, bytime, path=["response"]) + assert_matches_type(ByTime, bytime, path=["response"]) @pytest.mark.skip() @parametrize @@ -55,7 +55,7 @@ def test_raw_response_get(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(DNSAnalyticsReportByTime, bytime, path=["response"]) + assert_matches_type(ByTime, bytime, path=["response"]) @pytest.mark.skip() @parametrize @@ -68,7 +68,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" bytime = response.parse() - assert_matches_type(DNSAnalyticsReportByTime, bytime, path=["response"]) + assert_matches_type(ByTime, bytime, path=["response"]) assert cast(Any, response.is_closed) is True @@ -98,7 +98,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(DNSAnalyticsReportByTime, bytime, path=["response"]) + assert_matches_type(ByTime, bytime, path=["response"]) @pytest.mark.skip() @parametrize @@ -115,7 +115,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) - time_delta="hour", until=parse_datetime("2023-11-11T13:00:00Z"), ) - assert_matches_type(DNSAnalyticsReportByTime, bytime, path=["response"]) + assert_matches_type(ByTime, bytime, path=["response"]) @pytest.mark.skip() @parametrize @@ -128,7 +128,7 @@ async def test_raw_response_get(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(DNSAnalyticsReportByTime, bytime, path=["response"]) + assert_matches_type(ByTime, bytime, path=["response"]) @pytest.mark.skip() @parametrize @@ -141,7 +141,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" bytime = await response.parse() - assert_matches_type(DNSAnalyticsReportByTime, bytime, path=["response"]) + assert_matches_type(ByTime, bytime, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/dns/firewall/analytics/test_reports.py b/tests/api_resources/dns/firewall/analytics/test_reports.py index e36cb3033ac..295c315f8b0 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.analytics import DNSAnalyticsReport +from cloudflare.types.dns.analytics import Report base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -25,7 +25,7 @@ def test_method_get(self, client: Cloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(DNSAnalyticsReport, report, path=["response"]) + assert_matches_type(Report, report, path=["response"]) @pytest.mark.skip() @parametrize @@ -41,7 +41,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None: sort="+responseCode,-queryName", until=parse_datetime("2023-11-11T13:00:00Z"), ) - assert_matches_type(DNSAnalyticsReport, report, path=["response"]) + assert_matches_type(Report, report, path=["response"]) @pytest.mark.skip() @parametrize @@ -54,7 +54,7 @@ def test_raw_response_get(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(DNSAnalyticsReport, report, path=["response"]) + assert_matches_type(Report, report, path=["response"]) @pytest.mark.skip() @parametrize @@ -67,7 +67,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" report = response.parse() - assert_matches_type(DNSAnalyticsReport, report, path=["response"]) + assert_matches_type(Report, report, path=["response"]) assert cast(Any, response.is_closed) is True @@ -97,7 +97,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(DNSAnalyticsReport, report, path=["response"]) + assert_matches_type(Report, report, path=["response"]) @pytest.mark.skip() @parametrize @@ -113,7 +113,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) - sort="+responseCode,-queryName", until=parse_datetime("2023-11-11T13:00:00Z"), ) - assert_matches_type(DNSAnalyticsReport, report, path=["response"]) + assert_matches_type(Report, report, path=["response"]) @pytest.mark.skip() @parametrize @@ -126,7 +126,7 @@ async def test_raw_response_get(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(DNSAnalyticsReport, report, path=["response"]) + assert_matches_type(Report, report, path=["response"]) @pytest.mark.skip() @parametrize @@ -139,7 +139,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" report = await response.parse() - assert_matches_type(DNSAnalyticsReport, report, path=["response"]) + assert_matches_type(Report, report, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/dns/test_firewall.py b/tests/api_resources/dns/test_firewall.py index 4998c25f9b6..e8f10dc1fae 100644 --- a/tests/api_resources/dns/test_firewall.py +++ b/tests/api_resources/dns/test_firewall.py @@ -10,7 +10,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.types.dns import ( - DNSFirewall, + Firewall, FirewallDeleteResponse, ) from cloudflare.pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray @@ -29,7 +29,7 @@ def test_method_create(self, client: Cloudflare) -> None: name="My Awesome DNS Firewall cluster", upstream_ips=["192.0.2.1", "198.51.100.1", "2001:DB8:100::CF"], ) - assert_matches_type(DNSFirewall, firewall, path=["response"]) + assert_matches_type(Firewall, firewall, path=["response"]) @pytest.mark.skip() @parametrize @@ -50,7 +50,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: ratelimit=600, retries=2, ) - assert_matches_type(DNSFirewall, firewall, path=["response"]) + assert_matches_type(Firewall, firewall, path=["response"]) @pytest.mark.skip() @parametrize @@ -64,7 +64,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" firewall = response.parse() - assert_matches_type(DNSFirewall, firewall, path=["response"]) + assert_matches_type(Firewall, firewall, path=["response"]) @pytest.mark.skip() @parametrize @@ -78,7 +78,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" firewall = response.parse() - assert_matches_type(DNSFirewall, firewall, path=["response"]) + assert_matches_type(Firewall, firewall, path=["response"]) assert cast(Any, response.is_closed) is True @@ -98,7 +98,7 @@ def test_method_list(self, client: Cloudflare) -> None: firewall = client.dns.firewall.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncV4PagePaginationArray[DNSFirewall], firewall, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[Firewall], firewall, path=["response"]) @pytest.mark.skip() @parametrize @@ -108,7 +108,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: page=1, per_page=1, ) - assert_matches_type(SyncV4PagePaginationArray[DNSFirewall], firewall, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[Firewall], firewall, path=["response"]) @pytest.mark.skip() @parametrize @@ -120,7 +120,7 @@ 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" firewall = response.parse() - assert_matches_type(SyncV4PagePaginationArray[DNSFirewall], firewall, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[Firewall], firewall, path=["response"]) @pytest.mark.skip() @parametrize @@ -132,7 +132,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" firewall = response.parse() - assert_matches_type(SyncV4PagePaginationArray[DNSFirewall], firewall, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[Firewall], firewall, path=["response"]) assert cast(Any, response.is_closed) is True @@ -215,7 +215,7 @@ def test_method_edit(self, client: Cloudflare) -> None: name="My Awesome DNS Firewall cluster", upstream_ips=["192.0.2.1", "198.51.100.1", "2001:DB8:100::CF"], ) - assert_matches_type(DNSFirewall, firewall, path=["response"]) + assert_matches_type(Firewall, firewall, path=["response"]) @pytest.mark.skip() @parametrize @@ -238,7 +238,7 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: ratelimit=600, retries=2, ) - assert_matches_type(DNSFirewall, firewall, path=["response"]) + assert_matches_type(Firewall, firewall, path=["response"]) @pytest.mark.skip() @parametrize @@ -258,7 +258,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" firewall = response.parse() - assert_matches_type(DNSFirewall, firewall, path=["response"]) + assert_matches_type(Firewall, firewall, path=["response"]) @pytest.mark.skip() @parametrize @@ -278,7 +278,7 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" firewall = response.parse() - assert_matches_type(DNSFirewall, firewall, path=["response"]) + assert_matches_type(Firewall, firewall, path=["response"]) assert cast(Any, response.is_closed) is True @@ -318,7 +318,7 @@ def test_method_get(self, client: Cloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(DNSFirewall, firewall, path=["response"]) + assert_matches_type(Firewall, firewall, path=["response"]) @pytest.mark.skip() @parametrize @@ -331,7 +331,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" firewall = response.parse() - assert_matches_type(DNSFirewall, firewall, path=["response"]) + assert_matches_type(Firewall, firewall, path=["response"]) @pytest.mark.skip() @parametrize @@ -344,7 +344,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" firewall = response.parse() - assert_matches_type(DNSFirewall, firewall, path=["response"]) + assert_matches_type(Firewall, firewall, path=["response"]) assert cast(Any, response.is_closed) is True @@ -375,7 +375,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: name="My Awesome DNS Firewall cluster", upstream_ips=["192.0.2.1", "198.51.100.1", "2001:DB8:100::CF"], ) - assert_matches_type(DNSFirewall, firewall, path=["response"]) + assert_matches_type(Firewall, firewall, path=["response"]) @pytest.mark.skip() @parametrize @@ -396,7 +396,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare ratelimit=600, retries=2, ) - assert_matches_type(DNSFirewall, firewall, path=["response"]) + assert_matches_type(Firewall, firewall, path=["response"]) @pytest.mark.skip() @parametrize @@ -410,7 +410,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" firewall = await response.parse() - assert_matches_type(DNSFirewall, firewall, path=["response"]) + assert_matches_type(Firewall, firewall, path=["response"]) @pytest.mark.skip() @parametrize @@ -424,7 +424,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" firewall = await response.parse() - assert_matches_type(DNSFirewall, firewall, path=["response"]) + assert_matches_type(Firewall, firewall, path=["response"]) assert cast(Any, response.is_closed) is True @@ -444,7 +444,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: firewall = await async_client.dns.firewall.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncV4PagePaginationArray[DNSFirewall], firewall, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[Firewall], firewall, path=["response"]) @pytest.mark.skip() @parametrize @@ -454,7 +454,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) page=1, per_page=1, ) - assert_matches_type(AsyncV4PagePaginationArray[DNSFirewall], firewall, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[Firewall], firewall, path=["response"]) @pytest.mark.skip() @parametrize @@ -466,7 +466,7 @@ 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" firewall = await response.parse() - assert_matches_type(AsyncV4PagePaginationArray[DNSFirewall], firewall, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[Firewall], firewall, path=["response"]) @pytest.mark.skip() @parametrize @@ -478,7 +478,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" firewall = await response.parse() - assert_matches_type(AsyncV4PagePaginationArray[DNSFirewall], firewall, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[Firewall], firewall, path=["response"]) assert cast(Any, response.is_closed) is True @@ -561,7 +561,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: name="My Awesome DNS Firewall cluster", upstream_ips=["192.0.2.1", "198.51.100.1", "2001:DB8:100::CF"], ) - assert_matches_type(DNSFirewall, firewall, path=["response"]) + assert_matches_type(Firewall, firewall, path=["response"]) @pytest.mark.skip() @parametrize @@ -584,7 +584,7 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) ratelimit=600, retries=2, ) - assert_matches_type(DNSFirewall, firewall, path=["response"]) + assert_matches_type(Firewall, firewall, path=["response"]) @pytest.mark.skip() @parametrize @@ -604,7 +604,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" firewall = await response.parse() - assert_matches_type(DNSFirewall, firewall, path=["response"]) + assert_matches_type(Firewall, firewall, path=["response"]) @pytest.mark.skip() @parametrize @@ -624,7 +624,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" firewall = await response.parse() - assert_matches_type(DNSFirewall, firewall, path=["response"]) + assert_matches_type(Firewall, firewall, path=["response"]) assert cast(Any, response.is_closed) is True @@ -664,7 +664,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(DNSFirewall, firewall, path=["response"]) + assert_matches_type(Firewall, firewall, path=["response"]) @pytest.mark.skip() @parametrize @@ -677,7 +677,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" firewall = await response.parse() - assert_matches_type(DNSFirewall, firewall, path=["response"]) + assert_matches_type(Firewall, firewall, path=["response"]) @pytest.mark.skip() @parametrize @@ -690,7 +690,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" firewall = await response.parse() - assert_matches_type(DNSFirewall, firewall, path=["response"]) + assert_matches_type(Firewall, firewall, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/durable_objects/test_namespaces.py b/tests/api_resources/durable_objects/test_namespaces.py index 75327428664..ca9f1d784cc 100644 --- a/tests/api_resources/durable_objects/test_namespaces.py +++ b/tests/api_resources/durable_objects/test_namespaces.py @@ -10,7 +10,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.pagination import SyncSinglePage, AsyncSinglePage -from cloudflare.types.durable_objects import DurableObjectNamespace +from cloudflare.types.durable_objects import Namespace base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -24,7 +24,7 @@ def test_method_list(self, client: Cloudflare) -> None: namespace = client.durable_objects.namespaces.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncSinglePage[DurableObjectNamespace], namespace, path=["response"]) + assert_matches_type(SyncSinglePage[Namespace], namespace, path=["response"]) @pytest.mark.skip() @parametrize @@ -36,7 +36,7 @@ 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" namespace = response.parse() - assert_matches_type(SyncSinglePage[DurableObjectNamespace], namespace, path=["response"]) + assert_matches_type(SyncSinglePage[Namespace], namespace, path=["response"]) @pytest.mark.skip() @parametrize @@ -48,7 +48,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" namespace = response.parse() - assert_matches_type(SyncSinglePage[DurableObjectNamespace], namespace, path=["response"]) + assert_matches_type(SyncSinglePage[Namespace], namespace, path=["response"]) assert cast(Any, response.is_closed) is True @@ -70,7 +70,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: namespace = await async_client.durable_objects.namespaces.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncSinglePage[DurableObjectNamespace], namespace, path=["response"]) + assert_matches_type(AsyncSinglePage[Namespace], namespace, path=["response"]) @pytest.mark.skip() @parametrize @@ -82,7 +82,7 @@ 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" namespace = await response.parse() - assert_matches_type(AsyncSinglePage[DurableObjectNamespace], namespace, path=["response"]) + assert_matches_type(AsyncSinglePage[Namespace], namespace, path=["response"]) @pytest.mark.skip() @parametrize @@ -94,7 +94,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" namespace = await response.parse() - assert_matches_type(AsyncSinglePage[DurableObjectNamespace], namespace, path=["response"]) + assert_matches_type(AsyncSinglePage[Namespace], namespace, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/email_routing/rules/test_catch_alls.py b/tests/api_resources/email_routing/rules/test_catch_alls.py index 43476d56695..e0901a6d600 100644 --- a/tests/api_resources/email_routing/rules/test_catch_alls.py +++ b/tests/api_resources/email_routing/rules/test_catch_alls.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.email_routing.rules import EmailCatchAllRule +from cloudflare.types.email_routing.rules import CatchAllGetResponse, CatchAllUpdateResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -25,7 +25,7 @@ def test_method_update(self, client: Cloudflare) -> None: actions=[{"type": "forward"}, {"type": "forward"}, {"type": "forward"}], matchers=[{"type": "all"}, {"type": "all"}, {"type": "all"}], ) - assert_matches_type(EmailCatchAllRule, catch_all, path=["response"]) + assert_matches_type(CatchAllUpdateResponse, catch_all, path=["response"]) @pytest.mark.skip() @parametrize @@ -62,7 +62,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: enabled=True, name="Send to user@example.net rule.", ) - assert_matches_type(EmailCatchAllRule, catch_all, path=["response"]) + assert_matches_type(CatchAllUpdateResponse, catch_all, path=["response"]) @pytest.mark.skip() @parametrize @@ -76,7 +76,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" catch_all = response.parse() - assert_matches_type(EmailCatchAllRule, catch_all, path=["response"]) + assert_matches_type(CatchAllUpdateResponse, catch_all, path=["response"]) @pytest.mark.skip() @parametrize @@ -90,7 +90,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" catch_all = response.parse() - assert_matches_type(EmailCatchAllRule, catch_all, path=["response"]) + assert_matches_type(CatchAllUpdateResponse, catch_all, path=["response"]) assert cast(Any, response.is_closed) is True @@ -110,7 +110,7 @@ def test_method_get(self, client: Cloudflare) -> None: catch_all = client.email_routing.rules.catch_alls.get( "023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(EmailCatchAllRule, catch_all, path=["response"]) + assert_matches_type(CatchAllGetResponse, catch_all, path=["response"]) @pytest.mark.skip() @parametrize @@ -122,7 +122,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" catch_all = response.parse() - assert_matches_type(EmailCatchAllRule, catch_all, path=["response"]) + assert_matches_type(CatchAllGetResponse, catch_all, path=["response"]) @pytest.mark.skip() @parametrize @@ -134,7 +134,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" catch_all = response.parse() - assert_matches_type(EmailCatchAllRule, catch_all, path=["response"]) + assert_matches_type(CatchAllGetResponse, catch_all, path=["response"]) assert cast(Any, response.is_closed) is True @@ -158,7 +158,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: actions=[{"type": "forward"}, {"type": "forward"}, {"type": "forward"}], matchers=[{"type": "all"}, {"type": "all"}, {"type": "all"}], ) - assert_matches_type(EmailCatchAllRule, catch_all, path=["response"]) + assert_matches_type(CatchAllUpdateResponse, catch_all, path=["response"]) @pytest.mark.skip() @parametrize @@ -195,7 +195,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare enabled=True, name="Send to user@example.net rule.", ) - assert_matches_type(EmailCatchAllRule, catch_all, path=["response"]) + assert_matches_type(CatchAllUpdateResponse, catch_all, path=["response"]) @pytest.mark.skip() @parametrize @@ -209,7 +209,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" catch_all = await response.parse() - assert_matches_type(EmailCatchAllRule, catch_all, path=["response"]) + assert_matches_type(CatchAllUpdateResponse, catch_all, path=["response"]) @pytest.mark.skip() @parametrize @@ -223,7 +223,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" catch_all = await response.parse() - assert_matches_type(EmailCatchAllRule, catch_all, path=["response"]) + assert_matches_type(CatchAllUpdateResponse, catch_all, path=["response"]) assert cast(Any, response.is_closed) is True @@ -243,7 +243,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: catch_all = await async_client.email_routing.rules.catch_alls.get( "023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(EmailCatchAllRule, catch_all, path=["response"]) + assert_matches_type(CatchAllGetResponse, catch_all, path=["response"]) @pytest.mark.skip() @parametrize @@ -255,7 +255,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" catch_all = await response.parse() - assert_matches_type(EmailCatchAllRule, catch_all, path=["response"]) + assert_matches_type(CatchAllGetResponse, catch_all, path=["response"]) @pytest.mark.skip() @parametrize @@ -267,7 +267,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" catch_all = await response.parse() - assert_matches_type(EmailCatchAllRule, catch_all, path=["response"]) + assert_matches_type(CatchAllGetResponse, catch_all, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/email_routing/test_addresses.py b/tests/api_resources/email_routing/test_addresses.py index 4a88f556567..76bbe3c7794 100644 --- a/tests/api_resources/email_routing/test_addresses.py +++ b/tests/api_resources/email_routing/test_addresses.py @@ -10,7 +10,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray -from cloudflare.types.email_routing import DestinationAddress +from cloudflare.types.email_routing import Address base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -25,7 +25,7 @@ def test_method_create(self, client: Cloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", email="user@example.com", ) - assert_matches_type(DestinationAddress, address, path=["response"]) + assert_matches_type(Address, address, path=["response"]) @pytest.mark.skip() @parametrize @@ -38,7 +38,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" address = response.parse() - assert_matches_type(DestinationAddress, address, path=["response"]) + assert_matches_type(Address, address, path=["response"]) @pytest.mark.skip() @parametrize @@ -51,7 +51,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" address = response.parse() - assert_matches_type(DestinationAddress, address, path=["response"]) + assert_matches_type(Address, address, path=["response"]) assert cast(Any, response.is_closed) is True @@ -70,7 +70,7 @@ def test_method_list(self, client: Cloudflare) -> None: address = client.email_routing.addresses.list( "023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncV4PagePaginationArray[DestinationAddress], address, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[Address], address, path=["response"]) @pytest.mark.skip() @parametrize @@ -82,7 +82,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: per_page=5, verified=True, ) - assert_matches_type(SyncV4PagePaginationArray[DestinationAddress], address, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[Address], address, path=["response"]) @pytest.mark.skip() @parametrize @@ -94,7 +94,7 @@ 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" address = response.parse() - assert_matches_type(SyncV4PagePaginationArray[DestinationAddress], address, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[Address], address, path=["response"]) @pytest.mark.skip() @parametrize @@ -106,7 +106,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" address = response.parse() - assert_matches_type(SyncV4PagePaginationArray[DestinationAddress], address, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[Address], address, path=["response"]) assert cast(Any, response.is_closed) is True @@ -125,7 +125,7 @@ def test_method_delete(self, client: Cloudflare) -> None: "ea95132c15732412d22c1476fa83f27a", account_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(DestinationAddress, address, path=["response"]) + assert_matches_type(Address, address, path=["response"]) @pytest.mark.skip() @parametrize @@ -138,7 +138,7 @@ 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" address = response.parse() - assert_matches_type(DestinationAddress, address, path=["response"]) + assert_matches_type(Address, address, path=["response"]) @pytest.mark.skip() @parametrize @@ -151,7 +151,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" address = response.parse() - assert_matches_type(DestinationAddress, address, path=["response"]) + assert_matches_type(Address, address, path=["response"]) assert cast(Any, response.is_closed) is True @@ -179,7 +179,7 @@ def test_method_get(self, client: Cloudflare) -> None: "ea95132c15732412d22c1476fa83f27a", account_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(DestinationAddress, address, path=["response"]) + assert_matches_type(Address, address, path=["response"]) @pytest.mark.skip() @parametrize @@ -192,7 +192,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" address = response.parse() - assert_matches_type(DestinationAddress, address, path=["response"]) + assert_matches_type(Address, address, path=["response"]) @pytest.mark.skip() @parametrize @@ -205,7 +205,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" address = response.parse() - assert_matches_type(DestinationAddress, address, path=["response"]) + assert_matches_type(Address, address, path=["response"]) assert cast(Any, response.is_closed) is True @@ -237,7 +237,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", email="user@example.com", ) - assert_matches_type(DestinationAddress, address, path=["response"]) + assert_matches_type(Address, address, path=["response"]) @pytest.mark.skip() @parametrize @@ -250,7 +250,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" address = await response.parse() - assert_matches_type(DestinationAddress, address, path=["response"]) + assert_matches_type(Address, address, path=["response"]) @pytest.mark.skip() @parametrize @@ -263,7 +263,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" address = await response.parse() - assert_matches_type(DestinationAddress, address, path=["response"]) + assert_matches_type(Address, address, path=["response"]) assert cast(Any, response.is_closed) is True @@ -282,7 +282,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: address = await async_client.email_routing.addresses.list( "023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncV4PagePaginationArray[DestinationAddress], address, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[Address], address, path=["response"]) @pytest.mark.skip() @parametrize @@ -294,7 +294,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) per_page=5, verified=True, ) - assert_matches_type(AsyncV4PagePaginationArray[DestinationAddress], address, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[Address], address, path=["response"]) @pytest.mark.skip() @parametrize @@ -306,7 +306,7 @@ 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" address = await response.parse() - assert_matches_type(AsyncV4PagePaginationArray[DestinationAddress], address, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[Address], address, path=["response"]) @pytest.mark.skip() @parametrize @@ -318,7 +318,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" address = await response.parse() - assert_matches_type(AsyncV4PagePaginationArray[DestinationAddress], address, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[Address], address, path=["response"]) assert cast(Any, response.is_closed) is True @@ -337,7 +337,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: "ea95132c15732412d22c1476fa83f27a", account_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(DestinationAddress, address, path=["response"]) + assert_matches_type(Address, address, path=["response"]) @pytest.mark.skip() @parametrize @@ -350,7 +350,7 @@ 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" address = await response.parse() - assert_matches_type(DestinationAddress, address, path=["response"]) + assert_matches_type(Address, address, path=["response"]) @pytest.mark.skip() @parametrize @@ -363,7 +363,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" address = await response.parse() - assert_matches_type(DestinationAddress, address, path=["response"]) + assert_matches_type(Address, address, path=["response"]) assert cast(Any, response.is_closed) is True @@ -391,7 +391,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: "ea95132c15732412d22c1476fa83f27a", account_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(DestinationAddress, address, path=["response"]) + assert_matches_type(Address, address, path=["response"]) @pytest.mark.skip() @parametrize @@ -404,7 +404,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" address = await response.parse() - assert_matches_type(DestinationAddress, address, path=["response"]) + assert_matches_type(Address, address, path=["response"]) @pytest.mark.skip() @parametrize @@ -417,7 +417,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" address = await response.parse() - assert_matches_type(DestinationAddress, address, path=["response"]) + assert_matches_type(Address, address, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/email_routing/test_rules.py b/tests/api_resources/email_routing/test_rules.py index baed29ac5b9..c18ee28f032 100644 --- a/tests/api_resources/email_routing/test_rules.py +++ b/tests/api_resources/email_routing/test_rules.py @@ -10,7 +10,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray -from cloudflare.types.email_routing import Properties +from cloudflare.types.email_routing import EmailRule base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -67,7 +67,7 @@ def test_method_create(self, client: Cloudflare) -> None: }, ], ) - assert_matches_type(Properties, rule, path=["response"]) + assert_matches_type(EmailRule, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -121,7 +121,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: name="Send to user@example.net rule.", priority=0, ) - assert_matches_type(Properties, rule, path=["response"]) + assert_matches_type(EmailRule, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -176,7 +176,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(Properties, rule, path=["response"]) + assert_matches_type(EmailRule, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -231,7 +231,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(Properties, rule, path=["response"]) + assert_matches_type(EmailRule, rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -336,7 +336,7 @@ def test_method_update(self, client: Cloudflare) -> None: }, ], ) - assert_matches_type(Properties, rule, path=["response"]) + assert_matches_type(EmailRule, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -391,7 +391,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: name="Send to user@example.net rule.", priority=0, ) - assert_matches_type(Properties, rule, path=["response"]) + assert_matches_type(EmailRule, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -447,7 +447,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(Properties, rule, path=["response"]) + assert_matches_type(EmailRule, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -503,7 +503,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(Properties, rule, path=["response"]) + assert_matches_type(EmailRule, rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -614,7 +614,7 @@ def test_method_list(self, client: Cloudflare) -> None: rule = client.email_routing.rules.list( "023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncV4PagePaginationArray[Properties], rule, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[EmailRule], rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -625,7 +625,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: page=1, per_page=5, ) - assert_matches_type(SyncV4PagePaginationArray[Properties], rule, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[EmailRule], rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -637,7 +637,7 @@ 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" rule = response.parse() - assert_matches_type(SyncV4PagePaginationArray[Properties], rule, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[EmailRule], rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -649,7 +649,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(SyncV4PagePaginationArray[Properties], rule, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[EmailRule], rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -668,7 +668,7 @@ def test_method_delete(self, client: Cloudflare) -> None: "a7e6fb77503c41d8a7f3113c6918f10c", zone_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Properties, rule, path=["response"]) + assert_matches_type(EmailRule, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -681,7 +681,7 @@ 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" rule = response.parse() - assert_matches_type(Properties, rule, path=["response"]) + assert_matches_type(EmailRule, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -694,7 +694,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(Properties, rule, path=["response"]) + assert_matches_type(EmailRule, rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -720,7 +720,7 @@ def test_method_get(self, client: Cloudflare) -> None: "a7e6fb77503c41d8a7f3113c6918f10c", zone_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Properties, rule, path=["response"]) + assert_matches_type(EmailRule, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -733,7 +733,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(Properties, rule, path=["response"]) + assert_matches_type(EmailRule, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -746,7 +746,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(Properties, rule, path=["response"]) + assert_matches_type(EmailRule, rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -818,7 +818,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: }, ], ) - assert_matches_type(Properties, rule, path=["response"]) + assert_matches_type(EmailRule, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -872,7 +872,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare name="Send to user@example.net rule.", priority=0, ) - assert_matches_type(Properties, rule, path=["response"]) + assert_matches_type(EmailRule, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -927,7 +927,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(Properties, rule, path=["response"]) + assert_matches_type(EmailRule, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -982,7 +982,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(Properties, rule, path=["response"]) + assert_matches_type(EmailRule, rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1087,7 +1087,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: }, ], ) - assert_matches_type(Properties, rule, path=["response"]) + assert_matches_type(EmailRule, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -1142,7 +1142,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare name="Send to user@example.net rule.", priority=0, ) - assert_matches_type(Properties, rule, path=["response"]) + assert_matches_type(EmailRule, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -1198,7 +1198,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(Properties, rule, path=["response"]) + assert_matches_type(EmailRule, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -1254,7 +1254,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(Properties, rule, path=["response"]) + assert_matches_type(EmailRule, rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1365,7 +1365,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: rule = await async_client.email_routing.rules.list( "023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncV4PagePaginationArray[Properties], rule, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[EmailRule], rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -1376,7 +1376,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) page=1, per_page=5, ) - assert_matches_type(AsyncV4PagePaginationArray[Properties], rule, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[EmailRule], rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -1388,7 +1388,7 @@ 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" rule = await response.parse() - assert_matches_type(AsyncV4PagePaginationArray[Properties], rule, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[EmailRule], rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -1400,7 +1400,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(AsyncV4PagePaginationArray[Properties], rule, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[EmailRule], rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1419,7 +1419,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: "a7e6fb77503c41d8a7f3113c6918f10c", zone_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Properties, rule, path=["response"]) + assert_matches_type(EmailRule, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -1432,7 +1432,7 @@ 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" rule = await response.parse() - assert_matches_type(Properties, rule, path=["response"]) + assert_matches_type(EmailRule, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -1445,7 +1445,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(Properties, rule, path=["response"]) + assert_matches_type(EmailRule, rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1471,7 +1471,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: "a7e6fb77503c41d8a7f3113c6918f10c", zone_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Properties, rule, path=["response"]) + assert_matches_type(EmailRule, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -1484,7 +1484,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(Properties, rule, path=["response"]) + assert_matches_type(EmailRule, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -1497,7 +1497,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(Properties, rule, path=["response"]) + assert_matches_type(EmailRule, rule, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/firewall/test_lockdowns.py b/tests/api_resources/firewall/test_lockdowns.py index f83e6451362..2295de8f29f 100644 --- a/tests/api_resources/firewall/test_lockdowns.py +++ b/tests/api_resources/firewall/test_lockdowns.py @@ -12,7 +12,7 @@ from cloudflare._utils import parse_datetime from cloudflare.pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray from cloudflare.types.firewall import ( - FirewallZoneLockdown, + Lockdown, LockdownDeleteResponse, ) @@ -29,7 +29,7 @@ def test_method_create(self, client: Cloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", body={}, ) - assert_matches_type(Optional[FirewallZoneLockdown], lockdown, path=["response"]) + assert_matches_type(Lockdown, lockdown, path=["response"]) @pytest.mark.skip() @parametrize @@ -42,7 +42,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" lockdown = response.parse() - assert_matches_type(Optional[FirewallZoneLockdown], lockdown, path=["response"]) + assert_matches_type(Lockdown, lockdown, path=["response"]) @pytest.mark.skip() @parametrize @@ -55,7 +55,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" lockdown = response.parse() - assert_matches_type(Optional[FirewallZoneLockdown], lockdown, path=["response"]) + assert_matches_type(Lockdown, lockdown, path=["response"]) assert cast(Any, response.is_closed) is True @@ -76,7 +76,7 @@ def test_method_update(self, client: Cloudflare) -> None: zone_identifier="023e105f4ecef8ad9ca31a8372d0c353", body={}, ) - assert_matches_type(Optional[FirewallZoneLockdown], lockdown, path=["response"]) + assert_matches_type(Lockdown, lockdown, path=["response"]) @pytest.mark.skip() @parametrize @@ -90,7 +90,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" lockdown = response.parse() - assert_matches_type(Optional[FirewallZoneLockdown], lockdown, path=["response"]) + assert_matches_type(Lockdown, lockdown, path=["response"]) @pytest.mark.skip() @parametrize @@ -104,7 +104,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" lockdown = response.parse() - assert_matches_type(Optional[FirewallZoneLockdown], lockdown, path=["response"]) + assert_matches_type(Lockdown, lockdown, path=["response"]) assert cast(Any, response.is_closed) is True @@ -131,7 +131,7 @@ def test_method_list(self, client: Cloudflare) -> None: lockdown = client.firewall.lockdowns.list( "023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncV4PagePaginationArray[FirewallZoneLockdown], lockdown, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[Lockdown], lockdown, path=["response"]) @pytest.mark.skip() @parametrize @@ -150,7 +150,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: priority=5, uri_search="/some/path", ) - assert_matches_type(SyncV4PagePaginationArray[FirewallZoneLockdown], lockdown, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[Lockdown], lockdown, path=["response"]) @pytest.mark.skip() @parametrize @@ -162,7 +162,7 @@ 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" lockdown = response.parse() - assert_matches_type(SyncV4PagePaginationArray[FirewallZoneLockdown], lockdown, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[Lockdown], lockdown, path=["response"]) @pytest.mark.skip() @parametrize @@ -174,7 +174,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" lockdown = response.parse() - assert_matches_type(SyncV4PagePaginationArray[FirewallZoneLockdown], lockdown, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[Lockdown], lockdown, path=["response"]) assert cast(Any, response.is_closed) is True @@ -250,7 +250,7 @@ def test_method_get(self, client: Cloudflare) -> None: "372e67954025e0ba6aaa6d586b9e0b59", zone_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[FirewallZoneLockdown], lockdown, path=["response"]) + assert_matches_type(Lockdown, lockdown, path=["response"]) @pytest.mark.skip() @parametrize @@ -263,7 +263,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" lockdown = response.parse() - assert_matches_type(Optional[FirewallZoneLockdown], lockdown, path=["response"]) + assert_matches_type(Lockdown, lockdown, path=["response"]) @pytest.mark.skip() @parametrize @@ -276,7 +276,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" lockdown = response.parse() - assert_matches_type(Optional[FirewallZoneLockdown], lockdown, path=["response"]) + assert_matches_type(Lockdown, lockdown, path=["response"]) assert cast(Any, response.is_closed) is True @@ -306,7 +306,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", body={}, ) - assert_matches_type(Optional[FirewallZoneLockdown], lockdown, path=["response"]) + assert_matches_type(Lockdown, lockdown, path=["response"]) @pytest.mark.skip() @parametrize @@ -319,7 +319,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" lockdown = await response.parse() - assert_matches_type(Optional[FirewallZoneLockdown], lockdown, path=["response"]) + assert_matches_type(Lockdown, lockdown, path=["response"]) @pytest.mark.skip() @parametrize @@ -332,7 +332,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" lockdown = await response.parse() - assert_matches_type(Optional[FirewallZoneLockdown], lockdown, path=["response"]) + assert_matches_type(Lockdown, lockdown, path=["response"]) assert cast(Any, response.is_closed) is True @@ -353,7 +353,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: zone_identifier="023e105f4ecef8ad9ca31a8372d0c353", body={}, ) - assert_matches_type(Optional[FirewallZoneLockdown], lockdown, path=["response"]) + assert_matches_type(Lockdown, lockdown, path=["response"]) @pytest.mark.skip() @parametrize @@ -367,7 +367,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" lockdown = await response.parse() - assert_matches_type(Optional[FirewallZoneLockdown], lockdown, path=["response"]) + assert_matches_type(Lockdown, lockdown, path=["response"]) @pytest.mark.skip() @parametrize @@ -381,7 +381,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" lockdown = await response.parse() - assert_matches_type(Optional[FirewallZoneLockdown], lockdown, path=["response"]) + assert_matches_type(Lockdown, lockdown, path=["response"]) assert cast(Any, response.is_closed) is True @@ -408,7 +408,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: lockdown = await async_client.firewall.lockdowns.list( "023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncV4PagePaginationArray[FirewallZoneLockdown], lockdown, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[Lockdown], lockdown, path=["response"]) @pytest.mark.skip() @parametrize @@ -427,7 +427,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) priority=5, uri_search="/some/path", ) - assert_matches_type(AsyncV4PagePaginationArray[FirewallZoneLockdown], lockdown, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[Lockdown], lockdown, path=["response"]) @pytest.mark.skip() @parametrize @@ -439,7 +439,7 @@ 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" lockdown = await response.parse() - assert_matches_type(AsyncV4PagePaginationArray[FirewallZoneLockdown], lockdown, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[Lockdown], lockdown, path=["response"]) @pytest.mark.skip() @parametrize @@ -451,7 +451,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" lockdown = await response.parse() - assert_matches_type(AsyncV4PagePaginationArray[FirewallZoneLockdown], lockdown, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[Lockdown], lockdown, path=["response"]) assert cast(Any, response.is_closed) is True @@ -527,7 +527,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: "372e67954025e0ba6aaa6d586b9e0b59", zone_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[FirewallZoneLockdown], lockdown, path=["response"]) + assert_matches_type(Lockdown, lockdown, path=["response"]) @pytest.mark.skip() @parametrize @@ -540,7 +540,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" lockdown = await response.parse() - assert_matches_type(Optional[FirewallZoneLockdown], lockdown, path=["response"]) + assert_matches_type(Lockdown, lockdown, path=["response"]) @pytest.mark.skip() @parametrize @@ -553,7 +553,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" lockdown = await response.parse() - assert_matches_type(Optional[FirewallZoneLockdown], lockdown, path=["response"]) + assert_matches_type(Lockdown, lockdown, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/firewall/test_rules.py b/tests/api_resources/firewall/test_rules.py index cc9ebc23675..a57f861521b 100644 --- a/tests/api_resources/firewall/test_rules.py +++ b/tests/api_resources/firewall/test_rules.py @@ -11,8 +11,8 @@ from tests.utils import assert_matches_type from cloudflare.pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray from cloudflare.types.firewall import ( + Rule, RuleEditResponse, - FirewallFilterRule, RuleCreateResponse, ) @@ -76,7 +76,7 @@ def test_method_update(self, client: Cloudflare) -> None: zone_identifier="023e105f4ecef8ad9ca31a8372d0c353", body={}, ) - assert_matches_type(Optional[FirewallFilterRule], rule, path=["response"]) + assert_matches_type(Rule, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -90,7 +90,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(Optional[FirewallFilterRule], rule, path=["response"]) + assert_matches_type(Rule, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -104,7 +104,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(Optional[FirewallFilterRule], rule, path=["response"]) + assert_matches_type(Rule, rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -131,7 +131,7 @@ def test_method_list(self, client: Cloudflare) -> None: rule = client.firewall.rules.list( "023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncV4PagePaginationArray[FirewallFilterRule], rule, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[Rule], rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -145,7 +145,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: paused=False, per_page=5, ) - assert_matches_type(SyncV4PagePaginationArray[FirewallFilterRule], rule, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[Rule], rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -157,7 +157,7 @@ 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" rule = response.parse() - assert_matches_type(SyncV4PagePaginationArray[FirewallFilterRule], rule, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[Rule], rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -169,7 +169,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(SyncV4PagePaginationArray[FirewallFilterRule], rule, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[Rule], rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -188,7 +188,7 @@ def test_method_delete(self, client: Cloudflare) -> None: "372e67954025e0ba6aaa6d586b9e0b60", zone_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[FirewallFilterRule], rule, path=["response"]) + assert_matches_type(Rule, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -198,7 +198,7 @@ def test_method_delete_with_all_params(self, client: Cloudflare) -> None: zone_identifier="023e105f4ecef8ad9ca31a8372d0c353", delete_filter_if_unused=True, ) - assert_matches_type(Optional[FirewallFilterRule], rule, path=["response"]) + assert_matches_type(Rule, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -211,7 +211,7 @@ 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" rule = response.parse() - assert_matches_type(Optional[FirewallFilterRule], rule, path=["response"]) + assert_matches_type(Rule, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -224,7 +224,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(Optional[FirewallFilterRule], rule, path=["response"]) + assert_matches_type(Rule, rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -307,7 +307,7 @@ def test_method_get(self, client: Cloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", path_id="372e67954025e0ba6aaa6d586b9e0b60", ) - assert_matches_type(Optional[FirewallFilterRule], rule, path=["response"]) + assert_matches_type(Rule, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -317,7 +317,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None: path_id="372e67954025e0ba6aaa6d586b9e0b60", query_id="372e67954025e0ba6aaa6d586b9e0b60", ) - assert_matches_type(Optional[FirewallFilterRule], rule, path=["response"]) + assert_matches_type(Rule, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -330,7 +330,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(Optional[FirewallFilterRule], rule, path=["response"]) + assert_matches_type(Rule, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -343,7 +343,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(Optional[FirewallFilterRule], rule, path=["response"]) + assert_matches_type(Rule, rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -421,7 +421,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: zone_identifier="023e105f4ecef8ad9ca31a8372d0c353", body={}, ) - assert_matches_type(Optional[FirewallFilterRule], rule, path=["response"]) + assert_matches_type(Rule, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -435,7 +435,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(Optional[FirewallFilterRule], rule, path=["response"]) + assert_matches_type(Rule, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -449,7 +449,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(Optional[FirewallFilterRule], rule, path=["response"]) + assert_matches_type(Rule, rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -476,7 +476,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: rule = await async_client.firewall.rules.list( "023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncV4PagePaginationArray[FirewallFilterRule], rule, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[Rule], rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -490,7 +490,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) paused=False, per_page=5, ) - assert_matches_type(AsyncV4PagePaginationArray[FirewallFilterRule], rule, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[Rule], rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -502,7 +502,7 @@ 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" rule = await response.parse() - assert_matches_type(AsyncV4PagePaginationArray[FirewallFilterRule], rule, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[Rule], rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -514,7 +514,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(AsyncV4PagePaginationArray[FirewallFilterRule], rule, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[Rule], rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -533,7 +533,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: "372e67954025e0ba6aaa6d586b9e0b60", zone_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[FirewallFilterRule], rule, path=["response"]) + assert_matches_type(Rule, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -543,7 +543,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncCloudflare zone_identifier="023e105f4ecef8ad9ca31a8372d0c353", delete_filter_if_unused=True, ) - assert_matches_type(Optional[FirewallFilterRule], rule, path=["response"]) + assert_matches_type(Rule, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -556,7 +556,7 @@ 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" rule = await response.parse() - assert_matches_type(Optional[FirewallFilterRule], rule, path=["response"]) + assert_matches_type(Rule, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -569,7 +569,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(Optional[FirewallFilterRule], rule, path=["response"]) + assert_matches_type(Rule, rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -652,7 +652,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", path_id="372e67954025e0ba6aaa6d586b9e0b60", ) - assert_matches_type(Optional[FirewallFilterRule], rule, path=["response"]) + assert_matches_type(Rule, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -662,7 +662,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) - path_id="372e67954025e0ba6aaa6d586b9e0b60", query_id="372e67954025e0ba6aaa6d586b9e0b60", ) - assert_matches_type(Optional[FirewallFilterRule], rule, path=["response"]) + assert_matches_type(Rule, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -675,7 +675,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(Optional[FirewallFilterRule], rule, path=["response"]) + assert_matches_type(Rule, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -688,7 +688,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(Optional[FirewallFilterRule], rule, path=["response"]) + assert_matches_type(Rule, rule, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/firewall/test_ua_rules.py b/tests/api_resources/firewall/test_ua_rules.py index 19d406fc4ab..ae64eddcf08 100644 --- a/tests/api_resources/firewall/test_ua_rules.py +++ b/tests/api_resources/firewall/test_ua_rules.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, Optional, cast +from typing import Any, cast import pytest @@ -188,7 +188,7 @@ def test_method_delete(self, client: Cloudflare) -> None: zone_identifier="023e105f4ecef8ad9ca31a8372d0c353", body={}, ) - assert_matches_type(Optional[UARuleDeleteResponse], ua_rule, path=["response"]) + assert_matches_type(UARuleDeleteResponse, ua_rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -202,7 +202,7 @@ 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" ua_rule = response.parse() - assert_matches_type(Optional[UARuleDeleteResponse], ua_rule, path=["response"]) + assert_matches_type(UARuleDeleteResponse, ua_rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -216,7 +216,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" ua_rule = response.parse() - assert_matches_type(Optional[UARuleDeleteResponse], ua_rule, path=["response"]) + assert_matches_type(UARuleDeleteResponse, ua_rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -459,7 +459,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: zone_identifier="023e105f4ecef8ad9ca31a8372d0c353", body={}, ) - assert_matches_type(Optional[UARuleDeleteResponse], ua_rule, path=["response"]) + assert_matches_type(UARuleDeleteResponse, ua_rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -473,7 +473,7 @@ 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" ua_rule = await response.parse() - assert_matches_type(Optional[UARuleDeleteResponse], ua_rule, path=["response"]) + assert_matches_type(UARuleDeleteResponse, ua_rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -487,7 +487,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" ua_rule = await response.parse() - assert_matches_type(Optional[UARuleDeleteResponse], ua_rule, path=["response"]) + assert_matches_type(UARuleDeleteResponse, ua_rule, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/firewall/waf/packages/test_groups.py b/tests/api_resources/firewall/waf/packages/test_groups.py index 672e05bad34..f2582d3ced6 100644 --- a/tests/api_resources/firewall/waf/packages/test_groups.py +++ b/tests/api_resources/firewall/waf/packages/test_groups.py @@ -11,7 +11,7 @@ from tests.utils import assert_matches_type from cloudflare.pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray from cloudflare.types.shared import UnnamedSchemaRef9444735ca60712dbcf8afd832eb5716a -from cloudflare.types.firewall.waf.packages import WAFManagedRulesGroup +from cloudflare.types.firewall.waf.packages import Group base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -26,7 +26,7 @@ def test_method_list(self, client: Cloudflare) -> None: "a25a9a7e9c00afc1fb2e0245519d725b", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncV4PagePaginationArray[WAFManagedRulesGroup], group, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[Group], group, path=["response"]) @pytest.mark.skip() @parametrize @@ -43,7 +43,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: per_page=5, rules_count=10, ) - assert_matches_type(SyncV4PagePaginationArray[WAFManagedRulesGroup], group, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[Group], group, path=["response"]) @pytest.mark.skip() @parametrize @@ -56,7 +56,7 @@ 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" group = response.parse() - assert_matches_type(SyncV4PagePaginationArray[WAFManagedRulesGroup], group, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[Group], group, path=["response"]) @pytest.mark.skip() @parametrize @@ -69,7 +69,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" group = response.parse() - assert_matches_type(SyncV4PagePaginationArray[WAFManagedRulesGroup], group, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[Group], group, path=["response"]) assert cast(Any, response.is_closed) is True @@ -238,7 +238,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: "a25a9a7e9c00afc1fb2e0245519d725b", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncV4PagePaginationArray[WAFManagedRulesGroup], group, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[Group], group, path=["response"]) @pytest.mark.skip() @parametrize @@ -255,7 +255,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) per_page=5, rules_count=10, ) - assert_matches_type(AsyncV4PagePaginationArray[WAFManagedRulesGroup], group, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[Group], group, path=["response"]) @pytest.mark.skip() @parametrize @@ -268,7 +268,7 @@ 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" group = await response.parse() - assert_matches_type(AsyncV4PagePaginationArray[WAFManagedRulesGroup], group, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[Group], group, path=["response"]) @pytest.mark.skip() @parametrize @@ -281,7 +281,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" group = await response.parse() - assert_matches_type(AsyncV4PagePaginationArray[WAFManagedRulesGroup], group, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[Group], group, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/firewall/waf/packages/test_rules.py b/tests/api_resources/firewall/waf/packages/test_rules.py index 7ce3f4301b8..1443b99a897 100644 --- a/tests/api_resources/firewall/waf/packages/test_rules.py +++ b/tests/api_resources/firewall/waf/packages/test_rules.py @@ -11,10 +11,7 @@ from tests.utils import assert_matches_type from cloudflare.pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray from cloudflare.types.shared import UnnamedSchemaRef9444735ca60712dbcf8afd832eb5716a -from cloudflare.types.firewall.waf.packages import ( - RuleEditResponse, - WAFManagedRulesRule, -) +from cloudflare.types.firewall.waf.packages import Rule, RuleEditResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -29,7 +26,7 @@ def test_method_list(self, client: Cloudflare) -> None: "a25a9a7e9c00afc1fb2e0245519d725b", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncV4PagePaginationArray[WAFManagedRulesRule], rule, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[Rule], rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -47,7 +44,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: per_page=5, priority="string", ) - assert_matches_type(SyncV4PagePaginationArray[WAFManagedRulesRule], rule, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[Rule], rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -60,7 +57,7 @@ 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" rule = response.parse() - assert_matches_type(SyncV4PagePaginationArray[WAFManagedRulesRule], rule, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[Rule], rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -73,7 +70,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(SyncV4PagePaginationArray[WAFManagedRulesRule], rule, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[Rule], rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -242,7 +239,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: "a25a9a7e9c00afc1fb2e0245519d725b", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncV4PagePaginationArray[WAFManagedRulesRule], rule, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[Rule], rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -260,7 +257,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) per_page=5, priority="string", ) - assert_matches_type(AsyncV4PagePaginationArray[WAFManagedRulesRule], rule, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[Rule], rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -273,7 +270,7 @@ 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" rule = await response.parse() - assert_matches_type(AsyncV4PagePaginationArray[WAFManagedRulesRule], rule, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[Rule], rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -286,7 +283,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(AsyncV4PagePaginationArray[WAFManagedRulesRule], rule, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[Rule], rule, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/firewall/waf/test_overrides.py b/tests/api_resources/firewall/waf/test_overrides.py index da8e718d986..b27cefd5f67 100644 --- a/tests/api_resources/firewall/waf/test_overrides.py +++ b/tests/api_resources/firewall/waf/test_overrides.py @@ -11,7 +11,7 @@ from tests.utils import assert_matches_type from cloudflare.pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray from cloudflare.types.firewall.waf import ( - WAFOverride, + Override, OverrideDeleteResponse, ) @@ -28,7 +28,7 @@ def test_method_create(self, client: Cloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", body={}, ) - assert_matches_type(Optional[WAFOverride], override, path=["response"]) + assert_matches_type(Override, override, path=["response"]) @pytest.mark.skip() @parametrize @@ -41,7 +41,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" override = response.parse() - assert_matches_type(Optional[WAFOverride], override, path=["response"]) + assert_matches_type(Override, override, path=["response"]) @pytest.mark.skip() @parametrize @@ -54,7 +54,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" override = response.parse() - assert_matches_type(Optional[WAFOverride], override, path=["response"]) + assert_matches_type(Override, override, path=["response"]) assert cast(Any, response.is_closed) is True @@ -75,7 +75,7 @@ def test_method_update(self, client: Cloudflare) -> None: zone_identifier="023e105f4ecef8ad9ca31a8372d0c353", body={}, ) - assert_matches_type(Optional[WAFOverride], override, path=["response"]) + assert_matches_type(Override, override, path=["response"]) @pytest.mark.skip() @parametrize @@ -89,7 +89,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" override = response.parse() - assert_matches_type(Optional[WAFOverride], override, path=["response"]) + assert_matches_type(Override, override, path=["response"]) @pytest.mark.skip() @parametrize @@ -103,7 +103,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" override = response.parse() - assert_matches_type(Optional[WAFOverride], override, path=["response"]) + assert_matches_type(Override, override, path=["response"]) assert cast(Any, response.is_closed) is True @@ -130,7 +130,7 @@ def test_method_list(self, client: Cloudflare) -> None: override = client.firewall.waf.overrides.list( "023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncV4PagePaginationArray[WAFOverride], override, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[Override], override, path=["response"]) @pytest.mark.skip() @parametrize @@ -140,7 +140,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: page=1, per_page=5, ) - assert_matches_type(SyncV4PagePaginationArray[WAFOverride], override, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[Override], override, path=["response"]) @pytest.mark.skip() @parametrize @@ -152,7 +152,7 @@ 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" override = response.parse() - assert_matches_type(SyncV4PagePaginationArray[WAFOverride], override, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[Override], override, path=["response"]) @pytest.mark.skip() @parametrize @@ -164,7 +164,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" override = response.parse() - assert_matches_type(SyncV4PagePaginationArray[WAFOverride], override, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[Override], override, path=["response"]) assert cast(Any, response.is_closed) is True @@ -240,7 +240,7 @@ def test_method_get(self, client: Cloudflare) -> None: "de677e5818985db1285d0e80225f06e5", zone_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[WAFOverride], override, path=["response"]) + assert_matches_type(Override, override, path=["response"]) @pytest.mark.skip() @parametrize @@ -253,7 +253,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" override = response.parse() - assert_matches_type(Optional[WAFOverride], override, path=["response"]) + assert_matches_type(Override, override, path=["response"]) @pytest.mark.skip() @parametrize @@ -266,7 +266,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" override = response.parse() - assert_matches_type(Optional[WAFOverride], override, path=["response"]) + assert_matches_type(Override, override, path=["response"]) assert cast(Any, response.is_closed) is True @@ -296,7 +296,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", body={}, ) - assert_matches_type(Optional[WAFOverride], override, path=["response"]) + assert_matches_type(Override, override, path=["response"]) @pytest.mark.skip() @parametrize @@ -309,7 +309,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" override = await response.parse() - assert_matches_type(Optional[WAFOverride], override, path=["response"]) + assert_matches_type(Override, override, path=["response"]) @pytest.mark.skip() @parametrize @@ -322,7 +322,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" override = await response.parse() - assert_matches_type(Optional[WAFOverride], override, path=["response"]) + assert_matches_type(Override, override, path=["response"]) assert cast(Any, response.is_closed) is True @@ -343,7 +343,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: zone_identifier="023e105f4ecef8ad9ca31a8372d0c353", body={}, ) - assert_matches_type(Optional[WAFOverride], override, path=["response"]) + assert_matches_type(Override, override, path=["response"]) @pytest.mark.skip() @parametrize @@ -357,7 +357,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" override = await response.parse() - assert_matches_type(Optional[WAFOverride], override, path=["response"]) + assert_matches_type(Override, override, path=["response"]) @pytest.mark.skip() @parametrize @@ -371,7 +371,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" override = await response.parse() - assert_matches_type(Optional[WAFOverride], override, path=["response"]) + assert_matches_type(Override, override, path=["response"]) assert cast(Any, response.is_closed) is True @@ -398,7 +398,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: override = await async_client.firewall.waf.overrides.list( "023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncV4PagePaginationArray[WAFOverride], override, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[Override], override, path=["response"]) @pytest.mark.skip() @parametrize @@ -408,7 +408,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) page=1, per_page=5, ) - assert_matches_type(AsyncV4PagePaginationArray[WAFOverride], override, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[Override], override, path=["response"]) @pytest.mark.skip() @parametrize @@ -420,7 +420,7 @@ 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" override = await response.parse() - assert_matches_type(AsyncV4PagePaginationArray[WAFOverride], override, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[Override], override, path=["response"]) @pytest.mark.skip() @parametrize @@ -432,7 +432,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" override = await response.parse() - assert_matches_type(AsyncV4PagePaginationArray[WAFOverride], override, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[Override], override, path=["response"]) assert cast(Any, response.is_closed) is True @@ -508,7 +508,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: "de677e5818985db1285d0e80225f06e5", zone_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[WAFOverride], override, path=["response"]) + assert_matches_type(Override, override, path=["response"]) @pytest.mark.skip() @parametrize @@ -521,7 +521,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" override = await response.parse() - assert_matches_type(Optional[WAFOverride], override, path=["response"]) + assert_matches_type(Override, override, path=["response"]) @pytest.mark.skip() @parametrize @@ -534,7 +534,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" override = await response.parse() - assert_matches_type(Optional[WAFOverride], override, path=["response"]) + assert_matches_type(Override, override, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/firewall/waf/test_packages.py b/tests/api_resources/firewall/waf/test_packages.py index d1036e2d65f..405a42b1221 100644 --- a/tests/api_resources/firewall/waf/test_packages.py +++ b/tests/api_resources/firewall/waf/test_packages.py @@ -78,7 +78,7 @@ def test_path_params_list(self, client: Cloudflare) -> None: @parametrize def test_method_get(self, client: Cloudflare) -> None: package = client.firewall.waf.packages.get( - "a25a9a7e9c00afc1fb2e0245519d725b", + "023e105f4ecef8ad9ca31a8372d0c353", zone_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(PackageGetResponse, package, path=["response"]) @@ -87,7 +87,7 @@ def test_method_get(self, client: Cloudflare) -> None: @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: response = client.firewall.waf.packages.with_raw_response.get( - "a25a9a7e9c00afc1fb2e0245519d725b", + "023e105f4ecef8ad9ca31a8372d0c353", zone_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -100,7 +100,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: with client.firewall.waf.packages.with_streaming_response.get( - "a25a9a7e9c00afc1fb2e0245519d725b", + "023e105f4ecef8ad9ca31a8372d0c353", zone_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed @@ -116,7 +116,7 @@ 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 `zone_identifier` but received ''"): client.firewall.waf.packages.with_raw_response.get( - "a25a9a7e9c00afc1fb2e0245519d725b", + "023e105f4ecef8ad9ca31a8372d0c353", zone_identifier="", ) @@ -190,7 +190,7 @@ async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_get(self, async_client: AsyncCloudflare) -> None: package = await async_client.firewall.waf.packages.get( - "a25a9a7e9c00afc1fb2e0245519d725b", + "023e105f4ecef8ad9ca31a8372d0c353", zone_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) assert_matches_type(PackageGetResponse, package, path=["response"]) @@ -199,7 +199,7 @@ 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.firewall.waf.packages.with_raw_response.get( - "a25a9a7e9c00afc1fb2e0245519d725b", + "023e105f4ecef8ad9ca31a8372d0c353", zone_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -212,7 +212,7 @@ 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.firewall.waf.packages.with_streaming_response.get( - "a25a9a7e9c00afc1fb2e0245519d725b", + "023e105f4ecef8ad9ca31a8372d0c353", zone_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed @@ -228,7 +228,7 @@ 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 `zone_identifier` but received ''"): await async_client.firewall.waf.packages.with_raw_response.get( - "a25a9a7e9c00afc1fb2e0245519d725b", + "023e105f4ecef8ad9ca31a8372d0c353", zone_identifier="", ) diff --git a/tests/api_resources/hyperdrive/test_configs.py b/tests/api_resources/hyperdrive/test_configs.py index 6a6b9c8d33d..18738819f59 100644 --- a/tests/api_resources/hyperdrive/test_configs.py +++ b/tests/api_resources/hyperdrive/test_configs.py @@ -9,15 +9,9 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type +from cloudflare.types import Hyperdrive from cloudflare.pagination import SyncSinglePage, AsyncSinglePage from cloudflare.types.shared import UnnamedSchemaRef9444735ca60712dbcf8afd832eb5716a -from cloudflare.types.hyperdrive import ( - ConfigGetResponse, - ConfigEditResponse, - ConfigListResponse, - ConfigCreateResponse, - ConfigUpdateResponse, -) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -33,7 +27,7 @@ def test_method_create(self, client: Cloudflare) -> None: name={}, origin={"password": "password1234!"}, ) - assert_matches_type(Optional[ConfigCreateResponse], config, path=["response"]) + assert_matches_type(Optional[Hyperdrive], config, path=["response"]) @pytest.mark.skip() @parametrize @@ -47,7 +41,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = response.parse() - assert_matches_type(Optional[ConfigCreateResponse], config, path=["response"]) + assert_matches_type(Optional[Hyperdrive], config, path=["response"]) @pytest.mark.skip() @parametrize @@ -61,7 +55,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = response.parse() - assert_matches_type(Optional[ConfigCreateResponse], config, path=["response"]) + assert_matches_type(Optional[Hyperdrive], config, path=["response"]) assert cast(Any, response.is_closed) is True @@ -84,7 +78,7 @@ def test_method_update(self, client: Cloudflare) -> None: name={}, origin={"password": "password1234!"}, ) - assert_matches_type(Optional[ConfigUpdateResponse], config, path=["response"]) + assert_matches_type(Optional[Hyperdrive], config, path=["response"]) @pytest.mark.skip() @parametrize @@ -99,7 +93,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = response.parse() - assert_matches_type(Optional[ConfigUpdateResponse], config, path=["response"]) + assert_matches_type(Optional[Hyperdrive], config, path=["response"]) @pytest.mark.skip() @parametrize @@ -114,7 +108,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = response.parse() - assert_matches_type(Optional[ConfigUpdateResponse], config, path=["response"]) + assert_matches_type(Optional[Hyperdrive], config, path=["response"]) assert cast(Any, response.is_closed) is True @@ -143,7 +137,7 @@ def test_method_list(self, client: Cloudflare) -> None: config = client.hyperdrive.configs.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncSinglePage[ConfigListResponse], config, path=["response"]) + assert_matches_type(SyncSinglePage[Hyperdrive], config, path=["response"]) @pytest.mark.skip() @parametrize @@ -155,7 +149,7 @@ 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" config = response.parse() - assert_matches_type(SyncSinglePage[ConfigListResponse], config, path=["response"]) + assert_matches_type(SyncSinglePage[Hyperdrive], config, path=["response"]) @pytest.mark.skip() @parametrize @@ -167,7 +161,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = response.parse() - assert_matches_type(SyncSinglePage[ConfigListResponse], config, path=["response"]) + assert_matches_type(SyncSinglePage[Hyperdrive], config, path=["response"]) assert cast(Any, response.is_closed) is True @@ -238,7 +232,7 @@ def test_method_edit(self, client: Cloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[ConfigEditResponse], config, path=["response"]) + assert_matches_type(Optional[Hyperdrive], config, path=["response"]) @pytest.mark.skip() @parametrize @@ -248,7 +242,7 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", origin={"password": "password1234!"}, ) - assert_matches_type(Optional[ConfigEditResponse], config, path=["response"]) + assert_matches_type(Optional[Hyperdrive], config, path=["response"]) @pytest.mark.skip() @parametrize @@ -261,7 +255,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = response.parse() - assert_matches_type(Optional[ConfigEditResponse], config, path=["response"]) + assert_matches_type(Optional[Hyperdrive], config, path=["response"]) @pytest.mark.skip() @parametrize @@ -274,7 +268,7 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = response.parse() - assert_matches_type(Optional[ConfigEditResponse], config, path=["response"]) + assert_matches_type(Optional[Hyperdrive], config, path=["response"]) assert cast(Any, response.is_closed) is True @@ -300,7 +294,7 @@ def test_method_get(self, client: Cloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[ConfigGetResponse], config, path=["response"]) + assert_matches_type(Optional[Hyperdrive], config, path=["response"]) @pytest.mark.skip() @parametrize @@ -313,7 +307,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = response.parse() - assert_matches_type(Optional[ConfigGetResponse], config, path=["response"]) + assert_matches_type(Optional[Hyperdrive], config, path=["response"]) @pytest.mark.skip() @parametrize @@ -326,7 +320,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = response.parse() - assert_matches_type(Optional[ConfigGetResponse], config, path=["response"]) + assert_matches_type(Optional[Hyperdrive], config, path=["response"]) assert cast(Any, response.is_closed) is True @@ -357,7 +351,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: name={}, origin={"password": "password1234!"}, ) - assert_matches_type(Optional[ConfigCreateResponse], config, path=["response"]) + assert_matches_type(Optional[Hyperdrive], config, path=["response"]) @pytest.mark.skip() @parametrize @@ -371,7 +365,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = await response.parse() - assert_matches_type(Optional[ConfigCreateResponse], config, path=["response"]) + assert_matches_type(Optional[Hyperdrive], config, path=["response"]) @pytest.mark.skip() @parametrize @@ -385,7 +379,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = await response.parse() - assert_matches_type(Optional[ConfigCreateResponse], config, path=["response"]) + assert_matches_type(Optional[Hyperdrive], config, path=["response"]) assert cast(Any, response.is_closed) is True @@ -408,7 +402,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: name={}, origin={"password": "password1234!"}, ) - assert_matches_type(Optional[ConfigUpdateResponse], config, path=["response"]) + assert_matches_type(Optional[Hyperdrive], config, path=["response"]) @pytest.mark.skip() @parametrize @@ -423,7 +417,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = await response.parse() - assert_matches_type(Optional[ConfigUpdateResponse], config, path=["response"]) + assert_matches_type(Optional[Hyperdrive], config, path=["response"]) @pytest.mark.skip() @parametrize @@ -438,7 +432,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = await response.parse() - assert_matches_type(Optional[ConfigUpdateResponse], config, path=["response"]) + assert_matches_type(Optional[Hyperdrive], config, path=["response"]) assert cast(Any, response.is_closed) is True @@ -467,7 +461,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: config = await async_client.hyperdrive.configs.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncSinglePage[ConfigListResponse], config, path=["response"]) + assert_matches_type(AsyncSinglePage[Hyperdrive], config, path=["response"]) @pytest.mark.skip() @parametrize @@ -479,7 +473,7 @@ 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" config = await response.parse() - assert_matches_type(AsyncSinglePage[ConfigListResponse], config, path=["response"]) + assert_matches_type(AsyncSinglePage[Hyperdrive], config, path=["response"]) @pytest.mark.skip() @parametrize @@ -491,7 +485,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = await response.parse() - assert_matches_type(AsyncSinglePage[ConfigListResponse], config, path=["response"]) + assert_matches_type(AsyncSinglePage[Hyperdrive], config, path=["response"]) assert cast(Any, response.is_closed) is True @@ -562,7 +556,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[ConfigEditResponse], config, path=["response"]) + assert_matches_type(Optional[Hyperdrive], config, path=["response"]) @pytest.mark.skip() @parametrize @@ -572,7 +566,7 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) account_id="023e105f4ecef8ad9ca31a8372d0c353", origin={"password": "password1234!"}, ) - assert_matches_type(Optional[ConfigEditResponse], config, path=["response"]) + assert_matches_type(Optional[Hyperdrive], config, path=["response"]) @pytest.mark.skip() @parametrize @@ -585,7 +579,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = await response.parse() - assert_matches_type(Optional[ConfigEditResponse], config, path=["response"]) + assert_matches_type(Optional[Hyperdrive], config, path=["response"]) @pytest.mark.skip() @parametrize @@ -598,7 +592,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = await response.parse() - assert_matches_type(Optional[ConfigEditResponse], config, path=["response"]) + assert_matches_type(Optional[Hyperdrive], config, path=["response"]) assert cast(Any, response.is_closed) is True @@ -624,7 +618,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[ConfigGetResponse], config, path=["response"]) + assert_matches_type(Optional[Hyperdrive], config, path=["response"]) @pytest.mark.skip() @parametrize @@ -637,7 +631,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = await response.parse() - assert_matches_type(Optional[ConfigGetResponse], config, path=["response"]) + assert_matches_type(Optional[Hyperdrive], config, path=["response"]) @pytest.mark.skip() @parametrize @@ -650,7 +644,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = await response.parse() - assert_matches_type(Optional[ConfigGetResponse], config, path=["response"]) + assert_matches_type(Optional[Hyperdrive], config, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/images/test_v1.py b/tests/api_resources/images/test_v1.py index 39bca42483a..decdb71baa8 100644 --- a/tests/api_resources/images/test_v1.py +++ b/tests/api_resources/images/test_v1.py @@ -24,65 +24,29 @@ class TestV1: @pytest.mark.skip() @parametrize - def test_method_create_overload_1(self, client: Cloudflare) -> None: + def test_method_create(self, client: Cloudflare) -> None: v1 = client.images.v1.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", - file={}, - ) - assert_matches_type(Image, v1, path=["response"]) - - @pytest.mark.skip() - @parametrize - def test_raw_response_create_overload_1(self, client: Cloudflare) -> None: - response = client.images.v1.with_raw_response.create( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - file={}, ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - v1 = response.parse() assert_matches_type(Image, v1, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_create_overload_1(self, client: Cloudflare) -> None: - with client.images.v1.with_streaming_response.create( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - file={}, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - v1 = response.parse() - assert_matches_type(Image, v1, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - def test_path_params_create_overload_1(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.images.v1.with_raw_response.create( - account_id="", - file={}, - ) - - @pytest.mark.skip() - @parametrize - def test_method_create_overload_2(self, client: Cloudflare) -> None: + def test_method_create_with_all_params(self, client: Cloudflare) -> None: v1 = client.images.v1.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", + file={}, + metadata={}, + require_signed_urls=True, url="https://example.com/path/to/logo.png", ) assert_matches_type(Image, v1, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_create_overload_2(self, client: Cloudflare) -> None: + def test_raw_response_create(self, client: Cloudflare) -> None: response = client.images.v1.with_raw_response.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", - url="https://example.com/path/to/logo.png", ) assert response.is_closed is True @@ -92,10 +56,9 @@ def test_raw_response_create_overload_2(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_streaming_response_create_overload_2(self, client: Cloudflare) -> None: + def test_streaming_response_create(self, client: Cloudflare) -> None: with client.images.v1.with_streaming_response.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", - url="https://example.com/path/to/logo.png", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -107,11 +70,10 @@ def test_streaming_response_create_overload_2(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_path_params_create_overload_2(self, client: Cloudflare) -> None: + 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.images.v1.with_raw_response.create( account_id="", - url="https://example.com/path/to/logo.png", ) @pytest.mark.skip() @@ -344,65 +306,29 @@ class TestAsyncV1: @pytest.mark.skip() @parametrize - async def test_method_create_overload_1(self, async_client: AsyncCloudflare) -> None: + async def test_method_create(self, async_client: AsyncCloudflare) -> None: v1 = await async_client.images.v1.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", - file={}, - ) - assert_matches_type(Image, v1, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_raw_response_create_overload_1(self, async_client: AsyncCloudflare) -> None: - response = await async_client.images.v1.with_raw_response.create( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - file={}, ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - v1 = await response.parse() assert_matches_type(Image, v1, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_create_overload_1(self, async_client: AsyncCloudflare) -> None: - async with async_client.images.v1.with_streaming_response.create( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - file={}, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - v1 = await response.parse() - assert_matches_type(Image, v1, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip() - @parametrize - async def test_path_params_create_overload_1(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.images.v1.with_raw_response.create( - account_id="", - file={}, - ) - - @pytest.mark.skip() - @parametrize - async def test_method_create_overload_2(self, async_client: AsyncCloudflare) -> None: + async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: v1 = await async_client.images.v1.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", + file={}, + metadata={}, + require_signed_urls=True, url="https://example.com/path/to/logo.png", ) assert_matches_type(Image, v1, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_create_overload_2(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: response = await async_client.images.v1.with_raw_response.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", - url="https://example.com/path/to/logo.png", ) assert response.is_closed is True @@ -412,10 +338,9 @@ async def test_raw_response_create_overload_2(self, async_client: AsyncCloudflar @pytest.mark.skip() @parametrize - async def test_streaming_response_create_overload_2(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: async with async_client.images.v1.with_streaming_response.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", - url="https://example.com/path/to/logo.png", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -427,11 +352,10 @@ async def test_streaming_response_create_overload_2(self, async_client: AsyncClo @pytest.mark.skip() @parametrize - async def test_path_params_create_overload_2(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.images.v1.with_raw_response.create( account_id="", - url="https://example.com/path/to/logo.png", ) @pytest.mark.skip() diff --git a/tests/api_resources/images/v1/test_keys.py b/tests/api_resources/images/v1/test_keys.py index 258434f5463..aaba37156a1 100644 --- a/tests/api_resources/images/v1/test_keys.py +++ b/tests/api_resources/images/v1/test_keys.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.images.v1 import ImagesImageKeys +from cloudflare.types.images.v1 import Key base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -24,7 +24,7 @@ def test_method_update(self, client: Cloudflare) -> None: "someKey", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(ImagesImageKeys, key, path=["response"]) + assert_matches_type(Key, key, path=["response"]) @pytest.mark.skip() @parametrize @@ -37,7 +37,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" key = response.parse() - assert_matches_type(ImagesImageKeys, key, path=["response"]) + assert_matches_type(Key, key, path=["response"]) @pytest.mark.skip() @parametrize @@ -50,7 +50,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" key = response.parse() - assert_matches_type(ImagesImageKeys, key, path=["response"]) + assert_matches_type(Key, key, path=["response"]) assert cast(Any, response.is_closed) is True @@ -75,7 +75,7 @@ def test_method_list(self, client: Cloudflare) -> None: key = client.images.v1.keys.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(ImagesImageKeys, key, path=["response"]) + assert_matches_type(Key, key, path=["response"]) @pytest.mark.skip() @parametrize @@ -87,7 +87,7 @@ 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" key = response.parse() - assert_matches_type(ImagesImageKeys, key, path=["response"]) + assert_matches_type(Key, key, path=["response"]) @pytest.mark.skip() @parametrize @@ -99,7 +99,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" key = response.parse() - assert_matches_type(ImagesImageKeys, key, path=["response"]) + assert_matches_type(Key, key, path=["response"]) assert cast(Any, response.is_closed) is True @@ -118,7 +118,7 @@ def test_method_delete(self, client: Cloudflare) -> None: "someKey", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(ImagesImageKeys, key, path=["response"]) + assert_matches_type(Key, key, path=["response"]) @pytest.mark.skip() @parametrize @@ -131,7 +131,7 @@ 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" key = response.parse() - assert_matches_type(ImagesImageKeys, key, path=["response"]) + assert_matches_type(Key, key, path=["response"]) @pytest.mark.skip() @parametrize @@ -144,7 +144,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" key = response.parse() - assert_matches_type(ImagesImageKeys, key, path=["response"]) + assert_matches_type(Key, key, path=["response"]) assert cast(Any, response.is_closed) is True @@ -174,7 +174,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: "someKey", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(ImagesImageKeys, key, path=["response"]) + assert_matches_type(Key, key, path=["response"]) @pytest.mark.skip() @parametrize @@ -187,7 +187,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" key = await response.parse() - assert_matches_type(ImagesImageKeys, key, path=["response"]) + assert_matches_type(Key, key, path=["response"]) @pytest.mark.skip() @parametrize @@ -200,7 +200,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" key = await response.parse() - assert_matches_type(ImagesImageKeys, key, path=["response"]) + assert_matches_type(Key, key, path=["response"]) assert cast(Any, response.is_closed) is True @@ -225,7 +225,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: key = await async_client.images.v1.keys.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(ImagesImageKeys, key, path=["response"]) + assert_matches_type(Key, key, path=["response"]) @pytest.mark.skip() @parametrize @@ -237,7 +237,7 @@ 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" key = await response.parse() - assert_matches_type(ImagesImageKeys, key, path=["response"]) + assert_matches_type(Key, key, path=["response"]) @pytest.mark.skip() @parametrize @@ -249,7 +249,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" key = await response.parse() - assert_matches_type(ImagesImageKeys, key, path=["response"]) + assert_matches_type(Key, key, path=["response"]) assert cast(Any, response.is_closed) is True @@ -268,7 +268,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: "someKey", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(ImagesImageKeys, key, path=["response"]) + assert_matches_type(Key, key, path=["response"]) @pytest.mark.skip() @parametrize @@ -281,7 +281,7 @@ 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" key = await response.parse() - assert_matches_type(ImagesImageKeys, key, path=["response"]) + assert_matches_type(Key, key, path=["response"]) @pytest.mark.skip() @parametrize @@ -294,7 +294,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" key = await response.parse() - assert_matches_type(ImagesImageKeys, key, path=["response"]) + assert_matches_type(Key, key, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/images/v1/test_stats.py b/tests/api_resources/images/v1/test_stats.py index 9c5496d66db..d2ea3b07cbb 100644 --- a/tests/api_resources/images/v1/test_stats.py +++ b/tests/api_resources/images/v1/test_stats.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.images.v1 import ImagesImagesStats +from cloudflare.types.images.v1 import Stat base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -23,7 +23,7 @@ def test_method_get(self, client: Cloudflare) -> None: stat = client.images.v1.stats.get( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(ImagesImagesStats, stat, path=["response"]) + assert_matches_type(Stat, stat, path=["response"]) @pytest.mark.skip() @parametrize @@ -35,7 +35,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" stat = response.parse() - assert_matches_type(ImagesImagesStats, stat, path=["response"]) + assert_matches_type(Stat, stat, path=["response"]) @pytest.mark.skip() @parametrize @@ -47,7 +47,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" stat = response.parse() - assert_matches_type(ImagesImagesStats, stat, path=["response"]) + assert_matches_type(Stat, stat, path=["response"]) assert cast(Any, response.is_closed) is True @@ -69,7 +69,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: stat = await async_client.images.v1.stats.get( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(ImagesImagesStats, stat, path=["response"]) + assert_matches_type(Stat, stat, path=["response"]) @pytest.mark.skip() @parametrize @@ -81,7 +81,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" stat = await response.parse() - assert_matches_type(ImagesImagesStats, stat, path=["response"]) + assert_matches_type(Stat, stat, path=["response"]) @pytest.mark.skip() @parametrize @@ -93,7 +93,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" stat = await response.parse() - assert_matches_type(ImagesImagesStats, stat, path=["response"]) + assert_matches_type(Stat, stat, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/images/v1/test_variants.py b/tests/api_resources/images/v1/test_variants.py index ddb3b5757a7..31937f986de 100644 --- a/tests/api_resources/images/v1/test_variants.py +++ b/tests/api_resources/images/v1/test_variants.py @@ -11,8 +11,10 @@ from tests.utils import assert_matches_type from cloudflare.types.shared import UnnamedSchemaRef9444735ca60712dbcf8afd832eb5716a from cloudflare.types.images.v1 import ( - V1ImageVariant, - V1ImageVariants, + Variant, + VariantGetResponse, + VariantEditResponse, + VariantCreateResponse, ) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -34,7 +36,7 @@ def test_method_create(self, client: Cloudflare) -> None: "width": 1366, }, ) - assert_matches_type(V1ImageVariant, variant, path=["response"]) + assert_matches_type(VariantCreateResponse, variant, path=["response"]) @pytest.mark.skip() @parametrize @@ -50,7 +52,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: }, never_require_signed_urls=True, ) - assert_matches_type(V1ImageVariant, variant, path=["response"]) + assert_matches_type(VariantCreateResponse, variant, path=["response"]) @pytest.mark.skip() @parametrize @@ -69,7 +71,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" variant = response.parse() - assert_matches_type(V1ImageVariant, variant, path=["response"]) + assert_matches_type(VariantCreateResponse, variant, path=["response"]) @pytest.mark.skip() @parametrize @@ -88,7 +90,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" variant = response.parse() - assert_matches_type(V1ImageVariant, variant, path=["response"]) + assert_matches_type(VariantCreateResponse, variant, path=["response"]) assert cast(Any, response.is_closed) is True @@ -113,7 +115,7 @@ def test_method_list(self, client: Cloudflare) -> None: variant = client.images.v1.variants.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(V1ImageVariants, variant, path=["response"]) + assert_matches_type(Variant, variant, path=["response"]) @pytest.mark.skip() @parametrize @@ -125,7 +127,7 @@ 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" variant = response.parse() - assert_matches_type(V1ImageVariants, variant, path=["response"]) + assert_matches_type(Variant, variant, path=["response"]) @pytest.mark.skip() @parametrize @@ -137,7 +139,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" variant = response.parse() - assert_matches_type(V1ImageVariants, variant, path=["response"]) + assert_matches_type(Variant, variant, path=["response"]) assert cast(Any, response.is_closed) is True @@ -219,7 +221,7 @@ def test_method_edit(self, client: Cloudflare) -> None: "width": 1366, }, ) - assert_matches_type(V1ImageVariant, variant, path=["response"]) + assert_matches_type(VariantEditResponse, variant, path=["response"]) @pytest.mark.skip() @parametrize @@ -235,7 +237,7 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: }, never_require_signed_urls=True, ) - assert_matches_type(V1ImageVariant, variant, path=["response"]) + assert_matches_type(VariantEditResponse, variant, path=["response"]) @pytest.mark.skip() @parametrize @@ -254,7 +256,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" variant = response.parse() - assert_matches_type(V1ImageVariant, variant, path=["response"]) + assert_matches_type(VariantEditResponse, variant, path=["response"]) @pytest.mark.skip() @parametrize @@ -273,7 +275,7 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" variant = response.parse() - assert_matches_type(V1ImageVariant, variant, path=["response"]) + assert_matches_type(VariantEditResponse, variant, path=["response"]) assert cast(Any, response.is_closed) is True @@ -311,7 +313,7 @@ def test_method_get(self, client: Cloudflare) -> None: "hero", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(V1ImageVariant, variant, path=["response"]) + assert_matches_type(VariantGetResponse, variant, path=["response"]) @pytest.mark.skip() @parametrize @@ -324,7 +326,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" variant = response.parse() - assert_matches_type(V1ImageVariant, variant, path=["response"]) + assert_matches_type(VariantGetResponse, variant, path=["response"]) @pytest.mark.skip() @parametrize @@ -337,7 +339,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" variant = response.parse() - assert_matches_type(V1ImageVariant, variant, path=["response"]) + assert_matches_type(VariantGetResponse, variant, path=["response"]) assert cast(Any, response.is_closed) is True @@ -373,7 +375,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: "width": 1366, }, ) - assert_matches_type(V1ImageVariant, variant, path=["response"]) + assert_matches_type(VariantCreateResponse, variant, path=["response"]) @pytest.mark.skip() @parametrize @@ -389,7 +391,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare }, never_require_signed_urls=True, ) - assert_matches_type(V1ImageVariant, variant, path=["response"]) + assert_matches_type(VariantCreateResponse, variant, path=["response"]) @pytest.mark.skip() @parametrize @@ -408,7 +410,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" variant = await response.parse() - assert_matches_type(V1ImageVariant, variant, path=["response"]) + assert_matches_type(VariantCreateResponse, variant, path=["response"]) @pytest.mark.skip() @parametrize @@ -427,7 +429,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" variant = await response.parse() - assert_matches_type(V1ImageVariant, variant, path=["response"]) + assert_matches_type(VariantCreateResponse, variant, path=["response"]) assert cast(Any, response.is_closed) is True @@ -452,7 +454,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: variant = await async_client.images.v1.variants.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(V1ImageVariants, variant, path=["response"]) + assert_matches_type(Variant, variant, path=["response"]) @pytest.mark.skip() @parametrize @@ -464,7 +466,7 @@ 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" variant = await response.parse() - assert_matches_type(V1ImageVariants, variant, path=["response"]) + assert_matches_type(Variant, variant, path=["response"]) @pytest.mark.skip() @parametrize @@ -476,7 +478,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" variant = await response.parse() - assert_matches_type(V1ImageVariants, variant, path=["response"]) + assert_matches_type(Variant, variant, path=["response"]) assert cast(Any, response.is_closed) is True @@ -558,7 +560,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: "width": 1366, }, ) - assert_matches_type(V1ImageVariant, variant, path=["response"]) + assert_matches_type(VariantEditResponse, variant, path=["response"]) @pytest.mark.skip() @parametrize @@ -574,7 +576,7 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) }, never_require_signed_urls=True, ) - assert_matches_type(V1ImageVariant, variant, path=["response"]) + assert_matches_type(VariantEditResponse, variant, path=["response"]) @pytest.mark.skip() @parametrize @@ -593,7 +595,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" variant = await response.parse() - assert_matches_type(V1ImageVariant, variant, path=["response"]) + assert_matches_type(VariantEditResponse, variant, path=["response"]) @pytest.mark.skip() @parametrize @@ -612,7 +614,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" variant = await response.parse() - assert_matches_type(V1ImageVariant, variant, path=["response"]) + assert_matches_type(VariantEditResponse, variant, path=["response"]) assert cast(Any, response.is_closed) is True @@ -650,7 +652,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: "hero", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(V1ImageVariant, variant, path=["response"]) + assert_matches_type(VariantGetResponse, variant, path=["response"]) @pytest.mark.skip() @parametrize @@ -663,7 +665,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" variant = await response.parse() - assert_matches_type(V1ImageVariant, variant, path=["response"]) + assert_matches_type(VariantGetResponse, variant, path=["response"]) @pytest.mark.skip() @parametrize @@ -676,7 +678,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" variant = await response.parse() - assert_matches_type(V1ImageVariant, variant, path=["response"]) + assert_matches_type(VariantGetResponse, variant, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/intel/test_asn.py b/tests/api_resources/intel/test_asn.py index 75191ec2eb7..b2c1b70f746 100644 --- a/tests/api_resources/intel/test_asn.py +++ b/tests/api_resources/intel/test_asn.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.intel import IntelASN +from cloudflare.types.intel import ASN base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -24,7 +24,7 @@ def test_method_get(self, client: Cloudflare) -> None: 0, account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(IntelASN, asn, path=["response"]) + assert_matches_type(ASN, asn, path=["response"]) @pytest.mark.skip() @parametrize @@ -37,7 +37,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" asn = response.parse() - assert_matches_type(IntelASN, asn, path=["response"]) + assert_matches_type(ASN, asn, path=["response"]) @pytest.mark.skip() @parametrize @@ -50,7 +50,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" asn = response.parse() - assert_matches_type(IntelASN, asn, path=["response"]) + assert_matches_type(ASN, asn, path=["response"]) assert cast(Any, response.is_closed) is True @@ -74,7 +74,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: 0, account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(IntelASN, asn, path=["response"]) + assert_matches_type(ASN, asn, path=["response"]) @pytest.mark.skip() @parametrize @@ -87,7 +87,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" asn = await response.parse() - assert_matches_type(IntelASN, asn, path=["response"]) + assert_matches_type(ASN, asn, path=["response"]) @pytest.mark.skip() @parametrize @@ -100,7 +100,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" asn = await response.parse() - assert_matches_type(IntelASN, asn, path=["response"]) + assert_matches_type(ASN, asn, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/intel/test_dns.py b/tests/api_resources/intel/test_dns.py index febfa756ec3..84f07865c11 100644 --- a/tests/api_resources/intel/test_dns.py +++ b/tests/api_resources/intel/test_dns.py @@ -10,7 +10,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare._utils import parse_date -from cloudflare.types.intel import IntelPassiveDNSByIP +from cloudflare.types.intel import DNS base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -24,7 +24,7 @@ def test_method_get(self, client: Cloudflare) -> None: dns = client.intel.dns.get( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(IntelPassiveDNSByIP, dns, path=["response"]) + assert_matches_type(DNS, dns, path=["response"]) @pytest.mark.skip() @parametrize @@ -39,7 +39,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None: "start": parse_date("2021-04-01"), }, ) - assert_matches_type(IntelPassiveDNSByIP, dns, path=["response"]) + assert_matches_type(DNS, dns, path=["response"]) @pytest.mark.skip() @parametrize @@ -51,7 +51,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" dns = response.parse() - assert_matches_type(IntelPassiveDNSByIP, dns, path=["response"]) + assert_matches_type(DNS, dns, path=["response"]) @pytest.mark.skip() @parametrize @@ -63,7 +63,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" dns = response.parse() - assert_matches_type(IntelPassiveDNSByIP, dns, path=["response"]) + assert_matches_type(DNS, dns, path=["response"]) assert cast(Any, response.is_closed) is True @@ -85,7 +85,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: dns = await async_client.intel.dns.get( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(IntelPassiveDNSByIP, dns, path=["response"]) + assert_matches_type(DNS, dns, path=["response"]) @pytest.mark.skip() @parametrize @@ -100,7 +100,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) - "start": parse_date("2021-04-01"), }, ) - assert_matches_type(IntelPassiveDNSByIP, dns, path=["response"]) + assert_matches_type(DNS, dns, path=["response"]) @pytest.mark.skip() @parametrize @@ -112,7 +112,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" dns = await response.parse() - assert_matches_type(IntelPassiveDNSByIP, dns, path=["response"]) + assert_matches_type(DNS, dns, path=["response"]) @pytest.mark.skip() @parametrize @@ -124,7 +124,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" dns = await response.parse() - assert_matches_type(IntelPassiveDNSByIP, dns, path=["response"]) + assert_matches_type(DNS, dns, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/intel/test_domains.py b/tests/api_resources/intel/test_domains.py index edfc243062d..ccf650a3380 100644 --- a/tests/api_resources/intel/test_domains.py +++ b/tests/api_resources/intel/test_domains.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.intel import IntelDomain +from cloudflare.types.intel import Domain base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -23,7 +23,7 @@ def test_method_get(self, client: Cloudflare) -> None: domain = client.intel.domains.get( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(IntelDomain, domain, path=["response"]) + assert_matches_type(Domain, domain, path=["response"]) @pytest.mark.skip() @parametrize @@ -32,7 +32,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", domain="string", ) - assert_matches_type(IntelDomain, domain, path=["response"]) + assert_matches_type(Domain, domain, path=["response"]) @pytest.mark.skip() @parametrize @@ -44,7 +44,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" domain = response.parse() - assert_matches_type(IntelDomain, domain, path=["response"]) + assert_matches_type(Domain, domain, path=["response"]) @pytest.mark.skip() @parametrize @@ -56,7 +56,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" domain = response.parse() - assert_matches_type(IntelDomain, domain, path=["response"]) + assert_matches_type(Domain, domain, path=["response"]) assert cast(Any, response.is_closed) is True @@ -78,7 +78,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: domain = await async_client.intel.domains.get( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(IntelDomain, domain, path=["response"]) + assert_matches_type(Domain, domain, path=["response"]) @pytest.mark.skip() @parametrize @@ -87,7 +87,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) - account_id="023e105f4ecef8ad9ca31a8372d0c353", domain="string", ) - assert_matches_type(IntelDomain, domain, path=["response"]) + assert_matches_type(Domain, domain, path=["response"]) @pytest.mark.skip() @parametrize @@ -99,7 +99,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" domain = await response.parse() - assert_matches_type(IntelDomain, domain, path=["response"]) + assert_matches_type(Domain, domain, path=["response"]) @pytest.mark.skip() @parametrize @@ -111,7 +111,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" domain = await response.parse() - assert_matches_type(IntelDomain, domain, path=["response"]) + assert_matches_type(Domain, domain, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/intel/test_sinkholes.py b/tests/api_resources/intel/test_sinkholes.py index 7486df7c274..966a6ee1fa3 100644 --- a/tests/api_resources/intel/test_sinkholes.py +++ b/tests/api_resources/intel/test_sinkholes.py @@ -10,7 +10,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.pagination import SyncSinglePage, AsyncSinglePage -from cloudflare.types.intel import IntelSinkholeItem +from cloudflare.types.intel import SinkholeItem base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -24,7 +24,7 @@ def test_method_list(self, client: Cloudflare) -> None: sinkhole = client.intel.sinkholes.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncSinglePage[IntelSinkholeItem], sinkhole, path=["response"]) + assert_matches_type(SyncSinglePage[SinkholeItem], sinkhole, path=["response"]) @pytest.mark.skip() @parametrize @@ -36,7 +36,7 @@ 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" sinkhole = response.parse() - assert_matches_type(SyncSinglePage[IntelSinkholeItem], sinkhole, path=["response"]) + assert_matches_type(SyncSinglePage[SinkholeItem], sinkhole, path=["response"]) @pytest.mark.skip() @parametrize @@ -48,7 +48,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" sinkhole = response.parse() - assert_matches_type(SyncSinglePage[IntelSinkholeItem], sinkhole, path=["response"]) + assert_matches_type(SyncSinglePage[SinkholeItem], sinkhole, path=["response"]) assert cast(Any, response.is_closed) is True @@ -70,7 +70,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: sinkhole = await async_client.intel.sinkholes.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncSinglePage[IntelSinkholeItem], sinkhole, path=["response"]) + assert_matches_type(AsyncSinglePage[SinkholeItem], sinkhole, path=["response"]) @pytest.mark.skip() @parametrize @@ -82,7 +82,7 @@ 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" sinkhole = await response.parse() - assert_matches_type(AsyncSinglePage[IntelSinkholeItem], sinkhole, path=["response"]) + assert_matches_type(AsyncSinglePage[SinkholeItem], sinkhole, path=["response"]) @pytest.mark.skip() @parametrize @@ -94,7 +94,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" sinkhole = await response.parse() - assert_matches_type(AsyncSinglePage[IntelSinkholeItem], sinkhole, path=["response"]) + assert_matches_type(AsyncSinglePage[SinkholeItem], sinkhole, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/intel/test_whois.py b/tests/api_resources/intel/test_whois.py index 81060ff3119..5f42548c43b 100644 --- a/tests/api_resources/intel/test_whois.py +++ b/tests/api_resources/intel/test_whois.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.intel import IntelWhois +from cloudflare.types.intel import Whois base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -23,7 +23,7 @@ def test_method_get(self, client: Cloudflare) -> None: whois = client.intel.whois.get( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(IntelWhois, whois, path=["response"]) + assert_matches_type(Whois, whois, path=["response"]) @pytest.mark.skip() @parametrize @@ -32,7 +32,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", domain="string", ) - assert_matches_type(IntelWhois, whois, path=["response"]) + assert_matches_type(Whois, whois, path=["response"]) @pytest.mark.skip() @parametrize @@ -44,7 +44,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" whois = response.parse() - assert_matches_type(IntelWhois, whois, path=["response"]) + assert_matches_type(Whois, whois, path=["response"]) @pytest.mark.skip() @parametrize @@ -56,7 +56,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" whois = response.parse() - assert_matches_type(IntelWhois, whois, path=["response"]) + assert_matches_type(Whois, whois, path=["response"]) assert cast(Any, response.is_closed) is True @@ -78,7 +78,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: whois = await async_client.intel.whois.get( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(IntelWhois, whois, path=["response"]) + assert_matches_type(Whois, whois, path=["response"]) @pytest.mark.skip() @parametrize @@ -87,7 +87,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) - account_id="023e105f4ecef8ad9ca31a8372d0c353", domain="string", ) - assert_matches_type(IntelWhois, whois, path=["response"]) + assert_matches_type(Whois, whois, path=["response"]) @pytest.mark.skip() @parametrize @@ -99,7 +99,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" whois = await response.parse() - assert_matches_type(IntelWhois, whois, path=["response"]) + assert_matches_type(Whois, whois, path=["response"]) @pytest.mark.skip() @parametrize @@ -111,7 +111,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" whois = await response.parse() - assert_matches_type(IntelWhois, whois, path=["response"]) + assert_matches_type(Whois, whois, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/kv/namespaces/test_keys.py b/tests/api_resources/kv/namespaces/test_keys.py index 69d2cf6aa3c..36b5cad82c6 100644 --- a/tests/api_resources/kv/namespaces/test_keys.py +++ b/tests/api_resources/kv/namespaces/test_keys.py @@ -10,7 +10,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.pagination import SyncCursorLimitPagination, AsyncCursorLimitPagination -from cloudflare.types.kv.namespaces import WorkersKVKey +from cloudflare.types.kv.namespaces import Key base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -25,7 +25,7 @@ def test_method_list(self, client: Cloudflare) -> None: "0f2ac74b498b48028cb68387c421e279", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncCursorLimitPagination[WorkersKVKey], key, path=["response"]) + assert_matches_type(SyncCursorLimitPagination[Key], key, path=["response"]) @pytest.mark.skip() @parametrize @@ -37,7 +37,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: limit=10, prefix="My-Prefix", ) - assert_matches_type(SyncCursorLimitPagination[WorkersKVKey], key, path=["response"]) + assert_matches_type(SyncCursorLimitPagination[Key], key, path=["response"]) @pytest.mark.skip() @parametrize @@ -50,7 +50,7 @@ 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" key = response.parse() - assert_matches_type(SyncCursorLimitPagination[WorkersKVKey], key, path=["response"]) + assert_matches_type(SyncCursorLimitPagination[Key], key, path=["response"]) @pytest.mark.skip() @parametrize @@ -63,7 +63,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" key = response.parse() - assert_matches_type(SyncCursorLimitPagination[WorkersKVKey], key, path=["response"]) + assert_matches_type(SyncCursorLimitPagination[Key], key, path=["response"]) assert cast(Any, response.is_closed) is True @@ -93,7 +93,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: "0f2ac74b498b48028cb68387c421e279", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncCursorLimitPagination[WorkersKVKey], key, path=["response"]) + assert_matches_type(AsyncCursorLimitPagination[Key], key, path=["response"]) @pytest.mark.skip() @parametrize @@ -105,7 +105,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) limit=10, prefix="My-Prefix", ) - assert_matches_type(AsyncCursorLimitPagination[WorkersKVKey], key, path=["response"]) + assert_matches_type(AsyncCursorLimitPagination[Key], key, path=["response"]) @pytest.mark.skip() @parametrize @@ -118,7 +118,7 @@ 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" key = await response.parse() - assert_matches_type(AsyncCursorLimitPagination[WorkersKVKey], key, path=["response"]) + assert_matches_type(AsyncCursorLimitPagination[Key], key, path=["response"]) @pytest.mark.skip() @parametrize @@ -131,7 +131,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" key = await response.parse() - assert_matches_type(AsyncCursorLimitPagination[WorkersKVKey], key, path=["response"]) + assert_matches_type(AsyncCursorLimitPagination[Key], key, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/kv/test_namespaces.py b/tests/api_resources/kv/test_namespaces.py index f6b99756006..c812c31ce73 100644 --- a/tests/api_resources/kv/test_namespaces.py +++ b/tests/api_resources/kv/test_namespaces.py @@ -10,7 +10,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.types.kv import ( - WorkersKVNamespace, + Namespace, ) from cloudflare.pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray from cloudflare.types.shared import UnnamedSchemaRef8d6a37a1e4190f86652802244d29525f @@ -28,7 +28,7 @@ def test_method_create(self, client: Cloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", title="My Own Namespace", ) - assert_matches_type(WorkersKVNamespace, namespace, path=["response"]) + assert_matches_type(Namespace, namespace, path=["response"]) @pytest.mark.skip() @parametrize @@ -41,7 +41,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" namespace = response.parse() - assert_matches_type(WorkersKVNamespace, namespace, path=["response"]) + assert_matches_type(Namespace, namespace, path=["response"]) @pytest.mark.skip() @parametrize @@ -54,7 +54,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" namespace = response.parse() - assert_matches_type(WorkersKVNamespace, namespace, path=["response"]) + assert_matches_type(Namespace, namespace, path=["response"]) assert cast(Any, response.is_closed) is True @@ -130,7 +130,7 @@ def test_method_list(self, client: Cloudflare) -> None: namespace = client.kv.namespaces.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncV4PagePaginationArray[WorkersKVNamespace], namespace, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[Namespace], namespace, path=["response"]) @pytest.mark.skip() @parametrize @@ -142,7 +142,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: page=1, per_page=5, ) - assert_matches_type(SyncV4PagePaginationArray[WorkersKVNamespace], namespace, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[Namespace], namespace, path=["response"]) @pytest.mark.skip() @parametrize @@ -154,7 +154,7 @@ 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" namespace = response.parse() - assert_matches_type(SyncV4PagePaginationArray[WorkersKVNamespace], namespace, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[Namespace], namespace, path=["response"]) @pytest.mark.skip() @parametrize @@ -166,7 +166,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" namespace = response.parse() - assert_matches_type(SyncV4PagePaginationArray[WorkersKVNamespace], namespace, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[Namespace], namespace, path=["response"]) assert cast(Any, response.is_closed) is True @@ -246,7 +246,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", title="My Own Namespace", ) - assert_matches_type(WorkersKVNamespace, namespace, path=["response"]) + assert_matches_type(Namespace, namespace, path=["response"]) @pytest.mark.skip() @parametrize @@ -259,7 +259,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" namespace = await response.parse() - assert_matches_type(WorkersKVNamespace, namespace, path=["response"]) + assert_matches_type(Namespace, namespace, path=["response"]) @pytest.mark.skip() @parametrize @@ -272,7 +272,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" namespace = await response.parse() - assert_matches_type(WorkersKVNamespace, namespace, path=["response"]) + assert_matches_type(Namespace, namespace, path=["response"]) assert cast(Any, response.is_closed) is True @@ -348,7 +348,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: namespace = await async_client.kv.namespaces.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncV4PagePaginationArray[WorkersKVNamespace], namespace, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[Namespace], namespace, path=["response"]) @pytest.mark.skip() @parametrize @@ -360,7 +360,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) page=1, per_page=5, ) - assert_matches_type(AsyncV4PagePaginationArray[WorkersKVNamespace], namespace, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[Namespace], namespace, path=["response"]) @pytest.mark.skip() @parametrize @@ -372,7 +372,7 @@ 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" namespace = await response.parse() - assert_matches_type(AsyncV4PagePaginationArray[WorkersKVNamespace], namespace, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[Namespace], namespace, path=["response"]) @pytest.mark.skip() @parametrize @@ -384,7 +384,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" namespace = await response.parse() - assert_matches_type(AsyncV4PagePaginationArray[WorkersKVNamespace], namespace, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[Namespace], namespace, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/load_balancers/test_previews.py b/tests/api_resources/load_balancers/test_previews.py index de8e142121c..695eca5a8e3 100644 --- a/tests/api_resources/load_balancers/test_previews.py +++ b/tests/api_resources/load_balancers/test_previews.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.user.load_balancers import LoadBalancingPreview +from cloudflare.types.user.load_balancers import Preview base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -24,7 +24,7 @@ def test_method_get(self, client: Cloudflare) -> None: "p1aba936b94213e5b8dca0c0dbf1f9cc", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(LoadBalancingPreview, preview, path=["response"]) + assert_matches_type(Preview, preview, path=["response"]) @pytest.mark.skip() @parametrize @@ -37,7 +37,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" preview = response.parse() - assert_matches_type(LoadBalancingPreview, preview, path=["response"]) + assert_matches_type(Preview, preview, path=["response"]) @pytest.mark.skip() @parametrize @@ -50,7 +50,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" preview = response.parse() - assert_matches_type(LoadBalancingPreview, preview, path=["response"]) + assert_matches_type(Preview, preview, path=["response"]) assert cast(Any, response.is_closed) is True @@ -80,7 +80,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: "p1aba936b94213e5b8dca0c0dbf1f9cc", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(LoadBalancingPreview, preview, path=["response"]) + assert_matches_type(Preview, preview, path=["response"]) @pytest.mark.skip() @parametrize @@ -93,7 +93,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" preview = await response.parse() - assert_matches_type(LoadBalancingPreview, preview, path=["response"]) + assert_matches_type(Preview, preview, path=["response"]) @pytest.mark.skip() @parametrize @@ -106,7 +106,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" preview = await response.parse() - assert_matches_type(LoadBalancingPreview, preview, path=["response"]) + assert_matches_type(Preview, preview, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/magic_network_monitoring/configs/test_full.py b/tests/api_resources/magic_network_monitoring/configs/test_full.py index 79aa9f510d5..27f997aab52 100644 --- a/tests/api_resources/magic_network_monitoring/configs/test_full.py +++ b/tests/api_resources/magic_network_monitoring/configs/test_full.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.magic_network_monitoring import MagicNetworkMonitoringConfig +from cloudflare.types.magic_network_monitoring import Configuration base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -23,7 +23,7 @@ def test_method_get(self, client: Cloudflare) -> None: full = client.magic_network_monitoring.configs.full.get( account_id="6f91088a406011ed95aed352566e8d4c", ) - assert_matches_type(MagicNetworkMonitoringConfig, full, path=["response"]) + assert_matches_type(Configuration, full, path=["response"]) @pytest.mark.skip() @parametrize @@ -35,7 +35,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" full = response.parse() - assert_matches_type(MagicNetworkMonitoringConfig, full, path=["response"]) + assert_matches_type(Configuration, full, path=["response"]) @pytest.mark.skip() @parametrize @@ -47,7 +47,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" full = response.parse() - assert_matches_type(MagicNetworkMonitoringConfig, full, path=["response"]) + assert_matches_type(Configuration, full, path=["response"]) assert cast(Any, response.is_closed) is True @@ -69,7 +69,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: full = await async_client.magic_network_monitoring.configs.full.get( account_id="6f91088a406011ed95aed352566e8d4c", ) - assert_matches_type(MagicNetworkMonitoringConfig, full, path=["response"]) + assert_matches_type(Configuration, full, path=["response"]) @pytest.mark.skip() @parametrize @@ -81,7 +81,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" full = await response.parse() - assert_matches_type(MagicNetworkMonitoringConfig, full, path=["response"]) + assert_matches_type(Configuration, full, path=["response"]) @pytest.mark.skip() @parametrize @@ -93,7 +93,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" full = await response.parse() - assert_matches_type(MagicNetworkMonitoringConfig, full, path=["response"]) + assert_matches_type(Configuration, full, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/magic_network_monitoring/rules/test_advertisements.py b/tests/api_resources/magic_network_monitoring/rules/test_advertisements.py index 41ff67b49b1..ab20ee89a26 100644 --- a/tests/api_resources/magic_network_monitoring/rules/test_advertisements.py +++ b/tests/api_resources/magic_network_monitoring/rules/test_advertisements.py @@ -9,9 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.magic_network_monitoring.rules import ( - MagicNetworkMonitoringRuleAdvertisable, -) +from cloudflare.types.magic_network_monitoring.rules import Advertisement base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -27,7 +25,7 @@ def test_method_edit(self, client: Cloudflare) -> None: account_id="6f91088a406011ed95aed352566e8d4c", body={}, ) - assert_matches_type(Optional[MagicNetworkMonitoringRuleAdvertisable], advertisement, path=["response"]) + assert_matches_type(Optional[Advertisement], advertisement, path=["response"]) @pytest.mark.skip() @parametrize @@ -41,7 +39,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" advertisement = response.parse() - assert_matches_type(Optional[MagicNetworkMonitoringRuleAdvertisable], advertisement, path=["response"]) + assert_matches_type(Optional[Advertisement], advertisement, path=["response"]) @pytest.mark.skip() @parametrize @@ -55,7 +53,7 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" advertisement = response.parse() - assert_matches_type(Optional[MagicNetworkMonitoringRuleAdvertisable], advertisement, path=["response"]) + assert_matches_type(Optional[Advertisement], advertisement, path=["response"]) assert cast(Any, response.is_closed) is True @@ -88,7 +86,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: account_id="6f91088a406011ed95aed352566e8d4c", body={}, ) - assert_matches_type(Optional[MagicNetworkMonitoringRuleAdvertisable], advertisement, path=["response"]) + assert_matches_type(Optional[Advertisement], advertisement, path=["response"]) @pytest.mark.skip() @parametrize @@ -102,7 +100,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" advertisement = await response.parse() - assert_matches_type(Optional[MagicNetworkMonitoringRuleAdvertisable], advertisement, path=["response"]) + assert_matches_type(Optional[Advertisement], advertisement, path=["response"]) @pytest.mark.skip() @parametrize @@ -116,7 +114,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" advertisement = await response.parse() - assert_matches_type(Optional[MagicNetworkMonitoringRuleAdvertisable], advertisement, path=["response"]) + assert_matches_type(Optional[Advertisement], advertisement, 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 ef7f9d58f28..b576e51b7e6 100644 --- a/tests/api_resources/magic_network_monitoring/test_configs.py +++ b/tests/api_resources/magic_network_monitoring/test_configs.py @@ -10,7 +10,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.types.magic_network_monitoring import ( - MagicNetworkMonitoringConfig, + Configuration, ) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -26,7 +26,7 @@ def test_method_create(self, client: Cloudflare) -> None: account_id="6f91088a406011ed95aed352566e8d4c", body={}, ) - assert_matches_type(MagicNetworkMonitoringConfig, config, path=["response"]) + assert_matches_type(Configuration, config, path=["response"]) @pytest.mark.skip() @parametrize @@ -39,7 +39,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = response.parse() - assert_matches_type(MagicNetworkMonitoringConfig, config, path=["response"]) + assert_matches_type(Configuration, config, path=["response"]) @pytest.mark.skip() @parametrize @@ -52,7 +52,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = response.parse() - assert_matches_type(MagicNetworkMonitoringConfig, config, path=["response"]) + assert_matches_type(Configuration, config, path=["response"]) assert cast(Any, response.is_closed) is True @@ -72,7 +72,7 @@ def test_method_update(self, client: Cloudflare) -> None: account_id="6f91088a406011ed95aed352566e8d4c", body={}, ) - assert_matches_type(MagicNetworkMonitoringConfig, config, path=["response"]) + assert_matches_type(Configuration, config, path=["response"]) @pytest.mark.skip() @parametrize @@ -85,7 +85,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = response.parse() - assert_matches_type(MagicNetworkMonitoringConfig, config, path=["response"]) + assert_matches_type(Configuration, config, path=["response"]) @pytest.mark.skip() @parametrize @@ -98,7 +98,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = response.parse() - assert_matches_type(MagicNetworkMonitoringConfig, config, path=["response"]) + assert_matches_type(Configuration, config, path=["response"]) assert cast(Any, response.is_closed) is True @@ -118,7 +118,7 @@ def test_method_delete(self, client: Cloudflare) -> None: account_id="6f91088a406011ed95aed352566e8d4c", body={}, ) - assert_matches_type(MagicNetworkMonitoringConfig, config, path=["response"]) + assert_matches_type(Configuration, config, path=["response"]) @pytest.mark.skip() @parametrize @@ -131,7 +131,7 @@ 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" config = response.parse() - assert_matches_type(MagicNetworkMonitoringConfig, config, path=["response"]) + assert_matches_type(Configuration, config, path=["response"]) @pytest.mark.skip() @parametrize @@ -144,7 +144,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = response.parse() - assert_matches_type(MagicNetworkMonitoringConfig, config, path=["response"]) + assert_matches_type(Configuration, config, path=["response"]) assert cast(Any, response.is_closed) is True @@ -164,7 +164,7 @@ def test_method_edit(self, client: Cloudflare) -> None: account_id="6f91088a406011ed95aed352566e8d4c", body={}, ) - assert_matches_type(MagicNetworkMonitoringConfig, config, path=["response"]) + assert_matches_type(Configuration, config, path=["response"]) @pytest.mark.skip() @parametrize @@ -177,7 +177,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = response.parse() - assert_matches_type(MagicNetworkMonitoringConfig, config, path=["response"]) + assert_matches_type(Configuration, config, path=["response"]) @pytest.mark.skip() @parametrize @@ -190,7 +190,7 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = response.parse() - assert_matches_type(MagicNetworkMonitoringConfig, config, path=["response"]) + assert_matches_type(Configuration, config, path=["response"]) assert cast(Any, response.is_closed) is True @@ -209,7 +209,7 @@ def test_method_get(self, client: Cloudflare) -> None: config = client.magic_network_monitoring.configs.get( account_id="6f91088a406011ed95aed352566e8d4c", ) - assert_matches_type(MagicNetworkMonitoringConfig, config, path=["response"]) + assert_matches_type(Configuration, config, path=["response"]) @pytest.mark.skip() @parametrize @@ -221,7 +221,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = response.parse() - assert_matches_type(MagicNetworkMonitoringConfig, config, path=["response"]) + assert_matches_type(Configuration, config, path=["response"]) @pytest.mark.skip() @parametrize @@ -233,7 +233,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = response.parse() - assert_matches_type(MagicNetworkMonitoringConfig, config, path=["response"]) + assert_matches_type(Configuration, config, path=["response"]) assert cast(Any, response.is_closed) is True @@ -256,7 +256,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: account_id="6f91088a406011ed95aed352566e8d4c", body={}, ) - assert_matches_type(MagicNetworkMonitoringConfig, config, path=["response"]) + assert_matches_type(Configuration, config, path=["response"]) @pytest.mark.skip() @parametrize @@ -269,7 +269,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = await response.parse() - assert_matches_type(MagicNetworkMonitoringConfig, config, path=["response"]) + assert_matches_type(Configuration, config, path=["response"]) @pytest.mark.skip() @parametrize @@ -282,7 +282,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = await response.parse() - assert_matches_type(MagicNetworkMonitoringConfig, config, path=["response"]) + assert_matches_type(Configuration, config, path=["response"]) assert cast(Any, response.is_closed) is True @@ -302,7 +302,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: account_id="6f91088a406011ed95aed352566e8d4c", body={}, ) - assert_matches_type(MagicNetworkMonitoringConfig, config, path=["response"]) + assert_matches_type(Configuration, config, path=["response"]) @pytest.mark.skip() @parametrize @@ -315,7 +315,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = await response.parse() - assert_matches_type(MagicNetworkMonitoringConfig, config, path=["response"]) + assert_matches_type(Configuration, config, path=["response"]) @pytest.mark.skip() @parametrize @@ -328,7 +328,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = await response.parse() - assert_matches_type(MagicNetworkMonitoringConfig, config, path=["response"]) + assert_matches_type(Configuration, config, path=["response"]) assert cast(Any, response.is_closed) is True @@ -348,7 +348,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: account_id="6f91088a406011ed95aed352566e8d4c", body={}, ) - assert_matches_type(MagicNetworkMonitoringConfig, config, path=["response"]) + assert_matches_type(Configuration, config, path=["response"]) @pytest.mark.skip() @parametrize @@ -361,7 +361,7 @@ 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" config = await response.parse() - assert_matches_type(MagicNetworkMonitoringConfig, config, path=["response"]) + assert_matches_type(Configuration, config, path=["response"]) @pytest.mark.skip() @parametrize @@ -374,7 +374,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = await response.parse() - assert_matches_type(MagicNetworkMonitoringConfig, config, path=["response"]) + assert_matches_type(Configuration, config, path=["response"]) assert cast(Any, response.is_closed) is True @@ -394,7 +394,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: account_id="6f91088a406011ed95aed352566e8d4c", body={}, ) - assert_matches_type(MagicNetworkMonitoringConfig, config, path=["response"]) + assert_matches_type(Configuration, config, path=["response"]) @pytest.mark.skip() @parametrize @@ -407,7 +407,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = await response.parse() - assert_matches_type(MagicNetworkMonitoringConfig, config, path=["response"]) + assert_matches_type(Configuration, config, path=["response"]) @pytest.mark.skip() @parametrize @@ -420,7 +420,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = await response.parse() - assert_matches_type(MagicNetworkMonitoringConfig, config, path=["response"]) + assert_matches_type(Configuration, config, path=["response"]) assert cast(Any, response.is_closed) is True @@ -439,7 +439,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: config = await async_client.magic_network_monitoring.configs.get( account_id="6f91088a406011ed95aed352566e8d4c", ) - assert_matches_type(MagicNetworkMonitoringConfig, config, path=["response"]) + assert_matches_type(Configuration, config, path=["response"]) @pytest.mark.skip() @parametrize @@ -451,7 +451,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = await response.parse() - assert_matches_type(MagicNetworkMonitoringConfig, config, path=["response"]) + assert_matches_type(Configuration, config, path=["response"]) @pytest.mark.skip() @parametrize @@ -463,7 +463,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = await response.parse() - assert_matches_type(MagicNetworkMonitoringConfig, config, path=["response"]) + assert_matches_type(Configuration, config, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/origin_tls_client_auth/hostnames/test_certificates.py b/tests/api_resources/origin_tls_client_auth/hostnames/test_certificates.py index 11c2ca11fbd..49bebd3d608 100644 --- a/tests/api_resources/origin_tls_client_auth/hostnames/test_certificates.py +++ b/tests/api_resources/origin_tls_client_auth/hostnames/test_certificates.py @@ -10,9 +10,9 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.pagination import SyncSinglePage, AsyncSinglePage -from cloudflare.types.origin_tls_client_auth import OriginTLSClientCertificateID +from cloudflare.types.origin_tls_client_auth import AuthenticatedOriginPull from cloudflare.types.origin_tls_client_auth.hostnames import ( - OriginTLSClientCertificate, + Certificate, ) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -29,7 +29,7 @@ def test_method_create(self, client: Cloudflare) -> None: certificate="-----BEGIN CERTIFICATE-----\nMIIDtTCCAp2gAwIBAgIJAMHAwfXZ5/PWMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV\nBAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX\naWRnaXRzIFB0eSBMdGQwHhcNMTYwODI0MTY0MzAxWhcNMTYxMTIyMTY0MzAxWjBF\nMQswCQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50\nZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\nCgKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmGdtcGbg/1\nCGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKnabIRuGvB\nKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpidtnKX/a+5\n0GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+pyFxIXjbEI\ndZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pEewooaeO2\nizNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABo4GnMIGkMB0GA1UdDgQWBBT/LbE4\n9rWf288N6sJA5BRb6FJIGDB1BgNVHSMEbjBsgBT/LbE49rWf288N6sJA5BRb6FJI\nGKFJpEcwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNV\nBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAMHAwfXZ5/PWMAwGA1UdEwQF\nMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAHHFwl0tH0quUYZYO0dZYt4R7SJ0pCm2\n2satiyzHl4OnXcHDpekAo7/a09c6Lz6AU83cKy/+x3/djYHXWba7HpEu0dR3ugQP\nMlr4zrhd9xKZ0KZKiYmtJH+ak4OM4L3FbT0owUZPyjLSlhMtJVcoRp5CJsjAMBUG\nSvD8RX+T01wzox/Qb+lnnNnOlaWpqu8eoOenybxKp1a9ULzIVvN/LAcc+14vioFq\n2swRWtmocBAs8QR9n4uvbpiYvS8eYueDCWMM4fvFfBhaDZ3N9IbtySh3SpFdQDhw\nYbjM2rxXiyLGxB4Bol7QTv4zHif7Zt89FReT/NBy4rzaskDJY5L6xmY=\n-----END CERTIFICATE-----\n", private_key="-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmG\ndtcGbg/1CGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKn\nabIRuGvBKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpid\ntnKX/a+50GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+py\nFxIXjbEIdZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pE\newooaeO2izNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABAoIBACbhTYXBZYKmYPCb\nHBR1IBlCQA2nLGf0qRuJNJZg5iEzXows/6tc8YymZkQE7nolapWsQ+upk2y5Xdp/\naxiuprIs9JzkYK8Ox0r+dlwCG1kSW+UAbX0bQ/qUqlsTvU6muVuMP8vZYHxJ3wmb\n+ufRBKztPTQ/rYWaYQcgC0RWI20HTFBMxlTAyNxYNWzX7RKFkGVVyB9RsAtmcc8g\n+j4OdosbfNoJPS0HeIfNpAznDfHKdxDk2Yc1tV6RHBrC1ynyLE9+TaflIAdo2MVv\nKLMLq51GqYKtgJFIlBRPQqKoyXdz3fGvXrTkf/WY9QNq0J1Vk5ERePZ54mN8iZB7\n9lwy/AkCgYEA6FXzosxswaJ2wQLeoYc7ceaweX/SwTvxHgXzRyJIIT0eJWgx13Wo\n/WA3Iziimsjf6qE+SI/8laxPp2A86VMaIt3Z3mJN/CqSVGw8LK2AQst+OwdPyDMu\niacE8lj/IFGC8mwNUAb9CzGU3JpU4PxxGFjS/eMtGeRXCWkK4NE+G08CgYEA1Kp9\nN2JrVlqUz+gAX+LPmE9OEMAS9WQSQsfCHGogIFDGGcNf7+uwBM7GAaSJIP01zcoe\nVAgWdzXCv3FLhsaZoJ6RyLOLay5phbu1iaTr4UNYm5WtYTzMzqh8l1+MFFDl9xDB\nvULuCIIrglM5MeS/qnSg1uMoH2oVPj9TVst/ir8CgYEAxrI7Ws9Zc4Bt70N1As+U\nlySjaEVZCMkqvHJ6TCuVZFfQoE0r0whdLdRLU2PsLFP+q7qaeZQqgBaNSKeVcDYR\n9B+nY/jOmQoPewPVsp/vQTCnE/R81spu0mp0YI6cIheT1Z9zAy322svcc43JaWB7\nmEbeqyLOP4Z4qSOcmghZBSECgYACvR9Xs0DGn+wCsW4vze/2ei77MD4OQvepPIFX\ndFZtlBy5ADcgE9z0cuVB6CiL8DbdK5kwY9pGNr8HUCI03iHkW6Zs+0L0YmihfEVe\nPG19PSzK9CaDdhD9KFZSbLyVFmWfxOt50H7YRTTiPMgjyFpfi5j2q348yVT0tEQS\nfhRqaQKBgAcWPokmJ7EbYQGeMbS7HC8eWO/RyamlnSffdCdSc7ue3zdVJxpAkQ8W\nqu80pEIF6raIQfAf8MXiiZ7auFOSnHQTXUbhCpvDLKi0Mwq3G8Pl07l+2s6dQG6T\nlv6XTQaMyf6n1yjzL+fzDrH3qXMxHMO/b13EePXpDMpY7HQpoLDi\n-----END RSA PRIVATE KEY-----\n", ) - assert_matches_type(OriginTLSClientCertificate, certificate, path=["response"]) + assert_matches_type(Certificate, certificate, path=["response"]) @pytest.mark.skip() @parametrize @@ -43,7 +43,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" certificate = response.parse() - assert_matches_type(OriginTLSClientCertificate, certificate, path=["response"]) + assert_matches_type(Certificate, certificate, path=["response"]) @pytest.mark.skip() @parametrize @@ -57,7 +57,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" certificate = response.parse() - assert_matches_type(OriginTLSClientCertificate, certificate, path=["response"]) + assert_matches_type(Certificate, certificate, path=["response"]) assert cast(Any, response.is_closed) is True @@ -77,7 +77,7 @@ def test_method_list(self, client: Cloudflare) -> None: certificate = client.origin_tls_client_auth.hostnames.certificates.list( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncSinglePage[OriginTLSClientCertificateID], certificate, path=["response"]) + assert_matches_type(SyncSinglePage[AuthenticatedOriginPull], certificate, path=["response"]) @pytest.mark.skip() @parametrize @@ -89,7 +89,7 @@ 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" certificate = response.parse() - assert_matches_type(SyncSinglePage[OriginTLSClientCertificateID], certificate, path=["response"]) + assert_matches_type(SyncSinglePage[AuthenticatedOriginPull], certificate, path=["response"]) @pytest.mark.skip() @parametrize @@ -101,7 +101,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" certificate = response.parse() - assert_matches_type(SyncSinglePage[OriginTLSClientCertificateID], certificate, path=["response"]) + assert_matches_type(SyncSinglePage[AuthenticatedOriginPull], certificate, path=["response"]) assert cast(Any, response.is_closed) is True @@ -121,7 +121,7 @@ def test_method_delete(self, client: Cloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", body={}, ) - assert_matches_type(OriginTLSClientCertificate, certificate, path=["response"]) + assert_matches_type(Certificate, certificate, path=["response"]) @pytest.mark.skip() @parametrize @@ -135,7 +135,7 @@ 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" certificate = response.parse() - assert_matches_type(OriginTLSClientCertificate, certificate, path=["response"]) + assert_matches_type(Certificate, certificate, path=["response"]) @pytest.mark.skip() @parametrize @@ -149,7 +149,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" certificate = response.parse() - assert_matches_type(OriginTLSClientCertificate, certificate, path=["response"]) + assert_matches_type(Certificate, certificate, path=["response"]) assert cast(Any, response.is_closed) is True @@ -177,7 +177,7 @@ def test_method_get(self, client: Cloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(OriginTLSClientCertificate, certificate, path=["response"]) + assert_matches_type(Certificate, certificate, path=["response"]) @pytest.mark.skip() @parametrize @@ -190,7 +190,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" certificate = response.parse() - assert_matches_type(OriginTLSClientCertificate, certificate, path=["response"]) + assert_matches_type(Certificate, certificate, path=["response"]) @pytest.mark.skip() @parametrize @@ -203,7 +203,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" certificate = response.parse() - assert_matches_type(OriginTLSClientCertificate, certificate, path=["response"]) + assert_matches_type(Certificate, certificate, path=["response"]) assert cast(Any, response.is_closed) is True @@ -234,7 +234,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: certificate="-----BEGIN CERTIFICATE-----\nMIIDtTCCAp2gAwIBAgIJAMHAwfXZ5/PWMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV\nBAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX\naWRnaXRzIFB0eSBMdGQwHhcNMTYwODI0MTY0MzAxWhcNMTYxMTIyMTY0MzAxWjBF\nMQswCQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50\nZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\nCgKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmGdtcGbg/1\nCGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKnabIRuGvB\nKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpidtnKX/a+5\n0GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+pyFxIXjbEI\ndZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pEewooaeO2\nizNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABo4GnMIGkMB0GA1UdDgQWBBT/LbE4\n9rWf288N6sJA5BRb6FJIGDB1BgNVHSMEbjBsgBT/LbE49rWf288N6sJA5BRb6FJI\nGKFJpEcwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNV\nBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAMHAwfXZ5/PWMAwGA1UdEwQF\nMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAHHFwl0tH0quUYZYO0dZYt4R7SJ0pCm2\n2satiyzHl4OnXcHDpekAo7/a09c6Lz6AU83cKy/+x3/djYHXWba7HpEu0dR3ugQP\nMlr4zrhd9xKZ0KZKiYmtJH+ak4OM4L3FbT0owUZPyjLSlhMtJVcoRp5CJsjAMBUG\nSvD8RX+T01wzox/Qb+lnnNnOlaWpqu8eoOenybxKp1a9ULzIVvN/LAcc+14vioFq\n2swRWtmocBAs8QR9n4uvbpiYvS8eYueDCWMM4fvFfBhaDZ3N9IbtySh3SpFdQDhw\nYbjM2rxXiyLGxB4Bol7QTv4zHif7Zt89FReT/NBy4rzaskDJY5L6xmY=\n-----END CERTIFICATE-----\n", private_key="-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmG\ndtcGbg/1CGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKn\nabIRuGvBKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpid\ntnKX/a+50GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+py\nFxIXjbEIdZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pE\newooaeO2izNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABAoIBACbhTYXBZYKmYPCb\nHBR1IBlCQA2nLGf0qRuJNJZg5iEzXows/6tc8YymZkQE7nolapWsQ+upk2y5Xdp/\naxiuprIs9JzkYK8Ox0r+dlwCG1kSW+UAbX0bQ/qUqlsTvU6muVuMP8vZYHxJ3wmb\n+ufRBKztPTQ/rYWaYQcgC0RWI20HTFBMxlTAyNxYNWzX7RKFkGVVyB9RsAtmcc8g\n+j4OdosbfNoJPS0HeIfNpAznDfHKdxDk2Yc1tV6RHBrC1ynyLE9+TaflIAdo2MVv\nKLMLq51GqYKtgJFIlBRPQqKoyXdz3fGvXrTkf/WY9QNq0J1Vk5ERePZ54mN8iZB7\n9lwy/AkCgYEA6FXzosxswaJ2wQLeoYc7ceaweX/SwTvxHgXzRyJIIT0eJWgx13Wo\n/WA3Iziimsjf6qE+SI/8laxPp2A86VMaIt3Z3mJN/CqSVGw8LK2AQst+OwdPyDMu\niacE8lj/IFGC8mwNUAb9CzGU3JpU4PxxGFjS/eMtGeRXCWkK4NE+G08CgYEA1Kp9\nN2JrVlqUz+gAX+LPmE9OEMAS9WQSQsfCHGogIFDGGcNf7+uwBM7GAaSJIP01zcoe\nVAgWdzXCv3FLhsaZoJ6RyLOLay5phbu1iaTr4UNYm5WtYTzMzqh8l1+MFFDl9xDB\nvULuCIIrglM5MeS/qnSg1uMoH2oVPj9TVst/ir8CgYEAxrI7Ws9Zc4Bt70N1As+U\nlySjaEVZCMkqvHJ6TCuVZFfQoE0r0whdLdRLU2PsLFP+q7qaeZQqgBaNSKeVcDYR\n9B+nY/jOmQoPewPVsp/vQTCnE/R81spu0mp0YI6cIheT1Z9zAy322svcc43JaWB7\nmEbeqyLOP4Z4qSOcmghZBSECgYACvR9Xs0DGn+wCsW4vze/2ei77MD4OQvepPIFX\ndFZtlBy5ADcgE9z0cuVB6CiL8DbdK5kwY9pGNr8HUCI03iHkW6Zs+0L0YmihfEVe\nPG19PSzK9CaDdhD9KFZSbLyVFmWfxOt50H7YRTTiPMgjyFpfi5j2q348yVT0tEQS\nfhRqaQKBgAcWPokmJ7EbYQGeMbS7HC8eWO/RyamlnSffdCdSc7ue3zdVJxpAkQ8W\nqu80pEIF6raIQfAf8MXiiZ7auFOSnHQTXUbhCpvDLKi0Mwq3G8Pl07l+2s6dQG6T\nlv6XTQaMyf6n1yjzL+fzDrH3qXMxHMO/b13EePXpDMpY7HQpoLDi\n-----END RSA PRIVATE KEY-----\n", ) - assert_matches_type(OriginTLSClientCertificate, certificate, path=["response"]) + assert_matches_type(Certificate, certificate, path=["response"]) @pytest.mark.skip() @parametrize @@ -248,7 +248,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" certificate = await response.parse() - assert_matches_type(OriginTLSClientCertificate, certificate, path=["response"]) + assert_matches_type(Certificate, certificate, path=["response"]) @pytest.mark.skip() @parametrize @@ -262,7 +262,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" certificate = await response.parse() - assert_matches_type(OriginTLSClientCertificate, certificate, path=["response"]) + assert_matches_type(Certificate, certificate, path=["response"]) assert cast(Any, response.is_closed) is True @@ -282,7 +282,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: certificate = await async_client.origin_tls_client_auth.hostnames.certificates.list( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncSinglePage[OriginTLSClientCertificateID], certificate, path=["response"]) + assert_matches_type(AsyncSinglePage[AuthenticatedOriginPull], certificate, path=["response"]) @pytest.mark.skip() @parametrize @@ -294,7 +294,7 @@ 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" certificate = await response.parse() - assert_matches_type(AsyncSinglePage[OriginTLSClientCertificateID], certificate, path=["response"]) + assert_matches_type(AsyncSinglePage[AuthenticatedOriginPull], certificate, path=["response"]) @pytest.mark.skip() @parametrize @@ -306,7 +306,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" certificate = await response.parse() - assert_matches_type(AsyncSinglePage[OriginTLSClientCertificateID], certificate, path=["response"]) + assert_matches_type(AsyncSinglePage[AuthenticatedOriginPull], certificate, path=["response"]) assert cast(Any, response.is_closed) is True @@ -326,7 +326,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", body={}, ) - assert_matches_type(OriginTLSClientCertificate, certificate, path=["response"]) + assert_matches_type(Certificate, certificate, path=["response"]) @pytest.mark.skip() @parametrize @@ -340,7 +340,7 @@ 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" certificate = await response.parse() - assert_matches_type(OriginTLSClientCertificate, certificate, path=["response"]) + assert_matches_type(Certificate, certificate, path=["response"]) @pytest.mark.skip() @parametrize @@ -354,7 +354,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" certificate = await response.parse() - assert_matches_type(OriginTLSClientCertificate, certificate, path=["response"]) + assert_matches_type(Certificate, certificate, path=["response"]) assert cast(Any, response.is_closed) is True @@ -382,7 +382,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(OriginTLSClientCertificate, certificate, path=["response"]) + assert_matches_type(Certificate, certificate, path=["response"]) @pytest.mark.skip() @parametrize @@ -395,7 +395,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" certificate = await response.parse() - assert_matches_type(OriginTLSClientCertificate, certificate, path=["response"]) + assert_matches_type(Certificate, certificate, path=["response"]) @pytest.mark.skip() @parametrize @@ -408,7 +408,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" certificate = await response.parse() - assert_matches_type(OriginTLSClientCertificate, certificate, path=["response"]) + assert_matches_type(Certificate, certificate, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/origin_tls_client_auth/test_hostnames.py b/tests/api_resources/origin_tls_client_auth/test_hostnames.py index 1cbcd2e6440..6947bbad7ac 100644 --- a/tests/api_resources/origin_tls_client_auth/test_hostnames.py +++ b/tests/api_resources/origin_tls_client_auth/test_hostnames.py @@ -9,10 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.origin_tls_client_auth import ( - HostnameUpdateResponse, - OriginTLSClientCertificateID, -) +from cloudflare.types.origin_tls_client_auth import ID, HostnameUpdateResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -73,7 +70,7 @@ def test_method_get(self, client: Cloudflare) -> None: "app.example.com", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(OriginTLSClientCertificateID, hostname, path=["response"]) + assert_matches_type(ID, hostname, path=["response"]) @pytest.mark.skip() @parametrize @@ -86,7 +83,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" hostname = response.parse() - assert_matches_type(OriginTLSClientCertificateID, hostname, path=["response"]) + assert_matches_type(ID, hostname, path=["response"]) @pytest.mark.skip() @parametrize @@ -99,7 +96,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" hostname = response.parse() - assert_matches_type(OriginTLSClientCertificateID, hostname, path=["response"]) + assert_matches_type(ID, hostname, path=["response"]) assert cast(Any, response.is_closed) is True @@ -175,7 +172,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: "app.example.com", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(OriginTLSClientCertificateID, hostname, path=["response"]) + assert_matches_type(ID, hostname, path=["response"]) @pytest.mark.skip() @parametrize @@ -188,7 +185,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" hostname = await response.parse() - assert_matches_type(OriginTLSClientCertificateID, hostname, path=["response"]) + assert_matches_type(ID, hostname, path=["response"]) @pytest.mark.skip() @parametrize @@ -201,7 +198,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" hostname = await response.parse() - assert_matches_type(OriginTLSClientCertificateID, hostname, path=["response"]) + assert_matches_type(ID, hostname, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/page_shield/test_connections.py b/tests/api_resources/page_shield/test_connections.py index bf65f2d82ac..77edfc01969 100644 --- a/tests/api_resources/page_shield/test_connections.py +++ b/tests/api_resources/page_shield/test_connections.py @@ -10,7 +10,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.pagination import SyncSinglePage, AsyncSinglePage -from cloudflare.types.page_shield import PageShieldConnection +from cloudflare.types.page_shield import Connection base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -24,7 +24,7 @@ def test_method_list(self, client: Cloudflare) -> None: connection = client.page_shield.connections.list( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncSinglePage[PageShieldConnection], connection, path=["response"]) + assert_matches_type(SyncSinglePage[Connection], connection, path=["response"]) @pytest.mark.skip() @parametrize @@ -44,7 +44,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: status="active,inactive", urls="blog.cloudflare.com,www.example", ) - assert_matches_type(SyncSinglePage[PageShieldConnection], connection, path=["response"]) + assert_matches_type(SyncSinglePage[Connection], connection, path=["response"]) @pytest.mark.skip() @parametrize @@ -56,7 +56,7 @@ 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" connection = response.parse() - assert_matches_type(SyncSinglePage[PageShieldConnection], connection, path=["response"]) + assert_matches_type(SyncSinglePage[Connection], connection, path=["response"]) @pytest.mark.skip() @parametrize @@ -68,7 +68,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" connection = response.parse() - assert_matches_type(SyncSinglePage[PageShieldConnection], connection, path=["response"]) + assert_matches_type(SyncSinglePage[Connection], connection, path=["response"]) assert cast(Any, response.is_closed) is True @@ -87,7 +87,7 @@ def test_method_get(self, client: Cloudflare) -> None: "c9ef84a6bf5e47138c75d95e2f933e8f", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(PageShieldConnection, connection, path=["response"]) + assert_matches_type(Connection, connection, path=["response"]) @pytest.mark.skip() @parametrize @@ -100,7 +100,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" connection = response.parse() - assert_matches_type(PageShieldConnection, connection, path=["response"]) + assert_matches_type(Connection, connection, path=["response"]) @pytest.mark.skip() @parametrize @@ -113,7 +113,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" connection = response.parse() - assert_matches_type(PageShieldConnection, connection, path=["response"]) + assert_matches_type(Connection, connection, path=["response"]) assert cast(Any, response.is_closed) is True @@ -142,7 +142,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: connection = await async_client.page_shield.connections.list( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncSinglePage[PageShieldConnection], connection, path=["response"]) + assert_matches_type(AsyncSinglePage[Connection], connection, path=["response"]) @pytest.mark.skip() @parametrize @@ -162,7 +162,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) status="active,inactive", urls="blog.cloudflare.com,www.example", ) - assert_matches_type(AsyncSinglePage[PageShieldConnection], connection, path=["response"]) + assert_matches_type(AsyncSinglePage[Connection], connection, path=["response"]) @pytest.mark.skip() @parametrize @@ -174,7 +174,7 @@ 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" connection = await response.parse() - assert_matches_type(AsyncSinglePage[PageShieldConnection], connection, path=["response"]) + assert_matches_type(AsyncSinglePage[Connection], connection, path=["response"]) @pytest.mark.skip() @parametrize @@ -186,7 +186,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" connection = await response.parse() - assert_matches_type(AsyncSinglePage[PageShieldConnection], connection, path=["response"]) + assert_matches_type(AsyncSinglePage[Connection], connection, path=["response"]) assert cast(Any, response.is_closed) is True @@ -205,7 +205,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: "c9ef84a6bf5e47138c75d95e2f933e8f", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(PageShieldConnection, connection, path=["response"]) + assert_matches_type(Connection, connection, path=["response"]) @pytest.mark.skip() @parametrize @@ -218,7 +218,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" connection = await response.parse() - assert_matches_type(PageShieldConnection, connection, path=["response"]) + assert_matches_type(Connection, connection, path=["response"]) @pytest.mark.skip() @parametrize @@ -231,7 +231,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" connection = await response.parse() - assert_matches_type(PageShieldConnection, connection, path=["response"]) + assert_matches_type(Connection, connection, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/page_shield/test_policies.py b/tests/api_resources/page_shield/test_policies.py index 6a3a5dc7153..81f6297c0e0 100644 --- a/tests/api_resources/page_shield/test_policies.py +++ b/tests/api_resources/page_shield/test_policies.py @@ -10,7 +10,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.pagination import SyncSinglePage, AsyncSinglePage -from cloudflare.types.page_shield import PageShieldPolicy +from cloudflare.types.page_shield import Policy base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -24,7 +24,7 @@ def test_method_create(self, client: Cloudflare) -> None: policy = client.page_shield.policies.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(PageShieldPolicy, policy, path=["response"]) + assert_matches_type(Policy, policy, path=["response"]) @pytest.mark.skip() @parametrize @@ -37,7 +37,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: expression='ends_with(http.request.uri.path, "/checkout")', value="script-src 'none';", ) - assert_matches_type(PageShieldPolicy, policy, path=["response"]) + assert_matches_type(Policy, policy, path=["response"]) @pytest.mark.skip() @parametrize @@ -49,7 +49,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = response.parse() - assert_matches_type(PageShieldPolicy, policy, path=["response"]) + assert_matches_type(Policy, policy, path=["response"]) @pytest.mark.skip() @parametrize @@ -61,7 +61,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = response.parse() - assert_matches_type(PageShieldPolicy, policy, path=["response"]) + assert_matches_type(Policy, policy, path=["response"]) assert cast(Any, response.is_closed) is True @@ -80,7 +80,7 @@ def test_method_update(self, client: Cloudflare) -> None: "c9ef84a6bf5e47138c75d95e2f933e8f", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(PageShieldPolicy, policy, path=["response"]) + assert_matches_type(Policy, policy, path=["response"]) @pytest.mark.skip() @parametrize @@ -94,7 +94,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: expression='ends_with(http.request.uri.path, "/checkout")', value="script-src 'none';", ) - assert_matches_type(PageShieldPolicy, policy, path=["response"]) + assert_matches_type(Policy, policy, path=["response"]) @pytest.mark.skip() @parametrize @@ -107,7 +107,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = response.parse() - assert_matches_type(PageShieldPolicy, policy, path=["response"]) + assert_matches_type(Policy, policy, path=["response"]) @pytest.mark.skip() @parametrize @@ -120,7 +120,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = response.parse() - assert_matches_type(PageShieldPolicy, policy, path=["response"]) + assert_matches_type(Policy, policy, path=["response"]) assert cast(Any, response.is_closed) is True @@ -145,7 +145,7 @@ def test_method_list(self, client: Cloudflare) -> None: policy = client.page_shield.policies.list( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncSinglePage[PageShieldPolicy], policy, path=["response"]) + assert_matches_type(SyncSinglePage[Policy], policy, path=["response"]) @pytest.mark.skip() @parametrize @@ -157,7 +157,7 @@ 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" policy = response.parse() - assert_matches_type(SyncSinglePage[PageShieldPolicy], policy, path=["response"]) + assert_matches_type(SyncSinglePage[Policy], policy, path=["response"]) @pytest.mark.skip() @parametrize @@ -169,7 +169,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = response.parse() - assert_matches_type(SyncSinglePage[PageShieldPolicy], policy, path=["response"]) + assert_matches_type(SyncSinglePage[Policy], policy, path=["response"]) assert cast(Any, response.is_closed) is True @@ -240,7 +240,7 @@ def test_method_get(self, client: Cloudflare) -> None: "c9ef84a6bf5e47138c75d95e2f933e8f", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(PageShieldPolicy, policy, path=["response"]) + assert_matches_type(Policy, policy, path=["response"]) @pytest.mark.skip() @parametrize @@ -253,7 +253,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = response.parse() - assert_matches_type(PageShieldPolicy, policy, path=["response"]) + assert_matches_type(Policy, policy, path=["response"]) @pytest.mark.skip() @parametrize @@ -266,7 +266,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = response.parse() - assert_matches_type(PageShieldPolicy, policy, path=["response"]) + assert_matches_type(Policy, policy, path=["response"]) assert cast(Any, response.is_closed) is True @@ -295,7 +295,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: policy = await async_client.page_shield.policies.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(PageShieldPolicy, policy, path=["response"]) + assert_matches_type(Policy, policy, path=["response"]) @pytest.mark.skip() @parametrize @@ -308,7 +308,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare expression='ends_with(http.request.uri.path, "/checkout")', value="script-src 'none';", ) - assert_matches_type(PageShieldPolicy, policy, path=["response"]) + assert_matches_type(Policy, policy, path=["response"]) @pytest.mark.skip() @parametrize @@ -320,7 +320,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = await response.parse() - assert_matches_type(PageShieldPolicy, policy, path=["response"]) + assert_matches_type(Policy, policy, path=["response"]) @pytest.mark.skip() @parametrize @@ -332,7 +332,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = await response.parse() - assert_matches_type(PageShieldPolicy, policy, path=["response"]) + assert_matches_type(Policy, policy, path=["response"]) assert cast(Any, response.is_closed) is True @@ -351,7 +351,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: "c9ef84a6bf5e47138c75d95e2f933e8f", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(PageShieldPolicy, policy, path=["response"]) + assert_matches_type(Policy, policy, path=["response"]) @pytest.mark.skip() @parametrize @@ -365,7 +365,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare expression='ends_with(http.request.uri.path, "/checkout")', value="script-src 'none';", ) - assert_matches_type(PageShieldPolicy, policy, path=["response"]) + assert_matches_type(Policy, policy, path=["response"]) @pytest.mark.skip() @parametrize @@ -378,7 +378,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = await response.parse() - assert_matches_type(PageShieldPolicy, policy, path=["response"]) + assert_matches_type(Policy, policy, path=["response"]) @pytest.mark.skip() @parametrize @@ -391,7 +391,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = await response.parse() - assert_matches_type(PageShieldPolicy, policy, path=["response"]) + assert_matches_type(Policy, policy, path=["response"]) assert cast(Any, response.is_closed) is True @@ -416,7 +416,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: policy = await async_client.page_shield.policies.list( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncSinglePage[PageShieldPolicy], policy, path=["response"]) + assert_matches_type(AsyncSinglePage[Policy], policy, path=["response"]) @pytest.mark.skip() @parametrize @@ -428,7 +428,7 @@ 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" policy = await response.parse() - assert_matches_type(AsyncSinglePage[PageShieldPolicy], policy, path=["response"]) + assert_matches_type(AsyncSinglePage[Policy], policy, path=["response"]) @pytest.mark.skip() @parametrize @@ -440,7 +440,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = await response.parse() - assert_matches_type(AsyncSinglePage[PageShieldPolicy], policy, path=["response"]) + assert_matches_type(AsyncSinglePage[Policy], policy, path=["response"]) assert cast(Any, response.is_closed) is True @@ -511,7 +511,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: "c9ef84a6bf5e47138c75d95e2f933e8f", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(PageShieldPolicy, policy, path=["response"]) + assert_matches_type(Policy, policy, path=["response"]) @pytest.mark.skip() @parametrize @@ -524,7 +524,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = await response.parse() - assert_matches_type(PageShieldPolicy, policy, path=["response"]) + assert_matches_type(Policy, policy, path=["response"]) @pytest.mark.skip() @parametrize @@ -537,7 +537,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = await response.parse() - assert_matches_type(PageShieldPolicy, policy, path=["response"]) + assert_matches_type(Policy, policy, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/page_shield/test_scripts.py b/tests/api_resources/page_shield/test_scripts.py index 832d6445cf0..50e23e6340d 100644 --- a/tests/api_resources/page_shield/test_scripts.py +++ b/tests/api_resources/page_shield/test_scripts.py @@ -10,7 +10,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.pagination import SyncSinglePage, AsyncSinglePage -from cloudflare.types.page_shield import PageShieldScript, ScriptGetResponse +from cloudflare.types.page_shield import Script, ScriptGetResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -24,7 +24,7 @@ def test_method_list(self, client: Cloudflare) -> None: script = client.page_shield.scripts.list( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncSinglePage[PageShieldScript], script, path=["response"]) + assert_matches_type(SyncSinglePage[Script], script, path=["response"]) @pytest.mark.skip() @parametrize @@ -45,7 +45,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: status="active,inactive", urls="blog.cloudflare.com,www.example", ) - assert_matches_type(SyncSinglePage[PageShieldScript], script, path=["response"]) + assert_matches_type(SyncSinglePage[Script], script, path=["response"]) @pytest.mark.skip() @parametrize @@ -57,7 +57,7 @@ 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" script = response.parse() - assert_matches_type(SyncSinglePage[PageShieldScript], script, path=["response"]) + assert_matches_type(SyncSinglePage[Script], script, path=["response"]) @pytest.mark.skip() @parametrize @@ -69,7 +69,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" script = response.parse() - assert_matches_type(SyncSinglePage[PageShieldScript], script, path=["response"]) + assert_matches_type(SyncSinglePage[Script], script, path=["response"]) assert cast(Any, response.is_closed) is True @@ -143,7 +143,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: script = await async_client.page_shield.scripts.list( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncSinglePage[PageShieldScript], script, path=["response"]) + assert_matches_type(AsyncSinglePage[Script], script, path=["response"]) @pytest.mark.skip() @parametrize @@ -164,7 +164,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) status="active,inactive", urls="blog.cloudflare.com,www.example", ) - assert_matches_type(AsyncSinglePage[PageShieldScript], script, path=["response"]) + assert_matches_type(AsyncSinglePage[Script], script, path=["response"]) @pytest.mark.skip() @parametrize @@ -176,7 +176,7 @@ 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" script = await response.parse() - assert_matches_type(AsyncSinglePage[PageShieldScript], script, path=["response"]) + assert_matches_type(AsyncSinglePage[Script], script, path=["response"]) @pytest.mark.skip() @parametrize @@ -188,7 +188,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" script = await response.parse() - assert_matches_type(AsyncSinglePage[PageShieldScript], script, path=["response"]) + assert_matches_type(AsyncSinglePage[Script], script, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/pagerules/test_settings.py b/tests/api_resources/pagerules/test_settings.py index 47bfe3f3456..983c7e2bd05 100644 --- a/tests/api_resources/pagerules/test_settings.py +++ b/tests/api_resources/pagerules/test_settings.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.pagerules import ZonePageruleSettings +from cloudflare.types.pagerules import SettingListResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -23,7 +23,7 @@ def test_method_list(self, client: Cloudflare) -> None: setting = client.pagerules.settings.list( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(ZonePageruleSettings, setting, path=["response"]) + assert_matches_type(SettingListResponse, setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -35,7 +35,7 @@ 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" setting = response.parse() - assert_matches_type(ZonePageruleSettings, setting, path=["response"]) + assert_matches_type(SettingListResponse, setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -47,7 +47,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = response.parse() - assert_matches_type(ZonePageruleSettings, setting, path=["response"]) + assert_matches_type(SettingListResponse, setting, path=["response"]) assert cast(Any, response.is_closed) is True @@ -69,7 +69,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: setting = await async_client.pagerules.settings.list( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(ZonePageruleSettings, setting, path=["response"]) + assert_matches_type(SettingListResponse, setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -81,7 +81,7 @@ 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" setting = await response.parse() - assert_matches_type(ZonePageruleSettings, setting, path=["response"]) + assert_matches_type(SettingListResponse, setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -93,7 +93,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = await response.parse() - assert_matches_type(ZonePageruleSettings, setting, path=["response"]) + assert_matches_type(SettingListResponse, setting, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/pcaps/test_ownership.py b/tests/api_resources/pcaps/test_ownership.py index 47fd90cc6bf..d3a4f2fad81 100644 --- a/tests/api_resources/pcaps/test_ownership.py +++ b/tests/api_resources/pcaps/test_ownership.py @@ -9,10 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.pcaps import ( - OwnershipGetResponse, - MagicVisibilityPCAPsOwnership, -) +from cloudflare.types.pcaps import Ownership, OwnershipGetResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -27,7 +24,7 @@ def test_method_create(self, client: Cloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", destination_conf="s3://pcaps-bucket?region=us-east-1", ) - assert_matches_type(MagicVisibilityPCAPsOwnership, ownership, path=["response"]) + assert_matches_type(Ownership, ownership, path=["response"]) @pytest.mark.skip() @parametrize @@ -40,7 +37,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" ownership = response.parse() - assert_matches_type(MagicVisibilityPCAPsOwnership, ownership, path=["response"]) + assert_matches_type(Ownership, ownership, path=["response"]) @pytest.mark.skip() @parametrize @@ -53,7 +50,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" ownership = response.parse() - assert_matches_type(MagicVisibilityPCAPsOwnership, ownership, path=["response"]) + assert_matches_type(Ownership, ownership, path=["response"]) assert cast(Any, response.is_closed) is True @@ -168,7 +165,7 @@ def test_method_validate(self, client: Cloudflare) -> None: destination_conf="s3://pcaps-bucket?region=us-east-1", ownership_challenge="ownership-challenge-9883874ecac311ec8475433579a6bf5f.txt", ) - assert_matches_type(MagicVisibilityPCAPsOwnership, ownership, path=["response"]) + assert_matches_type(Ownership, ownership, path=["response"]) @pytest.mark.skip() @parametrize @@ -182,7 +179,7 @@ def test_raw_response_validate(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" ownership = response.parse() - assert_matches_type(MagicVisibilityPCAPsOwnership, ownership, path=["response"]) + assert_matches_type(Ownership, ownership, path=["response"]) @pytest.mark.skip() @parametrize @@ -196,7 +193,7 @@ def test_streaming_response_validate(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" ownership = response.parse() - assert_matches_type(MagicVisibilityPCAPsOwnership, ownership, path=["response"]) + assert_matches_type(Ownership, ownership, path=["response"]) assert cast(Any, response.is_closed) is True @@ -221,7 +218,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", destination_conf="s3://pcaps-bucket?region=us-east-1", ) - assert_matches_type(MagicVisibilityPCAPsOwnership, ownership, path=["response"]) + assert_matches_type(Ownership, ownership, path=["response"]) @pytest.mark.skip() @parametrize @@ -234,7 +231,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" ownership = await response.parse() - assert_matches_type(MagicVisibilityPCAPsOwnership, ownership, path=["response"]) + assert_matches_type(Ownership, ownership, path=["response"]) @pytest.mark.skip() @parametrize @@ -247,7 +244,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" ownership = await response.parse() - assert_matches_type(MagicVisibilityPCAPsOwnership, ownership, path=["response"]) + assert_matches_type(Ownership, ownership, path=["response"]) assert cast(Any, response.is_closed) is True @@ -362,7 +359,7 @@ async def test_method_validate(self, async_client: AsyncCloudflare) -> None: destination_conf="s3://pcaps-bucket?region=us-east-1", ownership_challenge="ownership-challenge-9883874ecac311ec8475433579a6bf5f.txt", ) - assert_matches_type(MagicVisibilityPCAPsOwnership, ownership, path=["response"]) + assert_matches_type(Ownership, ownership, path=["response"]) @pytest.mark.skip() @parametrize @@ -376,7 +373,7 @@ async def test_raw_response_validate(self, async_client: AsyncCloudflare) -> Non assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" ownership = await response.parse() - assert_matches_type(MagicVisibilityPCAPsOwnership, ownership, path=["response"]) + assert_matches_type(Ownership, ownership, path=["response"]) @pytest.mark.skip() @parametrize @@ -390,7 +387,7 @@ async def test_streaming_response_validate(self, async_client: AsyncCloudflare) assert response.http_request.headers.get("X-Stainless-Lang") == "python" ownership = await response.parse() - assert_matches_type(MagicVisibilityPCAPsOwnership, ownership, path=["response"]) + assert_matches_type(Ownership, ownership, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/r2/test_buckets.py b/tests/api_resources/r2/test_buckets.py index 572433a0ffd..157f4be3fe6 100644 --- a/tests/api_resources/r2/test_buckets.py +++ b/tests/api_resources/r2/test_buckets.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.r2 import R2Bucket +from cloudflare.types.r2 import Bucket from cloudflare.pagination import SyncCursorPagination, AsyncCursorPagination base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -25,7 +25,7 @@ def test_method_create(self, client: Cloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", name="example-bucket", ) - assert_matches_type(R2Bucket, bucket, path=["response"]) + assert_matches_type(Bucket, bucket, path=["response"]) @pytest.mark.skip() @parametrize @@ -35,7 +35,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: name="example-bucket", location_hint="apac", ) - assert_matches_type(R2Bucket, bucket, path=["response"]) + assert_matches_type(Bucket, bucket, path=["response"]) @pytest.mark.skip() @parametrize @@ -48,7 +48,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" bucket = response.parse() - assert_matches_type(R2Bucket, bucket, path=["response"]) + assert_matches_type(Bucket, bucket, path=["response"]) @pytest.mark.skip() @parametrize @@ -61,7 +61,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" bucket = response.parse() - assert_matches_type(R2Bucket, bucket, path=["response"]) + assert_matches_type(Bucket, bucket, path=["response"]) assert cast(Any, response.is_closed) is True @@ -80,7 +80,7 @@ def test_method_list(self, client: Cloudflare) -> None: bucket = client.r2.buckets.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncCursorPagination[R2Bucket], bucket, path=["response"]) + assert_matches_type(SyncCursorPagination[Bucket], bucket, path=["response"]) @pytest.mark.skip() @parametrize @@ -94,7 +94,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: per_page=1, start_after="my-bucket", ) - assert_matches_type(SyncCursorPagination[R2Bucket], bucket, path=["response"]) + assert_matches_type(SyncCursorPagination[Bucket], bucket, path=["response"]) @pytest.mark.skip() @parametrize @@ -106,7 +106,7 @@ 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" bucket = response.parse() - assert_matches_type(SyncCursorPagination[R2Bucket], bucket, path=["response"]) + assert_matches_type(SyncCursorPagination[Bucket], bucket, path=["response"]) @pytest.mark.skip() @parametrize @@ -118,7 +118,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" bucket = response.parse() - assert_matches_type(SyncCursorPagination[R2Bucket], bucket, path=["response"]) + assert_matches_type(SyncCursorPagination[Bucket], bucket, path=["response"]) assert cast(Any, response.is_closed) is True @@ -189,7 +189,7 @@ def test_method_get(self, client: Cloudflare) -> None: "example-bucket", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(R2Bucket, bucket, path=["response"]) + assert_matches_type(Bucket, bucket, path=["response"]) @pytest.mark.skip() @parametrize @@ -202,7 +202,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" bucket = response.parse() - assert_matches_type(R2Bucket, bucket, path=["response"]) + assert_matches_type(Bucket, bucket, path=["response"]) @pytest.mark.skip() @parametrize @@ -215,7 +215,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" bucket = response.parse() - assert_matches_type(R2Bucket, bucket, path=["response"]) + assert_matches_type(Bucket, bucket, path=["response"]) assert cast(Any, response.is_closed) is True @@ -245,7 +245,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", name="example-bucket", ) - assert_matches_type(R2Bucket, bucket, path=["response"]) + assert_matches_type(Bucket, bucket, path=["response"]) @pytest.mark.skip() @parametrize @@ -255,7 +255,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare name="example-bucket", location_hint="apac", ) - assert_matches_type(R2Bucket, bucket, path=["response"]) + assert_matches_type(Bucket, bucket, path=["response"]) @pytest.mark.skip() @parametrize @@ -268,7 +268,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" bucket = await response.parse() - assert_matches_type(R2Bucket, bucket, path=["response"]) + assert_matches_type(Bucket, bucket, path=["response"]) @pytest.mark.skip() @parametrize @@ -281,7 +281,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" bucket = await response.parse() - assert_matches_type(R2Bucket, bucket, path=["response"]) + assert_matches_type(Bucket, bucket, path=["response"]) assert cast(Any, response.is_closed) is True @@ -300,7 +300,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: bucket = await async_client.r2.buckets.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncCursorPagination[R2Bucket], bucket, path=["response"]) + assert_matches_type(AsyncCursorPagination[Bucket], bucket, path=["response"]) @pytest.mark.skip() @parametrize @@ -314,7 +314,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) per_page=1, start_after="my-bucket", ) - assert_matches_type(AsyncCursorPagination[R2Bucket], bucket, path=["response"]) + assert_matches_type(AsyncCursorPagination[Bucket], bucket, path=["response"]) @pytest.mark.skip() @parametrize @@ -326,7 +326,7 @@ 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" bucket = await response.parse() - assert_matches_type(AsyncCursorPagination[R2Bucket], bucket, path=["response"]) + assert_matches_type(AsyncCursorPagination[Bucket], bucket, path=["response"]) @pytest.mark.skip() @parametrize @@ -338,7 +338,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" bucket = await response.parse() - assert_matches_type(AsyncCursorPagination[R2Bucket], bucket, path=["response"]) + assert_matches_type(AsyncCursorPagination[Bucket], bucket, path=["response"]) assert cast(Any, response.is_closed) is True @@ -409,7 +409,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: "example-bucket", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(R2Bucket, bucket, path=["response"]) + assert_matches_type(Bucket, bucket, path=["response"]) @pytest.mark.skip() @parametrize @@ -422,7 +422,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" bucket = await response.parse() - assert_matches_type(R2Bucket, bucket, path=["response"]) + assert_matches_type(Bucket, bucket, path=["response"]) @pytest.mark.skip() @parametrize @@ -435,7 +435,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" bucket = await response.parse() - assert_matches_type(R2Bucket, bucket, path=["response"]) + assert_matches_type(Bucket, bucket, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/r2/test_sippy.py b/tests/api_resources/r2/test_sippy.py index c4b84c6282f..364859aae67 100644 --- a/tests/api_resources/r2/test_sippy.py +++ b/tests/api_resources/r2/test_sippy.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.r2 import R2Sippy, SippyDeleteResponse +from cloudflare.types.r2 import Sippy, SippyDeleteResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -24,7 +24,7 @@ def test_method_update_overload_1(self, client: Cloudflare) -> None: "example-bucket", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(R2Sippy, sippy, path=["response"]) + assert_matches_type(Sippy, sippy, path=["response"]) @pytest.mark.skip() @parametrize @@ -45,7 +45,7 @@ def test_method_update_with_all_params_overload_1(self, client: Cloudflare) -> N "secret_access_key": "string", }, ) - assert_matches_type(R2Sippy, sippy, path=["response"]) + assert_matches_type(Sippy, sippy, path=["response"]) @pytest.mark.skip() @parametrize @@ -58,7 +58,7 @@ def test_raw_response_update_overload_1(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" sippy = response.parse() - assert_matches_type(R2Sippy, sippy, path=["response"]) + assert_matches_type(Sippy, sippy, path=["response"]) @pytest.mark.skip() @parametrize @@ -71,7 +71,7 @@ def test_streaming_response_update_overload_1(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" sippy = response.parse() - assert_matches_type(R2Sippy, sippy, path=["response"]) + assert_matches_type(Sippy, sippy, path=["response"]) assert cast(Any, response.is_closed) is True @@ -97,7 +97,7 @@ def test_method_update_overload_2(self, client: Cloudflare) -> None: "example-bucket", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(R2Sippy, sippy, path=["response"]) + assert_matches_type(Sippy, sippy, path=["response"]) @pytest.mark.skip() @parametrize @@ -117,7 +117,7 @@ def test_method_update_with_all_params_overload_2(self, client: Cloudflare) -> N "provider": "gcs", }, ) - assert_matches_type(R2Sippy, sippy, path=["response"]) + assert_matches_type(Sippy, sippy, path=["response"]) @pytest.mark.skip() @parametrize @@ -130,7 +130,7 @@ def test_raw_response_update_overload_2(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" sippy = response.parse() - assert_matches_type(R2Sippy, sippy, path=["response"]) + assert_matches_type(Sippy, sippy, path=["response"]) @pytest.mark.skip() @parametrize @@ -143,7 +143,7 @@ def test_streaming_response_update_overload_2(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" sippy = response.parse() - assert_matches_type(R2Sippy, sippy, path=["response"]) + assert_matches_type(Sippy, sippy, path=["response"]) assert cast(Any, response.is_closed) is True @@ -221,7 +221,7 @@ def test_method_get(self, client: Cloudflare) -> None: "example-bucket", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(R2Sippy, sippy, path=["response"]) + assert_matches_type(Sippy, sippy, path=["response"]) @pytest.mark.skip() @parametrize @@ -234,7 +234,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" sippy = response.parse() - assert_matches_type(R2Sippy, sippy, path=["response"]) + assert_matches_type(Sippy, sippy, path=["response"]) @pytest.mark.skip() @parametrize @@ -247,7 +247,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" sippy = response.parse() - assert_matches_type(R2Sippy, sippy, path=["response"]) + assert_matches_type(Sippy, sippy, path=["response"]) assert cast(Any, response.is_closed) is True @@ -277,7 +277,7 @@ async def test_method_update_overload_1(self, async_client: AsyncCloudflare) -> "example-bucket", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(R2Sippy, sippy, path=["response"]) + assert_matches_type(Sippy, sippy, path=["response"]) @pytest.mark.skip() @parametrize @@ -298,7 +298,7 @@ async def test_method_update_with_all_params_overload_1(self, async_client: Asyn "secret_access_key": "string", }, ) - assert_matches_type(R2Sippy, sippy, path=["response"]) + assert_matches_type(Sippy, sippy, path=["response"]) @pytest.mark.skip() @parametrize @@ -311,7 +311,7 @@ async def test_raw_response_update_overload_1(self, async_client: AsyncCloudflar assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" sippy = await response.parse() - assert_matches_type(R2Sippy, sippy, path=["response"]) + assert_matches_type(Sippy, sippy, path=["response"]) @pytest.mark.skip() @parametrize @@ -324,7 +324,7 @@ async def test_streaming_response_update_overload_1(self, async_client: AsyncClo assert response.http_request.headers.get("X-Stainless-Lang") == "python" sippy = await response.parse() - assert_matches_type(R2Sippy, sippy, path=["response"]) + assert_matches_type(Sippy, sippy, path=["response"]) assert cast(Any, response.is_closed) is True @@ -350,7 +350,7 @@ async def test_method_update_overload_2(self, async_client: AsyncCloudflare) -> "example-bucket", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(R2Sippy, sippy, path=["response"]) + assert_matches_type(Sippy, sippy, path=["response"]) @pytest.mark.skip() @parametrize @@ -370,7 +370,7 @@ async def test_method_update_with_all_params_overload_2(self, async_client: Asyn "provider": "gcs", }, ) - assert_matches_type(R2Sippy, sippy, path=["response"]) + assert_matches_type(Sippy, sippy, path=["response"]) @pytest.mark.skip() @parametrize @@ -383,7 +383,7 @@ async def test_raw_response_update_overload_2(self, async_client: AsyncCloudflar assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" sippy = await response.parse() - assert_matches_type(R2Sippy, sippy, path=["response"]) + assert_matches_type(Sippy, sippy, path=["response"]) @pytest.mark.skip() @parametrize @@ -396,7 +396,7 @@ async def test_streaming_response_update_overload_2(self, async_client: AsyncClo assert response.http_request.headers.get("X-Stainless-Lang") == "python" sippy = await response.parse() - assert_matches_type(R2Sippy, sippy, path=["response"]) + assert_matches_type(Sippy, sippy, path=["response"]) assert cast(Any, response.is_closed) is True @@ -474,7 +474,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: "example-bucket", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(R2Sippy, sippy, path=["response"]) + assert_matches_type(Sippy, sippy, path=["response"]) @pytest.mark.skip() @parametrize @@ -487,7 +487,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" sippy = await response.parse() - assert_matches_type(R2Sippy, sippy, path=["response"]) + assert_matches_type(Sippy, sippy, path=["response"]) @pytest.mark.skip() @parametrize @@ -500,7 +500,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" sippy = await response.parse() - assert_matches_type(R2Sippy, sippy, path=["response"]) + assert_matches_type(Sippy, sippy, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/registrar/test_domains.py b/tests/api_resources/registrar/test_domains.py index 5ee6af94720..997f8ef0847 100644 --- a/tests/api_resources/registrar/test_domains.py +++ b/tests/api_resources/registrar/test_domains.py @@ -11,7 +11,7 @@ from tests.utils import assert_matches_type from cloudflare.pagination import SyncSinglePage, AsyncSinglePage from cloudflare.types.shared import UnnamedSchemaRef65e3c8c1a9c4638ec25cdbbaca7165c1 -from cloudflare.types.registrar import DomainListResponse +from cloudflare.types.registrar import Domain base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -89,7 +89,7 @@ def test_method_list(self, client: Cloudflare) -> None: domain = client.registrar.domains.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncSinglePage[DomainListResponse], domain, path=["response"]) + assert_matches_type(SyncSinglePage[Domain], domain, path=["response"]) @pytest.mark.skip() @parametrize @@ -101,7 +101,7 @@ 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" domain = response.parse() - assert_matches_type(SyncSinglePage[DomainListResponse], domain, path=["response"]) + assert_matches_type(SyncSinglePage[Domain], domain, path=["response"]) @pytest.mark.skip() @parametrize @@ -113,7 +113,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" domain = response.parse() - assert_matches_type(SyncSinglePage[DomainListResponse], domain, path=["response"]) + assert_matches_type(SyncSinglePage[Domain], domain, path=["response"]) assert cast(Any, response.is_closed) is True @@ -251,7 +251,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: domain = await async_client.registrar.domains.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncSinglePage[DomainListResponse], domain, path=["response"]) + assert_matches_type(AsyncSinglePage[Domain], domain, path=["response"]) @pytest.mark.skip() @parametrize @@ -263,7 +263,7 @@ 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" domain = await response.parse() - assert_matches_type(AsyncSinglePage[DomainListResponse], domain, path=["response"]) + assert_matches_type(AsyncSinglePage[Domain], domain, path=["response"]) @pytest.mark.skip() @parametrize @@ -275,7 +275,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" domain = await response.parse() - assert_matches_type(AsyncSinglePage[DomainListResponse], domain, path=["response"]) + assert_matches_type(AsyncSinglePage[Domain], domain, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/rules/test_lists.py b/tests/api_resources/rules/test_lists.py index c63a54d2fa1..f99b2f44efb 100644 --- a/tests/api_resources/rules/test_lists.py +++ b/tests/api_resources/rules/test_lists.py @@ -10,10 +10,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.pagination import SyncSinglePage, AsyncSinglePage -from cloudflare.types.rules import ( - ListsList, - ListDeleteResponse, -) +from cloudflare.types.rules import List, ListDeleteResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -29,7 +26,7 @@ def test_method_create(self, client: Cloudflare) -> None: kind="ip", name="list1", ) - assert_matches_type(Optional[ListsList], list, path=["response"]) + assert_matches_type(Optional[List], list, path=["response"]) @pytest.mark.skip() @parametrize @@ -40,7 +37,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: name="list1", description="This is a note", ) - assert_matches_type(Optional[ListsList], list, path=["response"]) + assert_matches_type(Optional[List], list, path=["response"]) @pytest.mark.skip() @parametrize @@ -54,7 +51,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" list = response.parse() - assert_matches_type(Optional[ListsList], list, path=["response"]) + assert_matches_type(Optional[List], list, path=["response"]) @pytest.mark.skip() @parametrize @@ -68,7 +65,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" list = response.parse() - assert_matches_type(Optional[ListsList], list, path=["response"]) + assert_matches_type(Optional[List], list, path=["response"]) assert cast(Any, response.is_closed) is True @@ -89,7 +86,7 @@ def test_method_update(self, client: Cloudflare) -> None: "2c0fc9fa937b11eaa1b71c4d701ab86e", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[ListsList], list, path=["response"]) + assert_matches_type(Optional[List], list, path=["response"]) @pytest.mark.skip() @parametrize @@ -99,7 +96,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", description="This is a note", ) - assert_matches_type(Optional[ListsList], list, path=["response"]) + assert_matches_type(Optional[List], list, path=["response"]) @pytest.mark.skip() @parametrize @@ -112,7 +109,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" list = response.parse() - assert_matches_type(Optional[ListsList], list, path=["response"]) + assert_matches_type(Optional[List], list, path=["response"]) @pytest.mark.skip() @parametrize @@ -125,7 +122,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" list = response.parse() - assert_matches_type(Optional[ListsList], list, path=["response"]) + assert_matches_type(Optional[List], list, path=["response"]) assert cast(Any, response.is_closed) is True @@ -150,7 +147,7 @@ def test_method_list(self, client: Cloudflare) -> None: list = client.rules.lists.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncSinglePage[ListsList], list, path=["response"]) + assert_matches_type(SyncSinglePage[List], list, path=["response"]) @pytest.mark.skip() @parametrize @@ -162,7 +159,7 @@ 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" list = response.parse() - assert_matches_type(SyncSinglePage[ListsList], list, path=["response"]) + assert_matches_type(SyncSinglePage[List], list, path=["response"]) @pytest.mark.skip() @parametrize @@ -174,7 +171,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" list = response.parse() - assert_matches_type(SyncSinglePage[ListsList], list, path=["response"]) + assert_matches_type(SyncSinglePage[List], list, path=["response"]) assert cast(Any, response.is_closed) is True @@ -250,7 +247,7 @@ def test_method_get(self, client: Cloudflare) -> None: "2c0fc9fa937b11eaa1b71c4d701ab86e", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[ListsList], list, path=["response"]) + assert_matches_type(Optional[List], list, path=["response"]) @pytest.mark.skip() @parametrize @@ -263,7 +260,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" list = response.parse() - assert_matches_type(Optional[ListsList], list, path=["response"]) + assert_matches_type(Optional[List], list, path=["response"]) @pytest.mark.skip() @parametrize @@ -276,7 +273,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" list = response.parse() - assert_matches_type(Optional[ListsList], list, path=["response"]) + assert_matches_type(Optional[List], list, path=["response"]) assert cast(Any, response.is_closed) is True @@ -307,7 +304,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: kind="ip", name="list1", ) - assert_matches_type(Optional[ListsList], list, path=["response"]) + assert_matches_type(Optional[List], list, path=["response"]) @pytest.mark.skip() @parametrize @@ -318,7 +315,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare name="list1", description="This is a note", ) - assert_matches_type(Optional[ListsList], list, path=["response"]) + assert_matches_type(Optional[List], list, path=["response"]) @pytest.mark.skip() @parametrize @@ -332,7 +329,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" list = await response.parse() - assert_matches_type(Optional[ListsList], list, path=["response"]) + assert_matches_type(Optional[List], list, path=["response"]) @pytest.mark.skip() @parametrize @@ -346,7 +343,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" list = await response.parse() - assert_matches_type(Optional[ListsList], list, path=["response"]) + assert_matches_type(Optional[List], list, path=["response"]) assert cast(Any, response.is_closed) is True @@ -367,7 +364,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: "2c0fc9fa937b11eaa1b71c4d701ab86e", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[ListsList], list, path=["response"]) + assert_matches_type(Optional[List], list, path=["response"]) @pytest.mark.skip() @parametrize @@ -377,7 +374,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare account_id="023e105f4ecef8ad9ca31a8372d0c353", description="This is a note", ) - assert_matches_type(Optional[ListsList], list, path=["response"]) + assert_matches_type(Optional[List], list, path=["response"]) @pytest.mark.skip() @parametrize @@ -390,7 +387,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" list = await response.parse() - assert_matches_type(Optional[ListsList], list, path=["response"]) + assert_matches_type(Optional[List], list, path=["response"]) @pytest.mark.skip() @parametrize @@ -403,7 +400,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" list = await response.parse() - assert_matches_type(Optional[ListsList], list, path=["response"]) + assert_matches_type(Optional[List], list, path=["response"]) assert cast(Any, response.is_closed) is True @@ -428,7 +425,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: list = await async_client.rules.lists.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncSinglePage[ListsList], list, path=["response"]) + assert_matches_type(AsyncSinglePage[List], list, path=["response"]) @pytest.mark.skip() @parametrize @@ -440,7 +437,7 @@ 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" list = await response.parse() - assert_matches_type(AsyncSinglePage[ListsList], list, path=["response"]) + assert_matches_type(AsyncSinglePage[List], list, path=["response"]) @pytest.mark.skip() @parametrize @@ -452,7 +449,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" list = await response.parse() - assert_matches_type(AsyncSinglePage[ListsList], list, path=["response"]) + assert_matches_type(AsyncSinglePage[List], list, path=["response"]) assert cast(Any, response.is_closed) is True @@ -528,7 +525,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: "2c0fc9fa937b11eaa1b71c4d701ab86e", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[ListsList], list, path=["response"]) + assert_matches_type(Optional[List], list, path=["response"]) @pytest.mark.skip() @parametrize @@ -541,7 +538,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" list = await response.parse() - assert_matches_type(Optional[ListsList], list, path=["response"]) + assert_matches_type(Optional[List], list, path=["response"]) @pytest.mark.skip() @parametrize @@ -554,7 +551,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" list = await response.parse() - assert_matches_type(Optional[ListsList], list, path=["response"]) + assert_matches_type(Optional[List], list, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/rum/test_rules.py b/tests/api_resources/rum/test_rules.py index 0250949fba5..260912c362c 100644 --- a/tests/api_resources/rum/test_rules.py +++ b/tests/api_resources/rum/test_rules.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.rum import RUMRule, RuleListResponse, RuleDeleteResponse +from cloudflare.types.rum import Rule, RuleListResponse, RuleDeleteResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -24,7 +24,7 @@ def test_method_create(self, client: Cloudflare) -> None: "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RUMRule], rule, path=["response"]) + assert_matches_type(Optional[Rule], rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -37,7 +37,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: is_paused=False, paths=["*"], ) - assert_matches_type(Optional[RUMRule], rule, path=["response"]) + assert_matches_type(Optional[Rule], rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -50,7 +50,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(Optional[RUMRule], rule, path=["response"]) + assert_matches_type(Optional[Rule], rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -63,7 +63,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(Optional[RUMRule], rule, path=["response"]) + assert_matches_type(Optional[Rule], rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -90,7 +90,7 @@ def test_method_update(self, client: Cloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", ruleset_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", ) - assert_matches_type(Optional[RUMRule], rule, path=["response"]) + assert_matches_type(Optional[Rule], rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -104,7 +104,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: is_paused=False, paths=["*"], ) - assert_matches_type(Optional[RUMRule], rule, path=["response"]) + assert_matches_type(Optional[Rule], rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -118,7 +118,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(Optional[RUMRule], rule, path=["response"]) + assert_matches_type(Optional[Rule], rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -132,7 +132,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(Optional[RUMRule], rule, path=["response"]) + assert_matches_type(Optional[Rule], rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -287,7 +287,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RUMRule], rule, path=["response"]) + assert_matches_type(Optional[Rule], rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -300,7 +300,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare is_paused=False, paths=["*"], ) - assert_matches_type(Optional[RUMRule], rule, path=["response"]) + assert_matches_type(Optional[Rule], rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -313,7 +313,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(Optional[RUMRule], rule, path=["response"]) + assert_matches_type(Optional[Rule], rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -326,7 +326,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(Optional[RUMRule], rule, path=["response"]) + assert_matches_type(Optional[Rule], rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -353,7 +353,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", ruleset_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", ) - assert_matches_type(Optional[RUMRule], rule, path=["response"]) + assert_matches_type(Optional[Rule], rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -367,7 +367,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare is_paused=False, paths=["*"], ) - assert_matches_type(Optional[RUMRule], rule, path=["response"]) + assert_matches_type(Optional[Rule], rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -381,7 +381,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(Optional[RUMRule], rule, path=["response"]) + assert_matches_type(Optional[Rule], rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -395,7 +395,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(Optional[RUMRule], rule, path=["response"]) + assert_matches_type(Optional[Rule], rule, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/rum/test_site_info.py b/tests/api_resources/rum/test_site_info.py index 3b611004ca6..a1f892e4669 100644 --- a/tests/api_resources/rum/test_site_info.py +++ b/tests/api_resources/rum/test_site_info.py @@ -10,7 +10,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.types.rum import ( - RUMSite, + Site, SiteInfoDeleteResponse, ) from cloudflare.pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray @@ -27,7 +27,7 @@ def test_method_create(self, client: Cloudflare) -> None: site_info = client.rum.site_info.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RUMSite], site_info, path=["response"]) + assert_matches_type(Optional[Site], site_info, path=["response"]) @pytest.mark.skip() @parametrize @@ -38,7 +38,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: host="example.com", zone_tag="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RUMSite], site_info, path=["response"]) + assert_matches_type(Optional[Site], site_info, path=["response"]) @pytest.mark.skip() @parametrize @@ -50,7 +50,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" site_info = response.parse() - assert_matches_type(Optional[RUMSite], site_info, path=["response"]) + assert_matches_type(Optional[Site], site_info, path=["response"]) @pytest.mark.skip() @parametrize @@ -62,7 +62,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" site_info = response.parse() - assert_matches_type(Optional[RUMSite], site_info, path=["response"]) + assert_matches_type(Optional[Site], site_info, path=["response"]) assert cast(Any, response.is_closed) is True @@ -81,7 +81,7 @@ def test_method_update(self, client: Cloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RUMSite], site_info, path=["response"]) + assert_matches_type(Optional[Site], site_info, path=["response"]) @pytest.mark.skip() @parametrize @@ -93,7 +93,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: host="example.com", zone_tag="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RUMSite], site_info, path=["response"]) + assert_matches_type(Optional[Site], site_info, path=["response"]) @pytest.mark.skip() @parametrize @@ -106,7 +106,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" site_info = response.parse() - assert_matches_type(Optional[RUMSite], site_info, path=["response"]) + assert_matches_type(Optional[Site], site_info, path=["response"]) @pytest.mark.skip() @parametrize @@ -119,7 +119,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" site_info = response.parse() - assert_matches_type(Optional[RUMSite], site_info, path=["response"]) + assert_matches_type(Optional[Site], site_info, path=["response"]) assert cast(Any, response.is_closed) is True @@ -144,7 +144,7 @@ def test_method_list(self, client: Cloudflare) -> None: site_info = client.rum.site_info.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncV4PagePaginationArray[RUMSite], site_info, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[Site], site_info, path=["response"]) @pytest.mark.skip() @parametrize @@ -155,7 +155,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: page=1, per_page=10, ) - assert_matches_type(SyncV4PagePaginationArray[RUMSite], site_info, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[Site], site_info, path=["response"]) @pytest.mark.skip() @parametrize @@ -167,7 +167,7 @@ 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" site_info = response.parse() - assert_matches_type(SyncV4PagePaginationArray[RUMSite], site_info, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[Site], site_info, path=["response"]) @pytest.mark.skip() @parametrize @@ -179,7 +179,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" site_info = response.parse() - assert_matches_type(SyncV4PagePaginationArray[RUMSite], site_info, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[Site], site_info, path=["response"]) assert cast(Any, response.is_closed) is True @@ -250,7 +250,7 @@ def test_method_get(self, client: Cloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RUMSite], site_info, path=["response"]) + assert_matches_type(Optional[Site], site_info, path=["response"]) @pytest.mark.skip() @parametrize @@ -263,7 +263,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" site_info = response.parse() - assert_matches_type(Optional[RUMSite], site_info, path=["response"]) + assert_matches_type(Optional[Site], site_info, path=["response"]) @pytest.mark.skip() @parametrize @@ -276,7 +276,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" site_info = response.parse() - assert_matches_type(Optional[RUMSite], site_info, path=["response"]) + assert_matches_type(Optional[Site], site_info, path=["response"]) assert cast(Any, response.is_closed) is True @@ -305,7 +305,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: site_info = await async_client.rum.site_info.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RUMSite], site_info, path=["response"]) + assert_matches_type(Optional[Site], site_info, path=["response"]) @pytest.mark.skip() @parametrize @@ -316,7 +316,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare host="example.com", zone_tag="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RUMSite], site_info, path=["response"]) + assert_matches_type(Optional[Site], site_info, path=["response"]) @pytest.mark.skip() @parametrize @@ -328,7 +328,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" site_info = await response.parse() - assert_matches_type(Optional[RUMSite], site_info, path=["response"]) + assert_matches_type(Optional[Site], site_info, path=["response"]) @pytest.mark.skip() @parametrize @@ -340,7 +340,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" site_info = await response.parse() - assert_matches_type(Optional[RUMSite], site_info, path=["response"]) + assert_matches_type(Optional[Site], site_info, path=["response"]) assert cast(Any, response.is_closed) is True @@ -359,7 +359,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RUMSite], site_info, path=["response"]) + assert_matches_type(Optional[Site], site_info, path=["response"]) @pytest.mark.skip() @parametrize @@ -371,7 +371,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare host="example.com", zone_tag="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RUMSite], site_info, path=["response"]) + assert_matches_type(Optional[Site], site_info, path=["response"]) @pytest.mark.skip() @parametrize @@ -384,7 +384,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" site_info = await response.parse() - assert_matches_type(Optional[RUMSite], site_info, path=["response"]) + assert_matches_type(Optional[Site], site_info, path=["response"]) @pytest.mark.skip() @parametrize @@ -397,7 +397,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" site_info = await response.parse() - assert_matches_type(Optional[RUMSite], site_info, path=["response"]) + assert_matches_type(Optional[Site], site_info, path=["response"]) assert cast(Any, response.is_closed) is True @@ -422,7 +422,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: site_info = await async_client.rum.site_info.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncV4PagePaginationArray[RUMSite], site_info, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[Site], site_info, path=["response"]) @pytest.mark.skip() @parametrize @@ -433,7 +433,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) page=1, per_page=10, ) - assert_matches_type(AsyncV4PagePaginationArray[RUMSite], site_info, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[Site], site_info, path=["response"]) @pytest.mark.skip() @parametrize @@ -445,7 +445,7 @@ 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" site_info = await response.parse() - assert_matches_type(AsyncV4PagePaginationArray[RUMSite], site_info, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[Site], site_info, path=["response"]) @pytest.mark.skip() @parametrize @@ -457,7 +457,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" site_info = await response.parse() - assert_matches_type(AsyncV4PagePaginationArray[RUMSite], site_info, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[Site], site_info, path=["response"]) assert cast(Any, response.is_closed) is True @@ -528,7 +528,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[RUMSite], site_info, path=["response"]) + assert_matches_type(Optional[Site], site_info, path=["response"]) @pytest.mark.skip() @parametrize @@ -541,7 +541,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" site_info = await response.parse() - assert_matches_type(Optional[RUMSite], site_info, path=["response"]) + assert_matches_type(Optional[Site], site_info, path=["response"]) @pytest.mark.skip() @parametrize @@ -554,7 +554,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" site_info = await response.parse() - assert_matches_type(Optional[RUMSite], site_info, path=["response"]) + assert_matches_type(Optional[Site], site_info, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/speed/test_availabilities.py b/tests/api_resources/speed/test_availabilities.py index 5c38c4e5ca1..1d651c0cda6 100644 --- a/tests/api_resources/speed/test_availabilities.py +++ b/tests/api_resources/speed/test_availabilities.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.speed import ObservatoryAvailabilities +from cloudflare.types.speed import Availability base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -23,7 +23,7 @@ def test_method_list(self, client: Cloudflare) -> None: availability = client.speed.availabilities.list( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[ObservatoryAvailabilities], availability, path=["response"]) + assert_matches_type(Optional[Availability], availability, path=["response"]) @pytest.mark.skip() @parametrize @@ -35,7 +35,7 @@ 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" availability = response.parse() - assert_matches_type(Optional[ObservatoryAvailabilities], availability, path=["response"]) + assert_matches_type(Optional[Availability], availability, path=["response"]) @pytest.mark.skip() @parametrize @@ -47,7 +47,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" availability = response.parse() - assert_matches_type(Optional[ObservatoryAvailabilities], availability, path=["response"]) + assert_matches_type(Optional[Availability], availability, path=["response"]) assert cast(Any, response.is_closed) is True @@ -69,7 +69,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: availability = await async_client.speed.availabilities.list( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[ObservatoryAvailabilities], availability, path=["response"]) + assert_matches_type(Optional[Availability], availability, path=["response"]) @pytest.mark.skip() @parametrize @@ -81,7 +81,7 @@ 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" availability = await response.parse() - assert_matches_type(Optional[ObservatoryAvailabilities], availability, path=["response"]) + assert_matches_type(Optional[Availability], availability, path=["response"]) @pytest.mark.skip() @parametrize @@ -93,7 +93,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" availability = await response.parse() - assert_matches_type(Optional[ObservatoryAvailabilities], availability, path=["response"]) + assert_matches_type(Optional[Availability], availability, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/speed/test_tests.py b/tests/api_resources/speed/test_tests.py index 8cd7b1dec63..fc85d909d50 100644 --- a/tests/api_resources/speed/test_tests.py +++ b/tests/api_resources/speed/test_tests.py @@ -10,9 +10,9 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.types.speed import ( + Test, TestListResponse, TestDeleteResponse, - ObservatoryPageTest, ) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -28,7 +28,7 @@ def test_method_create(self, client: Cloudflare) -> None: "example.com", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[ObservatoryPageTest], test, path=["response"]) + assert_matches_type(Optional[Test], test, path=["response"]) @pytest.mark.skip() @parametrize @@ -38,7 +38,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", region="us-central1", ) - assert_matches_type(Optional[ObservatoryPageTest], test, path=["response"]) + assert_matches_type(Optional[Test], test, path=["response"]) @pytest.mark.skip() @parametrize @@ -51,7 +51,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" test = response.parse() - assert_matches_type(Optional[ObservatoryPageTest], test, path=["response"]) + assert_matches_type(Optional[Test], test, path=["response"]) @pytest.mark.skip() @parametrize @@ -64,7 +64,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" test = response.parse() - assert_matches_type(Optional[ObservatoryPageTest], test, path=["response"]) + assert_matches_type(Optional[Test], test, path=["response"]) assert cast(Any, response.is_closed) is True @@ -217,7 +217,7 @@ def test_method_get(self, client: Cloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", url="example.com", ) - assert_matches_type(Optional[ObservatoryPageTest], test, path=["response"]) + assert_matches_type(Optional[Test], test, path=["response"]) @pytest.mark.skip() @parametrize @@ -231,7 +231,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" test = response.parse() - assert_matches_type(Optional[ObservatoryPageTest], test, path=["response"]) + assert_matches_type(Optional[Test], test, path=["response"]) @pytest.mark.skip() @parametrize @@ -245,7 +245,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" test = response.parse() - assert_matches_type(Optional[ObservatoryPageTest], test, path=["response"]) + assert_matches_type(Optional[Test], test, path=["response"]) assert cast(Any, response.is_closed) is True @@ -284,7 +284,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: "example.com", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[ObservatoryPageTest], test, path=["response"]) + assert_matches_type(Optional[Test], test, path=["response"]) @pytest.mark.skip() @parametrize @@ -294,7 +294,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare zone_id="023e105f4ecef8ad9ca31a8372d0c353", region="us-central1", ) - assert_matches_type(Optional[ObservatoryPageTest], test, path=["response"]) + assert_matches_type(Optional[Test], test, path=["response"]) @pytest.mark.skip() @parametrize @@ -307,7 +307,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" test = await response.parse() - assert_matches_type(Optional[ObservatoryPageTest], test, path=["response"]) + assert_matches_type(Optional[Test], test, path=["response"]) @pytest.mark.skip() @parametrize @@ -320,7 +320,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" test = await response.parse() - assert_matches_type(Optional[ObservatoryPageTest], test, path=["response"]) + assert_matches_type(Optional[Test], test, path=["response"]) assert cast(Any, response.is_closed) is True @@ -473,7 +473,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", url="example.com", ) - assert_matches_type(Optional[ObservatoryPageTest], test, path=["response"]) + assert_matches_type(Optional[Test], test, path=["response"]) @pytest.mark.skip() @parametrize @@ -487,7 +487,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" test = await response.parse() - assert_matches_type(Optional[ObservatoryPageTest], test, path=["response"]) + assert_matches_type(Optional[Test], test, path=["response"]) @pytest.mark.skip() @parametrize @@ -501,7 +501,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" test = await response.parse() - assert_matches_type(Optional[ObservatoryPageTest], test, path=["response"]) + assert_matches_type(Optional[Test], test, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/storage/test_analytics.py b/tests/api_resources/storage/test_analytics.py index 22f2f3db517..0a6e3064dcf 100644 --- a/tests/api_resources/storage/test_analytics.py +++ b/tests/api_resources/storage/test_analytics.py @@ -10,10 +10,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare._utils import parse_datetime -from cloudflare.types.storage import ( - WorkersKVSchemasResult, - WorkersKVComponentsSchemasResult, -) +from cloudflare.types.storage import Schema, Components base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -27,7 +24,7 @@ def test_method_list(self, client: Cloudflare) -> None: analytics = client.storage.analytics.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(WorkersKVSchemasResult, analytics, path=["response"]) + assert_matches_type(Schema, analytics, path=["response"]) @pytest.mark.skip() @parametrize @@ -44,7 +41,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: "until": parse_datetime("2019-01-02T03:20:00Z"), }, ) - assert_matches_type(WorkersKVSchemasResult, analytics, path=["response"]) + assert_matches_type(Schema, analytics, path=["response"]) @pytest.mark.skip() @parametrize @@ -56,7 +53,7 @@ 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" analytics = response.parse() - assert_matches_type(WorkersKVSchemasResult, analytics, path=["response"]) + assert_matches_type(Schema, analytics, path=["response"]) @pytest.mark.skip() @parametrize @@ -68,7 +65,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" analytics = response.parse() - assert_matches_type(WorkersKVSchemasResult, analytics, path=["response"]) + assert_matches_type(Schema, analytics, path=["response"]) assert cast(Any, response.is_closed) is True @@ -86,7 +83,7 @@ def test_method_stored(self, client: Cloudflare) -> None: analytics = client.storage.analytics.stored( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(WorkersKVComponentsSchemasResult, analytics, path=["response"]) + assert_matches_type(Components, analytics, path=["response"]) @pytest.mark.skip() @parametrize @@ -103,7 +100,7 @@ def test_method_stored_with_all_params(self, client: Cloudflare) -> None: "until": parse_datetime("2019-01-02T03:20:00Z"), }, ) - assert_matches_type(WorkersKVComponentsSchemasResult, analytics, path=["response"]) + assert_matches_type(Components, analytics, path=["response"]) @pytest.mark.skip() @parametrize @@ -115,7 +112,7 @@ def test_raw_response_stored(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" analytics = response.parse() - assert_matches_type(WorkersKVComponentsSchemasResult, analytics, path=["response"]) + assert_matches_type(Components, analytics, path=["response"]) @pytest.mark.skip() @parametrize @@ -127,7 +124,7 @@ def test_streaming_response_stored(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" analytics = response.parse() - assert_matches_type(WorkersKVComponentsSchemasResult, analytics, path=["response"]) + assert_matches_type(Components, analytics, path=["response"]) assert cast(Any, response.is_closed) is True @@ -149,7 +146,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: analytics = await async_client.storage.analytics.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(WorkersKVSchemasResult, analytics, path=["response"]) + assert_matches_type(Schema, analytics, path=["response"]) @pytest.mark.skip() @parametrize @@ -166,7 +163,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) "until": parse_datetime("2019-01-02T03:20:00Z"), }, ) - assert_matches_type(WorkersKVSchemasResult, analytics, path=["response"]) + assert_matches_type(Schema, analytics, path=["response"]) @pytest.mark.skip() @parametrize @@ -178,7 +175,7 @@ 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" analytics = await response.parse() - assert_matches_type(WorkersKVSchemasResult, analytics, path=["response"]) + assert_matches_type(Schema, analytics, path=["response"]) @pytest.mark.skip() @parametrize @@ -190,7 +187,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" analytics = await response.parse() - assert_matches_type(WorkersKVSchemasResult, analytics, path=["response"]) + assert_matches_type(Schema, analytics, path=["response"]) assert cast(Any, response.is_closed) is True @@ -208,7 +205,7 @@ async def test_method_stored(self, async_client: AsyncCloudflare) -> None: analytics = await async_client.storage.analytics.stored( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(WorkersKVComponentsSchemasResult, analytics, path=["response"]) + assert_matches_type(Components, analytics, path=["response"]) @pytest.mark.skip() @parametrize @@ -225,7 +222,7 @@ async def test_method_stored_with_all_params(self, async_client: AsyncCloudflare "until": parse_datetime("2019-01-02T03:20:00Z"), }, ) - assert_matches_type(WorkersKVComponentsSchemasResult, analytics, path=["response"]) + assert_matches_type(Components, analytics, path=["response"]) @pytest.mark.skip() @parametrize @@ -237,7 +234,7 @@ async def test_raw_response_stored(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" analytics = await response.parse() - assert_matches_type(WorkersKVComponentsSchemasResult, analytics, path=["response"]) + assert_matches_type(Components, analytics, path=["response"]) @pytest.mark.skip() @parametrize @@ -249,7 +246,7 @@ async def test_streaming_response_stored(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" analytics = await response.parse() - assert_matches_type(WorkersKVComponentsSchemasResult, analytics, path=["response"]) + assert_matches_type(Components, analytics, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/stream/live_inputs/test_outputs.py b/tests/api_resources/stream/live_inputs/test_outputs.py index bd5e3668ca8..d9d1b07eb10 100644 --- a/tests/api_resources/stream/live_inputs/test_outputs.py +++ b/tests/api_resources/stream/live_inputs/test_outputs.py @@ -10,9 +10,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.pagination import SyncSinglePage, AsyncSinglePage -from cloudflare.types.stream.live_inputs import ( - StreamOutput, -) +from cloudflare.types.stream.live_inputs import Output base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -29,7 +27,7 @@ def test_method_create(self, client: Cloudflare) -> None: stream_key="uzya-f19y-g2g9-a2ee-51j2", url="rtmp://a.rtmp.youtube.com/live2", ) - assert_matches_type(StreamOutput, output, path=["response"]) + assert_matches_type(Output, output, path=["response"]) @pytest.mark.skip() @parametrize @@ -41,7 +39,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: url="rtmp://a.rtmp.youtube.com/live2", enabled=True, ) - assert_matches_type(StreamOutput, output, path=["response"]) + assert_matches_type(Output, output, path=["response"]) @pytest.mark.skip() @parametrize @@ -56,7 +54,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" output = response.parse() - assert_matches_type(StreamOutput, output, path=["response"]) + assert_matches_type(Output, output, path=["response"]) @pytest.mark.skip() @parametrize @@ -71,7 +69,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" output = response.parse() - assert_matches_type(StreamOutput, output, path=["response"]) + assert_matches_type(Output, output, path=["response"]) assert cast(Any, response.is_closed) is True @@ -103,7 +101,7 @@ def test_method_update(self, client: Cloudflare) -> None: live_input_identifier="66be4bf738797e01e1fca35a7bdecdcd", enabled=True, ) - assert_matches_type(StreamOutput, output, path=["response"]) + assert_matches_type(Output, output, path=["response"]) @pytest.mark.skip() @parametrize @@ -118,7 +116,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" output = response.parse() - assert_matches_type(StreamOutput, output, path=["response"]) + assert_matches_type(Output, output, path=["response"]) @pytest.mark.skip() @parametrize @@ -133,7 +131,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" output = response.parse() - assert_matches_type(StreamOutput, output, path=["response"]) + assert_matches_type(Output, output, path=["response"]) assert cast(Any, response.is_closed) is True @@ -171,7 +169,7 @@ def test_method_list(self, client: Cloudflare) -> None: "66be4bf738797e01e1fca35a7bdecdcd", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncSinglePage[StreamOutput], output, path=["response"]) + assert_matches_type(SyncSinglePage[Output], output, path=["response"]) @pytest.mark.skip() @parametrize @@ -184,7 +182,7 @@ 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" output = response.parse() - assert_matches_type(SyncSinglePage[StreamOutput], output, path=["response"]) + assert_matches_type(SyncSinglePage[Output], output, path=["response"]) @pytest.mark.skip() @parametrize @@ -197,7 +195,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" output = response.parse() - assert_matches_type(SyncSinglePage[StreamOutput], output, path=["response"]) + assert_matches_type(SyncSinglePage[Output], output, path=["response"]) assert cast(Any, response.is_closed) is True @@ -299,7 +297,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: stream_key="uzya-f19y-g2g9-a2ee-51j2", url="rtmp://a.rtmp.youtube.com/live2", ) - assert_matches_type(StreamOutput, output, path=["response"]) + assert_matches_type(Output, output, path=["response"]) @pytest.mark.skip() @parametrize @@ -311,7 +309,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare url="rtmp://a.rtmp.youtube.com/live2", enabled=True, ) - assert_matches_type(StreamOutput, output, path=["response"]) + assert_matches_type(Output, output, path=["response"]) @pytest.mark.skip() @parametrize @@ -326,7 +324,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" output = await response.parse() - assert_matches_type(StreamOutput, output, path=["response"]) + assert_matches_type(Output, output, path=["response"]) @pytest.mark.skip() @parametrize @@ -341,7 +339,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" output = await response.parse() - assert_matches_type(StreamOutput, output, path=["response"]) + assert_matches_type(Output, output, path=["response"]) assert cast(Any, response.is_closed) is True @@ -373,7 +371,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: live_input_identifier="66be4bf738797e01e1fca35a7bdecdcd", enabled=True, ) - assert_matches_type(StreamOutput, output, path=["response"]) + assert_matches_type(Output, output, path=["response"]) @pytest.mark.skip() @parametrize @@ -388,7 +386,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" output = await response.parse() - assert_matches_type(StreamOutput, output, path=["response"]) + assert_matches_type(Output, output, path=["response"]) @pytest.mark.skip() @parametrize @@ -403,7 +401,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" output = await response.parse() - assert_matches_type(StreamOutput, output, path=["response"]) + assert_matches_type(Output, output, path=["response"]) assert cast(Any, response.is_closed) is True @@ -441,7 +439,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: "66be4bf738797e01e1fca35a7bdecdcd", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncSinglePage[StreamOutput], output, path=["response"]) + assert_matches_type(AsyncSinglePage[Output], output, path=["response"]) @pytest.mark.skip() @parametrize @@ -454,7 +452,7 @@ 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" output = await response.parse() - assert_matches_type(AsyncSinglePage[StreamOutput], output, path=["response"]) + assert_matches_type(AsyncSinglePage[Output], output, path=["response"]) @pytest.mark.skip() @parametrize @@ -467,7 +465,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" output = await response.parse() - assert_matches_type(AsyncSinglePage[StreamOutput], output, path=["response"]) + assert_matches_type(AsyncSinglePage[Output], output, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/stream/test_audio_tracks.py b/tests/api_resources/stream/test_audio_tracks.py index a832f3bd63c..8342581ab94 100644 --- a/tests/api_resources/stream/test_audio_tracks.py +++ b/tests/api_resources/stream/test_audio_tracks.py @@ -10,7 +10,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.types.shared import UnnamedSchemaRef602dd5f63eab958d53da61434dec08f0 -from cloudflare.types.stream import StreamAudio, AudioTrackGetResponse +from cloudflare.types.stream import Audio, AudioTrackGetResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -90,7 +90,7 @@ def test_method_copy(self, client: Cloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", label="director commentary", ) - assert_matches_type(StreamAudio, audio_track, path=["response"]) + assert_matches_type(Audio, audio_track, path=["response"]) @pytest.mark.skip() @parametrize @@ -101,7 +101,7 @@ def test_method_copy_with_all_params(self, client: Cloudflare) -> None: label="director commentary", url="https://www.examplestorage.com/audio_file.mp3", ) - assert_matches_type(StreamAudio, audio_track, path=["response"]) + assert_matches_type(Audio, audio_track, path=["response"]) @pytest.mark.skip() @parametrize @@ -115,7 +115,7 @@ def test_raw_response_copy(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" audio_track = response.parse() - assert_matches_type(StreamAudio, audio_track, path=["response"]) + assert_matches_type(Audio, audio_track, path=["response"]) @pytest.mark.skip() @parametrize @@ -129,7 +129,7 @@ def test_streaming_response_copy(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" audio_track = response.parse() - assert_matches_type(StreamAudio, audio_track, path=["response"]) + assert_matches_type(Audio, audio_track, path=["response"]) assert cast(Any, response.is_closed) is True @@ -158,7 +158,7 @@ def test_method_edit(self, client: Cloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", identifier="ea95132c15732412d22c1476fa83f27a", ) - assert_matches_type(StreamAudio, audio_track, path=["response"]) + assert_matches_type(Audio, audio_track, path=["response"]) @pytest.mark.skip() @parametrize @@ -170,7 +170,7 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: default=True, label="director commentary", ) - assert_matches_type(StreamAudio, audio_track, path=["response"]) + assert_matches_type(Audio, audio_track, path=["response"]) @pytest.mark.skip() @parametrize @@ -184,7 +184,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" audio_track = response.parse() - assert_matches_type(StreamAudio, audio_track, path=["response"]) + assert_matches_type(Audio, audio_track, path=["response"]) @pytest.mark.skip() @parametrize @@ -198,7 +198,7 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" audio_track = response.parse() - assert_matches_type(StreamAudio, audio_track, path=["response"]) + assert_matches_type(Audio, audio_track, path=["response"]) assert cast(Any, response.is_closed) is True @@ -354,7 +354,7 @@ async def test_method_copy(self, async_client: AsyncCloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", label="director commentary", ) - assert_matches_type(StreamAudio, audio_track, path=["response"]) + assert_matches_type(Audio, audio_track, path=["response"]) @pytest.mark.skip() @parametrize @@ -365,7 +365,7 @@ async def test_method_copy_with_all_params(self, async_client: AsyncCloudflare) label="director commentary", url="https://www.examplestorage.com/audio_file.mp3", ) - assert_matches_type(StreamAudio, audio_track, path=["response"]) + assert_matches_type(Audio, audio_track, path=["response"]) @pytest.mark.skip() @parametrize @@ -379,7 +379,7 @@ async def test_raw_response_copy(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" audio_track = await response.parse() - assert_matches_type(StreamAudio, audio_track, path=["response"]) + assert_matches_type(Audio, audio_track, path=["response"]) @pytest.mark.skip() @parametrize @@ -393,7 +393,7 @@ async def test_streaming_response_copy(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" audio_track = await response.parse() - assert_matches_type(StreamAudio, audio_track, path=["response"]) + assert_matches_type(Audio, audio_track, path=["response"]) assert cast(Any, response.is_closed) is True @@ -422,7 +422,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", identifier="ea95132c15732412d22c1476fa83f27a", ) - assert_matches_type(StreamAudio, audio_track, path=["response"]) + assert_matches_type(Audio, audio_track, path=["response"]) @pytest.mark.skip() @parametrize @@ -434,7 +434,7 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) default=True, label="director commentary", ) - assert_matches_type(StreamAudio, audio_track, path=["response"]) + assert_matches_type(Audio, audio_track, path=["response"]) @pytest.mark.skip() @parametrize @@ -448,7 +448,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" audio_track = await response.parse() - assert_matches_type(StreamAudio, audio_track, path=["response"]) + assert_matches_type(Audio, audio_track, path=["response"]) @pytest.mark.skip() @parametrize @@ -462,7 +462,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" audio_track = await response.parse() - assert_matches_type(StreamAudio, audio_track, path=["response"]) + assert_matches_type(Audio, audio_track, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/stream/test_clip.py b/tests/api_resources/stream/test_clip.py index 7a39bd3d338..c87a34a4b12 100644 --- a/tests/api_resources/stream/test_clip.py +++ b/tests/api_resources/stream/test_clip.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.stream import StreamClipping +from cloudflare.types.stream import Clip base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -26,7 +26,7 @@ def test_method_create(self, client: Cloudflare) -> None: end_time_seconds=0, start_time_seconds=0, ) - assert_matches_type(StreamClipping, clip, path=["response"]) + assert_matches_type(Clip, clip, path=["response"]) @pytest.mark.skip() @parametrize @@ -43,7 +43,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: thumbnail_timestamp_pct=0.529241, watermark={"uid": "ea95132c15732412d22c1476fa83f27a"}, ) - assert_matches_type(StreamClipping, clip, path=["response"]) + assert_matches_type(Clip, clip, path=["response"]) @pytest.mark.skip() @parametrize @@ -58,7 +58,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" clip = response.parse() - assert_matches_type(StreamClipping, clip, path=["response"]) + assert_matches_type(Clip, clip, path=["response"]) @pytest.mark.skip() @parametrize @@ -73,7 +73,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" clip = response.parse() - assert_matches_type(StreamClipping, clip, path=["response"]) + assert_matches_type(Clip, clip, path=["response"]) assert cast(Any, response.is_closed) is True @@ -101,7 +101,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: end_time_seconds=0, start_time_seconds=0, ) - assert_matches_type(StreamClipping, clip, path=["response"]) + assert_matches_type(Clip, clip, path=["response"]) @pytest.mark.skip() @parametrize @@ -118,7 +118,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare thumbnail_timestamp_pct=0.529241, watermark={"uid": "ea95132c15732412d22c1476fa83f27a"}, ) - assert_matches_type(StreamClipping, clip, path=["response"]) + assert_matches_type(Clip, clip, path=["response"]) @pytest.mark.skip() @parametrize @@ -133,7 +133,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" clip = await response.parse() - assert_matches_type(StreamClipping, clip, path=["response"]) + assert_matches_type(Clip, clip, path=["response"]) @pytest.mark.skip() @parametrize @@ -148,7 +148,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" clip = await response.parse() - assert_matches_type(StreamClipping, clip, path=["response"]) + assert_matches_type(Clip, clip, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/stream/test_copy.py b/tests/api_resources/stream/test_copy.py index 84ecfc0a992..ef0c4259030 100644 --- a/tests/api_resources/stream/test_copy.py +++ b/tests/api_resources/stream/test_copy.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types import StreamVideos +from cloudflare.types import Video from cloudflare._utils import parse_datetime base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -25,7 +25,7 @@ def test_method_create(self, client: Cloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", url="https://example.com/myvideo.mp4", ) - assert_matches_type(StreamVideos, copy, path=["response"]) + assert_matches_type(Video, copy, path=["response"]) @pytest.mark.skip() @parametrize @@ -41,7 +41,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: thumbnail_timestamp_pct=0.529241, watermark={"uid": "ea95132c15732412d22c1476fa83f27a"}, ) - assert_matches_type(StreamVideos, copy, path=["response"]) + assert_matches_type(Video, copy, path=["response"]) @pytest.mark.skip() @parametrize @@ -54,7 +54,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" copy = response.parse() - assert_matches_type(StreamVideos, copy, path=["response"]) + assert_matches_type(Video, copy, path=["response"]) @pytest.mark.skip() @parametrize @@ -67,7 +67,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" copy = response.parse() - assert_matches_type(StreamVideos, copy, path=["response"]) + assert_matches_type(Video, copy, path=["response"]) assert cast(Any, response.is_closed) is True @@ -91,7 +91,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", url="https://example.com/myvideo.mp4", ) - assert_matches_type(StreamVideos, copy, path=["response"]) + assert_matches_type(Video, copy, path=["response"]) @pytest.mark.skip() @parametrize @@ -107,7 +107,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare thumbnail_timestamp_pct=0.529241, watermark={"uid": "ea95132c15732412d22c1476fa83f27a"}, ) - assert_matches_type(StreamVideos, copy, path=["response"]) + assert_matches_type(Video, copy, path=["response"]) @pytest.mark.skip() @parametrize @@ -120,7 +120,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" copy = await response.parse() - assert_matches_type(StreamVideos, copy, path=["response"]) + assert_matches_type(Video, copy, path=["response"]) @pytest.mark.skip() @parametrize @@ -133,7 +133,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" copy = await response.parse() - assert_matches_type(StreamVideos, copy, path=["response"]) + assert_matches_type(Video, copy, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/stream/test_keys.py b/tests/api_resources/stream/test_keys.py index 178ecb20d1a..40883038b82 100644 --- a/tests/api_resources/stream/test_keys.py +++ b/tests/api_resources/stream/test_keys.py @@ -10,7 +10,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.types.shared import UnnamedSchemaRef602dd5f63eab958d53da61434dec08f0 -from cloudflare.types.stream import StreamKeys, KeyGetResponse +from cloudflare.types.stream import Keys, KeyGetResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -25,7 +25,7 @@ def test_method_create(self, client: Cloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", body={}, ) - assert_matches_type(StreamKeys, key, path=["response"]) + assert_matches_type(Keys, key, path=["response"]) @pytest.mark.skip() @parametrize @@ -38,7 +38,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" key = response.parse() - assert_matches_type(StreamKeys, key, path=["response"]) + assert_matches_type(Keys, key, path=["response"]) @pytest.mark.skip() @parametrize @@ -51,7 +51,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" key = response.parse() - assert_matches_type(StreamKeys, key, path=["response"]) + assert_matches_type(Keys, key, path=["response"]) assert cast(Any, response.is_closed) is True @@ -174,7 +174,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", body={}, ) - assert_matches_type(StreamKeys, key, path=["response"]) + assert_matches_type(Keys, key, path=["response"]) @pytest.mark.skip() @parametrize @@ -187,7 +187,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" key = await response.parse() - assert_matches_type(StreamKeys, key, path=["response"]) + assert_matches_type(Keys, key, path=["response"]) @pytest.mark.skip() @parametrize @@ -200,7 +200,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" key = await response.parse() - assert_matches_type(StreamKeys, key, path=["response"]) + assert_matches_type(Keys, key, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/stream/test_live_inputs.py b/tests/api_resources/stream/test_live_inputs.py index b9120dde6ab..6daaa1bafef 100644 --- a/tests/api_resources/stream/test_live_inputs.py +++ b/tests/api_resources/stream/test_live_inputs.py @@ -10,7 +10,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.types.stream import ( - StreamLiveInput, + LiveInput, LiveInputListResponse, ) @@ -26,7 +26,7 @@ def test_method_create(self, client: Cloudflare) -> None: live_input = client.stream.live_inputs.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(StreamLiveInput, live_input, path=["response"]) + assert_matches_type(LiveInput, live_input, path=["response"]) @pytest.mark.skip() @parametrize @@ -43,7 +43,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: "timeout_seconds": 0, }, ) - assert_matches_type(StreamLiveInput, live_input, path=["response"]) + assert_matches_type(LiveInput, live_input, path=["response"]) @pytest.mark.skip() @parametrize @@ -55,7 +55,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" live_input = response.parse() - assert_matches_type(StreamLiveInput, live_input, path=["response"]) + assert_matches_type(LiveInput, live_input, path=["response"]) @pytest.mark.skip() @parametrize @@ -67,7 +67,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" live_input = response.parse() - assert_matches_type(StreamLiveInput, live_input, path=["response"]) + assert_matches_type(LiveInput, live_input, path=["response"]) assert cast(Any, response.is_closed) is True @@ -86,7 +86,7 @@ def test_method_update(self, client: Cloudflare) -> None: "66be4bf738797e01e1fca35a7bdecdcd", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(StreamLiveInput, live_input, path=["response"]) + assert_matches_type(LiveInput, live_input, path=["response"]) @pytest.mark.skip() @parametrize @@ -104,7 +104,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: "timeout_seconds": 0, }, ) - assert_matches_type(StreamLiveInput, live_input, path=["response"]) + assert_matches_type(LiveInput, live_input, path=["response"]) @pytest.mark.skip() @parametrize @@ -117,7 +117,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" live_input = response.parse() - assert_matches_type(StreamLiveInput, live_input, path=["response"]) + assert_matches_type(LiveInput, live_input, path=["response"]) @pytest.mark.skip() @parametrize @@ -130,7 +130,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" live_input = response.parse() - assert_matches_type(StreamLiveInput, live_input, path=["response"]) + assert_matches_type(LiveInput, live_input, path=["response"]) assert cast(Any, response.is_closed) is True @@ -264,7 +264,7 @@ def test_method_get(self, client: Cloudflare) -> None: "66be4bf738797e01e1fca35a7bdecdcd", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(StreamLiveInput, live_input, path=["response"]) + assert_matches_type(LiveInput, live_input, path=["response"]) @pytest.mark.skip() @parametrize @@ -277,7 +277,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" live_input = response.parse() - assert_matches_type(StreamLiveInput, live_input, path=["response"]) + assert_matches_type(LiveInput, live_input, path=["response"]) @pytest.mark.skip() @parametrize @@ -290,7 +290,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" live_input = response.parse() - assert_matches_type(StreamLiveInput, live_input, path=["response"]) + assert_matches_type(LiveInput, live_input, path=["response"]) assert cast(Any, response.is_closed) is True @@ -319,7 +319,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: live_input = await async_client.stream.live_inputs.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(StreamLiveInput, live_input, path=["response"]) + assert_matches_type(LiveInput, live_input, path=["response"]) @pytest.mark.skip() @parametrize @@ -336,7 +336,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare "timeout_seconds": 0, }, ) - assert_matches_type(StreamLiveInput, live_input, path=["response"]) + assert_matches_type(LiveInput, live_input, path=["response"]) @pytest.mark.skip() @parametrize @@ -348,7 +348,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" live_input = await response.parse() - assert_matches_type(StreamLiveInput, live_input, path=["response"]) + assert_matches_type(LiveInput, live_input, path=["response"]) @pytest.mark.skip() @parametrize @@ -360,7 +360,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" live_input = await response.parse() - assert_matches_type(StreamLiveInput, live_input, path=["response"]) + assert_matches_type(LiveInput, live_input, path=["response"]) assert cast(Any, response.is_closed) is True @@ -379,7 +379,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: "66be4bf738797e01e1fca35a7bdecdcd", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(StreamLiveInput, live_input, path=["response"]) + assert_matches_type(LiveInput, live_input, path=["response"]) @pytest.mark.skip() @parametrize @@ -397,7 +397,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare "timeout_seconds": 0, }, ) - assert_matches_type(StreamLiveInput, live_input, path=["response"]) + assert_matches_type(LiveInput, live_input, path=["response"]) @pytest.mark.skip() @parametrize @@ -410,7 +410,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" live_input = await response.parse() - assert_matches_type(StreamLiveInput, live_input, path=["response"]) + assert_matches_type(LiveInput, live_input, path=["response"]) @pytest.mark.skip() @parametrize @@ -423,7 +423,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" live_input = await response.parse() - assert_matches_type(StreamLiveInput, live_input, path=["response"]) + assert_matches_type(LiveInput, live_input, path=["response"]) assert cast(Any, response.is_closed) is True @@ -557,7 +557,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: "66be4bf738797e01e1fca35a7bdecdcd", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(StreamLiveInput, live_input, path=["response"]) + assert_matches_type(LiveInput, live_input, path=["response"]) @pytest.mark.skip() @parametrize @@ -570,7 +570,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" live_input = await response.parse() - assert_matches_type(StreamLiveInput, live_input, path=["response"]) + assert_matches_type(LiveInput, live_input, path=["response"]) @pytest.mark.skip() @parametrize @@ -583,7 +583,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" live_input = await response.parse() - assert_matches_type(StreamLiveInput, live_input, path=["response"]) + assert_matches_type(LiveInput, live_input, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/stream/test_watermarks.py b/tests/api_resources/stream/test_watermarks.py index 9a68102941c..304774e6b4b 100644 --- a/tests/api_resources/stream/test_watermarks.py +++ b/tests/api_resources/stream/test_watermarks.py @@ -14,7 +14,7 @@ UnnamedSchemaRef602dd5f63eab958d53da61434dec08f0, UnnamedSchemaRef9444735ca60712dbcf8afd832eb5716a, ) -from cloudflare.types.stream import StreamWatermarks +from cloudflare.types.stream import Watermaks base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -88,7 +88,7 @@ def test_method_list(self, client: Cloudflare) -> None: watermark = client.stream.watermarks.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncSinglePage[StreamWatermarks], watermark, path=["response"]) + assert_matches_type(SyncSinglePage[Watermaks], watermark, path=["response"]) @pytest.mark.skip() @parametrize @@ -100,7 +100,7 @@ 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" watermark = response.parse() - assert_matches_type(SyncSinglePage[StreamWatermarks], watermark, path=["response"]) + assert_matches_type(SyncSinglePage[Watermaks], watermark, path=["response"]) @pytest.mark.skip() @parametrize @@ -112,7 +112,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" watermark = response.parse() - assert_matches_type(SyncSinglePage[StreamWatermarks], watermark, path=["response"]) + assert_matches_type(SyncSinglePage[Watermaks], watermark, path=["response"]) assert cast(Any, response.is_closed) is True @@ -303,7 +303,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: watermark = await async_client.stream.watermarks.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncSinglePage[StreamWatermarks], watermark, path=["response"]) + assert_matches_type(AsyncSinglePage[Watermaks], watermark, path=["response"]) @pytest.mark.skip() @parametrize @@ -315,7 +315,7 @@ 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" watermark = await response.parse() - assert_matches_type(AsyncSinglePage[StreamWatermarks], watermark, path=["response"]) + assert_matches_type(AsyncSinglePage[Watermaks], watermark, path=["response"]) @pytest.mark.skip() @parametrize @@ -327,7 +327,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" watermark = await response.parse() - assert_matches_type(AsyncSinglePage[StreamWatermarks], watermark, path=["response"]) + assert_matches_type(AsyncSinglePage[Watermaks], watermark, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_brand_protection.py b/tests/api_resources/test_brand_protection.py index cd7a5c57245..8dac9fc9c60 100644 --- a/tests/api_resources/test_brand_protection.py +++ b/tests/api_resources/test_brand_protection.py @@ -9,10 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types import ( - IntelPhishingURLInfo, - IntelPhishingURLSubmit, -) +from cloudflare.types import Info, Submit base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -26,7 +23,7 @@ def test_method_submit(self, client: Cloudflare) -> None: brand_protection = client.brand_protection.submit( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(IntelPhishingURLSubmit, brand_protection, path=["response"]) + assert_matches_type(Submit, brand_protection, path=["response"]) @pytest.mark.skip() @parametrize @@ -35,7 +32,7 @@ def test_method_submit_with_all_params(self, client: Cloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", url="https://www.cloudflare.com", ) - assert_matches_type(IntelPhishingURLSubmit, brand_protection, path=["response"]) + assert_matches_type(Submit, brand_protection, path=["response"]) @pytest.mark.skip() @parametrize @@ -47,7 +44,7 @@ def test_raw_response_submit(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" brand_protection = response.parse() - assert_matches_type(IntelPhishingURLSubmit, brand_protection, path=["response"]) + assert_matches_type(Submit, brand_protection, path=["response"]) @pytest.mark.skip() @parametrize @@ -59,7 +56,7 @@ def test_streaming_response_submit(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" brand_protection = response.parse() - assert_matches_type(IntelPhishingURLSubmit, brand_protection, path=["response"]) + assert_matches_type(Submit, brand_protection, path=["response"]) assert cast(Any, response.is_closed) is True @@ -77,7 +74,7 @@ def test_method_url_info(self, client: Cloudflare) -> None: brand_protection = client.brand_protection.url_info( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(IntelPhishingURLInfo, brand_protection, path=["response"]) + assert_matches_type(Info, brand_protection, path=["response"]) @pytest.mark.skip() @parametrize @@ -87,7 +84,7 @@ def test_method_url_info_with_all_params(self, client: Cloudflare) -> None: url="string", url_id_param={"url_id": 0}, ) - assert_matches_type(IntelPhishingURLInfo, brand_protection, path=["response"]) + assert_matches_type(Info, brand_protection, path=["response"]) @pytest.mark.skip() @parametrize @@ -99,7 +96,7 @@ def test_raw_response_url_info(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" brand_protection = response.parse() - assert_matches_type(IntelPhishingURLInfo, brand_protection, path=["response"]) + assert_matches_type(Info, brand_protection, path=["response"]) @pytest.mark.skip() @parametrize @@ -111,7 +108,7 @@ def test_streaming_response_url_info(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" brand_protection = response.parse() - assert_matches_type(IntelPhishingURLInfo, brand_protection, path=["response"]) + assert_matches_type(Info, brand_protection, path=["response"]) assert cast(Any, response.is_closed) is True @@ -133,7 +130,7 @@ async def test_method_submit(self, async_client: AsyncCloudflare) -> None: brand_protection = await async_client.brand_protection.submit( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(IntelPhishingURLSubmit, brand_protection, path=["response"]) + assert_matches_type(Submit, brand_protection, path=["response"]) @pytest.mark.skip() @parametrize @@ -142,7 +139,7 @@ async def test_method_submit_with_all_params(self, async_client: AsyncCloudflare account_id="023e105f4ecef8ad9ca31a8372d0c353", url="https://www.cloudflare.com", ) - assert_matches_type(IntelPhishingURLSubmit, brand_protection, path=["response"]) + assert_matches_type(Submit, brand_protection, path=["response"]) @pytest.mark.skip() @parametrize @@ -154,7 +151,7 @@ async def test_raw_response_submit(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" brand_protection = await response.parse() - assert_matches_type(IntelPhishingURLSubmit, brand_protection, path=["response"]) + assert_matches_type(Submit, brand_protection, path=["response"]) @pytest.mark.skip() @parametrize @@ -166,7 +163,7 @@ async def test_streaming_response_submit(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" brand_protection = await response.parse() - assert_matches_type(IntelPhishingURLSubmit, brand_protection, path=["response"]) + assert_matches_type(Submit, brand_protection, path=["response"]) assert cast(Any, response.is_closed) is True @@ -184,7 +181,7 @@ async def test_method_url_info(self, async_client: AsyncCloudflare) -> None: brand_protection = await async_client.brand_protection.url_info( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(IntelPhishingURLInfo, brand_protection, path=["response"]) + assert_matches_type(Info, brand_protection, path=["response"]) @pytest.mark.skip() @parametrize @@ -194,7 +191,7 @@ async def test_method_url_info_with_all_params(self, async_client: AsyncCloudfla url="string", url_id_param={"url_id": 0}, ) - assert_matches_type(IntelPhishingURLInfo, brand_protection, path=["response"]) + assert_matches_type(Info, brand_protection, path=["response"]) @pytest.mark.skip() @parametrize @@ -206,7 +203,7 @@ async def test_raw_response_url_info(self, async_client: AsyncCloudflare) -> Non assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" brand_protection = await response.parse() - assert_matches_type(IntelPhishingURLInfo, brand_protection, path=["response"]) + assert_matches_type(Info, brand_protection, path=["response"]) @pytest.mark.skip() @parametrize @@ -218,7 +215,7 @@ async def test_streaming_response_url_info(self, async_client: AsyncCloudflare) assert response.http_request.headers.get("X-Stainless-Lang") == "python" brand_protection = await response.parse() - assert_matches_type(IntelPhishingURLInfo, brand_protection, path=["response"]) + assert_matches_type(Info, brand_protection, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_custom_hostnames.py b/tests/api_resources/test_custom_hostnames.py index 3e55370cd11..bd784e3d6f1 100644 --- a/tests/api_resources/test_custom_hostnames.py +++ b/tests/api_resources/test_custom_hostnames.py @@ -10,10 +10,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.types import ( - CustomHostnameGetResponse, - CustomHostnameEditResponse, - CustomHostnameListResponse, - CustomHostnameCreateResponse, + CustomHostname, ) from cloudflare.pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray from cloudflare.types.shared import UnnamedSchemaRef8900f4cb9dca9b9ed0ac41ad571e6837 @@ -32,7 +29,7 @@ def test_method_create(self, client: Cloudflare) -> None: hostname="app.example.com", ssl={}, ) - assert_matches_type(CustomHostnameCreateResponse, custom_hostname, path=["response"]) + assert_matches_type(CustomHostname, custom_hostname, path=["response"]) @pytest.mark.skip() @parametrize @@ -58,7 +55,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: }, custom_metadata={"key": "value"}, ) - assert_matches_type(CustomHostnameCreateResponse, custom_hostname, path=["response"]) + assert_matches_type(CustomHostname, custom_hostname, path=["response"]) @pytest.mark.skip() @parametrize @@ -72,7 +69,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_hostname = response.parse() - assert_matches_type(CustomHostnameCreateResponse, custom_hostname, path=["response"]) + assert_matches_type(CustomHostname, custom_hostname, path=["response"]) @pytest.mark.skip() @parametrize @@ -86,7 +83,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_hostname = response.parse() - assert_matches_type(CustomHostnameCreateResponse, custom_hostname, path=["response"]) + assert_matches_type(CustomHostname, custom_hostname, path=["response"]) assert cast(Any, response.is_closed) is True @@ -106,7 +103,7 @@ def test_method_list(self, client: Cloudflare) -> None: custom_hostname = client.custom_hostnames.list( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncV4PagePaginationArray[CustomHostnameListResponse], custom_hostname, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[CustomHostname], custom_hostname, path=["response"]) @pytest.mark.skip() @parametrize @@ -121,7 +118,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: per_page=5, ssl=0, ) - assert_matches_type(SyncV4PagePaginationArray[CustomHostnameListResponse], custom_hostname, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[CustomHostname], custom_hostname, path=["response"]) @pytest.mark.skip() @parametrize @@ -133,7 +130,7 @@ 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" custom_hostname = response.parse() - assert_matches_type(SyncV4PagePaginationArray[CustomHostnameListResponse], custom_hostname, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[CustomHostname], custom_hostname, path=["response"]) @pytest.mark.skip() @parametrize @@ -145,9 +142,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_hostname = response.parse() - assert_matches_type( - SyncV4PagePaginationArray[CustomHostnameListResponse], custom_hostname, path=["response"] - ) + assert_matches_type(SyncV4PagePaginationArray[CustomHostname], custom_hostname, path=["response"]) assert cast(Any, response.is_closed) is True @@ -223,7 +218,7 @@ def test_method_edit(self, client: Cloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(CustomHostnameEditResponse, custom_hostname, path=["response"]) + assert_matches_type(CustomHostname, custom_hostname, path=["response"]) @pytest.mark.skip() @parametrize @@ -251,7 +246,7 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: "wildcard": False, }, ) - assert_matches_type(CustomHostnameEditResponse, custom_hostname, path=["response"]) + assert_matches_type(CustomHostname, custom_hostname, path=["response"]) @pytest.mark.skip() @parametrize @@ -264,7 +259,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_hostname = response.parse() - assert_matches_type(CustomHostnameEditResponse, custom_hostname, path=["response"]) + assert_matches_type(CustomHostname, custom_hostname, path=["response"]) @pytest.mark.skip() @parametrize @@ -277,7 +272,7 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_hostname = response.parse() - assert_matches_type(CustomHostnameEditResponse, custom_hostname, path=["response"]) + assert_matches_type(CustomHostname, custom_hostname, path=["response"]) assert cast(Any, response.is_closed) is True @@ -303,7 +298,7 @@ def test_method_get(self, client: Cloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(CustomHostnameGetResponse, custom_hostname, path=["response"]) + assert_matches_type(CustomHostname, custom_hostname, path=["response"]) @pytest.mark.skip() @parametrize @@ -316,7 +311,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_hostname = response.parse() - assert_matches_type(CustomHostnameGetResponse, custom_hostname, path=["response"]) + assert_matches_type(CustomHostname, custom_hostname, path=["response"]) @pytest.mark.skip() @parametrize @@ -329,7 +324,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_hostname = response.parse() - assert_matches_type(CustomHostnameGetResponse, custom_hostname, path=["response"]) + assert_matches_type(CustomHostname, custom_hostname, path=["response"]) assert cast(Any, response.is_closed) is True @@ -360,7 +355,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: hostname="app.example.com", ssl={}, ) - assert_matches_type(CustomHostnameCreateResponse, custom_hostname, path=["response"]) + assert_matches_type(CustomHostname, custom_hostname, path=["response"]) @pytest.mark.skip() @parametrize @@ -386,7 +381,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare }, custom_metadata={"key": "value"}, ) - assert_matches_type(CustomHostnameCreateResponse, custom_hostname, path=["response"]) + assert_matches_type(CustomHostname, custom_hostname, path=["response"]) @pytest.mark.skip() @parametrize @@ -400,7 +395,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_hostname = await response.parse() - assert_matches_type(CustomHostnameCreateResponse, custom_hostname, path=["response"]) + assert_matches_type(CustomHostname, custom_hostname, path=["response"]) @pytest.mark.skip() @parametrize @@ -414,7 +409,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_hostname = await response.parse() - assert_matches_type(CustomHostnameCreateResponse, custom_hostname, path=["response"]) + assert_matches_type(CustomHostname, custom_hostname, path=["response"]) assert cast(Any, response.is_closed) is True @@ -434,7 +429,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: custom_hostname = await async_client.custom_hostnames.list( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncV4PagePaginationArray[CustomHostnameListResponse], custom_hostname, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[CustomHostname], custom_hostname, path=["response"]) @pytest.mark.skip() @parametrize @@ -449,7 +444,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) per_page=5, ssl=0, ) - assert_matches_type(AsyncV4PagePaginationArray[CustomHostnameListResponse], custom_hostname, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[CustomHostname], custom_hostname, path=["response"]) @pytest.mark.skip() @parametrize @@ -461,7 +456,7 @@ 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" custom_hostname = await response.parse() - assert_matches_type(AsyncV4PagePaginationArray[CustomHostnameListResponse], custom_hostname, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[CustomHostname], custom_hostname, path=["response"]) @pytest.mark.skip() @parametrize @@ -473,9 +468,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_hostname = await response.parse() - assert_matches_type( - AsyncV4PagePaginationArray[CustomHostnameListResponse], custom_hostname, path=["response"] - ) + assert_matches_type(AsyncV4PagePaginationArray[CustomHostname], custom_hostname, path=["response"]) assert cast(Any, response.is_closed) is True @@ -551,7 +544,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(CustomHostnameEditResponse, custom_hostname, path=["response"]) + assert_matches_type(CustomHostname, custom_hostname, path=["response"]) @pytest.mark.skip() @parametrize @@ -579,7 +572,7 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) "wildcard": False, }, ) - assert_matches_type(CustomHostnameEditResponse, custom_hostname, path=["response"]) + assert_matches_type(CustomHostname, custom_hostname, path=["response"]) @pytest.mark.skip() @parametrize @@ -592,7 +585,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_hostname = await response.parse() - assert_matches_type(CustomHostnameEditResponse, custom_hostname, path=["response"]) + assert_matches_type(CustomHostname, custom_hostname, path=["response"]) @pytest.mark.skip() @parametrize @@ -605,7 +598,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_hostname = await response.parse() - assert_matches_type(CustomHostnameEditResponse, custom_hostname, path=["response"]) + assert_matches_type(CustomHostname, custom_hostname, path=["response"]) assert cast(Any, response.is_closed) is True @@ -631,7 +624,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(CustomHostnameGetResponse, custom_hostname, path=["response"]) + assert_matches_type(CustomHostname, custom_hostname, path=["response"]) @pytest.mark.skip() @parametrize @@ -644,7 +637,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_hostname = await response.parse() - assert_matches_type(CustomHostnameGetResponse, custom_hostname, path=["response"]) + assert_matches_type(CustomHostname, custom_hostname, path=["response"]) @pytest.mark.skip() @parametrize @@ -657,7 +650,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_hostname = await response.parse() - assert_matches_type(CustomHostnameGetResponse, custom_hostname, path=["response"]) + assert_matches_type(CustomHostname, custom_hostname, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_email_routing.py b/tests/api_resources/test_email_routing.py index 138f47222f6..a7a475c9ee7 100644 --- a/tests/api_resources/test_email_routing.py +++ b/tests/api_resources/test_email_routing.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types import EmailSettings +from cloudflare.types import Settings base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -24,7 +24,7 @@ def test_method_disable(self, client: Cloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", body={}, ) - assert_matches_type(EmailSettings, email_routing, path=["response"]) + assert_matches_type(Settings, email_routing, path=["response"]) @pytest.mark.skip() @parametrize @@ -37,7 +37,7 @@ def test_raw_response_disable(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" email_routing = response.parse() - assert_matches_type(EmailSettings, email_routing, path=["response"]) + assert_matches_type(Settings, email_routing, path=["response"]) @pytest.mark.skip() @parametrize @@ -50,7 +50,7 @@ def test_streaming_response_disable(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" email_routing = response.parse() - assert_matches_type(EmailSettings, email_routing, path=["response"]) + assert_matches_type(Settings, email_routing, path=["response"]) assert cast(Any, response.is_closed) is True @@ -70,7 +70,7 @@ def test_method_enable(self, client: Cloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", body={}, ) - assert_matches_type(EmailSettings, email_routing, path=["response"]) + assert_matches_type(Settings, email_routing, path=["response"]) @pytest.mark.skip() @parametrize @@ -83,7 +83,7 @@ def test_raw_response_enable(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" email_routing = response.parse() - assert_matches_type(EmailSettings, email_routing, path=["response"]) + assert_matches_type(Settings, email_routing, path=["response"]) @pytest.mark.skip() @parametrize @@ -96,7 +96,7 @@ def test_streaming_response_enable(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" email_routing = response.parse() - assert_matches_type(EmailSettings, email_routing, path=["response"]) + assert_matches_type(Settings, email_routing, path=["response"]) assert cast(Any, response.is_closed) is True @@ -115,7 +115,7 @@ def test_method_get(self, client: Cloudflare) -> None: email_routing = client.email_routing.get( "023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(EmailSettings, email_routing, path=["response"]) + assert_matches_type(Settings, email_routing, path=["response"]) @pytest.mark.skip() @parametrize @@ -127,7 +127,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" email_routing = response.parse() - assert_matches_type(EmailSettings, email_routing, path=["response"]) + assert_matches_type(Settings, email_routing, path=["response"]) @pytest.mark.skip() @parametrize @@ -139,7 +139,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" email_routing = response.parse() - assert_matches_type(EmailSettings, email_routing, path=["response"]) + assert_matches_type(Settings, email_routing, path=["response"]) assert cast(Any, response.is_closed) is True @@ -162,7 +162,7 @@ async def test_method_disable(self, async_client: AsyncCloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", body={}, ) - assert_matches_type(EmailSettings, email_routing, path=["response"]) + assert_matches_type(Settings, email_routing, path=["response"]) @pytest.mark.skip() @parametrize @@ -175,7 +175,7 @@ async def test_raw_response_disable(self, async_client: AsyncCloudflare) -> None assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" email_routing = await response.parse() - assert_matches_type(EmailSettings, email_routing, path=["response"]) + assert_matches_type(Settings, email_routing, path=["response"]) @pytest.mark.skip() @parametrize @@ -188,7 +188,7 @@ async def test_streaming_response_disable(self, async_client: AsyncCloudflare) - assert response.http_request.headers.get("X-Stainless-Lang") == "python" email_routing = await response.parse() - assert_matches_type(EmailSettings, email_routing, path=["response"]) + assert_matches_type(Settings, email_routing, path=["response"]) assert cast(Any, response.is_closed) is True @@ -208,7 +208,7 @@ async def test_method_enable(self, async_client: AsyncCloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", body={}, ) - assert_matches_type(EmailSettings, email_routing, path=["response"]) + assert_matches_type(Settings, email_routing, path=["response"]) @pytest.mark.skip() @parametrize @@ -221,7 +221,7 @@ async def test_raw_response_enable(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" email_routing = await response.parse() - assert_matches_type(EmailSettings, email_routing, path=["response"]) + assert_matches_type(Settings, email_routing, path=["response"]) @pytest.mark.skip() @parametrize @@ -234,7 +234,7 @@ async def test_streaming_response_enable(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" email_routing = await response.parse() - assert_matches_type(EmailSettings, email_routing, path=["response"]) + assert_matches_type(Settings, email_routing, path=["response"]) assert cast(Any, response.is_closed) is True @@ -253,7 +253,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: email_routing = await async_client.email_routing.get( "023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(EmailSettings, email_routing, path=["response"]) + assert_matches_type(Settings, email_routing, path=["response"]) @pytest.mark.skip() @parametrize @@ -265,7 +265,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" email_routing = await response.parse() - assert_matches_type(EmailSettings, email_routing, path=["response"]) + assert_matches_type(Settings, email_routing, path=["response"]) @pytest.mark.skip() @parametrize @@ -277,7 +277,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" email_routing = await response.parse() - assert_matches_type(EmailSettings, email_routing, path=["response"]) + assert_matches_type(Settings, email_routing, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_filters.py b/tests/api_resources/test_filters.py index 69b3b262b51..8a28414e499 100644 --- a/tests/api_resources/test_filters.py +++ b/tests/api_resources/test_filters.py @@ -10,8 +10,11 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.types import ( - FirewallFilter, + FilterGetResponse, + FilterListResponse, FilterCreateResponse, + FilterDeleteResponse, + FilterUpdateResponse, ) from cloudflare.pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray @@ -75,7 +78,7 @@ def test_method_update(self, client: Cloudflare) -> None: zone_identifier="023e105f4ecef8ad9ca31a8372d0c353", body={}, ) - assert_matches_type(Optional[FirewallFilter], filter, path=["response"]) + assert_matches_type(FilterUpdateResponse, filter, path=["response"]) @pytest.mark.skip() @parametrize @@ -89,7 +92,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" filter = response.parse() - assert_matches_type(Optional[FirewallFilter], filter, path=["response"]) + assert_matches_type(FilterUpdateResponse, filter, path=["response"]) @pytest.mark.skip() @parametrize @@ -103,7 +106,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" filter = response.parse() - assert_matches_type(Optional[FirewallFilter], filter, path=["response"]) + assert_matches_type(FilterUpdateResponse, filter, path=["response"]) assert cast(Any, response.is_closed) is True @@ -130,7 +133,7 @@ def test_method_list(self, client: Cloudflare) -> None: filter = client.filters.list( "023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncV4PagePaginationArray[FirewallFilter], filter, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[FilterListResponse], filter, path=["response"]) @pytest.mark.skip() @parametrize @@ -145,7 +148,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: per_page=5, ref="FIL-100", ) - assert_matches_type(SyncV4PagePaginationArray[FirewallFilter], filter, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[FilterListResponse], filter, path=["response"]) @pytest.mark.skip() @parametrize @@ -157,7 +160,7 @@ 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" filter = response.parse() - assert_matches_type(SyncV4PagePaginationArray[FirewallFilter], filter, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[FilterListResponse], filter, path=["response"]) @pytest.mark.skip() @parametrize @@ -169,7 +172,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" filter = response.parse() - assert_matches_type(SyncV4PagePaginationArray[FirewallFilter], filter, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[FilterListResponse], filter, path=["response"]) assert cast(Any, response.is_closed) is True @@ -189,7 +192,7 @@ def test_method_delete(self, client: Cloudflare) -> None: zone_identifier="023e105f4ecef8ad9ca31a8372d0c353", body={}, ) - assert_matches_type(Optional[FirewallFilter], filter, path=["response"]) + assert_matches_type(FilterDeleteResponse, filter, path=["response"]) @pytest.mark.skip() @parametrize @@ -203,7 +206,7 @@ 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" filter = response.parse() - assert_matches_type(Optional[FirewallFilter], filter, path=["response"]) + assert_matches_type(FilterDeleteResponse, filter, path=["response"]) @pytest.mark.skip() @parametrize @@ -217,7 +220,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" filter = response.parse() - assert_matches_type(Optional[FirewallFilter], filter, path=["response"]) + assert_matches_type(FilterDeleteResponse, filter, path=["response"]) assert cast(Any, response.is_closed) is True @@ -245,7 +248,7 @@ def test_method_get(self, client: Cloudflare) -> None: "372e67954025e0ba6aaa6d586b9e0b61", zone_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[FirewallFilter], filter, path=["response"]) + assert_matches_type(FilterGetResponse, filter, path=["response"]) @pytest.mark.skip() @parametrize @@ -258,7 +261,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" filter = response.parse() - assert_matches_type(Optional[FirewallFilter], filter, path=["response"]) + assert_matches_type(FilterGetResponse, filter, path=["response"]) @pytest.mark.skip() @parametrize @@ -271,7 +274,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" filter = response.parse() - assert_matches_type(Optional[FirewallFilter], filter, path=["response"]) + assert_matches_type(FilterGetResponse, filter, path=["response"]) assert cast(Any, response.is_closed) is True @@ -348,7 +351,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: zone_identifier="023e105f4ecef8ad9ca31a8372d0c353", body={}, ) - assert_matches_type(Optional[FirewallFilter], filter, path=["response"]) + assert_matches_type(FilterUpdateResponse, filter, path=["response"]) @pytest.mark.skip() @parametrize @@ -362,7 +365,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" filter = await response.parse() - assert_matches_type(Optional[FirewallFilter], filter, path=["response"]) + assert_matches_type(FilterUpdateResponse, filter, path=["response"]) @pytest.mark.skip() @parametrize @@ -376,7 +379,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" filter = await response.parse() - assert_matches_type(Optional[FirewallFilter], filter, path=["response"]) + assert_matches_type(FilterUpdateResponse, filter, path=["response"]) assert cast(Any, response.is_closed) is True @@ -403,7 +406,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: filter = await async_client.filters.list( "023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncV4PagePaginationArray[FirewallFilter], filter, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[FilterListResponse], filter, path=["response"]) @pytest.mark.skip() @parametrize @@ -418,7 +421,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) per_page=5, ref="FIL-100", ) - assert_matches_type(AsyncV4PagePaginationArray[FirewallFilter], filter, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[FilterListResponse], filter, path=["response"]) @pytest.mark.skip() @parametrize @@ -430,7 +433,7 @@ 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" filter = await response.parse() - assert_matches_type(AsyncV4PagePaginationArray[FirewallFilter], filter, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[FilterListResponse], filter, path=["response"]) @pytest.mark.skip() @parametrize @@ -442,7 +445,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" filter = await response.parse() - assert_matches_type(AsyncV4PagePaginationArray[FirewallFilter], filter, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[FilterListResponse], filter, path=["response"]) assert cast(Any, response.is_closed) is True @@ -462,7 +465,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: zone_identifier="023e105f4ecef8ad9ca31a8372d0c353", body={}, ) - assert_matches_type(Optional[FirewallFilter], filter, path=["response"]) + assert_matches_type(FilterDeleteResponse, filter, path=["response"]) @pytest.mark.skip() @parametrize @@ -476,7 +479,7 @@ 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" filter = await response.parse() - assert_matches_type(Optional[FirewallFilter], filter, path=["response"]) + assert_matches_type(FilterDeleteResponse, filter, path=["response"]) @pytest.mark.skip() @parametrize @@ -490,7 +493,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" filter = await response.parse() - assert_matches_type(Optional[FirewallFilter], filter, path=["response"]) + assert_matches_type(FilterDeleteResponse, filter, path=["response"]) assert cast(Any, response.is_closed) is True @@ -518,7 +521,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: "372e67954025e0ba6aaa6d586b9e0b61", zone_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[FirewallFilter], filter, path=["response"]) + assert_matches_type(FilterGetResponse, filter, path=["response"]) @pytest.mark.skip() @parametrize @@ -531,7 +534,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" filter = await response.parse() - assert_matches_type(Optional[FirewallFilter], filter, path=["response"]) + assert_matches_type(FilterGetResponse, filter, path=["response"]) @pytest.mark.skip() @parametrize @@ -544,7 +547,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" filter = await response.parse() - assert_matches_type(Optional[FirewallFilter], filter, path=["response"]) + assert_matches_type(FilterGetResponse, filter, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_keyless_certificates.py b/tests/api_resources/test_keyless_certificates.py index 54d36cea601..1a2be35ac0f 100644 --- a/tests/api_resources/test_keyless_certificates.py +++ b/tests/api_resources/test_keyless_certificates.py @@ -10,7 +10,8 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.types import ( - KeylessCertificateHostname, + Hostname, + KeylessCertificate, ) from cloudflare.pagination import SyncSinglePage, AsyncSinglePage from cloudflare.types.shared import UnnamedSchemaRef8900f4cb9dca9b9ed0ac41ad571e6837 @@ -30,7 +31,7 @@ def test_method_create(self, client: Cloudflare) -> None: host="example.com", port=24008, ) - assert_matches_type(KeylessCertificateHostname, keyless_certificate, path=["response"]) + assert_matches_type(Hostname, keyless_certificate, path=["response"]) @pytest.mark.skip() @parametrize @@ -47,7 +48,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: "vnet_id": "7365377a-85a4-4390-9480-531ef7dc7a3c", }, ) - assert_matches_type(KeylessCertificateHostname, keyless_certificate, path=["response"]) + assert_matches_type(Hostname, keyless_certificate, path=["response"]) @pytest.mark.skip() @parametrize @@ -62,7 +63,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" keyless_certificate = response.parse() - assert_matches_type(KeylessCertificateHostname, keyless_certificate, path=["response"]) + assert_matches_type(Hostname, keyless_certificate, path=["response"]) @pytest.mark.skip() @parametrize @@ -77,7 +78,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" keyless_certificate = response.parse() - assert_matches_type(KeylessCertificateHostname, keyless_certificate, path=["response"]) + assert_matches_type(Hostname, keyless_certificate, path=["response"]) assert cast(Any, response.is_closed) is True @@ -98,7 +99,7 @@ def test_method_list(self, client: Cloudflare) -> None: keyless_certificate = client.keyless_certificates.list( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncSinglePage[KeylessCertificateHostname], keyless_certificate, path=["response"]) + assert_matches_type(SyncSinglePage[KeylessCertificate], keyless_certificate, path=["response"]) @pytest.mark.skip() @parametrize @@ -110,7 +111,7 @@ 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" keyless_certificate = response.parse() - assert_matches_type(SyncSinglePage[KeylessCertificateHostname], keyless_certificate, path=["response"]) + assert_matches_type(SyncSinglePage[KeylessCertificate], keyless_certificate, path=["response"]) @pytest.mark.skip() @parametrize @@ -122,7 +123,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" keyless_certificate = response.parse() - assert_matches_type(SyncSinglePage[KeylessCertificateHostname], keyless_certificate, path=["response"]) + assert_matches_type(SyncSinglePage[KeylessCertificate], keyless_certificate, path=["response"]) assert cast(Any, response.is_closed) is True @@ -202,7 +203,7 @@ def test_method_edit(self, client: Cloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(KeylessCertificateHostname, keyless_certificate, path=["response"]) + assert_matches_type(Hostname, keyless_certificate, path=["response"]) @pytest.mark.skip() @parametrize @@ -219,7 +220,7 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: "vnet_id": "7365377a-85a4-4390-9480-531ef7dc7a3c", }, ) - assert_matches_type(KeylessCertificateHostname, keyless_certificate, path=["response"]) + assert_matches_type(Hostname, keyless_certificate, path=["response"]) @pytest.mark.skip() @parametrize @@ -232,7 +233,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" keyless_certificate = response.parse() - assert_matches_type(KeylessCertificateHostname, keyless_certificate, path=["response"]) + assert_matches_type(Hostname, keyless_certificate, path=["response"]) @pytest.mark.skip() @parametrize @@ -245,7 +246,7 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" keyless_certificate = response.parse() - assert_matches_type(KeylessCertificateHostname, keyless_certificate, path=["response"]) + assert_matches_type(Hostname, keyless_certificate, path=["response"]) assert cast(Any, response.is_closed) is True @@ -273,7 +274,7 @@ def test_method_get(self, client: Cloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(KeylessCertificateHostname, keyless_certificate, path=["response"]) + assert_matches_type(Hostname, keyless_certificate, path=["response"]) @pytest.mark.skip() @parametrize @@ -286,7 +287,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" keyless_certificate = response.parse() - assert_matches_type(KeylessCertificateHostname, keyless_certificate, path=["response"]) + assert_matches_type(Hostname, keyless_certificate, path=["response"]) @pytest.mark.skip() @parametrize @@ -299,7 +300,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" keyless_certificate = response.parse() - assert_matches_type(KeylessCertificateHostname, keyless_certificate, path=["response"]) + assert_matches_type(Hostname, keyless_certificate, path=["response"]) assert cast(Any, response.is_closed) is True @@ -333,7 +334,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: host="example.com", port=24008, ) - assert_matches_type(KeylessCertificateHostname, keyless_certificate, path=["response"]) + assert_matches_type(Hostname, keyless_certificate, path=["response"]) @pytest.mark.skip() @parametrize @@ -350,7 +351,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare "vnet_id": "7365377a-85a4-4390-9480-531ef7dc7a3c", }, ) - assert_matches_type(KeylessCertificateHostname, keyless_certificate, path=["response"]) + assert_matches_type(Hostname, keyless_certificate, path=["response"]) @pytest.mark.skip() @parametrize @@ -365,7 +366,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" keyless_certificate = await response.parse() - assert_matches_type(KeylessCertificateHostname, keyless_certificate, path=["response"]) + assert_matches_type(Hostname, keyless_certificate, path=["response"]) @pytest.mark.skip() @parametrize @@ -380,7 +381,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" keyless_certificate = await response.parse() - assert_matches_type(KeylessCertificateHostname, keyless_certificate, path=["response"]) + assert_matches_type(Hostname, keyless_certificate, path=["response"]) assert cast(Any, response.is_closed) is True @@ -401,7 +402,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: keyless_certificate = await async_client.keyless_certificates.list( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncSinglePage[KeylessCertificateHostname], keyless_certificate, path=["response"]) + assert_matches_type(AsyncSinglePage[KeylessCertificate], keyless_certificate, path=["response"]) @pytest.mark.skip() @parametrize @@ -413,7 +414,7 @@ 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" keyless_certificate = await response.parse() - assert_matches_type(AsyncSinglePage[KeylessCertificateHostname], keyless_certificate, path=["response"]) + assert_matches_type(AsyncSinglePage[KeylessCertificate], keyless_certificate, path=["response"]) @pytest.mark.skip() @parametrize @@ -425,7 +426,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" keyless_certificate = await response.parse() - assert_matches_type(AsyncSinglePage[KeylessCertificateHostname], keyless_certificate, path=["response"]) + assert_matches_type(AsyncSinglePage[KeylessCertificate], keyless_certificate, path=["response"]) assert cast(Any, response.is_closed) is True @@ -505,7 +506,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(KeylessCertificateHostname, keyless_certificate, path=["response"]) + assert_matches_type(Hostname, keyless_certificate, path=["response"]) @pytest.mark.skip() @parametrize @@ -522,7 +523,7 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) "vnet_id": "7365377a-85a4-4390-9480-531ef7dc7a3c", }, ) - assert_matches_type(KeylessCertificateHostname, keyless_certificate, path=["response"]) + assert_matches_type(Hostname, keyless_certificate, path=["response"]) @pytest.mark.skip() @parametrize @@ -535,7 +536,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" keyless_certificate = await response.parse() - assert_matches_type(KeylessCertificateHostname, keyless_certificate, path=["response"]) + assert_matches_type(Hostname, keyless_certificate, path=["response"]) @pytest.mark.skip() @parametrize @@ -548,7 +549,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" keyless_certificate = await response.parse() - assert_matches_type(KeylessCertificateHostname, keyless_certificate, path=["response"]) + assert_matches_type(Hostname, keyless_certificate, path=["response"]) assert cast(Any, response.is_closed) is True @@ -576,7 +577,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(KeylessCertificateHostname, keyless_certificate, path=["response"]) + assert_matches_type(Hostname, keyless_certificate, path=["response"]) @pytest.mark.skip() @parametrize @@ -589,7 +590,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" keyless_certificate = await response.parse() - assert_matches_type(KeylessCertificateHostname, keyless_certificate, path=["response"]) + assert_matches_type(Hostname, keyless_certificate, path=["response"]) @pytest.mark.skip() @parametrize @@ -602,7 +603,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" keyless_certificate = await response.parse() - assert_matches_type(KeylessCertificateHostname, keyless_certificate, path=["response"]) + assert_matches_type(Hostname, keyless_certificate, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_mtls_certificates.py b/tests/api_resources/test_mtls_certificates.py index 41314a8b285..336ea838c6f 100644 --- a/tests/api_resources/test_mtls_certificates.py +++ b/tests/api_resources/test_mtls_certificates.py @@ -11,7 +11,7 @@ from tests.utils import assert_matches_type from cloudflare.types import ( MTLSCertificate, - MTLSCertificateUpdate, + MTLSCertificateCreateResponse, ) from cloudflare.pagination import SyncSinglePage, AsyncSinglePage @@ -29,7 +29,7 @@ def test_method_create(self, client: Cloudflare) -> None: ca=True, certificates="-----BEGIN CERTIFICATE-----\nMIIDmDCCAoCgAwIBAgIUKTOAZNjcXVZRj4oQt0SHsl1c1vMwDQYJKoZIhvcNAQELBQAwUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgMDVNhbiBGcmFuY2lzY28xEzARBgNVBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4YW1wbGUgSW5jLjAgFw0yMjExMjIxNjU5NDdaGA8yMTIyMTAyOTE2NTk0N1owUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgMDVNhbiBGcmFuY2lzY28xEzARBgNVBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4YW1wbGUgSW5jLjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMRcORwgJFTdcG/2GKI+cFYiOBNDKjCZUXEOvXWY42BkH9wxiMT869CO+enA1w5pIrXow6kCM1sQspHHaVmJUlotEMJxyoLFfA/8Kt1EKFyobOjuZs2SwyVyJ2sStvQuUQEosULZCNGZEqoH5g6zhMPxaxm7ZLrrsDZ9maNGVqo7EWLWHrZ57Q/5MtTrbxQL+eXjUmJ9K3kS+3uEwMdqR6Z3BluU1ivanpPc1CN2GNhdO0/hSY4YkGEnuLsqJyDd3cIiB1MxuCBJ4ZaqOd2viV1WcP3oU3dxVPm4MWyfYIldMWB14FahScxLhWdRnM9YZ/i9IFcLypXsuz7DjrJPtPUCAwEAAaNmMGQwHQYDVR0OBBYEFP5JzLUawNF+c3AXsYTEWHh7z2czMB8GA1UdIwQYMBaAFP5JzLUawNF+c3AXsYTEWHh7z2czMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMBAf8ECDAGAQH/AgEBMA0GCSqGSIb3DQEBCwUAA4IBAQBc+Be7NDhpE09y7hLPZGRPl1cSKBw4RI0XIv6rlbSTFs5EebpTGjhx/whNxwEZhB9HZ7111Oa1YlT8xkI9DshB78mjAHCKBAJ76moK8tkG0aqdYpJ4ZcJTVBB7l98Rvgc7zfTii7WemTy72deBbSeiEtXavm4EF0mWjHhQ5Nxpnp00Bqn5g1x8CyTDypgmugnep+xG+iFzNmTdsz7WI9T/7kDMXqB7M/FPWBORyS98OJqNDswCLF8bIZYwUBEe+bRHFomoShMzaC3tvim7WCb16noDkSTMlfKO4pnvKhpcVdSgwcruATV7y+W+Lvmz2OT/Gui4JhqeoTewsxndhDDE\n-----END CERTIFICATE-----", ) - assert_matches_type(MTLSCertificateUpdate, mtls_certificate, path=["response"]) + assert_matches_type(MTLSCertificateCreateResponse, mtls_certificate, path=["response"]) @pytest.mark.skip() @parametrize @@ -41,7 +41,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: name="example_ca_cert", private_key="-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDEXDkcICRU3XBv9hiiPnBWIjgTQyowmVFxDr11mONgZB/cMYjE/OvQjvnpwNcOaSK16MOpAjNbELKRx2lZiVJaLRDCccqCxXwP/CrdRChcqGzo7mbNksMlcidrErb0LlEBKLFC2QjRmRKqB+YOs4TD8WsZu2S667A2fZmjRlaqOxFi1h62ee0P+TLU628UC/nl41JifSt5Evt7hMDHakemdwZblNYr2p6T3NQjdhjYXTtP4UmOGJBhJ7i7Kicg3d3CIgdTMbggSeGWqjndr4ldVnD96FN3cVT5uDFsn2CJXTFgdeBWoUnMS4VnUZzPWGf4vSBXC8qV7Ls+w46yT7T1AgMBAAECggEAQZnp/oqCeNPOR6l5S2L+1tfx0gWjZ78hJVteUpZ0iHSK7F6kKeOxyOird7vUXV0kmo+cJq+0hp0Ke4eam640FCpwKfYoSQ4/R3vgujGWJnaihCN5tv5sMet0XeJPuz5qE7ALoKCvwI6aXLHs20aAeZIDTQJ9QbGSGnJVzOWn+JDTidIgZpN57RpXfSAwnJPTQK/PN8i5z108hsaDOdEgGmxYZ7kYqMqzX20KXmth58LDfPixs5JGtS60iiKC/wOcGzkB2/AdTSojR76oEU77cANP/3zO25NG//whUdYlW0t0d7PgXxIeJe+xgYnamDQJx3qonVyt4H77ha0ObRAj9QKBgQDicZr+VTwFMnELP3a+FXGnjehRiuS1i7MXGKxNweCD+dFlML0FplSQS8Ro2n+d8lu8BBXGx0qm6VXu8Rhn7TAUL6q+PCgfarzxfIhacb/TZCqfieIHsMlVBfhV5HCXnk+kis0tuC/PRArcWTwDHJUJXkBhvkUsNswvQzavDPI7KwKBgQDd/WgLkj7A3X5fgIHZH/GbDSBiXwzKb+rF4ZCT2XFgG/OAW7vapfcX/w+v+5lBLyrocmOAS3PGGAhM5T3HLnUCQfnK4qgps1Lqibkc9Tmnsn60LanUjuUMsYv/zSw70tozbzhJ0pioEpWfRxRZBztO2Rr8Ntm7h6Fk701EXGNAXwKBgQCD1xsjy2J3sCerIdcz0u5qXLAPkeuZW+34m4/ucdwTWwc0gEz9lhsULFj9p4G351zLuiEnq+7mAWLcDJlmIO3mQt6JhiLiL9Y0T4pgBmxmWqKKYtAsJB0EmMY+1BNN44mBRqMxZFTJu1cLdhT/xstrOeoIPqytknYNanfTMZlzIwKBgHrLXe5oq0XMP8dcMneEcAUwsaU4pr6kQd3L9EmUkl5zl7J9C+DaxWAEuwzBw/iGutlxzRB+rD/7szu14wJ29EqXbDGKRzMp+se5/yfBjm7xEZ1hVPw7PwBShfqt57X/4Ktq7lwHnmH6RcGhc+P7WBc5iO/S94YAdIp8xOT3pf9JAoGAE0QkqJUY+5Mgr+fBO0VNV72ZoPveGpW+De59uhKAOnu1zljQCUtk59m6+DXfm0tNYKtawa5n8iN71Zh+s62xXSt3pYi1Y5CCCmv8Y4BhwIcPwXKk3zEvLgSHVTpC0bayA9aSO4bbZgVXa5w+Z0w/vvfp9DWo1IS3EnQRrz6WMYA=\n-----END PRIVATE KEY-----", ) - assert_matches_type(MTLSCertificateUpdate, mtls_certificate, path=["response"]) + assert_matches_type(MTLSCertificateCreateResponse, mtls_certificate, path=["response"]) @pytest.mark.skip() @parametrize @@ -55,7 +55,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" mtls_certificate = response.parse() - assert_matches_type(MTLSCertificateUpdate, mtls_certificate, path=["response"]) + assert_matches_type(MTLSCertificateCreateResponse, mtls_certificate, path=["response"]) @pytest.mark.skip() @parametrize @@ -69,7 +69,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" mtls_certificate = response.parse() - assert_matches_type(MTLSCertificateUpdate, mtls_certificate, path=["response"]) + assert_matches_type(MTLSCertificateCreateResponse, mtls_certificate, path=["response"]) assert cast(Any, response.is_closed) is True @@ -246,7 +246,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: ca=True, certificates="-----BEGIN CERTIFICATE-----\nMIIDmDCCAoCgAwIBAgIUKTOAZNjcXVZRj4oQt0SHsl1c1vMwDQYJKoZIhvcNAQELBQAwUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgMDVNhbiBGcmFuY2lzY28xEzARBgNVBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4YW1wbGUgSW5jLjAgFw0yMjExMjIxNjU5NDdaGA8yMTIyMTAyOTE2NTk0N1owUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgMDVNhbiBGcmFuY2lzY28xEzARBgNVBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4YW1wbGUgSW5jLjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMRcORwgJFTdcG/2GKI+cFYiOBNDKjCZUXEOvXWY42BkH9wxiMT869CO+enA1w5pIrXow6kCM1sQspHHaVmJUlotEMJxyoLFfA/8Kt1EKFyobOjuZs2SwyVyJ2sStvQuUQEosULZCNGZEqoH5g6zhMPxaxm7ZLrrsDZ9maNGVqo7EWLWHrZ57Q/5MtTrbxQL+eXjUmJ9K3kS+3uEwMdqR6Z3BluU1ivanpPc1CN2GNhdO0/hSY4YkGEnuLsqJyDd3cIiB1MxuCBJ4ZaqOd2viV1WcP3oU3dxVPm4MWyfYIldMWB14FahScxLhWdRnM9YZ/i9IFcLypXsuz7DjrJPtPUCAwEAAaNmMGQwHQYDVR0OBBYEFP5JzLUawNF+c3AXsYTEWHh7z2czMB8GA1UdIwQYMBaAFP5JzLUawNF+c3AXsYTEWHh7z2czMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMBAf8ECDAGAQH/AgEBMA0GCSqGSIb3DQEBCwUAA4IBAQBc+Be7NDhpE09y7hLPZGRPl1cSKBw4RI0XIv6rlbSTFs5EebpTGjhx/whNxwEZhB9HZ7111Oa1YlT8xkI9DshB78mjAHCKBAJ76moK8tkG0aqdYpJ4ZcJTVBB7l98Rvgc7zfTii7WemTy72deBbSeiEtXavm4EF0mWjHhQ5Nxpnp00Bqn5g1x8CyTDypgmugnep+xG+iFzNmTdsz7WI9T/7kDMXqB7M/FPWBORyS98OJqNDswCLF8bIZYwUBEe+bRHFomoShMzaC3tvim7WCb16noDkSTMlfKO4pnvKhpcVdSgwcruATV7y+W+Lvmz2OT/Gui4JhqeoTewsxndhDDE\n-----END CERTIFICATE-----", ) - assert_matches_type(MTLSCertificateUpdate, mtls_certificate, path=["response"]) + assert_matches_type(MTLSCertificateCreateResponse, mtls_certificate, path=["response"]) @pytest.mark.skip() @parametrize @@ -258,7 +258,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare name="example_ca_cert", private_key="-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDEXDkcICRU3XBv9hiiPnBWIjgTQyowmVFxDr11mONgZB/cMYjE/OvQjvnpwNcOaSK16MOpAjNbELKRx2lZiVJaLRDCccqCxXwP/CrdRChcqGzo7mbNksMlcidrErb0LlEBKLFC2QjRmRKqB+YOs4TD8WsZu2S667A2fZmjRlaqOxFi1h62ee0P+TLU628UC/nl41JifSt5Evt7hMDHakemdwZblNYr2p6T3NQjdhjYXTtP4UmOGJBhJ7i7Kicg3d3CIgdTMbggSeGWqjndr4ldVnD96FN3cVT5uDFsn2CJXTFgdeBWoUnMS4VnUZzPWGf4vSBXC8qV7Ls+w46yT7T1AgMBAAECggEAQZnp/oqCeNPOR6l5S2L+1tfx0gWjZ78hJVteUpZ0iHSK7F6kKeOxyOird7vUXV0kmo+cJq+0hp0Ke4eam640FCpwKfYoSQ4/R3vgujGWJnaihCN5tv5sMet0XeJPuz5qE7ALoKCvwI6aXLHs20aAeZIDTQJ9QbGSGnJVzOWn+JDTidIgZpN57RpXfSAwnJPTQK/PN8i5z108hsaDOdEgGmxYZ7kYqMqzX20KXmth58LDfPixs5JGtS60iiKC/wOcGzkB2/AdTSojR76oEU77cANP/3zO25NG//whUdYlW0t0d7PgXxIeJe+xgYnamDQJx3qonVyt4H77ha0ObRAj9QKBgQDicZr+VTwFMnELP3a+FXGnjehRiuS1i7MXGKxNweCD+dFlML0FplSQS8Ro2n+d8lu8BBXGx0qm6VXu8Rhn7TAUL6q+PCgfarzxfIhacb/TZCqfieIHsMlVBfhV5HCXnk+kis0tuC/PRArcWTwDHJUJXkBhvkUsNswvQzavDPI7KwKBgQDd/WgLkj7A3X5fgIHZH/GbDSBiXwzKb+rF4ZCT2XFgG/OAW7vapfcX/w+v+5lBLyrocmOAS3PGGAhM5T3HLnUCQfnK4qgps1Lqibkc9Tmnsn60LanUjuUMsYv/zSw70tozbzhJ0pioEpWfRxRZBztO2Rr8Ntm7h6Fk701EXGNAXwKBgQCD1xsjy2J3sCerIdcz0u5qXLAPkeuZW+34m4/ucdwTWwc0gEz9lhsULFj9p4G351zLuiEnq+7mAWLcDJlmIO3mQt6JhiLiL9Y0T4pgBmxmWqKKYtAsJB0EmMY+1BNN44mBRqMxZFTJu1cLdhT/xstrOeoIPqytknYNanfTMZlzIwKBgHrLXe5oq0XMP8dcMneEcAUwsaU4pr6kQd3L9EmUkl5zl7J9C+DaxWAEuwzBw/iGutlxzRB+rD/7szu14wJ29EqXbDGKRzMp+se5/yfBjm7xEZ1hVPw7PwBShfqt57X/4Ktq7lwHnmH6RcGhc+P7WBc5iO/S94YAdIp8xOT3pf9JAoGAE0QkqJUY+5Mgr+fBO0VNV72ZoPveGpW+De59uhKAOnu1zljQCUtk59m6+DXfm0tNYKtawa5n8iN71Zh+s62xXSt3pYi1Y5CCCmv8Y4BhwIcPwXKk3zEvLgSHVTpC0bayA9aSO4bbZgVXa5w+Z0w/vvfp9DWo1IS3EnQRrz6WMYA=\n-----END PRIVATE KEY-----", ) - assert_matches_type(MTLSCertificateUpdate, mtls_certificate, path=["response"]) + assert_matches_type(MTLSCertificateCreateResponse, mtls_certificate, path=["response"]) @pytest.mark.skip() @parametrize @@ -272,7 +272,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" mtls_certificate = await response.parse() - assert_matches_type(MTLSCertificateUpdate, mtls_certificate, path=["response"]) + assert_matches_type(MTLSCertificateCreateResponse, mtls_certificate, path=["response"]) @pytest.mark.skip() @parametrize @@ -286,7 +286,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" mtls_certificate = await response.parse() - assert_matches_type(MTLSCertificateUpdate, mtls_certificate, path=["response"]) + assert_matches_type(MTLSCertificateCreateResponse, mtls_certificate, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_origin_tls_client_auth.py b/tests/api_resources/test_origin_tls_client_auth.py index 9df0577c0d9..f881995b793 100644 --- a/tests/api_resources/test_origin_tls_client_auth.py +++ b/tests/api_resources/test_origin_tls_client_auth.py @@ -10,7 +10,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.types import ( - OriginTLSClientAuthListResponse, + ZoneAuthenticatedOriginPull, ) from cloudflare.pagination import SyncSinglePage, AsyncSinglePage from cloudflare.types.shared import UnnamedSchemaRef9444735ca60712dbcf8afd832eb5716a @@ -79,7 +79,7 @@ def test_method_list(self, client: Cloudflare) -> None: origin_tls_client_auth = client.origin_tls_client_auth.list( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncSinglePage[OriginTLSClientAuthListResponse], origin_tls_client_auth, path=["response"]) + assert_matches_type(SyncSinglePage[ZoneAuthenticatedOriginPull], origin_tls_client_auth, path=["response"]) @pytest.mark.skip() @parametrize @@ -91,7 +91,7 @@ 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" origin_tls_client_auth = response.parse() - assert_matches_type(SyncSinglePage[OriginTLSClientAuthListResponse], origin_tls_client_auth, path=["response"]) + assert_matches_type(SyncSinglePage[ZoneAuthenticatedOriginPull], origin_tls_client_auth, path=["response"]) @pytest.mark.skip() @parametrize @@ -103,9 +103,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" origin_tls_client_auth = response.parse() - assert_matches_type( - SyncSinglePage[OriginTLSClientAuthListResponse], origin_tls_client_auth, path=["response"] - ) + assert_matches_type(SyncSinglePage[ZoneAuthenticatedOriginPull], origin_tls_client_auth, path=["response"]) assert cast(Any, response.is_closed) is True @@ -292,7 +290,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: origin_tls_client_auth = await async_client.origin_tls_client_auth.list( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncSinglePage[OriginTLSClientAuthListResponse], origin_tls_client_auth, path=["response"]) + assert_matches_type(AsyncSinglePage[ZoneAuthenticatedOriginPull], origin_tls_client_auth, path=["response"]) @pytest.mark.skip() @parametrize @@ -304,7 +302,7 @@ 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" origin_tls_client_auth = await response.parse() - assert_matches_type(AsyncSinglePage[OriginTLSClientAuthListResponse], origin_tls_client_auth, path=["response"]) + assert_matches_type(AsyncSinglePage[ZoneAuthenticatedOriginPull], origin_tls_client_auth, path=["response"]) @pytest.mark.skip() @parametrize @@ -316,9 +314,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" origin_tls_client_auth = await response.parse() - assert_matches_type( - AsyncSinglePage[OriginTLSClientAuthListResponse], origin_tls_client_auth, path=["response"] - ) + assert_matches_type(AsyncSinglePage[ZoneAuthenticatedOriginPull], origin_tls_client_auth, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_page_shield.py b/tests/api_resources/test_page_shield.py index f8bbeaa1a85..e52ec5c9eb5 100644 --- a/tests/api_resources/test_page_shield.py +++ b/tests/api_resources/test_page_shield.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types import PageShieldSetting, PageShieldUpdateResponse +from cloudflare.types import Setting, PageShieldUpdateResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -76,7 +76,7 @@ def test_method_get(self, client: Cloudflare) -> None: page_shield = client.page_shield.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(PageShieldSetting, page_shield, path=["response"]) + assert_matches_type(Setting, page_shield, path=["response"]) @pytest.mark.skip() @parametrize @@ -88,7 +88,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" page_shield = response.parse() - assert_matches_type(PageShieldSetting, page_shield, path=["response"]) + assert_matches_type(Setting, page_shield, path=["response"]) @pytest.mark.skip() @parametrize @@ -100,7 +100,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" page_shield = response.parse() - assert_matches_type(PageShieldSetting, page_shield, path=["response"]) + assert_matches_type(Setting, page_shield, path=["response"]) assert cast(Any, response.is_closed) is True @@ -175,7 +175,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: page_shield = await async_client.page_shield.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(PageShieldSetting, page_shield, path=["response"]) + assert_matches_type(Setting, page_shield, path=["response"]) @pytest.mark.skip() @parametrize @@ -187,7 +187,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" page_shield = await response.parse() - assert_matches_type(PageShieldSetting, page_shield, path=["response"]) + assert_matches_type(Setting, page_shield, path=["response"]) @pytest.mark.skip() @parametrize @@ -199,7 +199,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" page_shield = await response.parse() - assert_matches_type(PageShieldSetting, page_shield, path=["response"]) + assert_matches_type(Setting, page_shield, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_rate_limits.py b/tests/api_resources/test_rate_limits.py index c0e5daabc2f..1b5de68b251 100644 --- a/tests/api_resources/test_rate_limits.py +++ b/tests/api_resources/test_rate_limits.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, Optional, cast +from typing import Any, cast import pytest @@ -128,7 +128,7 @@ def test_method_delete(self, client: Cloudflare) -> None: zone_identifier="023e105f4ecef8ad9ca31a8372d0c353", body={}, ) - assert_matches_type(Optional[RateLimitDeleteResponse], rate_limit, path=["response"]) + assert_matches_type(RateLimitDeleteResponse, rate_limit, path=["response"]) @pytest.mark.skip() @parametrize @@ -142,7 +142,7 @@ 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" rate_limit = response.parse() - assert_matches_type(Optional[RateLimitDeleteResponse], rate_limit, path=["response"]) + assert_matches_type(RateLimitDeleteResponse, rate_limit, path=["response"]) @pytest.mark.skip() @parametrize @@ -156,7 +156,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" rate_limit = response.parse() - assert_matches_type(Optional[RateLimitDeleteResponse], rate_limit, path=["response"]) + assert_matches_type(RateLimitDeleteResponse, rate_limit, path=["response"]) assert cast(Any, response.is_closed) is True @@ -396,7 +396,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: zone_identifier="023e105f4ecef8ad9ca31a8372d0c353", body={}, ) - assert_matches_type(Optional[RateLimitDeleteResponse], rate_limit, path=["response"]) + assert_matches_type(RateLimitDeleteResponse, rate_limit, path=["response"]) @pytest.mark.skip() @parametrize @@ -410,7 +410,7 @@ 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" rate_limit = await response.parse() - assert_matches_type(Optional[RateLimitDeleteResponse], rate_limit, path=["response"]) + assert_matches_type(RateLimitDeleteResponse, rate_limit, path=["response"]) @pytest.mark.skip() @parametrize @@ -424,7 +424,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" rate_limit = await response.parse() - assert_matches_type(Optional[RateLimitDeleteResponse], rate_limit, path=["response"]) + assert_matches_type(RateLimitDeleteResponse, rate_limit, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_speed.py b/tests/api_resources/test_speed.py index b3dacc27b02..0a442147be7 100644 --- a/tests/api_resources/test_speed.py +++ b/tests/api_resources/test_speed.py @@ -10,11 +10,11 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.types import ( - ObservatoryTrend, - ObservatorySchedule, + Trend, SpeedDeleteResponse, ) from cloudflare._utils import parse_datetime +from cloudflare.types.speed import Schedule base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -91,7 +91,7 @@ def test_method_schedule_get(self, client: Cloudflare) -> None: "example.com", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[ObservatorySchedule], speed, path=["response"]) + assert_matches_type(Optional[Schedule], speed, path=["response"]) @pytest.mark.skip() @parametrize @@ -101,7 +101,7 @@ def test_method_schedule_get_with_all_params(self, client: Cloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", region="us-central1", ) - assert_matches_type(Optional[ObservatorySchedule], speed, path=["response"]) + assert_matches_type(Optional[Schedule], speed, path=["response"]) @pytest.mark.skip() @parametrize @@ -114,7 +114,7 @@ def test_raw_response_schedule_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" speed = response.parse() - assert_matches_type(Optional[ObservatorySchedule], speed, path=["response"]) + assert_matches_type(Optional[Schedule], speed, path=["response"]) @pytest.mark.skip() @parametrize @@ -127,7 +127,7 @@ def test_streaming_response_schedule_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" speed = response.parse() - assert_matches_type(Optional[ObservatorySchedule], speed, path=["response"]) + assert_matches_type(Optional[Schedule], speed, path=["response"]) assert cast(Any, response.is_closed) is True @@ -158,7 +158,7 @@ def test_method_trends_list(self, client: Cloudflare) -> None: start=parse_datetime("2014-01-01T05:20:00.12345Z"), tz="string", ) - assert_matches_type(Optional[ObservatoryTrend], speed, path=["response"]) + assert_matches_type(Optional[Trend], speed, path=["response"]) @pytest.mark.skip() @parametrize @@ -173,7 +173,7 @@ def test_method_trends_list_with_all_params(self, client: Cloudflare) -> None: tz="string", end=parse_datetime("2014-01-01T05:20:00.12345Z"), ) - assert_matches_type(Optional[ObservatoryTrend], speed, path=["response"]) + assert_matches_type(Optional[Trend], speed, path=["response"]) @pytest.mark.skip() @parametrize @@ -191,7 +191,7 @@ def test_raw_response_trends_list(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" speed = response.parse() - assert_matches_type(Optional[ObservatoryTrend], speed, path=["response"]) + assert_matches_type(Optional[Trend], speed, path=["response"]) @pytest.mark.skip() @parametrize @@ -209,7 +209,7 @@ def test_streaming_response_trends_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" speed = response.parse() - assert_matches_type(Optional[ObservatoryTrend], speed, path=["response"]) + assert_matches_type(Optional[Trend], speed, path=["response"]) assert cast(Any, response.is_closed) is True @@ -311,7 +311,7 @@ async def test_method_schedule_get(self, async_client: AsyncCloudflare) -> None: "example.com", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[ObservatorySchedule], speed, path=["response"]) + assert_matches_type(Optional[Schedule], speed, path=["response"]) @pytest.mark.skip() @parametrize @@ -321,7 +321,7 @@ async def test_method_schedule_get_with_all_params(self, async_client: AsyncClou zone_id="023e105f4ecef8ad9ca31a8372d0c353", region="us-central1", ) - assert_matches_type(Optional[ObservatorySchedule], speed, path=["response"]) + assert_matches_type(Optional[Schedule], speed, path=["response"]) @pytest.mark.skip() @parametrize @@ -334,7 +334,7 @@ async def test_raw_response_schedule_get(self, async_client: AsyncCloudflare) -> assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" speed = await response.parse() - assert_matches_type(Optional[ObservatorySchedule], speed, path=["response"]) + assert_matches_type(Optional[Schedule], speed, path=["response"]) @pytest.mark.skip() @parametrize @@ -347,7 +347,7 @@ async def test_streaming_response_schedule_get(self, async_client: AsyncCloudfla assert response.http_request.headers.get("X-Stainless-Lang") == "python" speed = await response.parse() - assert_matches_type(Optional[ObservatorySchedule], speed, path=["response"]) + assert_matches_type(Optional[Schedule], speed, path=["response"]) assert cast(Any, response.is_closed) is True @@ -378,7 +378,7 @@ async def test_method_trends_list(self, async_client: AsyncCloudflare) -> None: start=parse_datetime("2014-01-01T05:20:00.12345Z"), tz="string", ) - assert_matches_type(Optional[ObservatoryTrend], speed, path=["response"]) + assert_matches_type(Optional[Trend], speed, path=["response"]) @pytest.mark.skip() @parametrize @@ -393,7 +393,7 @@ async def test_method_trends_list_with_all_params(self, async_client: AsyncCloud tz="string", end=parse_datetime("2014-01-01T05:20:00.12345Z"), ) - assert_matches_type(Optional[ObservatoryTrend], speed, path=["response"]) + assert_matches_type(Optional[Trend], speed, path=["response"]) @pytest.mark.skip() @parametrize @@ -411,7 +411,7 @@ async def test_raw_response_trends_list(self, async_client: AsyncCloudflare) -> assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" speed = await response.parse() - assert_matches_type(Optional[ObservatoryTrend], speed, path=["response"]) + assert_matches_type(Optional[Trend], speed, path=["response"]) @pytest.mark.skip() @parametrize @@ -429,7 +429,7 @@ async def test_streaming_response_trends_list(self, async_client: AsyncCloudflar assert response.http_request.headers.get("X-Stainless-Lang") == "python" speed = await response.parse() - assert_matches_type(Optional[ObservatoryTrend], speed, path=["response"]) + assert_matches_type(Optional[Trend], speed, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_stream.py b/tests/api_resources/test_stream.py index 5ab79ed336f..133dadd6af7 100644 --- a/tests/api_resources/test_stream.py +++ b/tests/api_resources/test_stream.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types import StreamVideos +from cloudflare.types import Video from cloudflare._utils import parse_datetime from cloudflare.pagination import SyncSinglePage, AsyncSinglePage @@ -71,7 +71,7 @@ def test_method_list(self, client: Cloudflare) -> None: stream = client.stream.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncSinglePage[StreamVideos], stream, path=["response"]) + assert_matches_type(SyncSinglePage[Video], stream, path=["response"]) @pytest.mark.skip() @parametrize @@ -87,7 +87,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: status="inprogress", type="live", ) - assert_matches_type(SyncSinglePage[StreamVideos], stream, path=["response"]) + assert_matches_type(SyncSinglePage[Video], stream, path=["response"]) @pytest.mark.skip() @parametrize @@ -99,7 +99,7 @@ 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" stream = response.parse() - assert_matches_type(SyncSinglePage[StreamVideos], stream, path=["response"]) + assert_matches_type(SyncSinglePage[Video], stream, path=["response"]) @pytest.mark.skip() @parametrize @@ -111,7 +111,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" stream = response.parse() - assert_matches_type(SyncSinglePage[StreamVideos], stream, path=["response"]) + assert_matches_type(SyncSinglePage[Video], stream, path=["response"]) assert cast(Any, response.is_closed) is True @@ -187,7 +187,7 @@ def test_method_get(self, client: Cloudflare) -> None: "ea95132c15732412d22c1476fa83f27a", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(StreamVideos, stream, path=["response"]) + assert_matches_type(Video, stream, path=["response"]) @pytest.mark.skip() @parametrize @@ -200,7 +200,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" stream = response.parse() - assert_matches_type(StreamVideos, stream, path=["response"]) + assert_matches_type(Video, stream, path=["response"]) @pytest.mark.skip() @parametrize @@ -213,7 +213,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" stream = response.parse() - assert_matches_type(StreamVideos, stream, path=["response"]) + assert_matches_type(Video, stream, path=["response"]) assert cast(Any, response.is_closed) is True @@ -288,7 +288,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: stream = await async_client.stream.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncSinglePage[StreamVideos], stream, path=["response"]) + assert_matches_type(AsyncSinglePage[Video], stream, path=["response"]) @pytest.mark.skip() @parametrize @@ -304,7 +304,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) status="inprogress", type="live", ) - assert_matches_type(AsyncSinglePage[StreamVideos], stream, path=["response"]) + assert_matches_type(AsyncSinglePage[Video], stream, path=["response"]) @pytest.mark.skip() @parametrize @@ -316,7 +316,7 @@ 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" stream = await response.parse() - assert_matches_type(AsyncSinglePage[StreamVideos], stream, path=["response"]) + assert_matches_type(AsyncSinglePage[Video], stream, path=["response"]) @pytest.mark.skip() @parametrize @@ -328,7 +328,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" stream = await response.parse() - assert_matches_type(AsyncSinglePage[StreamVideos], stream, path=["response"]) + assert_matches_type(AsyncSinglePage[Video], stream, path=["response"]) assert cast(Any, response.is_closed) is True @@ -404,7 +404,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: "ea95132c15732412d22c1476fa83f27a", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(StreamVideos, stream, path=["response"]) + assert_matches_type(Video, stream, path=["response"]) @pytest.mark.skip() @parametrize @@ -417,7 +417,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" stream = await response.parse() - assert_matches_type(StreamVideos, stream, path=["response"]) + assert_matches_type(Video, stream, path=["response"]) @pytest.mark.skip() @parametrize @@ -430,7 +430,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" stream = await response.parse() - assert_matches_type(StreamVideos, stream, path=["response"]) + assert_matches_type(Video, stream, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_subscriptions.py b/tests/api_resources/test_subscriptions.py index 3427c55b72b..a058901dc56 100644 --- a/tests/api_resources/test_subscriptions.py +++ b/tests/api_resources/test_subscriptions.py @@ -10,10 +10,10 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.types import ( - SubscriptionListResponse, SubscriptionDeleteResponse, ) from cloudflare.pagination import SyncSinglePage, AsyncSinglePage +from cloudflare.types.user import Subscription from cloudflare.types.shared import UnnamedSchemaRef9444735ca60712dbcf8afd832eb5716a base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -205,7 +205,7 @@ def test_method_list(self, client: Cloudflare) -> None: subscription = client.subscriptions.list( "023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncSinglePage[SubscriptionListResponse], subscription, path=["response"]) + assert_matches_type(SyncSinglePage[Subscription], subscription, path=["response"]) @pytest.mark.skip() @parametrize @@ -217,7 +217,7 @@ 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" subscription = response.parse() - assert_matches_type(SyncSinglePage[SubscriptionListResponse], subscription, path=["response"]) + assert_matches_type(SyncSinglePage[Subscription], subscription, path=["response"]) @pytest.mark.skip() @parametrize @@ -229,7 +229,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(SyncSinglePage[SubscriptionListResponse], subscription, path=["response"]) + assert_matches_type(SyncSinglePage[Subscription], subscription, path=["response"]) assert cast(Any, response.is_closed) is True @@ -529,7 +529,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: subscription = await async_client.subscriptions.list( "023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncSinglePage[SubscriptionListResponse], subscription, path=["response"]) + assert_matches_type(AsyncSinglePage[Subscription], subscription, path=["response"]) @pytest.mark.skip() @parametrize @@ -541,7 +541,7 @@ 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" subscription = await response.parse() - assert_matches_type(AsyncSinglePage[SubscriptionListResponse], subscription, path=["response"]) + assert_matches_type(AsyncSinglePage[Subscription], subscription, path=["response"]) @pytest.mark.skip() @parametrize @@ -553,7 +553,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = await response.parse() - assert_matches_type(AsyncSinglePage[SubscriptionListResponse], subscription, path=["response"]) + assert_matches_type(AsyncSinglePage[Subscription], subscription, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/user/firewall/test_access_rules.py b/tests/api_resources/user/firewall/test_access_rules.py index ff4ee06dfa8..726cc112e03 100644 --- a/tests/api_resources/user/firewall/test_access_rules.py +++ b/tests/api_resources/user/firewall/test_access_rules.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, Optional, cast +from typing import Any, cast import pytest @@ -11,7 +11,9 @@ from tests.utils import assert_matches_type from cloudflare.pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray from cloudflare.types.user.firewall import ( - AccessRule, + AccessRuleEditResponse, + AccessRuleListResponse, + AccessRuleCreateResponse, AccessRuleDeleteResponse, ) @@ -28,7 +30,7 @@ def test_method_create(self, client: Cloudflare) -> None: configuration={}, mode="challenge", ) - assert_matches_type(Optional[AccessRule], access_rule, path=["response"]) + assert_matches_type(AccessRuleCreateResponse, access_rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -41,7 +43,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: mode="challenge", notes="This rule is enabled because of an event that occurred on date X.", ) - assert_matches_type(Optional[AccessRule], access_rule, path=["response"]) + assert_matches_type(AccessRuleCreateResponse, access_rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -54,7 +56,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" access_rule = response.parse() - assert_matches_type(Optional[AccessRule], access_rule, path=["response"]) + assert_matches_type(AccessRuleCreateResponse, access_rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -67,7 +69,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" access_rule = response.parse() - assert_matches_type(Optional[AccessRule], access_rule, path=["response"]) + assert_matches_type(AccessRuleCreateResponse, access_rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -75,7 +77,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: @parametrize def test_method_list(self, client: Cloudflare) -> None: access_rule = client.user.firewall.access_rules.list() - assert_matches_type(SyncV4PagePaginationArray[AccessRule], access_rule, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[AccessRuleListResponse], access_rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -99,7 +101,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: page=1, per_page=20, ) - assert_matches_type(SyncV4PagePaginationArray[AccessRule], access_rule, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[AccessRuleListResponse], access_rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -109,7 +111,7 @@ 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" access_rule = response.parse() - assert_matches_type(SyncV4PagePaginationArray[AccessRule], access_rule, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[AccessRuleListResponse], access_rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -119,7 +121,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" access_rule = response.parse() - assert_matches_type(SyncV4PagePaginationArray[AccessRule], access_rule, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[AccessRuleListResponse], access_rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -130,7 +132,7 @@ def test_method_delete(self, client: Cloudflare) -> None: "92f17202ed8bd63d69a66b86a49a8f6b", body={}, ) - assert_matches_type(Optional[AccessRuleDeleteResponse], access_rule, path=["response"]) + assert_matches_type(AccessRuleDeleteResponse, access_rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -143,7 +145,7 @@ 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" access_rule = response.parse() - assert_matches_type(Optional[AccessRuleDeleteResponse], access_rule, path=["response"]) + assert_matches_type(AccessRuleDeleteResponse, access_rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -156,7 +158,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" access_rule = response.parse() - assert_matches_type(Optional[AccessRuleDeleteResponse], access_rule, path=["response"]) + assert_matches_type(AccessRuleDeleteResponse, access_rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -175,7 +177,7 @@ def test_method_edit(self, client: Cloudflare) -> None: access_rule = client.user.firewall.access_rules.edit( "92f17202ed8bd63d69a66b86a49a8f6b", ) - assert_matches_type(Optional[AccessRule], access_rule, path=["response"]) + assert_matches_type(AccessRuleEditResponse, access_rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -185,7 +187,7 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: mode="challenge", notes="This rule is enabled because of an event that occurred on date X.", ) - assert_matches_type(Optional[AccessRule], access_rule, path=["response"]) + assert_matches_type(AccessRuleEditResponse, access_rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -197,7 +199,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" access_rule = response.parse() - assert_matches_type(Optional[AccessRule], access_rule, path=["response"]) + assert_matches_type(AccessRuleEditResponse, access_rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -209,7 +211,7 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" access_rule = response.parse() - assert_matches_type(Optional[AccessRule], access_rule, path=["response"]) + assert_matches_type(AccessRuleEditResponse, access_rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -232,7 +234,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: configuration={}, mode="challenge", ) - assert_matches_type(Optional[AccessRule], access_rule, path=["response"]) + assert_matches_type(AccessRuleCreateResponse, access_rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -245,7 +247,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare mode="challenge", notes="This rule is enabled because of an event that occurred on date X.", ) - assert_matches_type(Optional[AccessRule], access_rule, path=["response"]) + assert_matches_type(AccessRuleCreateResponse, access_rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -258,7 +260,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" access_rule = await response.parse() - assert_matches_type(Optional[AccessRule], access_rule, path=["response"]) + assert_matches_type(AccessRuleCreateResponse, access_rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -271,7 +273,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" access_rule = await response.parse() - assert_matches_type(Optional[AccessRule], access_rule, path=["response"]) + assert_matches_type(AccessRuleCreateResponse, access_rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -279,7 +281,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> @parametrize async def test_method_list(self, async_client: AsyncCloudflare) -> None: access_rule = await async_client.user.firewall.access_rules.list() - assert_matches_type(AsyncV4PagePaginationArray[AccessRule], access_rule, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[AccessRuleListResponse], access_rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -303,7 +305,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) page=1, per_page=20, ) - assert_matches_type(AsyncV4PagePaginationArray[AccessRule], access_rule, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[AccessRuleListResponse], access_rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -313,7 +315,7 @@ 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" access_rule = await response.parse() - assert_matches_type(AsyncV4PagePaginationArray[AccessRule], access_rule, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[AccessRuleListResponse], access_rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -323,7 +325,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" access_rule = await response.parse() - assert_matches_type(AsyncV4PagePaginationArray[AccessRule], access_rule, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[AccessRuleListResponse], access_rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -334,7 +336,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: "92f17202ed8bd63d69a66b86a49a8f6b", body={}, ) - assert_matches_type(Optional[AccessRuleDeleteResponse], access_rule, path=["response"]) + assert_matches_type(AccessRuleDeleteResponse, access_rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -347,7 +349,7 @@ 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" access_rule = await response.parse() - assert_matches_type(Optional[AccessRuleDeleteResponse], access_rule, path=["response"]) + assert_matches_type(AccessRuleDeleteResponse, access_rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -360,7 +362,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" access_rule = await response.parse() - assert_matches_type(Optional[AccessRuleDeleteResponse], access_rule, path=["response"]) + assert_matches_type(AccessRuleDeleteResponse, access_rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -379,7 +381,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: access_rule = await async_client.user.firewall.access_rules.edit( "92f17202ed8bd63d69a66b86a49a8f6b", ) - assert_matches_type(Optional[AccessRule], access_rule, path=["response"]) + assert_matches_type(AccessRuleEditResponse, access_rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -389,7 +391,7 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) mode="challenge", notes="This rule is enabled because of an event that occurred on date X.", ) - assert_matches_type(Optional[AccessRule], access_rule, path=["response"]) + assert_matches_type(AccessRuleEditResponse, access_rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -401,7 +403,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" access_rule = await response.parse() - assert_matches_type(Optional[AccessRule], access_rule, path=["response"]) + assert_matches_type(AccessRuleEditResponse, access_rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -413,7 +415,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" access_rule = await response.parse() - assert_matches_type(Optional[AccessRule], access_rule, path=["response"]) + assert_matches_type(AccessRuleEditResponse, access_rule, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/user/load_balancers/analytics/test_events.py b/tests/api_resources/user/load_balancers/analytics/test_events.py index 26e4e169ef3..d29a265c01d 100644 --- a/tests/api_resources/user/load_balancers/analytics/test_events.py +++ b/tests/api_resources/user/load_balancers/analytics/test_events.py @@ -11,7 +11,7 @@ from tests.utils import assert_matches_type from cloudflare._utils import parse_datetime from cloudflare.pagination import SyncSinglePage, AsyncSinglePage -from cloudflare.types.user.load_balancers.analytics import LoadBalancingAnalytics +from cloudflare.types.user.load_balancers import Analytics base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -23,7 +23,7 @@ class TestEvents: @parametrize def test_method_list(self, client: Cloudflare) -> None: event = client.user.load_balancers.analytics.events.list() - assert_matches_type(SyncSinglePage[LoadBalancingAnalytics], event, path=["response"]) + assert_matches_type(SyncSinglePage[Analytics], event, path=["response"]) @pytest.mark.skip() @parametrize @@ -37,7 +37,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: since=parse_datetime("2016-11-11T12:00:00Z"), until=parse_datetime("2016-11-11T13:00:00Z"), ) - assert_matches_type(SyncSinglePage[LoadBalancingAnalytics], event, path=["response"]) + assert_matches_type(SyncSinglePage[Analytics], event, path=["response"]) @pytest.mark.skip() @parametrize @@ -47,7 +47,7 @@ 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" event = response.parse() - assert_matches_type(SyncSinglePage[LoadBalancingAnalytics], event, path=["response"]) + assert_matches_type(SyncSinglePage[Analytics], event, path=["response"]) @pytest.mark.skip() @parametrize @@ -57,7 +57,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" event = response.parse() - assert_matches_type(SyncSinglePage[LoadBalancingAnalytics], event, path=["response"]) + assert_matches_type(SyncSinglePage[Analytics], event, path=["response"]) assert cast(Any, response.is_closed) is True @@ -69,7 +69,7 @@ class TestAsyncEvents: @parametrize async def test_method_list(self, async_client: AsyncCloudflare) -> None: event = await async_client.user.load_balancers.analytics.events.list() - assert_matches_type(AsyncSinglePage[LoadBalancingAnalytics], event, path=["response"]) + assert_matches_type(AsyncSinglePage[Analytics], event, path=["response"]) @pytest.mark.skip() @parametrize @@ -83,7 +83,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) since=parse_datetime("2016-11-11T12:00:00Z"), until=parse_datetime("2016-11-11T13:00:00Z"), ) - assert_matches_type(AsyncSinglePage[LoadBalancingAnalytics], event, path=["response"]) + assert_matches_type(AsyncSinglePage[Analytics], event, path=["response"]) @pytest.mark.skip() @parametrize @@ -93,7 +93,7 @@ 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" event = await response.parse() - assert_matches_type(AsyncSinglePage[LoadBalancingAnalytics], event, path=["response"]) + assert_matches_type(AsyncSinglePage[Analytics], event, path=["response"]) @pytest.mark.skip() @parametrize @@ -103,6 +103,6 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" event = await response.parse() - assert_matches_type(AsyncSinglePage[LoadBalancingAnalytics], event, path=["response"]) + assert_matches_type(AsyncSinglePage[Analytics], event, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/user/load_balancers/test_preview.py b/tests/api_resources/user/load_balancers/test_preview.py index a5da3f9e2c9..bbf7558671a 100644 --- a/tests/api_resources/user/load_balancers/test_preview.py +++ b/tests/api_resources/user/load_balancers/test_preview.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.user.load_balancers import LoadBalancingPreview +from cloudflare.types.user.load_balancers import Preview base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -23,7 +23,7 @@ def test_method_get(self, client: Cloudflare) -> None: preview = client.user.load_balancers.preview.get( "f1aba936b94213e5b8dca0c0dbf1f9cc", ) - assert_matches_type(LoadBalancingPreview, preview, path=["response"]) + assert_matches_type(Preview, preview, path=["response"]) @pytest.mark.skip() @parametrize @@ -35,7 +35,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" preview = response.parse() - assert_matches_type(LoadBalancingPreview, preview, path=["response"]) + assert_matches_type(Preview, preview, path=["response"]) @pytest.mark.skip() @parametrize @@ -47,7 +47,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" preview = response.parse() - assert_matches_type(LoadBalancingPreview, preview, path=["response"]) + assert_matches_type(Preview, preview, path=["response"]) assert cast(Any, response.is_closed) is True @@ -69,7 +69,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: preview = await async_client.user.load_balancers.preview.get( "f1aba936b94213e5b8dca0c0dbf1f9cc", ) - assert_matches_type(LoadBalancingPreview, preview, path=["response"]) + assert_matches_type(Preview, preview, path=["response"]) @pytest.mark.skip() @parametrize @@ -81,7 +81,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" preview = await response.parse() - assert_matches_type(LoadBalancingPreview, preview, path=["response"]) + assert_matches_type(Preview, preview, path=["response"]) @pytest.mark.skip() @parametrize @@ -93,7 +93,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" preview = await response.parse() - assert_matches_type(LoadBalancingPreview, preview, path=["response"]) + assert_matches_type(Preview, preview, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/waiting_rooms/test_events.py b/tests/api_resources/waiting_rooms/test_events.py index 1226bd78135..97895dca042 100644 --- a/tests/api_resources/waiting_rooms/test_events.py +++ b/tests/api_resources/waiting_rooms/test_events.py @@ -11,8 +11,12 @@ from tests.utils import assert_matches_type from cloudflare.pagination import SyncSinglePage, AsyncSinglePage from cloudflare.types.waiting_rooms import ( - Event, + EventGetResponse, + EventEditResponse, + EventListResponse, + EventCreateResponse, EventDeleteResponse, + EventUpdateResponse, ) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -31,7 +35,7 @@ def test_method_create(self, client: Cloudflare) -> None: event_start_time="2021-09-28T15:30:00.000Z", name="production_webinar_event", ) - assert_matches_type(Event, event, path=["response"]) + assert_matches_type(EventCreateResponse, event, path=["response"]) @pytest.mark.skip() @parametrize @@ -53,7 +57,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: suspended=True, total_active_users=200, ) - assert_matches_type(Event, event, path=["response"]) + assert_matches_type(EventCreateResponse, event, path=["response"]) @pytest.mark.skip() @parametrize @@ -69,7 +73,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" event = response.parse() - assert_matches_type(Event, event, path=["response"]) + assert_matches_type(EventCreateResponse, event, path=["response"]) @pytest.mark.skip() @parametrize @@ -85,7 +89,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" event = response.parse() - assert_matches_type(Event, event, path=["response"]) + assert_matches_type(EventCreateResponse, event, path=["response"]) assert cast(Any, response.is_closed) is True @@ -121,7 +125,7 @@ def test_method_update(self, client: Cloudflare) -> None: event_start_time="2021-09-28T15:30:00.000Z", name="production_webinar_event", ) - assert_matches_type(Event, event, path=["response"]) + assert_matches_type(EventUpdateResponse, event, path=["response"]) @pytest.mark.skip() @parametrize @@ -144,7 +148,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: suspended=True, total_active_users=200, ) - assert_matches_type(Event, event, path=["response"]) + assert_matches_type(EventUpdateResponse, event, path=["response"]) @pytest.mark.skip() @parametrize @@ -161,7 +165,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" event = response.parse() - assert_matches_type(Event, event, path=["response"]) + assert_matches_type(EventUpdateResponse, event, path=["response"]) @pytest.mark.skip() @parametrize @@ -178,7 +182,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" event = response.parse() - assert_matches_type(Event, event, path=["response"]) + assert_matches_type(EventUpdateResponse, event, path=["response"]) assert cast(Any, response.is_closed) is True @@ -222,7 +226,7 @@ def test_method_list(self, client: Cloudflare) -> None: "699d98642c564d2e855e9661899b7252", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncSinglePage[Event], event, path=["response"]) + assert_matches_type(SyncSinglePage[EventListResponse], event, path=["response"]) @pytest.mark.skip() @parametrize @@ -235,7 +239,7 @@ 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" event = response.parse() - assert_matches_type(SyncSinglePage[Event], event, path=["response"]) + assert_matches_type(SyncSinglePage[EventListResponse], event, path=["response"]) @pytest.mark.skip() @parametrize @@ -248,7 +252,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" event = response.parse() - assert_matches_type(SyncSinglePage[Event], event, path=["response"]) + assert_matches_type(SyncSinglePage[EventListResponse], event, path=["response"]) assert cast(Any, response.is_closed) is True @@ -348,7 +352,7 @@ def test_method_edit(self, client: Cloudflare) -> None: event_start_time="2021-09-28T15:30:00.000Z", name="production_webinar_event", ) - assert_matches_type(Event, event, path=["response"]) + assert_matches_type(EventEditResponse, event, path=["response"]) @pytest.mark.skip() @parametrize @@ -371,7 +375,7 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: suspended=True, total_active_users=200, ) - assert_matches_type(Event, event, path=["response"]) + assert_matches_type(EventEditResponse, event, path=["response"]) @pytest.mark.skip() @parametrize @@ -388,7 +392,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" event = response.parse() - assert_matches_type(Event, event, path=["response"]) + assert_matches_type(EventEditResponse, event, path=["response"]) @pytest.mark.skip() @parametrize @@ -405,7 +409,7 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" event = response.parse() - assert_matches_type(Event, event, path=["response"]) + assert_matches_type(EventEditResponse, event, path=["response"]) assert cast(Any, response.is_closed) is True @@ -450,7 +454,7 @@ def test_method_get(self, client: Cloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", waiting_room_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(Event, event, path=["response"]) + assert_matches_type(EventGetResponse, event, path=["response"]) @pytest.mark.skip() @parametrize @@ -464,7 +468,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" event = response.parse() - assert_matches_type(Event, event, path=["response"]) + assert_matches_type(EventGetResponse, event, path=["response"]) @pytest.mark.skip() @parametrize @@ -478,7 +482,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" event = response.parse() - assert_matches_type(Event, event, path=["response"]) + assert_matches_type(EventGetResponse, event, path=["response"]) assert cast(Any, response.is_closed) is True @@ -520,7 +524,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: event_start_time="2021-09-28T15:30:00.000Z", name="production_webinar_event", ) - assert_matches_type(Event, event, path=["response"]) + assert_matches_type(EventCreateResponse, event, path=["response"]) @pytest.mark.skip() @parametrize @@ -542,7 +546,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare suspended=True, total_active_users=200, ) - assert_matches_type(Event, event, path=["response"]) + assert_matches_type(EventCreateResponse, event, path=["response"]) @pytest.mark.skip() @parametrize @@ -558,7 +562,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" event = await response.parse() - assert_matches_type(Event, event, path=["response"]) + assert_matches_type(EventCreateResponse, event, path=["response"]) @pytest.mark.skip() @parametrize @@ -574,7 +578,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" event = await response.parse() - assert_matches_type(Event, event, path=["response"]) + assert_matches_type(EventCreateResponse, event, path=["response"]) assert cast(Any, response.is_closed) is True @@ -610,7 +614,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: event_start_time="2021-09-28T15:30:00.000Z", name="production_webinar_event", ) - assert_matches_type(Event, event, path=["response"]) + assert_matches_type(EventUpdateResponse, event, path=["response"]) @pytest.mark.skip() @parametrize @@ -633,7 +637,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare suspended=True, total_active_users=200, ) - assert_matches_type(Event, event, path=["response"]) + assert_matches_type(EventUpdateResponse, event, path=["response"]) @pytest.mark.skip() @parametrize @@ -650,7 +654,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" event = await response.parse() - assert_matches_type(Event, event, path=["response"]) + assert_matches_type(EventUpdateResponse, event, path=["response"]) @pytest.mark.skip() @parametrize @@ -667,7 +671,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" event = await response.parse() - assert_matches_type(Event, event, path=["response"]) + assert_matches_type(EventUpdateResponse, event, path=["response"]) assert cast(Any, response.is_closed) is True @@ -711,7 +715,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: "699d98642c564d2e855e9661899b7252", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncSinglePage[Event], event, path=["response"]) + assert_matches_type(AsyncSinglePage[EventListResponse], event, path=["response"]) @pytest.mark.skip() @parametrize @@ -724,7 +728,7 @@ 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" event = await response.parse() - assert_matches_type(AsyncSinglePage[Event], event, path=["response"]) + assert_matches_type(AsyncSinglePage[EventListResponse], event, path=["response"]) @pytest.mark.skip() @parametrize @@ -737,7 +741,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" event = await response.parse() - assert_matches_type(AsyncSinglePage[Event], event, path=["response"]) + assert_matches_type(AsyncSinglePage[EventListResponse], event, path=["response"]) assert cast(Any, response.is_closed) is True @@ -837,7 +841,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: event_start_time="2021-09-28T15:30:00.000Z", name="production_webinar_event", ) - assert_matches_type(Event, event, path=["response"]) + assert_matches_type(EventEditResponse, event, path=["response"]) @pytest.mark.skip() @parametrize @@ -860,7 +864,7 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) suspended=True, total_active_users=200, ) - assert_matches_type(Event, event, path=["response"]) + assert_matches_type(EventEditResponse, event, path=["response"]) @pytest.mark.skip() @parametrize @@ -877,7 +881,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" event = await response.parse() - assert_matches_type(Event, event, path=["response"]) + assert_matches_type(EventEditResponse, event, path=["response"]) @pytest.mark.skip() @parametrize @@ -894,7 +898,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" event = await response.parse() - assert_matches_type(Event, event, path=["response"]) + assert_matches_type(EventEditResponse, event, path=["response"]) assert cast(Any, response.is_closed) is True @@ -939,7 +943,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", waiting_room_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(Event, event, path=["response"]) + assert_matches_type(EventGetResponse, event, path=["response"]) @pytest.mark.skip() @parametrize @@ -953,7 +957,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" event = await response.parse() - assert_matches_type(Event, event, path=["response"]) + assert_matches_type(EventGetResponse, event, path=["response"]) @pytest.mark.skip() @parametrize @@ -967,7 +971,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" event = await response.parse() - assert_matches_type(Event, event, path=["response"]) + assert_matches_type(EventGetResponse, event, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/waiting_rooms/test_rules.py b/tests/api_resources/waiting_rooms/test_rules.py index 7190d269fb3..191f587ac5f 100644 --- a/tests/api_resources/waiting_rooms/test_rules.py +++ b/tests/api_resources/waiting_rooms/test_rules.py @@ -11,8 +11,8 @@ from tests.utils import assert_matches_type from cloudflare.pagination import SyncSinglePage, AsyncSinglePage from cloudflare.types.waiting_rooms import ( + Event, RuleEditResponse, - RuleListResponse, RuleCreateResponse, RuleDeleteResponse, RuleUpdateResponse, @@ -228,7 +228,7 @@ def test_method_list(self, client: Cloudflare) -> None: "699d98642c564d2e855e9661899b7252", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncSinglePage[RuleListResponse], rule, path=["response"]) + assert_matches_type(SyncSinglePage[Event], rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -241,7 +241,7 @@ 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" rule = response.parse() - assert_matches_type(SyncSinglePage[RuleListResponse], rule, path=["response"]) + assert_matches_type(SyncSinglePage[Event], rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -254,7 +254,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(SyncSinglePage[RuleListResponse], rule, path=["response"]) + assert_matches_type(SyncSinglePage[Event], rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -642,7 +642,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: "699d98642c564d2e855e9661899b7252", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncSinglePage[RuleListResponse], rule, path=["response"]) + assert_matches_type(AsyncSinglePage[Event], rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -655,7 +655,7 @@ 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" rule = await response.parse() - assert_matches_type(AsyncSinglePage[RuleListResponse], rule, path=["response"]) + assert_matches_type(AsyncSinglePage[Event], rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -668,7 +668,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(AsyncSinglePage[RuleListResponse], rule, path=["response"]) + assert_matches_type(AsyncSinglePage[Event], rule, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/web3/hostnames/ipfs_universal_paths/content_lists/test_entries.py b/tests/api_resources/web3/hostnames/ipfs_universal_paths/content_lists/test_entries.py index 2bf92095fbc..aa2c97c07fb 100644 --- a/tests/api_resources/web3/hostnames/ipfs_universal_paths/content_lists/test_entries.py +++ b/tests/api_resources/web3/hostnames/ipfs_universal_paths/content_lists/test_entries.py @@ -10,9 +10,9 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.types.web3.hostnames.ipfs_universal_paths.content_lists import ( + ContentListItem, EntryListResponse, EntryDeleteResponse, - DistributedWebConfigContentListEntry, ) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -30,7 +30,7 @@ def test_method_create(self, client: Cloudflare) -> None: content="QmPZ9gcCEpqKTo6aq61g2nXGUhM4iCL3ewB6LDXZCtioEB", type="cid", ) - assert_matches_type(DistributedWebConfigContentListEntry, entry, path=["response"]) + assert_matches_type(ContentListItem, entry, path=["response"]) @pytest.mark.skip() @parametrize @@ -42,7 +42,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: type="cid", description="this is my content list entry", ) - assert_matches_type(DistributedWebConfigContentListEntry, entry, path=["response"]) + assert_matches_type(ContentListItem, entry, path=["response"]) @pytest.mark.skip() @parametrize @@ -57,7 +57,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" entry = response.parse() - assert_matches_type(DistributedWebConfigContentListEntry, entry, path=["response"]) + assert_matches_type(ContentListItem, entry, path=["response"]) @pytest.mark.skip() @parametrize @@ -72,7 +72,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" entry = response.parse() - assert_matches_type(DistributedWebConfigContentListEntry, entry, path=["response"]) + assert_matches_type(ContentListItem, entry, path=["response"]) assert cast(Any, response.is_closed) is True @@ -105,7 +105,7 @@ def test_method_update(self, client: Cloudflare) -> None: content="QmPZ9gcCEpqKTo6aq61g2nXGUhM4iCL3ewB6LDXZCtioEB", type="cid", ) - assert_matches_type(DistributedWebConfigContentListEntry, entry, path=["response"]) + assert_matches_type(ContentListItem, entry, path=["response"]) @pytest.mark.skip() @parametrize @@ -118,7 +118,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: type="cid", description="this is my content list entry", ) - assert_matches_type(DistributedWebConfigContentListEntry, entry, path=["response"]) + assert_matches_type(ContentListItem, entry, path=["response"]) @pytest.mark.skip() @parametrize @@ -134,7 +134,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" entry = response.parse() - assert_matches_type(DistributedWebConfigContentListEntry, entry, path=["response"]) + assert_matches_type(ContentListItem, entry, path=["response"]) @pytest.mark.skip() @parametrize @@ -150,7 +150,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" entry = response.parse() - assert_matches_type(DistributedWebConfigContentListEntry, entry, path=["response"]) + assert_matches_type(ContentListItem, entry, path=["response"]) assert cast(Any, response.is_closed) is True @@ -318,7 +318,7 @@ def test_method_get(self, client: Cloudflare) -> None: zone_identifier="023e105f4ecef8ad9ca31a8372d0c353", identifier="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(DistributedWebConfigContentListEntry, entry, path=["response"]) + assert_matches_type(ContentListItem, entry, path=["response"]) @pytest.mark.skip() @parametrize @@ -332,7 +332,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" entry = response.parse() - assert_matches_type(DistributedWebConfigContentListEntry, entry, path=["response"]) + assert_matches_type(ContentListItem, entry, path=["response"]) @pytest.mark.skip() @parametrize @@ -346,7 +346,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" entry = response.parse() - assert_matches_type(DistributedWebConfigContentListEntry, entry, path=["response"]) + assert_matches_type(ContentListItem, entry, path=["response"]) assert cast(Any, response.is_closed) is True @@ -389,7 +389,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: content="QmPZ9gcCEpqKTo6aq61g2nXGUhM4iCL3ewB6LDXZCtioEB", type="cid", ) - assert_matches_type(DistributedWebConfigContentListEntry, entry, path=["response"]) + assert_matches_type(ContentListItem, entry, path=["response"]) @pytest.mark.skip() @parametrize @@ -401,7 +401,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare type="cid", description="this is my content list entry", ) - assert_matches_type(DistributedWebConfigContentListEntry, entry, path=["response"]) + assert_matches_type(ContentListItem, entry, path=["response"]) @pytest.mark.skip() @parametrize @@ -418,7 +418,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" entry = await response.parse() - assert_matches_type(DistributedWebConfigContentListEntry, entry, path=["response"]) + assert_matches_type(ContentListItem, entry, path=["response"]) @pytest.mark.skip() @parametrize @@ -433,7 +433,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" entry = await response.parse() - assert_matches_type(DistributedWebConfigContentListEntry, entry, path=["response"]) + assert_matches_type(ContentListItem, entry, path=["response"]) assert cast(Any, response.is_closed) is True @@ -466,7 +466,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: content="QmPZ9gcCEpqKTo6aq61g2nXGUhM4iCL3ewB6LDXZCtioEB", type="cid", ) - assert_matches_type(DistributedWebConfigContentListEntry, entry, path=["response"]) + assert_matches_type(ContentListItem, entry, path=["response"]) @pytest.mark.skip() @parametrize @@ -479,7 +479,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare type="cid", description="this is my content list entry", ) - assert_matches_type(DistributedWebConfigContentListEntry, entry, path=["response"]) + assert_matches_type(ContentListItem, entry, path=["response"]) @pytest.mark.skip() @parametrize @@ -497,7 +497,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" entry = await response.parse() - assert_matches_type(DistributedWebConfigContentListEntry, entry, path=["response"]) + assert_matches_type(ContentListItem, entry, path=["response"]) @pytest.mark.skip() @parametrize @@ -513,7 +513,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" entry = await response.parse() - assert_matches_type(DistributedWebConfigContentListEntry, entry, path=["response"]) + assert_matches_type(ContentListItem, entry, path=["response"]) assert cast(Any, response.is_closed) is True @@ -683,7 +683,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: zone_identifier="023e105f4ecef8ad9ca31a8372d0c353", identifier="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(DistributedWebConfigContentListEntry, entry, path=["response"]) + assert_matches_type(ContentListItem, entry, path=["response"]) @pytest.mark.skip() @parametrize @@ -697,7 +697,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" entry = await response.parse() - assert_matches_type(DistributedWebConfigContentListEntry, entry, path=["response"]) + assert_matches_type(ContentListItem, entry, path=["response"]) @pytest.mark.skip() @parametrize @@ -711,7 +711,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" entry = await response.parse() - assert_matches_type(DistributedWebConfigContentListEntry, entry, path=["response"]) + assert_matches_type(ContentListItem, entry, 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 62cab2a7d3a..e2aa0af76c8 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 @@ -9,9 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.web3.hostnames.ipfs_universal_paths import ( - DistributedWebConfigContentList, -) +from cloudflare.types.web3.hostnames.ipfs_universal_paths import ContentList base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -28,7 +26,7 @@ def test_method_update(self, client: Cloudflare) -> None: action="block", entries=[{}, {}, {}], ) - assert_matches_type(DistributedWebConfigContentList, content_list, path=["response"]) + assert_matches_type(ContentList, content_list, path=["response"]) @pytest.mark.skip() @parametrize @@ -43,7 +41,7 @@ def test_raw_response_update(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(DistributedWebConfigContentList, content_list, path=["response"]) + assert_matches_type(ContentList, content_list, path=["response"]) @pytest.mark.skip() @parametrize @@ -58,7 +56,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" content_list = response.parse() - assert_matches_type(DistributedWebConfigContentList, content_list, path=["response"]) + assert_matches_type(ContentList, content_list, path=["response"]) assert cast(Any, response.is_closed) is True @@ -88,7 +86,7 @@ def test_method_get(self, client: Cloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", zone_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(DistributedWebConfigContentList, content_list, path=["response"]) + assert_matches_type(ContentList, content_list, path=["response"]) @pytest.mark.skip() @parametrize @@ -101,7 +99,7 @@ def test_raw_response_get(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(DistributedWebConfigContentList, content_list, path=["response"]) + assert_matches_type(ContentList, content_list, path=["response"]) @pytest.mark.skip() @parametrize @@ -114,7 +112,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" content_list = response.parse() - assert_matches_type(DistributedWebConfigContentList, content_list, path=["response"]) + assert_matches_type(ContentList, content_list, path=["response"]) assert cast(Any, response.is_closed) is True @@ -146,7 +144,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: action="block", entries=[{}, {}, {}], ) - assert_matches_type(DistributedWebConfigContentList, content_list, path=["response"]) + assert_matches_type(ContentList, content_list, path=["response"]) @pytest.mark.skip() @parametrize @@ -161,7 +159,7 @@ async def test_raw_response_update(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(DistributedWebConfigContentList, content_list, path=["response"]) + assert_matches_type(ContentList, content_list, path=["response"]) @pytest.mark.skip() @parametrize @@ -176,7 +174,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" content_list = await response.parse() - assert_matches_type(DistributedWebConfigContentList, content_list, path=["response"]) + assert_matches_type(ContentList, content_list, path=["response"]) assert cast(Any, response.is_closed) is True @@ -206,7 +204,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", zone_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(DistributedWebConfigContentList, content_list, path=["response"]) + assert_matches_type(ContentList, content_list, path=["response"]) @pytest.mark.skip() @parametrize @@ -219,7 +217,7 @@ async def test_raw_response_get(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(DistributedWebConfigContentList, content_list, path=["response"]) + assert_matches_type(ContentList, content_list, path=["response"]) @pytest.mark.skip() @parametrize @@ -232,7 +230,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" content_list = await response.parse() - assert_matches_type(DistributedWebConfigContentList, content_list, path=["response"]) + assert_matches_type(ContentList, content_list, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/web3/test_hostnames.py b/tests/api_resources/web3/test_hostnames.py index dc062f7126e..9520c176edb 100644 --- a/tests/api_resources/web3/test_hostnames.py +++ b/tests/api_resources/web3/test_hostnames.py @@ -11,7 +11,7 @@ from tests.utils import assert_matches_type from cloudflare.pagination import SyncSinglePage, AsyncSinglePage from cloudflare.types.web3 import ( - DistributedWebHostname, + Hostname, HostnameDeleteResponse, ) @@ -28,7 +28,7 @@ def test_method_create(self, client: Cloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", target="ipfs", ) - assert_matches_type(DistributedWebHostname, hostname, path=["response"]) + assert_matches_type(Hostname, hostname, path=["response"]) @pytest.mark.skip() @parametrize @@ -39,7 +39,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: description="This is my IPFS gateway.", dnslink="/ipns/onboarding.ipfs.cloudflare.com", ) - assert_matches_type(DistributedWebHostname, hostname, path=["response"]) + assert_matches_type(Hostname, hostname, path=["response"]) @pytest.mark.skip() @parametrize @@ -52,7 +52,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" hostname = response.parse() - assert_matches_type(DistributedWebHostname, hostname, path=["response"]) + assert_matches_type(Hostname, hostname, path=["response"]) @pytest.mark.skip() @parametrize @@ -65,7 +65,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" hostname = response.parse() - assert_matches_type(DistributedWebHostname, hostname, path=["response"]) + assert_matches_type(Hostname, hostname, path=["response"]) assert cast(Any, response.is_closed) is True @@ -84,7 +84,7 @@ def test_method_list(self, client: Cloudflare) -> None: hostname = client.web3.hostnames.list( "023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncSinglePage[DistributedWebHostname], hostname, path=["response"]) + assert_matches_type(SyncSinglePage[Hostname], hostname, path=["response"]) @pytest.mark.skip() @parametrize @@ -96,7 +96,7 @@ 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" hostname = response.parse() - assert_matches_type(SyncSinglePage[DistributedWebHostname], hostname, path=["response"]) + assert_matches_type(SyncSinglePage[Hostname], hostname, path=["response"]) @pytest.mark.skip() @parametrize @@ -108,7 +108,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" hostname = response.parse() - assert_matches_type(SyncSinglePage[DistributedWebHostname], hostname, path=["response"]) + assert_matches_type(SyncSinglePage[Hostname], hostname, path=["response"]) assert cast(Any, response.is_closed) is True @@ -184,7 +184,7 @@ def test_method_edit(self, client: Cloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", zone_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(DistributedWebHostname, hostname, path=["response"]) + assert_matches_type(Hostname, hostname, path=["response"]) @pytest.mark.skip() @parametrize @@ -195,7 +195,7 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: description="This is my IPFS gateway.", dnslink="/ipns/onboarding.ipfs.cloudflare.com", ) - assert_matches_type(DistributedWebHostname, hostname, path=["response"]) + assert_matches_type(Hostname, hostname, path=["response"]) @pytest.mark.skip() @parametrize @@ -208,7 +208,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" hostname = response.parse() - assert_matches_type(DistributedWebHostname, hostname, path=["response"]) + assert_matches_type(Hostname, hostname, path=["response"]) @pytest.mark.skip() @parametrize @@ -221,7 +221,7 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" hostname = response.parse() - assert_matches_type(DistributedWebHostname, hostname, path=["response"]) + assert_matches_type(Hostname, hostname, path=["response"]) assert cast(Any, response.is_closed) is True @@ -247,7 +247,7 @@ def test_method_get(self, client: Cloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", zone_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(DistributedWebHostname, hostname, path=["response"]) + assert_matches_type(Hostname, hostname, path=["response"]) @pytest.mark.skip() @parametrize @@ -260,7 +260,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" hostname = response.parse() - assert_matches_type(DistributedWebHostname, hostname, path=["response"]) + assert_matches_type(Hostname, hostname, path=["response"]) @pytest.mark.skip() @parametrize @@ -273,7 +273,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" hostname = response.parse() - assert_matches_type(DistributedWebHostname, hostname, path=["response"]) + assert_matches_type(Hostname, hostname, path=["response"]) assert cast(Any, response.is_closed) is True @@ -303,7 +303,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", target="ipfs", ) - assert_matches_type(DistributedWebHostname, hostname, path=["response"]) + assert_matches_type(Hostname, hostname, path=["response"]) @pytest.mark.skip() @parametrize @@ -314,7 +314,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare description="This is my IPFS gateway.", dnslink="/ipns/onboarding.ipfs.cloudflare.com", ) - assert_matches_type(DistributedWebHostname, hostname, path=["response"]) + assert_matches_type(Hostname, hostname, path=["response"]) @pytest.mark.skip() @parametrize @@ -327,7 +327,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" hostname = await response.parse() - assert_matches_type(DistributedWebHostname, hostname, path=["response"]) + assert_matches_type(Hostname, hostname, path=["response"]) @pytest.mark.skip() @parametrize @@ -340,7 +340,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" hostname = await response.parse() - assert_matches_type(DistributedWebHostname, hostname, path=["response"]) + assert_matches_type(Hostname, hostname, path=["response"]) assert cast(Any, response.is_closed) is True @@ -359,7 +359,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: hostname = await async_client.web3.hostnames.list( "023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncSinglePage[DistributedWebHostname], hostname, path=["response"]) + assert_matches_type(AsyncSinglePage[Hostname], hostname, path=["response"]) @pytest.mark.skip() @parametrize @@ -371,7 +371,7 @@ 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" hostname = await response.parse() - assert_matches_type(AsyncSinglePage[DistributedWebHostname], hostname, path=["response"]) + assert_matches_type(AsyncSinglePage[Hostname], hostname, path=["response"]) @pytest.mark.skip() @parametrize @@ -383,7 +383,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" hostname = await response.parse() - assert_matches_type(AsyncSinglePage[DistributedWebHostname], hostname, path=["response"]) + assert_matches_type(AsyncSinglePage[Hostname], hostname, path=["response"]) assert cast(Any, response.is_closed) is True @@ -459,7 +459,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", zone_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(DistributedWebHostname, hostname, path=["response"]) + assert_matches_type(Hostname, hostname, path=["response"]) @pytest.mark.skip() @parametrize @@ -470,7 +470,7 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) description="This is my IPFS gateway.", dnslink="/ipns/onboarding.ipfs.cloudflare.com", ) - assert_matches_type(DistributedWebHostname, hostname, path=["response"]) + assert_matches_type(Hostname, hostname, path=["response"]) @pytest.mark.skip() @parametrize @@ -483,7 +483,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" hostname = await response.parse() - assert_matches_type(DistributedWebHostname, hostname, path=["response"]) + assert_matches_type(Hostname, hostname, path=["response"]) @pytest.mark.skip() @parametrize @@ -496,7 +496,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" hostname = await response.parse() - assert_matches_type(DistributedWebHostname, hostname, path=["response"]) + assert_matches_type(Hostname, hostname, path=["response"]) assert cast(Any, response.is_closed) is True @@ -522,7 +522,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", zone_identifier="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(DistributedWebHostname, hostname, path=["response"]) + assert_matches_type(Hostname, hostname, path=["response"]) @pytest.mark.skip() @parametrize @@ -535,7 +535,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" hostname = await response.parse() - assert_matches_type(DistributedWebHostname, hostname, path=["response"]) + assert_matches_type(Hostname, hostname, path=["response"]) @pytest.mark.skip() @parametrize @@ -548,7 +548,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" hostname = await response.parse() - assert_matches_type(DistributedWebHostname, hostname, path=["response"]) + assert_matches_type(Hostname, hostname, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/workers/scripts/test_settings.py b/tests/api_resources/workers/scripts/test_settings.py index 324015fc81e..18860873e22 100644 --- a/tests/api_resources/workers/scripts/test_settings.py +++ b/tests/api_resources/workers/scripts/test_settings.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.workers import SettingsItem +from cloudflare.types.workers import ScriptSetting base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -24,7 +24,7 @@ def test_method_edit(self, client: Cloudflare) -> None: "this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SettingsItem, setting, path=["response"]) + assert_matches_type(ScriptSetting, setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -51,7 +51,7 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: }, ], ) - assert_matches_type(SettingsItem, setting, path=["response"]) + assert_matches_type(ScriptSetting, setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -64,7 +64,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = response.parse() - assert_matches_type(SettingsItem, setting, path=["response"]) + assert_matches_type(ScriptSetting, setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -77,7 +77,7 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = response.parse() - assert_matches_type(SettingsItem, setting, path=["response"]) + assert_matches_type(ScriptSetting, setting, path=["response"]) assert cast(Any, response.is_closed) is True @@ -103,7 +103,7 @@ def test_method_get(self, client: Cloudflare) -> None: "this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SettingsItem, setting, path=["response"]) + assert_matches_type(ScriptSetting, setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -116,7 +116,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = response.parse() - assert_matches_type(SettingsItem, setting, path=["response"]) + assert_matches_type(ScriptSetting, setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -129,7 +129,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = response.parse() - assert_matches_type(SettingsItem, setting, path=["response"]) + assert_matches_type(ScriptSetting, setting, path=["response"]) assert cast(Any, response.is_closed) is True @@ -159,7 +159,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: "this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SettingsItem, setting, path=["response"]) + assert_matches_type(ScriptSetting, setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -186,7 +186,7 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) }, ], ) - assert_matches_type(SettingsItem, setting, path=["response"]) + assert_matches_type(ScriptSetting, setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -199,7 +199,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = await response.parse() - assert_matches_type(SettingsItem, setting, path=["response"]) + assert_matches_type(ScriptSetting, setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -212,7 +212,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = await response.parse() - assert_matches_type(SettingsItem, setting, path=["response"]) + assert_matches_type(ScriptSetting, setting, path=["response"]) assert cast(Any, response.is_closed) is True @@ -238,7 +238,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: "this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SettingsItem, setting, path=["response"]) + assert_matches_type(ScriptSetting, setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -251,7 +251,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = await response.parse() - assert_matches_type(SettingsItem, setting, path=["response"]) + assert_matches_type(ScriptSetting, setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -264,7 +264,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = await response.parse() - assert_matches_type(SettingsItem, setting, path=["response"]) + assert_matches_type(ScriptSetting, setting, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/workers/scripts/versions/test_settings.py b/tests/api_resources/workers/scripts/versions/test_settings.py index e46ac5091fc..f53a9d35640 100644 --- a/tests/api_resources/workers/scripts/versions/test_settings.py +++ b/tests/api_resources/workers/scripts/versions/test_settings.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.workers.scripts.versions import SettingsItem +from cloudflare.types.workers.scripts.versions import Settings base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -24,7 +24,7 @@ def test_method_edit(self, client: Cloudflare) -> None: "this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SettingsItem, setting, path=["response"]) + assert_matches_type(Settings, setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -100,7 +100,7 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: "usage_model": "unbound", }, ) - assert_matches_type(SettingsItem, setting, path=["response"]) + assert_matches_type(Settings, setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -113,7 +113,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = response.parse() - assert_matches_type(SettingsItem, setting, path=["response"]) + assert_matches_type(Settings, setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -126,7 +126,7 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = response.parse() - assert_matches_type(SettingsItem, setting, path=["response"]) + assert_matches_type(Settings, setting, path=["response"]) assert cast(Any, response.is_closed) is True @@ -152,7 +152,7 @@ def test_method_get(self, client: Cloudflare) -> None: "this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SettingsItem, setting, path=["response"]) + assert_matches_type(Settings, setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -165,7 +165,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = response.parse() - assert_matches_type(SettingsItem, setting, path=["response"]) + assert_matches_type(Settings, setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -178,7 +178,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = response.parse() - assert_matches_type(SettingsItem, setting, path=["response"]) + assert_matches_type(Settings, setting, path=["response"]) assert cast(Any, response.is_closed) is True @@ -208,7 +208,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: "this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SettingsItem, setting, path=["response"]) + assert_matches_type(Settings, setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -284,7 +284,7 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) "usage_model": "unbound", }, ) - assert_matches_type(SettingsItem, setting, path=["response"]) + assert_matches_type(Settings, setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -297,7 +297,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = await response.parse() - assert_matches_type(SettingsItem, setting, path=["response"]) + assert_matches_type(Settings, setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -310,7 +310,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = await response.parse() - assert_matches_type(SettingsItem, setting, path=["response"]) + assert_matches_type(Settings, setting, path=["response"]) assert cast(Any, response.is_closed) is True @@ -336,7 +336,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: "this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SettingsItem, setting, path=["response"]) + assert_matches_type(Settings, setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -349,7 +349,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = await response.parse() - assert_matches_type(SettingsItem, setting, path=["response"]) + assert_matches_type(Settings, setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -362,7 +362,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = await response.parse() - assert_matches_type(SettingsItem, setting, path=["response"]) + assert_matches_type(Settings, setting, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/workers/services/environments/test_settings.py b/tests/api_resources/workers/services/environments/test_settings.py index 1c0e82365a8..4d06a04a600 100644 --- a/tests/api_resources/workers/services/environments/test_settings.py +++ b/tests/api_resources/workers/services/environments/test_settings.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.workers import SettingsItem +from cloudflare.types.workers import ScriptSetting base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -55,7 +55,7 @@ def test_method_edit(self, client: Cloudflare) -> None: result={}, success=True, ) - assert_matches_type(SettingsItem, setting, path=["response"]) + assert_matches_type(ScriptSetting, setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -114,7 +114,7 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: }, success=True, ) - assert_matches_type(SettingsItem, setting, path=["response"]) + assert_matches_type(ScriptSetting, setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -158,7 +158,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = response.parse() - assert_matches_type(SettingsItem, setting, path=["response"]) + assert_matches_type(ScriptSetting, setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -202,7 +202,7 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = response.parse() - assert_matches_type(SettingsItem, setting, path=["response"]) + assert_matches_type(ScriptSetting, setting, path=["response"]) assert cast(Any, response.is_closed) is True @@ -328,7 +328,7 @@ def test_method_get(self, client: Cloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", service_name="my-worker", ) - assert_matches_type(SettingsItem, setting, path=["response"]) + assert_matches_type(ScriptSetting, setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -342,7 +342,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = response.parse() - assert_matches_type(SettingsItem, setting, path=["response"]) + assert_matches_type(ScriptSetting, setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -356,7 +356,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = response.parse() - assert_matches_type(SettingsItem, setting, path=["response"]) + assert_matches_type(ScriptSetting, setting, path=["response"]) assert cast(Any, response.is_closed) is True @@ -426,7 +426,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: result={}, success=True, ) - assert_matches_type(SettingsItem, setting, path=["response"]) + assert_matches_type(ScriptSetting, setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -485,7 +485,7 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) }, success=True, ) - assert_matches_type(SettingsItem, setting, path=["response"]) + assert_matches_type(ScriptSetting, setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -529,7 +529,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = await response.parse() - assert_matches_type(SettingsItem, setting, path=["response"]) + assert_matches_type(ScriptSetting, setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -573,7 +573,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = await response.parse() - assert_matches_type(SettingsItem, setting, path=["response"]) + assert_matches_type(ScriptSetting, setting, path=["response"]) assert cast(Any, response.is_closed) is True @@ -699,7 +699,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", service_name="my-worker", ) - assert_matches_type(SettingsItem, setting, path=["response"]) + assert_matches_type(ScriptSetting, setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -713,7 +713,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = await response.parse() - assert_matches_type(SettingsItem, setting, path=["response"]) + assert_matches_type(ScriptSetting, setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -727,7 +727,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = await response.parse() - assert_matches_type(SettingsItem, setting, path=["response"]) + assert_matches_type(ScriptSetting, setting, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/workers/test_domains.py b/tests/api_resources/workers/test_domains.py index 490e2c440d3..ab46c5a79c7 100644 --- a/tests/api_resources/workers/test_domains.py +++ b/tests/api_resources/workers/test_domains.py @@ -10,7 +10,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.pagination import SyncSinglePage, AsyncSinglePage -from cloudflare.types.workers import WorkersDomain +from cloudflare.types.workers import Domain base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -28,7 +28,7 @@ def test_method_update(self, client: Cloudflare) -> None: service="foo", zone_id="593c9c94de529bbbfaac7c53ced0447d", ) - assert_matches_type(WorkersDomain, domain, path=["response"]) + assert_matches_type(Domain, domain, path=["response"]) @pytest.mark.skip() @parametrize @@ -44,7 +44,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" domain = response.parse() - assert_matches_type(WorkersDomain, domain, path=["response"]) + assert_matches_type(Domain, domain, path=["response"]) @pytest.mark.skip() @parametrize @@ -60,7 +60,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" domain = response.parse() - assert_matches_type(WorkersDomain, domain, path=["response"]) + assert_matches_type(Domain, domain, path=["response"]) assert cast(Any, response.is_closed) is True @@ -82,7 +82,7 @@ def test_method_list(self, client: Cloudflare) -> None: domain = client.workers.domains.list( account_id="9a7806061c88ada191ed06f989cc3dac", ) - assert_matches_type(SyncSinglePage[WorkersDomain], domain, path=["response"]) + assert_matches_type(SyncSinglePage[Domain], domain, path=["response"]) @pytest.mark.skip() @parametrize @@ -95,7 +95,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: zone_id="593c9c94de529bbbfaac7c53ced0447d", zone_name="example.com", ) - assert_matches_type(SyncSinglePage[WorkersDomain], domain, path=["response"]) + assert_matches_type(SyncSinglePage[Domain], domain, path=["response"]) @pytest.mark.skip() @parametrize @@ -107,7 +107,7 @@ 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" domain = response.parse() - assert_matches_type(SyncSinglePage[WorkersDomain], domain, path=["response"]) + assert_matches_type(SyncSinglePage[Domain], domain, path=["response"]) @pytest.mark.skip() @parametrize @@ -119,7 +119,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" domain = response.parse() - assert_matches_type(SyncSinglePage[WorkersDomain], domain, path=["response"]) + assert_matches_type(SyncSinglePage[Domain], domain, path=["response"]) assert cast(Any, response.is_closed) is True @@ -195,7 +195,7 @@ def test_method_get(self, client: Cloudflare) -> None: "dbe10b4bc17c295377eabd600e1787fd", account_id="9a7806061c88ada191ed06f989cc3dac", ) - assert_matches_type(WorkersDomain, domain, path=["response"]) + assert_matches_type(Domain, domain, path=["response"]) @pytest.mark.skip() @parametrize @@ -208,7 +208,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" domain = response.parse() - assert_matches_type(WorkersDomain, domain, path=["response"]) + assert_matches_type(Domain, domain, path=["response"]) @pytest.mark.skip() @parametrize @@ -221,7 +221,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" domain = response.parse() - assert_matches_type(WorkersDomain, domain, path=["response"]) + assert_matches_type(Domain, domain, path=["response"]) assert cast(Any, response.is_closed) is True @@ -254,7 +254,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: service="foo", zone_id="593c9c94de529bbbfaac7c53ced0447d", ) - assert_matches_type(WorkersDomain, domain, path=["response"]) + assert_matches_type(Domain, domain, path=["response"]) @pytest.mark.skip() @parametrize @@ -270,7 +270,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" domain = await response.parse() - assert_matches_type(WorkersDomain, domain, path=["response"]) + assert_matches_type(Domain, domain, path=["response"]) @pytest.mark.skip() @parametrize @@ -286,7 +286,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" domain = await response.parse() - assert_matches_type(WorkersDomain, domain, path=["response"]) + assert_matches_type(Domain, domain, path=["response"]) assert cast(Any, response.is_closed) is True @@ -308,7 +308,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: domain = await async_client.workers.domains.list( account_id="9a7806061c88ada191ed06f989cc3dac", ) - assert_matches_type(AsyncSinglePage[WorkersDomain], domain, path=["response"]) + assert_matches_type(AsyncSinglePage[Domain], domain, path=["response"]) @pytest.mark.skip() @parametrize @@ -321,7 +321,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) zone_id="593c9c94de529bbbfaac7c53ced0447d", zone_name="example.com", ) - assert_matches_type(AsyncSinglePage[WorkersDomain], domain, path=["response"]) + assert_matches_type(AsyncSinglePage[Domain], domain, path=["response"]) @pytest.mark.skip() @parametrize @@ -333,7 +333,7 @@ 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" domain = await response.parse() - assert_matches_type(AsyncSinglePage[WorkersDomain], domain, path=["response"]) + assert_matches_type(AsyncSinglePage[Domain], domain, path=["response"]) @pytest.mark.skip() @parametrize @@ -345,7 +345,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" domain = await response.parse() - assert_matches_type(AsyncSinglePage[WorkersDomain], domain, path=["response"]) + assert_matches_type(AsyncSinglePage[Domain], domain, path=["response"]) assert cast(Any, response.is_closed) is True @@ -421,7 +421,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: "dbe10b4bc17c295377eabd600e1787fd", account_id="9a7806061c88ada191ed06f989cc3dac", ) - assert_matches_type(WorkersDomain, domain, path=["response"]) + assert_matches_type(Domain, domain, path=["response"]) @pytest.mark.skip() @parametrize @@ -434,7 +434,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" domain = await response.parse() - assert_matches_type(WorkersDomain, domain, path=["response"]) + assert_matches_type(Domain, domain, path=["response"]) @pytest.mark.skip() @parametrize @@ -447,7 +447,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" domain = await response.parse() - assert_matches_type(WorkersDomain, domain, path=["response"]) + assert_matches_type(Domain, domain, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/workers_for_platforms/dispatch/namespaces/scripts/test_settings.py b/tests/api_resources/workers_for_platforms/dispatch/namespaces/scripts/test_settings.py index e96c7fa94a6..68c0091b8ae 100644 --- a/tests/api_resources/workers_for_platforms/dispatch/namespaces/scripts/test_settings.py +++ b/tests/api_resources/workers_for_platforms/dispatch/namespaces/scripts/test_settings.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.workers import SettingsItem +from cloudflare.types.workers import ScriptSetting base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -55,7 +55,7 @@ def test_method_edit(self, client: Cloudflare) -> None: result={}, success=True, ) - assert_matches_type(SettingsItem, setting, path=["response"]) + assert_matches_type(ScriptSetting, setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -114,7 +114,7 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: }, success=True, ) - assert_matches_type(SettingsItem, setting, path=["response"]) + assert_matches_type(ScriptSetting, setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -158,7 +158,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = response.parse() - assert_matches_type(SettingsItem, setting, path=["response"]) + assert_matches_type(ScriptSetting, setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -202,7 +202,7 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = response.parse() - assert_matches_type(SettingsItem, setting, path=["response"]) + assert_matches_type(ScriptSetting, setting, path=["response"]) assert cast(Any, response.is_closed) is True @@ -328,7 +328,7 @@ def test_method_get(self, client: Cloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="my-dispatch-namespace", ) - assert_matches_type(SettingsItem, setting, path=["response"]) + assert_matches_type(ScriptSetting, setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -342,7 +342,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = response.parse() - assert_matches_type(SettingsItem, setting, path=["response"]) + assert_matches_type(ScriptSetting, setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -356,7 +356,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = response.parse() - assert_matches_type(SettingsItem, setting, path=["response"]) + assert_matches_type(ScriptSetting, setting, path=["response"]) assert cast(Any, response.is_closed) is True @@ -426,7 +426,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: result={}, success=True, ) - assert_matches_type(SettingsItem, setting, path=["response"]) + assert_matches_type(ScriptSetting, setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -485,7 +485,7 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) }, success=True, ) - assert_matches_type(SettingsItem, setting, path=["response"]) + assert_matches_type(ScriptSetting, setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -529,7 +529,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = await response.parse() - assert_matches_type(SettingsItem, setting, path=["response"]) + assert_matches_type(ScriptSetting, setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -573,7 +573,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = await response.parse() - assert_matches_type(SettingsItem, setting, path=["response"]) + assert_matches_type(ScriptSetting, setting, path=["response"]) assert cast(Any, response.is_closed) is True @@ -699,7 +699,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="my-dispatch-namespace", ) - assert_matches_type(SettingsItem, setting, path=["response"]) + assert_matches_type(ScriptSetting, setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -713,7 +713,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = await response.parse() - assert_matches_type(SettingsItem, setting, path=["response"]) + assert_matches_type(ScriptSetting, setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -727,7 +727,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = await response.parse() - assert_matches_type(SettingsItem, setting, path=["response"]) + assert_matches_type(ScriptSetting, setting, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/workers_for_platforms/dispatch/namespaces/test_scripts.py b/tests/api_resources/workers_for_platforms/dispatch/namespaces/test_scripts.py index aa92c8bb35f..14252ec3630 100644 --- a/tests/api_resources/workers_for_platforms/dispatch/namespaces/test_scripts.py +++ b/tests/api_resources/workers_for_platforms/dispatch/namespaces/test_scripts.py @@ -11,7 +11,7 @@ from tests.utils import assert_matches_type from cloudflare.types.workers import Script from cloudflare.types.workers_for_platforms.dispatch.namespaces import ( - WorkersForPlatformsNamespaceScript, + Script, ) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -333,7 +333,7 @@ def test_method_get(self, client: Cloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="my-dispatch-namespace", ) - assert_matches_type(WorkersForPlatformsNamespaceScript, script, path=["response"]) + assert_matches_type(Script, script, path=["response"]) @pytest.mark.skip() @parametrize @@ -347,7 +347,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" script = response.parse() - assert_matches_type(WorkersForPlatformsNamespaceScript, script, path=["response"]) + assert_matches_type(Script, script, path=["response"]) @pytest.mark.skip() @parametrize @@ -361,7 +361,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" script = response.parse() - assert_matches_type(WorkersForPlatformsNamespaceScript, script, path=["response"]) + assert_matches_type(Script, script, path=["response"]) assert cast(Any, response.is_closed) is True @@ -706,7 +706,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="my-dispatch-namespace", ) - assert_matches_type(WorkersForPlatformsNamespaceScript, script, path=["response"]) + assert_matches_type(Script, script, path=["response"]) @pytest.mark.skip() @parametrize @@ -720,7 +720,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" script = await response.parse() - assert_matches_type(WorkersForPlatformsNamespaceScript, script, path=["response"]) + assert_matches_type(Script, script, path=["response"]) @pytest.mark.skip() @parametrize @@ -734,7 +734,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" script = await response.parse() - assert_matches_type(WorkersForPlatformsNamespaceScript, script, path=["response"]) + assert_matches_type(Script, script, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/access/applications/test_cas.py b/tests/api_resources/zero_trust/access/applications/test_cas.py index 114308d8c8d..68e66d5c981 100644 --- a/tests/api_resources/zero_trust/access/applications/test_cas.py +++ b/tests/api_resources/zero_trust/access/applications/test_cas.py @@ -11,7 +11,7 @@ from tests.utils import assert_matches_type from cloudflare.pagination import SyncSinglePage, AsyncSinglePage from cloudflare.types.shared import UnnamedSchemaRef9444735ca60712dbcf8afd832eb5716a -from cloudflare.types.zero_trust.access.applications import ZeroTrustCA, CADeleteResponse +from cloudflare.types.zero_trust.access.applications import CA, CADeleteResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -100,7 +100,7 @@ def test_method_list(self, client: Cloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(SyncSinglePage[ZeroTrustCA], ca, path=["response"]) + assert_matches_type(SyncSinglePage[CA], ca, path=["response"]) @pytest.mark.skip() @parametrize @@ -109,7 +109,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(SyncSinglePage[ZeroTrustCA], ca, path=["response"]) + assert_matches_type(SyncSinglePage[CA], ca, path=["response"]) @pytest.mark.skip() @parametrize @@ -122,7 +122,7 @@ 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" ca = response.parse() - assert_matches_type(SyncSinglePage[ZeroTrustCA], ca, path=["response"]) + assert_matches_type(SyncSinglePage[CA], ca, path=["response"]) @pytest.mark.skip() @parametrize @@ -135,7 +135,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" ca = response.parse() - assert_matches_type(SyncSinglePage[ZeroTrustCA], ca, path=["response"]) + assert_matches_type(SyncSinglePage[CA], ca, path=["response"]) assert cast(Any, response.is_closed) is True @@ -387,7 +387,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(AsyncSinglePage[ZeroTrustCA], ca, path=["response"]) + assert_matches_type(AsyncSinglePage[CA], ca, path=["response"]) @pytest.mark.skip() @parametrize @@ -396,7 +396,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) account_id="string", zone_id="string", ) - assert_matches_type(AsyncSinglePage[ZeroTrustCA], ca, path=["response"]) + assert_matches_type(AsyncSinglePage[CA], ca, path=["response"]) @pytest.mark.skip() @parametrize @@ -409,7 +409,7 @@ 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" ca = await response.parse() - assert_matches_type(AsyncSinglePage[ZeroTrustCA], ca, path=["response"]) + assert_matches_type(AsyncSinglePage[CA], ca, path=["response"]) @pytest.mark.skip() @parametrize @@ -422,7 +422,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" ca = await response.parse() - assert_matches_type(AsyncSinglePage[ZeroTrustCA], ca, path=["response"]) + assert_matches_type(AsyncSinglePage[CA], ca, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/access/test_bookmarks.py b/tests/api_resources/zero_trust/access/test_bookmarks.py index 868f025556e..7c9feaa759c 100644 --- a/tests/api_resources/zero_trust/access/test_bookmarks.py +++ b/tests/api_resources/zero_trust/access/test_bookmarks.py @@ -11,7 +11,7 @@ from tests.utils import assert_matches_type from cloudflare.pagination import SyncSinglePage, AsyncSinglePage from cloudflare.types.zero_trust.access import ( - ZeroTrustBookmarks, + Bookmarks, BookmarkDeleteResponse, ) @@ -29,7 +29,7 @@ def test_method_create(self, client: Cloudflare) -> None: identifier="699d98642c564d2e855e9661899b7252", body={}, ) - assert_matches_type(ZeroTrustBookmarks, bookmark, path=["response"]) + assert_matches_type(Bookmarks, bookmark, path=["response"]) @pytest.mark.skip() @parametrize @@ -43,7 +43,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" bookmark = response.parse() - assert_matches_type(ZeroTrustBookmarks, bookmark, path=["response"]) + assert_matches_type(Bookmarks, bookmark, path=["response"]) @pytest.mark.skip() @parametrize @@ -57,7 +57,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" bookmark = response.parse() - assert_matches_type(ZeroTrustBookmarks, bookmark, path=["response"]) + assert_matches_type(Bookmarks, bookmark, path=["response"]) assert cast(Any, response.is_closed) is True @@ -86,7 +86,7 @@ def test_method_update(self, client: Cloudflare) -> None: identifier="699d98642c564d2e855e9661899b7252", body={}, ) - assert_matches_type(ZeroTrustBookmarks, bookmark, path=["response"]) + assert_matches_type(Bookmarks, bookmark, path=["response"]) @pytest.mark.skip() @parametrize @@ -100,7 +100,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" bookmark = response.parse() - assert_matches_type(ZeroTrustBookmarks, bookmark, path=["response"]) + assert_matches_type(Bookmarks, bookmark, path=["response"]) @pytest.mark.skip() @parametrize @@ -114,7 +114,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" bookmark = response.parse() - assert_matches_type(ZeroTrustBookmarks, bookmark, path=["response"]) + assert_matches_type(Bookmarks, bookmark, path=["response"]) assert cast(Any, response.is_closed) is True @@ -141,7 +141,7 @@ def test_method_list(self, client: Cloudflare) -> None: bookmark = client.zero_trust.access.bookmarks.list( "699d98642c564d2e855e9661899b7252", ) - assert_matches_type(SyncSinglePage[ZeroTrustBookmarks], bookmark, path=["response"]) + assert_matches_type(SyncSinglePage[Bookmarks], bookmark, path=["response"]) @pytest.mark.skip() @parametrize @@ -153,7 +153,7 @@ 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" bookmark = response.parse() - assert_matches_type(SyncSinglePage[ZeroTrustBookmarks], bookmark, path=["response"]) + assert_matches_type(SyncSinglePage[Bookmarks], bookmark, path=["response"]) @pytest.mark.skip() @parametrize @@ -165,7 +165,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" bookmark = response.parse() - assert_matches_type(SyncSinglePage[ZeroTrustBookmarks], bookmark, path=["response"]) + assert_matches_type(SyncSinglePage[Bookmarks], bookmark, path=["response"]) assert cast(Any, response.is_closed) is True @@ -241,7 +241,7 @@ def test_method_get(self, client: Cloudflare) -> None: "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", identifier="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(ZeroTrustBookmarks, bookmark, path=["response"]) + assert_matches_type(Bookmarks, bookmark, path=["response"]) @pytest.mark.skip() @parametrize @@ -254,7 +254,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" bookmark = response.parse() - assert_matches_type(ZeroTrustBookmarks, bookmark, path=["response"]) + assert_matches_type(Bookmarks, bookmark, path=["response"]) @pytest.mark.skip() @parametrize @@ -267,7 +267,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" bookmark = response.parse() - assert_matches_type(ZeroTrustBookmarks, bookmark, path=["response"]) + assert_matches_type(Bookmarks, bookmark, path=["response"]) assert cast(Any, response.is_closed) is True @@ -298,7 +298,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: identifier="699d98642c564d2e855e9661899b7252", body={}, ) - assert_matches_type(ZeroTrustBookmarks, bookmark, path=["response"]) + assert_matches_type(Bookmarks, bookmark, path=["response"]) @pytest.mark.skip() @parametrize @@ -312,7 +312,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" bookmark = await response.parse() - assert_matches_type(ZeroTrustBookmarks, bookmark, path=["response"]) + assert_matches_type(Bookmarks, bookmark, path=["response"]) @pytest.mark.skip() @parametrize @@ -326,7 +326,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" bookmark = await response.parse() - assert_matches_type(ZeroTrustBookmarks, bookmark, path=["response"]) + assert_matches_type(Bookmarks, bookmark, path=["response"]) assert cast(Any, response.is_closed) is True @@ -355,7 +355,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: identifier="699d98642c564d2e855e9661899b7252", body={}, ) - assert_matches_type(ZeroTrustBookmarks, bookmark, path=["response"]) + assert_matches_type(Bookmarks, bookmark, path=["response"]) @pytest.mark.skip() @parametrize @@ -369,7 +369,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" bookmark = await response.parse() - assert_matches_type(ZeroTrustBookmarks, bookmark, path=["response"]) + assert_matches_type(Bookmarks, bookmark, path=["response"]) @pytest.mark.skip() @parametrize @@ -383,7 +383,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" bookmark = await response.parse() - assert_matches_type(ZeroTrustBookmarks, bookmark, path=["response"]) + assert_matches_type(Bookmarks, bookmark, path=["response"]) assert cast(Any, response.is_closed) is True @@ -410,7 +410,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: bookmark = await async_client.zero_trust.access.bookmarks.list( "699d98642c564d2e855e9661899b7252", ) - assert_matches_type(AsyncSinglePage[ZeroTrustBookmarks], bookmark, path=["response"]) + assert_matches_type(AsyncSinglePage[Bookmarks], bookmark, path=["response"]) @pytest.mark.skip() @parametrize @@ -422,7 +422,7 @@ 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" bookmark = await response.parse() - assert_matches_type(AsyncSinglePage[ZeroTrustBookmarks], bookmark, path=["response"]) + assert_matches_type(AsyncSinglePage[Bookmarks], bookmark, path=["response"]) @pytest.mark.skip() @parametrize @@ -434,7 +434,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" bookmark = await response.parse() - assert_matches_type(AsyncSinglePage[ZeroTrustBookmarks], bookmark, path=["response"]) + assert_matches_type(AsyncSinglePage[Bookmarks], bookmark, path=["response"]) assert cast(Any, response.is_closed) is True @@ -510,7 +510,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", identifier="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(ZeroTrustBookmarks, bookmark, path=["response"]) + assert_matches_type(Bookmarks, bookmark, path=["response"]) @pytest.mark.skip() @parametrize @@ -523,7 +523,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" bookmark = await response.parse() - assert_matches_type(ZeroTrustBookmarks, bookmark, path=["response"]) + assert_matches_type(Bookmarks, bookmark, path=["response"]) @pytest.mark.skip() @parametrize @@ -536,7 +536,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" bookmark = await response.parse() - assert_matches_type(ZeroTrustBookmarks, bookmark, path=["response"]) + assert_matches_type(Bookmarks, bookmark, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/access/test_custom_pages.py b/tests/api_resources/zero_trust/access/test_custom_pages.py index ccd44ae7fe9..e80430f53d9 100644 --- a/tests/api_resources/zero_trust/access/test_custom_pages.py +++ b/tests/api_resources/zero_trust/access/test_custom_pages.py @@ -11,9 +11,9 @@ from tests.utils import assert_matches_type from cloudflare.pagination import SyncSinglePage, AsyncSinglePage from cloudflare.types.zero_trust.access import ( - ZeroTrustCustomPage, + CustomPage, + CustomPageWithoutHTML, CustomPageDeleteResponse, - ZeroTrustCustomPageWithoutHTML, ) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -31,7 +31,7 @@ def test_method_create(self, client: Cloudflare) -> None: name="string", type="identity_denied", ) - assert_matches_type(ZeroTrustCustomPageWithoutHTML, custom_page, path=["response"]) + assert_matches_type(CustomPageWithoutHTML, custom_page, path=["response"]) @pytest.mark.skip() @parametrize @@ -43,7 +43,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: type="identity_denied", app_count=0, ) - assert_matches_type(ZeroTrustCustomPageWithoutHTML, custom_page, path=["response"]) + assert_matches_type(CustomPageWithoutHTML, custom_page, path=["response"]) @pytest.mark.skip() @parametrize @@ -58,7 +58,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_page = response.parse() - assert_matches_type(ZeroTrustCustomPageWithoutHTML, custom_page, path=["response"]) + assert_matches_type(CustomPageWithoutHTML, custom_page, path=["response"]) @pytest.mark.skip() @parametrize @@ -73,7 +73,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_page = response.parse() - assert_matches_type(ZeroTrustCustomPageWithoutHTML, custom_page, path=["response"]) + assert_matches_type(CustomPageWithoutHTML, custom_page, path=["response"]) assert cast(Any, response.is_closed) is True @@ -98,7 +98,7 @@ def test_method_update(self, client: Cloudflare) -> None: name="string", type="identity_denied", ) - assert_matches_type(ZeroTrustCustomPageWithoutHTML, custom_page, path=["response"]) + assert_matches_type(CustomPageWithoutHTML, custom_page, path=["response"]) @pytest.mark.skip() @parametrize @@ -111,7 +111,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: type="identity_denied", app_count=0, ) - assert_matches_type(ZeroTrustCustomPageWithoutHTML, custom_page, path=["response"]) + assert_matches_type(CustomPageWithoutHTML, custom_page, path=["response"]) @pytest.mark.skip() @parametrize @@ -127,7 +127,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_page = response.parse() - assert_matches_type(ZeroTrustCustomPageWithoutHTML, custom_page, path=["response"]) + assert_matches_type(CustomPageWithoutHTML, custom_page, path=["response"]) @pytest.mark.skip() @parametrize @@ -143,7 +143,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_page = response.parse() - assert_matches_type(ZeroTrustCustomPageWithoutHTML, custom_page, path=["response"]) + assert_matches_type(CustomPageWithoutHTML, custom_page, path=["response"]) assert cast(Any, response.is_closed) is True @@ -174,7 +174,7 @@ def test_method_list(self, client: Cloudflare) -> None: custom_page = client.zero_trust.access.custom_pages.list( "023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncSinglePage[ZeroTrustCustomPageWithoutHTML], custom_page, path=["response"]) + assert_matches_type(SyncSinglePage[CustomPageWithoutHTML], custom_page, path=["response"]) @pytest.mark.skip() @parametrize @@ -186,7 +186,7 @@ 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" custom_page = response.parse() - assert_matches_type(SyncSinglePage[ZeroTrustCustomPageWithoutHTML], custom_page, path=["response"]) + assert_matches_type(SyncSinglePage[CustomPageWithoutHTML], custom_page, path=["response"]) @pytest.mark.skip() @parametrize @@ -198,7 +198,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_page = response.parse() - assert_matches_type(SyncSinglePage[ZeroTrustCustomPageWithoutHTML], custom_page, path=["response"]) + assert_matches_type(SyncSinglePage[CustomPageWithoutHTML], custom_page, path=["response"]) assert cast(Any, response.is_closed) is True @@ -269,7 +269,7 @@ def test_method_get(self, client: Cloudflare) -> None: "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", identifier="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(ZeroTrustCustomPage, custom_page, path=["response"]) + assert_matches_type(CustomPage, custom_page, path=["response"]) @pytest.mark.skip() @parametrize @@ -282,7 +282,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_page = response.parse() - assert_matches_type(ZeroTrustCustomPage, custom_page, path=["response"]) + assert_matches_type(CustomPage, custom_page, path=["response"]) @pytest.mark.skip() @parametrize @@ -295,7 +295,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_page = response.parse() - assert_matches_type(ZeroTrustCustomPage, custom_page, path=["response"]) + assert_matches_type(CustomPage, custom_page, path=["response"]) assert cast(Any, response.is_closed) is True @@ -327,7 +327,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: name="string", type="identity_denied", ) - assert_matches_type(ZeroTrustCustomPageWithoutHTML, custom_page, path=["response"]) + assert_matches_type(CustomPageWithoutHTML, custom_page, path=["response"]) @pytest.mark.skip() @parametrize @@ -339,7 +339,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare type="identity_denied", app_count=0, ) - assert_matches_type(ZeroTrustCustomPageWithoutHTML, custom_page, path=["response"]) + assert_matches_type(CustomPageWithoutHTML, custom_page, path=["response"]) @pytest.mark.skip() @parametrize @@ -354,7 +354,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_page = await response.parse() - assert_matches_type(ZeroTrustCustomPageWithoutHTML, custom_page, path=["response"]) + assert_matches_type(CustomPageWithoutHTML, custom_page, path=["response"]) @pytest.mark.skip() @parametrize @@ -369,7 +369,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_page = await response.parse() - assert_matches_type(ZeroTrustCustomPageWithoutHTML, custom_page, path=["response"]) + assert_matches_type(CustomPageWithoutHTML, custom_page, path=["response"]) assert cast(Any, response.is_closed) is True @@ -394,7 +394,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: name="string", type="identity_denied", ) - assert_matches_type(ZeroTrustCustomPageWithoutHTML, custom_page, path=["response"]) + assert_matches_type(CustomPageWithoutHTML, custom_page, path=["response"]) @pytest.mark.skip() @parametrize @@ -407,7 +407,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare type="identity_denied", app_count=0, ) - assert_matches_type(ZeroTrustCustomPageWithoutHTML, custom_page, path=["response"]) + assert_matches_type(CustomPageWithoutHTML, custom_page, path=["response"]) @pytest.mark.skip() @parametrize @@ -423,7 +423,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_page = await response.parse() - assert_matches_type(ZeroTrustCustomPageWithoutHTML, custom_page, path=["response"]) + assert_matches_type(CustomPageWithoutHTML, custom_page, path=["response"]) @pytest.mark.skip() @parametrize @@ -439,7 +439,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_page = await response.parse() - assert_matches_type(ZeroTrustCustomPageWithoutHTML, custom_page, path=["response"]) + assert_matches_type(CustomPageWithoutHTML, custom_page, path=["response"]) assert cast(Any, response.is_closed) is True @@ -470,7 +470,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: custom_page = await async_client.zero_trust.access.custom_pages.list( "023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncSinglePage[ZeroTrustCustomPageWithoutHTML], custom_page, path=["response"]) + assert_matches_type(AsyncSinglePage[CustomPageWithoutHTML], custom_page, path=["response"]) @pytest.mark.skip() @parametrize @@ -482,7 +482,7 @@ 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" custom_page = await response.parse() - assert_matches_type(AsyncSinglePage[ZeroTrustCustomPageWithoutHTML], custom_page, path=["response"]) + assert_matches_type(AsyncSinglePage[CustomPageWithoutHTML], custom_page, path=["response"]) @pytest.mark.skip() @parametrize @@ -494,7 +494,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_page = await response.parse() - assert_matches_type(AsyncSinglePage[ZeroTrustCustomPageWithoutHTML], custom_page, path=["response"]) + assert_matches_type(AsyncSinglePage[CustomPageWithoutHTML], custom_page, path=["response"]) assert cast(Any, response.is_closed) is True @@ -565,7 +565,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", identifier="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(ZeroTrustCustomPage, custom_page, path=["response"]) + assert_matches_type(CustomPage, custom_page, path=["response"]) @pytest.mark.skip() @parametrize @@ -578,7 +578,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_page = await response.parse() - assert_matches_type(ZeroTrustCustomPage, custom_page, path=["response"]) + assert_matches_type(CustomPage, custom_page, path=["response"]) @pytest.mark.skip() @parametrize @@ -591,7 +591,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom_page = await response.parse() - assert_matches_type(ZeroTrustCustomPage, custom_page, path=["response"]) + assert_matches_type(CustomPage, custom_page, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/access/test_service_tokens.py b/tests/api_resources/zero_trust/access/test_service_tokens.py index 4815e282fff..ca6aa7c42bf 100644 --- a/tests/api_resources/zero_trust/access/test_service_tokens.py +++ b/tests/api_resources/zero_trust/access/test_service_tokens.py @@ -11,7 +11,7 @@ from tests.utils import assert_matches_type from cloudflare.pagination import SyncSinglePage, AsyncSinglePage from cloudflare.types.zero_trust.access import ( - ZeroTrustServiceTokens, + ErviceToken, ServiceTokenCreateResponse, ServiceTokenRotateResponse, ) @@ -98,7 +98,7 @@ def test_method_update(self, client: Cloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustServiceTokens, service_token, path=["response"]) + assert_matches_type(ErviceToken, service_token, path=["response"]) @pytest.mark.skip() @parametrize @@ -110,7 +110,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: duration="60m", name="CI/CD token", ) - assert_matches_type(ZeroTrustServiceTokens, service_token, path=["response"]) + assert_matches_type(ErviceToken, service_token, path=["response"]) @pytest.mark.skip() @parametrize @@ -124,7 +124,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" service_token = response.parse() - assert_matches_type(ZeroTrustServiceTokens, service_token, path=["response"]) + assert_matches_type(ErviceToken, service_token, path=["response"]) @pytest.mark.skip() @parametrize @@ -138,7 +138,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" service_token = response.parse() - assert_matches_type(ZeroTrustServiceTokens, service_token, path=["response"]) + assert_matches_type(ErviceToken, service_token, path=["response"]) assert cast(Any, response.is_closed) is True @@ -173,7 +173,7 @@ def test_method_list(self, client: Cloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(SyncSinglePage[ZeroTrustServiceTokens], service_token, path=["response"]) + assert_matches_type(SyncSinglePage[ErviceToken], service_token, path=["response"]) @pytest.mark.skip() @parametrize @@ -182,7 +182,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(SyncSinglePage[ZeroTrustServiceTokens], service_token, path=["response"]) + assert_matches_type(SyncSinglePage[ErviceToken], service_token, path=["response"]) @pytest.mark.skip() @parametrize @@ -195,7 +195,7 @@ 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" service_token = response.parse() - assert_matches_type(SyncSinglePage[ZeroTrustServiceTokens], service_token, path=["response"]) + assert_matches_type(SyncSinglePage[ErviceToken], service_token, path=["response"]) @pytest.mark.skip() @parametrize @@ -208,7 +208,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" service_token = response.parse() - assert_matches_type(SyncSinglePage[ZeroTrustServiceTokens], service_token, path=["response"]) + assert_matches_type(SyncSinglePage[ErviceToken], service_token, path=["response"]) assert cast(Any, response.is_closed) is True @@ -235,7 +235,7 @@ def test_method_delete(self, client: Cloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustServiceTokens, service_token, path=["response"]) + assert_matches_type(ErviceToken, service_token, path=["response"]) @pytest.mark.skip() @parametrize @@ -245,7 +245,7 @@ def test_method_delete_with_all_params(self, client: Cloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustServiceTokens, service_token, path=["response"]) + assert_matches_type(ErviceToken, service_token, path=["response"]) @pytest.mark.skip() @parametrize @@ -259,7 +259,7 @@ 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" service_token = response.parse() - assert_matches_type(ZeroTrustServiceTokens, service_token, path=["response"]) + assert_matches_type(ErviceToken, service_token, path=["response"]) @pytest.mark.skip() @parametrize @@ -273,7 +273,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" service_token = response.parse() - assert_matches_type(ZeroTrustServiceTokens, service_token, path=["response"]) + assert_matches_type(ErviceToken, service_token, path=["response"]) assert cast(Any, response.is_closed) is True @@ -308,7 +308,7 @@ def test_method_refresh(self, client: Cloudflare) -> None: "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", identifier="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(ZeroTrustServiceTokens, service_token, path=["response"]) + assert_matches_type(ErviceToken, service_token, path=["response"]) @pytest.mark.skip() @parametrize @@ -321,7 +321,7 @@ def test_raw_response_refresh(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" service_token = response.parse() - assert_matches_type(ZeroTrustServiceTokens, service_token, path=["response"]) + assert_matches_type(ErviceToken, service_token, path=["response"]) @pytest.mark.skip() @parametrize @@ -334,7 +334,7 @@ def test_streaming_response_refresh(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" service_token = response.parse() - assert_matches_type(ZeroTrustServiceTokens, service_token, path=["response"]) + assert_matches_type(ErviceToken, service_token, path=["response"]) assert cast(Any, response.is_closed) is True @@ -485,7 +485,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustServiceTokens, service_token, path=["response"]) + assert_matches_type(ErviceToken, service_token, path=["response"]) @pytest.mark.skip() @parametrize @@ -497,7 +497,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare duration="60m", name="CI/CD token", ) - assert_matches_type(ZeroTrustServiceTokens, service_token, path=["response"]) + assert_matches_type(ErviceToken, service_token, path=["response"]) @pytest.mark.skip() @parametrize @@ -511,7 +511,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" service_token = await response.parse() - assert_matches_type(ZeroTrustServiceTokens, service_token, path=["response"]) + assert_matches_type(ErviceToken, service_token, path=["response"]) @pytest.mark.skip() @parametrize @@ -525,7 +525,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" service_token = await response.parse() - assert_matches_type(ZeroTrustServiceTokens, service_token, path=["response"]) + assert_matches_type(ErviceToken, service_token, path=["response"]) assert cast(Any, response.is_closed) is True @@ -560,7 +560,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(AsyncSinglePage[ZeroTrustServiceTokens], service_token, path=["response"]) + assert_matches_type(AsyncSinglePage[ErviceToken], service_token, path=["response"]) @pytest.mark.skip() @parametrize @@ -569,7 +569,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) account_id="string", zone_id="string", ) - assert_matches_type(AsyncSinglePage[ZeroTrustServiceTokens], service_token, path=["response"]) + assert_matches_type(AsyncSinglePage[ErviceToken], service_token, path=["response"]) @pytest.mark.skip() @parametrize @@ -582,7 +582,7 @@ 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" service_token = await response.parse() - assert_matches_type(AsyncSinglePage[ZeroTrustServiceTokens], service_token, path=["response"]) + assert_matches_type(AsyncSinglePage[ErviceToken], service_token, path=["response"]) @pytest.mark.skip() @parametrize @@ -595,7 +595,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" service_token = await response.parse() - assert_matches_type(AsyncSinglePage[ZeroTrustServiceTokens], service_token, path=["response"]) + assert_matches_type(AsyncSinglePage[ErviceToken], service_token, path=["response"]) assert cast(Any, response.is_closed) is True @@ -622,7 +622,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustServiceTokens, service_token, path=["response"]) + assert_matches_type(ErviceToken, service_token, path=["response"]) @pytest.mark.skip() @parametrize @@ -632,7 +632,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncCloudflare account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustServiceTokens, service_token, path=["response"]) + assert_matches_type(ErviceToken, service_token, path=["response"]) @pytest.mark.skip() @parametrize @@ -646,7 +646,7 @@ 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" service_token = await response.parse() - assert_matches_type(ZeroTrustServiceTokens, service_token, path=["response"]) + assert_matches_type(ErviceToken, service_token, path=["response"]) @pytest.mark.skip() @parametrize @@ -660,7 +660,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" service_token = await response.parse() - assert_matches_type(ZeroTrustServiceTokens, service_token, path=["response"]) + assert_matches_type(ErviceToken, service_token, path=["response"]) assert cast(Any, response.is_closed) is True @@ -695,7 +695,7 @@ async def test_method_refresh(self, async_client: AsyncCloudflare) -> None: "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", identifier="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(ZeroTrustServiceTokens, service_token, path=["response"]) + assert_matches_type(ErviceToken, service_token, path=["response"]) @pytest.mark.skip() @parametrize @@ -708,7 +708,7 @@ async def test_raw_response_refresh(self, async_client: AsyncCloudflare) -> None assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" service_token = await response.parse() - assert_matches_type(ZeroTrustServiceTokens, service_token, path=["response"]) + assert_matches_type(ErviceToken, service_token, path=["response"]) @pytest.mark.skip() @parametrize @@ -721,7 +721,7 @@ async def test_streaming_response_refresh(self, async_client: AsyncCloudflare) - assert response.http_request.headers.get("X-Stainless-Lang") == "python" service_token = await response.parse() - assert_matches_type(ZeroTrustServiceTokens, service_token, path=["response"]) + assert_matches_type(ErviceToken, service_token, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/access/test_tags.py b/tests/api_resources/zero_trust/access/test_tags.py index 57c7961ae67..0848694db06 100644 --- a/tests/api_resources/zero_trust/access/test_tags.py +++ b/tests/api_resources/zero_trust/access/test_tags.py @@ -10,7 +10,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.pagination import SyncSinglePage, AsyncSinglePage -from cloudflare.types.zero_trust.access import ZeroTrustTag, TagDeleteResponse +from cloudflare.types.zero_trust.access import Tag, TagDeleteResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -25,7 +25,7 @@ def test_method_create(self, client: Cloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", name="engineers", ) - assert_matches_type(ZeroTrustTag, tag, path=["response"]) + assert_matches_type(Tag, tag, path=["response"]) @pytest.mark.skip() @parametrize @@ -38,7 +38,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" tag = response.parse() - assert_matches_type(ZeroTrustTag, tag, path=["response"]) + assert_matches_type(Tag, tag, path=["response"]) @pytest.mark.skip() @parametrize @@ -51,7 +51,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" tag = response.parse() - assert_matches_type(ZeroTrustTag, tag, path=["response"]) + assert_matches_type(Tag, tag, path=["response"]) assert cast(Any, response.is_closed) is True @@ -72,7 +72,7 @@ def test_method_update(self, client: Cloudflare) -> None: identifier="023e105f4ecef8ad9ca31a8372d0c353", name="engineers", ) - assert_matches_type(ZeroTrustTag, tag, path=["response"]) + assert_matches_type(Tag, tag, path=["response"]) @pytest.mark.skip() @parametrize @@ -86,7 +86,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" tag = response.parse() - assert_matches_type(ZeroTrustTag, tag, path=["response"]) + assert_matches_type(Tag, tag, path=["response"]) @pytest.mark.skip() @parametrize @@ -100,7 +100,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" tag = response.parse() - assert_matches_type(ZeroTrustTag, tag, path=["response"]) + assert_matches_type(Tag, tag, path=["response"]) assert cast(Any, response.is_closed) is True @@ -127,7 +127,7 @@ def test_method_list(self, client: Cloudflare) -> None: tag = client.zero_trust.access.tags.list( "023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncSinglePage[ZeroTrustTag], tag, path=["response"]) + assert_matches_type(SyncSinglePage[Tag], tag, path=["response"]) @pytest.mark.skip() @parametrize @@ -139,7 +139,7 @@ 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" tag = response.parse() - assert_matches_type(SyncSinglePage[ZeroTrustTag], tag, path=["response"]) + assert_matches_type(SyncSinglePage[Tag], tag, path=["response"]) @pytest.mark.skip() @parametrize @@ -151,7 +151,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" tag = response.parse() - assert_matches_type(SyncSinglePage[ZeroTrustTag], tag, path=["response"]) + assert_matches_type(SyncSinglePage[Tag], tag, path=["response"]) assert cast(Any, response.is_closed) is True @@ -222,7 +222,7 @@ def test_method_get(self, client: Cloudflare) -> None: "engineers", identifier="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(ZeroTrustTag, tag, path=["response"]) + assert_matches_type(Tag, tag, path=["response"]) @pytest.mark.skip() @parametrize @@ -235,7 +235,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" tag = response.parse() - assert_matches_type(ZeroTrustTag, tag, path=["response"]) + assert_matches_type(Tag, tag, path=["response"]) @pytest.mark.skip() @parametrize @@ -248,7 +248,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" tag = response.parse() - assert_matches_type(ZeroTrustTag, tag, path=["response"]) + assert_matches_type(Tag, tag, path=["response"]) assert cast(Any, response.is_closed) is True @@ -278,7 +278,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", name="engineers", ) - assert_matches_type(ZeroTrustTag, tag, path=["response"]) + assert_matches_type(Tag, tag, path=["response"]) @pytest.mark.skip() @parametrize @@ -291,7 +291,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" tag = await response.parse() - assert_matches_type(ZeroTrustTag, tag, path=["response"]) + assert_matches_type(Tag, tag, path=["response"]) @pytest.mark.skip() @parametrize @@ -304,7 +304,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" tag = await response.parse() - assert_matches_type(ZeroTrustTag, tag, path=["response"]) + assert_matches_type(Tag, tag, path=["response"]) assert cast(Any, response.is_closed) is True @@ -325,7 +325,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: identifier="023e105f4ecef8ad9ca31a8372d0c353", name="engineers", ) - assert_matches_type(ZeroTrustTag, tag, path=["response"]) + assert_matches_type(Tag, tag, path=["response"]) @pytest.mark.skip() @parametrize @@ -339,7 +339,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" tag = await response.parse() - assert_matches_type(ZeroTrustTag, tag, path=["response"]) + assert_matches_type(Tag, tag, path=["response"]) @pytest.mark.skip() @parametrize @@ -353,7 +353,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" tag = await response.parse() - assert_matches_type(ZeroTrustTag, tag, path=["response"]) + assert_matches_type(Tag, tag, path=["response"]) assert cast(Any, response.is_closed) is True @@ -380,7 +380,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: tag = await async_client.zero_trust.access.tags.list( "023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncSinglePage[ZeroTrustTag], tag, path=["response"]) + assert_matches_type(AsyncSinglePage[Tag], tag, path=["response"]) @pytest.mark.skip() @parametrize @@ -392,7 +392,7 @@ 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" tag = await response.parse() - assert_matches_type(AsyncSinglePage[ZeroTrustTag], tag, path=["response"]) + assert_matches_type(AsyncSinglePage[Tag], tag, path=["response"]) @pytest.mark.skip() @parametrize @@ -404,7 +404,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" tag = await response.parse() - assert_matches_type(AsyncSinglePage[ZeroTrustTag], tag, path=["response"]) + assert_matches_type(AsyncSinglePage[Tag], tag, path=["response"]) assert cast(Any, response.is_closed) is True @@ -475,7 +475,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: "engineers", identifier="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(ZeroTrustTag, tag, path=["response"]) + assert_matches_type(Tag, tag, path=["response"]) @pytest.mark.skip() @parametrize @@ -488,7 +488,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" tag = await response.parse() - assert_matches_type(ZeroTrustTag, tag, path=["response"]) + assert_matches_type(Tag, tag, path=["response"]) @pytest.mark.skip() @parametrize @@ -501,7 +501,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" tag = await response.parse() - assert_matches_type(ZeroTrustTag, tag, path=["response"]) + assert_matches_type(Tag, tag, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/access/test_users.py b/tests/api_resources/zero_trust/access/test_users.py index 5787f3daf8b..744e3ad3bf7 100644 --- a/tests/api_resources/zero_trust/access/test_users.py +++ b/tests/api_resources/zero_trust/access/test_users.py @@ -10,7 +10,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.pagination import SyncSinglePage, AsyncSinglePage -from cloudflare.types.zero_trust.access import ZeroTrustUsers +from cloudflare.types.zero_trust.access import User base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -24,7 +24,7 @@ def test_method_list(self, client: Cloudflare) -> None: user = client.zero_trust.access.users.list( "023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncSinglePage[ZeroTrustUsers], user, path=["response"]) + assert_matches_type(SyncSinglePage[User], user, path=["response"]) @pytest.mark.skip() @parametrize @@ -36,7 +36,7 @@ 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" user = response.parse() - assert_matches_type(SyncSinglePage[ZeroTrustUsers], user, path=["response"]) + assert_matches_type(SyncSinglePage[User], user, path=["response"]) @pytest.mark.skip() @parametrize @@ -48,7 +48,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" user = response.parse() - assert_matches_type(SyncSinglePage[ZeroTrustUsers], user, path=["response"]) + assert_matches_type(SyncSinglePage[User], user, path=["response"]) assert cast(Any, response.is_closed) is True @@ -70,7 +70,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: user = await async_client.zero_trust.access.users.list( "023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncSinglePage[ZeroTrustUsers], user, path=["response"]) + assert_matches_type(AsyncSinglePage[User], user, path=["response"]) @pytest.mark.skip() @parametrize @@ -82,7 +82,7 @@ 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" user = await response.parse() - assert_matches_type(AsyncSinglePage[ZeroTrustUsers], user, path=["response"]) + assert_matches_type(AsyncSinglePage[User], user, path=["response"]) @pytest.mark.skip() @parametrize @@ -94,7 +94,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" user = await response.parse() - assert_matches_type(AsyncSinglePage[ZeroTrustUsers], user, path=["response"]) + assert_matches_type(AsyncSinglePage[User], user, path=["response"]) assert cast(Any, response.is_closed) is True 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 b721c3213cb..5c6f4666b68 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 ZeroTrustIdentity +from cloudflare.types.zero_trust.access.users import Identity base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -24,7 +24,7 @@ def test_method_get(self, client: Cloudflare) -> None: "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", identifier="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(ZeroTrustIdentity, last_seen_identity, path=["response"]) + assert_matches_type(Identity, last_seen_identity, path=["response"]) @pytest.mark.skip() @parametrize @@ -37,7 +37,7 @@ def test_raw_response_get(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(ZeroTrustIdentity, last_seen_identity, path=["response"]) + assert_matches_type(Identity, last_seen_identity, path=["response"]) @pytest.mark.skip() @parametrize @@ -50,7 +50,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" last_seen_identity = response.parse() - assert_matches_type(ZeroTrustIdentity, last_seen_identity, path=["response"]) + assert_matches_type(Identity, last_seen_identity, path=["response"]) assert cast(Any, response.is_closed) is True @@ -80,7 +80,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", identifier="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(ZeroTrustIdentity, last_seen_identity, path=["response"]) + assert_matches_type(Identity, last_seen_identity, path=["response"]) @pytest.mark.skip() @parametrize @@ -93,7 +93,7 @@ async def test_raw_response_get(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(ZeroTrustIdentity, last_seen_identity, path=["response"]) + assert_matches_type(Identity, last_seen_identity, path=["response"]) @pytest.mark.skip() @parametrize @@ -106,7 +106,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" last_seen_identity = await response.parse() - assert_matches_type(ZeroTrustIdentity, last_seen_identity, path=["response"]) + assert_matches_type(Identity, last_seen_identity, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/devices/policies/test_excludes.py b/tests/api_resources/zero_trust/devices/policies/test_excludes.py index b154f08001b..fbdb2969e2c 100644 --- a/tests/api_resources/zero_trust/devices/policies/test_excludes.py +++ b/tests/api_resources/zero_trust/devices/policies/test_excludes.py @@ -11,8 +11,8 @@ from tests.utils import assert_matches_type from cloudflare.pagination import SyncSinglePage, AsyncSinglePage from cloudflare.types.zero_trust.devices.policies import ( - DevicesSplitTunnel, ExcludeGetResponse, + SplitTunnelExclude, ExcludeUpdateResponse, ) @@ -126,7 +126,7 @@ def test_method_list(self, client: Cloudflare) -> None: exclude = client.zero_trust.devices.policies.excludes.list( account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(SyncSinglePage[DevicesSplitTunnel], exclude, path=["response"]) + assert_matches_type(SyncSinglePage[SplitTunnelExclude], exclude, path=["response"]) @pytest.mark.skip() @parametrize @@ -138,7 +138,7 @@ 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" exclude = response.parse() - assert_matches_type(SyncSinglePage[DevicesSplitTunnel], exclude, path=["response"]) + assert_matches_type(SyncSinglePage[SplitTunnelExclude], exclude, path=["response"]) @pytest.mark.skip() @parametrize @@ -150,7 +150,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" exclude = response.parse() - assert_matches_type(SyncSinglePage[DevicesSplitTunnel], exclude, path=["response"]) + assert_matches_type(SyncSinglePage[SplitTunnelExclude], exclude, path=["response"]) assert cast(Any, response.is_closed) is True @@ -322,7 +322,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: exclude = await async_client.zero_trust.devices.policies.excludes.list( account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(AsyncSinglePage[DevicesSplitTunnel], exclude, path=["response"]) + assert_matches_type(AsyncSinglePage[SplitTunnelExclude], exclude, path=["response"]) @pytest.mark.skip() @parametrize @@ -334,7 +334,7 @@ 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" exclude = await response.parse() - assert_matches_type(AsyncSinglePage[DevicesSplitTunnel], exclude, path=["response"]) + assert_matches_type(AsyncSinglePage[SplitTunnelExclude], exclude, path=["response"]) @pytest.mark.skip() @parametrize @@ -346,7 +346,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" exclude = await response.parse() - assert_matches_type(AsyncSinglePage[DevicesSplitTunnel], exclude, path=["response"]) + assert_matches_type(AsyncSinglePage[SplitTunnelExclude], exclude, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/devices/policies/test_fallback_domains.py b/tests/api_resources/zero_trust/devices/policies/test_fallback_domains.py index 1fb852868b0..c23935cc023 100644 --- a/tests/api_resources/zero_trust/devices/policies/test_fallback_domains.py +++ b/tests/api_resources/zero_trust/devices/policies/test_fallback_domains.py @@ -11,7 +11,7 @@ from tests.utils import assert_matches_type from cloudflare.pagination import SyncSinglePage, AsyncSinglePage from cloudflare.types.zero_trust.devices.policies import ( - DevicesFallbackDomain, + FallbackDomain, FallbackDomainGetResponse, FallbackDomainUpdateResponse, ) @@ -85,7 +85,7 @@ def test_method_list(self, client: Cloudflare) -> None: fallback_domain = client.zero_trust.devices.policies.fallback_domains.list( account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(SyncSinglePage[DevicesFallbackDomain], fallback_domain, path=["response"]) + assert_matches_type(SyncSinglePage[FallbackDomain], fallback_domain, path=["response"]) @pytest.mark.skip() @parametrize @@ -97,7 +97,7 @@ 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" fallback_domain = response.parse() - assert_matches_type(SyncSinglePage[DevicesFallbackDomain], fallback_domain, path=["response"]) + assert_matches_type(SyncSinglePage[FallbackDomain], fallback_domain, path=["response"]) @pytest.mark.skip() @parametrize @@ -109,7 +109,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" fallback_domain = response.parse() - assert_matches_type(SyncSinglePage[DevicesFallbackDomain], fallback_domain, path=["response"]) + assert_matches_type(SyncSinglePage[FallbackDomain], fallback_domain, path=["response"]) assert cast(Any, response.is_closed) is True @@ -240,7 +240,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: fallback_domain = await async_client.zero_trust.devices.policies.fallback_domains.list( account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(AsyncSinglePage[DevicesFallbackDomain], fallback_domain, path=["response"]) + assert_matches_type(AsyncSinglePage[FallbackDomain], fallback_domain, path=["response"]) @pytest.mark.skip() @parametrize @@ -252,7 +252,7 @@ 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" fallback_domain = await response.parse() - assert_matches_type(AsyncSinglePage[DevicesFallbackDomain], fallback_domain, path=["response"]) + assert_matches_type(AsyncSinglePage[FallbackDomain], fallback_domain, path=["response"]) @pytest.mark.skip() @parametrize @@ -264,7 +264,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" fallback_domain = await response.parse() - assert_matches_type(AsyncSinglePage[DevicesFallbackDomain], fallback_domain, path=["response"]) + assert_matches_type(AsyncSinglePage[FallbackDomain], fallback_domain, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/devices/policies/test_includes.py b/tests/api_resources/zero_trust/devices/policies/test_includes.py index 41d15bd2c83..d17008e0558 100644 --- a/tests/api_resources/zero_trust/devices/policies/test_includes.py +++ b/tests/api_resources/zero_trust/devices/policies/test_includes.py @@ -12,8 +12,8 @@ from cloudflare.pagination import SyncSinglePage, AsyncSinglePage from cloudflare.types.zero_trust.devices.policies import ( IncludeGetResponse, + SplitTunnelInclude, IncludeUpdateResponse, - DevicesSplitTunnelInclude, ) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -126,7 +126,7 @@ def test_method_list(self, client: Cloudflare) -> None: include = client.zero_trust.devices.policies.includes.list( account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(SyncSinglePage[DevicesSplitTunnelInclude], include, path=["response"]) + assert_matches_type(SyncSinglePage[SplitTunnelInclude], include, path=["response"]) @pytest.mark.skip() @parametrize @@ -138,7 +138,7 @@ 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" include = response.parse() - assert_matches_type(SyncSinglePage[DevicesSplitTunnelInclude], include, path=["response"]) + assert_matches_type(SyncSinglePage[SplitTunnelInclude], include, path=["response"]) @pytest.mark.skip() @parametrize @@ -150,7 +150,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" include = response.parse() - assert_matches_type(SyncSinglePage[DevicesSplitTunnelInclude], include, path=["response"]) + assert_matches_type(SyncSinglePage[SplitTunnelInclude], include, path=["response"]) assert cast(Any, response.is_closed) is True @@ -322,7 +322,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: include = await async_client.zero_trust.devices.policies.includes.list( account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(AsyncSinglePage[DevicesSplitTunnelInclude], include, path=["response"]) + assert_matches_type(AsyncSinglePage[SplitTunnelInclude], include, path=["response"]) @pytest.mark.skip() @parametrize @@ -334,7 +334,7 @@ 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" include = await response.parse() - assert_matches_type(AsyncSinglePage[DevicesSplitTunnelInclude], include, path=["response"]) + assert_matches_type(AsyncSinglePage[SplitTunnelInclude], include, path=["response"]) @pytest.mark.skip() @parametrize @@ -346,7 +346,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" include = await response.parse() - assert_matches_type(AsyncSinglePage[DevicesSplitTunnelInclude], include, path=["response"]) + assert_matches_type(AsyncSinglePage[SplitTunnelInclude], include, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/devices/test_dex_tests.py b/tests/api_resources/zero_trust/devices/test_dex_tests.py index 3025b0db436..67f1de6d899 100644 --- a/tests/api_resources/zero_trust/devices/test_dex_tests.py +++ b/tests/api_resources/zero_trust/devices/test_dex_tests.py @@ -47,6 +47,24 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: interval="30m", name="HTTP dash health check", description="Checks the dash endpoint every 30 minutes", + target_policies=[ + { + "default": True, + "id": "string", + "name": "string", + }, + { + "default": True, + "id": "string", + "name": "string", + }, + { + "default": True, + "id": "string", + "name": "string", + }, + ], + targeted=True, ) assert_matches_type(Optional[SchemaHTTP], dex_test, path=["response"]) @@ -124,6 +142,24 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: interval="30m", name="HTTP dash health check", description="Checks the dash endpoint every 30 minutes", + target_policies=[ + { + "default": True, + "id": "string", + "name": "string", + }, + { + "default": True, + "id": "string", + "name": "string", + }, + { + "default": True, + "id": "string", + "name": "string", + }, + ], + targeted=True, ) assert_matches_type(Optional[SchemaHTTP], dex_test, path=["response"]) @@ -362,6 +398,24 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare interval="30m", name="HTTP dash health check", description="Checks the dash endpoint every 30 minutes", + target_policies=[ + { + "default": True, + "id": "string", + "name": "string", + }, + { + "default": True, + "id": "string", + "name": "string", + }, + { + "default": True, + "id": "string", + "name": "string", + }, + ], + targeted=True, ) assert_matches_type(Optional[SchemaHTTP], dex_test, path=["response"]) @@ -439,6 +493,24 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare interval="30m", name="HTTP dash health check", description="Checks the dash endpoint every 30 minutes", + target_policies=[ + { + "default": True, + "id": "string", + "name": "string", + }, + { + "default": True, + "id": "string", + "name": "string", + }, + { + "default": True, + "id": "string", + "name": "string", + }, + ], + targeted=True, ) assert_matches_type(Optional[SchemaHTTP], dex_test, path=["response"]) diff --git a/tests/api_resources/zero_trust/devices/test_networks.py b/tests/api_resources/zero_trust/devices/test_networks.py index 11037d75c30..d91e09d5763 100644 --- a/tests/api_resources/zero_trust/devices/test_networks.py +++ b/tests/api_resources/zero_trust/devices/test_networks.py @@ -11,7 +11,7 @@ from tests.utils import assert_matches_type from cloudflare.pagination import SyncSinglePage, AsyncSinglePage from cloudflare.types.zero_trust.devices import ( - DeviceManagedNetworks, + Network, NetworkDeleteResponse, ) @@ -30,7 +30,7 @@ def test_method_create(self, client: Cloudflare) -> None: name="managed-network-1", type="tls", ) - assert_matches_type(Optional[DeviceManagedNetworks], network, path=["response"]) + assert_matches_type(Optional[Network], network, path=["response"]) @pytest.mark.skip() @parametrize @@ -44,7 +44,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: name="managed-network-1", type="tls", ) - assert_matches_type(Optional[DeviceManagedNetworks], network, path=["response"]) + assert_matches_type(Optional[Network], network, path=["response"]) @pytest.mark.skip() @parametrize @@ -59,7 +59,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" network = response.parse() - assert_matches_type(Optional[DeviceManagedNetworks], network, path=["response"]) + assert_matches_type(Optional[Network], network, path=["response"]) @pytest.mark.skip() @parametrize @@ -74,7 +74,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" network = response.parse() - assert_matches_type(Optional[DeviceManagedNetworks], network, path=["response"]) + assert_matches_type(Optional[Network], network, path=["response"]) assert cast(Any, response.is_closed) is True @@ -96,7 +96,7 @@ def test_method_update(self, client: Cloudflare) -> None: "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(Optional[DeviceManagedNetworks], network, path=["response"]) + assert_matches_type(Optional[Network], network, path=["response"]) @pytest.mark.skip() @parametrize @@ -111,7 +111,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: name="managed-network-1", type="tls", ) - assert_matches_type(Optional[DeviceManagedNetworks], network, path=["response"]) + assert_matches_type(Optional[Network], network, path=["response"]) @pytest.mark.skip() @parametrize @@ -124,7 +124,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" network = response.parse() - assert_matches_type(Optional[DeviceManagedNetworks], network, path=["response"]) + assert_matches_type(Optional[Network], network, path=["response"]) @pytest.mark.skip() @parametrize @@ -137,7 +137,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" network = response.parse() - assert_matches_type(Optional[DeviceManagedNetworks], network, path=["response"]) + assert_matches_type(Optional[Network], network, path=["response"]) assert cast(Any, response.is_closed) is True @@ -162,7 +162,7 @@ def test_method_list(self, client: Cloudflare) -> None: network = client.zero_trust.devices.networks.list( account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(SyncSinglePage[DeviceManagedNetworks], network, path=["response"]) + assert_matches_type(SyncSinglePage[Network], network, path=["response"]) @pytest.mark.skip() @parametrize @@ -174,7 +174,7 @@ 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" network = response.parse() - assert_matches_type(SyncSinglePage[DeviceManagedNetworks], network, path=["response"]) + assert_matches_type(SyncSinglePage[Network], network, path=["response"]) @pytest.mark.skip() @parametrize @@ -186,7 +186,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" network = response.parse() - assert_matches_type(SyncSinglePage[DeviceManagedNetworks], network, path=["response"]) + assert_matches_type(SyncSinglePage[Network], network, path=["response"]) assert cast(Any, response.is_closed) is True @@ -262,7 +262,7 @@ def test_method_get(self, client: Cloudflare) -> None: "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(Optional[DeviceManagedNetworks], network, path=["response"]) + assert_matches_type(Optional[Network], network, path=["response"]) @pytest.mark.skip() @parametrize @@ -275,7 +275,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" network = response.parse() - assert_matches_type(Optional[DeviceManagedNetworks], network, path=["response"]) + assert_matches_type(Optional[Network], network, path=["response"]) @pytest.mark.skip() @parametrize @@ -288,7 +288,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" network = response.parse() - assert_matches_type(Optional[DeviceManagedNetworks], network, path=["response"]) + assert_matches_type(Optional[Network], network, path=["response"]) assert cast(Any, response.is_closed) is True @@ -320,7 +320,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: name="managed-network-1", type="tls", ) - assert_matches_type(Optional[DeviceManagedNetworks], network, path=["response"]) + assert_matches_type(Optional[Network], network, path=["response"]) @pytest.mark.skip() @parametrize @@ -334,7 +334,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare name="managed-network-1", type="tls", ) - assert_matches_type(Optional[DeviceManagedNetworks], network, path=["response"]) + assert_matches_type(Optional[Network], network, path=["response"]) @pytest.mark.skip() @parametrize @@ -349,7 +349,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" network = await response.parse() - assert_matches_type(Optional[DeviceManagedNetworks], network, path=["response"]) + assert_matches_type(Optional[Network], network, path=["response"]) @pytest.mark.skip() @parametrize @@ -364,7 +364,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" network = await response.parse() - assert_matches_type(Optional[DeviceManagedNetworks], network, path=["response"]) + assert_matches_type(Optional[Network], network, path=["response"]) assert cast(Any, response.is_closed) is True @@ -386,7 +386,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(Optional[DeviceManagedNetworks], network, path=["response"]) + assert_matches_type(Optional[Network], network, path=["response"]) @pytest.mark.skip() @parametrize @@ -401,7 +401,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare name="managed-network-1", type="tls", ) - assert_matches_type(Optional[DeviceManagedNetworks], network, path=["response"]) + assert_matches_type(Optional[Network], network, path=["response"]) @pytest.mark.skip() @parametrize @@ -414,7 +414,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" network = await response.parse() - assert_matches_type(Optional[DeviceManagedNetworks], network, path=["response"]) + assert_matches_type(Optional[Network], network, path=["response"]) @pytest.mark.skip() @parametrize @@ -427,7 +427,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" network = await response.parse() - assert_matches_type(Optional[DeviceManagedNetworks], network, path=["response"]) + assert_matches_type(Optional[Network], network, path=["response"]) assert cast(Any, response.is_closed) is True @@ -452,7 +452,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: network = await async_client.zero_trust.devices.networks.list( account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(AsyncSinglePage[DeviceManagedNetworks], network, path=["response"]) + assert_matches_type(AsyncSinglePage[Network], network, path=["response"]) @pytest.mark.skip() @parametrize @@ -464,7 +464,7 @@ 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" network = await response.parse() - assert_matches_type(AsyncSinglePage[DeviceManagedNetworks], network, path=["response"]) + assert_matches_type(AsyncSinglePage[Network], network, path=["response"]) @pytest.mark.skip() @parametrize @@ -476,7 +476,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" network = await response.parse() - assert_matches_type(AsyncSinglePage[DeviceManagedNetworks], network, path=["response"]) + assert_matches_type(AsyncSinglePage[Network], network, path=["response"]) assert cast(Any, response.is_closed) is True @@ -552,7 +552,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(Optional[DeviceManagedNetworks], network, path=["response"]) + assert_matches_type(Optional[Network], network, path=["response"]) @pytest.mark.skip() @parametrize @@ -565,7 +565,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" network = await response.parse() - assert_matches_type(Optional[DeviceManagedNetworks], network, path=["response"]) + assert_matches_type(Optional[Network], network, path=["response"]) @pytest.mark.skip() @parametrize @@ -578,7 +578,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" network = await response.parse() - assert_matches_type(Optional[DeviceManagedNetworks], network, path=["response"]) + assert_matches_type(Optional[Network], network, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/devices/test_policies.py b/tests/api_resources/zero_trust/devices/test_policies.py index d3e5f9a0cb0..8400c293aa1 100644 --- a/tests/api_resources/zero_trust/devices/test_policies.py +++ b/tests/api_resources/zero_trust/devices/test_policies.py @@ -11,8 +11,8 @@ from tests.utils import assert_matches_type from cloudflare.pagination import SyncSinglePage, AsyncSinglePage from cloudflare.types.zero_trust.devices import ( + SettingsPolicy, PolicyDeleteResponse, - DevicesDeviceSettingsPolicy, ) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -30,7 +30,7 @@ def test_method_create(self, client: Cloudflare) -> None: name="Allow Developers", precedence=100, ) - assert_matches_type(Optional[DevicesDeviceSettingsPolicy], policy, path=["response"]) + assert_matches_type(Optional[SettingsPolicy], policy, path=["response"]) @pytest.mark.skip() @parametrize @@ -58,7 +58,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: support_url="https://1.1.1.1/help", switch_locked=True, ) - assert_matches_type(Optional[DevicesDeviceSettingsPolicy], policy, path=["response"]) + assert_matches_type(Optional[SettingsPolicy], policy, path=["response"]) @pytest.mark.skip() @parametrize @@ -73,7 +73,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = response.parse() - assert_matches_type(Optional[DevicesDeviceSettingsPolicy], policy, path=["response"]) + assert_matches_type(Optional[SettingsPolicy], policy, path=["response"]) @pytest.mark.skip() @parametrize @@ -88,7 +88,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = response.parse() - assert_matches_type(Optional[DevicesDeviceSettingsPolicy], policy, path=["response"]) + assert_matches_type(Optional[SettingsPolicy], policy, path=["response"]) assert cast(Any, response.is_closed) is True @@ -109,7 +109,7 @@ def test_method_list(self, client: Cloudflare) -> None: policy = client.zero_trust.devices.policies.list( account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(SyncSinglePage[DevicesDeviceSettingsPolicy], policy, path=["response"]) + assert_matches_type(SyncSinglePage[SettingsPolicy], policy, path=["response"]) @pytest.mark.skip() @parametrize @@ -121,7 +121,7 @@ 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" policy = response.parse() - assert_matches_type(SyncSinglePage[DevicesDeviceSettingsPolicy], policy, path=["response"]) + assert_matches_type(SyncSinglePage[SettingsPolicy], policy, path=["response"]) @pytest.mark.skip() @parametrize @@ -133,7 +133,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = response.parse() - assert_matches_type(SyncSinglePage[DevicesDeviceSettingsPolicy], policy, path=["response"]) + assert_matches_type(SyncSinglePage[SettingsPolicy], policy, path=["response"]) assert cast(Any, response.is_closed) is True @@ -209,7 +209,7 @@ def test_method_edit(self, client: Cloudflare) -> None: "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(Optional[DevicesDeviceSettingsPolicy], policy, path=["response"]) + assert_matches_type(Optional[SettingsPolicy], policy, path=["response"]) @pytest.mark.skip() @parametrize @@ -236,7 +236,7 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: support_url="https://1.1.1.1/help", switch_locked=True, ) - assert_matches_type(Optional[DevicesDeviceSettingsPolicy], policy, path=["response"]) + assert_matches_type(Optional[SettingsPolicy], policy, path=["response"]) @pytest.mark.skip() @parametrize @@ -249,7 +249,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = response.parse() - assert_matches_type(Optional[DevicesDeviceSettingsPolicy], policy, path=["response"]) + assert_matches_type(Optional[SettingsPolicy], policy, path=["response"]) @pytest.mark.skip() @parametrize @@ -262,7 +262,7 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = response.parse() - assert_matches_type(Optional[DevicesDeviceSettingsPolicy], policy, path=["response"]) + assert_matches_type(Optional[SettingsPolicy], policy, path=["response"]) assert cast(Any, response.is_closed) is True @@ -288,7 +288,7 @@ def test_method_get(self, client: Cloudflare) -> None: "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(Optional[DevicesDeviceSettingsPolicy], policy, path=["response"]) + assert_matches_type(Optional[SettingsPolicy], policy, path=["response"]) @pytest.mark.skip() @parametrize @@ -301,7 +301,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = response.parse() - assert_matches_type(Optional[DevicesDeviceSettingsPolicy], policy, path=["response"]) + assert_matches_type(Optional[SettingsPolicy], policy, path=["response"]) @pytest.mark.skip() @parametrize @@ -314,7 +314,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = response.parse() - assert_matches_type(Optional[DevicesDeviceSettingsPolicy], policy, path=["response"]) + assert_matches_type(Optional[SettingsPolicy], policy, path=["response"]) assert cast(Any, response.is_closed) is True @@ -346,7 +346,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: name="Allow Developers", precedence=100, ) - assert_matches_type(Optional[DevicesDeviceSettingsPolicy], policy, path=["response"]) + assert_matches_type(Optional[SettingsPolicy], policy, path=["response"]) @pytest.mark.skip() @parametrize @@ -374,7 +374,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare support_url="https://1.1.1.1/help", switch_locked=True, ) - assert_matches_type(Optional[DevicesDeviceSettingsPolicy], policy, path=["response"]) + assert_matches_type(Optional[SettingsPolicy], policy, path=["response"]) @pytest.mark.skip() @parametrize @@ -389,7 +389,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = await response.parse() - assert_matches_type(Optional[DevicesDeviceSettingsPolicy], policy, path=["response"]) + assert_matches_type(Optional[SettingsPolicy], policy, path=["response"]) @pytest.mark.skip() @parametrize @@ -404,7 +404,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = await response.parse() - assert_matches_type(Optional[DevicesDeviceSettingsPolicy], policy, path=["response"]) + assert_matches_type(Optional[SettingsPolicy], policy, path=["response"]) assert cast(Any, response.is_closed) is True @@ -425,7 +425,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: policy = await async_client.zero_trust.devices.policies.list( account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(AsyncSinglePage[DevicesDeviceSettingsPolicy], policy, path=["response"]) + assert_matches_type(AsyncSinglePage[SettingsPolicy], policy, path=["response"]) @pytest.mark.skip() @parametrize @@ -437,7 +437,7 @@ 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" policy = await response.parse() - assert_matches_type(AsyncSinglePage[DevicesDeviceSettingsPolicy], policy, path=["response"]) + assert_matches_type(AsyncSinglePage[SettingsPolicy], policy, path=["response"]) @pytest.mark.skip() @parametrize @@ -449,7 +449,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = await response.parse() - assert_matches_type(AsyncSinglePage[DevicesDeviceSettingsPolicy], policy, path=["response"]) + assert_matches_type(AsyncSinglePage[SettingsPolicy], policy, path=["response"]) assert cast(Any, response.is_closed) is True @@ -525,7 +525,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(Optional[DevicesDeviceSettingsPolicy], policy, path=["response"]) + assert_matches_type(Optional[SettingsPolicy], policy, path=["response"]) @pytest.mark.skip() @parametrize @@ -552,7 +552,7 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) support_url="https://1.1.1.1/help", switch_locked=True, ) - assert_matches_type(Optional[DevicesDeviceSettingsPolicy], policy, path=["response"]) + assert_matches_type(Optional[SettingsPolicy], policy, path=["response"]) @pytest.mark.skip() @parametrize @@ -565,7 +565,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = await response.parse() - assert_matches_type(Optional[DevicesDeviceSettingsPolicy], policy, path=["response"]) + assert_matches_type(Optional[SettingsPolicy], policy, path=["response"]) @pytest.mark.skip() @parametrize @@ -578,7 +578,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = await response.parse() - assert_matches_type(Optional[DevicesDeviceSettingsPolicy], policy, path=["response"]) + assert_matches_type(Optional[SettingsPolicy], policy, path=["response"]) assert cast(Any, response.is_closed) is True @@ -604,7 +604,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(Optional[DevicesDeviceSettingsPolicy], policy, path=["response"]) + assert_matches_type(Optional[SettingsPolicy], policy, path=["response"]) @pytest.mark.skip() @parametrize @@ -617,7 +617,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = await response.parse() - assert_matches_type(Optional[DevicesDeviceSettingsPolicy], policy, path=["response"]) + assert_matches_type(Optional[SettingsPolicy], policy, path=["response"]) @pytest.mark.skip() @parametrize @@ -630,7 +630,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = await response.parse() - assert_matches_type(Optional[DevicesDeviceSettingsPolicy], policy, path=["response"]) + assert_matches_type(Optional[SettingsPolicy], policy, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/devices/test_settings.py b/tests/api_resources/zero_trust/devices/test_settings.py index 76fe07fda54..4223ebeeecb 100644 --- a/tests/api_resources/zero_trust/devices/test_settings.py +++ b/tests/api_resources/zero_trust/devices/test_settings.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.zero_trust.devices import ZeroTrustAccountDeviceSettings +from cloudflare.types.zero_trust.devices import DeviceSettings base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -23,7 +23,7 @@ def test_method_update(self, client: Cloudflare) -> None: setting = client.zero_trust.devices.settings.update( account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(Optional[ZeroTrustAccountDeviceSettings], setting, path=["response"]) + assert_matches_type(Optional[DeviceSettings], setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -35,7 +35,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: root_certificate_installation_enabled=True, use_zt_virtual_ip=True, ) - assert_matches_type(Optional[ZeroTrustAccountDeviceSettings], setting, path=["response"]) + assert_matches_type(Optional[DeviceSettings], setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -47,7 +47,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = response.parse() - assert_matches_type(Optional[ZeroTrustAccountDeviceSettings], setting, path=["response"]) + assert_matches_type(Optional[DeviceSettings], setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -59,7 +59,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = response.parse() - assert_matches_type(Optional[ZeroTrustAccountDeviceSettings], setting, path=["response"]) + assert_matches_type(Optional[DeviceSettings], setting, path=["response"]) assert cast(Any, response.is_closed) is True @@ -77,7 +77,7 @@ def test_method_list(self, client: Cloudflare) -> None: setting = client.zero_trust.devices.settings.list( account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(Optional[ZeroTrustAccountDeviceSettings], setting, path=["response"]) + assert_matches_type(Optional[DeviceSettings], setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -89,7 +89,7 @@ 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" setting = response.parse() - assert_matches_type(Optional[ZeroTrustAccountDeviceSettings], setting, path=["response"]) + assert_matches_type(Optional[DeviceSettings], setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -101,7 +101,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = response.parse() - assert_matches_type(Optional[ZeroTrustAccountDeviceSettings], setting, path=["response"]) + assert_matches_type(Optional[DeviceSettings], setting, path=["response"]) assert cast(Any, response.is_closed) is True @@ -123,7 +123,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zero_trust.devices.settings.update( account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(Optional[ZeroTrustAccountDeviceSettings], setting, path=["response"]) + assert_matches_type(Optional[DeviceSettings], setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -135,7 +135,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare root_certificate_installation_enabled=True, use_zt_virtual_ip=True, ) - assert_matches_type(Optional[ZeroTrustAccountDeviceSettings], setting, path=["response"]) + assert_matches_type(Optional[DeviceSettings], setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -147,7 +147,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = await response.parse() - assert_matches_type(Optional[ZeroTrustAccountDeviceSettings], setting, path=["response"]) + assert_matches_type(Optional[DeviceSettings], setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -159,7 +159,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = await response.parse() - assert_matches_type(Optional[ZeroTrustAccountDeviceSettings], setting, path=["response"]) + assert_matches_type(Optional[DeviceSettings], setting, path=["response"]) assert cast(Any, response.is_closed) is True @@ -177,7 +177,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: setting = await async_client.zero_trust.devices.settings.list( account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(Optional[ZeroTrustAccountDeviceSettings], setting, path=["response"]) + assert_matches_type(Optional[DeviceSettings], setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -189,7 +189,7 @@ 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" setting = await response.parse() - assert_matches_type(Optional[ZeroTrustAccountDeviceSettings], setting, path=["response"]) + assert_matches_type(Optional[DeviceSettings], setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -201,7 +201,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" setting = await response.parse() - assert_matches_type(Optional[ZeroTrustAccountDeviceSettings], setting, path=["response"]) + assert_matches_type(Optional[DeviceSettings], setting, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/dex/fleet_status/test_devices.py b/tests/api_resources/zero_trust/dex/fleet_status/test_devices.py index 01ff8997a3b..6c300ed53f7 100644 --- a/tests/api_resources/zero_trust/dex/fleet_status/test_devices.py +++ b/tests/api_resources/zero_trust/dex/fleet_status/test_devices.py @@ -10,7 +10,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray -from cloudflare.types.zero_trust.dex.fleet_status import Device +from cloudflare.types.zero_trust.dex.fleet_status import DeviceListResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -28,7 +28,7 @@ def test_method_list(self, client: Cloudflare) -> None: time_end="2023-10-11T00:00:00Z", time_start="2023-10-11T00:00:00Z", ) - assert_matches_type(SyncV4PagePaginationArray[Device], device, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[DeviceListResponse], device, path=["response"]) @pytest.mark.skip() @parametrize @@ -47,7 +47,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: status="connected", version="1.0.0", ) - assert_matches_type(SyncV4PagePaginationArray[Device], device, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[DeviceListResponse], device, path=["response"]) @pytest.mark.skip() @parametrize @@ -63,7 +63,7 @@ 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" device = response.parse() - assert_matches_type(SyncV4PagePaginationArray[Device], device, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[DeviceListResponse], device, path=["response"]) @pytest.mark.skip() @parametrize @@ -79,7 +79,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" device = response.parse() - assert_matches_type(SyncV4PagePaginationArray[Device], device, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[DeviceListResponse], device, path=["response"]) assert cast(Any, response.is_closed) is True @@ -109,7 +109,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: time_end="2023-10-11T00:00:00Z", time_start="2023-10-11T00:00:00Z", ) - assert_matches_type(AsyncV4PagePaginationArray[Device], device, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[DeviceListResponse], device, path=["response"]) @pytest.mark.skip() @parametrize @@ -128,7 +128,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) status="connected", version="1.0.0", ) - assert_matches_type(AsyncV4PagePaginationArray[Device], device, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[DeviceListResponse], device, path=["response"]) @pytest.mark.skip() @parametrize @@ -144,7 +144,7 @@ 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" device = await response.parse() - assert_matches_type(AsyncV4PagePaginationArray[Device], device, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[DeviceListResponse], device, path=["response"]) @pytest.mark.skip() @parametrize @@ -160,7 +160,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" device = await response.parse() - assert_matches_type(AsyncV4PagePaginationArray[Device], device, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[DeviceListResponse], device, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/dex/test_traceroute_tests.py b/tests/api_resources/zero_trust/dex/test_traceroute_tests.py index c5ef83b742b..674e41cd649 100644 --- a/tests/api_resources/zero_trust/dex/test_traceroute_tests.py +++ b/tests/api_resources/zero_trust/dex/test_traceroute_tests.py @@ -10,9 +10,9 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.types.zero_trust.dex import ( - TracerouteDetails, - TracerouteTestNetworkPath, - TracerouteDetailsPercentiles, + Traceroute, + NetworkPath, + TracerouteTestPercentilesResponse, ) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -31,7 +31,7 @@ def test_method_get(self, client: Cloudflare) -> None: time_end="string", time_start="string", ) - assert_matches_type(TracerouteDetails, traceroute_test, path=["response"]) + assert_matches_type(Traceroute, traceroute_test, path=["response"]) @pytest.mark.skip() @parametrize @@ -45,7 +45,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None: colo="string", device_id=["string", "string", "string"], ) - assert_matches_type(TracerouteDetails, traceroute_test, path=["response"]) + assert_matches_type(Traceroute, traceroute_test, path=["response"]) @pytest.mark.skip() @parametrize @@ -61,7 +61,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" traceroute_test = response.parse() - assert_matches_type(TracerouteDetails, traceroute_test, path=["response"]) + assert_matches_type(Traceroute, traceroute_test, path=["response"]) @pytest.mark.skip() @parametrize @@ -77,7 +77,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" traceroute_test = response.parse() - assert_matches_type(TracerouteDetails, traceroute_test, path=["response"]) + assert_matches_type(Traceroute, traceroute_test, path=["response"]) assert cast(Any, response.is_closed) is True @@ -113,7 +113,7 @@ def test_method_network_path(self, client: Cloudflare) -> None: time_end="string", time_start="string", ) - assert_matches_type(TracerouteTestNetworkPath, traceroute_test, path=["response"]) + assert_matches_type(NetworkPath, traceroute_test, path=["response"]) @pytest.mark.skip() @parametrize @@ -130,7 +130,7 @@ def test_raw_response_network_path(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" traceroute_test = response.parse() - assert_matches_type(TracerouteTestNetworkPath, traceroute_test, path=["response"]) + assert_matches_type(NetworkPath, traceroute_test, path=["response"]) @pytest.mark.skip() @parametrize @@ -147,7 +147,7 @@ def test_streaming_response_network_path(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" traceroute_test = response.parse() - assert_matches_type(TracerouteTestNetworkPath, traceroute_test, path=["response"]) + assert_matches_type(NetworkPath, traceroute_test, path=["response"]) assert cast(Any, response.is_closed) is True @@ -183,7 +183,7 @@ def test_method_percentiles(self, client: Cloudflare) -> None: time_end="2023-09-20T17:00:00Z", time_start="2023-09-20T17:00:00Z", ) - assert_matches_type(TracerouteDetailsPercentiles, traceroute_test, path=["response"]) + assert_matches_type(TracerouteTestPercentilesResponse, traceroute_test, path=["response"]) @pytest.mark.skip() @parametrize @@ -196,7 +196,7 @@ def test_method_percentiles_with_all_params(self, client: Cloudflare) -> None: colo="string", device_id=["string", "string", "string"], ) - assert_matches_type(TracerouteDetailsPercentiles, traceroute_test, path=["response"]) + assert_matches_type(TracerouteTestPercentilesResponse, traceroute_test, path=["response"]) @pytest.mark.skip() @parametrize @@ -211,7 +211,7 @@ def test_raw_response_percentiles(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" traceroute_test = response.parse() - assert_matches_type(TracerouteDetailsPercentiles, traceroute_test, path=["response"]) + assert_matches_type(TracerouteTestPercentilesResponse, traceroute_test, path=["response"]) @pytest.mark.skip() @parametrize @@ -226,7 +226,7 @@ def test_streaming_response_percentiles(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" traceroute_test = response.parse() - assert_matches_type(TracerouteDetailsPercentiles, traceroute_test, path=["response"]) + assert_matches_type(TracerouteTestPercentilesResponse, traceroute_test, path=["response"]) assert cast(Any, response.is_closed) is True @@ -263,7 +263,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: time_end="string", time_start="string", ) - assert_matches_type(TracerouteDetails, traceroute_test, path=["response"]) + assert_matches_type(Traceroute, traceroute_test, path=["response"]) @pytest.mark.skip() @parametrize @@ -277,7 +277,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) - colo="string", device_id=["string", "string", "string"], ) - assert_matches_type(TracerouteDetails, traceroute_test, path=["response"]) + assert_matches_type(Traceroute, traceroute_test, path=["response"]) @pytest.mark.skip() @parametrize @@ -293,7 +293,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" traceroute_test = await response.parse() - assert_matches_type(TracerouteDetails, traceroute_test, path=["response"]) + assert_matches_type(Traceroute, traceroute_test, path=["response"]) @pytest.mark.skip() @parametrize @@ -309,7 +309,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" traceroute_test = await response.parse() - assert_matches_type(TracerouteDetails, traceroute_test, path=["response"]) + assert_matches_type(Traceroute, traceroute_test, path=["response"]) assert cast(Any, response.is_closed) is True @@ -345,7 +345,7 @@ async def test_method_network_path(self, async_client: AsyncCloudflare) -> None: time_end="string", time_start="string", ) - assert_matches_type(TracerouteTestNetworkPath, traceroute_test, path=["response"]) + assert_matches_type(NetworkPath, traceroute_test, path=["response"]) @pytest.mark.skip() @parametrize @@ -362,7 +362,7 @@ async def test_raw_response_network_path(self, async_client: AsyncCloudflare) -> assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" traceroute_test = await response.parse() - assert_matches_type(TracerouteTestNetworkPath, traceroute_test, path=["response"]) + assert_matches_type(NetworkPath, traceroute_test, path=["response"]) @pytest.mark.skip() @parametrize @@ -379,7 +379,7 @@ async def test_streaming_response_network_path(self, async_client: AsyncCloudfla assert response.http_request.headers.get("X-Stainless-Lang") == "python" traceroute_test = await response.parse() - assert_matches_type(TracerouteTestNetworkPath, traceroute_test, path=["response"]) + assert_matches_type(NetworkPath, traceroute_test, path=["response"]) assert cast(Any, response.is_closed) is True @@ -415,7 +415,7 @@ async def test_method_percentiles(self, async_client: AsyncCloudflare) -> None: time_end="2023-09-20T17:00:00Z", time_start="2023-09-20T17:00:00Z", ) - assert_matches_type(TracerouteDetailsPercentiles, traceroute_test, path=["response"]) + assert_matches_type(TracerouteTestPercentilesResponse, traceroute_test, path=["response"]) @pytest.mark.skip() @parametrize @@ -428,7 +428,7 @@ async def test_method_percentiles_with_all_params(self, async_client: AsyncCloud colo="string", device_id=["string", "string", "string"], ) - assert_matches_type(TracerouteDetailsPercentiles, traceroute_test, path=["response"]) + assert_matches_type(TracerouteTestPercentilesResponse, traceroute_test, path=["response"]) @pytest.mark.skip() @parametrize @@ -443,7 +443,7 @@ async def test_raw_response_percentiles(self, async_client: AsyncCloudflare) -> assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" traceroute_test = await response.parse() - assert_matches_type(TracerouteDetailsPercentiles, traceroute_test, path=["response"]) + assert_matches_type(TracerouteTestPercentilesResponse, traceroute_test, path=["response"]) @pytest.mark.skip() @parametrize @@ -458,7 +458,7 @@ async def test_streaming_response_percentiles(self, async_client: AsyncCloudflar assert response.http_request.headers.get("X-Stainless-Lang") == "python" traceroute_test = await response.parse() - assert_matches_type(TracerouteDetailsPercentiles, traceroute_test, path=["response"]) + assert_matches_type(TracerouteTestPercentilesResponse, traceroute_test, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/dex/traceroute_test_results/test_network_path.py b/tests/api_resources/zero_trust/dex/traceroute_test_results/test_network_path.py index 0af6e17a5ea..60a912d414a 100644 --- a/tests/api_resources/zero_trust/dex/traceroute_test_results/test_network_path.py +++ b/tests/api_resources/zero_trust/dex/traceroute_test_results/test_network_path.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.zero_trust.dex.traceroute_test_results import TracerouteTestResultNetworkPath +from cloudflare.types.zero_trust.dex.traceroute_test_results import NetworkPath base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -24,7 +24,7 @@ def test_method_get(self, client: Cloudflare) -> None: "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="01a7362d577a6c3019a474fd6f485823", ) - assert_matches_type(TracerouteTestResultNetworkPath, network_path, path=["response"]) + assert_matches_type(NetworkPath, network_path, path=["response"]) @pytest.mark.skip() @parametrize @@ -37,7 +37,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" network_path = response.parse() - assert_matches_type(TracerouteTestResultNetworkPath, network_path, path=["response"]) + assert_matches_type(NetworkPath, network_path, path=["response"]) @pytest.mark.skip() @parametrize @@ -50,7 +50,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" network_path = response.parse() - assert_matches_type(TracerouteTestResultNetworkPath, network_path, path=["response"]) + assert_matches_type(NetworkPath, network_path, path=["response"]) assert cast(Any, response.is_closed) is True @@ -80,7 +80,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="01a7362d577a6c3019a474fd6f485823", ) - assert_matches_type(TracerouteTestResultNetworkPath, network_path, path=["response"]) + assert_matches_type(NetworkPath, network_path, path=["response"]) @pytest.mark.skip() @parametrize @@ -93,7 +93,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" network_path = await response.parse() - assert_matches_type(TracerouteTestResultNetworkPath, network_path, path=["response"]) + assert_matches_type(NetworkPath, network_path, path=["response"]) @pytest.mark.skip() @parametrize @@ -106,7 +106,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" network_path = await response.parse() - assert_matches_type(TracerouteTestResultNetworkPath, network_path, path=["response"]) + assert_matches_type(NetworkPath, network_path, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/dlp/test_payload_logs.py b/tests/api_resources/zero_trust/dlp/test_payload_logs.py index ce4c31c883e..0f18a2aa45e 100644 --- a/tests/api_resources/zero_trust/dlp/test_payload_logs.py +++ b/tests/api_resources/zero_trust/dlp/test_payload_logs.py @@ -3,13 +3,13 @@ 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.types.zero_trust.dlp import UnnamedSchemaRefE31ff4936b1b42746e8cb62bbc87f2e5 +from cloudflare.types.zero_trust.dlp import PayloadLogGetResponse, PayloadLogUpdateResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -24,7 +24,7 @@ def test_method_update(self, client: Cloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", public_key="EmpOvSXw8BfbrGCi0fhGiD/3yXk2SiV1Nzg2lru3oj0=", ) - assert_matches_type(Optional[UnnamedSchemaRefE31ff4936b1b42746e8cb62bbc87f2e5], payload_log, path=["response"]) + assert_matches_type(PayloadLogUpdateResponse, payload_log, path=["response"]) @pytest.mark.skip() @parametrize @@ -37,7 +37,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" payload_log = response.parse() - assert_matches_type(Optional[UnnamedSchemaRefE31ff4936b1b42746e8cb62bbc87f2e5], payload_log, path=["response"]) + assert_matches_type(PayloadLogUpdateResponse, payload_log, path=["response"]) @pytest.mark.skip() @parametrize @@ -50,9 +50,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" payload_log = response.parse() - assert_matches_type( - Optional[UnnamedSchemaRefE31ff4936b1b42746e8cb62bbc87f2e5], payload_log, path=["response"] - ) + assert_matches_type(PayloadLogUpdateResponse, payload_log, path=["response"]) assert cast(Any, response.is_closed) is True @@ -71,7 +69,7 @@ def test_method_get(self, client: Cloudflare) -> None: payload_log = client.zero_trust.dlp.payload_logs.get( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[UnnamedSchemaRefE31ff4936b1b42746e8cb62bbc87f2e5], payload_log, path=["response"]) + assert_matches_type(PayloadLogGetResponse, payload_log, path=["response"]) @pytest.mark.skip() @parametrize @@ -83,7 +81,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" payload_log = response.parse() - assert_matches_type(Optional[UnnamedSchemaRefE31ff4936b1b42746e8cb62bbc87f2e5], payload_log, path=["response"]) + assert_matches_type(PayloadLogGetResponse, payload_log, path=["response"]) @pytest.mark.skip() @parametrize @@ -95,9 +93,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" payload_log = response.parse() - assert_matches_type( - Optional[UnnamedSchemaRefE31ff4936b1b42746e8cb62bbc87f2e5], payload_log, path=["response"] - ) + assert_matches_type(PayloadLogGetResponse, payload_log, path=["response"]) assert cast(Any, response.is_closed) is True @@ -120,7 +116,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", public_key="EmpOvSXw8BfbrGCi0fhGiD/3yXk2SiV1Nzg2lru3oj0=", ) - assert_matches_type(Optional[UnnamedSchemaRefE31ff4936b1b42746e8cb62bbc87f2e5], payload_log, path=["response"]) + assert_matches_type(PayloadLogUpdateResponse, payload_log, path=["response"]) @pytest.mark.skip() @parametrize @@ -133,7 +129,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" payload_log = await response.parse() - assert_matches_type(Optional[UnnamedSchemaRefE31ff4936b1b42746e8cb62bbc87f2e5], payload_log, path=["response"]) + assert_matches_type(PayloadLogUpdateResponse, payload_log, path=["response"]) @pytest.mark.skip() @parametrize @@ -146,9 +142,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" payload_log = await response.parse() - assert_matches_type( - Optional[UnnamedSchemaRefE31ff4936b1b42746e8cb62bbc87f2e5], payload_log, path=["response"] - ) + assert_matches_type(PayloadLogUpdateResponse, payload_log, path=["response"]) assert cast(Any, response.is_closed) is True @@ -167,7 +161,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: payload_log = await async_client.zero_trust.dlp.payload_logs.get( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[UnnamedSchemaRefE31ff4936b1b42746e8cb62bbc87f2e5], payload_log, path=["response"]) + assert_matches_type(PayloadLogGetResponse, payload_log, path=["response"]) @pytest.mark.skip() @parametrize @@ -179,7 +173,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" payload_log = await response.parse() - assert_matches_type(Optional[UnnamedSchemaRefE31ff4936b1b42746e8cb62bbc87f2e5], payload_log, path=["response"]) + assert_matches_type(PayloadLogGetResponse, payload_log, path=["response"]) @pytest.mark.skip() @parametrize @@ -191,9 +185,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" payload_log = await response.parse() - assert_matches_type( - Optional[UnnamedSchemaRefE31ff4936b1b42746e8cb62bbc87f2e5], payload_log, path=["response"] - ) + assert_matches_type(PayloadLogGetResponse, payload_log, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/dlp/test_profiles.py b/tests/api_resources/zero_trust/dlp/test_profiles.py index 8bf670d85d4..c373f9035ff 100644 --- a/tests/api_resources/zero_trust/dlp/test_profiles.py +++ b/tests/api_resources/zero_trust/dlp/test_profiles.py @@ -10,7 +10,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.pagination import SyncSinglePage, AsyncSinglePage -from cloudflare.types.zero_trust.dlp import DLPProfile, ProfileGetResponse +from cloudflare.types.zero_trust.dlp import Profile, ProfileGetResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -24,7 +24,7 @@ def test_method_list(self, client: Cloudflare) -> None: profile = client.zero_trust.dlp.profiles.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncSinglePage[DLPProfile], profile, path=["response"]) + assert_matches_type(SyncSinglePage[Profile], profile, path=["response"]) @pytest.mark.skip() @parametrize @@ -36,7 +36,7 @@ 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" profile = response.parse() - assert_matches_type(SyncSinglePage[DLPProfile], profile, path=["response"]) + assert_matches_type(SyncSinglePage[Profile], profile, path=["response"]) @pytest.mark.skip() @parametrize @@ -48,7 +48,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" profile = response.parse() - assert_matches_type(SyncSinglePage[DLPProfile], profile, path=["response"]) + assert_matches_type(SyncSinglePage[Profile], profile, path=["response"]) assert cast(Any, response.is_closed) is True @@ -122,7 +122,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: profile = await async_client.zero_trust.dlp.profiles.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncSinglePage[DLPProfile], profile, path=["response"]) + assert_matches_type(AsyncSinglePage[Profile], profile, path=["response"]) @pytest.mark.skip() @parametrize @@ -134,7 +134,7 @@ 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" profile = await response.parse() - assert_matches_type(AsyncSinglePage[DLPProfile], profile, path=["response"]) + assert_matches_type(AsyncSinglePage[Profile], profile, path=["response"]) @pytest.mark.skip() @parametrize @@ -146,7 +146,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" profile = await response.parse() - assert_matches_type(AsyncSinglePage[DLPProfile], profile, path=["response"]) + assert_matches_type(AsyncSinglePage[Profile], profile, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/gateway/test_app_types.py b/tests/api_resources/zero_trust/gateway/test_app_types.py index 1c07ff95dc2..73e3cc10608 100644 --- a/tests/api_resources/zero_trust/gateway/test_app_types.py +++ b/tests/api_resources/zero_trust/gateway/test_app_types.py @@ -10,7 +10,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.pagination import SyncSinglePage, AsyncSinglePage -from cloudflare.types.zero_trust.gateway import ZeroTrustGatewayAppTypes +from cloudflare.types.zero_trust.gateway import AppType base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -24,7 +24,7 @@ def test_method_list(self, client: Cloudflare) -> None: app_type = client.zero_trust.gateway.app_types.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncSinglePage[ZeroTrustGatewayAppTypes], app_type, path=["response"]) + assert_matches_type(SyncSinglePage[AppType], app_type, path=["response"]) @pytest.mark.skip() @parametrize @@ -36,7 +36,7 @@ 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" app_type = response.parse() - assert_matches_type(SyncSinglePage[ZeroTrustGatewayAppTypes], app_type, path=["response"]) + assert_matches_type(SyncSinglePage[AppType], app_type, path=["response"]) @pytest.mark.skip() @parametrize @@ -48,7 +48,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" app_type = response.parse() - assert_matches_type(SyncSinglePage[ZeroTrustGatewayAppTypes], app_type, path=["response"]) + assert_matches_type(SyncSinglePage[AppType], app_type, path=["response"]) assert cast(Any, response.is_closed) is True @@ -70,7 +70,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: app_type = await async_client.zero_trust.gateway.app_types.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncSinglePage[ZeroTrustGatewayAppTypes], app_type, path=["response"]) + assert_matches_type(AsyncSinglePage[AppType], app_type, path=["response"]) @pytest.mark.skip() @parametrize @@ -82,7 +82,7 @@ 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" app_type = await response.parse() - assert_matches_type(AsyncSinglePage[ZeroTrustGatewayAppTypes], app_type, path=["response"]) + assert_matches_type(AsyncSinglePage[AppType], app_type, path=["response"]) @pytest.mark.skip() @parametrize @@ -94,7 +94,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" app_type = await response.parse() - assert_matches_type(AsyncSinglePage[ZeroTrustGatewayAppTypes], app_type, path=["response"]) + assert_matches_type(AsyncSinglePage[AppType], app_type, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/gateway/test_audit_ssh_settings.py b/tests/api_resources/zero_trust/gateway/test_audit_ssh_settings.py index 41131b5b655..195b71962d7 100644 --- a/tests/api_resources/zero_trust/gateway/test_audit_ssh_settings.py +++ b/tests/api_resources/zero_trust/gateway/test_audit_ssh_settings.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.zero_trust.gateway import ZeroTrustGatewaySettings +from cloudflare.types.zero_trust.gateway import GatewaySettings base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -24,7 +24,7 @@ def test_method_update(self, client: Cloudflare) -> None: account_id="699d98642c564d2e855e9661899b7252", public_key="1pyl6I1tL7xfJuFYVzXlUW8uXXlpxegHXBzGCBKaSFA=", ) - assert_matches_type(ZeroTrustGatewaySettings, audit_ssh_setting, path=["response"]) + assert_matches_type(GatewaySettings, audit_ssh_setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -34,7 +34,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: public_key="1pyl6I1tL7xfJuFYVzXlUW8uXXlpxegHXBzGCBKaSFA=", seed_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", ) - assert_matches_type(ZeroTrustGatewaySettings, audit_ssh_setting, path=["response"]) + assert_matches_type(GatewaySettings, audit_ssh_setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -47,7 +47,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" audit_ssh_setting = response.parse() - assert_matches_type(ZeroTrustGatewaySettings, audit_ssh_setting, path=["response"]) + assert_matches_type(GatewaySettings, audit_ssh_setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -60,7 +60,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" audit_ssh_setting = response.parse() - assert_matches_type(ZeroTrustGatewaySettings, audit_ssh_setting, path=["response"]) + assert_matches_type(GatewaySettings, audit_ssh_setting, path=["response"]) assert cast(Any, response.is_closed) is True @@ -79,7 +79,7 @@ def test_method_get(self, client: Cloudflare) -> None: audit_ssh_setting = client.zero_trust.gateway.audit_ssh_settings.get( account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(ZeroTrustGatewaySettings, audit_ssh_setting, path=["response"]) + assert_matches_type(GatewaySettings, audit_ssh_setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -91,7 +91,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" audit_ssh_setting = response.parse() - assert_matches_type(ZeroTrustGatewaySettings, audit_ssh_setting, path=["response"]) + assert_matches_type(GatewaySettings, audit_ssh_setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -103,7 +103,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" audit_ssh_setting = response.parse() - assert_matches_type(ZeroTrustGatewaySettings, audit_ssh_setting, path=["response"]) + assert_matches_type(GatewaySettings, audit_ssh_setting, path=["response"]) assert cast(Any, response.is_closed) is True @@ -126,7 +126,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: account_id="699d98642c564d2e855e9661899b7252", public_key="1pyl6I1tL7xfJuFYVzXlUW8uXXlpxegHXBzGCBKaSFA=", ) - assert_matches_type(ZeroTrustGatewaySettings, audit_ssh_setting, path=["response"]) + assert_matches_type(GatewaySettings, audit_ssh_setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -136,7 +136,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare public_key="1pyl6I1tL7xfJuFYVzXlUW8uXXlpxegHXBzGCBKaSFA=", seed_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", ) - assert_matches_type(ZeroTrustGatewaySettings, audit_ssh_setting, path=["response"]) + assert_matches_type(GatewaySettings, audit_ssh_setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -149,7 +149,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" audit_ssh_setting = await response.parse() - assert_matches_type(ZeroTrustGatewaySettings, audit_ssh_setting, path=["response"]) + assert_matches_type(GatewaySettings, audit_ssh_setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -162,7 +162,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" audit_ssh_setting = await response.parse() - assert_matches_type(ZeroTrustGatewaySettings, audit_ssh_setting, path=["response"]) + assert_matches_type(GatewaySettings, audit_ssh_setting, path=["response"]) assert cast(Any, response.is_closed) is True @@ -181,7 +181,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: audit_ssh_setting = await async_client.zero_trust.gateway.audit_ssh_settings.get( account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(ZeroTrustGatewaySettings, audit_ssh_setting, path=["response"]) + assert_matches_type(GatewaySettings, audit_ssh_setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -193,7 +193,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" audit_ssh_setting = await response.parse() - assert_matches_type(ZeroTrustGatewaySettings, audit_ssh_setting, path=["response"]) + assert_matches_type(GatewaySettings, audit_ssh_setting, path=["response"]) @pytest.mark.skip() @parametrize @@ -205,7 +205,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" audit_ssh_setting = await response.parse() - assert_matches_type(ZeroTrustGatewaySettings, audit_ssh_setting, path=["response"]) + assert_matches_type(GatewaySettings, audit_ssh_setting, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/gateway/test_categories.py b/tests/api_resources/zero_trust/gateway/test_categories.py index 597b08b3c5d..1ec3c2e3886 100644 --- a/tests/api_resources/zero_trust/gateway/test_categories.py +++ b/tests/api_resources/zero_trust/gateway/test_categories.py @@ -10,7 +10,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.pagination import SyncSinglePage, AsyncSinglePage -from cloudflare.types.zero_trust.gateway import ZeroTrustGatewayCategories +from cloudflare.types.zero_trust.gateway import Category base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -24,7 +24,7 @@ def test_method_list(self, client: Cloudflare) -> None: category = client.zero_trust.gateway.categories.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncSinglePage[ZeroTrustGatewayCategories], category, path=["response"]) + assert_matches_type(SyncSinglePage[Category], category, path=["response"]) @pytest.mark.skip() @parametrize @@ -36,7 +36,7 @@ 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" category = response.parse() - assert_matches_type(SyncSinglePage[ZeroTrustGatewayCategories], category, path=["response"]) + assert_matches_type(SyncSinglePage[Category], category, path=["response"]) @pytest.mark.skip() @parametrize @@ -48,7 +48,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" category = response.parse() - assert_matches_type(SyncSinglePage[ZeroTrustGatewayCategories], category, path=["response"]) + assert_matches_type(SyncSinglePage[Category], category, path=["response"]) assert cast(Any, response.is_closed) is True @@ -70,7 +70,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: category = await async_client.zero_trust.gateway.categories.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncSinglePage[ZeroTrustGatewayCategories], category, path=["response"]) + assert_matches_type(AsyncSinglePage[Category], category, path=["response"]) @pytest.mark.skip() @parametrize @@ -82,7 +82,7 @@ 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" category = await response.parse() - assert_matches_type(AsyncSinglePage[ZeroTrustGatewayCategories], category, path=["response"]) + assert_matches_type(AsyncSinglePage[Category], category, path=["response"]) @pytest.mark.skip() @parametrize @@ -94,7 +94,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" category = await response.parse() - assert_matches_type(AsyncSinglePage[ZeroTrustGatewayCategories], category, path=["response"]) + assert_matches_type(AsyncSinglePage[Category], category, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/gateway/test_lists.py b/tests/api_resources/zero_trust/gateway/test_lists.py index d4beb995661..ef5bda156b0 100644 --- a/tests/api_resources/zero_trust/gateway/test_lists.py +++ b/tests/api_resources/zero_trust/gateway/test_lists.py @@ -12,8 +12,8 @@ from cloudflare.pagination import SyncSinglePage, AsyncSinglePage from cloudflare.types.shared import UnnamedSchemaRef9444735ca60712dbcf8afd832eb5716a from cloudflare.types.zero_trust.gateway import ( + Lists, ListCreateResponse, - ZeroTrustGatewayLists, ) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -92,7 +92,7 @@ def test_method_update(self, client: Cloudflare) -> None: account_id="699d98642c564d2e855e9661899b7252", name="Admin Serial Numbers", ) - assert_matches_type(ZeroTrustGatewayLists, list, path=["response"]) + assert_matches_type(Lists, list, path=["response"]) @pytest.mark.skip() @parametrize @@ -103,7 +103,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: name="Admin Serial Numbers", description="The serial numbers for administrators", ) - assert_matches_type(ZeroTrustGatewayLists, list, path=["response"]) + assert_matches_type(Lists, list, path=["response"]) @pytest.mark.skip() @parametrize @@ -117,7 +117,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" list = response.parse() - assert_matches_type(ZeroTrustGatewayLists, list, path=["response"]) + assert_matches_type(Lists, list, path=["response"]) @pytest.mark.skip() @parametrize @@ -131,7 +131,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" list = response.parse() - assert_matches_type(ZeroTrustGatewayLists, list, path=["response"]) + assert_matches_type(Lists, list, path=["response"]) assert cast(Any, response.is_closed) is True @@ -158,7 +158,7 @@ def test_method_list(self, client: Cloudflare) -> None: list = client.zero_trust.gateway.lists.list( account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(SyncSinglePage[ZeroTrustGatewayLists], list, path=["response"]) + assert_matches_type(SyncSinglePage[Lists], list, path=["response"]) @pytest.mark.skip() @parametrize @@ -170,7 +170,7 @@ 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" list = response.parse() - assert_matches_type(SyncSinglePage[ZeroTrustGatewayLists], list, path=["response"]) + assert_matches_type(SyncSinglePage[Lists], list, path=["response"]) @pytest.mark.skip() @parametrize @@ -182,7 +182,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" list = response.parse() - assert_matches_type(SyncSinglePage[ZeroTrustGatewayLists], list, path=["response"]) + assert_matches_type(SyncSinglePage[Lists], list, path=["response"]) assert cast(Any, response.is_closed) is True @@ -258,7 +258,7 @@ def test_method_edit(self, client: Cloudflare) -> None: "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(ZeroTrustGatewayLists, list, path=["response"]) + assert_matches_type(Lists, list, path=["response"]) @pytest.mark.skip() @parametrize @@ -269,7 +269,7 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: append=[{"value": "8GE8721REF"}, {"value": "8GE8721REF"}, {"value": "8GE8721REF"}], remove=["8GE8721REF", "8GE8721REF", "8GE8721REF"], ) - assert_matches_type(ZeroTrustGatewayLists, list, path=["response"]) + assert_matches_type(Lists, list, path=["response"]) @pytest.mark.skip() @parametrize @@ -282,7 +282,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" list = response.parse() - assert_matches_type(ZeroTrustGatewayLists, list, path=["response"]) + assert_matches_type(Lists, list, path=["response"]) @pytest.mark.skip() @parametrize @@ -295,7 +295,7 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" list = response.parse() - assert_matches_type(ZeroTrustGatewayLists, list, path=["response"]) + assert_matches_type(Lists, list, path=["response"]) assert cast(Any, response.is_closed) is True @@ -321,7 +321,7 @@ def test_method_get(self, client: Cloudflare) -> None: "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(ZeroTrustGatewayLists, list, path=["response"]) + assert_matches_type(Lists, list, path=["response"]) @pytest.mark.skip() @parametrize @@ -334,7 +334,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" list = response.parse() - assert_matches_type(ZeroTrustGatewayLists, list, path=["response"]) + assert_matches_type(Lists, list, path=["response"]) @pytest.mark.skip() @parametrize @@ -347,7 +347,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" list = response.parse() - assert_matches_type(ZeroTrustGatewayLists, list, path=["response"]) + assert_matches_type(Lists, list, path=["response"]) assert cast(Any, response.is_closed) is True @@ -440,7 +440,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: account_id="699d98642c564d2e855e9661899b7252", name="Admin Serial Numbers", ) - assert_matches_type(ZeroTrustGatewayLists, list, path=["response"]) + assert_matches_type(Lists, list, path=["response"]) @pytest.mark.skip() @parametrize @@ -451,7 +451,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare name="Admin Serial Numbers", description="The serial numbers for administrators", ) - assert_matches_type(ZeroTrustGatewayLists, list, path=["response"]) + assert_matches_type(Lists, list, path=["response"]) @pytest.mark.skip() @parametrize @@ -465,7 +465,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" list = await response.parse() - assert_matches_type(ZeroTrustGatewayLists, list, path=["response"]) + assert_matches_type(Lists, list, path=["response"]) @pytest.mark.skip() @parametrize @@ -479,7 +479,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" list = await response.parse() - assert_matches_type(ZeroTrustGatewayLists, list, path=["response"]) + assert_matches_type(Lists, list, path=["response"]) assert cast(Any, response.is_closed) is True @@ -506,7 +506,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: list = await async_client.zero_trust.gateway.lists.list( account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(AsyncSinglePage[ZeroTrustGatewayLists], list, path=["response"]) + assert_matches_type(AsyncSinglePage[Lists], list, path=["response"]) @pytest.mark.skip() @parametrize @@ -518,7 +518,7 @@ 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" list = await response.parse() - assert_matches_type(AsyncSinglePage[ZeroTrustGatewayLists], list, path=["response"]) + assert_matches_type(AsyncSinglePage[Lists], list, path=["response"]) @pytest.mark.skip() @parametrize @@ -530,7 +530,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" list = await response.parse() - assert_matches_type(AsyncSinglePage[ZeroTrustGatewayLists], list, path=["response"]) + assert_matches_type(AsyncSinglePage[Lists], list, path=["response"]) assert cast(Any, response.is_closed) is True @@ -606,7 +606,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(ZeroTrustGatewayLists, list, path=["response"]) + assert_matches_type(Lists, list, path=["response"]) @pytest.mark.skip() @parametrize @@ -617,7 +617,7 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) append=[{"value": "8GE8721REF"}, {"value": "8GE8721REF"}, {"value": "8GE8721REF"}], remove=["8GE8721REF", "8GE8721REF", "8GE8721REF"], ) - assert_matches_type(ZeroTrustGatewayLists, list, path=["response"]) + assert_matches_type(Lists, list, path=["response"]) @pytest.mark.skip() @parametrize @@ -630,7 +630,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" list = await response.parse() - assert_matches_type(ZeroTrustGatewayLists, list, path=["response"]) + assert_matches_type(Lists, list, path=["response"]) @pytest.mark.skip() @parametrize @@ -643,7 +643,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" list = await response.parse() - assert_matches_type(ZeroTrustGatewayLists, list, path=["response"]) + assert_matches_type(Lists, list, path=["response"]) assert cast(Any, response.is_closed) is True @@ -669,7 +669,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(ZeroTrustGatewayLists, list, path=["response"]) + assert_matches_type(Lists, list, path=["response"]) @pytest.mark.skip() @parametrize @@ -682,7 +682,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" list = await response.parse() - assert_matches_type(ZeroTrustGatewayLists, list, path=["response"]) + assert_matches_type(Lists, list, path=["response"]) @pytest.mark.skip() @parametrize @@ -695,7 +695,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" list = await response.parse() - assert_matches_type(ZeroTrustGatewayLists, list, path=["response"]) + assert_matches_type(Lists, list, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/gateway/test_locations.py b/tests/api_resources/zero_trust/gateway/test_locations.py index d5fa0dcf57a..9a3e0803e59 100644 --- a/tests/api_resources/zero_trust/gateway/test_locations.py +++ b/tests/api_resources/zero_trust/gateway/test_locations.py @@ -12,7 +12,7 @@ from cloudflare.pagination import SyncSinglePage, AsyncSinglePage from cloudflare.types.shared import UnnamedSchemaRef9444735ca60712dbcf8afd832eb5716a from cloudflare.types.zero_trust.gateway import ( - Locations, + Location, ) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -28,7 +28,7 @@ def test_method_create(self, client: Cloudflare) -> None: account_id="699d98642c564d2e855e9661899b7252", name="Austin Office Location", ) - assert_matches_type(Locations, location, path=["response"]) + assert_matches_type(Location, location, path=["response"]) @pytest.mark.skip() @parametrize @@ -40,7 +40,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: ecs_support=False, networks=[{"network": "192.0.2.1/32"}, {"network": "192.0.2.1/32"}, {"network": "192.0.2.1/32"}], ) - assert_matches_type(Locations, location, path=["response"]) + assert_matches_type(Location, location, path=["response"]) @pytest.mark.skip() @parametrize @@ -53,7 +53,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" location = response.parse() - assert_matches_type(Locations, location, path=["response"]) + assert_matches_type(Location, location, path=["response"]) @pytest.mark.skip() @parametrize @@ -66,7 +66,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" location = response.parse() - assert_matches_type(Locations, location, path=["response"]) + assert_matches_type(Location, location, path=["response"]) assert cast(Any, response.is_closed) is True @@ -87,7 +87,7 @@ def test_method_update(self, client: Cloudflare) -> None: account_id="699d98642c564d2e855e9661899b7252", name="Austin Office Location", ) - assert_matches_type(Locations, location, path=["response"]) + assert_matches_type(Location, location, path=["response"]) @pytest.mark.skip() @parametrize @@ -100,7 +100,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: ecs_support=False, networks=[{"network": "192.0.2.1/32"}, {"network": "192.0.2.1/32"}, {"network": "192.0.2.1/32"}], ) - assert_matches_type(Locations, location, path=["response"]) + assert_matches_type(Location, location, path=["response"]) @pytest.mark.skip() @parametrize @@ -114,7 +114,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" location = response.parse() - assert_matches_type(Locations, location, path=["response"]) + assert_matches_type(Location, location, path=["response"]) @pytest.mark.skip() @parametrize @@ -128,7 +128,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" location = response.parse() - assert_matches_type(Locations, location, path=["response"]) + assert_matches_type(Location, location, path=["response"]) assert cast(Any, response.is_closed) is True @@ -155,7 +155,7 @@ def test_method_list(self, client: Cloudflare) -> None: location = client.zero_trust.gateway.locations.list( account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(SyncSinglePage[Locations], location, path=["response"]) + assert_matches_type(SyncSinglePage[Location], location, path=["response"]) @pytest.mark.skip() @parametrize @@ -167,7 +167,7 @@ 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" location = response.parse() - assert_matches_type(SyncSinglePage[Locations], location, path=["response"]) + assert_matches_type(SyncSinglePage[Location], location, path=["response"]) @pytest.mark.skip() @parametrize @@ -179,7 +179,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" location = response.parse() - assert_matches_type(SyncSinglePage[Locations], location, path=["response"]) + assert_matches_type(SyncSinglePage[Location], location, path=["response"]) assert cast(Any, response.is_closed) is True @@ -255,7 +255,7 @@ def test_method_get(self, client: Cloudflare) -> None: "ed35569b41ce4d1facfe683550f54086", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(Locations, location, path=["response"]) + assert_matches_type(Location, location, path=["response"]) @pytest.mark.skip() @parametrize @@ -268,7 +268,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" location = response.parse() - assert_matches_type(Locations, location, path=["response"]) + assert_matches_type(Location, location, path=["response"]) @pytest.mark.skip() @parametrize @@ -281,7 +281,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" location = response.parse() - assert_matches_type(Locations, location, path=["response"]) + assert_matches_type(Location, location, path=["response"]) assert cast(Any, response.is_closed) is True @@ -311,7 +311,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: account_id="699d98642c564d2e855e9661899b7252", name="Austin Office Location", ) - assert_matches_type(Locations, location, path=["response"]) + assert_matches_type(Location, location, path=["response"]) @pytest.mark.skip() @parametrize @@ -323,7 +323,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare ecs_support=False, networks=[{"network": "192.0.2.1/32"}, {"network": "192.0.2.1/32"}, {"network": "192.0.2.1/32"}], ) - assert_matches_type(Locations, location, path=["response"]) + assert_matches_type(Location, location, path=["response"]) @pytest.mark.skip() @parametrize @@ -336,7 +336,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" location = await response.parse() - assert_matches_type(Locations, location, path=["response"]) + assert_matches_type(Location, location, path=["response"]) @pytest.mark.skip() @parametrize @@ -349,7 +349,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" location = await response.parse() - assert_matches_type(Locations, location, path=["response"]) + assert_matches_type(Location, location, path=["response"]) assert cast(Any, response.is_closed) is True @@ -370,7 +370,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: account_id="699d98642c564d2e855e9661899b7252", name="Austin Office Location", ) - assert_matches_type(Locations, location, path=["response"]) + assert_matches_type(Location, location, path=["response"]) @pytest.mark.skip() @parametrize @@ -383,7 +383,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare ecs_support=False, networks=[{"network": "192.0.2.1/32"}, {"network": "192.0.2.1/32"}, {"network": "192.0.2.1/32"}], ) - assert_matches_type(Locations, location, path=["response"]) + assert_matches_type(Location, location, path=["response"]) @pytest.mark.skip() @parametrize @@ -397,7 +397,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" location = await response.parse() - assert_matches_type(Locations, location, path=["response"]) + assert_matches_type(Location, location, path=["response"]) @pytest.mark.skip() @parametrize @@ -411,7 +411,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" location = await response.parse() - assert_matches_type(Locations, location, path=["response"]) + assert_matches_type(Location, location, path=["response"]) assert cast(Any, response.is_closed) is True @@ -438,7 +438,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: location = await async_client.zero_trust.gateway.locations.list( account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(AsyncSinglePage[Locations], location, path=["response"]) + assert_matches_type(AsyncSinglePage[Location], location, path=["response"]) @pytest.mark.skip() @parametrize @@ -450,7 +450,7 @@ 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" location = await response.parse() - assert_matches_type(AsyncSinglePage[Locations], location, path=["response"]) + assert_matches_type(AsyncSinglePage[Location], location, path=["response"]) @pytest.mark.skip() @parametrize @@ -462,7 +462,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" location = await response.parse() - assert_matches_type(AsyncSinglePage[Locations], location, path=["response"]) + assert_matches_type(AsyncSinglePage[Location], location, path=["response"]) assert cast(Any, response.is_closed) is True @@ -538,7 +538,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: "ed35569b41ce4d1facfe683550f54086", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(Locations, location, path=["response"]) + assert_matches_type(Location, location, path=["response"]) @pytest.mark.skip() @parametrize @@ -551,7 +551,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" location = await response.parse() - assert_matches_type(Locations, location, path=["response"]) + assert_matches_type(Location, location, path=["response"]) @pytest.mark.skip() @parametrize @@ -564,7 +564,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" location = await response.parse() - assert_matches_type(Locations, location, path=["response"]) + assert_matches_type(Location, location, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/gateway/test_logging.py b/tests/api_resources/zero_trust/gateway/test_logging.py index 271ab5a347b..0472b550c3e 100644 --- a/tests/api_resources/zero_trust/gateway/test_logging.py +++ b/tests/api_resources/zero_trust/gateway/test_logging.py @@ -10,7 +10,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.types.zero_trust.gateway import ( - ZeroTrustGatewayGatewayAccountLoggingSettings, + LoggingSetting, ) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -25,7 +25,7 @@ def test_method_update(self, client: Cloudflare) -> None: logging = client.zero_trust.gateway.logging.update( account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(ZeroTrustGatewayGatewayAccountLoggingSettings, logging, path=["response"]) + assert_matches_type(LoggingSetting, logging, path=["response"]) @pytest.mark.skip() @parametrize @@ -39,7 +39,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: "l4": {}, }, ) - assert_matches_type(ZeroTrustGatewayGatewayAccountLoggingSettings, logging, path=["response"]) + assert_matches_type(LoggingSetting, logging, path=["response"]) @pytest.mark.skip() @parametrize @@ -51,7 +51,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" logging = response.parse() - assert_matches_type(ZeroTrustGatewayGatewayAccountLoggingSettings, logging, path=["response"]) + assert_matches_type(LoggingSetting, logging, path=["response"]) @pytest.mark.skip() @parametrize @@ -63,7 +63,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" logging = response.parse() - assert_matches_type(ZeroTrustGatewayGatewayAccountLoggingSettings, logging, path=["response"]) + assert_matches_type(LoggingSetting, logging, path=["response"]) assert cast(Any, response.is_closed) is True @@ -81,7 +81,7 @@ def test_method_get(self, client: Cloudflare) -> None: logging = client.zero_trust.gateway.logging.get( account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(ZeroTrustGatewayGatewayAccountLoggingSettings, logging, path=["response"]) + assert_matches_type(LoggingSetting, logging, path=["response"]) @pytest.mark.skip() @parametrize @@ -93,7 +93,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" logging = response.parse() - assert_matches_type(ZeroTrustGatewayGatewayAccountLoggingSettings, logging, path=["response"]) + assert_matches_type(LoggingSetting, logging, path=["response"]) @pytest.mark.skip() @parametrize @@ -105,7 +105,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" logging = response.parse() - assert_matches_type(ZeroTrustGatewayGatewayAccountLoggingSettings, logging, path=["response"]) + assert_matches_type(LoggingSetting, logging, path=["response"]) assert cast(Any, response.is_closed) is True @@ -127,7 +127,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: logging = await async_client.zero_trust.gateway.logging.update( account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(ZeroTrustGatewayGatewayAccountLoggingSettings, logging, path=["response"]) + assert_matches_type(LoggingSetting, logging, path=["response"]) @pytest.mark.skip() @parametrize @@ -141,7 +141,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare "l4": {}, }, ) - assert_matches_type(ZeroTrustGatewayGatewayAccountLoggingSettings, logging, path=["response"]) + assert_matches_type(LoggingSetting, logging, path=["response"]) @pytest.mark.skip() @parametrize @@ -153,7 +153,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" logging = await response.parse() - assert_matches_type(ZeroTrustGatewayGatewayAccountLoggingSettings, logging, path=["response"]) + assert_matches_type(LoggingSetting, logging, path=["response"]) @pytest.mark.skip() @parametrize @@ -165,7 +165,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" logging = await response.parse() - assert_matches_type(ZeroTrustGatewayGatewayAccountLoggingSettings, logging, path=["response"]) + assert_matches_type(LoggingSetting, logging, path=["response"]) assert cast(Any, response.is_closed) is True @@ -183,7 +183,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: logging = await async_client.zero_trust.gateway.logging.get( account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(ZeroTrustGatewayGatewayAccountLoggingSettings, logging, path=["response"]) + assert_matches_type(LoggingSetting, logging, path=["response"]) @pytest.mark.skip() @parametrize @@ -195,7 +195,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" logging = await response.parse() - assert_matches_type(ZeroTrustGatewayGatewayAccountLoggingSettings, logging, path=["response"]) + assert_matches_type(LoggingSetting, logging, path=["response"]) @pytest.mark.skip() @parametrize @@ -207,7 +207,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" logging = await response.parse() - assert_matches_type(ZeroTrustGatewayGatewayAccountLoggingSettings, logging, path=["response"]) + assert_matches_type(LoggingSetting, logging, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/gateway/test_proxy_endpoints.py b/tests/api_resources/zero_trust/gateway/test_proxy_endpoints.py index ebeb9cd8683..4c0d7ab0f7d 100644 --- a/tests/api_resources/zero_trust/gateway/test_proxy_endpoints.py +++ b/tests/api_resources/zero_trust/gateway/test_proxy_endpoints.py @@ -12,7 +12,7 @@ from cloudflare.pagination import SyncSinglePage, AsyncSinglePage from cloudflare.types.shared import UnnamedSchemaRef9444735ca60712dbcf8afd832eb5716a from cloudflare.types.zero_trust.gateway import ( - ZeroTrustGatewayProxyEndpoints, + ProxyEndpoint, ) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -29,7 +29,7 @@ def test_method_create(self, client: Cloudflare) -> None: ips=["192.0.2.1/32", "192.0.2.1/32", "192.0.2.1/32"], name="Devops team", ) - assert_matches_type(ZeroTrustGatewayProxyEndpoints, proxy_endpoint, path=["response"]) + assert_matches_type(ProxyEndpoint, proxy_endpoint, path=["response"]) @pytest.mark.skip() @parametrize @@ -43,7 +43,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" proxy_endpoint = response.parse() - assert_matches_type(ZeroTrustGatewayProxyEndpoints, proxy_endpoint, path=["response"]) + assert_matches_type(ProxyEndpoint, proxy_endpoint, path=["response"]) @pytest.mark.skip() @parametrize @@ -57,7 +57,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" proxy_endpoint = response.parse() - assert_matches_type(ZeroTrustGatewayProxyEndpoints, proxy_endpoint, path=["response"]) + assert_matches_type(ProxyEndpoint, proxy_endpoint, path=["response"]) assert cast(Any, response.is_closed) is True @@ -77,7 +77,7 @@ def test_method_list(self, client: Cloudflare) -> None: proxy_endpoint = client.zero_trust.gateway.proxy_endpoints.list( account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(SyncSinglePage[ZeroTrustGatewayProxyEndpoints], proxy_endpoint, path=["response"]) + assert_matches_type(SyncSinglePage[ProxyEndpoint], proxy_endpoint, path=["response"]) @pytest.mark.skip() @parametrize @@ -89,7 +89,7 @@ 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" proxy_endpoint = response.parse() - assert_matches_type(SyncSinglePage[ZeroTrustGatewayProxyEndpoints], proxy_endpoint, path=["response"]) + assert_matches_type(SyncSinglePage[ProxyEndpoint], proxy_endpoint, path=["response"]) @pytest.mark.skip() @parametrize @@ -101,7 +101,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" proxy_endpoint = response.parse() - assert_matches_type(SyncSinglePage[ZeroTrustGatewayProxyEndpoints], proxy_endpoint, path=["response"]) + assert_matches_type(SyncSinglePage[ProxyEndpoint], proxy_endpoint, path=["response"]) assert cast(Any, response.is_closed) is True @@ -177,7 +177,7 @@ def test_method_edit(self, client: Cloudflare) -> None: "ed35569b41ce4d1facfe683550f54086", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(ZeroTrustGatewayProxyEndpoints, proxy_endpoint, path=["response"]) + assert_matches_type(ProxyEndpoint, proxy_endpoint, path=["response"]) @pytest.mark.skip() @parametrize @@ -188,7 +188,7 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: ips=["192.0.2.1/32", "192.0.2.1/32", "192.0.2.1/32"], name="Devops team", ) - assert_matches_type(ZeroTrustGatewayProxyEndpoints, proxy_endpoint, path=["response"]) + assert_matches_type(ProxyEndpoint, proxy_endpoint, path=["response"]) @pytest.mark.skip() @parametrize @@ -201,7 +201,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" proxy_endpoint = response.parse() - assert_matches_type(ZeroTrustGatewayProxyEndpoints, proxy_endpoint, path=["response"]) + assert_matches_type(ProxyEndpoint, proxy_endpoint, path=["response"]) @pytest.mark.skip() @parametrize @@ -214,7 +214,7 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" proxy_endpoint = response.parse() - assert_matches_type(ZeroTrustGatewayProxyEndpoints, proxy_endpoint, path=["response"]) + assert_matches_type(ProxyEndpoint, proxy_endpoint, path=["response"]) assert cast(Any, response.is_closed) is True @@ -240,7 +240,7 @@ def test_method_get(self, client: Cloudflare) -> None: "ed35569b41ce4d1facfe683550f54086", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(ZeroTrustGatewayProxyEndpoints, proxy_endpoint, path=["response"]) + assert_matches_type(ProxyEndpoint, proxy_endpoint, path=["response"]) @pytest.mark.skip() @parametrize @@ -253,7 +253,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" proxy_endpoint = response.parse() - assert_matches_type(ZeroTrustGatewayProxyEndpoints, proxy_endpoint, path=["response"]) + assert_matches_type(ProxyEndpoint, proxy_endpoint, path=["response"]) @pytest.mark.skip() @parametrize @@ -266,7 +266,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" proxy_endpoint = response.parse() - assert_matches_type(ZeroTrustGatewayProxyEndpoints, proxy_endpoint, path=["response"]) + assert_matches_type(ProxyEndpoint, proxy_endpoint, path=["response"]) assert cast(Any, response.is_closed) is True @@ -297,7 +297,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: ips=["192.0.2.1/32", "192.0.2.1/32", "192.0.2.1/32"], name="Devops team", ) - assert_matches_type(ZeroTrustGatewayProxyEndpoints, proxy_endpoint, path=["response"]) + assert_matches_type(ProxyEndpoint, proxy_endpoint, path=["response"]) @pytest.mark.skip() @parametrize @@ -311,7 +311,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" proxy_endpoint = await response.parse() - assert_matches_type(ZeroTrustGatewayProxyEndpoints, proxy_endpoint, path=["response"]) + assert_matches_type(ProxyEndpoint, proxy_endpoint, path=["response"]) @pytest.mark.skip() @parametrize @@ -325,7 +325,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" proxy_endpoint = await response.parse() - assert_matches_type(ZeroTrustGatewayProxyEndpoints, proxy_endpoint, path=["response"]) + assert_matches_type(ProxyEndpoint, proxy_endpoint, path=["response"]) assert cast(Any, response.is_closed) is True @@ -345,7 +345,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: proxy_endpoint = await async_client.zero_trust.gateway.proxy_endpoints.list( account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(AsyncSinglePage[ZeroTrustGatewayProxyEndpoints], proxy_endpoint, path=["response"]) + assert_matches_type(AsyncSinglePage[ProxyEndpoint], proxy_endpoint, path=["response"]) @pytest.mark.skip() @parametrize @@ -357,7 +357,7 @@ 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" proxy_endpoint = await response.parse() - assert_matches_type(AsyncSinglePage[ZeroTrustGatewayProxyEndpoints], proxy_endpoint, path=["response"]) + assert_matches_type(AsyncSinglePage[ProxyEndpoint], proxy_endpoint, path=["response"]) @pytest.mark.skip() @parametrize @@ -369,7 +369,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" proxy_endpoint = await response.parse() - assert_matches_type(AsyncSinglePage[ZeroTrustGatewayProxyEndpoints], proxy_endpoint, path=["response"]) + assert_matches_type(AsyncSinglePage[ProxyEndpoint], proxy_endpoint, path=["response"]) assert cast(Any, response.is_closed) is True @@ -445,7 +445,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: "ed35569b41ce4d1facfe683550f54086", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(ZeroTrustGatewayProxyEndpoints, proxy_endpoint, path=["response"]) + assert_matches_type(ProxyEndpoint, proxy_endpoint, path=["response"]) @pytest.mark.skip() @parametrize @@ -456,7 +456,7 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) ips=["192.0.2.1/32", "192.0.2.1/32", "192.0.2.1/32"], name="Devops team", ) - assert_matches_type(ZeroTrustGatewayProxyEndpoints, proxy_endpoint, path=["response"]) + assert_matches_type(ProxyEndpoint, proxy_endpoint, path=["response"]) @pytest.mark.skip() @parametrize @@ -469,7 +469,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" proxy_endpoint = await response.parse() - assert_matches_type(ZeroTrustGatewayProxyEndpoints, proxy_endpoint, path=["response"]) + assert_matches_type(ProxyEndpoint, proxy_endpoint, path=["response"]) @pytest.mark.skip() @parametrize @@ -482,7 +482,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" proxy_endpoint = await response.parse() - assert_matches_type(ZeroTrustGatewayProxyEndpoints, proxy_endpoint, path=["response"]) + assert_matches_type(ProxyEndpoint, proxy_endpoint, path=["response"]) assert cast(Any, response.is_closed) is True @@ -508,7 +508,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: "ed35569b41ce4d1facfe683550f54086", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(ZeroTrustGatewayProxyEndpoints, proxy_endpoint, path=["response"]) + assert_matches_type(ProxyEndpoint, proxy_endpoint, path=["response"]) @pytest.mark.skip() @parametrize @@ -521,7 +521,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" proxy_endpoint = await response.parse() - assert_matches_type(ZeroTrustGatewayProxyEndpoints, proxy_endpoint, path=["response"]) + assert_matches_type(ProxyEndpoint, proxy_endpoint, path=["response"]) @pytest.mark.skip() @parametrize @@ -534,7 +534,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" proxy_endpoint = await response.parse() - assert_matches_type(ZeroTrustGatewayProxyEndpoints, proxy_endpoint, path=["response"]) + assert_matches_type(ProxyEndpoint, proxy_endpoint, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/gateway/test_rules.py b/tests/api_resources/zero_trust/gateway/test_rules.py index 3a07d40478f..022d3c5740e 100644 --- a/tests/api_resources/zero_trust/gateway/test_rules.py +++ b/tests/api_resources/zero_trust/gateway/test_rules.py @@ -12,7 +12,7 @@ from cloudflare.pagination import SyncSinglePage, AsyncSinglePage from cloudflare.types.shared import UnnamedSchemaRef9444735ca60712dbcf8afd832eb5716a from cloudflare.types.zero_trust.gateway import ( - ZeroTrustGatewayRules, + Rule, ) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -29,7 +29,7 @@ def test_method_create(self, client: Cloudflare) -> None: action="allow", name="block bad websites", ) - assert_matches_type(ZeroTrustGatewayRules, rule, path=["response"]) + assert_matches_type(Rule, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -142,7 +142,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: }, traffic='http.request.uri matches ".*a/partial/uri.*" and http.request.host in $01302951-49f9-47c9-a400-0297e60b6a10', ) - assert_matches_type(ZeroTrustGatewayRules, rule, path=["response"]) + assert_matches_type(Rule, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -156,7 +156,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(ZeroTrustGatewayRules, rule, path=["response"]) + assert_matches_type(Rule, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -170,7 +170,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(ZeroTrustGatewayRules, rule, path=["response"]) + assert_matches_type(Rule, rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -193,7 +193,7 @@ def test_method_update(self, client: Cloudflare) -> None: action="allow", name="block bad websites", ) - assert_matches_type(ZeroTrustGatewayRules, rule, path=["response"]) + assert_matches_type(Rule, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -307,7 +307,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: }, traffic='http.request.uri matches ".*a/partial/uri.*" and http.request.host in $01302951-49f9-47c9-a400-0297e60b6a10', ) - assert_matches_type(ZeroTrustGatewayRules, rule, path=["response"]) + assert_matches_type(Rule, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -322,7 +322,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(ZeroTrustGatewayRules, rule, path=["response"]) + assert_matches_type(Rule, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -337,7 +337,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(ZeroTrustGatewayRules, rule, path=["response"]) + assert_matches_type(Rule, rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -366,7 +366,7 @@ def test_method_list(self, client: Cloudflare) -> None: rule = client.zero_trust.gateway.rules.list( account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(SyncSinglePage[ZeroTrustGatewayRules], rule, path=["response"]) + assert_matches_type(SyncSinglePage[Rule], rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -378,7 +378,7 @@ 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" rule = response.parse() - assert_matches_type(SyncSinglePage[ZeroTrustGatewayRules], rule, path=["response"]) + assert_matches_type(SyncSinglePage[Rule], rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -390,7 +390,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(SyncSinglePage[ZeroTrustGatewayRules], rule, path=["response"]) + assert_matches_type(SyncSinglePage[Rule], rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -466,7 +466,7 @@ def test_method_get(self, client: Cloudflare) -> None: "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(ZeroTrustGatewayRules, rule, path=["response"]) + assert_matches_type(Rule, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -479,7 +479,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(ZeroTrustGatewayRules, rule, path=["response"]) + assert_matches_type(Rule, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -492,7 +492,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(ZeroTrustGatewayRules, rule, path=["response"]) + assert_matches_type(Rule, rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -523,7 +523,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: action="allow", name="block bad websites", ) - assert_matches_type(ZeroTrustGatewayRules, rule, path=["response"]) + assert_matches_type(Rule, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -636,7 +636,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare }, traffic='http.request.uri matches ".*a/partial/uri.*" and http.request.host in $01302951-49f9-47c9-a400-0297e60b6a10', ) - assert_matches_type(ZeroTrustGatewayRules, rule, path=["response"]) + assert_matches_type(Rule, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -650,7 +650,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(ZeroTrustGatewayRules, rule, path=["response"]) + assert_matches_type(Rule, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -664,7 +664,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(ZeroTrustGatewayRules, rule, path=["response"]) + assert_matches_type(Rule, rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -687,7 +687,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: action="allow", name="block bad websites", ) - assert_matches_type(ZeroTrustGatewayRules, rule, path=["response"]) + assert_matches_type(Rule, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -801,7 +801,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare }, traffic='http.request.uri matches ".*a/partial/uri.*" and http.request.host in $01302951-49f9-47c9-a400-0297e60b6a10', ) - assert_matches_type(ZeroTrustGatewayRules, rule, path=["response"]) + assert_matches_type(Rule, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -816,7 +816,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(ZeroTrustGatewayRules, rule, path=["response"]) + assert_matches_type(Rule, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -831,7 +831,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(ZeroTrustGatewayRules, rule, path=["response"]) + assert_matches_type(Rule, rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -860,7 +860,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: rule = await async_client.zero_trust.gateway.rules.list( account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(AsyncSinglePage[ZeroTrustGatewayRules], rule, path=["response"]) + assert_matches_type(AsyncSinglePage[Rule], rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -872,7 +872,7 @@ 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" rule = await response.parse() - assert_matches_type(AsyncSinglePage[ZeroTrustGatewayRules], rule, path=["response"]) + assert_matches_type(AsyncSinglePage[Rule], rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -884,7 +884,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(AsyncSinglePage[ZeroTrustGatewayRules], rule, path=["response"]) + assert_matches_type(AsyncSinglePage[Rule], rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -960,7 +960,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(ZeroTrustGatewayRules, rule, path=["response"]) + assert_matches_type(Rule, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -973,7 +973,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(ZeroTrustGatewayRules, rule, path=["response"]) + assert_matches_type(Rule, rule, path=["response"]) @pytest.mark.skip() @parametrize @@ -986,7 +986,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(ZeroTrustGatewayRules, rule, path=["response"]) + assert_matches_type(Rule, rule, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/networks/routes/test_ips.py b/tests/api_resources/zero_trust/networks/routes/test_ips.py index e27958f7424..a7017c04eb0 100644 --- a/tests/api_resources/zero_trust/networks/routes/test_ips.py +++ b/tests/api_resources/zero_trust/networks/routes/test_ips.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.zero_trust.networks import TunnelTeamnet +from cloudflare.types.zero_trust.networks import Teamnet base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -24,7 +24,7 @@ def test_method_get(self, client: Cloudflare) -> None: "10.1.0.137", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(TunnelTeamnet, ip, path=["response"]) + assert_matches_type(Teamnet, ip, path=["response"]) @pytest.mark.skip() @parametrize @@ -34,7 +34,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None: account_id="699d98642c564d2e855e9661899b7252", virtual_network_id={}, ) - assert_matches_type(TunnelTeamnet, ip, path=["response"]) + assert_matches_type(Teamnet, ip, path=["response"]) @pytest.mark.skip() @parametrize @@ -47,7 +47,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" ip = response.parse() - assert_matches_type(TunnelTeamnet, ip, path=["response"]) + assert_matches_type(Teamnet, ip, path=["response"]) @pytest.mark.skip() @parametrize @@ -60,7 +60,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" ip = response.parse() - assert_matches_type(TunnelTeamnet, ip, path=["response"]) + assert_matches_type(Teamnet, ip, path=["response"]) assert cast(Any, response.is_closed) is True @@ -90,7 +90,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: "10.1.0.137", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(TunnelTeamnet, ip, path=["response"]) + assert_matches_type(Teamnet, ip, path=["response"]) @pytest.mark.skip() @parametrize @@ -100,7 +100,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) - account_id="699d98642c564d2e855e9661899b7252", virtual_network_id={}, ) - assert_matches_type(TunnelTeamnet, ip, path=["response"]) + assert_matches_type(Teamnet, ip, path=["response"]) @pytest.mark.skip() @parametrize @@ -113,7 +113,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" ip = await response.parse() - assert_matches_type(TunnelTeamnet, ip, path=["response"]) + assert_matches_type(Teamnet, ip, path=["response"]) @pytest.mark.skip() @parametrize @@ -126,7 +126,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" ip = await response.parse() - assert_matches_type(TunnelTeamnet, ip, path=["response"]) + assert_matches_type(Teamnet, ip, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/networks/routes/test_networks.py b/tests/api_resources/zero_trust/networks/routes/test_networks.py index 087470e1890..b441734789b 100644 --- a/tests/api_resources/zero_trust/networks/routes/test_networks.py +++ b/tests/api_resources/zero_trust/networks/routes/test_networks.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.zero_trust.networks import TunnelRoute +from cloudflare.types.zero_trust.networks import Route base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -24,7 +24,7 @@ def test_method_create(self, client: Cloudflare) -> None: "172.16.0.0%2F16", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(TunnelRoute, network, path=["response"]) + assert_matches_type(Route, network, path=["response"]) @pytest.mark.skip() @parametrize @@ -35,7 +35,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: comment="Example comment for this route.", virtual_network_id={}, ) - assert_matches_type(TunnelRoute, network, path=["response"]) + assert_matches_type(Route, network, path=["response"]) @pytest.mark.skip() @parametrize @@ -48,7 +48,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" network = response.parse() - assert_matches_type(TunnelRoute, network, path=["response"]) + assert_matches_type(Route, network, path=["response"]) @pytest.mark.skip() @parametrize @@ -61,7 +61,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" network = response.parse() - assert_matches_type(TunnelRoute, network, path=["response"]) + assert_matches_type(Route, network, path=["response"]) assert cast(Any, response.is_closed) is True @@ -87,7 +87,7 @@ def test_method_delete(self, client: Cloudflare) -> None: "172.16.0.0%2F16", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(TunnelRoute, network, path=["response"]) + assert_matches_type(Route, network, path=["response"]) @pytest.mark.skip() @parametrize @@ -99,7 +99,7 @@ def test_method_delete_with_all_params(self, client: Cloudflare) -> None: tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", virtual_network_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", ) - assert_matches_type(TunnelRoute, network, path=["response"]) + assert_matches_type(Route, network, path=["response"]) @pytest.mark.skip() @parametrize @@ -112,7 +112,7 @@ 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" network = response.parse() - assert_matches_type(TunnelRoute, network, path=["response"]) + assert_matches_type(Route, network, path=["response"]) @pytest.mark.skip() @parametrize @@ -125,7 +125,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" network = response.parse() - assert_matches_type(TunnelRoute, network, path=["response"]) + assert_matches_type(Route, network, path=["response"]) assert cast(Any, response.is_closed) is True @@ -151,7 +151,7 @@ def test_method_edit(self, client: Cloudflare) -> None: "172.16.0.0%2F16", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(TunnelRoute, network, path=["response"]) + assert_matches_type(Route, network, path=["response"]) @pytest.mark.skip() @parametrize @@ -164,7 +164,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" network = response.parse() - assert_matches_type(TunnelRoute, network, path=["response"]) + assert_matches_type(Route, network, path=["response"]) @pytest.mark.skip() @parametrize @@ -177,7 +177,7 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" network = response.parse() - assert_matches_type(TunnelRoute, network, path=["response"]) + assert_matches_type(Route, network, path=["response"]) assert cast(Any, response.is_closed) is True @@ -207,7 +207,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: "172.16.0.0%2F16", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(TunnelRoute, network, path=["response"]) + assert_matches_type(Route, network, path=["response"]) @pytest.mark.skip() @parametrize @@ -218,7 +218,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare comment="Example comment for this route.", virtual_network_id={}, ) - assert_matches_type(TunnelRoute, network, path=["response"]) + assert_matches_type(Route, network, path=["response"]) @pytest.mark.skip() @parametrize @@ -231,7 +231,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" network = await response.parse() - assert_matches_type(TunnelRoute, network, path=["response"]) + assert_matches_type(Route, network, path=["response"]) @pytest.mark.skip() @parametrize @@ -244,7 +244,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" network = await response.parse() - assert_matches_type(TunnelRoute, network, path=["response"]) + assert_matches_type(Route, network, path=["response"]) assert cast(Any, response.is_closed) is True @@ -270,7 +270,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: "172.16.0.0%2F16", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(TunnelRoute, network, path=["response"]) + assert_matches_type(Route, network, path=["response"]) @pytest.mark.skip() @parametrize @@ -282,7 +282,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncCloudflare tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", virtual_network_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", ) - assert_matches_type(TunnelRoute, network, path=["response"]) + assert_matches_type(Route, network, path=["response"]) @pytest.mark.skip() @parametrize @@ -295,7 +295,7 @@ 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" network = await response.parse() - assert_matches_type(TunnelRoute, network, path=["response"]) + assert_matches_type(Route, network, path=["response"]) @pytest.mark.skip() @parametrize @@ -308,7 +308,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" network = await response.parse() - assert_matches_type(TunnelRoute, network, path=["response"]) + assert_matches_type(Route, network, path=["response"]) assert cast(Any, response.is_closed) is True @@ -334,7 +334,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: "172.16.0.0%2F16", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(TunnelRoute, network, path=["response"]) + assert_matches_type(Route, network, path=["response"]) @pytest.mark.skip() @parametrize @@ -347,7 +347,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" network = await response.parse() - assert_matches_type(TunnelRoute, network, path=["response"]) + assert_matches_type(Route, network, path=["response"]) @pytest.mark.skip() @parametrize @@ -360,7 +360,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" network = await response.parse() - assert_matches_type(TunnelRoute, network, path=["response"]) + assert_matches_type(Route, network, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/networks/test_routes.py b/tests/api_resources/zero_trust/networks/test_routes.py index 89a2a5237ac..851dd4ec855 100644 --- a/tests/api_resources/zero_trust/networks/test_routes.py +++ b/tests/api_resources/zero_trust/networks/test_routes.py @@ -11,8 +11,8 @@ from tests.utils import assert_matches_type from cloudflare.pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray from cloudflare.types.zero_trust.networks import ( - TunnelRoute, - TunnelTeamnet, + Route, + Teamnet, ) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -28,7 +28,7 @@ def test_method_create(self, client: Cloudflare) -> None: account_id="699d98642c564d2e855e9661899b7252", ip_network="172.16.0.0/16", ) - assert_matches_type(TunnelRoute, route, path=["response"]) + assert_matches_type(Route, route, path=["response"]) @pytest.mark.skip() @parametrize @@ -39,7 +39,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: comment="Example comment for this route.", virtual_network_id={}, ) - assert_matches_type(TunnelRoute, route, path=["response"]) + assert_matches_type(Route, route, path=["response"]) @pytest.mark.skip() @parametrize @@ -52,7 +52,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" route = response.parse() - assert_matches_type(TunnelRoute, route, path=["response"]) + assert_matches_type(Route, route, path=["response"]) @pytest.mark.skip() @parametrize @@ -65,7 +65,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" route = response.parse() - assert_matches_type(TunnelRoute, route, path=["response"]) + assert_matches_type(Route, route, path=["response"]) assert cast(Any, response.is_closed) is True @@ -84,7 +84,7 @@ def test_method_list(self, client: Cloudflare) -> None: route = client.zero_trust.networks.routes.list( account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(SyncV4PagePaginationArray[TunnelTeamnet], route, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[Teamnet], route, path=["response"]) @pytest.mark.skip() @parametrize @@ -103,7 +103,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: tunnel_id={}, virtual_network_id={}, ) - assert_matches_type(SyncV4PagePaginationArray[TunnelTeamnet], route, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[Teamnet], route, path=["response"]) @pytest.mark.skip() @parametrize @@ -115,7 +115,7 @@ 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" route = response.parse() - assert_matches_type(SyncV4PagePaginationArray[TunnelTeamnet], route, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[Teamnet], route, path=["response"]) @pytest.mark.skip() @parametrize @@ -127,7 +127,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" route = response.parse() - assert_matches_type(SyncV4PagePaginationArray[TunnelTeamnet], route, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[Teamnet], route, path=["response"]) assert cast(Any, response.is_closed) is True @@ -146,7 +146,7 @@ def test_method_delete(self, client: Cloudflare) -> None: "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(TunnelRoute, route, path=["response"]) + assert_matches_type(Route, route, path=["response"]) @pytest.mark.skip() @parametrize @@ -159,7 +159,7 @@ 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" route = response.parse() - assert_matches_type(TunnelRoute, route, path=["response"]) + assert_matches_type(Route, route, path=["response"]) @pytest.mark.skip() @parametrize @@ -172,7 +172,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" route = response.parse() - assert_matches_type(TunnelRoute, route, path=["response"]) + assert_matches_type(Route, route, path=["response"]) assert cast(Any, response.is_closed) is True @@ -198,7 +198,7 @@ def test_method_edit(self, client: Cloudflare) -> None: "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(TunnelRoute, route, path=["response"]) + assert_matches_type(Route, route, path=["response"]) @pytest.mark.skip() @parametrize @@ -212,7 +212,7 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: tunnel_id={}, virtual_network_id={}, ) - assert_matches_type(TunnelRoute, route, path=["response"]) + assert_matches_type(Route, route, path=["response"]) @pytest.mark.skip() @parametrize @@ -225,7 +225,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" route = response.parse() - assert_matches_type(TunnelRoute, route, path=["response"]) + assert_matches_type(Route, route, path=["response"]) @pytest.mark.skip() @parametrize @@ -238,7 +238,7 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" route = response.parse() - assert_matches_type(TunnelRoute, route, path=["response"]) + assert_matches_type(Route, route, path=["response"]) assert cast(Any, response.is_closed) is True @@ -268,7 +268,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: account_id="699d98642c564d2e855e9661899b7252", ip_network="172.16.0.0/16", ) - assert_matches_type(TunnelRoute, route, path=["response"]) + assert_matches_type(Route, route, path=["response"]) @pytest.mark.skip() @parametrize @@ -279,7 +279,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare comment="Example comment for this route.", virtual_network_id={}, ) - assert_matches_type(TunnelRoute, route, path=["response"]) + assert_matches_type(Route, route, path=["response"]) @pytest.mark.skip() @parametrize @@ -292,7 +292,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" route = await response.parse() - assert_matches_type(TunnelRoute, route, path=["response"]) + assert_matches_type(Route, route, path=["response"]) @pytest.mark.skip() @parametrize @@ -305,7 +305,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" route = await response.parse() - assert_matches_type(TunnelRoute, route, path=["response"]) + assert_matches_type(Route, route, path=["response"]) assert cast(Any, response.is_closed) is True @@ -324,7 +324,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: route = await async_client.zero_trust.networks.routes.list( account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(AsyncV4PagePaginationArray[TunnelTeamnet], route, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[Teamnet], route, path=["response"]) @pytest.mark.skip() @parametrize @@ -343,7 +343,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) tunnel_id={}, virtual_network_id={}, ) - assert_matches_type(AsyncV4PagePaginationArray[TunnelTeamnet], route, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[Teamnet], route, path=["response"]) @pytest.mark.skip() @parametrize @@ -355,7 +355,7 @@ 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" route = await response.parse() - assert_matches_type(AsyncV4PagePaginationArray[TunnelTeamnet], route, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[Teamnet], route, path=["response"]) @pytest.mark.skip() @parametrize @@ -367,7 +367,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" route = await response.parse() - assert_matches_type(AsyncV4PagePaginationArray[TunnelTeamnet], route, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[Teamnet], route, path=["response"]) assert cast(Any, response.is_closed) is True @@ -386,7 +386,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(TunnelRoute, route, path=["response"]) + assert_matches_type(Route, route, path=["response"]) @pytest.mark.skip() @parametrize @@ -399,7 +399,7 @@ 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" route = await response.parse() - assert_matches_type(TunnelRoute, route, path=["response"]) + assert_matches_type(Route, route, path=["response"]) @pytest.mark.skip() @parametrize @@ -412,7 +412,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" route = await response.parse() - assert_matches_type(TunnelRoute, route, path=["response"]) + assert_matches_type(Route, route, path=["response"]) assert cast(Any, response.is_closed) is True @@ -438,7 +438,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(TunnelRoute, route, path=["response"]) + assert_matches_type(Route, route, path=["response"]) @pytest.mark.skip() @parametrize @@ -452,7 +452,7 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) tunnel_id={}, virtual_network_id={}, ) - assert_matches_type(TunnelRoute, route, path=["response"]) + assert_matches_type(Route, route, path=["response"]) @pytest.mark.skip() @parametrize @@ -465,7 +465,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" route = await response.parse() - assert_matches_type(TunnelRoute, route, path=["response"]) + assert_matches_type(Route, route, path=["response"]) @pytest.mark.skip() @parametrize @@ -478,7 +478,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" route = await response.parse() - assert_matches_type(TunnelRoute, route, path=["response"]) + assert_matches_type(Route, route, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/networks/test_virtual_networks.py b/tests/api_resources/zero_trust/networks/test_virtual_networks.py index c9e66b17374..67af2e09fcd 100644 --- a/tests/api_resources/zero_trust/networks/test_virtual_networks.py +++ b/tests/api_resources/zero_trust/networks/test_virtual_networks.py @@ -12,7 +12,7 @@ from cloudflare.pagination import SyncSinglePage, AsyncSinglePage from cloudflare.types.shared import UnnamedSchemaRef65e3c8c1a9c4638ec25cdbbaca7165c1 from cloudflare.types.zero_trust.networks import ( - TunnelVirtualNetwork, + VirtualNetwork, ) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -92,7 +92,7 @@ def test_method_list(self, client: Cloudflare) -> None: virtual_network = client.zero_trust.networks.virtual_networks.list( account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(SyncSinglePage[TunnelVirtualNetwork], virtual_network, path=["response"]) + assert_matches_type(SyncSinglePage[VirtualNetwork], virtual_network, path=["response"]) @pytest.mark.skip() @parametrize @@ -105,7 +105,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: vnet_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", vnet_name="us-east-1-vpc", ) - assert_matches_type(SyncSinglePage[TunnelVirtualNetwork], virtual_network, path=["response"]) + assert_matches_type(SyncSinglePage[VirtualNetwork], virtual_network, path=["response"]) @pytest.mark.skip() @parametrize @@ -117,7 +117,7 @@ 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" virtual_network = response.parse() - assert_matches_type(SyncSinglePage[TunnelVirtualNetwork], virtual_network, path=["response"]) + assert_matches_type(SyncSinglePage[VirtualNetwork], virtual_network, path=["response"]) @pytest.mark.skip() @parametrize @@ -129,7 +129,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" virtual_network = response.parse() - assert_matches_type(SyncSinglePage[TunnelVirtualNetwork], virtual_network, path=["response"]) + assert_matches_type(SyncSinglePage[VirtualNetwork], virtual_network, path=["response"]) assert cast(Any, response.is_closed) is True @@ -351,7 +351,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: virtual_network = await async_client.zero_trust.networks.virtual_networks.list( account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(AsyncSinglePage[TunnelVirtualNetwork], virtual_network, path=["response"]) + assert_matches_type(AsyncSinglePage[VirtualNetwork], virtual_network, path=["response"]) @pytest.mark.skip() @parametrize @@ -364,7 +364,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) vnet_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", vnet_name="us-east-1-vpc", ) - assert_matches_type(AsyncSinglePage[TunnelVirtualNetwork], virtual_network, path=["response"]) + assert_matches_type(AsyncSinglePage[VirtualNetwork], virtual_network, path=["response"]) @pytest.mark.skip() @parametrize @@ -376,7 +376,7 @@ 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" virtual_network = await response.parse() - assert_matches_type(AsyncSinglePage[TunnelVirtualNetwork], virtual_network, path=["response"]) + assert_matches_type(AsyncSinglePage[VirtualNetwork], virtual_network, path=["response"]) @pytest.mark.skip() @parametrize @@ -388,7 +388,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" virtual_network = await response.parse() - assert_matches_type(AsyncSinglePage[TunnelVirtualNetwork], virtual_network, path=["response"]) + assert_matches_type(AsyncSinglePage[VirtualNetwork], virtual_network, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/test_devices.py b/tests/api_resources/zero_trust/test_devices.py index 456b4d37f0f..62ee181072e 100644 --- a/tests/api_resources/zero_trust/test_devices.py +++ b/tests/api_resources/zero_trust/test_devices.py @@ -11,7 +11,7 @@ from tests.utils import assert_matches_type from cloudflare.pagination import SyncSinglePage, AsyncSinglePage from cloudflare.types.shared import UnnamedSchemaRef9444735ca60712dbcf8afd832eb5716a -from cloudflare.types.zero_trust import ZeroTrustDevices +from cloudflare.types.zero_trust import Device base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -25,7 +25,7 @@ def test_method_list(self, client: Cloudflare) -> None: device = client.zero_trust.devices.list( account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(SyncSinglePage[ZeroTrustDevices], device, path=["response"]) + assert_matches_type(SyncSinglePage[Device], device, path=["response"]) @pytest.mark.skip() @parametrize @@ -37,7 +37,7 @@ 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" device = response.parse() - assert_matches_type(SyncSinglePage[ZeroTrustDevices], device, path=["response"]) + assert_matches_type(SyncSinglePage[Device], device, path=["response"]) @pytest.mark.skip() @parametrize @@ -49,7 +49,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" device = response.parse() - assert_matches_type(SyncSinglePage[ZeroTrustDevices], device, path=["response"]) + assert_matches_type(SyncSinglePage[Device], device, path=["response"]) assert cast(Any, response.is_closed) is True @@ -123,7 +123,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: device = await async_client.zero_trust.devices.list( account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(AsyncSinglePage[ZeroTrustDevices], device, path=["response"]) + assert_matches_type(AsyncSinglePage[Device], device, path=["response"]) @pytest.mark.skip() @parametrize @@ -135,7 +135,7 @@ 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" device = await response.parse() - assert_matches_type(AsyncSinglePage[ZeroTrustDevices], device, path=["response"]) + assert_matches_type(AsyncSinglePage[Device], device, path=["response"]) @pytest.mark.skip() @parametrize @@ -147,7 +147,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" device = await response.parse() - assert_matches_type(AsyncSinglePage[ZeroTrustDevices], device, path=["response"]) + assert_matches_type(AsyncSinglePage[Device], device, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/test_identity_providers.py b/tests/api_resources/zero_trust/test_identity_providers.py index 39ad381c741..a9e58c4d60b 100644 --- a/tests/api_resources/zero_trust/test_identity_providers.py +++ b/tests/api_resources/zero_trust/test_identity_providers.py @@ -11,7 +11,7 @@ from tests.utils import assert_matches_type from cloudflare.pagination import SyncSinglePage, AsyncSinglePage from cloudflare.types.zero_trust import ( - ZeroTrustIdentityProviders, + IdentityProvider, IdentityProviderListResponse, IdentityProviderDeleteResponse, ) @@ -32,7 +32,7 @@ def test_method_create_overload_1(self, client: Cloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -60,7 +60,7 @@ def test_method_create_with_all_params_overload_1(self, client: Cloudflare) -> N "user_deprovision": True, }, ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -76,7 +76,7 @@ def test_raw_response_create_overload_1(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -92,7 +92,7 @@ def test_streaming_response_create_overload_1(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) assert cast(Any, response.is_closed) is True @@ -127,7 +127,7 @@ def test_method_create_overload_2(self, client: Cloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -153,7 +153,7 @@ def test_method_create_with_all_params_overload_2(self, client: Cloudflare) -> N "user_deprovision": True, }, ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -169,7 +169,7 @@ def test_raw_response_create_overload_2(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -185,7 +185,7 @@ def test_streaming_response_create_overload_2(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) assert cast(Any, response.is_closed) is True @@ -220,7 +220,7 @@ def test_method_create_overload_3(self, client: Cloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -242,7 +242,7 @@ def test_method_create_with_all_params_overload_3(self, client: Cloudflare) -> N "user_deprovision": True, }, ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -258,7 +258,7 @@ def test_raw_response_create_overload_3(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -274,7 +274,7 @@ def test_streaming_response_create_overload_3(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) assert cast(Any, response.is_closed) is True @@ -309,7 +309,7 @@ def test_method_create_overload_4(self, client: Cloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -331,7 +331,7 @@ def test_method_create_with_all_params_overload_4(self, client: Cloudflare) -> N "user_deprovision": True, }, ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -347,7 +347,7 @@ def test_raw_response_create_overload_4(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -363,7 +363,7 @@ def test_streaming_response_create_overload_4(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) assert cast(Any, response.is_closed) is True @@ -398,7 +398,7 @@ def test_method_create_overload_5(self, client: Cloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -422,7 +422,7 @@ def test_method_create_with_all_params_overload_5(self, client: Cloudflare) -> N "user_deprovision": True, }, ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -438,7 +438,7 @@ def test_raw_response_create_overload_5(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -454,7 +454,7 @@ def test_streaming_response_create_overload_5(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) assert cast(Any, response.is_closed) is True @@ -489,7 +489,7 @@ def test_method_create_overload_6(self, client: Cloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -514,7 +514,7 @@ def test_method_create_with_all_params_overload_6(self, client: Cloudflare) -> N "user_deprovision": True, }, ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -530,7 +530,7 @@ def test_raw_response_create_overload_6(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -546,7 +546,7 @@ def test_streaming_response_create_overload_6(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) assert cast(Any, response.is_closed) is True @@ -581,7 +581,7 @@ def test_method_create_overload_7(self, client: Cloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -603,7 +603,7 @@ def test_method_create_with_all_params_overload_7(self, client: Cloudflare) -> N "user_deprovision": True, }, ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -619,7 +619,7 @@ def test_raw_response_create_overload_7(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -635,7 +635,7 @@ def test_streaming_response_create_overload_7(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) assert cast(Any, response.is_closed) is True @@ -670,7 +670,7 @@ def test_method_create_overload_8(self, client: Cloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -698,7 +698,7 @@ def test_method_create_with_all_params_overload_8(self, client: Cloudflare) -> N "user_deprovision": True, }, ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -714,7 +714,7 @@ def test_raw_response_create_overload_8(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -730,7 +730,7 @@ def test_streaming_response_create_overload_8(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) assert cast(Any, response.is_closed) is True @@ -765,7 +765,7 @@ def test_method_create_overload_9(self, client: Cloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -791,7 +791,7 @@ def test_method_create_with_all_params_overload_9(self, client: Cloudflare) -> N "user_deprovision": True, }, ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -807,7 +807,7 @@ def test_raw_response_create_overload_9(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -823,7 +823,7 @@ def test_streaming_response_create_overload_9(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) assert cast(Any, response.is_closed) is True @@ -858,7 +858,7 @@ def test_method_create_overload_10(self, client: Cloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -883,7 +883,7 @@ def test_method_create_with_all_params_overload_10(self, client: Cloudflare) -> "user_deprovision": True, }, ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -899,7 +899,7 @@ def test_raw_response_create_overload_10(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -915,7 +915,7 @@ def test_streaming_response_create_overload_10(self, client: Cloudflare) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) assert cast(Any, response.is_closed) is True @@ -950,7 +950,7 @@ def test_method_create_overload_11(self, client: Cloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -975,7 +975,7 @@ def test_method_create_with_all_params_overload_11(self, client: Cloudflare) -> "user_deprovision": True, }, ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -991,7 +991,7 @@ def test_raw_response_create_overload_11(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -1007,7 +1007,7 @@ def test_streaming_response_create_overload_11(self, client: Cloudflare) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1042,7 +1042,7 @@ def test_method_create_overload_12(self, client: Cloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -1082,7 +1082,7 @@ def test_method_create_with_all_params_overload_12(self, client: Cloudflare) -> "user_deprovision": True, }, ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -1098,7 +1098,7 @@ def test_raw_response_create_overload_12(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -1114,7 +1114,7 @@ def test_streaming_response_create_overload_12(self, client: Cloudflare) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1149,7 +1149,7 @@ def test_method_create_overload_13(self, client: Cloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -1171,7 +1171,7 @@ def test_method_create_with_all_params_overload_13(self, client: Cloudflare) -> "user_deprovision": True, }, ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -1187,7 +1187,7 @@ def test_raw_response_create_overload_13(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -1203,7 +1203,7 @@ def test_streaming_response_create_overload_13(self, client: Cloudflare) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1238,7 +1238,7 @@ def test_method_create_overload_14(self, client: Cloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -1257,7 +1257,7 @@ def test_method_create_with_all_params_overload_14(self, client: Cloudflare) -> "user_deprovision": True, }, ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -1273,7 +1273,7 @@ def test_raw_response_create_overload_14(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -1289,7 +1289,7 @@ def test_streaming_response_create_overload_14(self, client: Cloudflare) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1325,7 +1325,7 @@ def test_method_update_overload_1(self, client: Cloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -1354,7 +1354,7 @@ def test_method_update_with_all_params_overload_1(self, client: Cloudflare) -> N "user_deprovision": True, }, ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -1371,7 +1371,7 @@ def test_raw_response_update_overload_1(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -1388,7 +1388,7 @@ def test_streaming_response_update_overload_1(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1436,7 +1436,7 @@ def test_method_update_overload_2(self, client: Cloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -1463,7 +1463,7 @@ def test_method_update_with_all_params_overload_2(self, client: Cloudflare) -> N "user_deprovision": True, }, ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -1480,7 +1480,7 @@ def test_raw_response_update_overload_2(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -1497,7 +1497,7 @@ def test_streaming_response_update_overload_2(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1545,7 +1545,7 @@ def test_method_update_overload_3(self, client: Cloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -1568,7 +1568,7 @@ def test_method_update_with_all_params_overload_3(self, client: Cloudflare) -> N "user_deprovision": True, }, ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -1585,7 +1585,7 @@ def test_raw_response_update_overload_3(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -1602,7 +1602,7 @@ def test_streaming_response_update_overload_3(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1650,7 +1650,7 @@ def test_method_update_overload_4(self, client: Cloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -1673,7 +1673,7 @@ def test_method_update_with_all_params_overload_4(self, client: Cloudflare) -> N "user_deprovision": True, }, ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -1690,7 +1690,7 @@ def test_raw_response_update_overload_4(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -1707,7 +1707,7 @@ def test_streaming_response_update_overload_4(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1755,7 +1755,7 @@ def test_method_update_overload_5(self, client: Cloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -1780,7 +1780,7 @@ def test_method_update_with_all_params_overload_5(self, client: Cloudflare) -> N "user_deprovision": True, }, ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -1797,7 +1797,7 @@ def test_raw_response_update_overload_5(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -1814,7 +1814,7 @@ def test_streaming_response_update_overload_5(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1862,7 +1862,7 @@ def test_method_update_overload_6(self, client: Cloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -1888,7 +1888,7 @@ def test_method_update_with_all_params_overload_6(self, client: Cloudflare) -> N "user_deprovision": True, }, ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -1905,7 +1905,7 @@ def test_raw_response_update_overload_6(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -1922,7 +1922,7 @@ def test_streaming_response_update_overload_6(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1970,7 +1970,7 @@ def test_method_update_overload_7(self, client: Cloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -1993,7 +1993,7 @@ def test_method_update_with_all_params_overload_7(self, client: Cloudflare) -> N "user_deprovision": True, }, ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -2010,7 +2010,7 @@ def test_raw_response_update_overload_7(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -2027,7 +2027,7 @@ def test_streaming_response_update_overload_7(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) assert cast(Any, response.is_closed) is True @@ -2075,7 +2075,7 @@ def test_method_update_overload_8(self, client: Cloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -2104,7 +2104,7 @@ def test_method_update_with_all_params_overload_8(self, client: Cloudflare) -> N "user_deprovision": True, }, ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -2121,7 +2121,7 @@ def test_raw_response_update_overload_8(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -2138,7 +2138,7 @@ def test_streaming_response_update_overload_8(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) assert cast(Any, response.is_closed) is True @@ -2186,7 +2186,7 @@ def test_method_update_overload_9(self, client: Cloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -2213,7 +2213,7 @@ def test_method_update_with_all_params_overload_9(self, client: Cloudflare) -> N "user_deprovision": True, }, ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -2230,7 +2230,7 @@ def test_raw_response_update_overload_9(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -2247,7 +2247,7 @@ def test_streaming_response_update_overload_9(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) assert cast(Any, response.is_closed) is True @@ -2295,7 +2295,7 @@ def test_method_update_overload_10(self, client: Cloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -2321,7 +2321,7 @@ def test_method_update_with_all_params_overload_10(self, client: Cloudflare) -> "user_deprovision": True, }, ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -2338,7 +2338,7 @@ def test_raw_response_update_overload_10(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -2355,7 +2355,7 @@ def test_streaming_response_update_overload_10(self, client: Cloudflare) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) assert cast(Any, response.is_closed) is True @@ -2403,7 +2403,7 @@ def test_method_update_overload_11(self, client: Cloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -2429,7 +2429,7 @@ def test_method_update_with_all_params_overload_11(self, client: Cloudflare) -> "user_deprovision": True, }, ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -2446,7 +2446,7 @@ def test_raw_response_update_overload_11(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -2463,7 +2463,7 @@ def test_streaming_response_update_overload_11(self, client: Cloudflare) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) assert cast(Any, response.is_closed) is True @@ -2511,7 +2511,7 @@ def test_method_update_overload_12(self, client: Cloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -2552,7 +2552,7 @@ def test_method_update_with_all_params_overload_12(self, client: Cloudflare) -> "user_deprovision": True, }, ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -2569,7 +2569,7 @@ def test_raw_response_update_overload_12(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -2586,7 +2586,7 @@ def test_streaming_response_update_overload_12(self, client: Cloudflare) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) assert cast(Any, response.is_closed) is True @@ -2634,7 +2634,7 @@ def test_method_update_overload_13(self, client: Cloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -2657,7 +2657,7 @@ def test_method_update_with_all_params_overload_13(self, client: Cloudflare) -> "user_deprovision": True, }, ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -2674,7 +2674,7 @@ def test_raw_response_update_overload_13(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -2691,7 +2691,7 @@ def test_streaming_response_update_overload_13(self, client: Cloudflare) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) assert cast(Any, response.is_closed) is True @@ -2739,7 +2739,7 @@ def test_method_update_overload_14(self, client: Cloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -2759,7 +2759,7 @@ def test_method_update_with_all_params_overload_14(self, client: Cloudflare) -> "user_deprovision": True, }, ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -2776,7 +2776,7 @@ def test_raw_response_update_overload_14(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -2793,7 +2793,7 @@ def test_streaming_response_update_overload_14(self, client: Cloudflare) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) assert cast(Any, response.is_closed) is True @@ -2973,7 +2973,7 @@ def test_method_get(self, client: Cloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -2983,7 +2983,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -2997,7 +2997,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -3011,7 +3011,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) assert cast(Any, response.is_closed) is True @@ -3053,7 +3053,7 @@ async def test_method_create_overload_1(self, async_client: AsyncCloudflare) -> account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -3081,7 +3081,7 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn "user_deprovision": True, }, ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -3097,7 +3097,7 @@ async def test_raw_response_create_overload_1(self, async_client: AsyncCloudflar assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = await response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -3113,7 +3113,7 @@ async def test_streaming_response_create_overload_1(self, async_client: AsyncClo assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = await response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) assert cast(Any, response.is_closed) is True @@ -3148,7 +3148,7 @@ async def test_method_create_overload_2(self, async_client: AsyncCloudflare) -> account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -3174,7 +3174,7 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn "user_deprovision": True, }, ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -3190,7 +3190,7 @@ async def test_raw_response_create_overload_2(self, async_client: AsyncCloudflar assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = await response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -3206,7 +3206,7 @@ async def test_streaming_response_create_overload_2(self, async_client: AsyncClo assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = await response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) assert cast(Any, response.is_closed) is True @@ -3241,7 +3241,7 @@ async def test_method_create_overload_3(self, async_client: AsyncCloudflare) -> account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -3263,7 +3263,7 @@ async def test_method_create_with_all_params_overload_3(self, async_client: Asyn "user_deprovision": True, }, ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -3279,7 +3279,7 @@ async def test_raw_response_create_overload_3(self, async_client: AsyncCloudflar assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = await response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -3295,7 +3295,7 @@ async def test_streaming_response_create_overload_3(self, async_client: AsyncClo assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = await response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) assert cast(Any, response.is_closed) is True @@ -3330,7 +3330,7 @@ async def test_method_create_overload_4(self, async_client: AsyncCloudflare) -> account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -3352,7 +3352,7 @@ async def test_method_create_with_all_params_overload_4(self, async_client: Asyn "user_deprovision": True, }, ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -3368,7 +3368,7 @@ async def test_raw_response_create_overload_4(self, async_client: AsyncCloudflar assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = await response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -3384,7 +3384,7 @@ async def test_streaming_response_create_overload_4(self, async_client: AsyncClo assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = await response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) assert cast(Any, response.is_closed) is True @@ -3419,7 +3419,7 @@ async def test_method_create_overload_5(self, async_client: AsyncCloudflare) -> account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -3443,7 +3443,7 @@ async def test_method_create_with_all_params_overload_5(self, async_client: Asyn "user_deprovision": True, }, ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -3459,7 +3459,7 @@ async def test_raw_response_create_overload_5(self, async_client: AsyncCloudflar assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = await response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -3475,7 +3475,7 @@ async def test_streaming_response_create_overload_5(self, async_client: AsyncClo assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = await response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) assert cast(Any, response.is_closed) is True @@ -3510,7 +3510,7 @@ async def test_method_create_overload_6(self, async_client: AsyncCloudflare) -> account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -3535,7 +3535,7 @@ async def test_method_create_with_all_params_overload_6(self, async_client: Asyn "user_deprovision": True, }, ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -3551,7 +3551,7 @@ async def test_raw_response_create_overload_6(self, async_client: AsyncCloudflar assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = await response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -3567,7 +3567,7 @@ async def test_streaming_response_create_overload_6(self, async_client: AsyncClo assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = await response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) assert cast(Any, response.is_closed) is True @@ -3602,7 +3602,7 @@ async def test_method_create_overload_7(self, async_client: AsyncCloudflare) -> account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -3624,7 +3624,7 @@ async def test_method_create_with_all_params_overload_7(self, async_client: Asyn "user_deprovision": True, }, ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -3640,7 +3640,7 @@ async def test_raw_response_create_overload_7(self, async_client: AsyncCloudflar assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = await response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -3656,7 +3656,7 @@ async def test_streaming_response_create_overload_7(self, async_client: AsyncClo assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = await response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) assert cast(Any, response.is_closed) is True @@ -3691,7 +3691,7 @@ async def test_method_create_overload_8(self, async_client: AsyncCloudflare) -> account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -3719,7 +3719,7 @@ async def test_method_create_with_all_params_overload_8(self, async_client: Asyn "user_deprovision": True, }, ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -3735,7 +3735,7 @@ async def test_raw_response_create_overload_8(self, async_client: AsyncCloudflar assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = await response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -3751,7 +3751,7 @@ async def test_streaming_response_create_overload_8(self, async_client: AsyncClo assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = await response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) assert cast(Any, response.is_closed) is True @@ -3786,7 +3786,7 @@ async def test_method_create_overload_9(self, async_client: AsyncCloudflare) -> account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -3812,7 +3812,7 @@ async def test_method_create_with_all_params_overload_9(self, async_client: Asyn "user_deprovision": True, }, ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -3828,7 +3828,7 @@ async def test_raw_response_create_overload_9(self, async_client: AsyncCloudflar assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = await response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -3844,7 +3844,7 @@ async def test_streaming_response_create_overload_9(self, async_client: AsyncClo assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = await response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) assert cast(Any, response.is_closed) is True @@ -3879,7 +3879,7 @@ async def test_method_create_overload_10(self, async_client: AsyncCloudflare) -> account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -3904,7 +3904,7 @@ async def test_method_create_with_all_params_overload_10(self, async_client: Asy "user_deprovision": True, }, ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -3920,7 +3920,7 @@ async def test_raw_response_create_overload_10(self, async_client: AsyncCloudfla assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = await response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -3936,7 +3936,7 @@ async def test_streaming_response_create_overload_10(self, async_client: AsyncCl assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = await response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) assert cast(Any, response.is_closed) is True @@ -3971,7 +3971,7 @@ async def test_method_create_overload_11(self, async_client: AsyncCloudflare) -> account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -3996,7 +3996,7 @@ async def test_method_create_with_all_params_overload_11(self, async_client: Asy "user_deprovision": True, }, ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -4012,7 +4012,7 @@ async def test_raw_response_create_overload_11(self, async_client: AsyncCloudfla assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = await response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -4028,7 +4028,7 @@ async def test_streaming_response_create_overload_11(self, async_client: AsyncCl assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = await response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) assert cast(Any, response.is_closed) is True @@ -4063,7 +4063,7 @@ async def test_method_create_overload_12(self, async_client: AsyncCloudflare) -> account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -4103,7 +4103,7 @@ async def test_method_create_with_all_params_overload_12(self, async_client: Asy "user_deprovision": True, }, ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -4119,7 +4119,7 @@ async def test_raw_response_create_overload_12(self, async_client: AsyncCloudfla assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = await response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -4135,7 +4135,7 @@ async def test_streaming_response_create_overload_12(self, async_client: AsyncCl assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = await response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) assert cast(Any, response.is_closed) is True @@ -4170,7 +4170,7 @@ async def test_method_create_overload_13(self, async_client: AsyncCloudflare) -> account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -4192,7 +4192,7 @@ async def test_method_create_with_all_params_overload_13(self, async_client: Asy "user_deprovision": True, }, ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -4208,7 +4208,7 @@ async def test_raw_response_create_overload_13(self, async_client: AsyncCloudfla assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = await response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -4224,7 +4224,7 @@ async def test_streaming_response_create_overload_13(self, async_client: AsyncCl assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = await response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) assert cast(Any, response.is_closed) is True @@ -4259,7 +4259,7 @@ async def test_method_create_overload_14(self, async_client: AsyncCloudflare) -> account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -4278,7 +4278,7 @@ async def test_method_create_with_all_params_overload_14(self, async_client: Asy "user_deprovision": True, }, ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -4294,7 +4294,7 @@ async def test_raw_response_create_overload_14(self, async_client: AsyncCloudfla assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = await response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -4310,7 +4310,7 @@ async def test_streaming_response_create_overload_14(self, async_client: AsyncCl assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = await response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) assert cast(Any, response.is_closed) is True @@ -4346,7 +4346,7 @@ async def test_method_update_overload_1(self, async_client: AsyncCloudflare) -> account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -4375,7 +4375,7 @@ async def test_method_update_with_all_params_overload_1(self, async_client: Asyn "user_deprovision": True, }, ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -4392,7 +4392,7 @@ async def test_raw_response_update_overload_1(self, async_client: AsyncCloudflar assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = await response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -4409,7 +4409,7 @@ async def test_streaming_response_update_overload_1(self, async_client: AsyncClo assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = await response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) assert cast(Any, response.is_closed) is True @@ -4457,7 +4457,7 @@ async def test_method_update_overload_2(self, async_client: AsyncCloudflare) -> account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -4484,7 +4484,7 @@ async def test_method_update_with_all_params_overload_2(self, async_client: Asyn "user_deprovision": True, }, ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -4501,7 +4501,7 @@ async def test_raw_response_update_overload_2(self, async_client: AsyncCloudflar assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = await response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -4518,7 +4518,7 @@ async def test_streaming_response_update_overload_2(self, async_client: AsyncClo assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = await response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) assert cast(Any, response.is_closed) is True @@ -4566,7 +4566,7 @@ async def test_method_update_overload_3(self, async_client: AsyncCloudflare) -> account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -4589,7 +4589,7 @@ async def test_method_update_with_all_params_overload_3(self, async_client: Asyn "user_deprovision": True, }, ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -4606,7 +4606,7 @@ async def test_raw_response_update_overload_3(self, async_client: AsyncCloudflar assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = await response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -4623,7 +4623,7 @@ async def test_streaming_response_update_overload_3(self, async_client: AsyncClo assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = await response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) assert cast(Any, response.is_closed) is True @@ -4671,7 +4671,7 @@ async def test_method_update_overload_4(self, async_client: AsyncCloudflare) -> account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -4694,7 +4694,7 @@ async def test_method_update_with_all_params_overload_4(self, async_client: Asyn "user_deprovision": True, }, ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -4711,7 +4711,7 @@ async def test_raw_response_update_overload_4(self, async_client: AsyncCloudflar assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = await response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -4728,7 +4728,7 @@ async def test_streaming_response_update_overload_4(self, async_client: AsyncClo assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = await response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) assert cast(Any, response.is_closed) is True @@ -4776,7 +4776,7 @@ async def test_method_update_overload_5(self, async_client: AsyncCloudflare) -> account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -4801,7 +4801,7 @@ async def test_method_update_with_all_params_overload_5(self, async_client: Asyn "user_deprovision": True, }, ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -4818,7 +4818,7 @@ async def test_raw_response_update_overload_5(self, async_client: AsyncCloudflar assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = await response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -4835,7 +4835,7 @@ async def test_streaming_response_update_overload_5(self, async_client: AsyncClo assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = await response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) assert cast(Any, response.is_closed) is True @@ -4883,7 +4883,7 @@ async def test_method_update_overload_6(self, async_client: AsyncCloudflare) -> account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -4909,7 +4909,7 @@ async def test_method_update_with_all_params_overload_6(self, async_client: Asyn "user_deprovision": True, }, ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -4926,7 +4926,7 @@ async def test_raw_response_update_overload_6(self, async_client: AsyncCloudflar assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = await response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -4943,7 +4943,7 @@ async def test_streaming_response_update_overload_6(self, async_client: AsyncClo assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = await response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) assert cast(Any, response.is_closed) is True @@ -4991,7 +4991,7 @@ async def test_method_update_overload_7(self, async_client: AsyncCloudflare) -> account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -5014,7 +5014,7 @@ async def test_method_update_with_all_params_overload_7(self, async_client: Asyn "user_deprovision": True, }, ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -5031,7 +5031,7 @@ async def test_raw_response_update_overload_7(self, async_client: AsyncCloudflar assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = await response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -5048,7 +5048,7 @@ async def test_streaming_response_update_overload_7(self, async_client: AsyncClo assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = await response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) assert cast(Any, response.is_closed) is True @@ -5096,7 +5096,7 @@ async def test_method_update_overload_8(self, async_client: AsyncCloudflare) -> account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -5125,7 +5125,7 @@ async def test_method_update_with_all_params_overload_8(self, async_client: Asyn "user_deprovision": True, }, ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -5142,7 +5142,7 @@ async def test_raw_response_update_overload_8(self, async_client: AsyncCloudflar assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = await response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -5159,7 +5159,7 @@ async def test_streaming_response_update_overload_8(self, async_client: AsyncClo assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = await response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) assert cast(Any, response.is_closed) is True @@ -5207,7 +5207,7 @@ async def test_method_update_overload_9(self, async_client: AsyncCloudflare) -> account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -5234,7 +5234,7 @@ async def test_method_update_with_all_params_overload_9(self, async_client: Asyn "user_deprovision": True, }, ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -5251,7 +5251,7 @@ async def test_raw_response_update_overload_9(self, async_client: AsyncCloudflar assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = await response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -5268,7 +5268,7 @@ async def test_streaming_response_update_overload_9(self, async_client: AsyncClo assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = await response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) assert cast(Any, response.is_closed) is True @@ -5316,7 +5316,7 @@ async def test_method_update_overload_10(self, async_client: AsyncCloudflare) -> account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -5342,7 +5342,7 @@ async def test_method_update_with_all_params_overload_10(self, async_client: Asy "user_deprovision": True, }, ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -5359,7 +5359,7 @@ async def test_raw_response_update_overload_10(self, async_client: AsyncCloudfla assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = await response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -5376,7 +5376,7 @@ async def test_streaming_response_update_overload_10(self, async_client: AsyncCl assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = await response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) assert cast(Any, response.is_closed) is True @@ -5424,7 +5424,7 @@ async def test_method_update_overload_11(self, async_client: AsyncCloudflare) -> account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -5450,7 +5450,7 @@ async def test_method_update_with_all_params_overload_11(self, async_client: Asy "user_deprovision": True, }, ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -5467,7 +5467,7 @@ async def test_raw_response_update_overload_11(self, async_client: AsyncCloudfla assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = await response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -5484,7 +5484,7 @@ async def test_streaming_response_update_overload_11(self, async_client: AsyncCl assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = await response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) assert cast(Any, response.is_closed) is True @@ -5532,7 +5532,7 @@ async def test_method_update_overload_12(self, async_client: AsyncCloudflare) -> account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -5573,7 +5573,7 @@ async def test_method_update_with_all_params_overload_12(self, async_client: Asy "user_deprovision": True, }, ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -5590,7 +5590,7 @@ async def test_raw_response_update_overload_12(self, async_client: AsyncCloudfla assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = await response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -5607,7 +5607,7 @@ async def test_streaming_response_update_overload_12(self, async_client: AsyncCl assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = await response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) assert cast(Any, response.is_closed) is True @@ -5655,7 +5655,7 @@ async def test_method_update_overload_13(self, async_client: AsyncCloudflare) -> account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -5678,7 +5678,7 @@ async def test_method_update_with_all_params_overload_13(self, async_client: Asy "user_deprovision": True, }, ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -5695,7 +5695,7 @@ async def test_raw_response_update_overload_13(self, async_client: AsyncCloudfla assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = await response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -5712,7 +5712,7 @@ async def test_streaming_response_update_overload_13(self, async_client: AsyncCl assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = await response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) assert cast(Any, response.is_closed) is True @@ -5760,7 +5760,7 @@ async def test_method_update_overload_14(self, async_client: AsyncCloudflare) -> account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -5780,7 +5780,7 @@ async def test_method_update_with_all_params_overload_14(self, async_client: Asy "user_deprovision": True, }, ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -5797,7 +5797,7 @@ async def test_raw_response_update_overload_14(self, async_client: AsyncCloudfla assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = await response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -5814,7 +5814,7 @@ async def test_streaming_response_update_overload_14(self, async_client: AsyncCl assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = await response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) assert cast(Any, response.is_closed) is True @@ -5994,7 +5994,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -6004,7 +6004,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) - account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -6018,7 +6018,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = await response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize @@ -6032,7 +6032,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = await response.parse() - assert_matches_type(ZeroTrustIdentityProviders, identity_provider, path=["response"]) + assert_matches_type(IdentityProvider, identity_provider, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/test_organizations.py b/tests/api_resources/zero_trust/test_organizations.py index e0fee873f5f..62c7721a086 100644 --- a/tests/api_resources/zero_trust/test_organizations.py +++ b/tests/api_resources/zero_trust/test_organizations.py @@ -10,7 +10,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.types.zero_trust import ( - ZeroTrustOrganizations, + Organizations, OrganizationRevokeUsersResponse, ) @@ -29,7 +29,7 @@ def test_method_create(self, client: Cloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustOrganizations, organization, path=["response"]) + assert_matches_type(Organizations, organization, path=["response"]) @pytest.mark.skip() @parametrize @@ -54,7 +54,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: user_seat_expiration_inactive_time="720h", warp_auth_session_duration="24h", ) - assert_matches_type(ZeroTrustOrganizations, organization, path=["response"]) + assert_matches_type(Organizations, organization, path=["response"]) @pytest.mark.skip() @parametrize @@ -69,7 +69,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" organization = response.parse() - assert_matches_type(ZeroTrustOrganizations, organization, path=["response"]) + assert_matches_type(Organizations, organization, path=["response"]) @pytest.mark.skip() @parametrize @@ -84,7 +84,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" organization = response.parse() - assert_matches_type(ZeroTrustOrganizations, organization, path=["response"]) + assert_matches_type(Organizations, organization, path=["response"]) assert cast(Any, response.is_closed) is True @@ -114,7 +114,7 @@ def test_method_update(self, client: Cloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustOrganizations, organization, path=["response"]) + assert_matches_type(Organizations, organization, path=["response"]) @pytest.mark.skip() @parametrize @@ -143,7 +143,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: user_seat_expiration_inactive_time="720h", warp_auth_session_duration="24h", ) - assert_matches_type(ZeroTrustOrganizations, organization, path=["response"]) + assert_matches_type(Organizations, organization, path=["response"]) @pytest.mark.skip() @parametrize @@ -156,7 +156,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" organization = response.parse() - assert_matches_type(ZeroTrustOrganizations, organization, path=["response"]) + assert_matches_type(Organizations, organization, path=["response"]) @pytest.mark.skip() @parametrize @@ -169,7 +169,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" organization = response.parse() - assert_matches_type(ZeroTrustOrganizations, organization, path=["response"]) + assert_matches_type(Organizations, organization, path=["response"]) assert cast(Any, response.is_closed) is True @@ -195,7 +195,7 @@ def test_method_list(self, client: Cloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustOrganizations, organization, path=["response"]) + assert_matches_type(Organizations, organization, path=["response"]) @pytest.mark.skip() @parametrize @@ -204,7 +204,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustOrganizations, organization, path=["response"]) + assert_matches_type(Organizations, organization, path=["response"]) @pytest.mark.skip() @parametrize @@ -217,7 +217,7 @@ 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" organization = response.parse() - assert_matches_type(ZeroTrustOrganizations, organization, path=["response"]) + assert_matches_type(Organizations, organization, path=["response"]) @pytest.mark.skip() @parametrize @@ -230,7 +230,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" organization = response.parse() - assert_matches_type(ZeroTrustOrganizations, organization, path=["response"]) + assert_matches_type(Organizations, organization, path=["response"]) assert cast(Any, response.is_closed) is True @@ -329,7 +329,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustOrganizations, organization, path=["response"]) + assert_matches_type(Organizations, organization, path=["response"]) @pytest.mark.skip() @parametrize @@ -354,7 +354,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare user_seat_expiration_inactive_time="720h", warp_auth_session_duration="24h", ) - assert_matches_type(ZeroTrustOrganizations, organization, path=["response"]) + assert_matches_type(Organizations, organization, path=["response"]) @pytest.mark.skip() @parametrize @@ -369,7 +369,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" organization = await response.parse() - assert_matches_type(ZeroTrustOrganizations, organization, path=["response"]) + assert_matches_type(Organizations, organization, path=["response"]) @pytest.mark.skip() @parametrize @@ -384,7 +384,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" organization = await response.parse() - assert_matches_type(ZeroTrustOrganizations, organization, path=["response"]) + assert_matches_type(Organizations, organization, path=["response"]) assert cast(Any, response.is_closed) is True @@ -414,7 +414,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustOrganizations, organization, path=["response"]) + assert_matches_type(Organizations, organization, path=["response"]) @pytest.mark.skip() @parametrize @@ -443,7 +443,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare user_seat_expiration_inactive_time="720h", warp_auth_session_duration="24h", ) - assert_matches_type(ZeroTrustOrganizations, organization, path=["response"]) + assert_matches_type(Organizations, organization, path=["response"]) @pytest.mark.skip() @parametrize @@ -456,7 +456,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" organization = await response.parse() - assert_matches_type(ZeroTrustOrganizations, organization, path=["response"]) + assert_matches_type(Organizations, organization, path=["response"]) @pytest.mark.skip() @parametrize @@ -469,7 +469,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" organization = await response.parse() - assert_matches_type(ZeroTrustOrganizations, organization, path=["response"]) + assert_matches_type(Organizations, organization, path=["response"]) assert cast(Any, response.is_closed) is True @@ -495,7 +495,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustOrganizations, organization, path=["response"]) + assert_matches_type(Organizations, organization, path=["response"]) @pytest.mark.skip() @parametrize @@ -504,7 +504,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) account_id="string", zone_id="string", ) - assert_matches_type(ZeroTrustOrganizations, organization, path=["response"]) + assert_matches_type(Organizations, organization, path=["response"]) @pytest.mark.skip() @parametrize @@ -517,7 +517,7 @@ 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" organization = await response.parse() - assert_matches_type(ZeroTrustOrganizations, organization, path=["response"]) + assert_matches_type(Organizations, organization, path=["response"]) @pytest.mark.skip() @parametrize @@ -530,7 +530,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" organization = await response.parse() - assert_matches_type(ZeroTrustOrganizations, organization, path=["response"]) + assert_matches_type(Organizations, organization, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/tunnels/test_connectors.py b/tests/api_resources/zero_trust/tunnels/test_connectors.py index fda4d0fd22a..6c9843d9e52 100644 --- a/tests/api_resources/zero_trust/tunnels/test_connectors.py +++ b/tests/api_resources/zero_trust/tunnels/test_connectors.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.zero_trust.tunnels import TunnelTunnelClient +from cloudflare.types.zero_trust.tunnels import Client base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -25,7 +25,7 @@ def test_method_get(self, client: Cloudflare) -> None: account_id="699d98642c564d2e855e9661899b7252", tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", ) - assert_matches_type(TunnelTunnelClient, connector, path=["response"]) + assert_matches_type(Client, connector, path=["response"]) @pytest.mark.skip() @parametrize @@ -39,7 +39,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" connector = response.parse() - assert_matches_type(TunnelTunnelClient, connector, path=["response"]) + assert_matches_type(Client, connector, path=["response"]) @pytest.mark.skip() @parametrize @@ -53,7 +53,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" connector = response.parse() - assert_matches_type(TunnelTunnelClient, connector, path=["response"]) + assert_matches_type(Client, connector, path=["response"]) assert cast(Any, response.is_closed) is True @@ -93,7 +93,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: account_id="699d98642c564d2e855e9661899b7252", tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", ) - assert_matches_type(TunnelTunnelClient, connector, path=["response"]) + assert_matches_type(Client, connector, path=["response"]) @pytest.mark.skip() @parametrize @@ -107,7 +107,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" connector = await response.parse() - assert_matches_type(TunnelTunnelClient, connector, path=["response"]) + assert_matches_type(Client, connector, path=["response"]) @pytest.mark.skip() @parametrize @@ -121,7 +121,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" connector = await response.parse() - assert_matches_type(TunnelTunnelClient, connector, path=["response"]) + assert_matches_type(Client, connector, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zones/test_holds.py b/tests/api_resources/zones/test_holds.py index ea9413b1700..5c9c3e04182 100644 --- a/tests/api_resources/zones/test_holds.py +++ b/tests/api_resources/zones/test_holds.py @@ -9,9 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.zones import ( - UnnamedSchemaRef45004a9444b6da9f88158ed2fb9a5820, -) +from cloudflare.types.zones import ZoneHold base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -25,7 +23,7 @@ def test_method_create(self, client: Cloudflare) -> None: hold = client.zones.holds.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(UnnamedSchemaRef45004a9444b6da9f88158ed2fb9a5820, hold, path=["response"]) + assert_matches_type(ZoneHold, hold, path=["response"]) @pytest.mark.skip() @parametrize @@ -34,7 +32,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", include_subdomains=True, ) - assert_matches_type(UnnamedSchemaRef45004a9444b6da9f88158ed2fb9a5820, hold, path=["response"]) + assert_matches_type(ZoneHold, hold, path=["response"]) @pytest.mark.skip() @parametrize @@ -46,7 +44,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" hold = response.parse() - assert_matches_type(UnnamedSchemaRef45004a9444b6da9f88158ed2fb9a5820, hold, path=["response"]) + assert_matches_type(ZoneHold, hold, path=["response"]) @pytest.mark.skip() @parametrize @@ -58,7 +56,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" hold = response.parse() - assert_matches_type(UnnamedSchemaRef45004a9444b6da9f88158ed2fb9a5820, hold, path=["response"]) + assert_matches_type(ZoneHold, hold, path=["response"]) assert cast(Any, response.is_closed) is True @@ -76,7 +74,7 @@ def test_method_delete(self, client: Cloudflare) -> None: hold = client.zones.holds.delete( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[UnnamedSchemaRef45004a9444b6da9f88158ed2fb9a5820], hold, path=["response"]) + assert_matches_type(Optional[ZoneHold], hold, path=["response"]) @pytest.mark.skip() @parametrize @@ -85,7 +83,7 @@ def test_method_delete_with_all_params(self, client: Cloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", hold_after="string", ) - assert_matches_type(Optional[UnnamedSchemaRef45004a9444b6da9f88158ed2fb9a5820], hold, path=["response"]) + assert_matches_type(Optional[ZoneHold], hold, path=["response"]) @pytest.mark.skip() @parametrize @@ -97,7 +95,7 @@ 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" hold = response.parse() - assert_matches_type(Optional[UnnamedSchemaRef45004a9444b6da9f88158ed2fb9a5820], hold, path=["response"]) + assert_matches_type(Optional[ZoneHold], hold, path=["response"]) @pytest.mark.skip() @parametrize @@ -109,7 +107,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" hold = response.parse() - assert_matches_type(Optional[UnnamedSchemaRef45004a9444b6da9f88158ed2fb9a5820], hold, path=["response"]) + assert_matches_type(Optional[ZoneHold], hold, path=["response"]) assert cast(Any, response.is_closed) is True @@ -127,7 +125,7 @@ def test_method_get(self, client: Cloudflare) -> None: hold = client.zones.holds.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(UnnamedSchemaRef45004a9444b6da9f88158ed2fb9a5820, hold, path=["response"]) + assert_matches_type(ZoneHold, hold, path=["response"]) @pytest.mark.skip() @parametrize @@ -139,7 +137,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" hold = response.parse() - assert_matches_type(UnnamedSchemaRef45004a9444b6da9f88158ed2fb9a5820, hold, path=["response"]) + assert_matches_type(ZoneHold, hold, path=["response"]) @pytest.mark.skip() @parametrize @@ -151,7 +149,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" hold = response.parse() - assert_matches_type(UnnamedSchemaRef45004a9444b6da9f88158ed2fb9a5820, hold, path=["response"]) + assert_matches_type(ZoneHold, hold, path=["response"]) assert cast(Any, response.is_closed) is True @@ -173,7 +171,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: hold = await async_client.zones.holds.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(UnnamedSchemaRef45004a9444b6da9f88158ed2fb9a5820, hold, path=["response"]) + assert_matches_type(ZoneHold, hold, path=["response"]) @pytest.mark.skip() @parametrize @@ -182,7 +180,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare zone_id="023e105f4ecef8ad9ca31a8372d0c353", include_subdomains=True, ) - assert_matches_type(UnnamedSchemaRef45004a9444b6da9f88158ed2fb9a5820, hold, path=["response"]) + assert_matches_type(ZoneHold, hold, path=["response"]) @pytest.mark.skip() @parametrize @@ -194,7 +192,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" hold = await response.parse() - assert_matches_type(UnnamedSchemaRef45004a9444b6da9f88158ed2fb9a5820, hold, path=["response"]) + assert_matches_type(ZoneHold, hold, path=["response"]) @pytest.mark.skip() @parametrize @@ -206,7 +204,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" hold = await response.parse() - assert_matches_type(UnnamedSchemaRef45004a9444b6da9f88158ed2fb9a5820, hold, path=["response"]) + assert_matches_type(ZoneHold, hold, path=["response"]) assert cast(Any, response.is_closed) is True @@ -224,7 +222,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: hold = await async_client.zones.holds.delete( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[UnnamedSchemaRef45004a9444b6da9f88158ed2fb9a5820], hold, path=["response"]) + assert_matches_type(Optional[ZoneHold], hold, path=["response"]) @pytest.mark.skip() @parametrize @@ -233,7 +231,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncCloudflare zone_id="023e105f4ecef8ad9ca31a8372d0c353", hold_after="string", ) - assert_matches_type(Optional[UnnamedSchemaRef45004a9444b6da9f88158ed2fb9a5820], hold, path=["response"]) + assert_matches_type(Optional[ZoneHold], hold, path=["response"]) @pytest.mark.skip() @parametrize @@ -245,7 +243,7 @@ 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" hold = await response.parse() - assert_matches_type(Optional[UnnamedSchemaRef45004a9444b6da9f88158ed2fb9a5820], hold, path=["response"]) + assert_matches_type(Optional[ZoneHold], hold, path=["response"]) @pytest.mark.skip() @parametrize @@ -257,7 +255,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" hold = await response.parse() - assert_matches_type(Optional[UnnamedSchemaRef45004a9444b6da9f88158ed2fb9a5820], hold, path=["response"]) + assert_matches_type(Optional[ZoneHold], hold, path=["response"]) assert cast(Any, response.is_closed) is True @@ -275,7 +273,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: hold = await async_client.zones.holds.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(UnnamedSchemaRef45004a9444b6da9f88158ed2fb9a5820, hold, path=["response"]) + assert_matches_type(ZoneHold, hold, path=["response"]) @pytest.mark.skip() @parametrize @@ -287,7 +285,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" hold = await response.parse() - assert_matches_type(UnnamedSchemaRef45004a9444b6da9f88158ed2fb9a5820, hold, path=["response"]) + assert_matches_type(ZoneHold, hold, path=["response"]) @pytest.mark.skip() @parametrize @@ -299,7 +297,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" hold = await response.parse() - assert_matches_type(UnnamedSchemaRef45004a9444b6da9f88158ed2fb9a5820, hold, path=["response"]) + assert_matches_type(ZoneHold, hold, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zones/test_subscriptions.py b/tests/api_resources/zones/test_subscriptions.py index 08b41d427a2..babfccc8c28 100644 --- a/tests/api_resources/zones/test_subscriptions.py +++ b/tests/api_resources/zones/test_subscriptions.py @@ -10,7 +10,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.pagination import SyncSinglePage, AsyncSinglePage -from cloudflare.types.zones import SubscriptionListResponse +from cloudflare.types.user import Subscription from cloudflare.types.shared import UnnamedSchemaRef9444735ca60712dbcf8afd832eb5716a base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -107,7 +107,7 @@ def test_method_list(self, client: Cloudflare) -> None: subscription = client.zones.subscriptions.list( "023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncSinglePage[SubscriptionListResponse], subscription, path=["response"]) + assert_matches_type(SyncSinglePage[Subscription], subscription, path=["response"]) @pytest.mark.skip() @parametrize @@ -119,7 +119,7 @@ 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" subscription = response.parse() - assert_matches_type(SyncSinglePage[SubscriptionListResponse], subscription, path=["response"]) + assert_matches_type(SyncSinglePage[Subscription], subscription, path=["response"]) @pytest.mark.skip() @parametrize @@ -131,7 +131,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(SyncSinglePage[SubscriptionListResponse], subscription, path=["response"]) + assert_matches_type(SyncSinglePage[Subscription], subscription, path=["response"]) assert cast(Any, response.is_closed) is True @@ -277,7 +277,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: subscription = await async_client.zones.subscriptions.list( "023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncSinglePage[SubscriptionListResponse], subscription, path=["response"]) + assert_matches_type(AsyncSinglePage[Subscription], subscription, path=["response"]) @pytest.mark.skip() @parametrize @@ -289,7 +289,7 @@ 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" subscription = await response.parse() - assert_matches_type(AsyncSinglePage[SubscriptionListResponse], subscription, path=["response"]) + assert_matches_type(AsyncSinglePage[Subscription], subscription, path=["response"]) @pytest.mark.skip() @parametrize @@ -301,7 +301,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = await response.parse() - assert_matches_type(AsyncSinglePage[SubscriptionListResponse], subscription, path=["response"]) + assert_matches_type(AsyncSinglePage[Subscription], subscription, path=["response"]) assert cast(Any, response.is_closed) is True