From d6c32f08277e0fef9c5f1f7826fac87b10091f0c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 20 Feb 2024 23:16:18 +0000 Subject: [PATCH] feat: update via SDK Studio (#45) --- .stats.yml | 2 +- README.md | 2 +- api.md | 923 ++-- src/index.ts | 122 +- src/resources/access/access.ts | 42 +- .../access/applications/applications.ts | 156 +- src/resources/access/applications/index.ts | 8 +- src/resources/access/applications/policies.ts | 3848 ++++++------- src/resources/access/bookmarks.ts | 88 +- .../access/certificates/certificates.ts | 98 +- src/resources/access/certificates/index.ts | 6 +- src/resources/access/certificates/settings.ts | 52 +- src/resources/access/custom-pages.ts | 88 +- src/resources/access/groups.ts | 4792 ++++++++--------- src/resources/access/identity-providers.ts | 410 +- src/resources/access/index.ts | 38 +- src/resources/access/keys.ts | 34 +- src/resources/access/organizations.ts | 58 +- src/resources/access/seats.ts | 22 +- src/resources/access/service-tokens.ts | 100 +- src/resources/access/tags.ts | 74 +- src/resources/account-members.ts | 202 +- src/resources/accounts.ts | 58 +- src/resources/activation-checks.ts | 8 +- .../addresses/address-maps/accounts.ts | 26 +- .../addresses/address-maps/address-maps.ts | 134 +- src/resources/addresses/address-maps/index.ts | 10 +- src/resources/addresses/address-maps/ips.ts | 26 +- src/resources/addresses/address-maps/zones.ts | 26 +- src/resources/addresses/addresses.ts | 8 +- src/resources/addresses/index.ts | 8 +- src/resources/addresses/prefixes/bgps/bgps.ts | 4 +- .../addresses/prefixes/bgps/index.ts | 2 +- .../addresses/prefixes/bgps/statuses.ts | 16 +- src/resources/addresses/prefixes/index.ts | 4 +- src/resources/addresses/prefixes/prefixes.ts | 170 +- .../addressing/prefixes/bgp-prefixes.ts | 182 +- src/resources/addressing/prefixes/index.ts | 4 +- src/resources/addressing/prefixes/prefixes.ts | 4 +- .../alerting/v3/destinations/destinations.ts | 4 +- .../alerting/v3/destinations/index.ts | 4 +- .../alerting/v3/destinations/webhooks.ts | 50 +- src/resources/alerting/v3/index.ts | 4 +- src/resources/alerting/v3/policies.ts | 56 +- src/resources/alerting/v3/v3.ts | 4 +- src/resources/argo/argo.ts | 8 +- src/resources/argo/index.ts | 8 +- src/resources/argo/smart-routing.ts | 16 +- src/resources/argo/tiered-caching.ts | 16 +- src/resources/bot-management.ts | 70 +- src/resources/cache/cache-reserves.ts | 30 +- src/resources/cache/cache.ts | 100 +- src/resources/cache/index.ts | 18 +- src/resources/cache/regional-tiered-cache.ts | 20 +- .../cache/tiered-cache-smart-topology.ts | 40 +- src/resources/cache/variants.ts | 86 +- src/resources/calls.ts | 84 +- .../certificate-authorities.ts | 4 +- .../hostname-associations.ts | 54 +- .../certificate-authorities/index.ts | 4 +- src/resources/challenges/challenges.ts | 4 +- src/resources/challenges/index.ts | 4 +- src/resources/challenges/widgets.ts | 86 +- src/resources/client-certificates.ts | 54 +- .../custom-certificates.ts | 70 +- src/resources/custom-certificates/index.ts | 6 +- .../custom-certificates/prioritize.ts | 30 +- .../custom-hostnames/custom-hostnames.ts | 142 +- .../custom-hostnames/fallback-origin.ts | 42 +- src/resources/custom-hostnames/index.ts | 8 +- src/resources/devices/devices.ts | 20 +- src/resources/devices/dex-tests.ts | 144 +- src/resources/devices/index.ts | 18 +- src/resources/devices/networks.ts | 130 +- src/resources/devices/policies/excludes.ts | 50 +- .../devices/policies/fallback-domains.ts | 60 +- src/resources/devices/policies/includes.ts | 50 +- src/resources/devices/policies/index.ts | 12 +- src/resources/devices/policies/policies.ts | 60 +- src/resources/devices/postures/index.ts | 8 +- .../devices/postures/integrations.ts | 62 +- src/resources/devices/postures/postures.ts | 1460 ++--- src/resources/devices/settings.ts | 34 +- src/resources/dispatchers/dispatchers.ts | 4 +- src/resources/dispatchers/index.ts | 4 +- src/resources/dispatchers/scripts.ts | 194 +- src/resources/dlp/datasets/datasets.ts | 104 +- src/resources/dlp/datasets/index.ts | 6 +- src/resources/dlp/datasets/upload.ts | 20 +- src/resources/dlp/dlp.ts | 8 +- src/resources/dlp/index.ts | 8 +- src/resources/dlp/payload-logs.ts | 34 +- src/resources/dlp/profiles/customs.ts | 52 +- src/resources/dlp/profiles/index.ts | 8 +- src/resources/dlp/profiles/predefineds.ts | 52 +- src/resources/dlp/profiles/profiles.ts | 8 +- src/resources/dns-firewall/dns-firewall.ts | 74 +- src/resources/dns-firewall/index.ts | 4 +- src/resources/dns-records.ts | 734 +-- src/resources/dnssec.ts | 36 +- src/resources/emails/routing/index.ts | 4 +- src/resources/emails/routing/routing.ts | 4 +- .../emails/routing/rules/catch-alls.ts | 58 +- src/resources/emails/routing/rules/index.ts | 6 +- src/resources/emails/routing/rules/rules.ts | 96 +- src/resources/filters.ts | 76 +- src/resources/firewall/waf/packages/groups.ts | 68 +- src/resources/firewall/waf/packages/index.ts | 6 +- .../firewall/waf/packages/packages.ts | 8 +- src/resources/firewall/waf/packages/rules.ts | 24 +- src/resources/firewalls/access-rules.ts | 200 +- src/resources/firewalls/firewalls.ts | 16 +- src/resources/firewalls/index.ts | 16 +- src/resources/firewalls/lockdowns.ts | 80 +- src/resources/firewalls/rules.ts | 260 +- src/resources/firewalls/ua-rules.ts | 46 +- src/resources/firewalls/waf/index.ts | 4 +- src/resources/firewalls/waf/overrides.ts | 154 +- .../firewalls/waf/packages/groups.ts | 68 +- src/resources/firewalls/waf/packages/index.ts | 8 +- .../firewalls/waf/packages/packages.ts | 8 +- src/resources/firewalls/waf/packages/rules.ts | 24 +- src/resources/firewalls/waf/waf.ts | 4 +- src/resources/gateways/audit-ssh-settings.ts | 40 +- src/resources/gateways/configurations.ts | 62 +- src/resources/gateways/gateways.ts | 28 +- src/resources/gateways/index.ts | 26 +- src/resources/gateways/lists/index.ts | 4 +- src/resources/gateways/lists/lists.ts | 102 +- src/resources/gateways/locations.ts | 142 +- src/resources/gateways/loggings.ts | 46 +- src/resources/gateways/proxy-endpoints.ts | 86 +- src/resources/gateways/rules.ts | 1470 ++--- src/resources/healthchecks/healthchecks.ts | 396 +- src/resources/healthchecks/index.ts | 4 +- src/resources/hostnames/settings/index.ts | 2 +- src/resources/hostnames/settings/settings.ts | 4 +- src/resources/hostnames/settings/tls.ts | 90 +- src/resources/hyperdrive/configs.ts | 54 +- src/resources/hyperdrive/hyperdrive.ts | 4 +- src/resources/hyperdrive/index.ts | 4 +- src/resources/images/images.ts | 4 +- src/resources/images/index.ts | 4 +- src/resources/images/v1s/index.ts | 8 +- src/resources/images/v1s/v1s.ts | 118 +- src/resources/images/v1s/variants.ts | 142 +- src/resources/index.ts | 132 +- src/resources/intel/index.ts | 4 +- src/resources/intel/indicator-feeds/index.ts | 4 +- .../intel/indicator-feeds/indicator-feeds.ts | 74 +- src/resources/intel/intel.ts | 4 +- src/resources/keyless-certificates.ts | 188 +- src/resources/load-balancers/index.ts | 12 +- .../load-balancers/load-balancers.ts | 2402 ++++----- .../load-balancers/monitors/index.ts | 4 +- .../load-balancers/monitors/monitors.ts | 250 +- src/resources/load-balancers/pools/index.ts | 4 +- src/resources/load-balancers/pools/pools.ts | 968 ++-- src/resources/logpush/index.ts | 4 +- src/resources/logpush/jobs.ts | 352 +- src/resources/logpush/logpush.ts | 4 +- src/resources/magics/cf-interconnects.ts | 60 +- src/resources/magics/gre-tunnels.ts | 58 +- src/resources/magics/index.ts | 16 +- src/resources/magics/ipsec-tunnels/index.ts | 4 +- .../magics/ipsec-tunnels/ipsec-tunnels.ts | 56 +- src/resources/magics/magics.ts | 16 +- src/resources/magics/routes.ts | 58 +- src/resources/managed-headers.ts | 68 +- src/resources/memberships.ts | 50 +- src/resources/mnms/configs/configs.ts | 18 +- src/resources/mnms/configs/index.ts | 2 +- src/resources/mnms/index.ts | 4 +- src/resources/mnms/mnms.ts | 4 +- src/resources/mnms/rules/advertisements.ts | 10 +- src/resources/mnms/rules/index.ts | 4 +- src/resources/mnms/rules/rules.ts | 42 +- .../origin-post-quantum-encryption.ts | 34 +- .../hostnames/hostnames.ts | 118 +- .../origin-tls-client-auth/hostnames/index.ts | 2 +- src/resources/origin-tls-client-auth/index.ts | 6 +- .../origin-tls-client-auth.ts | 8 +- .../origin-tls-client-auth/settings.ts | 42 +- src/resources/page-shield/index.ts | 8 +- src/resources/page-shield/page-shield.ts | 38 +- src/resources/page-shield/policies.ts | 92 +- src/resources/pagerules/index.ts | 4 +- src/resources/pagerules/pagerules.ts | 96 +- src/resources/pages/index.ts | 4 +- src/resources/pages/pages.ts | 4 +- src/resources/pages/projects/domains.ts | 40 +- src/resources/pages/projects/index.ts | 6 +- src/resources/pages/projects/projects.ts | 48 +- src/resources/rate-limits.ts | 46 +- src/resources/registrar/domains.ts | 44 +- src/resources/registrar/index.ts | 4 +- src/resources/registrar/registrar.ts | 4 +- src/resources/request-tracers/index.ts | 2 +- .../request-tracers/request-tracers.ts | 1 + src/resources/request-tracers/traces.ts | 83 +- src/resources/rules/index.ts | 4 +- src/resources/rules/lists/index.ts | 8 +- src/resources/rules/lists/items.ts | 134 +- src/resources/rules/lists/lists.ts | 48 +- src/resources/rules/rules.ts | 4 +- src/resources/rulesets/index.ts | 8 +- src/resources/rulesets/rules.ts | 90 +- src/resources/rulesets/rulesets.ts | 220 +- src/resources/rum/index.ts | 8 +- src/resources/rum/rules.ts | 100 +- src/resources/rum/rum.ts | 8 +- src/resources/rum/site-infos.ts | 92 +- src/resources/secondary-dns/acls.ts | 72 +- src/resources/secondary-dns/incoming.ts | 48 +- src/resources/secondary-dns/index.ts | 20 +- src/resources/secondary-dns/outgoing/index.ts | 4 +- .../secondary-dns/outgoing/outgoing.ts | 80 +- src/resources/secondary-dns/peers.ts | 106 +- src/resources/secondary-dns/secondary-dns.ts | 20 +- src/resources/secondary-dns/tsigs.ts | 74 +- src/resources/settings/always-online.ts | 16 +- src/resources/settings/always-use-https.ts | 16 +- .../settings/automatic-https-rewrites.ts | 16 +- .../automatic-platform-optimization.ts | 20 +- src/resources/settings/brotli.ts | 16 +- src/resources/settings/browser-cache-ttl.ts | 16 +- src/resources/settings/browser-check.ts | 16 +- src/resources/settings/cache-level.ts | 16 +- src/resources/settings/challenge-ttl.ts | 16 +- src/resources/settings/ciphers.ts | 16 +- src/resources/settings/development-mode.ts | 16 +- src/resources/settings/early-hints.ts | 16 +- src/resources/settings/email-obfuscation.ts | 16 +- src/resources/settings/font-settings.ts | 16 +- src/resources/settings/h2-prioritization.ts | 20 +- src/resources/settings/hotlink-protection.ts | 16 +- src/resources/settings/http2.ts | 16 +- src/resources/settings/http3.ts | 16 +- src/resources/settings/image-resizing.ts | 20 +- src/resources/settings/index.ts | 173 +- src/resources/settings/ip-geolocation.ts | 16 +- src/resources/settings/ipv6.ts | 16 +- src/resources/settings/min-tls-version.ts | 16 +- src/resources/settings/minify.ts | 24 +- src/resources/settings/mirage.ts | 16 +- src/resources/settings/mobile-redirect.ts | 24 +- src/resources/settings/nel.ts | 24 +- .../settings/opportunistic-encryption.ts | 16 +- src/resources/settings/opportunistic-onion.ts | 16 +- src/resources/settings/orange-to-orange.ts | 20 +- .../settings/origin-error-page-pass-thru.ts | 16 +- .../settings/origin-max-http-version.ts | 16 +- src/resources/settings/polish.ts | 20 +- src/resources/settings/prefetch-preload.ts | 16 +- src/resources/settings/proxy-read-timeout.ts | 20 +- src/resources/settings/pseudo-ipv4.ts | 16 +- src/resources/settings/response-buffering.ts | 16 +- src/resources/settings/rocket-loader.ts | 20 +- src/resources/settings/security-headers.ts | 24 +- src/resources/settings/security-level.ts | 16 +- .../settings/server-side-excludes.ts | 16 +- src/resources/settings/settings.ts | 200 +- .../settings/sort-query-string-for-cache.ts | 16 +- src/resources/settings/ssl-recommender.ts | 20 +- src/resources/settings/ssl.ts | 16 +- src/resources/settings/tls-1-3.ts | 16 +- src/resources/settings/tls-client-auth.ts | 16 +- .../settings/true-client-ip-header.ts | 16 +- src/resources/settings/waf.ts | 16 +- src/resources/settings/webp.ts | 16 +- src/resources/settings/websocket.ts | 16 +- src/resources/settings/zero-rtt.ts | 16 +- src/resources/snippets/index.ts | 16 +- src/resources/snippets/snippet-rules.ts | 62 +- src/resources/snippets/snippets.ts | 110 +- src/resources/spectrum/apps.ts | 104 +- src/resources/spectrum/index.ts | 4 +- src/resources/spectrum/spectrum.ts | 4 +- .../certificate-packs/certificate-packs.ts | 58 +- src/resources/ssl/certificate-packs/index.ts | 2 +- src/resources/ssl/index.ts | 6 +- src/resources/ssl/ssl.ts | 6 +- src/resources/ssl/universal/index.ts | 2 +- src/resources/ssl/universal/settings.ts | 16 +- src/resources/ssl/universal/universal.ts | 4 +- src/resources/ssl/verification.ts | 66 +- src/resources/storage/kv/index.ts | 4 +- src/resources/storage/kv/kv.ts | 4 +- src/resources/storage/kv/namespaces/bulk.ts | 52 +- src/resources/storage/kv/namespaces/index.ts | 10 +- .../storage/kv/namespaces/namespaces.ts | 64 +- src/resources/storage/kv/namespaces/values.ts | 56 +- src/resources/stream/audio-tracks.ts | 88 +- src/resources/stream/captions.ts | 48 +- src/resources/stream/index.ts | 16 +- src/resources/stream/live-inputs/index.ts | 8 +- .../stream/live-inputs/live-inputs.ts | 196 +- src/resources/stream/live-inputs/outputs.ts | 90 +- src/resources/stream/stream.ts | 16 +- src/resources/stream/webhooks.ts | 40 +- src/resources/subscriptions.ts | 54 +- src/resources/teamnet/index.ts | 4 +- src/resources/teamnet/routes.ts | 40 +- src/resources/teamnet/teamnet.ts | 4 +- src/resources/teamnets/index.ts | 4 +- src/resources/teamnets/teamnets.ts | 4 +- src/resources/teamnets/virtual-networks.ts | 74 +- src/resources/tunnels/configurations.ts | 44 +- src/resources/tunnels/index.ts | 8 +- src/resources/tunnels/tunnels.ts | 184 +- src/resources/url-normalizations.ts | 30 +- .../firewall/access-rules/access-rules.ts | 4 +- .../users/firewall/access-rules/index.ts | 4 +- .../users/firewall/access-rules/rules.ts | 104 +- src/resources/users/index.ts | 14 +- src/resources/users/invites.ts | 34 +- src/resources/users/load-balancers/index.ts | 8 +- .../users/load-balancers/load-balancers.ts | 8 +- .../users/load-balancers/monitors/index.ts | 4 +- .../users/load-balancers/monitors/monitors.ts | 248 +- .../users/load-balancers/pools/index.ts | 4 +- .../users/load-balancers/pools/pools.ts | 964 ++-- src/resources/users/subscriptions.ts | 50 +- src/resources/users/tokens/index.ts | 6 +- src/resources/users/tokens/tokens.ts | 64 +- src/resources/users/tokens/values.ts | 16 +- src/resources/users/users.ts | 40 +- src/resources/vectorize/index.ts | 4 +- src/resources/vectorize/indexes.ts | 122 +- src/resources/vectorize/vectorize.ts | 4 +- src/resources/waiting-rooms/events/events.ts | 222 +- src/resources/waiting-rooms/events/index.ts | 4 +- src/resources/waiting-rooms/index.ts | 16 +- src/resources/waiting-rooms/rules.ts | 88 +- src/resources/waiting-rooms/settings.ts | 16 +- src/resources/waiting-rooms/waiting-rooms.ts | 1298 ++--- src/resources/warp-connector.ts | 88 +- src/resources/web3/hostnames/hostnames.ts | 112 +- src/resources/web3/hostnames/index.ts | 4 +- .../content-lists/content-lists.ts | 44 +- .../content-lists/entries.ts | 96 +- .../content-lists/index.ts | 8 +- .../hostnames/ipfs-universal-paths/index.ts | 4 +- .../ipfs-universal-paths.ts | 4 +- src/resources/web3/index.ts | 4 +- src/resources/web3/web3.ts | 4 +- src/resources/worker-scripts/content.ts | 24 +- src/resources/worker-scripts/index.ts | 4 +- src/resources/worker-scripts/settings.ts | 46 +- .../worker-scripts/worker-scripts.ts | 8 +- .../dispatch/namespaces/scripts/content.ts | 56 +- .../dispatch/namespaces/scripts/index.ts | 4 +- .../dispatch/namespaces/scripts/scripts.ts | 8 +- .../dispatch/namespaces/scripts/settings.ts | 50 +- src/resources/workers/account-settings.ts | 40 +- src/resources/workers/domains.ts | 102 +- src/resources/workers/filters.ts | 58 +- src/resources/workers/index.ts | 28 +- src/resources/workers/queues/consumers.ts | 90 +- src/resources/workers/queues/index.ts | 8 +- src/resources/workers/queues/queues.ts | 64 +- src/resources/workers/routes.ts | 66 +- src/resources/workers/scripts/index.ts | 10 +- src/resources/workers/scripts/schedules.ts | 48 +- src/resources/workers/scripts/scripts.ts | 202 +- src/resources/workers/scripts/usage-model.ts | 42 +- .../workers/services/environments/content.ts | 54 +- .../services/environments/environments.ts | 8 +- .../workers/services/environments/index.ts | 4 +- .../workers/services/environments/settings.ts | 50 +- src/resources/workers/subdomains.ts | 34 +- src/resources/workers/workers.ts | 28 +- src/resources/zaraz/config.ts | 78 +- src/resources/zaraz/history/history.ts | 114 +- src/resources/zaraz/history/index.ts | 4 +- src/resources/zaraz/index.ts | 8 +- src/resources/zaraz/zaraz.ts | 24 +- .../zerotrust/connectivity-settings.ts | 16 +- src/resources/zerotrust/index.ts | 4 +- src/resources/zerotrust/zerotrust.ts | 4 +- src/resources/zones/index.ts | 4 +- src/resources/zones/zones.ts | 142 +- .../access/applications/applications.test.ts | 134 +- .../access/applications/policies.test.ts | 146 +- tests/api-resources/access/bookmarks.test.ts | 30 +- .../access/certificates/certificates.test.ts | 60 +- .../access/certificates/settings.test.ts | 52 +- .../api-resources/access/custom-pages.test.ts | 68 +- tests/api-resources/access/groups.test.ts | 104 +- .../access/identity-providers.test.ts | 92 +- tests/api-resources/access/keys.test.ts | 30 +- .../access/organizations.test.ts | 30 +- tests/api-resources/access/seats.test.ts | 8 +- .../access/service-tokens.test.ts | 34 +- tests/api-resources/access/tags.test.ts | 42 +- tests/api-resources/account-members.test.ts | 58 +- tests/api-resources/accounts.test.ts | 54 +- tests/api-resources/activation-checks.test.ts | 8 +- .../addresses/address-maps/accounts.test.ts | 8 +- .../address-maps/address-maps.test.ts | 32 +- .../addresses/address-maps/ips.test.ts | 8 +- .../addresses/address-maps/zones.test.ts | 8 +- .../addresses/prefixes/bgps/statuses.test.ts | 8 +- .../addresses/prefixes/prefixes.test.ts | 50 +- .../addressing/prefixes/bgp-prefixes.test.ts | 34 +- .../alerting/v3/destinations/webhooks.test.ts | 58 +- .../alerting/v3/policies.test.ts | 32 +- .../api-resources/argo/smart-routing.test.ts | 8 +- .../api-resources/argo/tiered-caching.test.ts | 8 +- tests/api-resources/bot-management.test.ts | 24 +- .../cache/cache-reserves.test.ts | 34 +- tests/api-resources/cache/cache.test.ts | 26 + .../cache/regional-tiered-cache.test.ts | 8 +- .../cache/tiered-cache-smart-topology.test.ts | 24 +- tests/api-resources/cache/variants.test.ts | 64 +- tests/api-resources/calls.test.ts | 32 +- .../hostname-associations.test.ts | 30 +- .../api-resources/challenges/widgets.test.ts | 72 +- .../api-resources/client-certificates.test.ts | 54 +- .../custom-certificates.test.ts | 32 +- .../custom-certificates/prioritize.test.ts | 8 +- .../custom-hostnames/custom-hostnames.test.ts | 32 +- .../custom-hostnames/fallback-origin.test.ts | 46 +- tests/api-resources/devices/dex-tests.test.ts | 62 +- tests/api-resources/devices/networks.test.ts | 32 +- .../devices/policies/excludes.test.ts | 52 +- .../devices/policies/fallback-domains.test.ts | 62 +- .../devices/policies/includes.test.ts | 52 +- .../devices/policies/policies.test.ts | 32 +- .../devices/postures/integrations.test.ts | 10 +- .../devices/postures/postures.test.ts | 78 +- tests/api-resources/devices/settings.test.ts | 24 +- .../api-resources/dispatchers/scripts.test.ts | 34 +- .../dlp/datasets/datasets.test.ts | 32 +- .../api-resources/dlp/datasets/upload.test.ts | 4 +- tests/api-resources/dlp/payload-logs.test.ts | 34 +- .../dlp/profiles/customs.test.ts | 32 +- .../dlp/profiles/predefineds.test.ts | 32 +- .../dns-firewall/dns-firewall.test.ts | 100 +- tests/api-resources/dns-records.test.ts | 66 +- tests/api-resources/dnssec.test.ts | 8 +- .../emails/routing/rules/catch-alls.test.ts | 52 +- .../emails/routing/rules/rules.test.ts | 184 +- tests/api-resources/filters.test.ts | 50 +- .../firewall/waf/packages/groups.test.ts | 34 +- .../firewall/waf/packages/rules.test.ts | 4 +- .../firewalls/access-rules.test.ts | 56 +- .../api-resources/firewalls/lockdowns.test.ts | 50 +- tests/api-resources/firewalls/rules.test.ts | 46 +- .../api-resources/firewalls/ua-rules.test.ts | 50 +- .../firewalls/waf/overrides.test.ts | 50 +- .../firewalls/waf/packages/groups.test.ts | 34 +- .../firewalls/waf/packages/rules.test.ts | 4 +- .../gateways/audit-ssh-settings.test.ts | 36 +- .../gateways/configurations.test.ts | 27 +- .../gateways/lists/lists.test.ts | 50 +- .../api-resources/gateways/locations.test.ts | 60 +- tests/api-resources/gateways/loggings.test.ts | 24 +- .../gateways/proxy-endpoints.test.ts | 32 +- tests/api-resources/gateways/rules.test.ts | 136 +- .../healthchecks/healthchecks.test.ts | 96 +- .../hostnames/settings/tls.test.ts | 54 +- .../api-resources/hyperdrive/configs.test.ts | 50 +- tests/api-resources/images/v1s/v1s.test.ts | 24 +- .../api-resources/images/v1s/variants.test.ts | 46 +- .../indicator-feeds/indicator-feeds.test.ts | 32 +- .../keyless-certificates.test.ts | 32 +- .../load-balancers/load-balancers.test.ts | 32 +- .../load-balancers/monitors/monitors.test.ts | 82 +- .../load-balancers/pools/pools.test.ts | 32 +- tests/api-resources/logpush/jobs.test.ts | 34 +- .../magics/cf-interconnects.test.ts | 32 +- .../api-resources/magics/gre-tunnels.test.ts | 90 +- .../ipsec-tunnels/ipsec-tunnels.test.ts | 66 +- tests/api-resources/magics/routes.test.ts | 64 +- tests/api-resources/managed-headers.test.ts | 52 +- tests/api-resources/memberships.test.ts | 42 +- .../mnms/configs/configs.test.ts | 4 +- .../mnms/rules/advertisements.test.ts | 4 +- tests/api-resources/mnms/rules/rules.test.ts | 32 +- .../origin-post-quantum-encryption.test.ts | 37 +- .../hostnames/hostnames.test.ts | 48 +- .../origin-tls-client-auth/settings.test.ts | 38 +- .../page-shield/page-shield.test.ts | 24 +- .../page-shield/policies.test.ts | 32 +- .../api-resources/pagerules/pagerules.test.ts | 82 +- .../pages/projects/domains.test.ts | 32 +- .../pages/projects/projects.test.ts | 82 +- tests/api-resources/rate-limits.test.ts | 50 +- tests/api-resources/registrar/domains.test.ts | 32 +- tests/api-resources/rules/lists/items.test.ts | 142 +- tests/api-resources/rules/lists/lists.test.ts | 32 +- tests/api-resources/rulesets/rules.test.ts | 70 +- tests/api-resources/rulesets/rulesets.test.ts | 166 +- tests/api-resources/rum/rules.test.ts | 34 +- tests/api-resources/rum/site-infos.test.ts | 32 +- .../api-resources/secondary-dns/acls.test.ts | 50 +- .../secondary-dns/incoming.test.ts | 50 +- .../secondary-dns/outgoing/outgoing.test.ts | 46 +- .../api-resources/secondary-dns/peers.test.ts | 62 +- .../api-resources/secondary-dns/tsigs.test.ts | 70 +- .../settings/always-online.test.ts | 8 +- .../settings/always-use-https.test.ts | 8 +- .../settings/automatic-https-rewrites.test.ts | 8 +- .../automatic-platform-optimization.test.ts | 8 +- tests/api-resources/settings/brotli.test.ts | 8 +- .../settings/browser-cache-ttl.test.ts | 8 +- .../settings/browser-check.test.ts | 8 +- .../settings/cache-level.test.ts | 8 +- .../settings/challenge-ttl.test.ts | 8 +- tests/api-resources/settings/ciphers.test.ts | 8 +- .../settings/development-mode.test.ts | 8 +- .../settings/early-hints.test.ts | 8 +- .../settings/email-obfuscation.test.ts | 8 +- .../settings/font-settings.test.ts | 8 +- .../settings/h2-prioritization.test.ts | 8 +- .../settings/hotlink-protection.test.ts | 8 +- tests/api-resources/settings/http2.test.ts | 8 +- tests/api-resources/settings/http3.test.ts | 8 +- .../settings/image-resizing.test.ts | 8 +- .../settings/ip-geolocation.test.ts | 8 +- tests/api-resources/settings/ipv6.test.ts | 8 +- .../settings/min-tls-version.test.ts | 8 +- tests/api-resources/settings/minify.test.ts | 8 +- tests/api-resources/settings/mirage.test.ts | 8 +- .../settings/mobile-redirect.test.ts | 8 +- tests/api-resources/settings/nel.test.ts | 8 +- .../settings/opportunistic-encryption.test.ts | 8 +- .../settings/opportunistic-onion.test.ts | 13 +- .../settings/orange-to-orange.test.ts | 8 +- .../origin-error-page-pass-thru.test.ts | 8 +- .../settings/origin-max-http-version.test.ts | 13 +- tests/api-resources/settings/polish.test.ts | 8 +- .../settings/prefetch-preload.test.ts | 8 +- .../settings/proxy-read-timeout.test.ts | 8 +- .../settings/pseudo-ipv4.test.ts | 8 +- .../settings/response-buffering.test.ts | 8 +- .../settings/rocket-loader.test.ts | 8 +- .../settings/security-headers.test.ts | 8 +- .../settings/security-level.test.ts | 8 +- .../settings/server-side-excludes.test.ts | 13 +- .../sort-query-string-for-cache.test.ts | 8 +- .../settings/ssl-recommender.test.ts | 8 +- tests/api-resources/settings/ssl.test.ts | 10 +- tests/api-resources/settings/tls-1-3.test.ts | 8 +- .../settings/tls-client-auth.test.ts | 8 +- .../settings/true-client-ip-header.test.ts | 13 +- tests/api-resources/settings/waf.test.ts | 12 +- tests/api-resources/settings/webp.test.ts | 8 +- .../api-resources/settings/websocket.test.ts | 8 +- tests/api-resources/settings/zero-rtt.test.ts | 8 +- .../snippets/snippet-rules.test.ts | 56 +- tests/api-resources/snippets/snippets.test.ts | 71 +- tests/api-resources/spectrum/apps.test.ts | 72 +- .../certificate-packs.test.ts | 30 +- .../ssl/universal/settings.test.ts | 4 +- tests/api-resources/ssl/verification.test.ts | 50 +- .../storage/kv/namespaces/bulk.test.ts | 58 +- .../storage/kv/namespaces/namespaces.test.ts | 50 +- .../storage/kv/namespaces/values.test.ts | 54 +- .../api-resources/stream/audio-tracks.test.ts | 34 +- tests/api-resources/stream/captions.test.ts | 54 +- .../stream/live-inputs/live-inputs.test.ts | 32 +- .../stream/live-inputs/outputs.test.ts | 54 +- tests/api-resources/stream/webhooks.test.ts | 42 +- tests/api-resources/subscriptions.test.ts | 32 +- tests/api-resources/teamnet/routes.test.ts | 32 +- .../teamnets/virtual-networks.test.ts | 32 +- .../tunnels/configurations.test.ts | 32 +- tests/api-resources/tunnels/tunnels.test.ts | 32 +- .../api-resources/url-normalizations.test.ts | 24 +- .../users/firewall/access-rules/rules.test.ts | 30 +- tests/api-resources/users/invites.test.ts | 30 +- .../load-balancers/monitors/monitors.test.ts | 76 +- .../users/load-balancers/pools/pools.test.ts | 27 +- .../api-resources/users/subscriptions.test.ts | 24 +- .../api-resources/users/tokens/tokens.test.ts | 134 +- .../api-resources/users/tokens/values.test.ts | 8 +- tests/api-resources/users/users.test.ts | 24 +- tests/api-resources/vectorize/indexes.test.ts | 50 +- .../waiting-rooms/events/events.test.ts | 92 +- .../api-resources/waiting-rooms/rules.test.ts | 78 +- .../waiting-rooms/settings.test.ts | 4 +- .../waiting-rooms/waiting-rooms.test.ts | 108 +- tests/api-resources/warp-connector.test.ts | 32 +- .../web3/hostnames/hostnames.test.ts | 32 +- .../content-lists/content-lists.test.ts | 62 +- .../content-lists/entries.test.ts | 62 +- .../worker-scripts/content.test.ts | 4 +- .../worker-scripts/settings.test.ts | 4 +- .../namespaces/scripts/content.test.ts | 30 +- .../namespaces/scripts/settings.test.ts | 8 +- .../workers/account-settings.test.ts | 38 +- tests/api-resources/workers/domains.test.ts | 54 +- tests/api-resources/workers/filters.test.ts | 50 +- .../workers/queues/consumers.test.ts | 70 +- .../workers/queues/queues.test.ts | 50 +- tests/api-resources/workers/routes.test.ts | 50 +- .../workers/scripts/schedules.test.ts | 36 +- .../workers/scripts/scripts.test.ts | 32 +- .../workers/scripts/usage-model.test.ts | 36 +- .../services/environments/content.test.ts | 30 +- .../services/environments/settings.test.ts | 8 +- .../api-resources/workers/subdomains.test.ts | 38 +- tests/api-resources/zaraz/config.test.ts | 48 +- .../zaraz/history/history.test.ts | 34 +- tests/api-resources/zaraz/zaraz.test.ts | 8 +- .../zerotrust/connectivity-settings.test.ts | 4 +- tests/api-resources/zones/zones.test.ts | 24 +- 609 files changed, 21854 insertions(+), 21834 deletions(-) create mode 100644 tests/api-resources/cache/cache.test.ts diff --git a/.stats.yml b/.stats.yml index 961e096a51..42d2723898 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1 +1 @@ -configured_endpoints: 1110 +configured_endpoints: 1111 diff --git a/README.md b/README.md index 88ef8ccbfe..2e54bd548f 100644 --- a/README.md +++ b/README.md @@ -130,7 +130,7 @@ const cloudflare = new Cloudflare({ }); // Override per-request: -await cloudflare.zones.update('023e105f4ecef8ad9ca31a8372d0c353', { +await cloudflare.zones.edit('023e105f4ecef8ad9ca31a8372d0c353', { timeout: 5 * 1000, }); ``` diff --git a/api.md b/api.md index b92205c6b9..9163c43603 100644 --- a/api.md +++ b/api.md @@ -2,15 +2,15 @@ Types: +- AccountUpdateResponse - AccountListResponse - AccountGetResponse -- AccountReplaceResponse Methods: +- client.accounts.update(accountId, { ...params }) -> AccountUpdateResponse - client.accounts.list({ ...params }) -> AccountListResponsesV4PagePaginationArray - client.accounts.get(accountId) -> AccountGetResponse -- client.accounts.replace(accountId, { ...params }) -> AccountReplaceResponse # Certificates @@ -42,29 +42,29 @@ Methods: Types: +- MembershipUpdateResponse - MembershipListResponse - MembershipDeleteResponse - MembershipGetResponse -- MembershipReplaceResponse Methods: +- client.memberships.update(membershipId, { ...params }) -> MembershipUpdateResponse - client.memberships.list({ ...params }) -> MembershipListResponsesV4PagePaginationArray - client.memberships.delete(membershipId) -> MembershipDeleteResponse - client.memberships.get(membershipId) -> MembershipGetResponse -- client.memberships.replace(membershipId, { ...params }) -> MembershipReplaceResponse # Users Types: -- UserUpdateResponse - UserListResponse +- UserEditResponse Methods: -- client.users.update({ ...params }) -> UserUpdateResponse - client.users.list() -> UserListResponse +- client.users.edit({ ...params }) -> UserEditResponse ## AuditLogs @@ -107,29 +107,29 @@ Methods: Types: - RuleCreateResponse -- RuleUpdateResponse - RuleListResponse - RuleDeleteResponse +- RuleEditResponse Methods: - client.users.firewall.accessRules.rules.create({ ...params }) -> RuleCreateResponse | null -- client.users.firewall.accessRules.rules.update(identifier, { ...params }) -> RuleUpdateResponse | null - client.users.firewall.accessRules.rules.list({ ...params }) -> RuleListResponsesV4PagePaginationArray - client.users.firewall.accessRules.rules.delete(identifier) -> RuleDeleteResponse | null +- client.users.firewall.accessRules.rules.edit(identifier, { ...params }) -> RuleEditResponse | null ## Invites Types: -- InviteUpdateResponse - InviteListResponse +- InviteEditResponse - InviteGetResponse Methods: -- client.users.invites.update(inviteId, { ...params }) -> InviteUpdateResponse - client.users.invites.list() -> InviteListResponse | null +- client.users.invites.edit(inviteId, { ...params }) -> InviteEditResponse - client.users.invites.get(inviteId) -> InviteGetResponse ## LoadBalancers @@ -139,17 +139,17 @@ Methods: Types: - MonitorCreateResponse -- MonitorUpdateResponse - MonitorListResponse - MonitorDeleteResponse +- MonitorEditResponse - MonitorGetResponse Methods: - client.users.loadBalancers.monitors.create({ ...params }) -> MonitorCreateResponse -- client.users.loadBalancers.monitors.update(monitorId, { ...params }) -> MonitorUpdateResponse - client.users.loadBalancers.monitors.list() -> MonitorListResponse | null - client.users.loadBalancers.monitors.delete(monitorId) -> MonitorDeleteResponse +- client.users.loadBalancers.monitors.edit(monitorId, { ...params }) -> MonitorEditResponse - client.users.loadBalancers.monitors.get(monitorId) -> MonitorGetResponse #### Previews @@ -177,17 +177,17 @@ Methods: Types: - PoolCreateResponse -- PoolUpdateResponse - PoolListResponse - PoolDeleteResponse +- PoolEditResponse - PoolGetResponse Methods: - client.users.loadBalancers.pools.create({ ...params }) -> PoolCreateResponse -- client.users.loadBalancers.pools.update(poolId, { ...params }) -> PoolUpdateResponse - client.users.loadBalancers.pools.list({ ...params }) -> PoolListResponse | null - client.users.loadBalancers.pools.delete(poolId) -> PoolDeleteResponse +- client.users.loadBalancers.pools.edit(poolId, { ...params }) -> PoolEditResponse - client.users.loadBalancers.pools.get(poolId) -> PoolGetResponse #### Health @@ -260,34 +260,34 @@ Methods: Types: +- SubscriptionUpdateResponse - SubscriptionListResponse - SubscriptionDeleteResponse -- SubscriptionReplaceResponse Methods: +- client.users.subscriptions.update(identifier, { ...params }) -> SubscriptionUpdateResponse - client.users.subscriptions.list() -> SubscriptionListResponse | null - client.users.subscriptions.delete(identifier) -> SubscriptionDeleteResponse -- client.users.subscriptions.replace(identifier, { ...params }) -> SubscriptionReplaceResponse ## Tokens Types: - TokenCreateResponse +- TokenUpdateResponse - TokenListResponse - TokenDeleteResponse - TokenGetResponse -- TokenReplaceResponse - TokenVerifyResponse Methods: - client.users.tokens.create({ ...params }) -> TokenCreateResponse +- client.users.tokens.update(tokenId, { ...params }) -> TokenUpdateResponse - client.users.tokens.list({ ...params }) -> TokenListResponsesV4PagePaginationArray - client.users.tokens.delete(tokenId) -> TokenDeleteResponse | null - client.users.tokens.get(tokenId) -> TokenGetResponse -- client.users.tokens.replace(tokenId, { ...params }) -> TokenReplaceResponse - client.users.tokens.verify() -> TokenVerifyResponse ### PermissionGroups @@ -304,28 +304,28 @@ Methods: Types: -- ValueReplaceResponse +- ValueUpdateResponse Methods: -- client.users.tokens.values.replace(tokenId, { ...params }) -> ValueReplaceResponse +- client.users.tokens.values.update(tokenId, { ...params }) -> ValueUpdateResponse # Zones Types: - ZoneCreateResponse -- ZoneUpdateResponse - ZoneListResponse - ZoneDeleteResponse +- ZoneEditResponse - ZoneGetResponse Methods: - client.zones.create({ ...params }) -> ZoneCreateResponse -- client.zones.update(zoneId, { ...params }) -> ZoneUpdateResponse - client.zones.list({ ...params }) -> ZoneListResponsesV4PagePaginationArray - client.zones.delete(zoneId) -> ZoneDeleteResponse | null +- client.zones.edit(zoneId, { ...params }) -> ZoneEditResponse - client.zones.get(zoneId) -> ZoneGetResponse ## Holds @@ -357,17 +357,17 @@ Methods: Types: - LoadBalancerCreateResponse -- LoadBalancerUpdateResponse - LoadBalancerListResponse - LoadBalancerDeleteResponse +- LoadBalancerEditResponse - LoadBalancerGetResponse Methods: - client.loadBalancers.create(zoneId, { ...params }) -> LoadBalancerCreateResponse -- client.loadBalancers.update(zoneId, loadBalancerId, { ...params }) -> LoadBalancerUpdateResponse - client.loadBalancers.list(zoneId) -> LoadBalancerListResponse | null - client.loadBalancers.delete(zoneId, loadBalancerId) -> LoadBalancerDeleteResponse +- client.loadBalancers.edit(zoneId, loadBalancerId, { ...params }) -> LoadBalancerEditResponse - client.loadBalancers.get(zoneId, loadBalancerId) -> LoadBalancerGetResponse ## Monitors @@ -375,17 +375,17 @@ Methods: Types: - MonitorCreateResponse -- MonitorUpdateResponse - MonitorListResponse - MonitorDeleteResponse +- MonitorEditResponse - MonitorGetResponse Methods: - client.loadBalancers.monitors.create(accountId, { ...params }) -> MonitorCreateResponse -- client.loadBalancers.monitors.update(accountId, monitorId, { ...params }) -> MonitorUpdateResponse - client.loadBalancers.monitors.list(accountId) -> MonitorListResponse | null - client.loadBalancers.monitors.delete(accountId, monitorId) -> MonitorDeleteResponse +- client.loadBalancers.monitors.edit(accountId, monitorId, { ...params }) -> MonitorEditResponse - client.loadBalancers.monitors.get(accountId, monitorId) -> MonitorGetResponse ### Previews @@ -413,17 +413,17 @@ Methods: Types: - PoolCreateResponse -- PoolUpdateResponse - PoolListResponse - PoolDeleteResponse +- PoolEditResponse - PoolGetResponse Methods: - client.loadBalancers.pools.create(accountId, { ...params }) -> PoolCreateResponse -- client.loadBalancers.pools.update(accountId, poolId, { ...params }) -> PoolUpdateResponse - client.loadBalancers.pools.list(accountId, { ...params }) -> PoolListResponse | null - client.loadBalancers.pools.delete(accountId, poolId) -> PoolDeleteResponse +- client.loadBalancers.pools.edit(accountId, poolId, { ...params }) -> PoolEditResponse - client.loadBalancers.pools.get(accountId, poolId) -> PoolGetResponse ### Health @@ -487,19 +487,19 @@ Methods: Types: - ApplicationCreateResponse +- ApplicationUpdateResponse - ApplicationListResponse - ApplicationDeleteResponse - ApplicationGetResponse -- ApplicationReplaceResponse - ApplicationRevokeTokensResponse Methods: - client.access.applications.create(accountOrZone, accountOrZoneId, { ...params }) -> ApplicationCreateResponse +- client.access.applications.update(accountOrZone, accountOrZoneId, appId, { ...params }) -> ApplicationUpdateResponse - client.access.applications.list(accountOrZone, accountOrZoneId) -> ApplicationListResponse | null - client.access.applications.delete(accountOrZone, accountOrZoneId, appId) -> ApplicationDeleteResponse - client.access.applications.get(accountOrZone, accountOrZoneId, appId) -> ApplicationGetResponse -- client.access.applications.replace(accountOrZone, accountOrZoneId, appId, { ...params }) -> ApplicationReplaceResponse - client.access.applications.revokeTokens(accountOrZone, accountOrZoneId, appId) -> ApplicationRevokeTokensResponse | null ### Cas @@ -533,99 +533,99 @@ Methods: Types: - PolicyCreateResponse +- PolicyUpdateResponse - PolicyListResponse - PolicyDeleteResponse - PolicyGetResponse -- PolicyReplaceResponse Methods: - client.access.applications.policies.create(accountOrZone, accountOrZoneId, uuid, { ...params }) -> PolicyCreateResponse +- client.access.applications.policies.update(accountOrZone, accountOrZoneId, uuid1, uuid, { ...params }) -> PolicyUpdateResponse - client.access.applications.policies.list(accountOrZone, accountOrZoneId, uuid) -> PolicyListResponse | null - client.access.applications.policies.delete(accountOrZone, accountOrZoneId, uuid1, uuid) -> PolicyDeleteResponse - client.access.applications.policies.get(accountOrZone, accountOrZoneId, uuid1, uuid) -> PolicyGetResponse -- client.access.applications.policies.replace(accountOrZone, accountOrZoneId, uuid1, uuid, { ...params }) -> PolicyReplaceResponse ## Certificates Types: - CertificateCreateResponse +- CertificateUpdateResponse - CertificateListResponse - CertificateDeleteResponse - CertificateGetResponse -- CertificateReplaceResponse Methods: - client.access.certificates.create(accountOrZone, accountOrZoneId, { ...params }) -> CertificateCreateResponse +- client.access.certificates.update(accountOrZone, accountOrZoneId, uuid, { ...params }) -> CertificateUpdateResponse - client.access.certificates.list(accountOrZone, accountOrZoneId) -> CertificateListResponse | null - client.access.certificates.delete(accountOrZone, accountOrZoneId, uuid) -> CertificateDeleteResponse - client.access.certificates.get(accountOrZone, accountOrZoneId, uuid) -> CertificateGetResponse -- client.access.certificates.replace(accountOrZone, accountOrZoneId, uuid, { ...params }) -> CertificateReplaceResponse ### Settings Types: +- SettingUpdateResponse - SettingListResponse -- SettingReplaceResponse Methods: +- client.access.certificates.settings.update(accountOrZone, accountOrZoneId, { ...params }) -> SettingUpdateResponse | null - client.access.certificates.settings.list(accountOrZone, accountOrZoneId) -> SettingListResponse | null -- client.access.certificates.settings.replace(accountOrZone, accountOrZoneId, { ...params }) -> SettingReplaceResponse | null ## Groups Types: - GroupCreateResponse +- GroupUpdateResponse - GroupListResponse - GroupDeleteResponse - GroupGetResponse -- GroupReplaceResponse Methods: - client.access.groups.create(accountOrZone, accountOrZoneId, { ...params }) -> GroupCreateResponse +- client.access.groups.update(accountOrZone, accountOrZoneId, uuid, { ...params }) -> GroupUpdateResponse - client.access.groups.list(accountOrZone, accountOrZoneId) -> GroupListResponse | null - client.access.groups.delete(accountOrZone, accountOrZoneId, uuid) -> GroupDeleteResponse - client.access.groups.get(accountOrZone, accountOrZoneId, uuid) -> GroupGetResponse -- client.access.groups.replace(accountOrZone, accountOrZoneId, uuid, { ...params }) -> GroupReplaceResponse ## IdentityProviders Types: - IdentityProviderCreateResponse +- IdentityProviderUpdateResponse - IdentityProviderListResponse - IdentityProviderDeleteResponse - IdentityProviderGetResponse -- IdentityProviderReplaceResponse Methods: - client.access.identityProviders.create(accountOrZone, accountOrZoneId, { ...params }) -> IdentityProviderCreateResponse +- client.access.identityProviders.update(accountOrZone, accountOrZoneId, uuid, { ...params }) -> IdentityProviderUpdateResponse - client.access.identityProviders.list(accountOrZone, accountOrZoneId) -> IdentityProviderListResponse | null - client.access.identityProviders.delete(accountOrZone, accountOrZoneId, uuid) -> IdentityProviderDeleteResponse - client.access.identityProviders.get(accountOrZone, accountOrZoneId, uuid) -> IdentityProviderGetResponse -- client.access.identityProviders.replace(accountOrZone, accountOrZoneId, uuid, { ...params }) -> IdentityProviderReplaceResponse ## Organizations Types: - OrganizationCreateResponse +- OrganizationUpdateResponse - OrganizationListResponse -- OrganizationReplaceResponse - OrganizationRevokeUsersResponse Methods: - client.access.organizations.create(accountOrZone, accountOrZoneId, { ...params }) -> OrganizationCreateResponse +- client.access.organizations.update(accountOrZone, accountOrZoneId, { ...params }) -> OrganizationUpdateResponse - client.access.organizations.list(accountOrZone, accountOrZoneId) -> OrganizationListResponse -- client.access.organizations.replace(accountOrZone, accountOrZoneId, { ...params }) -> OrganizationReplaceResponse - client.access.organizations.revokeUsers(accountOrZone, accountOrZoneId, { ...params }) -> OrganizationRevokeUsersResponse ## ServiceTokens @@ -633,49 +633,49 @@ Methods: Types: - ServiceTokenCreateResponse +- ServiceTokenUpdateResponse - ServiceTokenListResponse - ServiceTokenDeleteResponse - ServiceTokenRefreshResponse -- ServiceTokenReplaceResponse - ServiceTokenRotateResponse Methods: - client.access.serviceTokens.create(accountOrZone, accountOrZoneId, { ...params }) -> ServiceTokenCreateResponse +- client.access.serviceTokens.update(accountOrZone, accountOrZoneId, uuid, { ...params }) -> ServiceTokenUpdateResponse - client.access.serviceTokens.list(accountOrZone, accountOrZoneId) -> ServiceTokenListResponse | null - client.access.serviceTokens.delete(accountOrZone, accountOrZoneId, uuid) -> ServiceTokenDeleteResponse - client.access.serviceTokens.refresh(identifier, uuid) -> ServiceTokenRefreshResponse -- client.access.serviceTokens.replace(accountOrZone, accountOrZoneId, uuid, { ...params }) -> ServiceTokenReplaceResponse - client.access.serviceTokens.rotate(identifier, uuid) -> ServiceTokenRotateResponse ## Bookmarks Types: +- BookmarkUpdateResponse - BookmarkListResponse - BookmarkDeleteResponse - BookmarkGetResponse -- BookmarkReplaceResponse Methods: +- client.access.bookmarks.update(identifier, uuid) -> BookmarkUpdateResponse - client.access.bookmarks.list(identifier) -> BookmarkListResponse | null - client.access.bookmarks.delete(identifier, uuid) -> BookmarkDeleteResponse - client.access.bookmarks.get(identifier, uuid) -> BookmarkGetResponse -- client.access.bookmarks.replace(identifier, uuid) -> BookmarkReplaceResponse ## Keys Types: +- KeyUpdateResponse - KeyListResponse -- KeyReplaceResponse - KeyRotateResponse Methods: +- client.access.keys.update(identifier, { ...params }) -> KeyUpdateResponse - client.access.keys.list(identifier) -> KeyListResponse -- client.access.keys.replace(identifier, { ...params }) -> KeyReplaceResponse - client.access.keys.rotate(identifier) -> KeyRotateResponse ## Logs @@ -694,11 +694,11 @@ Methods: Types: -- SeatUpdateResponse +- SeatEditResponse Methods: -- client.access.seats.update(identifier, [ ...body ]) -> SeatUpdateResponse | null +- client.access.seats.edit(identifier, [ ...body ]) -> SeatEditResponse | null ## Users @@ -747,36 +747,36 @@ Methods: Types: - CustomPageCreateResponse +- CustomPageUpdateResponse - CustomPageListResponse - CustomPageDeleteResponse - CustomPageGetResponse -- CustomPageReplaceResponse Methods: - client.access.customPages.create(identifier, { ...params }) -> CustomPageCreateResponse +- client.access.customPages.update(identifier, uuid, { ...params }) -> CustomPageUpdateResponse - client.access.customPages.list(identifier) -> CustomPageListResponse | null - client.access.customPages.delete(identifier, uuid) -> CustomPageDeleteResponse - client.access.customPages.get(identifier, uuid) -> CustomPageGetResponse -- client.access.customPages.replace(identifier, uuid, { ...params }) -> CustomPageReplaceResponse ## Tags Types: - TagCreateResponse +- TagUpdateResponse - TagListResponse - TagDeleteResponse - TagGetResponse -- TagReplaceResponse Methods: - client.access.tags.create(identifier, { ...params }) -> TagCreateResponse +- client.access.tags.update(identifier, tagName, { ...params }) -> TagUpdateResponse - client.access.tags.list(identifier) -> TagListResponse | null - client.access.tags.delete(identifier, name) -> TagDeleteResponse - client.access.tags.get(identifier, name) -> TagGetResponse -- client.access.tags.replace(identifier, tagName, { ...params }) -> TagReplaceResponse # DNSAnalytics @@ -802,56 +802,64 @@ Methods: # Cache +Types: + +- CachePurgeResponse + +Methods: + +- client.cache.purge(zoneId, { ...params }) -> CachePurgeResponse | null + ## CacheReserves Types: -- CacheReserveUpdateResponse - CacheReserveListResponse +- CacheReserveEditResponse Methods: -- client.cache.cacheReserves.update(zoneId, { ...params }) -> CacheReserveUpdateResponse - client.cache.cacheReserves.list(zoneId) -> CacheReserveListResponse +- client.cache.cacheReserves.edit(zoneId, { ...params }) -> CacheReserveEditResponse ## TieredCacheSmartTopology Types: -- TieredCacheSmartTopologyUpdateResponse - TieredCacheSmartTopologyDeleteResponse +- TieredCacheSmartTopologyEditResponse - TieredCacheSmartTopologyGetResponse Methods: -- client.cache.tieredCacheSmartTopology.update(zoneId, { ...params }) -> TieredCacheSmartTopologyUpdateResponse - client.cache.tieredCacheSmartTopology.delete(zoneId) -> TieredCacheSmartTopologyDeleteResponse +- client.cache.tieredCacheSmartTopology.edit(zoneId, { ...params }) -> TieredCacheSmartTopologyEditResponse - client.cache.tieredCacheSmartTopology.get(zoneId) -> TieredCacheSmartTopologyGetResponse ## Variants Types: -- VariantUpdateResponse - VariantListResponse - VariantDeleteResponse +- VariantEditResponse Methods: -- client.cache.variants.update(zoneId, { ...params }) -> VariantUpdateResponse - client.cache.variants.list(zoneId) -> VariantListResponse - client.cache.variants.delete(zoneId) -> VariantDeleteResponse +- client.cache.variants.edit(zoneId, { ...params }) -> VariantEditResponse ## RegionalTieredCache Types: -- RegionalTieredCacheUpdateResponse +- RegionalTieredCacheEditResponse - RegionalTieredCacheGetResponse Methods: -- client.cache.regionalTieredCache.update(zoneId, { ...params }) -> RegionalTieredCacheUpdateResponse +- client.cache.regionalTieredCache.edit(zoneId, { ...params }) -> RegionalTieredCacheEditResponse - client.cache.regionalTieredCache.get(zoneId) -> RegionalTieredCacheGetResponse # SSL @@ -870,16 +878,16 @@ Methods: Types: -- CertificatePackUpdateResponse - CertificatePackListResponse - CertificatePackDeleteResponse +- CertificatePackEditResponse - CertificatePackGetResponse Methods: -- client.ssl.certificatePacks.update(zoneId, certificatePackId) -> CertificatePackUpdateResponse - client.ssl.certificatePacks.list(zoneId, { ...params }) -> CertificatePackListResponse | null - client.ssl.certificatePacks.delete(zoneId, certificatePackId) -> CertificatePackDeleteResponse +- client.ssl.certificatePacks.edit(zoneId, certificatePackId) -> CertificatePackEditResponse - client.ssl.certificatePacks.get(zoneId, certificatePackId) -> CertificatePackGetResponse ### Order @@ -918,43 +926,43 @@ Methods: Types: -- SettingUpdateResponse +- SettingEditResponse - SettingGetResponse Methods: -- client.ssl.universal.settings.update(zoneId, { ...params }) -> SettingUpdateResponse +- client.ssl.universal.settings.edit(zoneId, { ...params }) -> SettingEditResponse - client.ssl.universal.settings.get(zoneId) -> SettingGetResponse ## Verification Types: -- VerificationUpdateResponse - VerificationListResponse +- VerificationEditResponse Methods: -- client.ssl.verification.update(zoneId, certificatePackId, { ...params }) -> VerificationUpdateResponse - client.ssl.verification.list(zoneId, { ...params }) -> VerificationListResponse +- client.ssl.verification.edit(zoneId, certificatePackId, { ...params }) -> VerificationEditResponse # Subscriptions Types: - SubscriptionCreateResponse +- SubscriptionUpdateResponse - SubscriptionListResponse - SubscriptionDeleteResponse - SubscriptionGetResponse -- SubscriptionReplaceResponse Methods: - client.subscriptions.create(identifier, { ...params }) -> SubscriptionCreateResponse +- client.subscriptions.update(accountIdentifier, subscriptionIdentifier, { ...params }) -> SubscriptionUpdateResponse - client.subscriptions.list(accountIdentifier) -> SubscriptionListResponse | null - client.subscriptions.delete(accountIdentifier, subscriptionIdentifier) -> SubscriptionDeleteResponse - client.subscriptions.get(identifier) -> SubscriptionGetResponse -- client.subscriptions.replace(accountIdentifier, subscriptionIdentifier, { ...params }) -> SubscriptionReplaceResponse # Acm @@ -976,24 +984,24 @@ Methods: Types: -- SmartRoutingUpdateResponse +- SmartRoutingEditResponse - SmartRoutingGetResponse Methods: -- client.argo.smartRouting.update(zoneId, { ...params }) -> SmartRoutingUpdateResponse +- client.argo.smartRouting.edit(zoneId, { ...params }) -> SmartRoutingEditResponse - client.argo.smartRouting.get(zoneId) -> SmartRoutingGetResponse ## TieredCaching Types: -- TieredCachingUpdateResponse +- TieredCachingEditResponse - TieredCachingGetResponse Methods: -- client.argo.tieredCaching.update(zoneId, { ...params }) -> TieredCachingUpdateResponse +- client.argo.tieredCaching.edit(zoneId, { ...params }) -> TieredCachingEditResponse - client.argo.tieredCaching.get(zoneId) -> TieredCachingGetResponse # AvailablePlans @@ -1024,30 +1032,30 @@ Methods: Types: +- HostnameAssociationUpdateResponse - HostnameAssociationListResponse -- HostnameAssociationReplaceResponse Methods: +- client.certificateAuthorities.hostnameAssociations.update(zoneId, { ...params }) -> HostnameAssociationUpdateResponse - client.certificateAuthorities.hostnameAssociations.list(zoneId, { ...params }) -> HostnameAssociationListResponse -- client.certificateAuthorities.hostnameAssociations.replace(zoneId, { ...params }) -> HostnameAssociationReplaceResponse # ClientCertificates Types: - ClientCertificateCreateResponse -- ClientCertificateUpdateResponse - ClientCertificateListResponse - ClientCertificateDeleteResponse +- ClientCertificateEditResponse - ClientCertificateGetResponse Methods: - client.clientCertificates.create(zoneId, { ...params }) -> ClientCertificateCreateResponse -- client.clientCertificates.update(zoneId, clientCertificateId) -> ClientCertificateUpdateResponse - client.clientCertificates.list(zoneId, { ...params }) -> ClientCertificateListResponsesV4PagePaginationArray - client.clientCertificates.delete(zoneId, clientCertificateId) -> ClientCertificateDeleteResponse +- client.clientCertificates.edit(zoneId, clientCertificateId) -> ClientCertificateEditResponse - client.clientCertificates.get(zoneId, clientCertificateId) -> ClientCertificateGetResponse # CustomCertificates @@ -1055,60 +1063,60 @@ Methods: Types: - CustomCertificateCreateResponse -- CustomCertificateUpdateResponse - CustomCertificateListResponse - CustomCertificateDeleteResponse +- CustomCertificateEditResponse - CustomCertificateGetResponse Methods: - client.customCertificates.create(zoneId, { ...params }) -> CustomCertificateCreateResponse -- client.customCertificates.update(zoneId, customCertificateId, { ...params }) -> CustomCertificateUpdateResponse - client.customCertificates.list(zoneId, { ...params }) -> CustomCertificateListResponsesV4PagePaginationArray - client.customCertificates.delete(zoneId, customCertificateId) -> CustomCertificateDeleteResponse +- client.customCertificates.edit(zoneId, customCertificateId, { ...params }) -> CustomCertificateEditResponse - client.customCertificates.get(zoneId, customCertificateId) -> CustomCertificateGetResponse ## Prioritize Types: -- PrioritizeReplaceResponse +- PrioritizeUpdateResponse Methods: -- client.customCertificates.prioritize.replace(zoneId, { ...params }) -> PrioritizeReplaceResponse | null +- client.customCertificates.prioritize.update(zoneId, { ...params }) -> PrioritizeUpdateResponse | null # CustomHostnames Types: - CustomHostnameCreateResponse -- CustomHostnameUpdateResponse - CustomHostnameListResponse - CustomHostnameDeleteResponse +- CustomHostnameEditResponse - CustomHostnameGetResponse Methods: - client.customHostnames.create(zoneId, { ...params }) -> CustomHostnameCreateResponse -- client.customHostnames.update(zoneId, customHostnameId, { ...params }) -> CustomHostnameUpdateResponse - client.customHostnames.list(zoneId, { ...params }) -> CustomHostnameListResponsesV4PagePaginationArray - client.customHostnames.delete(zoneId, customHostnameId) -> CustomHostnameDeleteResponse +- client.customHostnames.edit(zoneId, customHostnameId, { ...params }) -> CustomHostnameEditResponse - client.customHostnames.get(zoneId, customHostnameId) -> CustomHostnameGetResponse ## FallbackOrigin Types: +- FallbackOriginUpdateResponse - FallbackOriginDeleteResponse - FallbackOriginGetResponse -- FallbackOriginReplaceResponse Methods: +- client.customHostnames.fallbackOrigin.update(zoneId, { ...params }) -> FallbackOriginUpdateResponse - client.customHostnames.fallbackOrigin.delete(zoneId) -> FallbackOriginDeleteResponse - client.customHostnames.fallbackOrigin.get(zoneId) -> FallbackOriginGetResponse -- client.customHostnames.fallbackOrigin.replace(zoneId, { ...params }) -> FallbackOriginReplaceResponse # CustomNameservers @@ -1133,37 +1141,37 @@ Methods: Types: - DNSRecordCreateResponse +- DNSRecordUpdateResponse - DNSRecordListResponse - DNSRecordDeleteResponse - DNSRecordExportResponse - DNSRecordGetResponse - DNSRecordImportResponse -- DNSRecordReplaceResponse - DNSRecordScanResponse Methods: - client.dnsRecords.create(zoneId, { ...params }) -> DNSRecordCreateResponse +- client.dnsRecords.update(zoneId, dnsRecordId, { ...params }) -> DNSRecordUpdateResponse - client.dnsRecords.list(zoneId, { ...params }) -> DNSRecordListResponsesV4PagePaginationArray - client.dnsRecords.delete(zoneId, dnsRecordId) -> DNSRecordDeleteResponse - client.dnsRecords.export(zoneId) -> string - client.dnsRecords.get(zoneId, dnsRecordId) -> DNSRecordGetResponse - client.dnsRecords.import(zoneId, { ...params }) -> DNSRecordImportResponse -- client.dnsRecords.replace(zoneId, dnsRecordId, { ...params }) -> DNSRecordReplaceResponse - client.dnsRecords.scan(zoneId) -> DNSRecordScanResponse # DNSSEC Types: -- DNSSECUpdateResponse - DNSSECDeleteResponse +- DNSSECEditResponse - DNSSECGetResponse Methods: -- client.dnssec.update(zoneId, { ...params }) -> DNSSECUpdateResponse - client.dnssec.delete(zoneId) -> DNSSECDeleteResponse +- client.dnssec.edit(zoneId, { ...params }) -> DNSSECEditResponse - client.dnssec.get(zoneId) -> DNSSECGetResponse # Emails @@ -1213,30 +1221,30 @@ Methods: Types: - RuleCreateResponse +- RuleUpdateResponse - RuleListResponse - RuleDeleteResponse - RuleGetResponse -- RuleReplaceResponse Methods: - client.emails.routing.rules.create(zoneIdentifier, { ...params }) -> RuleCreateResponse +- client.emails.routing.rules.update(zoneIdentifier, ruleIdentifier, { ...params }) -> RuleUpdateResponse - client.emails.routing.rules.list(zoneIdentifier, { ...params }) -> RuleListResponsesV4PagePaginationArray - client.emails.routing.rules.delete(zoneIdentifier, ruleIdentifier) -> RuleDeleteResponse - client.emails.routing.rules.get(zoneIdentifier, ruleIdentifier) -> RuleGetResponse -- client.emails.routing.rules.replace(zoneIdentifier, ruleIdentifier, { ...params }) -> RuleReplaceResponse #### CatchAlls Types: +- CatchAllUpdateResponse - CatchAllGetResponse -- CatchAllReplaceResponse Methods: +- client.emails.routing.rules.catchAlls.update(zoneIdentifier, { ...params }) -> CatchAllUpdateResponse - client.emails.routing.rules.catchAlls.get(zoneIdentifier) -> CatchAllGetResponse -- client.emails.routing.rules.catchAlls.replace(zoneIdentifier, { ...params }) -> CatchAllReplaceResponse ### Addresses @@ -1259,18 +1267,18 @@ Methods: Types: - FilterCreateResponse +- FilterUpdateResponse - FilterListResponse - FilterDeleteResponse - FilterGetResponse -- FilterReplaceResponse Methods: - client.filters.create(zoneIdentifier, { ...params }) -> FilterCreateResponse | null +- client.filters.update(zoneIdentifier, id, { ...params }) -> FilterUpdateResponse | null - client.filters.list(zoneIdentifier, { ...params }) -> FilterListResponsesV4PagePaginationArray - client.filters.delete(zoneIdentifier, id) -> FilterDeleteResponse | null - client.filters.get(zoneIdentifier, id) -> FilterGetResponse | null -- client.filters.replace(zoneIdentifier, id, { ...params }) -> FilterReplaceResponse | null # Firewalls @@ -1279,18 +1287,18 @@ Methods: Types: - LockdownCreateResponse +- LockdownUpdateResponse - LockdownListResponse - LockdownDeleteResponse - LockdownGetResponse -- LockdownReplaceResponse Methods: - client.firewalls.lockdowns.create(zoneIdentifier, { ...params }) -> LockdownCreateResponse | null +- client.firewalls.lockdowns.update(zoneIdentifier, id, { ...params }) -> LockdownUpdateResponse | null - client.firewalls.lockdowns.list(zoneIdentifier, { ...params }) -> LockdownListResponsesV4PagePaginationArray - client.firewalls.lockdowns.delete(zoneIdentifier, id) -> LockdownDeleteResponse - client.firewalls.lockdowns.get(zoneIdentifier, id) -> LockdownGetResponse | null -- client.firewalls.lockdowns.replace(zoneIdentifier, id, { ...params }) -> LockdownReplaceResponse | null ## Rules @@ -1300,34 +1308,34 @@ Types: - RuleUpdateResponse - RuleListResponse - RuleDeleteResponse +- RuleEditResponse - RuleGetResponse -- RuleReplaceResponse Methods: - client.firewalls.rules.create(zoneIdentifier, { ...params }) -> RuleCreateResponse | null -- client.firewalls.rules.update(zoneIdentifier, { ...params }) -> RuleUpdateResponse | null +- client.firewalls.rules.update(zoneIdentifier, id, { ...params }) -> RuleUpdateResponse | null - client.firewalls.rules.list(zoneIdentifier, { ...params }) -> RuleListResponsesV4PagePaginationArray - client.firewalls.rules.delete(zoneIdentifier, id, { ...params }) -> RuleDeleteResponse | null +- client.firewalls.rules.edit(zoneIdentifier, { ...params }) -> RuleEditResponse | null - client.firewalls.rules.get(zoneIdentifier, id) -> RuleGetResponse | null -- client.firewalls.rules.replace(zoneIdentifier, id, { ...params }) -> RuleReplaceResponse | null ## AccessRules Types: - AccessRuleCreateResponse -- AccessRuleUpdateResponse - AccessRuleListResponse - AccessRuleDeleteResponse +- AccessRuleEditResponse - AccessRuleGetResponse Methods: - client.firewalls.accessRules.create(accountOrZone, accountOrZoneId, { ...params }) -> AccessRuleCreateResponse | null -- client.firewalls.accessRules.update(identifier, { ...params }) -> AccessRuleUpdateResponse | null - client.firewalls.accessRules.list(accountOrZone, accountOrZoneId, { ...params }) -> AccessRuleListResponsesV4PagePaginationArray - client.firewalls.accessRules.delete(accountOrZone, accountOrZoneId, identifier) -> AccessRuleDeleteResponse | null +- client.firewalls.accessRules.edit(identifier, { ...params }) -> AccessRuleEditResponse | null - client.firewalls.accessRules.get(accountOrZone, accountOrZoneId, identifier) -> AccessRuleGetResponse | null ## UaRules @@ -1335,18 +1343,18 @@ Methods: Types: - UaRuleCreateResponse +- UaRuleUpdateResponse - UaRuleListResponse - UaRuleDeleteResponse - UaRuleGetResponse -- UaRuleReplaceResponse Methods: - client.firewalls.uaRules.create(zoneIdentifier, { ...params }) -> UaRuleCreateResponse | null +- client.firewalls.uaRules.update(zoneIdentifier, id, { ...params }) -> UaRuleUpdateResponse | null - client.firewalls.uaRules.list(zoneIdentifier, { ...params }) -> UaRuleListResponsesV4PagePaginationArray - client.firewalls.uaRules.delete(zoneIdentifier, id) -> UaRuleDeleteResponse | null - client.firewalls.uaRules.get(zoneIdentifier, id) -> UaRuleGetResponse | null -- client.firewalls.uaRules.replace(zoneIdentifier, id, { ...params }) -> UaRuleReplaceResponse | null ## WAF @@ -1355,18 +1363,18 @@ Methods: Types: - OverrideCreateResponse +- OverrideUpdateResponse - OverrideListResponse - OverrideDeleteResponse - OverrideGetResponse -- OverrideReplaceResponse Methods: - client.firewalls.waf.overrides.create(zoneIdentifier, { ...params }) -> OverrideCreateResponse | null +- client.firewalls.waf.overrides.update(zoneIdentifier, id, { ...params }) -> OverrideUpdateResponse | null - client.firewalls.waf.overrides.list(zoneIdentifier, { ...params }) -> OverrideListResponsesV4PagePaginationArray - client.firewalls.waf.overrides.delete(zoneIdentifier, id) -> OverrideDeleteResponse - client.firewalls.waf.overrides.get(zoneIdentifier, id) -> OverrideGetResponse | null -- client.firewalls.waf.overrides.replace(zoneIdentifier, id, { ...params }) -> OverrideReplaceResponse | null ### Packages @@ -1384,27 +1392,27 @@ Methods: Types: -- GroupUpdateResponse - GroupListResponse +- GroupEditResponse - GroupGetResponse Methods: -- client.firewalls.waf.packages.groups.update(zoneId, packageId, groupId, { ...params }) -> GroupUpdateResponse - client.firewalls.waf.packages.groups.list(zoneId, packageId, { ...params }) -> GroupListResponsesV4PagePaginationArray +- client.firewalls.waf.packages.groups.edit(zoneId, packageId, groupId, { ...params }) -> GroupEditResponse - client.firewalls.waf.packages.groups.get(zoneId, packageId, groupId) -> GroupGetResponse #### Rules Types: -- RuleUpdateResponse +- RuleEditResponse - RuleGetResponse - RuleWAFRulesListWAFRulesResponse Methods: -- client.firewalls.waf.packages.rules.update(zoneId, packageId, ruleId, { ...params }) -> RuleUpdateResponse +- client.firewalls.waf.packages.rules.edit(zoneId, packageId, ruleId, { ...params }) -> RuleEditResponse - client.firewalls.waf.packages.rules.get(zoneId, packageId, ruleId) -> RuleGetResponse - client.firewalls.waf.packages.rules.wafRulesListWAFRules(zoneId, packageId, { ...params }) -> RuleWAFRulesListWAFRulesResponse | null @@ -1413,18 +1421,18 @@ Methods: Types: - HealthcheckCreateResponse +- HealthcheckUpdateResponse - HealthcheckListResponse - HealthcheckDeleteResponse - HealthcheckGetResponse -- HealthcheckReplaceResponse Methods: - client.healthchecks.create(zoneIdentifier, { ...params }) -> HealthcheckCreateResponse +- client.healthchecks.update(zoneIdentifier, identifier, { ...params }) -> HealthcheckUpdateResponse - client.healthchecks.list(zoneIdentifier) -> HealthcheckListResponse | null - client.healthchecks.delete(zoneIdentifier, identifier) -> HealthcheckDeleteResponse - client.healthchecks.get(zoneIdentifier, identifier) -> HealthcheckGetResponse -- client.healthchecks.replace(zoneIdentifier, identifier, { ...params }) -> HealthcheckReplaceResponse ## Previews @@ -1445,17 +1453,17 @@ Methods: Types: - KeylessCertificateCreateResponse -- KeylessCertificateUpdateResponse - KeylessCertificateListResponse - KeylessCertificateDeleteResponse +- KeylessCertificateEditResponse - KeylessCertificateGetResponse Methods: - client.keylessCertificates.create(zoneId, { ...params }) -> KeylessCertificateCreateResponse -- client.keylessCertificates.update(zoneId, keylessCertificateId, { ...params }) -> KeylessCertificateUpdateResponse - client.keylessCertificates.list(zoneId) -> KeylessCertificateListResponse | null - client.keylessCertificates.delete(zoneId, keylessCertificateId) -> KeylessCertificateDeleteResponse +- client.keylessCertificates.edit(zoneId, keylessCertificateId, { ...params }) -> KeylessCertificateEditResponse - client.keylessCertificates.get(zoneId, keylessCertificateId) -> KeylessCertificateGetResponse # Logpush @@ -1499,18 +1507,18 @@ Methods: Types: - JobCreateResponse +- JobUpdateResponse - JobListResponse - JobDeleteResponse - JobGetResponse -- JobReplaceResponse Methods: - client.logpush.jobs.create(accountOrZone, accountOrZoneId, { ...params }) -> JobCreateResponse | null +- client.logpush.jobs.update(accountOrZone, accountOrZoneId, jobId, { ...params }) -> JobUpdateResponse | null - client.logpush.jobs.list(accountOrZone, accountOrZoneId) -> JobListResponse - client.logpush.jobs.delete(accountOrZone, accountOrZoneId, jobId) -> JobDeleteResponse | null - client.logpush.jobs.get(accountOrZone, accountOrZoneId, jobId) -> JobGetResponse | null -- client.logpush.jobs.replace(accountOrZone, accountOrZoneId, jobId, { ...params }) -> JobReplaceResponse | null ## Ownership @@ -1620,13 +1628,13 @@ Methods: Types: +- HostnameUpdateResponse - HostnameGetResponse -- HostnameReplaceResponse Methods: +- client.originTLSClientAuth.hostnames.update(zoneId, { ...params }) -> HostnameUpdateResponse | null - client.originTLSClientAuth.hostnames.get(zoneId, hostname) -> HostnameGetResponse -- client.originTLSClientAuth.hostnames.replace(zoneId, { ...params }) -> HostnameReplaceResponse | null ### Certificates @@ -1648,31 +1656,31 @@ Methods: Types: +- SettingUpdateResponse - SettingGetResponse -- SettingReplaceResponse Methods: +- client.originTLSClientAuth.settings.update(zoneId, { ...params }) -> SettingUpdateResponse - client.originTLSClientAuth.settings.get(zoneId) -> SettingGetResponse -- client.originTLSClientAuth.settings.replace(zoneId, { ...params }) -> SettingReplaceResponse # Pagerules Types: - PageruleCreateResponse +- PageruleUpdateResponse - PageruleListResponse - PageruleDeleteResponse - PageruleGetResponse -- PageruleReplaceResponse Methods: - client.pagerules.create(zoneId, { ...params }) -> PageruleCreateResponse +- client.pagerules.update(zoneId, pageruleId, { ...params }) -> PageruleUpdateResponse - client.pagerules.list(zoneId, { ...params }) -> PageruleListResponse - client.pagerules.delete(zoneId, pageruleId) -> PageruleDeleteResponse | null - client.pagerules.get(zoneId, pageruleId) -> PageruleGetResponse -- client.pagerules.replace(zoneId, pageruleId, { ...params }) -> PageruleReplaceResponse ## Settings @@ -1689,17 +1697,17 @@ Methods: Types: - RateLimitCreateResponse -- RateLimitUpdateResponse - RateLimitListResponse - RateLimitDeleteResponse +- RateLimitEditResponse - RateLimitGetResponse Methods: - client.rateLimits.create(zoneIdentifier, { ...params }) -> RateLimitCreateResponse | null -- client.rateLimits.update(zoneIdentifier, id, { ...params }) -> RateLimitUpdateResponse | null - client.rateLimits.list(zoneIdentifier, { ...params }) -> RateLimitListResponsesV4PagePaginationArray - client.rateLimits.delete(zoneIdentifier, id) -> RateLimitDeleteResponse | null +- client.rateLimits.edit(zoneIdentifier, id, { ...params }) -> RateLimitEditResponse | null - client.rateLimits.get(zoneIdentifier, id) -> RateLimitGetResponse | null # SecondaryDNS @@ -1719,38 +1727,38 @@ Methods: Types: - IncomingCreateResponse +- IncomingUpdateResponse - IncomingDeleteResponse - IncomingGetResponse -- IncomingReplaceResponse Methods: - client.secondaryDNS.incoming.create(zoneId, { ...params }) -> IncomingCreateResponse +- client.secondaryDNS.incoming.update(zoneId, { ...params }) -> IncomingUpdateResponse - client.secondaryDNS.incoming.delete(zoneId) -> IncomingDeleteResponse - client.secondaryDNS.incoming.get(zoneId) -> IncomingGetResponse -- client.secondaryDNS.incoming.replace(zoneId, { ...params }) -> IncomingReplaceResponse ## Outgoing Types: - OutgoingCreateResponse +- OutgoingUpdateResponse - OutgoingDeleteResponse - OutgoingDisableResponse - OutgoingEnableResponse - OutgoingForceNotifyResponse - OutgoingGetResponse -- OutgoingReplaceResponse Methods: - client.secondaryDNS.outgoing.create(zoneId, { ...params }) -> OutgoingCreateResponse +- client.secondaryDNS.outgoing.update(zoneId, { ...params }) -> OutgoingUpdateResponse - client.secondaryDNS.outgoing.delete(zoneId) -> OutgoingDeleteResponse - client.secondaryDNS.outgoing.disable(zoneId) -> OutgoingDisableResponse - client.secondaryDNS.outgoing.enable(zoneId) -> OutgoingEnableResponse - client.secondaryDNS.outgoing.forceNotify(zoneId) -> OutgoingForceNotifyResponse - client.secondaryDNS.outgoing.get(zoneId) -> OutgoingGetResponse -- client.secondaryDNS.outgoing.replace(zoneId, { ...params }) -> OutgoingReplaceResponse ### Status @@ -1767,54 +1775,54 @@ Methods: Types: - ACLCreateResponse +- ACLUpdateResponse - ACLListResponse - ACLDeleteResponse - ACLGetResponse -- ACLReplaceResponse Methods: - client.secondaryDNS.acls.create(accountId, { ...params }) -> ACLCreateResponse +- client.secondaryDNS.acls.update(accountId, aclId, { ...params }) -> ACLUpdateResponse - client.secondaryDNS.acls.list(accountId) -> ACLListResponse | null - client.secondaryDNS.acls.delete(accountId, aclId) -> ACLDeleteResponse - client.secondaryDNS.acls.get(accountId, aclId) -> ACLGetResponse -- client.secondaryDNS.acls.replace(accountId, aclId, { ...params }) -> ACLReplaceResponse ## Peers Types: - PeerCreateResponse +- PeerUpdateResponse - PeerListResponse - PeerDeleteResponse - PeerGetResponse -- PeerReplaceResponse Methods: - client.secondaryDNS.peers.create(accountId, { ...params }) -> PeerCreateResponse +- client.secondaryDNS.peers.update(accountId, peerId, { ...params }) -> PeerUpdateResponse - client.secondaryDNS.peers.list(accountId) -> PeerListResponse | null - client.secondaryDNS.peers.delete(accountId, peerId) -> PeerDeleteResponse - client.secondaryDNS.peers.get(accountId, peerId) -> PeerGetResponse -- client.secondaryDNS.peers.replace(accountId, peerId, { ...params }) -> PeerReplaceResponse ## Tsigs Types: - TsigCreateResponse +- TsigUpdateResponse - TsigListResponse - TsigDeleteResponse - TsigGetResponse -- TsigReplaceResponse Methods: - client.secondaryDNS.tsigs.create(accountId, { ...params }) -> TsigCreateResponse +- client.secondaryDNS.tsigs.update(accountId, tsigId, { ...params }) -> TsigUpdateResponse - client.secondaryDNS.tsigs.list(accountId) -> TsigListResponse | null - client.secondaryDNS.tsigs.delete(accountId, tsigId) -> TsigDeleteResponse - client.secondaryDNS.tsigs.get(accountId, tsigId) -> TsigGetResponse -- client.secondaryDNS.tsigs.replace(accountId, tsigId, { ...params }) -> TsigReplaceResponse # Settings @@ -1832,12 +1840,12 @@ Methods: Types: -- ZeroRttUpdateResponse +- ZeroRttEditResponse - ZeroRttGetResponse Methods: -- client.settings.zeroRtt.update(zoneId, { ...params }) -> ZeroRttUpdateResponse +- client.settings.zeroRtt.edit(zoneId, { ...params }) -> ZeroRttEditResponse - client.settings.zeroRtt.get(zoneId) -> ZeroRttGetResponse ## AdvancedDDOS @@ -1854,588 +1862,588 @@ Methods: Types: -- AlwaysOnlineUpdateResponse +- AlwaysOnlineEditResponse - AlwaysOnlineGetResponse Methods: -- client.settings.alwaysOnline.update(zoneId, { ...params }) -> AlwaysOnlineUpdateResponse +- client.settings.alwaysOnline.edit(zoneId, { ...params }) -> AlwaysOnlineEditResponse - client.settings.alwaysOnline.get(zoneId) -> AlwaysOnlineGetResponse ## AlwaysUseHTTPS Types: -- AlwaysUseHTTPSUpdateResponse +- AlwaysUseHTTPSEditResponse - AlwaysUseHTTPSGetResponse Methods: -- client.settings.alwaysUseHTTPS.update(zoneId, { ...params }) -> AlwaysUseHTTPSUpdateResponse +- client.settings.alwaysUseHTTPS.edit(zoneId, { ...params }) -> AlwaysUseHTTPSEditResponse - client.settings.alwaysUseHTTPS.get(zoneId) -> AlwaysUseHTTPSGetResponse ## AutomaticHTTPSRewrites Types: -- AutomaticHTTPSRewriteUpdateResponse +- AutomaticHTTPSRewriteEditResponse - AutomaticHTTPSRewriteGetResponse Methods: -- client.settings.automaticHTTPSRewrites.update(zoneId, { ...params }) -> AutomaticHTTPSRewriteUpdateResponse +- client.settings.automaticHTTPSRewrites.edit(zoneId, { ...params }) -> AutomaticHTTPSRewriteEditResponse - client.settings.automaticHTTPSRewrites.get(zoneId) -> AutomaticHTTPSRewriteGetResponse ## AutomaticPlatformOptimization Types: -- AutomaticPlatformOptimizationUpdateResponse +- AutomaticPlatformOptimizationEditResponse - AutomaticPlatformOptimizationGetResponse Methods: -- client.settings.automaticPlatformOptimization.update(zoneId, { ...params }) -> AutomaticPlatformOptimizationUpdateResponse +- client.settings.automaticPlatformOptimization.edit(zoneId, { ...params }) -> AutomaticPlatformOptimizationEditResponse - client.settings.automaticPlatformOptimization.get(zoneId) -> AutomaticPlatformOptimizationGetResponse ## Brotli Types: -- BrotliUpdateResponse +- BrotliEditResponse - BrotliGetResponse Methods: -- client.settings.brotli.update(zoneId, { ...params }) -> BrotliUpdateResponse +- client.settings.brotli.edit(zoneId, { ...params }) -> BrotliEditResponse - client.settings.brotli.get(zoneId) -> BrotliGetResponse ## BrowserCacheTTL Types: -- BrowserCacheTTLUpdateResponse +- BrowserCacheTTLEditResponse - BrowserCacheTTLGetResponse Methods: -- client.settings.browserCacheTTL.update(zoneId, { ...params }) -> BrowserCacheTTLUpdateResponse +- client.settings.browserCacheTTL.edit(zoneId, { ...params }) -> BrowserCacheTTLEditResponse - client.settings.browserCacheTTL.get(zoneId) -> BrowserCacheTTLGetResponse ## BrowserCheck Types: -- BrowserCheckUpdateResponse +- BrowserCheckEditResponse - BrowserCheckGetResponse Methods: -- client.settings.browserCheck.update(zoneId, { ...params }) -> BrowserCheckUpdateResponse +- client.settings.browserCheck.edit(zoneId, { ...params }) -> BrowserCheckEditResponse - client.settings.browserCheck.get(zoneId) -> BrowserCheckGetResponse ## CacheLevel Types: -- CacheLevelUpdateResponse +- CacheLevelEditResponse - CacheLevelGetResponse Methods: -- client.settings.cacheLevel.update(zoneId, { ...params }) -> CacheLevelUpdateResponse +- client.settings.cacheLevel.edit(zoneId, { ...params }) -> CacheLevelEditResponse - client.settings.cacheLevel.get(zoneId) -> CacheLevelGetResponse ## ChallengeTTL Types: -- ChallengeTTLUpdateResponse +- ChallengeTTLEditResponse - ChallengeTTLGetResponse Methods: -- client.settings.challengeTTL.update(zoneId, { ...params }) -> ChallengeTTLUpdateResponse +- client.settings.challengeTTL.edit(zoneId, { ...params }) -> ChallengeTTLEditResponse - client.settings.challengeTTL.get(zoneId) -> ChallengeTTLGetResponse ## Ciphers Types: -- CipherUpdateResponse +- CipherEditResponse - CipherGetResponse Methods: -- client.settings.ciphers.update(zoneId, { ...params }) -> CipherUpdateResponse +- client.settings.ciphers.edit(zoneId, { ...params }) -> CipherEditResponse - client.settings.ciphers.get(zoneId) -> CipherGetResponse ## DevelopmentMode Types: -- DevelopmentModeUpdateResponse +- DevelopmentModeEditResponse - DevelopmentModeGetResponse Methods: -- client.settings.developmentMode.update(zoneId, { ...params }) -> DevelopmentModeUpdateResponse +- client.settings.developmentMode.edit(zoneId, { ...params }) -> DevelopmentModeEditResponse - client.settings.developmentMode.get(zoneId) -> DevelopmentModeGetResponse ## EarlyHints Types: -- EarlyHintUpdateResponse +- EarlyHintEditResponse - EarlyHintGetResponse Methods: -- client.settings.earlyHints.update(zoneId, { ...params }) -> EarlyHintUpdateResponse +- client.settings.earlyHints.edit(zoneId, { ...params }) -> EarlyHintEditResponse - client.settings.earlyHints.get(zoneId) -> EarlyHintGetResponse ## EmailObfuscation Types: -- EmailObfuscationUpdateResponse +- EmailObfuscationEditResponse - EmailObfuscationGetResponse Methods: -- client.settings.emailObfuscation.update(zoneId, { ...params }) -> EmailObfuscationUpdateResponse +- client.settings.emailObfuscation.edit(zoneId, { ...params }) -> EmailObfuscationEditResponse - client.settings.emailObfuscation.get(zoneId) -> EmailObfuscationGetResponse ## H2Prioritization Types: -- H2PrioritizationUpdateResponse +- H2PrioritizationEditResponse - H2PrioritizationGetResponse Methods: -- client.settings.h2Prioritization.update(zoneId, { ...params }) -> H2PrioritizationUpdateResponse +- client.settings.h2Prioritization.edit(zoneId, { ...params }) -> H2PrioritizationEditResponse - client.settings.h2Prioritization.get(zoneId) -> H2PrioritizationGetResponse ## HotlinkProtection Types: -- HotlinkProtectionUpdateResponse +- HotlinkProtectionEditResponse - HotlinkProtectionGetResponse Methods: -- client.settings.hotlinkProtection.update(zoneId, { ...params }) -> HotlinkProtectionUpdateResponse +- client.settings.hotlinkProtection.edit(zoneId, { ...params }) -> HotlinkProtectionEditResponse - client.settings.hotlinkProtection.get(zoneId) -> HotlinkProtectionGetResponse ## HTTP2 Types: -- HTTP2UpdateResponse +- HTTP2EditResponse - HTTP2GetResponse Methods: -- client.settings.http2.update(zoneId, { ...params }) -> HTTP2UpdateResponse +- client.settings.http2.edit(zoneId, { ...params }) -> HTTP2EditResponse - client.settings.http2.get(zoneId) -> HTTP2GetResponse ## HTTP3 Types: -- HTTP3UpdateResponse +- HTTP3EditResponse - HTTP3GetResponse Methods: -- client.settings.http3.update(zoneId, { ...params }) -> HTTP3UpdateResponse +- client.settings.http3.edit(zoneId, { ...params }) -> HTTP3EditResponse - client.settings.http3.get(zoneId) -> HTTP3GetResponse ## ImageResizing Types: -- ImageResizingUpdateResponse +- ImageResizingEditResponse - ImageResizingGetResponse Methods: -- client.settings.imageResizing.update(zoneId, { ...params }) -> ImageResizingUpdateResponse +- client.settings.imageResizing.edit(zoneId, { ...params }) -> ImageResizingEditResponse - client.settings.imageResizing.get(zoneId) -> ImageResizingGetResponse ## IPGeolocation Types: -- IPGeolocationUpdateResponse +- IPGeolocationEditResponse - IPGeolocationGetResponse Methods: -- client.settings.ipGeolocation.update(zoneId, { ...params }) -> IPGeolocationUpdateResponse +- client.settings.ipGeolocation.edit(zoneId, { ...params }) -> IPGeolocationEditResponse - client.settings.ipGeolocation.get(zoneId) -> IPGeolocationGetResponse ## IPV6 Types: -- IPV6UpdateResponse +- IPV6EditResponse - IPV6GetResponse Methods: -- client.settings.ipv6.update(zoneId, { ...params }) -> IPV6UpdateResponse +- client.settings.ipv6.edit(zoneId, { ...params }) -> IPV6EditResponse - client.settings.ipv6.get(zoneId) -> IPV6GetResponse ## MinTLSVersion Types: -- MinTLSVersionUpdateResponse +- MinTLSVersionEditResponse - MinTLSVersionGetResponse Methods: -- client.settings.minTLSVersion.update(zoneId, { ...params }) -> MinTLSVersionUpdateResponse +- client.settings.minTLSVersion.edit(zoneId, { ...params }) -> MinTLSVersionEditResponse - client.settings.minTLSVersion.get(zoneId) -> MinTLSVersionGetResponse ## Minify Types: -- MinifyUpdateResponse +- MinifyEditResponse - MinifyGetResponse Methods: -- client.settings.minify.update(zoneId, { ...params }) -> MinifyUpdateResponse +- client.settings.minify.edit(zoneId, { ...params }) -> MinifyEditResponse - client.settings.minify.get(zoneId) -> MinifyGetResponse ## Mirage Types: -- MirageUpdateResponse +- MirageEditResponse - MirageGetResponse Methods: -- client.settings.mirage.update(zoneId, { ...params }) -> MirageUpdateResponse +- client.settings.mirage.edit(zoneId, { ...params }) -> MirageEditResponse - client.settings.mirage.get(zoneId) -> MirageGetResponse ## MobileRedirect Types: -- MobileRedirectUpdateResponse +- MobileRedirectEditResponse - MobileRedirectGetResponse Methods: -- client.settings.mobileRedirect.update(zoneId, { ...params }) -> MobileRedirectUpdateResponse +- client.settings.mobileRedirect.edit(zoneId, { ...params }) -> MobileRedirectEditResponse - client.settings.mobileRedirect.get(zoneId) -> MobileRedirectGetResponse ## NEL Types: -- NELUpdateResponse +- NELEditResponse - NELGetResponse Methods: -- client.settings.nel.update(zoneId, { ...params }) -> NELUpdateResponse +- client.settings.nel.edit(zoneId, { ...params }) -> NELEditResponse - client.settings.nel.get(zoneId) -> NELGetResponse ## OpportunisticEncryption Types: -- OpportunisticEncryptionUpdateResponse +- OpportunisticEncryptionEditResponse - OpportunisticEncryptionGetResponse Methods: -- client.settings.opportunisticEncryption.update(zoneId, { ...params }) -> OpportunisticEncryptionUpdateResponse +- client.settings.opportunisticEncryption.edit(zoneId, { ...params }) -> OpportunisticEncryptionEditResponse - client.settings.opportunisticEncryption.get(zoneId) -> OpportunisticEncryptionGetResponse ## OpportunisticOnion Types: -- OpportunisticOnionUpdateResponse +- OpportunisticOnionEditResponse - OpportunisticOnionGetResponse Methods: -- client.settings.opportunisticOnion.update(zoneId, { ...params }) -> OpportunisticOnionUpdateResponse +- client.settings.opportunisticOnion.edit(zoneId, { ...params }) -> OpportunisticOnionEditResponse - client.settings.opportunisticOnion.get(zoneId) -> OpportunisticOnionGetResponse ## OrangeToOrange Types: -- OrangeToOrangeUpdateResponse +- OrangeToOrangeEditResponse - OrangeToOrangeGetResponse Methods: -- client.settings.orangeToOrange.update(zoneId, { ...params }) -> OrangeToOrangeUpdateResponse +- client.settings.orangeToOrange.edit(zoneId, { ...params }) -> OrangeToOrangeEditResponse - client.settings.orangeToOrange.get(zoneId) -> OrangeToOrangeGetResponse ## OriginErrorPagePassThru Types: -- OriginErrorPagePassThruUpdateResponse +- OriginErrorPagePassThruEditResponse - OriginErrorPagePassThruGetResponse Methods: -- client.settings.originErrorPagePassThru.update(zoneId, { ...params }) -> OriginErrorPagePassThruUpdateResponse +- client.settings.originErrorPagePassThru.edit(zoneId, { ...params }) -> OriginErrorPagePassThruEditResponse - client.settings.originErrorPagePassThru.get(zoneId) -> OriginErrorPagePassThruGetResponse ## OriginMaxHTTPVersion Types: -- OriginMaxHTTPVersionUpdateResponse +- OriginMaxHTTPVersionEditResponse - OriginMaxHTTPVersionGetResponse Methods: -- client.settings.originMaxHTTPVersion.update(zoneId, { ...params }) -> OriginMaxHTTPVersionUpdateResponse +- client.settings.originMaxHTTPVersion.edit(zoneId, { ...params }) -> OriginMaxHTTPVersionEditResponse - client.settings.originMaxHTTPVersion.get(zoneId) -> OriginMaxHTTPVersionGetResponse ## Polish Types: -- PolishUpdateResponse +- PolishEditResponse - PolishGetResponse Methods: -- client.settings.polish.update(zoneId, { ...params }) -> PolishUpdateResponse +- client.settings.polish.edit(zoneId, { ...params }) -> PolishEditResponse - client.settings.polish.get(zoneId) -> PolishGetResponse ## PrefetchPreload Types: -- PrefetchPreloadUpdateResponse +- PrefetchPreloadEditResponse - PrefetchPreloadGetResponse Methods: -- client.settings.prefetchPreload.update(zoneId, { ...params }) -> PrefetchPreloadUpdateResponse +- client.settings.prefetchPreload.edit(zoneId, { ...params }) -> PrefetchPreloadEditResponse - client.settings.prefetchPreload.get(zoneId) -> PrefetchPreloadGetResponse ## ProxyReadTimeout Types: -- ProxyReadTimeoutUpdateResponse +- ProxyReadTimeoutEditResponse - ProxyReadTimeoutGetResponse Methods: -- client.settings.proxyReadTimeout.update(zoneId, { ...params }) -> ProxyReadTimeoutUpdateResponse +- client.settings.proxyReadTimeout.edit(zoneId, { ...params }) -> ProxyReadTimeoutEditResponse - client.settings.proxyReadTimeout.get(zoneId) -> ProxyReadTimeoutGetResponse ## PseudoIPV4 Types: -- PseudoIPV4UpdateResponse +- PseudoIPV4EditResponse - PseudoIPV4GetResponse Methods: -- client.settings.pseudoIPV4.update(zoneId, { ...params }) -> PseudoIPV4UpdateResponse +- client.settings.pseudoIPV4.edit(zoneId, { ...params }) -> PseudoIPV4EditResponse - client.settings.pseudoIPV4.get(zoneId) -> PseudoIPV4GetResponse ## ResponseBuffering Types: -- ResponseBufferingUpdateResponse +- ResponseBufferingEditResponse - ResponseBufferingGetResponse Methods: -- client.settings.responseBuffering.update(zoneId, { ...params }) -> ResponseBufferingUpdateResponse +- client.settings.responseBuffering.edit(zoneId, { ...params }) -> ResponseBufferingEditResponse - client.settings.responseBuffering.get(zoneId) -> ResponseBufferingGetResponse ## RocketLoader Types: -- RocketLoaderUpdateResponse +- RocketLoaderEditResponse - RocketLoaderGetResponse Methods: -- client.settings.rocketLoader.update(zoneId, { ...params }) -> RocketLoaderUpdateResponse +- client.settings.rocketLoader.edit(zoneId, { ...params }) -> RocketLoaderEditResponse - client.settings.rocketLoader.get(zoneId) -> RocketLoaderGetResponse ## SecurityHeaders Types: -- SecurityHeaderUpdateResponse +- SecurityHeaderEditResponse - SecurityHeaderGetResponse Methods: -- client.settings.securityHeaders.update(zoneId, { ...params }) -> SecurityHeaderUpdateResponse +- client.settings.securityHeaders.edit(zoneId, { ...params }) -> SecurityHeaderEditResponse - client.settings.securityHeaders.get(zoneId) -> SecurityHeaderGetResponse ## SecurityLevel Types: -- SecurityLevelUpdateResponse +- SecurityLevelEditResponse - SecurityLevelGetResponse Methods: -- client.settings.securityLevel.update(zoneId, { ...params }) -> SecurityLevelUpdateResponse +- client.settings.securityLevel.edit(zoneId, { ...params }) -> SecurityLevelEditResponse - client.settings.securityLevel.get(zoneId) -> SecurityLevelGetResponse ## ServerSideExcludes Types: -- ServerSideExcludeUpdateResponse +- ServerSideExcludeEditResponse - ServerSideExcludeGetResponse Methods: -- client.settings.serverSideExcludes.update(zoneId, { ...params }) -> ServerSideExcludeUpdateResponse +- client.settings.serverSideExcludes.edit(zoneId, { ...params }) -> ServerSideExcludeEditResponse - client.settings.serverSideExcludes.get(zoneId) -> ServerSideExcludeGetResponse ## SortQueryStringForCache Types: -- SortQueryStringForCacheUpdateResponse +- SortQueryStringForCacheEditResponse - SortQueryStringForCacheGetResponse Methods: -- client.settings.sortQueryStringForCache.update(zoneId, { ...params }) -> SortQueryStringForCacheUpdateResponse +- client.settings.sortQueryStringForCache.edit(zoneId, { ...params }) -> SortQueryStringForCacheEditResponse - client.settings.sortQueryStringForCache.get(zoneId) -> SortQueryStringForCacheGetResponse ## SSL Types: -- SSLUpdateResponse +- SSLEditResponse - SSLGetResponse Methods: -- client.settings.ssl.update(zoneId, { ...params }) -> SSLUpdateResponse +- client.settings.ssl.edit(zoneId, { ...params }) -> SSLEditResponse - client.settings.ssl.get(zoneId) -> SSLGetResponse ## SSLRecommender Types: -- SSLRecommenderUpdateResponse +- SSLRecommenderEditResponse - SSLRecommenderGetResponse Methods: -- client.settings.sslRecommender.update(zoneId, { ...params }) -> SSLRecommenderUpdateResponse +- client.settings.sslRecommender.edit(zoneId, { ...params }) -> SSLRecommenderEditResponse - client.settings.sslRecommender.get(zoneId) -> SSLRecommenderGetResponse ## TLS1_3 Types: -- TLS1_3UpdateResponse +- TLS1_3EditResponse - TLS1_3GetResponse Methods: -- client.settings.tls1_3.update(zoneId, { ...params }) -> TLS1_3UpdateResponse +- client.settings.tls1_3.edit(zoneId, { ...params }) -> TLS1_3EditResponse - client.settings.tls1_3.get(zoneId) -> TLS1_3GetResponse ## TLSClientAuth Types: -- TLSClientAuthUpdateResponse +- TLSClientAuthEditResponse - TLSClientAuthGetResponse Methods: -- client.settings.tlsClientAuth.update(zoneId, { ...params }) -> TLSClientAuthUpdateResponse +- client.settings.tlsClientAuth.edit(zoneId, { ...params }) -> TLSClientAuthEditResponse - client.settings.tlsClientAuth.get(zoneId) -> TLSClientAuthGetResponse ## TrueClientIPHeader Types: -- TrueClientIPHeaderUpdateResponse +- TrueClientIPHeaderEditResponse - TrueClientIPHeaderGetResponse Methods: -- client.settings.trueClientIPHeader.update(zoneId, { ...params }) -> TrueClientIPHeaderUpdateResponse +- client.settings.trueClientIPHeader.edit(zoneId, { ...params }) -> TrueClientIPHeaderEditResponse - client.settings.trueClientIPHeader.get(zoneId) -> TrueClientIPHeaderGetResponse ## WAF Types: -- WAFUpdateResponse +- WAFEditResponse - WAFGetResponse Methods: -- client.settings.waf.update(zoneId, { ...params }) -> WAFUpdateResponse +- client.settings.waf.edit(zoneId, { ...params }) -> WAFEditResponse - client.settings.waf.get(zoneId) -> WAFGetResponse ## Webp Types: -- WebpUpdateResponse +- WebpEditResponse - WebpGetResponse Methods: -- client.settings.webp.update(zoneId, { ...params }) -> WebpUpdateResponse +- client.settings.webp.edit(zoneId, { ...params }) -> WebpEditResponse - client.settings.webp.get(zoneId) -> WebpGetResponse ## Websocket Types: -- WebsocketUpdateResponse +- WebsocketEditResponse - WebsocketGetResponse Methods: -- client.settings.websocket.update(zoneId, { ...params }) -> WebsocketUpdateResponse +- client.settings.websocket.edit(zoneId, { ...params }) -> WebsocketEditResponse - client.settings.websocket.get(zoneId) -> WebsocketGetResponse ## FontSettings Types: -- FontSettingUpdateResponse +- FontSettingEditResponse - FontSettingGetResponse Methods: -- client.settings.fontSettings.update(zoneId, { ...params }) -> FontSettingUpdateResponse +- client.settings.fontSettings.edit(zoneId, { ...params }) -> FontSettingEditResponse - client.settings.fontSettings.get(zoneId) -> FontSettingGetResponse # WaitingRooms @@ -2443,38 +2451,38 @@ Methods: Types: - WaitingRoomCreateResponse +- WaitingRoomUpdateResponse - WaitingRoomListResponse - WaitingRoomDeleteResponse - WaitingRoomGetResponse - WaitingRoomPreviewResponse -- WaitingRoomReplaceResponse Methods: - client.waitingRooms.create(zoneIdentifier, { ...params }) -> WaitingRoomCreateResponse +- client.waitingRooms.update(zoneIdentifier, waitingRoomId, { ...params }) -> WaitingRoomUpdateResponse - client.waitingRooms.list(zoneIdentifier) -> WaitingRoomListResponse | null - client.waitingRooms.delete(zoneIdentifier, waitingRoomId) -> WaitingRoomDeleteResponse - client.waitingRooms.get(zoneIdentifier, waitingRoomId) -> WaitingRoomGetResponse - client.waitingRooms.preview(zoneIdentifier, { ...params }) -> WaitingRoomPreviewResponse -- client.waitingRooms.replace(zoneIdentifier, waitingRoomId, { ...params }) -> WaitingRoomReplaceResponse ## Events Types: - EventCreateResponse +- EventUpdateResponse - EventListResponse - EventDeleteResponse - EventGetResponse -- EventReplaceResponse Methods: - client.waitingRooms.events.create(zoneIdentifier, waitingRoomId, { ...params }) -> EventCreateResponse +- client.waitingRooms.events.update(zoneIdentifier, waitingRoomId, eventId, { ...params }) -> EventUpdateResponse - client.waitingRooms.events.list(zoneIdentifier, waitingRoomId) -> EventListResponse | null - client.waitingRooms.events.delete(zoneIdentifier, waitingRoomId, eventId) -> EventDeleteResponse - client.waitingRooms.events.get(zoneIdentifier, waitingRoomId, eventId) -> EventGetResponse -- client.waitingRooms.events.replace(zoneIdentifier, waitingRoomId, eventId, { ...params }) -> EventReplaceResponse ### Details @@ -2494,15 +2502,15 @@ Types: - RuleUpdateResponse - RuleListResponse - RuleDeleteResponse -- RuleReplaceResponse +- RuleEditResponse Methods: - client.waitingRooms.rules.create(zoneIdentifier, waitingRoomId, { ...params }) -> RuleCreateResponse | null -- client.waitingRooms.rules.update(zoneIdentifier, waitingRoomId, ruleId, { ...params }) -> RuleUpdateResponse | null +- client.waitingRooms.rules.update(zoneIdentifier, waitingRoomId, [ ...body ]) -> RuleUpdateResponse | null - client.waitingRooms.rules.list(zoneIdentifier, waitingRoomId) -> RuleListResponse | null - client.waitingRooms.rules.delete(zoneIdentifier, waitingRoomId, ruleId) -> RuleDeleteResponse | null -- client.waitingRooms.rules.replace(zoneIdentifier, waitingRoomId, [ ...body ]) -> RuleReplaceResponse | null +- client.waitingRooms.rules.edit(zoneIdentifier, waitingRoomId, ruleId, { ...params }) -> RuleEditResponse | null ## Statuses @@ -2519,12 +2527,12 @@ Methods: Types: - WaitingroomZoneSettingsResponse -- SettingUpdateResponse +- SettingEditResponse - SettingGetResponse Methods: -- client.waitingRooms.settings.update(zoneIdentifier, { ...params }) -> SettingUpdateResponse +- client.waitingRooms.settings.edit(zoneIdentifier, { ...params }) -> SettingEditResponse - client.waitingRooms.settings.get(zoneIdentifier) -> SettingGetResponse # Web3 @@ -2534,17 +2542,17 @@ Methods: Types: - HostnameCreateResponse -- HostnameUpdateResponse - HostnameListResponse - HostnameDeleteResponse +- HostnameEditResponse - HostnameGetResponse Methods: - client.web3.hostnames.create(zoneIdentifier, { ...params }) -> HostnameCreateResponse -- client.web3.hostnames.update(zoneIdentifier, identifier, { ...params }) -> HostnameUpdateResponse - client.web3.hostnames.list(zoneIdentifier) -> HostnameListResponse | null - client.web3.hostnames.delete(zoneIdentifier, identifier) -> HostnameDeleteResponse | null +- client.web3.hostnames.edit(zoneIdentifier, identifier, { ...params }) -> HostnameEditResponse - client.web3.hostnames.get(zoneIdentifier, identifier) -> HostnameGetResponse ### IpfsUniversalPaths @@ -2553,31 +2561,31 @@ Methods: Types: +- ContentListUpdateResponse - ContentListListResponse -- ContentListReplaceResponse Methods: +- client.web3.hostnames.ipfsUniversalPaths.contentLists.update(zoneIdentifier, identifier, { ...params }) -> ContentListUpdateResponse - client.web3.hostnames.ipfsUniversalPaths.contentLists.list(zoneIdentifier, identifier) -> ContentListListResponse -- client.web3.hostnames.ipfsUniversalPaths.contentLists.replace(zoneIdentifier, identifier, { ...params }) -> ContentListReplaceResponse ##### Entries Types: - EntryCreateResponse +- EntryUpdateResponse - EntryListResponse - EntryDeleteResponse - EntryGetResponse -- EntryReplaceResponse Methods: - client.web3.hostnames.ipfsUniversalPaths.contentLists.entries.create(zoneIdentifier, identifier, { ...params }) -> EntryCreateResponse +- client.web3.hostnames.ipfsUniversalPaths.contentLists.entries.update(zoneIdentifier, identifier, contentListEntryIdentifier, { ...params }) -> EntryUpdateResponse - client.web3.hostnames.ipfsUniversalPaths.contentLists.entries.list(zoneIdentifier, identifier) -> EntryListResponse | null - client.web3.hostnames.ipfsUniversalPaths.contentLists.entries.delete(zoneIdentifier, identifier, contentListEntryIdentifier) -> EntryDeleteResponse | null - client.web3.hostnames.ipfsUniversalPaths.contentLists.entries.get(zoneIdentifier, identifier, contentListEntryIdentifier) -> EntryGetResponse -- client.web3.hostnames.ipfsUniversalPaths.contentLists.entries.replace(zoneIdentifier, identifier, contentListEntryIdentifier, { ...params }) -> EntryReplaceResponse # Workers @@ -2585,15 +2593,15 @@ Methods: Types: +- ScriptUpdateResponse - ScriptListResponse -- ScriptReplaceResponse Methods: +- client.workers.scripts.update(accountId, scriptName, { ...params }) -> ScriptUpdateResponse - client.workers.scripts.list(accountId) -> ScriptListResponse - client.workers.scripts.delete(accountId, scriptName, { ...params }) -> void - client.workers.scripts.get(accountId, scriptName) -> Response -- client.workers.scripts.replace(accountId, scriptName, { ...params }) -> ScriptReplaceResponse ### Bindings @@ -2609,13 +2617,13 @@ Methods: Types: +- ScheduleUpdateResponse - ScheduleListResponse -- ScheduleReplaceResponse Methods: +- client.workers.scripts.schedules.update(accountId, scriptName, { ...params }) -> ScheduleUpdateResponse - client.workers.scripts.schedules.list(accountId, scriptName) -> ScheduleListResponse -- client.workers.scripts.schedules.replace(accountId, scriptName, { ...params }) -> ScheduleReplaceResponse ### Tail @@ -2635,59 +2643,59 @@ Methods: Types: +- UsageModelUpdateResponse - UsageModelGetResponse -- UsageModelReplaceResponse Methods: +- client.workers.scripts.usageModel.update(accountId, scriptName, { ...params }) -> UsageModelUpdateResponse - client.workers.scripts.usageModel.get(accountId, scriptName) -> UsageModelGetResponse -- client.workers.scripts.usageModel.replace(accountId, scriptName, { ...params }) -> UsageModelReplaceResponse ## Filters Types: - FilterCreateResponse +- FilterUpdateResponse - FilterListResponse - FilterDeleteResponse -- FilterReplaceResponse Methods: - client.workers.filters.create(zoneId, { ...params }) -> FilterCreateResponse | null +- client.workers.filters.update(zoneId, filterId, { ...params }) -> FilterUpdateResponse - client.workers.filters.list(zoneId) -> FilterListResponse - client.workers.filters.delete(zoneId, filterId) -> FilterDeleteResponse | null -- client.workers.filters.replace(zoneId, filterId, { ...params }) -> FilterReplaceResponse ## Routes Types: - RouteCreateResponse +- RouteUpdateResponse - RouteListResponse - RouteDeleteResponse - RouteGetResponse -- RouteReplaceResponse Methods: - client.workers.routes.create(zoneId, { ...params }) -> RouteCreateResponse +- client.workers.routes.update(zoneId, routeId, { ...params }) -> RouteUpdateResponse - client.workers.routes.list(zoneId) -> RouteListResponse - client.workers.routes.delete(zoneId, routeId) -> RouteDeleteResponse - client.workers.routes.get(zoneId, routeId) -> RouteGetResponse -- client.workers.routes.replace(zoneId, routeId, { ...params }) -> RouteReplaceResponse ## AccountSettings Types: +- AccountSettingUpdateResponse - AccountSettingGetResponse -- AccountSettingReplaceResponse Methods: +- client.workers.accountSettings.update(accountId, { ...params }) -> AccountSettingUpdateResponse - client.workers.accountSettings.get(accountId) -> AccountSettingGetResponse -- client.workers.accountSettings.replace(accountId, { ...params }) -> AccountSettingReplaceResponse ## Deployments @@ -2707,16 +2715,16 @@ Methods: Types: +- DomainUpdateResponse - DomainListResponse - DomainGetResponse -- DomainReplaceResponse Methods: +- client.workers.domains.update(accountId, { ...params }) -> DomainUpdateResponse - client.workers.domains.list(accountId, { ...params }) -> DomainListResponse - client.workers.domains.delete(accountId, domainId) -> void - client.workers.domains.get(accountId, domainId) -> DomainGetResponse -- client.workers.domains.replace(accountId, { ...params }) -> DomainReplaceResponse ## DurableObjects @@ -2745,46 +2753,46 @@ Methods: Types: - QueueCreateResponse +- QueueUpdateResponse - QueueListResponse - QueueDeleteResponse - QueueGetResponse -- QueueReplaceResponse Methods: - client.workers.queues.create(accountId, { ...params }) -> QueueCreateResponse | null +- client.workers.queues.update(accountId, name, { ...params }) -> QueueUpdateResponse | null - client.workers.queues.list(accountId) -> QueueListResponse | null - client.workers.queues.delete(accountId, name) -> QueueDeleteResponse | null - client.workers.queues.get(accountId, name) -> QueueGetResponse | null -- client.workers.queues.replace(accountId, name, { ...params }) -> QueueReplaceResponse | null ### Consumers Types: - ConsumerCreateResponse +- ConsumerUpdateResponse - ConsumerListResponse - ConsumerDeleteResponse -- ConsumerReplaceResponse Methods: - client.workers.queues.consumers.create(accountId, name, { ...params }) -> ConsumerCreateResponse | null +- client.workers.queues.consumers.update(accountId, name, consumerName, { ...params }) -> ConsumerUpdateResponse | null - client.workers.queues.consumers.list(accountId, name) -> ConsumerListResponse | null - client.workers.queues.consumers.delete(accountId, name, consumerName) -> ConsumerDeleteResponse | null -- client.workers.queues.consumers.replace(accountId, name, consumerName, { ...params }) -> ConsumerReplaceResponse | null ## Subdomains Types: +- SubdomainUpdateResponse - SubdomainGetResponse -- SubdomainReplaceResponse Methods: +- client.workers.subdomains.update(accountId, { ...params }) -> SubdomainUpdateResponse - client.workers.subdomains.get(accountId) -> SubdomainGetResponse -- client.workers.subdomains.replace(accountId, { ...params }) -> SubdomainReplaceResponse ## DeploymentsByScript @@ -2806,23 +2814,23 @@ Methods: Types: -- ContentReplaceResponse +- ContentUpdateResponse Methods: +- client.workers.services.environments.content.update(accountId, serviceName, environmentName, { ...params }) -> ContentUpdateResponse - client.workers.services.environments.content.get(accountId, serviceName, environmentName) -> Response -- client.workers.services.environments.content.replace(accountId, serviceName, environmentName, { ...params }) -> ContentReplaceResponse #### Settings Types: -- SettingUpdateResponse +- SettingEditResponse - SettingGetResponse Methods: -- client.workers.services.environments.settings.update(accountId, serviceName, environmentName, { ...params }) -> SettingUpdateResponse +- client.workers.services.environments.settings.edit(accountId, serviceName, environmentName, { ...params }) -> SettingEditResponse - client.workers.services.environments.settings.get(accountId, serviceName, environmentName) -> SettingGetResponse ## Script @@ -2835,52 +2843,52 @@ Methods: Types: -- ActivationCheckReplaceResponse +- ActivationCheckUpdateResponse Methods: -- client.activationChecks.replace(zoneId) -> ActivationCheckReplaceResponse +- client.activationChecks.update(zoneId) -> ActivationCheckUpdateResponse # ManagedHeaders Types: -- ManagedHeaderUpdateResponse - ManagedHeaderListResponse +- ManagedHeaderEditResponse Methods: -- client.managedHeaders.update(zoneId, { ...params }) -> ManagedHeaderUpdateResponse - client.managedHeaders.list(zoneId) -> ManagedHeaderListResponse +- client.managedHeaders.edit(zoneId, { ...params }) -> ManagedHeaderEditResponse # PageShield Types: +- PageShieldUpdateResponse - PageShieldListResponse -- PageShieldReplaceResponse Methods: +- client.pageShield.update(zoneId, { ...params }) -> PageShieldUpdateResponse - client.pageShield.list(zoneId) -> PageShieldListResponse -- client.pageShield.replace(zoneId, { ...params }) -> PageShieldReplaceResponse ## Policies Types: - PolicyCreateResponse +- PolicyUpdateResponse - PolicyListResponse - PolicyGetResponse -- PolicyReplaceResponse Methods: - client.pageShield.policies.create(zoneId, { ...params }) -> PolicyCreateResponse +- client.pageShield.policies.update(zoneId, policyId, { ...params }) -> PolicyUpdateResponse - client.pageShield.policies.list(zoneId) -> PolicyListResponse | null - client.pageShield.policies.delete(zoneId, policyId) -> void - client.pageShield.policies.get(zoneId, policyId) -> PolicyGetResponse -- client.pageShield.policies.replace(zoneId, policyId, { ...params }) -> PolicyReplaceResponse ## Connections @@ -2911,17 +2919,17 @@ Methods: Types: - RulesetCreateResponse +- RulesetUpdateResponse - RulesetListResponse - RulesetGetResponse -- RulesetReplaceResponse Methods: - client.rulesets.create(accountOrZone, accountOrZoneId, { ...params }) -> RulesetCreateResponse +- client.rulesets.update(accountOrZone, accountOrZoneId, rulesetId, { ...params }) -> RulesetUpdateResponse - client.rulesets.list(accountOrZone, accountOrZoneId) -> RulesetListResponse - client.rulesets.delete(accountOrZone, accountOrZoneId, rulesetId) -> void - client.rulesets.get(accountOrZone, accountOrZoneId, rulesetId) -> RulesetGetResponse -- client.rulesets.replace(accountOrZone, accountOrZoneId, rulesetId, { ...params }) -> RulesetReplaceResponse ## Phases @@ -2938,14 +2946,14 @@ Methods: Types: - RuleCreateResponse -- RuleUpdateResponse - RuleDeleteResponse +- RuleEditResponse Methods: - client.rulesets.rules.create(accountOrZone, accountOrZoneId, rulesetId, { ...params }) -> RuleCreateResponse -- client.rulesets.rules.update(rulesetId, ruleId, { ...params }) -> RuleUpdateResponse - client.rulesets.rules.delete(accountOrZone, accountOrZoneId, rulesetId, ruleId) -> RuleDeleteResponse +- client.rulesets.rules.edit(rulesetId, ruleId, { ...params }) -> RuleEditResponse ## Versions @@ -2974,13 +2982,13 @@ Methods: Types: +- URLNormalizationUpdateResponse - URLNormalizationGetResponse -- URLNormalizationReplaceResponse Methods: +- client.urlNormalizations.update(zoneId, { ...params }) -> URLNormalizationUpdateResponse - client.urlNormalizations.get(zoneId) -> URLNormalizationGetResponse -- client.urlNormalizations.replace(zoneId, { ...params }) -> URLNormalizationReplaceResponse # Spectrum @@ -3025,18 +3033,18 @@ Methods: Types: - AppCreateResponse +- AppUpdateResponse - AppListResponse - AppDeleteResponse - AppGetResponse -- AppReplaceResponse Methods: - client.spectrum.apps.create(zone, { ...params }) -> AppCreateResponse | null +- client.spectrum.apps.update(zone, appId, { ...params }) -> AppUpdateResponse | null - client.spectrum.apps.list(zone, { ...params }) -> AppListResponsesV4PagePaginationArray - client.spectrum.apps.delete(zone, appId) -> AppDeleteResponse | null - client.spectrum.apps.get(zone, appId) -> AppGetResponse | null -- client.spectrum.apps.replace(zone, appId, { ...params }) -> AppReplaceResponse | null # Addresses @@ -3045,54 +3053,54 @@ Methods: Types: - AddressMapCreateResponse -- AddressMapUpdateResponse - AddressMapListResponse - AddressMapDeleteResponse +- AddressMapEditResponse - AddressMapGetResponse Methods: - client.addresses.addressMaps.create(accountId, { ...params }) -> AddressMapCreateResponse -- client.addresses.addressMaps.update(accountId, addressMapId, { ...params }) -> AddressMapUpdateResponse - client.addresses.addressMaps.list(accountId) -> AddressMapListResponse | null - client.addresses.addressMaps.delete(accountId, addressMapId) -> AddressMapDeleteResponse | null +- client.addresses.addressMaps.edit(accountId, addressMapId, { ...params }) -> AddressMapEditResponse - client.addresses.addressMaps.get(accountId, addressMapId) -> AddressMapGetResponse ### Accounts Types: +- AccountUpdateResponse - AccountDeleteResponse -- AccountReplaceResponse Methods: +- client.addresses.addressMaps.accounts.update(accountId, addressMapId) -> AccountUpdateResponse | null - client.addresses.addressMaps.accounts.delete(accountId, addressMapId) -> AccountDeleteResponse | null -- client.addresses.addressMaps.accounts.replace(accountId, addressMapId) -> AccountReplaceResponse | null ### IPs Types: +- IPUpdateResponse - IPDeleteResponse -- IPReplaceResponse Methods: +- client.addresses.addressMaps.ips.update(accountId, addressMapId, ipAddress) -> IPUpdateResponse | null - client.addresses.addressMaps.ips.delete(accountId, addressMapId, ipAddress) -> IPDeleteResponse | null -- client.addresses.addressMaps.ips.replace(accountId, addressMapId, ipAddress) -> IPReplaceResponse | null ### Zones Types: +- ZoneUpdateResponse - ZoneDeleteResponse -- ZoneReplaceResponse Methods: +- client.addresses.addressMaps.zones.update(accountId, addressMapId, zoneId) -> ZoneUpdateResponse | null - client.addresses.addressMaps.zones.delete(accountId, addressMapId, zoneId) -> ZoneDeleteResponse | null -- client.addresses.addressMaps.zones.replace(accountId, addressMapId, zoneId) -> ZoneReplaceResponse | null ## LoaDocuments @@ -3119,17 +3127,17 @@ Methods: Types: - PrefixCreateResponse -- PrefixUpdateResponse - PrefixListResponse - PrefixDeleteResponse +- PrefixEditResponse - PrefixGetResponse Methods: - client.addresses.prefixes.create(accountId, { ...params }) -> PrefixCreateResponse -- client.addresses.prefixes.update(accountId, prefixId, { ...params }) -> PrefixUpdateResponse - client.addresses.prefixes.list(accountId) -> PrefixListResponse | null - client.addresses.prefixes.delete(accountId, prefixId) -> PrefixDeleteResponse | null +- client.addresses.prefixes.edit(accountId, prefixId, { ...params }) -> PrefixEditResponse - client.addresses.prefixes.get(accountId, prefixId) -> PrefixGetResponse ### BGPs @@ -3138,12 +3146,12 @@ Methods: Types: -- StatusUpdateResponse +- StatusEditResponse - StatusGetResponse Methods: -- client.addresses.prefixes.bgps.statuses.update(accountId, prefixId, { ...params }) -> StatusUpdateResponse +- client.addresses.prefixes.bgps.statuses.edit(accountId, prefixId, { ...params }) -> StatusEditResponse - client.addresses.prefixes.bgps.statuses.get(accountId, prefixId) -> StatusGetResponse ### Delegations @@ -3209,30 +3217,30 @@ Methods: Types: - TunnelCreateResponse -- TunnelUpdateResponse - TunnelListResponse - TunnelDeleteResponse +- TunnelEditResponse - TunnelGetResponse Methods: - client.tunnels.create(accountId, { ...params }) -> TunnelCreateResponse -- client.tunnels.update(accountId, tunnelId, { ...params }) -> TunnelUpdateResponse - client.tunnels.list(accountId, { ...params }) -> TunnelListResponsesV4PagePaginationArray - client.tunnels.delete(accountId, tunnelId, { ...params }) -> TunnelDeleteResponse +- client.tunnels.edit(accountId, tunnelId, { ...params }) -> TunnelEditResponse - client.tunnels.get(accountId, tunnelId) -> TunnelGetResponse ## Configurations Types: +- ConfigurationUpdateResponse - ConfigurationListResponse -- ConfigurationReplaceResponse Methods: +- client.tunnels.configurations.update(accountId, tunnelId, { ...params }) -> ConfigurationUpdateResponse - client.tunnels.configurations.list(accountId, tunnelId) -> ConfigurationListResponse -- client.tunnels.configurations.replace(accountId, tunnelId, { ...params }) -> ConfigurationReplaceResponse ## Connections @@ -3295,29 +3303,29 @@ Methods: Types: - DatasetCreateResponse +- DatasetUpdateResponse - DatasetListResponse - DatasetGetResponse -- DatasetReplaceResponse Methods: - client.dlp.datasets.create(accountId, { ...params }) -> DatasetCreateResponse +- client.dlp.datasets.update(accountId, datasetId, { ...params }) -> DatasetUpdateResponse - client.dlp.datasets.list(accountId) -> DatasetListResponse - client.dlp.datasets.delete(accountId, datasetId) -> void - client.dlp.datasets.get(accountId, datasetId) -> DatasetGetResponse -- client.dlp.datasets.replace(accountId, datasetId, { ...params }) -> DatasetReplaceResponse ### Upload Types: - UploadCreateResponse -- UploadUpdateResponse +- UploadEditResponse Methods: - client.dlp.datasets.upload.create(accountId, datasetId) -> UploadCreateResponse -- client.dlp.datasets.upload.update(accountId, datasetId, version) -> UploadUpdateResponse +- client.dlp.datasets.upload.edit(accountId, datasetId, version) -> UploadEditResponse ## Patterns @@ -3333,13 +3341,13 @@ Methods: Types: +- PayloadLogUpdateResponse - PayloadLogGetResponse -- PayloadLogReplaceResponse Methods: +- client.dlp.payloadLogs.update(accountId, { ...params }) -> PayloadLogUpdateResponse - client.dlp.payloadLogs.get(accountId) -> PayloadLogGetResponse -- client.dlp.payloadLogs.replace(accountId, { ...params }) -> PayloadLogReplaceResponse ## Profiles @@ -3358,45 +3366,45 @@ Methods: Types: - CustomCreateResponse +- CustomUpdateResponse - CustomDeleteResponse - CustomGetResponse -- CustomReplaceResponse Methods: - client.dlp.profiles.customs.create(accountId, { ...params }) -> CustomCreateResponse | null +- client.dlp.profiles.customs.update(accountId, profileId, { ...params }) -> CustomUpdateResponse - client.dlp.profiles.customs.delete(accountId, profileId) -> CustomDeleteResponse - client.dlp.profiles.customs.get(accountId, profileId) -> CustomGetResponse -- client.dlp.profiles.customs.replace(accountId, profileId, { ...params }) -> CustomReplaceResponse ### Predefineds Types: +- PredefinedUpdateResponse - PredefinedGetResponse -- PredefinedReplaceResponse Methods: +- client.dlp.profiles.predefineds.update(accountId, profileId, { ...params }) -> PredefinedUpdateResponse - client.dlp.profiles.predefineds.get(accountId, profileId) -> PredefinedGetResponse -- client.dlp.profiles.predefineds.replace(accountId, profileId, { ...params }) -> PredefinedReplaceResponse # DNSFirewall Types: - DNSFirewallCreateResponse -- DNSFirewallUpdateResponse - DNSFirewallListResponse - DNSFirewallDeleteResponse +- DNSFirewallEditResponse - DNSFirewallGetResponse Methods: - client.dnsFirewall.create(accountId, { ...params }) -> DNSFirewallCreateResponse -- client.dnsFirewall.update(accountId, dnsFirewallId, { ...params }) -> DNSFirewallUpdateResponse - client.dnsFirewall.list(accountId, { ...params }) -> DNSFirewallListResponsesV4PagePaginationArray - client.dnsFirewall.delete(accountId, dnsFirewallId) -> DNSFirewallDeleteResponse +- client.dnsFirewall.edit(accountId, dnsFirewallId, { ...params }) -> DNSFirewallEditResponse - client.dnsFirewall.get(accountId, dnsFirewallId) -> DNSFirewallGetResponse ## DNSAnalytics @@ -3428,17 +3436,17 @@ Methods: Types: - V1CreateResponse -- V1UpdateResponse - V1ListResponse - V1DeleteResponse +- V1EditResponse - V1GetResponse Methods: - client.images.v1s.create(accountId, { ...params }) -> V1CreateResponse -- client.images.v1s.update(accountId, imageId, { ...params }) -> V1UpdateResponse - client.images.v1s.list(accountId, { ...params }) -> V1ListResponsesV4PagePagination - client.images.v1s.delete(accountId, imageId) -> V1DeleteResponse +- client.images.v1s.edit(accountId, imageId, { ...params }) -> V1EditResponse - client.images.v1s.get(accountId, imageId) -> V1GetResponse ### Keys @@ -3466,17 +3474,17 @@ Methods: Types: - VariantCreateResponse -- VariantUpdateResponse - VariantListResponse - VariantDeleteResponse +- VariantEditResponse - VariantGetResponse Methods: - client.images.v1s.variants.create(accountId, { ...params }) -> VariantCreateResponse -- client.images.v1s.variants.update(accountId, variantId, { ...params }) -> VariantUpdateResponse - client.images.v1s.variants.list(accountId) -> VariantListResponse - client.images.v1s.variants.delete(accountId, variantId) -> VariantDeleteResponse +- client.images.v1s.variants.edit(accountId, variantId, { ...params }) -> VariantEditResponse - client.images.v1s.variants.get(accountId, variantId) -> VariantGetResponse ### Blobs @@ -3613,18 +3621,18 @@ Methods: Types: - IndicatorFeedCreateResponse +- IndicatorFeedUpdateResponse - IndicatorFeedListResponse - IndicatorFeedDataResponse - IndicatorFeedGetResponse -- IndicatorFeedReplaceResponse Methods: - client.intel.indicatorFeeds.create(accountId, { ...params }) -> IndicatorFeedCreateResponse +- client.intel.indicatorFeeds.update(accountId, feedId, { ...params }) -> IndicatorFeedUpdateResponse - client.intel.indicatorFeeds.list(accountId) -> IndicatorFeedListResponse - client.intel.indicatorFeeds.data(accountId, feedId) -> string - client.intel.indicatorFeeds.get(accountId, feedId) -> IndicatorFeedGetResponse -- client.intel.indicatorFeeds.replace(accountId, feedId, { ...params }) -> IndicatorFeedReplaceResponse ### Permissions @@ -3656,51 +3664,51 @@ Methods: Types: +- CfInterconnectUpdateResponse - CfInterconnectListResponse - CfInterconnectGetResponse -- CfInterconnectReplaceResponse Methods: +- client.magics.cfInterconnects.update(accountIdentifier, tunnelIdentifier, { ...params }) -> CfInterconnectUpdateResponse - client.magics.cfInterconnects.list(accountIdentifier) -> CfInterconnectListResponse - client.magics.cfInterconnects.get(accountIdentifier, tunnelIdentifier) -> CfInterconnectGetResponse -- client.magics.cfInterconnects.replace(accountIdentifier, tunnelIdentifier, { ...params }) -> CfInterconnectReplaceResponse ## GreTunnels Types: - GreTunnelCreateResponse +- GreTunnelUpdateResponse - GreTunnelListResponse - GreTunnelDeleteResponse - GreTunnelGetResponse -- GreTunnelReplaceResponse Methods: - client.magics.greTunnels.create(accountIdentifier, { ...params }) -> GreTunnelCreateResponse +- client.magics.greTunnels.update(accountIdentifier, tunnelIdentifier, { ...params }) -> GreTunnelUpdateResponse - client.magics.greTunnels.list(accountIdentifier) -> GreTunnelListResponse - client.magics.greTunnels.delete(accountIdentifier, tunnelIdentifier) -> GreTunnelDeleteResponse - client.magics.greTunnels.get(accountIdentifier, tunnelIdentifier) -> GreTunnelGetResponse -- client.magics.greTunnels.replace(accountIdentifier, tunnelIdentifier, { ...params }) -> GreTunnelReplaceResponse ## IpsecTunnels Types: - IpsecTunnelCreateResponse +- IpsecTunnelUpdateResponse - IpsecTunnelListResponse - IpsecTunnelDeleteResponse - IpsecTunnelGetResponse -- IpsecTunnelReplaceResponse Methods: - client.magics.ipsecTunnels.create(accountIdentifier, { ...params }) -> IpsecTunnelCreateResponse +- client.magics.ipsecTunnels.update(accountIdentifier, tunnelIdentifier, { ...params }) -> IpsecTunnelUpdateResponse - client.magics.ipsecTunnels.list(accountIdentifier) -> IpsecTunnelListResponse - client.magics.ipsecTunnels.delete(accountIdentifier, tunnelIdentifier) -> IpsecTunnelDeleteResponse - client.magics.ipsecTunnels.get(accountIdentifier, tunnelIdentifier) -> IpsecTunnelGetResponse -- client.magics.ipsecTunnels.replace(accountIdentifier, tunnelIdentifier, { ...params }) -> IpsecTunnelReplaceResponse ### PskGenerates @@ -3717,36 +3725,36 @@ Methods: Types: - RouteCreateResponse +- RouteUpdateResponse - RouteDeleteResponse - RouteGetResponse - RouteMagicStaticRoutesListRoutesResponse -- RouteReplaceResponse Methods: - client.magics.routes.create(accountIdentifier, { ...params }) -> RouteCreateResponse +- client.magics.routes.update(accountIdentifier, routeIdentifier, { ...params }) -> RouteUpdateResponse - client.magics.routes.delete(accountIdentifier, routeIdentifier) -> RouteDeleteResponse - client.magics.routes.get(accountIdentifier, routeIdentifier) -> RouteGetResponse - client.magics.routes.magicStaticRoutesListRoutes(accountIdentifier) -> RouteMagicStaticRoutesListRoutesResponse -- client.magics.routes.replace(accountIdentifier, routeIdentifier, { ...params }) -> RouteReplaceResponse # AccountMembers Types: - AccountMemberCreateResponse +- AccountMemberUpdateResponse - AccountMemberListResponse - AccountMemberDeleteResponse - AccountMemberGetResponse -- AccountMemberReplaceResponse Methods: - client.accountMembers.create(accountId, { ...params }) -> AccountMemberCreateResponse +- client.accountMembers.update(accountId, memberId, { ...params }) -> AccountMemberUpdateResponse - client.accountMembers.list(accountId, { ...params }) -> AccountMemberListResponsesV4PagePaginationArray - client.accountMembers.delete(accountId, memberId) -> AccountMemberDeleteResponse | null - client.accountMembers.get(accountId, memberId) -> AccountMemberGetResponse -- client.accountMembers.replace(accountId, memberId, { ...params }) -> AccountMemberReplaceResponse # Mnms @@ -3758,15 +3766,15 @@ Types: - ConfigUpdateResponse - ConfigListResponse - ConfigDeleteResponse -- ConfigReplaceResponse +- ConfigEditResponse Methods: - client.mnms.configs.create(accountIdentifier) -> ConfigCreateResponse -- client.mnms.configs.update(accountIdentifier) -> ConfigUpdateResponse +- client.mnms.configs.update(accountIdentifier) -> ConfigUpdateResponse - client.mnms.configs.list(accountIdentifier) -> ConfigListResponse - client.mnms.configs.delete(accountIdentifier) -> ConfigDeleteResponse -- client.mnms.configs.replace(accountIdentifier) -> ConfigReplaceResponse +- client.mnms.configs.edit(accountIdentifier) -> ConfigEditResponse ### Fulls @@ -3786,27 +3794,27 @@ Types: - RuleUpdateResponse - RuleListResponse - RuleDeleteResponse +- RuleEditResponse - RuleGetResponse -- RuleReplaceResponse Methods: - client.mnms.rules.create(accountIdentifier) -> RuleCreateResponse | null -- client.mnms.rules.update(accountIdentifier, ruleIdentifier) -> RuleUpdateResponse | null +- client.mnms.rules.update(accountIdentifier) -> RuleUpdateResponse | null - client.mnms.rules.list(accountIdentifier) -> RuleListResponse | null - client.mnms.rules.delete(accountIdentifier, ruleIdentifier) -> RuleDeleteResponse | null +- client.mnms.rules.edit(accountIdentifier, ruleIdentifier) -> RuleEditResponse | null - client.mnms.rules.get(accountIdentifier, ruleIdentifier) -> RuleGetResponse | null -- client.mnms.rules.replace(accountIdentifier) -> RuleReplaceResponse | null ### Advertisements Types: -- AdvertisementUpdateResponse +- AdvertisementEditResponse Methods: -- client.mnms.rules.advertisements.update(accountIdentifier, ruleIdentifier) -> AdvertisementUpdateResponse | null +- client.mnms.rules.advertisements.edit(accountIdentifier, ruleIdentifier) -> AdvertisementEditResponse | null # MtlsCertificates @@ -3841,18 +3849,18 @@ Methods: Types: - ProjectCreateResponse -- ProjectUpdateResponse - ProjectListResponse - ProjectDeleteResponse +- ProjectEditResponse - ProjectGetResponse - ProjectPurgeBuildCacheResponse Methods: - client.pages.projects.create(accountId, { ...params }) -> ProjectCreateResponse -- client.pages.projects.update(accountId, projectName, { ...params }) -> ProjectUpdateResponse - client.pages.projects.list(accountId) -> ProjectListResponse - client.pages.projects.delete(accountId, projectName) -> unknown +- client.pages.projects.edit(accountId, projectName, { ...params }) -> ProjectEditResponse - client.pages.projects.get(accountId, projectName) -> ProjectGetResponse - client.pages.projects.purgeBuildCache(accountId, projectName) -> unknown @@ -3893,17 +3901,17 @@ Methods: Types: - DomainCreateResponse -- DomainUpdateResponse - DomainListResponse - DomainDeleteResponse +- DomainEditResponse - DomainGetResponse Methods: - client.pages.projects.domains.create(accountId, projectName, { ...params }) -> DomainCreateResponse | null -- client.pages.projects.domains.update(accountId, projectName, domainName) -> DomainUpdateResponse | null - client.pages.projects.domains.list(accountId, projectName) -> DomainListResponse - client.pages.projects.domains.delete(accountId, projectName, domainName) -> unknown +- client.pages.projects.domains.edit(accountId, projectName, domainName) -> DomainEditResponse | null - client.pages.projects.domains.get(accountId, projectName, domainName) -> DomainGetResponse | null # Pcaps @@ -3947,15 +3955,15 @@ Methods: Types: +- DomainUpdateResponse - DomainListResponse - DomainGetResponse -- DomainReplaceResponse Methods: +- client.registrar.domains.update(accountId, domainName, { ...params }) -> DomainUpdateResponse | null - client.registrar.domains.list(accountId) -> DomainListResponse | null - client.registrar.domains.get(accountId, domainName) -> DomainGetResponse | null -- client.registrar.domains.replace(accountId, domainName, { ...params }) -> DomainReplaceResponse | null # RequestTracers @@ -3963,6 +3971,7 @@ Methods: Types: +- Bz6um997Trace - TraceCreateResponse Methods: @@ -3988,18 +3997,18 @@ Methods: Types: - ListCreateResponse +- ListUpdateResponse - ListListResponse - ListDeleteResponse - ListGetResponse -- ListReplaceResponse Methods: - client.rules.lists.create(accountId, { ...params }) -> ListCreateResponse | null +- client.rules.lists.update(accountId, listId, { ...params }) -> ListUpdateResponse | null - client.rules.lists.list(accountId) -> ListListResponse | null - client.rules.lists.delete(accountId, listId) -> ListDeleteResponse | null - client.rules.lists.get(accountId, listId) -> ListGetResponse | null -- client.rules.lists.replace(accountId, listId, { ...params }) -> ListReplaceResponse | null ### BulkOperations @@ -4016,18 +4025,18 @@ Methods: Types: - ItemCreateResponse +- ItemUpdateResponse - ItemListResponse - ItemDeleteResponse - ItemGetResponse -- ItemReplaceResponse Methods: - client.rules.lists.items.create(accountId, listId, [ ...body ]) -> ItemCreateResponse | null +- client.rules.lists.items.update(accountId, listId, [ ...body ]) -> ItemUpdateResponse | null - client.rules.lists.items.list(accountId, listId, { ...params }) -> ItemListResponse | null - client.rules.lists.items.delete(accountId, listId, { ...params }) -> ItemDeleteResponse | null - client.rules.lists.items.get(accountIdentifier, listId, itemId) -> ItemGetResponse | null -- client.rules.lists.items.replace(accountId, listId, [ ...body ]) -> ItemReplaceResponse | null # Storage @@ -4050,28 +4059,28 @@ Methods: Types: - NamespaceCreateResponse +- NamespaceUpdateResponse - NamespaceListResponse - NamespaceDeleteResponse -- NamespaceReplaceResponse Methods: - client.storage.kv.namespaces.create(accountId, { ...params }) -> NamespaceCreateResponse +- client.storage.kv.namespaces.update(accountId, namespaceId, { ...params }) -> NamespaceUpdateResponse - client.storage.kv.namespaces.list(accountId, { ...params }) -> NamespaceListResponsesV4PagePaginationArray - client.storage.kv.namespaces.delete(accountId, namespaceId) -> NamespaceDeleteResponse -- client.storage.kv.namespaces.replace(accountId, namespaceId, { ...params }) -> NamespaceReplaceResponse #### Bulk Types: +- BulkUpdateResponse - BulkDeleteResponse -- BulkReplaceResponse Methods: +- client.storage.kv.namespaces.bulk.update(accountId, namespaceId, [ ...body ]) -> BulkUpdateResponse - client.storage.kv.namespaces.bulk.delete(accountId, namespaceId, [ ...body ]) -> BulkDeleteResponse -- client.storage.kv.namespaces.bulk.replace(accountId, namespaceId, [ ...body ]) -> BulkReplaceResponse #### Keys @@ -4097,15 +4106,15 @@ Methods: Types: +- ValueUpdateResponse - ValueDeleteResponse - ValueGetResponse -- ValueReplaceResponse Methods: +- client.storage.kv.namespaces.values.update(accountId, namespaceId, keyName, { ...params }) -> ValueUpdateResponse - client.storage.kv.namespaces.values.delete(accountId, namespaceId, keyName) -> ValueDeleteResponse - client.storage.kv.namespaces.values.get(accountId, namespaceId, keyName) -> string -- client.storage.kv.namespaces.values.replace(accountId, namespaceId, keyName, { ...params }) -> ValueReplaceResponse # Stream @@ -4126,16 +4135,16 @@ Methods: Types: - AudioTrackCreateResponse -- AudioTrackUpdateResponse - AudioTrackListResponse - AudioTrackDeleteResponse +- AudioTrackEditResponse Methods: - client.stream.audioTracks.create(accountId, identifier, { ...params }) -> AudioTrackCreateResponse -- client.stream.audioTracks.update(accountId, identifier, audioIdentifier, { ...params }) -> AudioTrackUpdateResponse - client.stream.audioTracks.list(accountId, identifier) -> AudioTrackListResponse - client.stream.audioTracks.delete(accountId, identifier, audioIdentifier) -> AudioTrackDeleteResponse +- client.stream.audioTracks.edit(accountId, identifier, audioIdentifier, { ...params }) -> AudioTrackEditResponse ## Videos @@ -4196,32 +4205,32 @@ Methods: Types: - LiveInputCreateResponse +- LiveInputUpdateResponse - LiveInputListResponse - LiveInputGetResponse -- LiveInputReplaceResponse Methods: - client.stream.liveInputs.create(accountId, { ...params }) -> LiveInputCreateResponse +- client.stream.liveInputs.update(accountId, liveInputIdentifier, { ...params }) -> LiveInputUpdateResponse - client.stream.liveInputs.list(accountId, { ...params }) -> LiveInputListResponse - client.stream.liveInputs.delete(accountId, liveInputIdentifier) -> void - client.stream.liveInputs.get(accountId, liveInputIdentifier) -> LiveInputGetResponse -- client.stream.liveInputs.replace(accountId, liveInputIdentifier, { ...params }) -> LiveInputReplaceResponse ### Outputs Types: - OutputCreateResponse +- OutputUpdateResponse - OutputListResponse -- OutputReplaceResponse Methods: - client.stream.liveInputs.outputs.create(accountId, liveInputIdentifier, { ...params }) -> OutputCreateResponse +- client.stream.liveInputs.outputs.update(accountId, liveInputIdentifier, outputIdentifier, { ...params }) -> OutputUpdateResponse - client.stream.liveInputs.outputs.list(accountId, liveInputIdentifier) -> OutputListResponse - client.stream.liveInputs.outputs.delete(accountId, liveInputIdentifier, outputIdentifier) -> void -- client.stream.liveInputs.outputs.replace(accountId, liveInputIdentifier, outputIdentifier, { ...params }) -> OutputReplaceResponse ## Watermarks @@ -4243,29 +4252,29 @@ Methods: Types: +- WebhookUpdateResponse - WebhookDeleteResponse - WebhookGetResponse -- WebhookReplaceResponse Methods: +- client.stream.webhooks.update(accountId, { ...params }) -> WebhookUpdateResponse - client.stream.webhooks.delete(accountId) -> WebhookDeleteResponse - client.stream.webhooks.get(accountId) -> WebhookGetResponse -- client.stream.webhooks.replace(accountId, { ...params }) -> WebhookReplaceResponse ## Captions Types: +- CaptionUpdateResponse - CaptionListResponse - CaptionDeleteResponse -- CaptionReplaceResponse Methods: +- client.stream.captions.update(accountId, identifier, language, { ...params }) -> CaptionUpdateResponse - client.stream.captions.list(accountId, identifier) -> CaptionListResponse - client.stream.captions.delete(accountId, identifier, language) -> CaptionDeleteResponse -- client.stream.captions.replace(accountId, identifier, language, { ...params }) -> CaptionReplaceResponse ## Downloads @@ -4340,16 +4349,16 @@ Methods: Types: - VirtualNetworkCreateResponse -- VirtualNetworkUpdateResponse - VirtualNetworkListResponse - VirtualNetworkDeleteResponse +- VirtualNetworkEditResponse Methods: - client.teamnets.virtualNetworks.create(accountId, { ...params }) -> VirtualNetworkCreateResponse -- client.teamnets.virtualNetworks.update(accountId, virtualNetworkId, { ...params }) -> VirtualNetworkUpdateResponse - client.teamnets.virtualNetworks.list(accountId, { ...params }) -> VirtualNetworkListResponse | null - client.teamnets.virtualNetworks.delete(accountId, virtualNetworkId) -> VirtualNetworkDeleteResponse +- client.teamnets.virtualNetworks.edit(accountId, virtualNetworkId, { ...params }) -> VirtualNetworkEditResponse # Gateways @@ -4367,13 +4376,13 @@ Methods: Types: +- AuditSSHSettingUpdateResponse - AuditSSHSettingGetResponse -- AuditSSHSettingReplaceResponse Methods: +- client.gateways.auditSSHSettings.update(accountId, { ...params }) -> AuditSSHSettingUpdateResponse - client.gateways.auditSSHSettings.get(accountId) -> AuditSSHSettingGetResponse -- client.gateways.auditSSHSettings.replace(accountId, { ...params }) -> AuditSSHSettingReplaceResponse ## Categories @@ -4400,32 +4409,32 @@ Methods: Types: - ConfigurationUpdateResponse +- ConfigurationEditResponse - ConfigurationGetResponse -- ConfigurationReplaceResponse Methods: -- client.gateways.configurations.update(accountId, { ...params }) -> ConfigurationUpdateResponse +- client.gateways.configurations.update(accountId, { ...params }) -> ConfigurationUpdateResponse +- client.gateways.configurations.edit(accountId, { ...params }) -> ConfigurationEditResponse - client.gateways.configurations.get(accountId) -> ConfigurationGetResponse -- client.gateways.configurations.replace(accountId, { ...params }) -> ConfigurationReplaceResponse ## Lists Types: - ListCreateResponse +- ListUpdateResponse - ListListResponse - ListDeleteResponse - ListGetResponse -- ListReplaceResponse Methods: - client.gateways.lists.create(accountId, { ...params }) -> ListCreateResponse +- client.gateways.lists.update(accountId, listId, { ...params }) -> ListUpdateResponse - client.gateways.lists.list(accountId) -> ListListResponse | null - client.gateways.lists.delete(accountId, listId) -> ListDeleteResponse - client.gateways.lists.get(accountId, listId) -> ListGetResponse -- client.gateways.lists.replace(accountId, listId, { ...params }) -> ListReplaceResponse ### Items @@ -4442,47 +4451,47 @@ Methods: Types: - LocationCreateResponse +- LocationUpdateResponse - LocationListResponse - LocationDeleteResponse - LocationGetResponse -- LocationReplaceResponse Methods: - client.gateways.locations.create(accountId, { ...params }) -> LocationCreateResponse +- client.gateways.locations.update(accountId, locationId, { ...params }) -> LocationUpdateResponse - client.gateways.locations.list(accountId) -> LocationListResponse | null - client.gateways.locations.delete(accountId, locationId) -> LocationDeleteResponse - client.gateways.locations.get(accountId, locationId) -> LocationGetResponse -- client.gateways.locations.replace(accountId, locationId, { ...params }) -> LocationReplaceResponse ## Loggings Types: +- LoggingUpdateResponse - LoggingGetResponse -- LoggingReplaceResponse Methods: +- client.gateways.loggings.update(accountId, { ...params }) -> LoggingUpdateResponse - client.gateways.loggings.get(accountId) -> LoggingGetResponse -- client.gateways.loggings.replace(accountId, { ...params }) -> LoggingReplaceResponse ## ProxyEndpoints Types: - ProxyEndpointCreateResponse -- ProxyEndpointUpdateResponse - ProxyEndpointListResponse - ProxyEndpointDeleteResponse +- ProxyEndpointEditResponse - ProxyEndpointGetResponse Methods: - client.gateways.proxyEndpoints.create(accountId, { ...params }) -> ProxyEndpointCreateResponse -- client.gateways.proxyEndpoints.update(accountId, proxyEndpointId, { ...params }) -> ProxyEndpointUpdateResponse - client.gateways.proxyEndpoints.list(accountId) -> ProxyEndpointListResponse | null - client.gateways.proxyEndpoints.delete(accountId, proxyEndpointId) -> ProxyEndpointDeleteResponse +- client.gateways.proxyEndpoints.edit(accountId, proxyEndpointId, { ...params }) -> ProxyEndpointEditResponse - client.gateways.proxyEndpoints.get(accountId, proxyEndpointId) -> ProxyEndpointGetResponse ## Rules @@ -4490,18 +4499,18 @@ Methods: Types: - RuleCreateResponse +- RuleUpdateResponse - RuleListResponse - RuleDeleteResponse - RuleGetResponse -- RuleReplaceResponse Methods: - client.gateways.rules.create(accountId, { ...params }) -> RuleCreateResponse +- client.gateways.rules.update(accountId, ruleId, { ...params }) -> RuleUpdateResponse - client.gateways.rules.list(accountId) -> RuleListResponse | null - client.gateways.rules.delete(accountId, ruleId) -> RuleDeleteResponse - client.gateways.rules.get(accountId, ruleId) -> RuleGetResponse -- client.gateways.rules.replace(accountId, ruleId, { ...params }) -> RuleReplaceResponse # Alerting @@ -4548,18 +4557,18 @@ Methods: Types: - WebhookCreateResponse +- WebhookUpdateResponse - WebhookListResponse - WebhookDeleteResponse - WebhookGetResponse -- WebhookReplaceResponse Methods: - client.alerting.v3.destinations.webhooks.create(accountId, { ...params }) -> WebhookCreateResponse +- client.alerting.v3.destinations.webhooks.update(accountId, webhookId, { ...params }) -> WebhookUpdateResponse - client.alerting.v3.destinations.webhooks.list(accountId) -> WebhookListResponse | null - client.alerting.v3.destinations.webhooks.delete(accountId, webhookId) -> WebhookDeleteResponse | null - client.alerting.v3.destinations.webhooks.get(accountId, webhookId) -> WebhookGetResponse -- client.alerting.v3.destinations.webhooks.replace(accountId, webhookId, { ...params }) -> WebhookReplaceResponse ### Histories @@ -4576,18 +4585,18 @@ Methods: Types: - PolicyCreateResponse +- PolicyUpdateResponse - PolicyListResponse - PolicyDeleteResponse - PolicyGetResponse -- PolicyReplaceResponse Methods: - client.alerting.v3.policies.create(accountId, { ...params }) -> PolicyCreateResponse +- client.alerting.v3.policies.update(accountId, policyId, { ...params }) -> PolicyUpdateResponse - client.alerting.v3.policies.list(accountId) -> PolicyListResponse | null - client.alerting.v3.policies.delete(accountId, policyId) -> PolicyDeleteResponse | null - client.alerting.v3.policies.get(accountId, policyId) -> PolicyGetResponse -- client.alerting.v3.policies.replace(accountId, policyId, { ...params }) -> PolicyReplaceResponse # Devices @@ -4606,53 +4615,53 @@ Methods: Types: - DEXTestCreateResponse +- DEXTestUpdateResponse - DEXTestListResponse - DEXTestDeleteResponse - DEXTestGetResponse -- DEXTestReplaceResponse Methods: - client.devices.dexTests.create(identifier, { ...params }) -> DEXTestCreateResponse | null +- client.devices.dexTests.update(identifier, uuid, { ...params }) -> DEXTestUpdateResponse | null - client.devices.dexTests.list(identifier) -> DEXTestListResponse | null - client.devices.dexTests.delete(identifier, uuid) -> DEXTestDeleteResponse | null - client.devices.dexTests.get(identifier, uuid) -> DEXTestGetResponse | null -- client.devices.dexTests.replace(identifier, uuid, { ...params }) -> DEXTestReplaceResponse | null ## Networks Types: - NetworkCreateResponse +- NetworkUpdateResponse - NetworkListResponse - NetworkDeleteResponse - NetworkGetResponse -- NetworkReplaceResponse Methods: - client.devices.networks.create(identifier, { ...params }) -> NetworkCreateResponse | null +- client.devices.networks.update(identifier, uuid, { ...params }) -> NetworkUpdateResponse | null - client.devices.networks.list(identifier) -> NetworkListResponse | null - client.devices.networks.delete(identifier, uuid) -> NetworkDeleteResponse | null - client.devices.networks.get(identifier, uuid) -> NetworkGetResponse | null -- client.devices.networks.replace(identifier, uuid, { ...params }) -> NetworkReplaceResponse | null ## Policies Types: - PolicyCreateResponse -- PolicyUpdateResponse - PolicyListResponse - PolicyDeleteResponse +- PolicyEditResponse - PolicyGetResponse Methods: - client.devices.policies.create(identifier, { ...params }) -> PolicyCreateResponse | null -- client.devices.policies.update(identifier, uuid, { ...params }) -> PolicyUpdateResponse | null - client.devices.policies.list(identifier) -> PolicyListResponse | null - client.devices.policies.delete(identifier, uuid) -> PolicyDeleteResponse | null +- client.devices.policies.edit(identifier, uuid, { ...params }) -> PolicyEditResponse | null - client.devices.policies.get(identifier, uuid) -> PolicyGetResponse | null ### DefaultPolicy @@ -4669,70 +4678,70 @@ Methods: Types: +- ExcludeUpdateResponse - ExcludeListResponse -- ExcludeReplaceResponse Methods: +- client.devices.policies.excludes.update(identifier, [ ...body ]) -> ExcludeUpdateResponse | null - client.devices.policies.excludes.list(identifier) -> ExcludeListResponse | null -- client.devices.policies.excludes.replace(identifier, [ ...body ]) -> ExcludeReplaceResponse | null ### FallbackDomains Types: +- FallbackDomainUpdateResponse - FallbackDomainListResponse -- FallbackDomainReplaceResponse Methods: +- client.devices.policies.fallbackDomains.update(identifier, uuid, [ ...body ]) -> FallbackDomainUpdateResponse | null - client.devices.policies.fallbackDomains.list(identifier, uuid) -> FallbackDomainListResponse | null -- client.devices.policies.fallbackDomains.replace(identifier, uuid, [ ...body ]) -> FallbackDomainReplaceResponse | null ### Includes Types: +- IncludeUpdateResponse - IncludeListResponse -- IncludeReplaceResponse Methods: +- client.devices.policies.includes.update(identifier, [ ...body ]) -> IncludeUpdateResponse | null - client.devices.policies.includes.list(identifier) -> IncludeListResponse | null -- client.devices.policies.includes.replace(identifier, [ ...body ]) -> IncludeReplaceResponse | null ## Postures Types: - PostureCreateResponse +- PostureUpdateResponse - PostureListResponse - PostureDeleteResponse - PostureGetResponse -- PostureReplaceResponse Methods: - client.devices.postures.create(identifier, { ...params }) -> PostureCreateResponse | null +- client.devices.postures.update(identifier, uuid, { ...params }) -> PostureUpdateResponse | null - client.devices.postures.list(identifier) -> PostureListResponse | null - client.devices.postures.delete(identifier, uuid) -> PostureDeleteResponse | null - client.devices.postures.get(identifier, uuid) -> PostureGetResponse | null -- client.devices.postures.replace(identifier, uuid, { ...params }) -> PostureReplaceResponse | null ### Integrations Types: - IntegrationCreateResponse -- IntegrationUpdateResponse - IntegrationDeleteResponse +- IntegrationEditResponse - IntegrationGetResponse Methods: - client.devices.postures.integrations.create(identifier, { ...params }) -> IntegrationCreateResponse | null -- client.devices.postures.integrations.update(identifier, uuid, { ...params }) -> IntegrationUpdateResponse | null - client.devices.postures.integrations.delete(identifier, uuid) -> IntegrationDeleteResponse | null +- client.devices.postures.integrations.edit(identifier, uuid, { ...params }) -> IntegrationEditResponse | null - client.devices.postures.integrations.get(identifier, uuid) -> IntegrationGetResponse | null ## Revokes @@ -4749,13 +4758,13 @@ Methods: Types: +- SettingUpdateResponse - SettingListResponse -- SettingReplaceResponse Methods: +- client.devices.settings.update(identifier, { ...params }) -> SettingUpdateResponse | null - client.devices.settings.list(identifier) -> SettingListResponse | null -- client.devices.settings.replace(identifier, { ...params }) -> SettingReplaceResponse | null ## Unrevokes @@ -4936,31 +4945,31 @@ Methods: Types: - RouteCreateResponse -- RouteUpdateResponse - RouteDeleteResponse +- RouteEditResponse Methods: - client.teamnet.routes.create(accountId, { ...params }) -> RouteCreateResponse -- client.teamnet.routes.update(accountId, routeId, { ...params }) -> RouteUpdateResponse - client.teamnet.routes.delete(accountId, routeId) -> RouteDeleteResponse +- client.teamnet.routes.edit(accountId, routeId, { ...params }) -> RouteEditResponse # WarpConnector Types: - WarpConnectorCreateResponse -- WarpConnectorUpdateResponse - WarpConnectorListResponse - WarpConnectorDeleteResponse +- WarpConnectorEditResponse - WarpConnectorGetResponse Methods: - client.warpConnector.create(accountId, { ...params }) -> WarpConnectorCreateResponse -- client.warpConnector.update(accountId, tunnelId, { ...params }) -> WarpConnectorUpdateResponse - client.warpConnector.list(accountId, { ...params }) -> WarpConnectorListResponsesV4PagePaginationArray - client.warpConnector.delete(accountId, tunnelId, { ...params }) -> WarpConnectorDeleteResponse +- client.warpConnector.edit(accountId, tunnelId, { ...params }) -> WarpConnectorEditResponse - client.warpConnector.get(accountId, tunnelId) -> WarpConnectorGetResponse # Dispatchers @@ -4969,14 +4978,14 @@ Methods: Types: +- ScriptUpdateResponse - ScriptGetResponse -- ScriptReplaceResponse Methods: +- client.dispatchers.scripts.update(accountId, dispatchNamespace, scriptName, { ...params }) -> ScriptUpdateResponse - client.dispatchers.scripts.delete(accountId, dispatchNamespace, scriptName, { ...params }) -> void - client.dispatchers.scripts.get(accountId, dispatchNamespace, scriptName) -> ScriptGetResponse -- client.dispatchers.scripts.replace(accountId, dispatchNamespace, scriptName, { ...params }) -> ScriptReplaceResponse # WorkersForPlatforms @@ -4990,23 +4999,23 @@ Methods: Types: -- ContentReplaceResponse +- ContentUpdateResponse Methods: +- client.workersForPlatforms.dispatch.namespaces.scripts.content.update(accountId, dispatchNamespace, scriptName, { ...params }) -> ContentUpdateResponse - client.workersForPlatforms.dispatch.namespaces.scripts.content.get(accountId, dispatchNamespace, scriptName) -> Response -- client.workersForPlatforms.dispatch.namespaces.scripts.content.replace(accountId, dispatchNamespace, scriptName, { ...params }) -> ContentReplaceResponse ##### Settings Types: -- SettingUpdateResponse +- SettingEditResponse - SettingGetResponse Methods: -- client.workersForPlatforms.dispatch.namespaces.scripts.settings.update(accountId, dispatchNamespace, scriptName, { ...params }) -> SettingUpdateResponse +- client.workersForPlatforms.dispatch.namespaces.scripts.settings.edit(accountId, dispatchNamespace, scriptName, { ...params }) -> SettingEditResponse - client.workersForPlatforms.dispatch.namespaces.scripts.settings.get(accountId, dispatchNamespace, scriptName) -> SettingGetResponse # WorkerDomains @@ -5026,11 +5035,11 @@ Methods: Types: -- ContentReplaceResponse +- ContentUpdateResponse Methods: -- client.workerScripts.content.replace(accountId, scriptName, { ...params }) -> ContentReplaceResponse +- client.workerScripts.content.update(accountId, scriptName, { ...params }) -> ContentUpdateResponse ## ContentV2 @@ -5042,12 +5051,12 @@ Methods: Types: -- SettingUpdateResponse +- SettingEditResponse - SettingGetResponse Methods: -- client.workerScripts.settings.update(accountId, scriptName, { ...params }) -> SettingUpdateResponse +- client.workerScripts.settings.edit(accountId, scriptName, { ...params }) -> SettingEditResponse - client.workerScripts.settings.get(accountId, scriptName) -> SettingGetResponse # Zerotrust @@ -5056,12 +5065,12 @@ Methods: Types: -- ConnectivitySettingUpdateResponse +- ConnectivitySettingEditResponse - ConnectivitySettingGetResponse Methods: -- client.zerotrust.connectivitySettings.update(accountId, { ...params }) -> ConnectivitySettingUpdateResponse +- client.zerotrust.connectivitySettings.edit(accountId, { ...params }) -> ConnectivitySettingEditResponse - client.zerotrust.connectivitySettings.get(accountId) -> ConnectivitySettingGetResponse # Addressing @@ -5072,14 +5081,14 @@ Methods: Types: -- BGPPrefixUpdateResponse - BGPPrefixListResponse +- BGPPrefixEditResponse - BGPPrefixGetResponse Methods: -- client.addressing.prefixes.bgpPrefixes.update(accountId, prefixId, bgpPrefixId, { ...params }) -> BGPPrefixUpdateResponse - client.addressing.prefixes.bgpPrefixes.list(accountId, prefixId) -> BGPPrefixListResponse | null +- client.addressing.prefixes.bgpPrefixes.edit(accountId, prefixId, bgpPrefixId, { ...params }) -> BGPPrefixEditResponse - client.addressing.prefixes.bgpPrefixes.get(accountId, prefixId, bgpPrefixId) -> BGPPrefixGetResponse ### Bindings @@ -5115,19 +5124,19 @@ Methods: Types: - WidgetCreateResponse +- WidgetUpdateResponse - WidgetListResponse - WidgetDeleteResponse - WidgetGetResponse -- WidgetReplaceResponse - WidgetRotateSecretResponse Methods: - client.challenges.widgets.create(accountIdentifier, { ...params }) -> WidgetCreateResponse +- client.challenges.widgets.update(accountIdentifier, sitekey, { ...params }) -> WidgetUpdateResponse - client.challenges.widgets.list(accountIdentifier, { ...params }) -> WidgetListResponsesV4PagePaginationArray - client.challenges.widgets.delete(accountIdentifier, sitekey) -> WidgetDeleteResponse - client.challenges.widgets.get(accountIdentifier, sitekey) -> WidgetGetResponse -- client.challenges.widgets.replace(accountIdentifier, sitekey, { ...params }) -> WidgetReplaceResponse - client.challenges.widgets.rotateSecret(accountIdentifier, sitekey, { ...params }) -> WidgetRotateSecretResponse # Hyperdrive @@ -5137,18 +5146,18 @@ Methods: Types: - ConfigCreateResponse +- ConfigUpdateResponse - ConfigListResponse - ConfigDeleteResponse - ConfigGetResponse -- ConfigReplaceResponse Methods: - client.hyperdrive.configs.create(accountId, { ...params }) -> ConfigCreateResponse | null +- client.hyperdrive.configs.update(accountId, hyperdriveId, { ...params }) -> ConfigUpdateResponse | null - client.hyperdrive.configs.list(accountId) -> ConfigListResponse - client.hyperdrive.configs.delete(accountId, hyperdriveId) -> ConfigDeleteResponse | null - client.hyperdrive.configs.get(accountId, hyperdriveId) -> ConfigGetResponse | null -- client.hyperdrive.configs.replace(accountId, hyperdriveId, { ...params }) -> ConfigReplaceResponse | null # Rum @@ -5157,34 +5166,34 @@ Methods: Types: - SiteInfoCreateResponse +- SiteInfoUpdateResponse - SiteInfoListResponse - SiteInfoDeleteResponse - SiteInfoGetResponse -- SiteInfoReplaceResponse Methods: - client.rum.siteInfos.create(accountId, { ...params }) -> SiteInfoCreateResponse +- client.rum.siteInfos.update(accountId, siteId, { ...params }) -> SiteInfoUpdateResponse - client.rum.siteInfos.list(accountId, { ...params }) -> SiteInfoListResponsesV4PagePaginationArray - client.rum.siteInfos.delete(accountId, siteId) -> SiteInfoDeleteResponse - client.rum.siteInfos.get(accountId, siteId) -> SiteInfoGetResponse -- client.rum.siteInfos.replace(accountId, siteId, { ...params }) -> SiteInfoReplaceResponse ## Rules Types: - RuleCreateResponse +- RuleUpdateResponse - RuleListResponse - RuleDeleteResponse -- RuleReplaceResponse Methods: - client.rum.rules.create(accountId, rulesetId, { ...params }) -> RuleCreateResponse +- client.rum.rules.update(accountId, rulesetId, ruleId, { ...params }) -> RuleUpdateResponse - client.rum.rules.list(accountId, rulesetId) -> RuleListResponse - client.rum.rules.delete(accountId, rulesetId, ruleId) -> RuleDeleteResponse -- client.rum.rules.replace(accountId, rulesetId, ruleId, { ...params }) -> RuleReplaceResponse # Vectorize @@ -5193,23 +5202,23 @@ Methods: Types: - IndexCreateResponse +- IndexUpdateResponse - IndexListResponse - IndexDeleteResponse - IndexGetResponse - IndexInsertResponse - IndexQueryResponse -- IndexReplaceResponse - IndexUpsertResponse Methods: - client.vectorize.indexes.create(accountIdentifier, { ...params }) -> IndexCreateResponse | null +- client.vectorize.indexes.update(accountIdentifier, indexName, { ...params }) -> IndexUpdateResponse | null - client.vectorize.indexes.list(accountIdentifier) -> IndexListResponse - client.vectorize.indexes.delete(accountIdentifier, indexName) -> IndexDeleteResponse | null - client.vectorize.indexes.get(accountIdentifier, indexName) -> IndexGetResponse | null - client.vectorize.indexes.insert(accountIdentifier, indexName) -> IndexInsertResponse | null - client.vectorize.indexes.query(accountIdentifier, indexName, { ...params }) -> IndexQueryResponse | null -- client.vectorize.indexes.replace(accountIdentifier, indexName, { ...params }) -> IndexReplaceResponse | null - client.vectorize.indexes.upsert(accountIdentifier, indexName) -> IndexUpsertResponse | null # URLScanner @@ -5967,13 +5976,13 @@ Methods: Types: +- BotManagementUpdateResponse - BotManagementGetResponse -- BotManagementReplaceResponse Methods: +- client.botManagement.update(zoneId, { ...params }) -> BotManagementUpdateResponse - client.botManagement.get(zoneId) -> BotManagementGetResponse -- client.botManagement.replace(zoneId, { ...params }) -> BotManagementReplaceResponse # CacheReserve @@ -5991,13 +6000,13 @@ Methods: Types: +- OriginPostQuantumEncryptionUpdateResponse - OriginPostQuantumEncryptionGetResponse -- OriginPostQuantumEncryptionReplaceResponse Methods: +- client.originPostQuantumEncryption.update(zoneId, { ...params }) -> OriginPostQuantumEncryptionUpdateResponse - client.originPostQuantumEncryption.get(zoneId) -> OriginPostQuantumEncryptionGetResponse -- client.originPostQuantumEncryption.replace(zoneId, { ...params }) -> OriginPostQuantumEncryptionReplaceResponse # Firewall @@ -6009,49 +6018,49 @@ Methods: Types: -- GroupUpdateResponse - GroupListResponse +- GroupEditResponse - GroupGetResponse Methods: -- client.firewall.waf.packages.groups.update(zoneId, packageId, groupId, { ...params }) -> GroupUpdateResponse - client.firewall.waf.packages.groups.list(zoneId, packageId, { ...params }) -> GroupListResponsesV4PagePaginationArray +- client.firewall.waf.packages.groups.edit(zoneId, packageId, groupId, { ...params }) -> GroupEditResponse - client.firewall.waf.packages.groups.get(zoneId, packageId, groupId) -> GroupGetResponse #### Rules Types: -- RuleUpdateResponse +- RuleEditResponse - RuleGetResponse Methods: -- client.firewall.waf.packages.rules.update(zoneId, packageId, ruleId, { ...params }) -> RuleUpdateResponse +- client.firewall.waf.packages.rules.edit(zoneId, packageId, ruleId, { ...params }) -> RuleEditResponse - client.firewall.waf.packages.rules.get(zoneId, packageId, ruleId) -> RuleGetResponse # Zaraz Types: -- ZarazReplaceResponse +- ZarazUpdateResponse Methods: -- client.zaraz.replace(zoneId, { ...params }) -> ZarazReplaceResponse +- client.zaraz.update(zoneId, { ...params }) -> ZarazUpdateResponse ## Config Types: +- ConfigUpdateResponse - ConfigGetResponse -- ConfigReplaceResponse Methods: +- client.zaraz.config.update(zoneId, { ...params }) -> ConfigUpdateResponse - client.zaraz.config.get(zoneId) -> ConfigGetResponse -- client.zaraz.config.replace(zoneId, { ...params }) -> ConfigReplaceResponse ## Default @@ -6077,13 +6086,13 @@ Methods: Types: +- HistoryUpdateResponse - HistoryListResponse -- HistoryReplaceResponse Methods: +- client.zaraz.history.update(zoneId, { ...params }) -> HistoryUpdateResponse - client.zaraz.history.list(zoneId, { ...params }) -> HistoryListResponse -- client.zaraz.history.replace(zoneId, { ...params }) -> HistoryReplaceResponse ### Configs @@ -6193,31 +6202,31 @@ Methods: Types: +- TLSUpdateResponse - TLSDeleteResponse - TLSGetResponse -- TLSReplaceResponse Methods: +- client.hostnames.settings.tls.update(zoneId, settingId, hostname, { ...params }) -> TLSUpdateResponse - client.hostnames.settings.tls.delete(zoneId, settingId, hostname) -> TLSDeleteResponse - client.hostnames.settings.tls.get(zoneId, settingId) -> TLSGetResponse | null -- client.hostnames.settings.tls.replace(zoneId, settingId, hostname, { ...params }) -> TLSReplaceResponse # Snippets Types: +- SnippetUpdateResponse - SnippetListResponse - SnippetDeleteResponse - SnippetGetResponse -- SnippetReplaceResponse Methods: +- client.snippets.update(zoneIdentifier, snippetName, { ...params }) -> SnippetUpdateResponse - client.snippets.list(zoneIdentifier) -> SnippetListResponse - client.snippets.delete(zoneIdentifier, snippetName) -> SnippetDeleteResponse - client.snippets.get(zoneIdentifier, snippetName) -> SnippetGetResponse -- client.snippets.replace(zoneIdentifier, snippetName, { ...params }) -> SnippetReplaceResponse ## Content @@ -6229,28 +6238,28 @@ Methods: Types: +- SnippetRuleUpdateResponse - SnippetRuleListResponse -- SnippetRuleReplaceResponse Methods: +- client.snippets.snippetRules.update(zoneIdentifier, { ...params }) -> SnippetRuleUpdateResponse - client.snippets.snippetRules.list(zoneIdentifier) -> SnippetRuleListResponse -- client.snippets.snippetRules.replace(zoneIdentifier, { ...params }) -> SnippetRuleReplaceResponse # Calls Types: - CallCreateResponse +- CallUpdateResponse - CallListResponse - CallDeleteResponse - CallGetResponse -- CallReplaceResponse Methods: - client.calls.create(accountId, { ...params }) -> CallCreateResponse +- client.calls.update(accountId, appId, { ...params }) -> CallUpdateResponse - client.calls.list(accountId) -> CallListResponse - client.calls.delete(accountId, appId) -> CallDeleteResponse - client.calls.get(accountId, appId) -> CallGetResponse -- client.calls.replace(accountId, appId, { ...params }) -> CallReplaceResponse diff --git a/src/index.ts b/src/index.ts index 33dff65a5e..271868970a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -354,12 +354,12 @@ export namespace Cloudflare { export import V4PagePaginationArrayResponse = Pagination.V4PagePaginationArrayResponse; export import Accounts = API.Accounts; + export import AccountUpdateResponse = API.AccountUpdateResponse; export import AccountListResponse = API.AccountListResponse; export import AccountGetResponse = API.AccountGetResponse; - export import AccountReplaceResponse = API.AccountReplaceResponse; export import AccountListResponsesV4PagePaginationArray = API.AccountListResponsesV4PagePaginationArray; + export import AccountUpdateParams = API.AccountUpdateParams; export import AccountListParams = API.AccountListParams; - export import AccountReplaceParams = API.AccountReplaceParams; export import Certificates = API.Certificates; export import CertificateCreateResponse = API.CertificateCreateResponse; @@ -373,29 +373,29 @@ export namespace Cloudflare { export import IPListParams = API.IPListParams; export import Memberships = API.Memberships; + export import MembershipUpdateResponse = API.MembershipUpdateResponse; export import MembershipListResponse = API.MembershipListResponse; export import MembershipDeleteResponse = API.MembershipDeleteResponse; export import MembershipGetResponse = API.MembershipGetResponse; - export import MembershipReplaceResponse = API.MembershipReplaceResponse; export import MembershipListResponsesV4PagePaginationArray = API.MembershipListResponsesV4PagePaginationArray; + export import MembershipUpdateParams = API.MembershipUpdateParams; export import MembershipListParams = API.MembershipListParams; - export import MembershipReplaceParams = API.MembershipReplaceParams; export import Users = API.Users; - export import UserUpdateResponse = API.UserUpdateResponse; export import UserListResponse = API.UserListResponse; - export import UserUpdateParams = API.UserUpdateParams; + export import UserEditResponse = API.UserEditResponse; + export import UserEditParams = API.UserEditParams; export import Zones = API.Zones; export import ZoneCreateResponse = API.ZoneCreateResponse; - export import ZoneUpdateResponse = API.ZoneUpdateResponse; export import ZoneListResponse = API.ZoneListResponse; export import ZoneDeleteResponse = API.ZoneDeleteResponse; + export import ZoneEditResponse = API.ZoneEditResponse; export import ZoneGetResponse = API.ZoneGetResponse; export import ZoneListResponsesV4PagePaginationArray = API.ZoneListResponsesV4PagePaginationArray; export import ZoneCreateParams = API.ZoneCreateParams; - export import ZoneUpdateParams = API.ZoneUpdateParams; export import ZoneListParams = API.ZoneListParams; + export import ZoneEditParams = API.ZoneEditParams; export import AI = API.AI; export import AICreateResponse = API.AICreateResponse; @@ -403,29 +403,31 @@ export namespace Cloudflare { export import LoadBalancers = API.LoadBalancers; export import LoadBalancerCreateResponse = API.LoadBalancerCreateResponse; - export import LoadBalancerUpdateResponse = API.LoadBalancerUpdateResponse; export import LoadBalancerListResponse = API.LoadBalancerListResponse; export import LoadBalancerDeleteResponse = API.LoadBalancerDeleteResponse; + export import LoadBalancerEditResponse = API.LoadBalancerEditResponse; export import LoadBalancerGetResponse = API.LoadBalancerGetResponse; export import LoadBalancerCreateParams = API.LoadBalancerCreateParams; - export import LoadBalancerUpdateParams = API.LoadBalancerUpdateParams; + export import LoadBalancerEditParams = API.LoadBalancerEditParams; export import Access = API.Access; export import DNSAnalytics = API.DNSAnalytics; export import Cache = API.Cache; + export import CachePurgeResponse = API.CachePurgeResponse; + export import CachePurgeParams = API.CachePurgeParams; export import SSL = API.SSL; export import Subscriptions = API.Subscriptions; export import SubscriptionCreateResponse = API.SubscriptionCreateResponse; + export import SubscriptionUpdateResponse = API.SubscriptionUpdateResponse; export import SubscriptionListResponse = API.SubscriptionListResponse; export import SubscriptionDeleteResponse = API.SubscriptionDeleteResponse; export import SubscriptionGetResponse = API.SubscriptionGetResponse; - export import SubscriptionReplaceResponse = API.SubscriptionReplaceResponse; export import SubscriptionCreateParams = API.SubscriptionCreateParams; - export import SubscriptionReplaceParams = API.SubscriptionReplaceParams; + export import SubscriptionUpdateParams = API.SubscriptionUpdateParams; export import Acm = API.Acm; @@ -442,9 +444,9 @@ export namespace Cloudflare { export import ClientCertificates = API.ClientCertificates; export import ClientCertificateCreateResponse = API.ClientCertificateCreateResponse; - export import ClientCertificateUpdateResponse = API.ClientCertificateUpdateResponse; export import ClientCertificateListResponse = API.ClientCertificateListResponse; export import ClientCertificateDeleteResponse = API.ClientCertificateDeleteResponse; + export import ClientCertificateEditResponse = API.ClientCertificateEditResponse; export import ClientCertificateGetResponse = API.ClientCertificateGetResponse; export import ClientCertificateListResponsesV4PagePaginationArray = API.ClientCertificateListResponsesV4PagePaginationArray; export import ClientCertificateCreateParams = API.ClientCertificateCreateParams; @@ -452,25 +454,25 @@ export namespace Cloudflare { export import CustomCertificates = API.CustomCertificates; export import CustomCertificateCreateResponse = API.CustomCertificateCreateResponse; - export import CustomCertificateUpdateResponse = API.CustomCertificateUpdateResponse; export import CustomCertificateListResponse = API.CustomCertificateListResponse; export import CustomCertificateDeleteResponse = API.CustomCertificateDeleteResponse; + export import CustomCertificateEditResponse = API.CustomCertificateEditResponse; export import CustomCertificateGetResponse = API.CustomCertificateGetResponse; export import CustomCertificateListResponsesV4PagePaginationArray = API.CustomCertificateListResponsesV4PagePaginationArray; export import CustomCertificateCreateParams = API.CustomCertificateCreateParams; - export import CustomCertificateUpdateParams = API.CustomCertificateUpdateParams; export import CustomCertificateListParams = API.CustomCertificateListParams; + export import CustomCertificateEditParams = API.CustomCertificateEditParams; export import CustomHostnames = API.CustomHostnames; export import CustomHostnameCreateResponse = API.CustomHostnameCreateResponse; - export import CustomHostnameUpdateResponse = API.CustomHostnameUpdateResponse; export import CustomHostnameListResponse = API.CustomHostnameListResponse; export import CustomHostnameDeleteResponse = API.CustomHostnameDeleteResponse; + export import CustomHostnameEditResponse = API.CustomHostnameEditResponse; export import CustomHostnameGetResponse = API.CustomHostnameGetResponse; export import CustomHostnameListResponsesV4PagePaginationArray = API.CustomHostnameListResponsesV4PagePaginationArray; export import CustomHostnameCreateParams = API.CustomHostnameCreateParams; - export import CustomHostnameUpdateParams = API.CustomHostnameUpdateParams; export import CustomHostnameListParams = API.CustomHostnameListParams; + export import CustomHostnameEditParams = API.CustomHostnameEditParams; export import CustomNameservers = API.CustomNameservers; export import CustomNameserverCreateResponse = API.CustomNameserverCreateResponse; @@ -482,57 +484,57 @@ export namespace Cloudflare { export import DNSRecords = API.DNSRecords; export import DNSRecordCreateResponse = API.DNSRecordCreateResponse; + export import DNSRecordUpdateResponse = API.DNSRecordUpdateResponse; export import DNSRecordListResponse = API.DNSRecordListResponse; export import DNSRecordDeleteResponse = API.DNSRecordDeleteResponse; export import DNSRecordExportResponse = API.DNSRecordExportResponse; export import DNSRecordGetResponse = API.DNSRecordGetResponse; export import DNSRecordImportResponse = API.DNSRecordImportResponse; - export import DNSRecordReplaceResponse = API.DNSRecordReplaceResponse; export import DNSRecordScanResponse = API.DNSRecordScanResponse; export import DNSRecordListResponsesV4PagePaginationArray = API.DNSRecordListResponsesV4PagePaginationArray; export import DNSRecordCreateParams = API.DNSRecordCreateParams; + export import DNSRecordUpdateParams = API.DNSRecordUpdateParams; export import DNSRecordListParams = API.DNSRecordListParams; export import DNSRecordImportParams = API.DNSRecordImportParams; - export import DNSRecordReplaceParams = API.DNSRecordReplaceParams; export import DNSSEC = API.DNSSEC; - export import DNSSECUpdateResponse = API.DNSSECUpdateResponse; export import DNSSECDeleteResponse = API.DNSSECDeleteResponse; + export import DNSSECEditResponse = API.DNSSECEditResponse; export import DNSSECGetResponse = API.DNSSECGetResponse; - export import DNSSECUpdateParams = API.DNSSECUpdateParams; + export import DNSSECEditParams = API.DNSSECEditParams; export import Emails = API.Emails; export import Filters = API.Filters; export import FilterCreateResponse = API.FilterCreateResponse; + export import FilterUpdateResponse = API.FilterUpdateResponse; export import FilterListResponse = API.FilterListResponse; export import FilterDeleteResponse = API.FilterDeleteResponse; export import FilterGetResponse = API.FilterGetResponse; - export import FilterReplaceResponse = API.FilterReplaceResponse; export import FilterListResponsesV4PagePaginationArray = API.FilterListResponsesV4PagePaginationArray; export import FilterCreateParams = API.FilterCreateParams; + export import FilterUpdateParams = API.FilterUpdateParams; export import FilterListParams = API.FilterListParams; - export import FilterReplaceParams = API.FilterReplaceParams; export import Firewalls = API.Firewalls; export import Healthchecks = API.Healthchecks; export import HealthcheckCreateResponse = API.HealthcheckCreateResponse; + export import HealthcheckUpdateResponse = API.HealthcheckUpdateResponse; export import HealthcheckListResponse = API.HealthcheckListResponse; export import HealthcheckDeleteResponse = API.HealthcheckDeleteResponse; export import HealthcheckGetResponse = API.HealthcheckGetResponse; - export import HealthcheckReplaceResponse = API.HealthcheckReplaceResponse; export import HealthcheckCreateParams = API.HealthcheckCreateParams; - export import HealthcheckReplaceParams = API.HealthcheckReplaceParams; + export import HealthcheckUpdateParams = API.HealthcheckUpdateParams; export import KeylessCertificates = API.KeylessCertificates; export import KeylessCertificateCreateResponse = API.KeylessCertificateCreateResponse; - export import KeylessCertificateUpdateResponse = API.KeylessCertificateUpdateResponse; export import KeylessCertificateListResponse = API.KeylessCertificateListResponse; export import KeylessCertificateDeleteResponse = API.KeylessCertificateDeleteResponse; + export import KeylessCertificateEditResponse = API.KeylessCertificateEditResponse; export import KeylessCertificateGetResponse = API.KeylessCertificateGetResponse; export import KeylessCertificateCreateParams = API.KeylessCertificateCreateParams; - export import KeylessCertificateUpdateParams = API.KeylessCertificateUpdateParams; + export import KeylessCertificateEditParams = API.KeylessCertificateEditParams; export import Logpush = API.Logpush; @@ -547,24 +549,24 @@ export namespace Cloudflare { export import Pagerules = API.Pagerules; export import PageruleCreateResponse = API.PageruleCreateResponse; + export import PageruleUpdateResponse = API.PageruleUpdateResponse; export import PageruleListResponse = API.PageruleListResponse; export import PageruleDeleteResponse = API.PageruleDeleteResponse; export import PageruleGetResponse = API.PageruleGetResponse; - export import PageruleReplaceResponse = API.PageruleReplaceResponse; export import PageruleCreateParams = API.PageruleCreateParams; + export import PageruleUpdateParams = API.PageruleUpdateParams; export import PageruleListParams = API.PageruleListParams; - export import PageruleReplaceParams = API.PageruleReplaceParams; export import RateLimits = API.RateLimits; export import RateLimitCreateResponse = API.RateLimitCreateResponse; - export import RateLimitUpdateResponse = API.RateLimitUpdateResponse; export import RateLimitListResponse = API.RateLimitListResponse; export import RateLimitDeleteResponse = API.RateLimitDeleteResponse; + export import RateLimitEditResponse = API.RateLimitEditResponse; export import RateLimitGetResponse = API.RateLimitGetResponse; export import RateLimitListResponsesV4PagePaginationArray = API.RateLimitListResponsesV4PagePaginationArray; export import RateLimitCreateParams = API.RateLimitCreateParams; - export import RateLimitUpdateParams = API.RateLimitUpdateParams; export import RateLimitListParams = API.RateLimitListParams; + export import RateLimitEditParams = API.RateLimitEditParams; export import SecondaryDNS = API.SecondaryDNS; @@ -575,44 +577,44 @@ export namespace Cloudflare { export import WaitingRooms = API.WaitingRooms; export import WaitingRoomCreateResponse = API.WaitingRoomCreateResponse; + export import WaitingRoomUpdateResponse = API.WaitingRoomUpdateResponse; export import WaitingRoomListResponse = API.WaitingRoomListResponse; export import WaitingRoomDeleteResponse = API.WaitingRoomDeleteResponse; export import WaitingRoomGetResponse = API.WaitingRoomGetResponse; export import WaitingRoomPreviewResponse = API.WaitingRoomPreviewResponse; - export import WaitingRoomReplaceResponse = API.WaitingRoomReplaceResponse; export import WaitingRoomCreateParams = API.WaitingRoomCreateParams; + export import WaitingRoomUpdateParams = API.WaitingRoomUpdateParams; export import WaitingRoomPreviewParams = API.WaitingRoomPreviewParams; - export import WaitingRoomReplaceParams = API.WaitingRoomReplaceParams; export import Web3 = API.Web3; export import Workers = API.Workers; export import ActivationChecks = API.ActivationChecks; - export import ActivationCheckReplaceResponse = API.ActivationCheckReplaceResponse; + export import ActivationCheckUpdateResponse = API.ActivationCheckUpdateResponse; export import ManagedHeaders = API.ManagedHeaders; - export import ManagedHeaderUpdateResponse = API.ManagedHeaderUpdateResponse; export import ManagedHeaderListResponse = API.ManagedHeaderListResponse; - export import ManagedHeaderUpdateParams = API.ManagedHeaderUpdateParams; + export import ManagedHeaderEditResponse = API.ManagedHeaderEditResponse; + export import ManagedHeaderEditParams = API.ManagedHeaderEditParams; export import PageShield = API.PageShield; + export import PageShieldUpdateResponse = API.PageShieldUpdateResponse; export import PageShieldListResponse = API.PageShieldListResponse; - export import PageShieldReplaceResponse = API.PageShieldReplaceResponse; - export import PageShieldReplaceParams = API.PageShieldReplaceParams; + export import PageShieldUpdateParams = API.PageShieldUpdateParams; export import Rulesets = API.Rulesets; export import RulesetCreateResponse = API.RulesetCreateResponse; + export import RulesetUpdateResponse = API.RulesetUpdateResponse; export import RulesetListResponse = API.RulesetListResponse; export import RulesetGetResponse = API.RulesetGetResponse; - export import RulesetReplaceResponse = API.RulesetReplaceResponse; export import RulesetCreateParams = API.RulesetCreateParams; - export import RulesetReplaceParams = API.RulesetReplaceParams; + export import RulesetUpdateParams = API.RulesetUpdateParams; export import URLNormalizations = API.URLNormalizations; + export import URLNormalizationUpdateResponse = API.URLNormalizationUpdateResponse; export import URLNormalizationGetResponse = API.URLNormalizationGetResponse; - export import URLNormalizationReplaceResponse = API.URLNormalizationReplaceResponse; - export import URLNormalizationReplaceParams = API.URLNormalizationReplaceParams; + export import URLNormalizationUpdateParams = API.URLNormalizationUpdateParams; export import Spectrum = API.Spectrum; @@ -629,15 +631,15 @@ export namespace Cloudflare { export import Tunnels = API.Tunnels; export import TunnelCreateResponse = API.TunnelCreateResponse; - export import TunnelUpdateResponse = API.TunnelUpdateResponse; export import TunnelListResponse = API.TunnelListResponse; export import TunnelDeleteResponse = API.TunnelDeleteResponse; + export import TunnelEditResponse = API.TunnelEditResponse; export import TunnelGetResponse = API.TunnelGetResponse; export import TunnelListResponsesV4PagePaginationArray = API.TunnelListResponsesV4PagePaginationArray; export import TunnelCreateParams = API.TunnelCreateParams; - export import TunnelUpdateParams = API.TunnelUpdateParams; export import TunnelListParams = API.TunnelListParams; export import TunnelDeleteParams = API.TunnelDeleteParams; + export import TunnelEditParams = API.TunnelEditParams; export import Diagnostics = API.Diagnostics; @@ -645,14 +647,14 @@ export namespace Cloudflare { export import DNSFirewall = API.DNSFirewall; export import DNSFirewallCreateResponse = API.DNSFirewallCreateResponse; - export import DNSFirewallUpdateResponse = API.DNSFirewallUpdateResponse; export import DNSFirewallListResponse = API.DNSFirewallListResponse; export import DNSFirewallDeleteResponse = API.DNSFirewallDeleteResponse; + export import DNSFirewallEditResponse = API.DNSFirewallEditResponse; export import DNSFirewallGetResponse = API.DNSFirewallGetResponse; export import DNSFirewallListResponsesV4PagePaginationArray = API.DNSFirewallListResponsesV4PagePaginationArray; export import DNSFirewallCreateParams = API.DNSFirewallCreateParams; - export import DNSFirewallUpdateParams = API.DNSFirewallUpdateParams; export import DNSFirewallListParams = API.DNSFirewallListParams; + export import DNSFirewallEditParams = API.DNSFirewallEditParams; export import Images = API.Images; @@ -662,14 +664,14 @@ export namespace Cloudflare { export import AccountMembers = API.AccountMembers; export import AccountMemberCreateResponse = API.AccountMemberCreateResponse; + export import AccountMemberUpdateResponse = API.AccountMemberUpdateResponse; export import AccountMemberListResponse = API.AccountMemberListResponse; export import AccountMemberDeleteResponse = API.AccountMemberDeleteResponse; export import AccountMemberGetResponse = API.AccountMemberGetResponse; - export import AccountMemberReplaceResponse = API.AccountMemberReplaceResponse; export import AccountMemberListResponsesV4PagePaginationArray = API.AccountMemberListResponsesV4PagePaginationArray; export import AccountMemberCreateParams = API.AccountMemberCreateParams; + export import AccountMemberUpdateParams = API.AccountMemberUpdateParams; export import AccountMemberListParams = API.AccountMemberListParams; - export import AccountMemberReplaceParams = API.AccountMemberReplaceParams; export import Mnms = API.Mnms; @@ -728,15 +730,15 @@ export namespace Cloudflare { export import WarpConnector = API.WarpConnector; export import WarpConnectorCreateResponse = API.WarpConnectorCreateResponse; - export import WarpConnectorUpdateResponse = API.WarpConnectorUpdateResponse; export import WarpConnectorListResponse = API.WarpConnectorListResponse; export import WarpConnectorDeleteResponse = API.WarpConnectorDeleteResponse; + export import WarpConnectorEditResponse = API.WarpConnectorEditResponse; export import WarpConnectorGetResponse = API.WarpConnectorGetResponse; export import WarpConnectorListResponsesV4PagePaginationArray = API.WarpConnectorListResponsesV4PagePaginationArray; export import WarpConnectorCreateParams = API.WarpConnectorCreateParams; - export import WarpConnectorUpdateParams = API.WarpConnectorUpdateParams; export import WarpConnectorListParams = API.WarpConnectorListParams; export import WarpConnectorDeleteParams = API.WarpConnectorDeleteParams; + export import WarpConnectorEditParams = API.WarpConnectorEditParams; export import Dispatchers = API.Dispatchers; @@ -766,24 +768,24 @@ export namespace Cloudflare { export import Radar = API.Radar; export import BotManagement = API.BotManagement; + export import BotManagementUpdateResponse = API.BotManagementUpdateResponse; export import BotManagementGetResponse = API.BotManagementGetResponse; - export import BotManagementReplaceResponse = API.BotManagementReplaceResponse; - export import BotManagementReplaceParams = API.BotManagementReplaceParams; + export import BotManagementUpdateParams = API.BotManagementUpdateParams; export import CacheReserve = API.CacheReserve; export import CacheReserveCreateResponse = API.CacheReserveCreateResponse; export import CacheReserveGetResponse = API.CacheReserveGetResponse; export import OriginPostQuantumEncryption = API.OriginPostQuantumEncryption; + export import OriginPostQuantumEncryptionUpdateResponse = API.OriginPostQuantumEncryptionUpdateResponse; export import OriginPostQuantumEncryptionGetResponse = API.OriginPostQuantumEncryptionGetResponse; - export import OriginPostQuantumEncryptionReplaceResponse = API.OriginPostQuantumEncryptionReplaceResponse; - export import OriginPostQuantumEncryptionReplaceParams = API.OriginPostQuantumEncryptionReplaceParams; + export import OriginPostQuantumEncryptionUpdateParams = API.OriginPostQuantumEncryptionUpdateParams; export import Firewall = API.Firewall; export import Zaraz = API.Zaraz; - export import ZarazReplaceResponse = API.ZarazReplaceResponse; - export import ZarazReplaceParams = API.ZarazReplaceParams; + export import ZarazUpdateResponse = API.ZarazUpdateResponse; + export import ZarazUpdateParams = API.ZarazUpdateParams; export import Speed = API.Speed; export import SpeedCreateResponse = API.SpeedCreateResponse; @@ -801,20 +803,20 @@ export namespace Cloudflare { export import Hostnames = API.Hostnames; export import Snippets = API.Snippets; + export import SnippetUpdateResponse = API.SnippetUpdateResponse; export import SnippetListResponse = API.SnippetListResponse; export import SnippetDeleteResponse = API.SnippetDeleteResponse; export import SnippetGetResponse = API.SnippetGetResponse; - export import SnippetReplaceResponse = API.SnippetReplaceResponse; - export import SnippetReplaceParams = API.SnippetReplaceParams; + export import SnippetUpdateParams = API.SnippetUpdateParams; export import Calls = API.Calls; export import CallCreateResponse = API.CallCreateResponse; + export import CallUpdateResponse = API.CallUpdateResponse; export import CallListResponse = API.CallListResponse; export import CallDeleteResponse = API.CallDeleteResponse; export import CallGetResponse = API.CallGetResponse; - export import CallReplaceResponse = API.CallReplaceResponse; export import CallCreateParams = API.CallCreateParams; - export import CallReplaceParams = API.CallReplaceParams; + export import CallUpdateParams = API.CallUpdateParams; } export default Cloudflare; diff --git a/src/resources/access/access.ts b/src/resources/access/access.ts index 26900d7286..3a71c55afb 100644 --- a/src/resources/access/access.ts +++ b/src/resources/access/access.ts @@ -36,84 +36,84 @@ export class Access extends APIResource { export namespace Access { export import Applications = ApplicationsAPI.Applications; export import ApplicationCreateResponse = ApplicationsAPI.ApplicationCreateResponse; + export import ApplicationUpdateResponse = ApplicationsAPI.ApplicationUpdateResponse; export import ApplicationListResponse = ApplicationsAPI.ApplicationListResponse; export import ApplicationDeleteResponse = ApplicationsAPI.ApplicationDeleteResponse; export import ApplicationGetResponse = ApplicationsAPI.ApplicationGetResponse; - export import ApplicationReplaceResponse = ApplicationsAPI.ApplicationReplaceResponse; export import ApplicationRevokeTokensResponse = ApplicationsAPI.ApplicationRevokeTokensResponse; export import ApplicationCreateParams = ApplicationsAPI.ApplicationCreateParams; - export import ApplicationReplaceParams = ApplicationsAPI.ApplicationReplaceParams; + export import ApplicationUpdateParams = ApplicationsAPI.ApplicationUpdateParams; export import Certificates = CertificatesAPI.Certificates; export import CertificateCreateResponse = CertificatesAPI.CertificateCreateResponse; + export import CertificateUpdateResponse = CertificatesAPI.CertificateUpdateResponse; export import CertificateListResponse = CertificatesAPI.CertificateListResponse; export import CertificateDeleteResponse = CertificatesAPI.CertificateDeleteResponse; export import CertificateGetResponse = CertificatesAPI.CertificateGetResponse; - export import CertificateReplaceResponse = CertificatesAPI.CertificateReplaceResponse; export import CertificateCreateParams = CertificatesAPI.CertificateCreateParams; - export import CertificateReplaceParams = CertificatesAPI.CertificateReplaceParams; + export import CertificateUpdateParams = CertificatesAPI.CertificateUpdateParams; export import Groups = GroupsAPI.Groups; export import GroupCreateResponse = GroupsAPI.GroupCreateResponse; + export import GroupUpdateResponse = GroupsAPI.GroupUpdateResponse; export import GroupListResponse = GroupsAPI.GroupListResponse; export import GroupDeleteResponse = GroupsAPI.GroupDeleteResponse; export import GroupGetResponse = GroupsAPI.GroupGetResponse; - export import GroupReplaceResponse = GroupsAPI.GroupReplaceResponse; export import GroupCreateParams = GroupsAPI.GroupCreateParams; - export import GroupReplaceParams = GroupsAPI.GroupReplaceParams; + export import GroupUpdateParams = GroupsAPI.GroupUpdateParams; export import IdentityProviders = IdentityProvidersAPI.IdentityProviders; export import IdentityProviderCreateResponse = IdentityProvidersAPI.IdentityProviderCreateResponse; + export import IdentityProviderUpdateResponse = IdentityProvidersAPI.IdentityProviderUpdateResponse; export import IdentityProviderListResponse = IdentityProvidersAPI.IdentityProviderListResponse; export import IdentityProviderDeleteResponse = IdentityProvidersAPI.IdentityProviderDeleteResponse; export import IdentityProviderGetResponse = IdentityProvidersAPI.IdentityProviderGetResponse; - export import IdentityProviderReplaceResponse = IdentityProvidersAPI.IdentityProviderReplaceResponse; export import IdentityProviderCreateParams = IdentityProvidersAPI.IdentityProviderCreateParams; - export import IdentityProviderReplaceParams = IdentityProvidersAPI.IdentityProviderReplaceParams; + export import IdentityProviderUpdateParams = IdentityProvidersAPI.IdentityProviderUpdateParams; export import Organizations = OrganizationsAPI.Organizations; export import OrganizationCreateResponse = OrganizationsAPI.OrganizationCreateResponse; + export import OrganizationUpdateResponse = OrganizationsAPI.OrganizationUpdateResponse; export import OrganizationListResponse = OrganizationsAPI.OrganizationListResponse; - export import OrganizationReplaceResponse = OrganizationsAPI.OrganizationReplaceResponse; export import OrganizationRevokeUsersResponse = OrganizationsAPI.OrganizationRevokeUsersResponse; export import OrganizationCreateParams = OrganizationsAPI.OrganizationCreateParams; - export import OrganizationReplaceParams = OrganizationsAPI.OrganizationReplaceParams; + export import OrganizationUpdateParams = OrganizationsAPI.OrganizationUpdateParams; export import OrganizationRevokeUsersParams = OrganizationsAPI.OrganizationRevokeUsersParams; export import ServiceTokens = ServiceTokensAPI.ServiceTokens; export import ServiceTokenCreateResponse = ServiceTokensAPI.ServiceTokenCreateResponse; + export import ServiceTokenUpdateResponse = ServiceTokensAPI.ServiceTokenUpdateResponse; export import ServiceTokenListResponse = ServiceTokensAPI.ServiceTokenListResponse; export import ServiceTokenDeleteResponse = ServiceTokensAPI.ServiceTokenDeleteResponse; export import ServiceTokenRefreshResponse = ServiceTokensAPI.ServiceTokenRefreshResponse; - export import ServiceTokenReplaceResponse = ServiceTokensAPI.ServiceTokenReplaceResponse; export import ServiceTokenRotateResponse = ServiceTokensAPI.ServiceTokenRotateResponse; export import ServiceTokenCreateParams = ServiceTokensAPI.ServiceTokenCreateParams; - export import ServiceTokenReplaceParams = ServiceTokensAPI.ServiceTokenReplaceParams; + export import ServiceTokenUpdateParams = ServiceTokensAPI.ServiceTokenUpdateParams; export import Bookmarks = BookmarksAPI.Bookmarks; + export import BookmarkUpdateResponse = BookmarksAPI.BookmarkUpdateResponse; export import BookmarkListResponse = BookmarksAPI.BookmarkListResponse; export import BookmarkDeleteResponse = BookmarksAPI.BookmarkDeleteResponse; export import BookmarkGetResponse = BookmarksAPI.BookmarkGetResponse; - export import BookmarkReplaceResponse = BookmarksAPI.BookmarkReplaceResponse; export import Keys = KeysAPI.Keys; + export import KeyUpdateResponse = KeysAPI.KeyUpdateResponse; export import KeyListResponse = KeysAPI.KeyListResponse; - export import KeyReplaceResponse = KeysAPI.KeyReplaceResponse; export import KeyRotateResponse = KeysAPI.KeyRotateResponse; - export import KeyReplaceParams = KeysAPI.KeyReplaceParams; + export import KeyUpdateParams = KeysAPI.KeyUpdateParams; export import Logs = LogsAPI.Logs; export import Seats = SeatsAPI.Seats; - export import SeatUpdateResponse = SeatsAPI.SeatUpdateResponse; - export import SeatUpdateParams = SeatsAPI.SeatUpdateParams; + export import SeatEditResponse = SeatsAPI.SeatEditResponse; + export import SeatEditParams = SeatsAPI.SeatEditParams; export import Users = UsersAPI.Users; export import UserListResponse = UsersAPI.UserListResponse; export import CustomPages = CustomPagesAPI.CustomPages; export import CustomPageCreateResponse = CustomPagesAPI.CustomPageCreateResponse; + export import CustomPageUpdateResponse = CustomPagesAPI.CustomPageUpdateResponse; export import CustomPageListResponse = CustomPagesAPI.CustomPageListResponse; export import CustomPageDeleteResponse = CustomPagesAPI.CustomPageDeleteResponse; export import CustomPageGetResponse = CustomPagesAPI.CustomPageGetResponse; - export import CustomPageReplaceResponse = CustomPagesAPI.CustomPageReplaceResponse; export import CustomPageCreateParams = CustomPagesAPI.CustomPageCreateParams; - export import CustomPageReplaceParams = CustomPagesAPI.CustomPageReplaceParams; + export import CustomPageUpdateParams = CustomPagesAPI.CustomPageUpdateParams; export import Tags = TagsAPI.Tags; export import TagCreateResponse = TagsAPI.TagCreateResponse; + export import TagUpdateResponse = TagsAPI.TagUpdateResponse; export import TagListResponse = TagsAPI.TagListResponse; export import TagDeleteResponse = TagsAPI.TagDeleteResponse; export import TagGetResponse = TagsAPI.TagGetResponse; - export import TagReplaceResponse = TagsAPI.TagReplaceResponse; export import TagCreateParams = TagsAPI.TagCreateParams; - export import TagReplaceParams = TagsAPI.TagReplaceParams; + export import TagUpdateParams = TagsAPI.TagUpdateParams; } diff --git a/src/resources/access/applications/applications.ts b/src/resources/access/applications/applications.ts index 602f72c588..f1e49c54f9 100644 --- a/src/resources/access/applications/applications.ts +++ b/src/resources/access/applications/applications.ts @@ -31,6 +31,24 @@ export class Applications extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Updates an Access application. + */ + update( + accountOrZone: string, + accountOrZoneId: string, + appId: string | string, + body: ApplicationUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/${accountOrZone}/${accountOrZoneId}/access/apps/${appId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: ApplicationUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * Lists all Access applications in an account or zone. */ @@ -80,24 +98,6 @@ export class Applications extends APIResource { )._thenUnwrap((obj) => obj.result); } - /** - * Updates an Access application. - */ - replace( - accountOrZone: string, - accountOrZoneId: string, - appId: string | string, - body: ApplicationReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put(`/${accountOrZone}/${accountOrZoneId}/access/apps/${appId}`, { - body, - ...options, - }) as Core.APIPromise<{ result: ApplicationReplaceResponse }> - )._thenUnwrap((obj) => obj.result); - } - /** * Revokes all tokens issued for an application. */ @@ -1086,18 +1086,17 @@ export namespace ApplicationCreateResponse { } } -export type ApplicationListResponse = Array< - | ApplicationListResponse.SelfHostedApplication - | ApplicationListResponse.SaaSApplication - | ApplicationListResponse.BrowserSSHApplication - | ApplicationListResponse.BrowserVncApplication - | ApplicationListResponse.AppLauncherApplication - | ApplicationListResponse.DeviceEnrollmentPermissionsApplication - | ApplicationListResponse.BrowserIsolationPermissionsApplication - | ApplicationListResponse.BookmarkApplication ->; - -export namespace ApplicationListResponse { +export type ApplicationUpdateResponse = + | ApplicationUpdateResponse.SelfHostedApplication + | ApplicationUpdateResponse.SaaSApplication + | ApplicationUpdateResponse.BrowserSSHApplication + | ApplicationUpdateResponse.BrowserVncApplication + | ApplicationUpdateResponse.AppLauncherApplication + | ApplicationUpdateResponse.DeviceEnrollmentPermissionsApplication + | ApplicationUpdateResponse.BrowserIsolationPermissionsApplication + | ApplicationUpdateResponse.BookmarkApplication; + +export namespace ApplicationUpdateResponse { export interface SelfHostedApplication { /** * The primary hostname and path that Access will secure. If the app is visible in @@ -2057,24 +2056,18 @@ export namespace ApplicationListResponse { } } -export interface ApplicationDeleteResponse { - /** - * UUID - */ - id?: string; -} - -export type ApplicationGetResponse = - | ApplicationGetResponse.SelfHostedApplication - | ApplicationGetResponse.SaaSApplication - | ApplicationGetResponse.BrowserSSHApplication - | ApplicationGetResponse.BrowserVncApplication - | ApplicationGetResponse.AppLauncherApplication - | ApplicationGetResponse.DeviceEnrollmentPermissionsApplication - | ApplicationGetResponse.BrowserIsolationPermissionsApplication - | ApplicationGetResponse.BookmarkApplication; +export type ApplicationListResponse = Array< + | ApplicationListResponse.SelfHostedApplication + | ApplicationListResponse.SaaSApplication + | ApplicationListResponse.BrowserSSHApplication + | ApplicationListResponse.BrowserVncApplication + | ApplicationListResponse.AppLauncherApplication + | ApplicationListResponse.DeviceEnrollmentPermissionsApplication + | ApplicationListResponse.BrowserIsolationPermissionsApplication + | ApplicationListResponse.BookmarkApplication +>; -export namespace ApplicationGetResponse { +export namespace ApplicationListResponse { export interface SelfHostedApplication { /** * The primary hostname and path that Access will secure. If the app is visible in @@ -3034,17 +3027,24 @@ export namespace ApplicationGetResponse { } } -export type ApplicationReplaceResponse = - | ApplicationReplaceResponse.SelfHostedApplication - | ApplicationReplaceResponse.SaaSApplication - | ApplicationReplaceResponse.BrowserSSHApplication - | ApplicationReplaceResponse.BrowserVncApplication - | ApplicationReplaceResponse.AppLauncherApplication - | ApplicationReplaceResponse.DeviceEnrollmentPermissionsApplication - | ApplicationReplaceResponse.BrowserIsolationPermissionsApplication - | ApplicationReplaceResponse.BookmarkApplication; - -export namespace ApplicationReplaceResponse { +export interface ApplicationDeleteResponse { + /** + * UUID + */ + id?: string; +} + +export type ApplicationGetResponse = + | ApplicationGetResponse.SelfHostedApplication + | ApplicationGetResponse.SaaSApplication + | ApplicationGetResponse.BrowserSSHApplication + | ApplicationGetResponse.BrowserVncApplication + | ApplicationGetResponse.AppLauncherApplication + | ApplicationGetResponse.DeviceEnrollmentPermissionsApplication + | ApplicationGetResponse.BrowserIsolationPermissionsApplication + | ApplicationGetResponse.BookmarkApplication; + +export namespace ApplicationGetResponse { export interface SelfHostedApplication { /** * The primary hostname and path that Access will secure. If the app is visible in @@ -4825,17 +4825,17 @@ export namespace ApplicationCreateParams { } } -export type ApplicationReplaceParams = - | ApplicationReplaceParams.Variant0 - | ApplicationReplaceParams.Variant1 - | ApplicationReplaceParams.Variant2 - | ApplicationReplaceParams.Variant3 - | ApplicationReplaceParams.Variant4 - | ApplicationReplaceParams.Variant5 - | ApplicationReplaceParams.Variant6 - | ApplicationReplaceParams.Variant7; - -export namespace ApplicationReplaceParams { +export type ApplicationUpdateParams = + | ApplicationUpdateParams.Variant0 + | ApplicationUpdateParams.Variant1 + | ApplicationUpdateParams.Variant2 + | ApplicationUpdateParams.Variant3 + | ApplicationUpdateParams.Variant4 + | ApplicationUpdateParams.Variant5 + | ApplicationUpdateParams.Variant6 + | ApplicationUpdateParams.Variant7; + +export namespace ApplicationUpdateParams { export interface Variant0 { /** * The primary hostname and path that Access will secure. If the app is visible in @@ -4873,7 +4873,7 @@ export namespace ApplicationReplaceParams { */ auto_redirect_to_identity?: boolean; - cors_headers?: ApplicationReplaceParams.Variant0.CorsHeaders; + cors_headers?: ApplicationUpdateParams.Variant0.CorsHeaders; /** * The custom error message shown to a user when they are denied access to the @@ -5042,8 +5042,8 @@ export namespace ApplicationReplaceParams { name?: string; saas_app?: - | ApplicationReplaceParams.Variant1.AccessSamlSaasApp - | ApplicationReplaceParams.Variant1.AccessOidcSaasApp; + | ApplicationUpdateParams.Variant1.AccessSamlSaasApp + | ApplicationUpdateParams.Variant1.AccessOidcSaasApp; /** * The tags you want assigned to an application. Tags are used to filter @@ -5228,7 +5228,7 @@ export namespace ApplicationReplaceParams { */ auto_redirect_to_identity?: boolean; - cors_headers?: ApplicationReplaceParams.Variant2.CorsHeaders; + cors_headers?: ApplicationUpdateParams.Variant2.CorsHeaders; /** * The custom error message shown to a user when they are denied access to the @@ -5400,7 +5400,7 @@ export namespace ApplicationReplaceParams { */ auto_redirect_to_identity?: boolean; - cors_headers?: ApplicationReplaceParams.Variant3.CorsHeaders; + cors_headers?: ApplicationUpdateParams.Variant3.CorsHeaders; /** * The custom error message shown to a user when they are denied access to the @@ -5646,13 +5646,13 @@ export namespace ApplicationReplaceParams { export namespace Applications { export import ApplicationCreateResponse = ApplicationsAPI.ApplicationCreateResponse; + export import ApplicationUpdateResponse = ApplicationsAPI.ApplicationUpdateResponse; export import ApplicationListResponse = ApplicationsAPI.ApplicationListResponse; export import ApplicationDeleteResponse = ApplicationsAPI.ApplicationDeleteResponse; export import ApplicationGetResponse = ApplicationsAPI.ApplicationGetResponse; - export import ApplicationReplaceResponse = ApplicationsAPI.ApplicationReplaceResponse; export import ApplicationRevokeTokensResponse = ApplicationsAPI.ApplicationRevokeTokensResponse; export import ApplicationCreateParams = ApplicationsAPI.ApplicationCreateParams; - export import ApplicationReplaceParams = ApplicationsAPI.ApplicationReplaceParams; + export import ApplicationUpdateParams = ApplicationsAPI.ApplicationUpdateParams; export import Cas = CasAPI.Cas; export import CaCreateResponse = CasAPI.CaCreateResponse; export import CaListResponse = CasAPI.CaListResponse; @@ -5662,10 +5662,10 @@ export namespace Applications { export import UserPolicyCheckListResponse = UserPolicyChecksAPI.UserPolicyCheckListResponse; export import Policies = PoliciesAPI.Policies; export import PolicyCreateResponse = PoliciesAPI.PolicyCreateResponse; + export import PolicyUpdateResponse = PoliciesAPI.PolicyUpdateResponse; export import PolicyListResponse = PoliciesAPI.PolicyListResponse; export import PolicyDeleteResponse = PoliciesAPI.PolicyDeleteResponse; export import PolicyGetResponse = PoliciesAPI.PolicyGetResponse; - export import PolicyReplaceResponse = PoliciesAPI.PolicyReplaceResponse; export import PolicyCreateParams = PoliciesAPI.PolicyCreateParams; - export import PolicyReplaceParams = PoliciesAPI.PolicyReplaceParams; + export import PolicyUpdateParams = PoliciesAPI.PolicyUpdateParams; } diff --git a/src/resources/access/applications/index.ts b/src/resources/access/applications/index.ts index b709cff48d..488b7c6a5e 100644 --- a/src/resources/access/applications/index.ts +++ b/src/resources/access/applications/index.ts @@ -2,24 +2,24 @@ export { ApplicationCreateResponse, + ApplicationUpdateResponse, ApplicationListResponse, ApplicationDeleteResponse, ApplicationGetResponse, - ApplicationReplaceResponse, ApplicationRevokeTokensResponse, ApplicationCreateParams, - ApplicationReplaceParams, + ApplicationUpdateParams, Applications, } from './applications'; export { CaCreateResponse, CaListResponse, CaDeleteResponse, CaGetResponse, Cas } from './cas'; export { PolicyCreateResponse, + PolicyUpdateResponse, PolicyListResponse, PolicyDeleteResponse, PolicyGetResponse, - PolicyReplaceResponse, PolicyCreateParams, - PolicyReplaceParams, + PolicyUpdateParams, Policies, } from './policies'; export { UserPolicyCheckListResponse, UserPolicyChecks } from './user-policy-checks'; diff --git a/src/resources/access/applications/policies.ts b/src/resources/access/applications/policies.ts index 9e52d0c6a9..44a3f90deb 100644 --- a/src/resources/access/applications/policies.ts +++ b/src/resources/access/applications/policies.ts @@ -23,6 +23,25 @@ export class Policies extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Update a configured Access policy. + */ + update( + accountOrZone: string, + accountOrZoneId: string, + uuid1: string, + uuid: string, + body: PolicyUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/${accountOrZone}/${accountOrZoneId}/access/apps/${uuid1}/policies/${uuid}`, { + body, + ...options, + }) as Core.APIPromise<{ result: PolicyUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * Lists Access policies configured for an application. */ @@ -75,25 +94,6 @@ export class Policies extends APIResource { ) as Core.APIPromise<{ result: PolicyGetResponse }> )._thenUnwrap((obj) => obj.result); } - - /** - * Update a configured Access policy. - */ - replace( - accountOrZone: string, - accountOrZoneId: string, - uuid1: string, - uuid: string, - body: PolicyReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put(`/${accountOrZone}/${accountOrZoneId}/access/apps/${uuid1}/policies/${uuid}`, { - body, - ...options, - }) as Core.APIPromise<{ result: PolicyReplaceResponse }> - )._thenUnwrap((obj) => obj.result); - } } export interface PolicyCreateResponse { @@ -1202,2230 +1202,2230 @@ export namespace PolicyCreateResponse { } } -export type PolicyListResponse = Array; +export interface PolicyUpdateResponse { + /** + * UUID + */ + id?: string; -export namespace PolicyListResponse { - export interface PolicyListResponseItem { - /** - * UUID - */ - id?: string; + /** + * Administrators who can approve a temporary authentication request. + */ + approval_groups?: Array; - /** - * Administrators who can approve a temporary authentication request. - */ - approval_groups?: Array; + /** + * Requires the user to request access from an administrator at the start of each + * session. + */ + approval_required?: boolean; - /** - * Requires the user to request access from an administrator at the start of each - * session. - */ - approval_required?: boolean; + created_at?: string; - created_at?: string; + /** + * The action Access will take if a user matches this policy. + */ + decision?: 'allow' | 'deny' | 'non_identity' | 'bypass'; - /** - * The action Access will take if a user matches this policy. - */ - decision?: 'allow' | 'deny' | 'non_identity' | 'bypass'; + /** + * Rules evaluated with a NOT logical operator. To match the policy, a user cannot + * meet any of the Exclude rules. + */ + exclude?: Array< + | PolicyUpdateResponse.AccessEmailRule + | PolicyUpdateResponse.AccessEmailListRule + | PolicyUpdateResponse.AccessDomainRule + | PolicyUpdateResponse.AccessEveryoneRule + | PolicyUpdateResponse.AccessIPRule + | PolicyUpdateResponse.AccessIPListRule + | PolicyUpdateResponse.AccessCertificateRule + | PolicyUpdateResponse.AccessAccessGroupRule + | PolicyUpdateResponse.AccessAzureGroupRule + | PolicyUpdateResponse.AccessGitHubOrganizationRule + | PolicyUpdateResponse.AccessGsuiteGroupRule + | PolicyUpdateResponse.AccessOktaGroupRule + | PolicyUpdateResponse.AccessSamlGroupRule + | PolicyUpdateResponse.AccessServiceTokenRule + | PolicyUpdateResponse.AccessAnyValidServiceTokenRule + | PolicyUpdateResponse.AccessExternalEvaluationRule + | PolicyUpdateResponse.AccessCountryRule + | PolicyUpdateResponse.AccessAuthenticationMethodRule + | PolicyUpdateResponse.AccessDevicePostureRule + >; - /** - * Rules evaluated with a NOT logical operator. To match the policy, a user cannot - * meet any of the Exclude rules. - */ - exclude?: Array< - | PolicyListResponseItem.AccessEmailRule - | PolicyListResponseItem.AccessEmailListRule - | PolicyListResponseItem.AccessDomainRule - | PolicyListResponseItem.AccessEveryoneRule - | PolicyListResponseItem.AccessIPRule - | PolicyListResponseItem.AccessIPListRule - | PolicyListResponseItem.AccessCertificateRule - | PolicyListResponseItem.AccessAccessGroupRule - | PolicyListResponseItem.AccessAzureGroupRule - | PolicyListResponseItem.AccessGitHubOrganizationRule - | PolicyListResponseItem.AccessGsuiteGroupRule - | PolicyListResponseItem.AccessOktaGroupRule - | PolicyListResponseItem.AccessSamlGroupRule - | PolicyListResponseItem.AccessServiceTokenRule - | PolicyListResponseItem.AccessAnyValidServiceTokenRule - | PolicyListResponseItem.AccessExternalEvaluationRule - | PolicyListResponseItem.AccessCountryRule - | PolicyListResponseItem.AccessAuthenticationMethodRule - | PolicyListResponseItem.AccessDevicePostureRule - >; + /** + * Rules evaluated with an OR logical operator. A user needs to meet only one of + * the Include rules. + */ + include?: Array< + | PolicyUpdateResponse.AccessEmailRule + | PolicyUpdateResponse.AccessEmailListRule + | PolicyUpdateResponse.AccessDomainRule + | PolicyUpdateResponse.AccessEveryoneRule + | PolicyUpdateResponse.AccessIPRule + | PolicyUpdateResponse.AccessIPListRule + | PolicyUpdateResponse.AccessCertificateRule + | PolicyUpdateResponse.AccessAccessGroupRule + | PolicyUpdateResponse.AccessAzureGroupRule + | PolicyUpdateResponse.AccessGitHubOrganizationRule + | PolicyUpdateResponse.AccessGsuiteGroupRule + | PolicyUpdateResponse.AccessOktaGroupRule + | PolicyUpdateResponse.AccessSamlGroupRule + | PolicyUpdateResponse.AccessServiceTokenRule + | PolicyUpdateResponse.AccessAnyValidServiceTokenRule + | PolicyUpdateResponse.AccessExternalEvaluationRule + | PolicyUpdateResponse.AccessCountryRule + | PolicyUpdateResponse.AccessAuthenticationMethodRule + | PolicyUpdateResponse.AccessDevicePostureRule + >; - /** - * Rules evaluated with an OR logical operator. A user needs to meet only one of - * the Include rules. - */ - include?: Array< - | PolicyListResponseItem.AccessEmailRule - | PolicyListResponseItem.AccessEmailListRule - | PolicyListResponseItem.AccessDomainRule - | PolicyListResponseItem.AccessEveryoneRule - | PolicyListResponseItem.AccessIPRule - | PolicyListResponseItem.AccessIPListRule - | PolicyListResponseItem.AccessCertificateRule - | PolicyListResponseItem.AccessAccessGroupRule - | PolicyListResponseItem.AccessAzureGroupRule - | PolicyListResponseItem.AccessGitHubOrganizationRule - | PolicyListResponseItem.AccessGsuiteGroupRule - | PolicyListResponseItem.AccessOktaGroupRule - | PolicyListResponseItem.AccessSamlGroupRule - | PolicyListResponseItem.AccessServiceTokenRule - | PolicyListResponseItem.AccessAnyValidServiceTokenRule - | PolicyListResponseItem.AccessExternalEvaluationRule - | PolicyListResponseItem.AccessCountryRule - | PolicyListResponseItem.AccessAuthenticationMethodRule - | PolicyListResponseItem.AccessDevicePostureRule - >; + /** + * 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. + */ + isolation_required?: boolean; - /** - * 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. - */ - isolation_required?: boolean; + /** + * The name of the Access policy. + */ + name?: string; - /** - * The name of the Access policy. - */ - name?: string; + /** + * The order of execution for this policy. Must be unique for each policy. + */ + precedence?: number; - /** - * The order of execution for this policy. Must be unique for each policy. - */ - precedence?: number; + /** + * A custom message that will appear on the purpose justification screen. + */ + purpose_justification_prompt?: string; - /** - * A custom message that will appear on the purpose justification screen. - */ - purpose_justification_prompt?: string; + /** + * Require users to enter a justification when they log in to the application. + */ + purpose_justification_required?: boolean; - /** - * Require users to enter a justification when they log in to the application. - */ - purpose_justification_required?: boolean; + /** + * Rules evaluated with an AND logical operator. To match the policy, a user must + * meet all of the Require rules. + */ + require?: Array< + | PolicyUpdateResponse.AccessEmailRule + | PolicyUpdateResponse.AccessEmailListRule + | PolicyUpdateResponse.AccessDomainRule + | PolicyUpdateResponse.AccessEveryoneRule + | PolicyUpdateResponse.AccessIPRule + | PolicyUpdateResponse.AccessIPListRule + | PolicyUpdateResponse.AccessCertificateRule + | PolicyUpdateResponse.AccessAccessGroupRule + | PolicyUpdateResponse.AccessAzureGroupRule + | PolicyUpdateResponse.AccessGitHubOrganizationRule + | PolicyUpdateResponse.AccessGsuiteGroupRule + | PolicyUpdateResponse.AccessOktaGroupRule + | PolicyUpdateResponse.AccessSamlGroupRule + | PolicyUpdateResponse.AccessServiceTokenRule + | PolicyUpdateResponse.AccessAnyValidServiceTokenRule + | PolicyUpdateResponse.AccessExternalEvaluationRule + | PolicyUpdateResponse.AccessCountryRule + | PolicyUpdateResponse.AccessAuthenticationMethodRule + | PolicyUpdateResponse.AccessDevicePostureRule + >; + + /** + * 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. + */ + session_duration?: string; + + updated_at?: string; +} +export namespace PolicyUpdateResponse { + /** + * A group of email addresses that can approve a temporary authentication request. + */ + export interface ApprovalGroup { /** - * Rules evaluated with an AND logical operator. To match the policy, a user must - * meet all of the Require rules. + * The number of approvals needed to obtain access. */ - require?: Array< - | PolicyListResponseItem.AccessEmailRule - | PolicyListResponseItem.AccessEmailListRule - | PolicyListResponseItem.AccessDomainRule - | PolicyListResponseItem.AccessEveryoneRule - | PolicyListResponseItem.AccessIPRule - | PolicyListResponseItem.AccessIPListRule - | PolicyListResponseItem.AccessCertificateRule - | PolicyListResponseItem.AccessAccessGroupRule - | PolicyListResponseItem.AccessAzureGroupRule - | PolicyListResponseItem.AccessGitHubOrganizationRule - | PolicyListResponseItem.AccessGsuiteGroupRule - | PolicyListResponseItem.AccessOktaGroupRule - | PolicyListResponseItem.AccessSamlGroupRule - | PolicyListResponseItem.AccessServiceTokenRule - | PolicyListResponseItem.AccessAnyValidServiceTokenRule - | PolicyListResponseItem.AccessExternalEvaluationRule - | PolicyListResponseItem.AccessCountryRule - | PolicyListResponseItem.AccessAuthenticationMethodRule - | PolicyListResponseItem.AccessDevicePostureRule - >; + approvals_needed: number; /** - * 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. + * A list of emails that can approve the access request. */ - session_duration?: string; - - updated_at?: string; - } + email_addresses?: Array; - export namespace PolicyListResponseItem { /** - * A group of email addresses that can approve a temporary authentication request. + * The UUID of an re-usable email list. */ - export interface ApprovalGroup { - /** - * The number of approvals needed to obtain access. - */ - approvals_needed: number; + email_list_uuid?: string; + } - /** - * A list of emails that can approve the access request. - */ - email_addresses?: Array; + /** + * Matches a specific email. + */ + export interface AccessEmailRule { + email: AccessEmailRule.Email; + } + export namespace AccessEmailRule { + export interface Email { /** - * The UUID of an re-usable email list. + * The email of the user. */ - email_list_uuid?: string; + email: string; } + } - /** - * Matches a specific email. - */ - export interface AccessEmailRule { - email: AccessEmailRule.Email; - } + /** + * Matches an email address from a list. + */ + export interface AccessEmailListRule { + email_list: AccessEmailListRule.EmailList; + } - export namespace AccessEmailRule { - export interface Email { - /** - * The email of the user. - */ - email: string; - } + export namespace AccessEmailListRule { + export interface EmailList { + /** + * The ID of a previously created email list. + */ + id: string; } + } - /** - * Matches an email address from a list. - */ - export interface AccessEmailListRule { - email_list: AccessEmailListRule.EmailList; - } + /** + * Match an entire email domain. + */ + export interface AccessDomainRule { + email_domain: AccessDomainRule.EmailDomain; + } - export namespace AccessEmailListRule { - export interface EmailList { - /** - * The ID of a previously created email list. - */ - id: string; - } + export namespace AccessDomainRule { + export interface EmailDomain { + /** + * The email domain to match. + */ + domain: string; } + } + /** + * Matches everyone. + */ + export interface AccessEveryoneRule { /** - * Match an entire email domain. + * An empty object which matches on all users. */ - export interface AccessDomainRule { - email_domain: AccessDomainRule.EmailDomain; - } + everyone: unknown; + } - export namespace AccessDomainRule { - export interface EmailDomain { - /** - * The email domain to match. - */ - domain: string; - } - } + /** + * Matches an IP address block. + */ + export interface AccessIPRule { + ip: AccessIPRule.IP; + } - /** - * Matches everyone. - */ - export interface AccessEveryoneRule { + export namespace AccessIPRule { + export interface IP { /** - * An empty object which matches on all users. + * An IPv4 or IPv6 CIDR block. */ - everyone: unknown; + ip: string; } + } - /** - * Matches an IP address block. - */ - export interface AccessIPRule { - ip: AccessIPRule.IP; - } + /** + * Matches an IP address from a list. + */ + export interface AccessIPListRule { + ip_list: AccessIPListRule.IPList; + } - export namespace AccessIPRule { - export interface IP { - /** - * An IPv4 or IPv6 CIDR block. - */ - ip: string; - } + export namespace AccessIPListRule { + export interface IPList { + /** + * The ID of a previously created IP list. + */ + id: string; } + } - /** - * Matches an IP address from a list. - */ - export interface AccessIPListRule { - ip_list: AccessIPListRule.IPList; - } + /** + * Matches any valid client certificate. + */ + export interface AccessCertificateRule { + certificate: unknown; + } - export namespace AccessIPListRule { - export interface IPList { - /** - * The ID of a previously created IP list. - */ - id: string; - } - } + /** + * Matches an Access group. + */ + export interface AccessAccessGroupRule { + group: AccessAccessGroupRule.Group; + } - /** - * Matches any valid client certificate. - */ - export interface AccessCertificateRule { - certificate: unknown; + export namespace AccessAccessGroupRule { + export interface Group { + /** + * The ID of a previously created Access group. + */ + id: string; } + } - /** - * Matches an Access group. - */ - export interface AccessAccessGroupRule { - group: AccessAccessGroupRule.Group; - } + /** + * Matches an Azure group. Requires an Azure identity provider. + */ + export interface AccessAzureGroupRule { + azureAD: AccessAzureGroupRule.AzureAd; + } - export namespace AccessAccessGroupRule { - export interface Group { - /** - * The ID of a previously created Access group. - */ - id: string; - } - } + export namespace AccessAzureGroupRule { + export interface AzureAd { + /** + * The ID of an Azure group. + */ + id: string; - /** - * Matches an Azure group. Requires an Azure identity provider. - */ - export interface AccessAzureGroupRule { - azureAD: AccessAzureGroupRule.AzureAd; + /** + * The ID of your Azure identity provider. + */ + connection_id: string; } + } - export namespace AccessAzureGroupRule { - export interface AzureAd { - /** - * The ID of an Azure group. - */ - id: string; + /** + * Matches a Github organization. Requires a Github identity provider. + */ + export interface AccessGitHubOrganizationRule { + 'github-organization': AccessGitHubOrganizationRule.GitHubOrganization; + } - /** - * The ID of your Azure identity provider. - */ - connection_id: string; - } - } + export namespace AccessGitHubOrganizationRule { + export interface GitHubOrganization { + /** + * The ID of your Github identity provider. + */ + connection_id: string; - /** - * Matches a Github organization. Requires a Github identity provider. - */ - export interface AccessGitHubOrganizationRule { - 'github-organization': AccessGitHubOrganizationRule.GitHubOrganization; + /** + * The name of the organization. + */ + name: string; } + } - export namespace AccessGitHubOrganizationRule { - export interface GitHubOrganization { - /** - * The ID of your Github identity provider. - */ - connection_id: string; + /** + * Matches a group in Google Workspace. Requires a Google Workspace identity + * provider. + */ + export interface AccessGsuiteGroupRule { + gsuite: AccessGsuiteGroupRule.Gsuite; + } - /** - * The name of the organization. - */ - name: string; - } - } + export namespace AccessGsuiteGroupRule { + export interface Gsuite { + /** + * The ID of your Google Workspace identity provider. + */ + connection_id: string; - /** - * Matches a group in Google Workspace. Requires a Google Workspace identity - * provider. - */ - export interface AccessGsuiteGroupRule { - gsuite: AccessGsuiteGroupRule.Gsuite; + /** + * The email of the Google Workspace group. + */ + email: string; } + } - export namespace AccessGsuiteGroupRule { - export interface Gsuite { - /** - * The ID of your Google Workspace identity provider. - */ - connection_id: string; + /** + * Matches an Okta group. Requires an Okta identity provider. + */ + export interface AccessOktaGroupRule { + okta: AccessOktaGroupRule.Okta; + } - /** - * The email of the Google Workspace group. - */ - email: string; - } - } + export namespace AccessOktaGroupRule { + export interface Okta { + /** + * The ID of your Okta identity provider. + */ + connection_id: string; - /** - * Matches an Okta group. Requires an Okta identity provider. - */ - export interface AccessOktaGroupRule { - okta: AccessOktaGroupRule.Okta; + /** + * The email of the Okta group. + */ + email: string; } + } - export namespace AccessOktaGroupRule { - export interface Okta { - /** - * The ID of your Okta identity provider. - */ - connection_id: string; + /** + * Matches a SAML group. Requires a SAML identity provider. + */ + export interface AccessSamlGroupRule { + saml: AccessSamlGroupRule.Saml; + } - /** - * The email of the Okta group. - */ - email: string; - } - } + export namespace AccessSamlGroupRule { + export interface Saml { + /** + * The name of the SAML attribute. + */ + attribute_name: string; - /** - * Matches a SAML group. Requires a SAML identity provider. - */ - export interface AccessSamlGroupRule { - saml: AccessSamlGroupRule.Saml; + /** + * The SAML attribute value to look for. + */ + attribute_value: string; } + } - export namespace AccessSamlGroupRule { - export interface Saml { - /** - * The name of the SAML attribute. - */ - attribute_name: string; + /** + * Matches a specific Access Service Token + */ + export interface AccessServiceTokenRule { + service_token: AccessServiceTokenRule.ServiceToken; + } - /** - * The SAML attribute value to look for. - */ - attribute_value: string; - } + export namespace AccessServiceTokenRule { + export interface ServiceToken { + /** + * The ID of a Service Token. + */ + token_id: string; } + } + /** + * Matches any valid Access Service Token + */ + export interface AccessAnyValidServiceTokenRule { /** - * Matches a specific Access Service Token + * An empty object which matches on all service tokens. */ - export interface AccessServiceTokenRule { - service_token: AccessServiceTokenRule.ServiceToken; - } + any_valid_service_token: unknown; + } - export namespace AccessServiceTokenRule { - export interface ServiceToken { - /** - * The ID of a Service Token. - */ - token_id: string; - } - } + /** + * Create Allow or Block policies which evaluate the user based on custom criteria. + */ + export interface AccessExternalEvaluationRule { + external_evaluation: AccessExternalEvaluationRule.ExternalEvaluation; + } - /** - * Matches any valid Access Service Token - */ - export interface AccessAnyValidServiceTokenRule { + export namespace AccessExternalEvaluationRule { + export interface ExternalEvaluation { /** - * An empty object which matches on all service tokens. + * The API endpoint containing your business logic. */ - any_valid_service_token: unknown; - } + evaluate_url: string; - /** - * Create Allow or Block policies which evaluate the user based on custom criteria. - */ - export interface AccessExternalEvaluationRule { - external_evaluation: AccessExternalEvaluationRule.ExternalEvaluation; + /** + * The API endpoint containing the key that Access uses to verify that the response + * came from your API. + */ + keys_url: string; } + } - export namespace AccessExternalEvaluationRule { - export interface ExternalEvaluation { - /** - * The API endpoint containing your business logic. - */ - evaluate_url: string; + /** + * Matches a specific country + */ + export interface AccessCountryRule { + geo: AccessCountryRule.Geo; + } - /** - * The API endpoint containing the key that Access uses to verify that the response - * came from your API. - */ - keys_url: string; - } + export namespace AccessCountryRule { + export interface Geo { + /** + * The country code that should be matched. + */ + country_code: string; } + } - /** - * Matches a specific country - */ - export interface AccessCountryRule { - geo: AccessCountryRule.Geo; - } + /** + * Enforce different MFA options + */ + export interface AccessAuthenticationMethodRule { + auth_method: AccessAuthenticationMethodRule.AuthMethod; + } - export namespace AccessCountryRule { - export interface Geo { - /** - * The country code that should be matched. - */ - country_code: string; - } + export namespace AccessAuthenticationMethodRule { + export interface AuthMethod { + /** + * The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. + */ + auth_method: string; } + } - /** - * Enforce different MFA options - */ - export interface AccessAuthenticationMethodRule { - auth_method: AccessAuthenticationMethodRule.AuthMethod; - } + /** + * Enforces a device posture rule has run successfully + */ + export interface AccessDevicePostureRule { + device_posture: AccessDevicePostureRule.DevicePosture; + } - export namespace AccessAuthenticationMethodRule { - export interface AuthMethod { - /** - * The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. - */ - auth_method: string; - } + export namespace AccessDevicePostureRule { + export interface DevicePosture { + /** + * The ID of a device posture integration. + */ + integration_uid: string; } + } - /** - * Enforces a device posture rule has run successfully - */ - export interface AccessDevicePostureRule { - device_posture: AccessDevicePostureRule.DevicePosture; - } + /** + * Matches a specific email. + */ + export interface AccessEmailRule { + email: AccessEmailRule.Email; + } - export namespace AccessDevicePostureRule { - export interface DevicePosture { - /** - * The ID of a device posture integration. - */ - integration_uid: string; - } + export namespace AccessEmailRule { + export interface Email { + /** + * The email of the user. + */ + email: string; } + } - /** - * Matches a specific email. - */ - export interface AccessEmailRule { - email: AccessEmailRule.Email; - } + /** + * Matches an email address from a list. + */ + export interface AccessEmailListRule { + email_list: AccessEmailListRule.EmailList; + } - export namespace AccessEmailRule { - export interface Email { - /** - * The email of the user. - */ - email: string; - } + export namespace AccessEmailListRule { + export interface EmailList { + /** + * The ID of a previously created email list. + */ + id: string; } + } - /** - * Matches an email address from a list. - */ - export interface AccessEmailListRule { - email_list: AccessEmailListRule.EmailList; - } + /** + * Match an entire email domain. + */ + export interface AccessDomainRule { + email_domain: AccessDomainRule.EmailDomain; + } - export namespace AccessEmailListRule { - export interface EmailList { - /** - * The ID of a previously created email list. - */ - id: string; - } + export namespace AccessDomainRule { + export interface EmailDomain { + /** + * The email domain to match. + */ + domain: string; } + } + /** + * Matches everyone. + */ + export interface AccessEveryoneRule { /** - * Match an entire email domain. + * An empty object which matches on all users. */ - export interface AccessDomainRule { - email_domain: AccessDomainRule.EmailDomain; - } + everyone: unknown; + } - export namespace AccessDomainRule { - export interface EmailDomain { - /** - * The email domain to match. - */ - domain: string; - } - } + /** + * Matches an IP address block. + */ + export interface AccessIPRule { + ip: AccessIPRule.IP; + } - /** - * Matches everyone. - */ - export interface AccessEveryoneRule { + export namespace AccessIPRule { + export interface IP { /** - * An empty object which matches on all users. + * An IPv4 or IPv6 CIDR block. */ - everyone: unknown; + ip: string; } + } - /** - * Matches an IP address block. - */ - export interface AccessIPRule { - ip: AccessIPRule.IP; - } + /** + * Matches an IP address from a list. + */ + export interface AccessIPListRule { + ip_list: AccessIPListRule.IPList; + } - export namespace AccessIPRule { - export interface IP { - /** - * An IPv4 or IPv6 CIDR block. - */ - ip: string; - } + export namespace AccessIPListRule { + export interface IPList { + /** + * The ID of a previously created IP list. + */ + id: string; } + } - /** - * Matches an IP address from a list. - */ - export interface AccessIPListRule { - ip_list: AccessIPListRule.IPList; - } + /** + * Matches any valid client certificate. + */ + export interface AccessCertificateRule { + certificate: unknown; + } - export namespace AccessIPListRule { - export interface IPList { - /** - * The ID of a previously created IP list. - */ - id: string; - } - } + /** + * Matches an Access group. + */ + export interface AccessAccessGroupRule { + group: AccessAccessGroupRule.Group; + } - /** - * Matches any valid client certificate. - */ - export interface AccessCertificateRule { - certificate: unknown; + export namespace AccessAccessGroupRule { + export interface Group { + /** + * The ID of a previously created Access group. + */ + id: string; } + } - /** - * Matches an Access group. - */ - export interface AccessAccessGroupRule { - group: AccessAccessGroupRule.Group; - } + /** + * Matches an Azure group. Requires an Azure identity provider. + */ + export interface AccessAzureGroupRule { + azureAD: AccessAzureGroupRule.AzureAd; + } - export namespace AccessAccessGroupRule { - export interface Group { - /** - * The ID of a previously created Access group. - */ - id: string; - } - } + export namespace AccessAzureGroupRule { + export interface AzureAd { + /** + * The ID of an Azure group. + */ + id: string; - /** - * Matches an Azure group. Requires an Azure identity provider. - */ - export interface AccessAzureGroupRule { - azureAD: AccessAzureGroupRule.AzureAd; + /** + * The ID of your Azure identity provider. + */ + connection_id: string; } + } - export namespace AccessAzureGroupRule { - export interface AzureAd { - /** - * The ID of an Azure group. - */ - id: string; + /** + * Matches a Github organization. Requires a Github identity provider. + */ + export interface AccessGitHubOrganizationRule { + 'github-organization': AccessGitHubOrganizationRule.GitHubOrganization; + } - /** - * The ID of your Azure identity provider. - */ - connection_id: string; - } - } + export namespace AccessGitHubOrganizationRule { + export interface GitHubOrganization { + /** + * The ID of your Github identity provider. + */ + connection_id: string; - /** - * Matches a Github organization. Requires a Github identity provider. - */ - export interface AccessGitHubOrganizationRule { - 'github-organization': AccessGitHubOrganizationRule.GitHubOrganization; + /** + * The name of the organization. + */ + name: string; } + } - export namespace AccessGitHubOrganizationRule { - export interface GitHubOrganization { - /** - * The ID of your Github identity provider. - */ - connection_id: string; + /** + * Matches a group in Google Workspace. Requires a Google Workspace identity + * provider. + */ + export interface AccessGsuiteGroupRule { + gsuite: AccessGsuiteGroupRule.Gsuite; + } - /** - * The name of the organization. - */ - name: string; - } - } + export namespace AccessGsuiteGroupRule { + export interface Gsuite { + /** + * The ID of your Google Workspace identity provider. + */ + connection_id: string; - /** - * Matches a group in Google Workspace. Requires a Google Workspace identity - * provider. - */ - export interface AccessGsuiteGroupRule { - gsuite: AccessGsuiteGroupRule.Gsuite; + /** + * The email of the Google Workspace group. + */ + email: string; } + } - export namespace AccessGsuiteGroupRule { - export interface Gsuite { - /** - * The ID of your Google Workspace identity provider. - */ - connection_id: string; - - /** - * The email of the Google Workspace group. - */ - email: string; - } - } + /** + * Matches an Okta group. Requires an Okta identity provider. + */ + export interface AccessOktaGroupRule { + okta: AccessOktaGroupRule.Okta; + } - /** - * Matches an Okta group. Requires an Okta identity provider. - */ - export interface AccessOktaGroupRule { - okta: AccessOktaGroupRule.Okta; + export namespace AccessOktaGroupRule { + export interface Okta { + /** + * The ID of your Okta identity provider. + */ + connection_id: string; + + /** + * The email of the Okta group. + */ + email: string; } + } - export namespace AccessOktaGroupRule { - export interface Okta { - /** - * The ID of your Okta identity provider. - */ - connection_id: string; + /** + * Matches a SAML group. Requires a SAML identity provider. + */ + export interface AccessSamlGroupRule { + saml: AccessSamlGroupRule.Saml; + } - /** - * The email of the Okta group. - */ - email: string; - } - } + export namespace AccessSamlGroupRule { + export interface Saml { + /** + * The name of the SAML attribute. + */ + attribute_name: string; - /** - * Matches a SAML group. Requires a SAML identity provider. - */ - export interface AccessSamlGroupRule { - saml: AccessSamlGroupRule.Saml; + /** + * The SAML attribute value to look for. + */ + attribute_value: string; } + } - export namespace AccessSamlGroupRule { - export interface Saml { - /** - * The name of the SAML attribute. - */ - attribute_name: string; + /** + * Matches a specific Access Service Token + */ + export interface AccessServiceTokenRule { + service_token: AccessServiceTokenRule.ServiceToken; + } - /** - * The SAML attribute value to look for. - */ - attribute_value: string; - } + export namespace AccessServiceTokenRule { + export interface ServiceToken { + /** + * The ID of a Service Token. + */ + token_id: string; } + } + /** + * Matches any valid Access Service Token + */ + export interface AccessAnyValidServiceTokenRule { /** - * Matches a specific Access Service Token + * An empty object which matches on all service tokens. */ - export interface AccessServiceTokenRule { - service_token: AccessServiceTokenRule.ServiceToken; - } + any_valid_service_token: unknown; + } - export namespace AccessServiceTokenRule { - export interface ServiceToken { - /** - * The ID of a Service Token. - */ - token_id: string; - } - } + /** + * Create Allow or Block policies which evaluate the user based on custom criteria. + */ + export interface AccessExternalEvaluationRule { + external_evaluation: AccessExternalEvaluationRule.ExternalEvaluation; + } - /** - * Matches any valid Access Service Token - */ - export interface AccessAnyValidServiceTokenRule { + export namespace AccessExternalEvaluationRule { + export interface ExternalEvaluation { /** - * An empty object which matches on all service tokens. + * The API endpoint containing your business logic. */ - any_valid_service_token: unknown; - } + evaluate_url: string; - /** - * Create Allow or Block policies which evaluate the user based on custom criteria. - */ - export interface AccessExternalEvaluationRule { - external_evaluation: AccessExternalEvaluationRule.ExternalEvaluation; + /** + * The API endpoint containing the key that Access uses to verify that the response + * came from your API. + */ + keys_url: string; } + } - export namespace AccessExternalEvaluationRule { - export interface ExternalEvaluation { - /** - * The API endpoint containing your business logic. - */ - evaluate_url: string; + /** + * Matches a specific country + */ + export interface AccessCountryRule { + geo: AccessCountryRule.Geo; + } - /** - * The API endpoint containing the key that Access uses to verify that the response - * came from your API. - */ - keys_url: string; - } + export namespace AccessCountryRule { + export interface Geo { + /** + * The country code that should be matched. + */ + country_code: string; } + } - /** - * Matches a specific country - */ - export interface AccessCountryRule { - geo: AccessCountryRule.Geo; - } + /** + * Enforce different MFA options + */ + export interface AccessAuthenticationMethodRule { + auth_method: AccessAuthenticationMethodRule.AuthMethod; + } - export namespace AccessCountryRule { - export interface Geo { - /** - * The country code that should be matched. - */ - country_code: string; - } + export namespace AccessAuthenticationMethodRule { + export interface AuthMethod { + /** + * The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. + */ + auth_method: string; } + } - /** - * Enforce different MFA options - */ - export interface AccessAuthenticationMethodRule { - auth_method: AccessAuthenticationMethodRule.AuthMethod; - } + /** + * Enforces a device posture rule has run successfully + */ + export interface AccessDevicePostureRule { + device_posture: AccessDevicePostureRule.DevicePosture; + } - export namespace AccessAuthenticationMethodRule { - export interface AuthMethod { - /** - * The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. - */ - auth_method: string; - } + export namespace AccessDevicePostureRule { + export interface DevicePosture { + /** + * The ID of a device posture integration. + */ + integration_uid: string; } + } - /** - * Enforces a device posture rule has run successfully - */ - export interface AccessDevicePostureRule { - device_posture: AccessDevicePostureRule.DevicePosture; - } + /** + * Matches a specific email. + */ + export interface AccessEmailRule { + email: AccessEmailRule.Email; + } - export namespace AccessDevicePostureRule { - export interface DevicePosture { - /** - * The ID of a device posture integration. - */ - integration_uid: string; - } + export namespace AccessEmailRule { + export interface Email { + /** + * The email of the user. + */ + email: string; } + } - /** - * Matches a specific email. - */ - export interface AccessEmailRule { - email: AccessEmailRule.Email; + /** + * Matches an email address from a list. + */ + export interface AccessEmailListRule { + email_list: AccessEmailListRule.EmailList; + } + + export namespace AccessEmailListRule { + export interface EmailList { + /** + * The ID of a previously created email list. + */ + id: string; } + } - export namespace AccessEmailRule { - export interface Email { - /** - * The email of the user. - */ - email: string; - } + /** + * Match an entire email domain. + */ + export interface AccessDomainRule { + email_domain: AccessDomainRule.EmailDomain; + } + + export namespace AccessDomainRule { + export interface EmailDomain { + /** + * The email domain to match. + */ + domain: string; } + } + /** + * Matches everyone. + */ + export interface AccessEveryoneRule { /** - * Matches an email address from a list. + * An empty object which matches on all users. */ - export interface AccessEmailListRule { - email_list: AccessEmailListRule.EmailList; - } + everyone: unknown; + } - export namespace AccessEmailListRule { - export interface EmailList { - /** - * The ID of a previously created email list. - */ - id: string; - } - } + /** + * Matches an IP address block. + */ + export interface AccessIPRule { + ip: AccessIPRule.IP; + } - /** - * Match an entire email domain. - */ - export interface AccessDomainRule { - email_domain: AccessDomainRule.EmailDomain; + export namespace AccessIPRule { + export interface IP { + /** + * An IPv4 or IPv6 CIDR block. + */ + ip: string; } + } - export namespace AccessDomainRule { - export interface EmailDomain { - /** - * The email domain to match. - */ - domain: string; - } - } + /** + * Matches an IP address from a list. + */ + export interface AccessIPListRule { + ip_list: AccessIPListRule.IPList; + } - /** - * Matches everyone. - */ - export interface AccessEveryoneRule { + export namespace AccessIPListRule { + export interface IPList { /** - * An empty object which matches on all users. + * The ID of a previously created IP list. */ - everyone: unknown; + id: string; } + } - /** - * Matches an IP address block. - */ - export interface AccessIPRule { - ip: AccessIPRule.IP; - } + /** + * Matches any valid client certificate. + */ + export interface AccessCertificateRule { + certificate: unknown; + } - export namespace AccessIPRule { - export interface IP { - /** - * An IPv4 or IPv6 CIDR block. - */ - ip: string; - } - } + /** + * Matches an Access group. + */ + export interface AccessAccessGroupRule { + group: AccessAccessGroupRule.Group; + } - /** - * Matches an IP address from a list. - */ - export interface AccessIPListRule { - ip_list: AccessIPListRule.IPList; + export namespace AccessAccessGroupRule { + export interface Group { + /** + * The ID of a previously created Access group. + */ + id: string; } + } - export namespace AccessIPListRule { - export interface IPList { - /** - * The ID of a previously created IP list. - */ - id: string; - } - } + /** + * Matches an Azure group. Requires an Azure identity provider. + */ + export interface AccessAzureGroupRule { + azureAD: AccessAzureGroupRule.AzureAd; + } - /** - * Matches any valid client certificate. - */ - export interface AccessCertificateRule { - certificate: unknown; - } + export namespace AccessAzureGroupRule { + export interface AzureAd { + /** + * The ID of an Azure group. + */ + id: string; - /** - * Matches an Access group. - */ - export interface AccessAccessGroupRule { - group: AccessAccessGroupRule.Group; + /** + * The ID of your Azure identity provider. + */ + connection_id: string; } + } - export namespace AccessAccessGroupRule { - export interface Group { - /** - * The ID of a previously created Access group. - */ - id: string; - } - } + /** + * Matches a Github organization. Requires a Github identity provider. + */ + export interface AccessGitHubOrganizationRule { + 'github-organization': AccessGitHubOrganizationRule.GitHubOrganization; + } - /** - * Matches an Azure group. Requires an Azure identity provider. - */ - export interface AccessAzureGroupRule { - azureAD: AccessAzureGroupRule.AzureAd; + export namespace AccessGitHubOrganizationRule { + export interface GitHubOrganization { + /** + * The ID of your Github identity provider. + */ + connection_id: string; + + /** + * The name of the organization. + */ + name: string; } + } - export namespace AccessAzureGroupRule { - export interface AzureAd { - /** - * The ID of an Azure group. - */ - id: string; + /** + * Matches a group in Google Workspace. Requires a Google Workspace identity + * provider. + */ + export interface AccessGsuiteGroupRule { + gsuite: AccessGsuiteGroupRule.Gsuite; + } - /** - * The ID of your Azure identity provider. - */ - connection_id: string; - } - } + export namespace AccessGsuiteGroupRule { + export interface Gsuite { + /** + * The ID of your Google Workspace identity provider. + */ + connection_id: string; - /** - * Matches a Github organization. Requires a Github identity provider. - */ - export interface AccessGitHubOrganizationRule { - 'github-organization': AccessGitHubOrganizationRule.GitHubOrganization; + /** + * The email of the Google Workspace group. + */ + email: string; } + } - export namespace AccessGitHubOrganizationRule { - export interface GitHubOrganization { - /** - * The ID of your Github identity provider. - */ - connection_id: string; + /** + * Matches an Okta group. Requires an Okta identity provider. + */ + export interface AccessOktaGroupRule { + okta: AccessOktaGroupRule.Okta; + } - /** - * The name of the organization. - */ - name: string; - } - } + export namespace AccessOktaGroupRule { + export interface Okta { + /** + * The ID of your Okta identity provider. + */ + connection_id: string; - /** - * Matches a group in Google Workspace. Requires a Google Workspace identity - * provider. - */ - export interface AccessGsuiteGroupRule { - gsuite: AccessGsuiteGroupRule.Gsuite; + /** + * The email of the Okta group. + */ + email: string; } + } - export namespace AccessGsuiteGroupRule { - export interface Gsuite { - /** - * The ID of your Google Workspace identity provider. - */ - connection_id: string; + /** + * Matches a SAML group. Requires a SAML identity provider. + */ + export interface AccessSamlGroupRule { + saml: AccessSamlGroupRule.Saml; + } - /** - * The email of the Google Workspace group. - */ - email: string; - } - } + export namespace AccessSamlGroupRule { + export interface Saml { + /** + * The name of the SAML attribute. + */ + attribute_name: string; - /** - * Matches an Okta group. Requires an Okta identity provider. - */ - export interface AccessOktaGroupRule { - okta: AccessOktaGroupRule.Okta; + /** + * The SAML attribute value to look for. + */ + attribute_value: string; } + } - export namespace AccessOktaGroupRule { - export interface Okta { - /** - * The ID of your Okta identity provider. - */ - connection_id: string; + /** + * Matches a specific Access Service Token + */ + export interface AccessServiceTokenRule { + service_token: AccessServiceTokenRule.ServiceToken; + } - /** - * The email of the Okta group. - */ - email: string; - } + export namespace AccessServiceTokenRule { + export interface ServiceToken { + /** + * The ID of a Service Token. + */ + token_id: string; } + } + /** + * Matches any valid Access Service Token + */ + export interface AccessAnyValidServiceTokenRule { /** - * Matches a SAML group. Requires a SAML identity provider. + * An empty object which matches on all service tokens. */ - export interface AccessSamlGroupRule { - saml: AccessSamlGroupRule.Saml; - } + any_valid_service_token: unknown; + } - export namespace AccessSamlGroupRule { - export interface Saml { - /** - * The name of the SAML attribute. - */ - attribute_name: string; + /** + * Create Allow or Block policies which evaluate the user based on custom criteria. + */ + export interface AccessExternalEvaluationRule { + external_evaluation: AccessExternalEvaluationRule.ExternalEvaluation; + } - /** - * The SAML attribute value to look for. - */ - attribute_value: string; - } - } + export namespace AccessExternalEvaluationRule { + export interface ExternalEvaluation { + /** + * The API endpoint containing your business logic. + */ + evaluate_url: string; - /** - * Matches a specific Access Service Token - */ - export interface AccessServiceTokenRule { - service_token: AccessServiceTokenRule.ServiceToken; + /** + * The API endpoint containing the key that Access uses to verify that the response + * came from your API. + */ + keys_url: string; } + } - export namespace AccessServiceTokenRule { - export interface ServiceToken { - /** - * The ID of a Service Token. - */ - token_id: string; - } - } + /** + * Matches a specific country + */ + export interface AccessCountryRule { + geo: AccessCountryRule.Geo; + } - /** - * Matches any valid Access Service Token - */ - export interface AccessAnyValidServiceTokenRule { + export namespace AccessCountryRule { + export interface Geo { /** - * An empty object which matches on all service tokens. + * The country code that should be matched. */ - any_valid_service_token: unknown; + country_code: string; } + } - /** - * Create Allow or Block policies which evaluate the user based on custom criteria. - */ - export interface AccessExternalEvaluationRule { - external_evaluation: AccessExternalEvaluationRule.ExternalEvaluation; + /** + * Enforce different MFA options + */ + export interface AccessAuthenticationMethodRule { + auth_method: AccessAuthenticationMethodRule.AuthMethod; + } + + export namespace AccessAuthenticationMethodRule { + export interface AuthMethod { + /** + * The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. + */ + auth_method: string; } + } - export namespace AccessExternalEvaluationRule { - export interface ExternalEvaluation { - /** - * The API endpoint containing your business logic. - */ - evaluate_url: string; + /** + * Enforces a device posture rule has run successfully + */ + export interface AccessDevicePostureRule { + device_posture: AccessDevicePostureRule.DevicePosture; + } - /** - * The API endpoint containing the key that Access uses to verify that the response - * came from your API. - */ - keys_url: string; - } + export namespace AccessDevicePostureRule { + export interface DevicePosture { + /** + * The ID of a device posture integration. + */ + integration_uid: string; } + } +} +export type PolicyListResponse = Array; + +export namespace PolicyListResponse { + export interface PolicyListResponseItem { /** - * Matches a specific country + * UUID */ - export interface AccessCountryRule { - geo: AccessCountryRule.Geo; - } + id?: string; - export namespace AccessCountryRule { - export interface Geo { - /** - * The country code that should be matched. - */ - country_code: string; - } - } + /** + * Administrators who can approve a temporary authentication request. + */ + approval_groups?: Array; /** - * Enforce different MFA options + * Requires the user to request access from an administrator at the start of each + * session. */ - export interface AccessAuthenticationMethodRule { - auth_method: AccessAuthenticationMethodRule.AuthMethod; - } + approval_required?: boolean; - export namespace AccessAuthenticationMethodRule { - export interface AuthMethod { - /** - * The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. - */ - auth_method: string; - } - } + created_at?: string; /** - * Enforces a device posture rule has run successfully + * The action Access will take if a user matches this policy. */ - export interface AccessDevicePostureRule { - device_posture: AccessDevicePostureRule.DevicePosture; - } + decision?: 'allow' | 'deny' | 'non_identity' | 'bypass'; - export namespace AccessDevicePostureRule { - export interface DevicePosture { - /** - * The ID of a device posture integration. - */ - integration_uid: string; - } - } - } -} + /** + * Rules evaluated with a NOT logical operator. To match the policy, a user cannot + * meet any of the Exclude rules. + */ + exclude?: Array< + | PolicyListResponseItem.AccessEmailRule + | PolicyListResponseItem.AccessEmailListRule + | PolicyListResponseItem.AccessDomainRule + | PolicyListResponseItem.AccessEveryoneRule + | PolicyListResponseItem.AccessIPRule + | PolicyListResponseItem.AccessIPListRule + | PolicyListResponseItem.AccessCertificateRule + | PolicyListResponseItem.AccessAccessGroupRule + | PolicyListResponseItem.AccessAzureGroupRule + | PolicyListResponseItem.AccessGitHubOrganizationRule + | PolicyListResponseItem.AccessGsuiteGroupRule + | PolicyListResponseItem.AccessOktaGroupRule + | PolicyListResponseItem.AccessSamlGroupRule + | PolicyListResponseItem.AccessServiceTokenRule + | PolicyListResponseItem.AccessAnyValidServiceTokenRule + | PolicyListResponseItem.AccessExternalEvaluationRule + | PolicyListResponseItem.AccessCountryRule + | PolicyListResponseItem.AccessAuthenticationMethodRule + | PolicyListResponseItem.AccessDevicePostureRule + >; -export interface PolicyDeleteResponse { - /** - * UUID - */ - id?: string; -} - -export interface PolicyGetResponse { - /** - * UUID - */ - id?: string; - - /** - * Administrators who can approve a temporary authentication request. - */ - approval_groups?: Array; - - /** - * Requires the user to request access from an administrator at the start of each - * session. - */ - approval_required?: boolean; - - created_at?: string; - - /** - * The action Access will take if a user matches this policy. - */ - decision?: 'allow' | 'deny' | 'non_identity' | 'bypass'; - - /** - * Rules evaluated with a NOT logical operator. To match the policy, a user cannot - * meet any of the Exclude rules. - */ - exclude?: Array< - | PolicyGetResponse.AccessEmailRule - | PolicyGetResponse.AccessEmailListRule - | PolicyGetResponse.AccessDomainRule - | PolicyGetResponse.AccessEveryoneRule - | PolicyGetResponse.AccessIPRule - | PolicyGetResponse.AccessIPListRule - | PolicyGetResponse.AccessCertificateRule - | PolicyGetResponse.AccessAccessGroupRule - | PolicyGetResponse.AccessAzureGroupRule - | PolicyGetResponse.AccessGitHubOrganizationRule - | PolicyGetResponse.AccessGsuiteGroupRule - | PolicyGetResponse.AccessOktaGroupRule - | PolicyGetResponse.AccessSamlGroupRule - | PolicyGetResponse.AccessServiceTokenRule - | PolicyGetResponse.AccessAnyValidServiceTokenRule - | PolicyGetResponse.AccessExternalEvaluationRule - | PolicyGetResponse.AccessCountryRule - | PolicyGetResponse.AccessAuthenticationMethodRule - | PolicyGetResponse.AccessDevicePostureRule - >; - - /** - * Rules evaluated with an OR logical operator. A user needs to meet only one of - * the Include rules. - */ - include?: Array< - | PolicyGetResponse.AccessEmailRule - | PolicyGetResponse.AccessEmailListRule - | PolicyGetResponse.AccessDomainRule - | PolicyGetResponse.AccessEveryoneRule - | PolicyGetResponse.AccessIPRule - | PolicyGetResponse.AccessIPListRule - | PolicyGetResponse.AccessCertificateRule - | PolicyGetResponse.AccessAccessGroupRule - | PolicyGetResponse.AccessAzureGroupRule - | PolicyGetResponse.AccessGitHubOrganizationRule - | PolicyGetResponse.AccessGsuiteGroupRule - | PolicyGetResponse.AccessOktaGroupRule - | PolicyGetResponse.AccessSamlGroupRule - | PolicyGetResponse.AccessServiceTokenRule - | PolicyGetResponse.AccessAnyValidServiceTokenRule - | PolicyGetResponse.AccessExternalEvaluationRule - | PolicyGetResponse.AccessCountryRule - | PolicyGetResponse.AccessAuthenticationMethodRule - | PolicyGetResponse.AccessDevicePostureRule - >; - - /** - * 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. - */ - isolation_required?: boolean; - - /** - * The name of the Access policy. - */ - name?: string; - - /** - * The order of execution for this policy. Must be unique for each policy. - */ - precedence?: number; - - /** - * A custom message that will appear on the purpose justification screen. - */ - purpose_justification_prompt?: string; + /** + * Rules evaluated with an OR logical operator. A user needs to meet only one of + * the Include rules. + */ + include?: Array< + | PolicyListResponseItem.AccessEmailRule + | PolicyListResponseItem.AccessEmailListRule + | PolicyListResponseItem.AccessDomainRule + | PolicyListResponseItem.AccessEveryoneRule + | PolicyListResponseItem.AccessIPRule + | PolicyListResponseItem.AccessIPListRule + | PolicyListResponseItem.AccessCertificateRule + | PolicyListResponseItem.AccessAccessGroupRule + | PolicyListResponseItem.AccessAzureGroupRule + | PolicyListResponseItem.AccessGitHubOrganizationRule + | PolicyListResponseItem.AccessGsuiteGroupRule + | PolicyListResponseItem.AccessOktaGroupRule + | PolicyListResponseItem.AccessSamlGroupRule + | PolicyListResponseItem.AccessServiceTokenRule + | PolicyListResponseItem.AccessAnyValidServiceTokenRule + | PolicyListResponseItem.AccessExternalEvaluationRule + | PolicyListResponseItem.AccessCountryRule + | PolicyListResponseItem.AccessAuthenticationMethodRule + | PolicyListResponseItem.AccessDevicePostureRule + >; - /** - * Require users to enter a justification when they log in to the application. - */ - purpose_justification_required?: boolean; + /** + * 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. + */ + isolation_required?: boolean; - /** - * Rules evaluated with an AND logical operator. To match the policy, a user must - * meet all of the Require rules. - */ - require?: Array< - | PolicyGetResponse.AccessEmailRule - | PolicyGetResponse.AccessEmailListRule - | PolicyGetResponse.AccessDomainRule - | PolicyGetResponse.AccessEveryoneRule - | PolicyGetResponse.AccessIPRule - | PolicyGetResponse.AccessIPListRule - | PolicyGetResponse.AccessCertificateRule - | PolicyGetResponse.AccessAccessGroupRule - | PolicyGetResponse.AccessAzureGroupRule - | PolicyGetResponse.AccessGitHubOrganizationRule - | PolicyGetResponse.AccessGsuiteGroupRule - | PolicyGetResponse.AccessOktaGroupRule - | PolicyGetResponse.AccessSamlGroupRule - | PolicyGetResponse.AccessServiceTokenRule - | PolicyGetResponse.AccessAnyValidServiceTokenRule - | PolicyGetResponse.AccessExternalEvaluationRule - | PolicyGetResponse.AccessCountryRule - | PolicyGetResponse.AccessAuthenticationMethodRule - | PolicyGetResponse.AccessDevicePostureRule - >; + /** + * The name of the Access policy. + */ + name?: string; - /** - * 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. - */ - session_duration?: string; + /** + * The order of execution for this policy. Must be unique for each policy. + */ + precedence?: number; - updated_at?: string; -} + /** + * A custom message that will appear on the purpose justification screen. + */ + purpose_justification_prompt?: string; -export namespace PolicyGetResponse { - /** - * A group of email addresses that can approve a temporary authentication request. - */ - export interface ApprovalGroup { /** - * The number of approvals needed to obtain access. + * Require users to enter a justification when they log in to the application. */ - approvals_needed: number; + purpose_justification_required?: boolean; /** - * A list of emails that can approve the access request. + * Rules evaluated with an AND logical operator. To match the policy, a user must + * meet all of the Require rules. */ - email_addresses?: Array; + require?: Array< + | PolicyListResponseItem.AccessEmailRule + | PolicyListResponseItem.AccessEmailListRule + | PolicyListResponseItem.AccessDomainRule + | PolicyListResponseItem.AccessEveryoneRule + | PolicyListResponseItem.AccessIPRule + | PolicyListResponseItem.AccessIPListRule + | PolicyListResponseItem.AccessCertificateRule + | PolicyListResponseItem.AccessAccessGroupRule + | PolicyListResponseItem.AccessAzureGroupRule + | PolicyListResponseItem.AccessGitHubOrganizationRule + | PolicyListResponseItem.AccessGsuiteGroupRule + | PolicyListResponseItem.AccessOktaGroupRule + | PolicyListResponseItem.AccessSamlGroupRule + | PolicyListResponseItem.AccessServiceTokenRule + | PolicyListResponseItem.AccessAnyValidServiceTokenRule + | PolicyListResponseItem.AccessExternalEvaluationRule + | PolicyListResponseItem.AccessCountryRule + | PolicyListResponseItem.AccessAuthenticationMethodRule + | PolicyListResponseItem.AccessDevicePostureRule + >; /** - * The UUID of an re-usable email list. + * 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. */ - email_list_uuid?: string; - } + session_duration?: string; - /** - * Matches a specific email. - */ - export interface AccessEmailRule { - email: AccessEmailRule.Email; + updated_at?: string; } - export namespace AccessEmailRule { - export interface Email { + export namespace PolicyListResponseItem { + /** + * A group of email addresses that can approve a temporary authentication request. + */ + export interface ApprovalGroup { /** - * The email of the user. + * The number of approvals needed to obtain access. */ - email: string; + approvals_needed: number; + + /** + * A list of emails that can approve the access request. + */ + email_addresses?: Array; + + /** + * The UUID of an re-usable email list. + */ + email_list_uuid?: string; + } + + /** + * Matches a specific email. + */ + export interface AccessEmailRule { + email: AccessEmailRule.Email; + } + + export namespace AccessEmailRule { + export interface Email { + /** + * The email of the user. + */ + email: string; + } + } + + /** + * Matches an email address from a list. + */ + export interface AccessEmailListRule { + email_list: AccessEmailListRule.EmailList; } - } - /** - * Matches an email address from a list. - */ - export interface AccessEmailListRule { - email_list: AccessEmailListRule.EmailList; - } + export namespace AccessEmailListRule { + export interface EmailList { + /** + * The ID of a previously created email list. + */ + id: string; + } + } - export namespace AccessEmailListRule { - export interface EmailList { - /** - * The ID of a previously created email list. - */ - id: string; + /** + * Match an entire email domain. + */ + export interface AccessDomainRule { + email_domain: AccessDomainRule.EmailDomain; } - } - /** - * Match an entire email domain. - */ - export interface AccessDomainRule { - email_domain: AccessDomainRule.EmailDomain; - } + export namespace AccessDomainRule { + export interface EmailDomain { + /** + * The email domain to match. + */ + domain: string; + } + } - export namespace AccessDomainRule { - export interface EmailDomain { + /** + * Matches everyone. + */ + export interface AccessEveryoneRule { /** - * The email domain to match. + * An empty object which matches on all users. */ - domain: string; + everyone: unknown; } - } - /** - * Matches everyone. - */ - export interface AccessEveryoneRule { /** - * An empty object which matches on all users. + * Matches an IP address block. */ - everyone: unknown; - } + export interface AccessIPRule { + ip: AccessIPRule.IP; + } - /** - * Matches an IP address block. - */ - export interface AccessIPRule { - ip: AccessIPRule.IP; - } + export namespace AccessIPRule { + export interface IP { + /** + * An IPv4 or IPv6 CIDR block. + */ + ip: string; + } + } - export namespace AccessIPRule { - export interface IP { - /** - * An IPv4 or IPv6 CIDR block. - */ - ip: string; + /** + * Matches an IP address from a list. + */ + export interface AccessIPListRule { + ip_list: AccessIPListRule.IPList; } - } - /** - * Matches an IP address from a list. - */ - export interface AccessIPListRule { - ip_list: AccessIPListRule.IPList; - } + export namespace AccessIPListRule { + export interface IPList { + /** + * The ID of a previously created IP list. + */ + id: string; + } + } - export namespace AccessIPListRule { - export interface IPList { - /** - * The ID of a previously created IP list. - */ - id: string; + /** + * Matches any valid client certificate. + */ + export interface AccessCertificateRule { + certificate: unknown; } - } - /** - * Matches any valid client certificate. - */ - export interface AccessCertificateRule { - certificate: unknown; - } + /** + * Matches an Access group. + */ + export interface AccessAccessGroupRule { + group: AccessAccessGroupRule.Group; + } - /** - * Matches an Access group. - */ - export interface AccessAccessGroupRule { - group: AccessAccessGroupRule.Group; - } + export namespace AccessAccessGroupRule { + export interface Group { + /** + * The ID of a previously created Access group. + */ + id: string; + } + } - export namespace AccessAccessGroupRule { - export interface Group { - /** - * The ID of a previously created Access group. - */ - id: string; + /** + * Matches an Azure group. Requires an Azure identity provider. + */ + export interface AccessAzureGroupRule { + azureAD: AccessAzureGroupRule.AzureAd; } - } - /** - * Matches an Azure group. Requires an Azure identity provider. - */ - export interface AccessAzureGroupRule { - azureAD: AccessAzureGroupRule.AzureAd; - } + export namespace AccessAzureGroupRule { + export interface AzureAd { + /** + * The ID of an Azure group. + */ + id: string; - export namespace AccessAzureGroupRule { - export interface AzureAd { - /** - * The ID of an Azure group. - */ - id: string; + /** + * The ID of your Azure identity provider. + */ + connection_id: string; + } + } - /** - * The ID of your Azure identity provider. - */ - connection_id: string; + /** + * Matches a Github organization. Requires a Github identity provider. + */ + export interface AccessGitHubOrganizationRule { + 'github-organization': AccessGitHubOrganizationRule.GitHubOrganization; } - } - /** - * Matches a Github organization. Requires a Github identity provider. - */ - export interface AccessGitHubOrganizationRule { - 'github-organization': AccessGitHubOrganizationRule.GitHubOrganization; - } + export namespace AccessGitHubOrganizationRule { + export interface GitHubOrganization { + /** + * The ID of your Github identity provider. + */ + connection_id: string; - export namespace AccessGitHubOrganizationRule { - export interface GitHubOrganization { - /** - * The ID of your Github identity provider. - */ - connection_id: string; + /** + * The name of the organization. + */ + name: string; + } + } - /** - * The name of the organization. - */ - name: string; + /** + * Matches a group in Google Workspace. Requires a Google Workspace identity + * provider. + */ + export interface AccessGsuiteGroupRule { + gsuite: AccessGsuiteGroupRule.Gsuite; } - } - /** - * Matches a group in Google Workspace. Requires a Google Workspace identity - * provider. - */ - export interface AccessGsuiteGroupRule { - gsuite: AccessGsuiteGroupRule.Gsuite; - } + export namespace AccessGsuiteGroupRule { + export interface Gsuite { + /** + * The ID of your Google Workspace identity provider. + */ + connection_id: string; - export namespace AccessGsuiteGroupRule { - export interface Gsuite { - /** - * The ID of your Google Workspace identity provider. - */ - connection_id: string; + /** + * The email of the Google Workspace group. + */ + email: string; + } + } - /** - * The email of the Google Workspace group. - */ - email: string; + /** + * Matches an Okta group. Requires an Okta identity provider. + */ + export interface AccessOktaGroupRule { + okta: AccessOktaGroupRule.Okta; } - } - /** - * Matches an Okta group. Requires an Okta identity provider. - */ - export interface AccessOktaGroupRule { - okta: AccessOktaGroupRule.Okta; - } + export namespace AccessOktaGroupRule { + export interface Okta { + /** + * The ID of your Okta identity provider. + */ + connection_id: string; - export namespace AccessOktaGroupRule { - export interface Okta { - /** - * The ID of your Okta identity provider. - */ - connection_id: string; + /** + * The email of the Okta group. + */ + email: string; + } + } - /** - * The email of the Okta group. - */ - email: string; + /** + * Matches a SAML group. Requires a SAML identity provider. + */ + export interface AccessSamlGroupRule { + saml: AccessSamlGroupRule.Saml; } - } - /** - * Matches a SAML group. Requires a SAML identity provider. - */ - export interface AccessSamlGroupRule { - saml: AccessSamlGroupRule.Saml; - } + export namespace AccessSamlGroupRule { + export interface Saml { + /** + * The name of the SAML attribute. + */ + attribute_name: string; - export namespace AccessSamlGroupRule { - export interface Saml { - /** - * The name of the SAML attribute. - */ - attribute_name: string; + /** + * The SAML attribute value to look for. + */ + attribute_value: string; + } + } - /** - * The SAML attribute value to look for. - */ - attribute_value: string; + /** + * Matches a specific Access Service Token + */ + export interface AccessServiceTokenRule { + service_token: AccessServiceTokenRule.ServiceToken; } - } - /** - * Matches a specific Access Service Token - */ - export interface AccessServiceTokenRule { - service_token: AccessServiceTokenRule.ServiceToken; - } + export namespace AccessServiceTokenRule { + export interface ServiceToken { + /** + * The ID of a Service Token. + */ + token_id: string; + } + } - export namespace AccessServiceTokenRule { - export interface ServiceToken { + /** + * Matches any valid Access Service Token + */ + export interface AccessAnyValidServiceTokenRule { /** - * The ID of a Service Token. + * An empty object which matches on all service tokens. */ - token_id: string; + any_valid_service_token: unknown; } - } - /** - * Matches any valid Access Service Token - */ - export interface AccessAnyValidServiceTokenRule { /** - * An empty object which matches on all service tokens. + * Create Allow or Block policies which evaluate the user based on custom criteria. */ - any_valid_service_token: unknown; - } + export interface AccessExternalEvaluationRule { + external_evaluation: AccessExternalEvaluationRule.ExternalEvaluation; + } - /** - * Create Allow or Block policies which evaluate the user based on custom criteria. - */ - export interface AccessExternalEvaluationRule { - external_evaluation: AccessExternalEvaluationRule.ExternalEvaluation; - } + export namespace AccessExternalEvaluationRule { + export interface ExternalEvaluation { + /** + * The API endpoint containing your business logic. + */ + evaluate_url: string; - export namespace AccessExternalEvaluationRule { - export interface ExternalEvaluation { - /** - * The API endpoint containing your business logic. - */ - evaluate_url: string; + /** + * The API endpoint containing the key that Access uses to verify that the response + * came from your API. + */ + keys_url: string; + } + } - /** - * The API endpoint containing the key that Access uses to verify that the response - * came from your API. - */ - keys_url: string; + /** + * Matches a specific country + */ + export interface AccessCountryRule { + geo: AccessCountryRule.Geo; } - } - /** - * Matches a specific country - */ - export interface AccessCountryRule { - geo: AccessCountryRule.Geo; - } + export namespace AccessCountryRule { + export interface Geo { + /** + * The country code that should be matched. + */ + country_code: string; + } + } - export namespace AccessCountryRule { - export interface Geo { - /** - * The country code that should be matched. - */ - country_code: string; + /** + * Enforce different MFA options + */ + export interface AccessAuthenticationMethodRule { + auth_method: AccessAuthenticationMethodRule.AuthMethod; } - } - /** - * Enforce different MFA options - */ - export interface AccessAuthenticationMethodRule { - auth_method: AccessAuthenticationMethodRule.AuthMethod; - } + export namespace AccessAuthenticationMethodRule { + export interface AuthMethod { + /** + * The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. + */ + auth_method: string; + } + } - export namespace AccessAuthenticationMethodRule { - export interface AuthMethod { - /** - * The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. - */ - auth_method: string; + /** + * Enforces a device posture rule has run successfully + */ + export interface AccessDevicePostureRule { + device_posture: AccessDevicePostureRule.DevicePosture; } - } - /** - * Enforces a device posture rule has run successfully - */ - export interface AccessDevicePostureRule { - device_posture: AccessDevicePostureRule.DevicePosture; - } + export namespace AccessDevicePostureRule { + export interface DevicePosture { + /** + * The ID of a device posture integration. + */ + integration_uid: string; + } + } - export namespace AccessDevicePostureRule { - export interface DevicePosture { - /** - * The ID of a device posture integration. - */ - integration_uid: string; + /** + * Matches a specific email. + */ + export interface AccessEmailRule { + email: AccessEmailRule.Email; } - } - /** - * Matches a specific email. - */ - export interface AccessEmailRule { - email: AccessEmailRule.Email; - } + export namespace AccessEmailRule { + export interface Email { + /** + * The email of the user. + */ + email: string; + } + } - export namespace AccessEmailRule { - export interface Email { - /** - * The email of the user. - */ - email: string; + /** + * Matches an email address from a list. + */ + export interface AccessEmailListRule { + email_list: AccessEmailListRule.EmailList; } - } - /** - * Matches an email address from a list. - */ - export interface AccessEmailListRule { - email_list: AccessEmailListRule.EmailList; - } + export namespace AccessEmailListRule { + export interface EmailList { + /** + * The ID of a previously created email list. + */ + id: string; + } + } - export namespace AccessEmailListRule { - export interface EmailList { - /** - * The ID of a previously created email list. - */ - id: string; + /** + * Match an entire email domain. + */ + export interface AccessDomainRule { + email_domain: AccessDomainRule.EmailDomain; } - } - /** - * Match an entire email domain. - */ - export interface AccessDomainRule { - email_domain: AccessDomainRule.EmailDomain; - } + export namespace AccessDomainRule { + export interface EmailDomain { + /** + * The email domain to match. + */ + domain: string; + } + } - export namespace AccessDomainRule { - export interface EmailDomain { + /** + * Matches everyone. + */ + export interface AccessEveryoneRule { /** - * The email domain to match. + * An empty object which matches on all users. */ - domain: string; + everyone: unknown; } - } - /** - * Matches everyone. - */ - export interface AccessEveryoneRule { /** - * An empty object which matches on all users. + * Matches an IP address block. */ - everyone: unknown; - } + export interface AccessIPRule { + ip: AccessIPRule.IP; + } - /** - * Matches an IP address block. - */ - export interface AccessIPRule { - ip: AccessIPRule.IP; - } + export namespace AccessIPRule { + export interface IP { + /** + * An IPv4 or IPv6 CIDR block. + */ + ip: string; + } + } - export namespace AccessIPRule { - export interface IP { - /** - * An IPv4 or IPv6 CIDR block. - */ - ip: string; + /** + * Matches an IP address from a list. + */ + export interface AccessIPListRule { + ip_list: AccessIPListRule.IPList; } - } - /** - * Matches an IP address from a list. - */ - export interface AccessIPListRule { - ip_list: AccessIPListRule.IPList; - } + export namespace AccessIPListRule { + export interface IPList { + /** + * The ID of a previously created IP list. + */ + id: string; + } + } - export namespace AccessIPListRule { - export interface IPList { - /** - * The ID of a previously created IP list. - */ - id: string; + /** + * Matches any valid client certificate. + */ + export interface AccessCertificateRule { + certificate: unknown; } - } - /** - * Matches any valid client certificate. - */ - export interface AccessCertificateRule { - certificate: unknown; - } + /** + * Matches an Access group. + */ + export interface AccessAccessGroupRule { + group: AccessAccessGroupRule.Group; + } - /** - * Matches an Access group. - */ - export interface AccessAccessGroupRule { - group: AccessAccessGroupRule.Group; - } + export namespace AccessAccessGroupRule { + export interface Group { + /** + * The ID of a previously created Access group. + */ + id: string; + } + } - export namespace AccessAccessGroupRule { - export interface Group { - /** - * The ID of a previously created Access group. - */ - id: string; + /** + * Matches an Azure group. Requires an Azure identity provider. + */ + export interface AccessAzureGroupRule { + azureAD: AccessAzureGroupRule.AzureAd; } - } - /** - * Matches an Azure group. Requires an Azure identity provider. - */ - export interface AccessAzureGroupRule { - azureAD: AccessAzureGroupRule.AzureAd; - } + export namespace AccessAzureGroupRule { + export interface AzureAd { + /** + * The ID of an Azure group. + */ + id: string; - export namespace AccessAzureGroupRule { - export interface AzureAd { - /** - * The ID of an Azure group. - */ - id: string; + /** + * The ID of your Azure identity provider. + */ + connection_id: string; + } + } - /** - * The ID of your Azure identity provider. - */ - connection_id: string; + /** + * Matches a Github organization. Requires a Github identity provider. + */ + export interface AccessGitHubOrganizationRule { + 'github-organization': AccessGitHubOrganizationRule.GitHubOrganization; } - } - /** - * Matches a Github organization. Requires a Github identity provider. - */ - export interface AccessGitHubOrganizationRule { - 'github-organization': AccessGitHubOrganizationRule.GitHubOrganization; - } + export namespace AccessGitHubOrganizationRule { + export interface GitHubOrganization { + /** + * The ID of your Github identity provider. + */ + connection_id: string; - export namespace AccessGitHubOrganizationRule { - export interface GitHubOrganization { - /** - * The ID of your Github identity provider. - */ - connection_id: string; + /** + * The name of the organization. + */ + name: string; + } + } - /** - * The name of the organization. - */ - name: string; + /** + * Matches a group in Google Workspace. Requires a Google Workspace identity + * provider. + */ + export interface AccessGsuiteGroupRule { + gsuite: AccessGsuiteGroupRule.Gsuite; } - } - /** - * Matches a group in Google Workspace. Requires a Google Workspace identity - * provider. - */ - export interface AccessGsuiteGroupRule { - gsuite: AccessGsuiteGroupRule.Gsuite; - } + export namespace AccessGsuiteGroupRule { + export interface Gsuite { + /** + * The ID of your Google Workspace identity provider. + */ + connection_id: string; - export namespace AccessGsuiteGroupRule { - export interface Gsuite { - /** - * The ID of your Google Workspace identity provider. - */ - connection_id: string; + /** + * The email of the Google Workspace group. + */ + email: string; + } + } - /** - * The email of the Google Workspace group. - */ - email: string; + /** + * Matches an Okta group. Requires an Okta identity provider. + */ + export interface AccessOktaGroupRule { + okta: AccessOktaGroupRule.Okta; } - } - /** - * Matches an Okta group. Requires an Okta identity provider. - */ - export interface AccessOktaGroupRule { - okta: AccessOktaGroupRule.Okta; - } + export namespace AccessOktaGroupRule { + export interface Okta { + /** + * The ID of your Okta identity provider. + */ + connection_id: string; - export namespace AccessOktaGroupRule { - export interface Okta { - /** - * The ID of your Okta identity provider. - */ - connection_id: string; + /** + * The email of the Okta group. + */ + email: string; + } + } - /** - * The email of the Okta group. - */ - email: string; + /** + * Matches a SAML group. Requires a SAML identity provider. + */ + export interface AccessSamlGroupRule { + saml: AccessSamlGroupRule.Saml; } - } - /** - * Matches a SAML group. Requires a SAML identity provider. - */ - export interface AccessSamlGroupRule { - saml: AccessSamlGroupRule.Saml; - } + export namespace AccessSamlGroupRule { + export interface Saml { + /** + * The name of the SAML attribute. + */ + attribute_name: string; - export namespace AccessSamlGroupRule { - export interface Saml { - /** - * The name of the SAML attribute. - */ - attribute_name: string; + /** + * The SAML attribute value to look for. + */ + attribute_value: string; + } + } - /** - * The SAML attribute value to look for. - */ - attribute_value: string; + /** + * Matches a specific Access Service Token + */ + export interface AccessServiceTokenRule { + service_token: AccessServiceTokenRule.ServiceToken; } - } - /** - * Matches a specific Access Service Token - */ - export interface AccessServiceTokenRule { - service_token: AccessServiceTokenRule.ServiceToken; - } + export namespace AccessServiceTokenRule { + export interface ServiceToken { + /** + * The ID of a Service Token. + */ + token_id: string; + } + } - export namespace AccessServiceTokenRule { - export interface ServiceToken { + /** + * Matches any valid Access Service Token + */ + export interface AccessAnyValidServiceTokenRule { /** - * The ID of a Service Token. + * An empty object which matches on all service tokens. */ - token_id: string; + any_valid_service_token: unknown; } - } - /** - * Matches any valid Access Service Token - */ - export interface AccessAnyValidServiceTokenRule { /** - * An empty object which matches on all service tokens. + * Create Allow or Block policies which evaluate the user based on custom criteria. */ - any_valid_service_token: unknown; - } + export interface AccessExternalEvaluationRule { + external_evaluation: AccessExternalEvaluationRule.ExternalEvaluation; + } - /** - * Create Allow or Block policies which evaluate the user based on custom criteria. - */ - export interface AccessExternalEvaluationRule { - external_evaluation: AccessExternalEvaluationRule.ExternalEvaluation; - } + export namespace AccessExternalEvaluationRule { + export interface ExternalEvaluation { + /** + * The API endpoint containing your business logic. + */ + evaluate_url: string; - export namespace AccessExternalEvaluationRule { - export interface ExternalEvaluation { - /** - * The API endpoint containing your business logic. - */ - evaluate_url: string; + /** + * The API endpoint containing the key that Access uses to verify that the response + * came from your API. + */ + keys_url: string; + } + } - /** - * The API endpoint containing the key that Access uses to verify that the response - * came from your API. - */ - keys_url: string; + /** + * Matches a specific country + */ + export interface AccessCountryRule { + geo: AccessCountryRule.Geo; } - } - /** - * Matches a specific country - */ - export interface AccessCountryRule { - geo: AccessCountryRule.Geo; - } + export namespace AccessCountryRule { + export interface Geo { + /** + * The country code that should be matched. + */ + country_code: string; + } + } - export namespace AccessCountryRule { - export interface Geo { - /** - * The country code that should be matched. - */ - country_code: string; + /** + * Enforce different MFA options + */ + export interface AccessAuthenticationMethodRule { + auth_method: AccessAuthenticationMethodRule.AuthMethod; } - } - /** - * Enforce different MFA options - */ - export interface AccessAuthenticationMethodRule { - auth_method: AccessAuthenticationMethodRule.AuthMethod; - } + export namespace AccessAuthenticationMethodRule { + export interface AuthMethod { + /** + * The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. + */ + auth_method: string; + } + } - export namespace AccessAuthenticationMethodRule { - export interface AuthMethod { - /** - * The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. - */ - auth_method: string; + /** + * Enforces a device posture rule has run successfully + */ + export interface AccessDevicePostureRule { + device_posture: AccessDevicePostureRule.DevicePosture; } - } - /** - * Enforces a device posture rule has run successfully - */ - export interface AccessDevicePostureRule { - device_posture: AccessDevicePostureRule.DevicePosture; - } + export namespace AccessDevicePostureRule { + export interface DevicePosture { + /** + * The ID of a device posture integration. + */ + integration_uid: string; + } + } - export namespace AccessDevicePostureRule { - export interface DevicePosture { - /** - * The ID of a device posture integration. - */ - integration_uid: string; + /** + * Matches a specific email. + */ + export interface AccessEmailRule { + email: AccessEmailRule.Email; } - } - /** - * Matches a specific email. - */ - export interface AccessEmailRule { - email: AccessEmailRule.Email; - } + export namespace AccessEmailRule { + export interface Email { + /** + * The email of the user. + */ + email: string; + } + } - export namespace AccessEmailRule { - export interface Email { - /** - * The email of the user. - */ - email: string; + /** + * Matches an email address from a list. + */ + export interface AccessEmailListRule { + email_list: AccessEmailListRule.EmailList; } - } - /** - * Matches an email address from a list. - */ - export interface AccessEmailListRule { - email_list: AccessEmailListRule.EmailList; - } + export namespace AccessEmailListRule { + export interface EmailList { + /** + * The ID of a previously created email list. + */ + id: string; + } + } - export namespace AccessEmailListRule { - export interface EmailList { - /** - * The ID of a previously created email list. - */ - id: string; + /** + * Match an entire email domain. + */ + export interface AccessDomainRule { + email_domain: AccessDomainRule.EmailDomain; } - } - /** - * Match an entire email domain. - */ - export interface AccessDomainRule { - email_domain: AccessDomainRule.EmailDomain; - } + export namespace AccessDomainRule { + export interface EmailDomain { + /** + * The email domain to match. + */ + domain: string; + } + } - export namespace AccessDomainRule { - export interface EmailDomain { + /** + * Matches everyone. + */ + export interface AccessEveryoneRule { /** - * The email domain to match. + * An empty object which matches on all users. */ - domain: string; + everyone: unknown; } - } - /** - * Matches everyone. - */ - export interface AccessEveryoneRule { /** - * An empty object which matches on all users. + * Matches an IP address block. */ - everyone: unknown; - } + export interface AccessIPRule { + ip: AccessIPRule.IP; + } - /** - * Matches an IP address block. - */ - export interface AccessIPRule { - ip: AccessIPRule.IP; - } + export namespace AccessIPRule { + export interface IP { + /** + * An IPv4 or IPv6 CIDR block. + */ + ip: string; + } + } - export namespace AccessIPRule { - export interface IP { - /** - * An IPv4 or IPv6 CIDR block. - */ - ip: string; + /** + * Matches an IP address from a list. + */ + export interface AccessIPListRule { + ip_list: AccessIPListRule.IPList; } - } - /** - * Matches an IP address from a list. - */ - export interface AccessIPListRule { - ip_list: AccessIPListRule.IPList; - } + export namespace AccessIPListRule { + export interface IPList { + /** + * The ID of a previously created IP list. + */ + id: string; + } + } - export namespace AccessIPListRule { - export interface IPList { - /** - * The ID of a previously created IP list. - */ - id: string; + /** + * Matches any valid client certificate. + */ + export interface AccessCertificateRule { + certificate: unknown; } - } - /** - * Matches any valid client certificate. - */ - export interface AccessCertificateRule { - certificate: unknown; - } + /** + * Matches an Access group. + */ + export interface AccessAccessGroupRule { + group: AccessAccessGroupRule.Group; + } - /** - * Matches an Access group. - */ - export interface AccessAccessGroupRule { - group: AccessAccessGroupRule.Group; - } + export namespace AccessAccessGroupRule { + export interface Group { + /** + * The ID of a previously created Access group. + */ + id: string; + } + } - export namespace AccessAccessGroupRule { - export interface Group { - /** - * The ID of a previously created Access group. - */ - id: string; + /** + * Matches an Azure group. Requires an Azure identity provider. + */ + export interface AccessAzureGroupRule { + azureAD: AccessAzureGroupRule.AzureAd; } - } - /** - * Matches an Azure group. Requires an Azure identity provider. - */ - export interface AccessAzureGroupRule { - azureAD: AccessAzureGroupRule.AzureAd; - } + export namespace AccessAzureGroupRule { + export interface AzureAd { + /** + * The ID of an Azure group. + */ + id: string; - export namespace AccessAzureGroupRule { - export interface AzureAd { - /** - * The ID of an Azure group. - */ - id: string; + /** + * The ID of your Azure identity provider. + */ + connection_id: string; + } + } - /** - * The ID of your Azure identity provider. - */ - connection_id: string; + /** + * Matches a Github organization. Requires a Github identity provider. + */ + export interface AccessGitHubOrganizationRule { + 'github-organization': AccessGitHubOrganizationRule.GitHubOrganization; } - } - /** - * Matches a Github organization. Requires a Github identity provider. - */ - export interface AccessGitHubOrganizationRule { - 'github-organization': AccessGitHubOrganizationRule.GitHubOrganization; - } + export namespace AccessGitHubOrganizationRule { + export interface GitHubOrganization { + /** + * The ID of your Github identity provider. + */ + connection_id: string; - export namespace AccessGitHubOrganizationRule { - export interface GitHubOrganization { - /** - * The ID of your Github identity provider. - */ - connection_id: string; + /** + * The name of the organization. + */ + name: string; + } + } - /** - * The name of the organization. - */ - name: string; + /** + * Matches a group in Google Workspace. Requires a Google Workspace identity + * provider. + */ + export interface AccessGsuiteGroupRule { + gsuite: AccessGsuiteGroupRule.Gsuite; } - } - /** - * Matches a group in Google Workspace. Requires a Google Workspace identity - * provider. - */ - export interface AccessGsuiteGroupRule { - gsuite: AccessGsuiteGroupRule.Gsuite; - } + export namespace AccessGsuiteGroupRule { + export interface Gsuite { + /** + * The ID of your Google Workspace identity provider. + */ + connection_id: string; - export namespace AccessGsuiteGroupRule { - export interface Gsuite { - /** - * The ID of your Google Workspace identity provider. - */ - connection_id: string; + /** + * The email of the Google Workspace group. + */ + email: string; + } + } - /** - * The email of the Google Workspace group. - */ - email: string; + /** + * Matches an Okta group. Requires an Okta identity provider. + */ + export interface AccessOktaGroupRule { + okta: AccessOktaGroupRule.Okta; } - } - /** - * Matches an Okta group. Requires an Okta identity provider. - */ - export interface AccessOktaGroupRule { - okta: AccessOktaGroupRule.Okta; - } + export namespace AccessOktaGroupRule { + export interface Okta { + /** + * The ID of your Okta identity provider. + */ + connection_id: string; - export namespace AccessOktaGroupRule { - export interface Okta { - /** - * The ID of your Okta identity provider. - */ - connection_id: string; + /** + * The email of the Okta group. + */ + email: string; + } + } - /** - * The email of the Okta group. - */ - email: string; + /** + * Matches a SAML group. Requires a SAML identity provider. + */ + export interface AccessSamlGroupRule { + saml: AccessSamlGroupRule.Saml; } - } - /** - * Matches a SAML group. Requires a SAML identity provider. - */ - export interface AccessSamlGroupRule { - saml: AccessSamlGroupRule.Saml; - } + export namespace AccessSamlGroupRule { + export interface Saml { + /** + * The name of the SAML attribute. + */ + attribute_name: string; - export namespace AccessSamlGroupRule { - export interface Saml { - /** - * The name of the SAML attribute. - */ - attribute_name: string; + /** + * The SAML attribute value to look for. + */ + attribute_value: string; + } + } - /** - * The SAML attribute value to look for. - */ - attribute_value: string; + /** + * Matches a specific Access Service Token + */ + export interface AccessServiceTokenRule { + service_token: AccessServiceTokenRule.ServiceToken; } - } - /** - * Matches a specific Access Service Token - */ - export interface AccessServiceTokenRule { - service_token: AccessServiceTokenRule.ServiceToken; - } + export namespace AccessServiceTokenRule { + export interface ServiceToken { + /** + * The ID of a Service Token. + */ + token_id: string; + } + } - export namespace AccessServiceTokenRule { - export interface ServiceToken { + /** + * Matches any valid Access Service Token + */ + export interface AccessAnyValidServiceTokenRule { /** - * The ID of a Service Token. + * An empty object which matches on all service tokens. */ - token_id: string; + any_valid_service_token: unknown; } - } - /** - * Matches any valid Access Service Token - */ - export interface AccessAnyValidServiceTokenRule { /** - * An empty object which matches on all service tokens. + * Create Allow or Block policies which evaluate the user based on custom criteria. */ - any_valid_service_token: unknown; - } + export interface AccessExternalEvaluationRule { + external_evaluation: AccessExternalEvaluationRule.ExternalEvaluation; + } - /** - * Create Allow or Block policies which evaluate the user based on custom criteria. - */ - export interface AccessExternalEvaluationRule { - external_evaluation: AccessExternalEvaluationRule.ExternalEvaluation; - } + export namespace AccessExternalEvaluationRule { + export interface ExternalEvaluation { + /** + * The API endpoint containing your business logic. + */ + evaluate_url: string; - export namespace AccessExternalEvaluationRule { - export interface ExternalEvaluation { - /** - * The API endpoint containing your business logic. - */ - evaluate_url: string; + /** + * The API endpoint containing the key that Access uses to verify that the response + * came from your API. + */ + keys_url: string; + } + } - /** - * The API endpoint containing the key that Access uses to verify that the response - * came from your API. - */ - keys_url: string; + /** + * Matches a specific country + */ + export interface AccessCountryRule { + geo: AccessCountryRule.Geo; } - } - /** - * Matches a specific country - */ - export interface AccessCountryRule { - geo: AccessCountryRule.Geo; - } + export namespace AccessCountryRule { + export interface Geo { + /** + * The country code that should be matched. + */ + country_code: string; + } + } - export namespace AccessCountryRule { - export interface Geo { - /** - * The country code that should be matched. - */ - country_code: string; + /** + * Enforce different MFA options + */ + export interface AccessAuthenticationMethodRule { + auth_method: AccessAuthenticationMethodRule.AuthMethod; } - } - /** - * Enforce different MFA options - */ - export interface AccessAuthenticationMethodRule { - auth_method: AccessAuthenticationMethodRule.AuthMethod; - } + export namespace AccessAuthenticationMethodRule { + export interface AuthMethod { + /** + * The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. + */ + auth_method: string; + } + } - export namespace AccessAuthenticationMethodRule { - export interface AuthMethod { - /** - * The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. - */ - auth_method: string; + /** + * Enforces a device posture rule has run successfully + */ + export interface AccessDevicePostureRule { + device_posture: AccessDevicePostureRule.DevicePosture; + } + + export namespace AccessDevicePostureRule { + export interface DevicePosture { + /** + * The ID of a device posture integration. + */ + integration_uid: string; + } } } +} +export interface PolicyDeleteResponse { /** - * Enforces a device posture rule has run successfully + * UUID */ - export interface AccessDevicePostureRule { - device_posture: AccessDevicePostureRule.DevicePosture; - } - - export namespace AccessDevicePostureRule { - export interface DevicePosture { - /** - * The ID of a device posture integration. - */ - integration_uid: string; - } - } + id?: string; } -export interface PolicyReplaceResponse { +export interface PolicyGetResponse { /** * UUID */ @@ -3434,7 +3434,7 @@ export interface PolicyReplaceResponse { /** * Administrators who can approve a temporary authentication request. */ - approval_groups?: Array; + approval_groups?: Array; /** * Requires the user to request access from an administrator at the start of each @@ -3454,25 +3454,25 @@ export interface PolicyReplaceResponse { * meet any of the Exclude rules. */ exclude?: Array< - | PolicyReplaceResponse.AccessEmailRule - | PolicyReplaceResponse.AccessEmailListRule - | PolicyReplaceResponse.AccessDomainRule - | PolicyReplaceResponse.AccessEveryoneRule - | PolicyReplaceResponse.AccessIPRule - | PolicyReplaceResponse.AccessIPListRule - | PolicyReplaceResponse.AccessCertificateRule - | PolicyReplaceResponse.AccessAccessGroupRule - | PolicyReplaceResponse.AccessAzureGroupRule - | PolicyReplaceResponse.AccessGitHubOrganizationRule - | PolicyReplaceResponse.AccessGsuiteGroupRule - | PolicyReplaceResponse.AccessOktaGroupRule - | PolicyReplaceResponse.AccessSamlGroupRule - | PolicyReplaceResponse.AccessServiceTokenRule - | PolicyReplaceResponse.AccessAnyValidServiceTokenRule - | PolicyReplaceResponse.AccessExternalEvaluationRule - | PolicyReplaceResponse.AccessCountryRule - | PolicyReplaceResponse.AccessAuthenticationMethodRule - | PolicyReplaceResponse.AccessDevicePostureRule + | PolicyGetResponse.AccessEmailRule + | PolicyGetResponse.AccessEmailListRule + | PolicyGetResponse.AccessDomainRule + | PolicyGetResponse.AccessEveryoneRule + | PolicyGetResponse.AccessIPRule + | PolicyGetResponse.AccessIPListRule + | PolicyGetResponse.AccessCertificateRule + | PolicyGetResponse.AccessAccessGroupRule + | PolicyGetResponse.AccessAzureGroupRule + | PolicyGetResponse.AccessGitHubOrganizationRule + | PolicyGetResponse.AccessGsuiteGroupRule + | PolicyGetResponse.AccessOktaGroupRule + | PolicyGetResponse.AccessSamlGroupRule + | PolicyGetResponse.AccessServiceTokenRule + | PolicyGetResponse.AccessAnyValidServiceTokenRule + | PolicyGetResponse.AccessExternalEvaluationRule + | PolicyGetResponse.AccessCountryRule + | PolicyGetResponse.AccessAuthenticationMethodRule + | PolicyGetResponse.AccessDevicePostureRule >; /** @@ -3480,25 +3480,25 @@ export interface PolicyReplaceResponse { * the Include rules. */ include?: Array< - | PolicyReplaceResponse.AccessEmailRule - | PolicyReplaceResponse.AccessEmailListRule - | PolicyReplaceResponse.AccessDomainRule - | PolicyReplaceResponse.AccessEveryoneRule - | PolicyReplaceResponse.AccessIPRule - | PolicyReplaceResponse.AccessIPListRule - | PolicyReplaceResponse.AccessCertificateRule - | PolicyReplaceResponse.AccessAccessGroupRule - | PolicyReplaceResponse.AccessAzureGroupRule - | PolicyReplaceResponse.AccessGitHubOrganizationRule - | PolicyReplaceResponse.AccessGsuiteGroupRule - | PolicyReplaceResponse.AccessOktaGroupRule - | PolicyReplaceResponse.AccessSamlGroupRule - | PolicyReplaceResponse.AccessServiceTokenRule - | PolicyReplaceResponse.AccessAnyValidServiceTokenRule - | PolicyReplaceResponse.AccessExternalEvaluationRule - | PolicyReplaceResponse.AccessCountryRule - | PolicyReplaceResponse.AccessAuthenticationMethodRule - | PolicyReplaceResponse.AccessDevicePostureRule + | PolicyGetResponse.AccessEmailRule + | PolicyGetResponse.AccessEmailListRule + | PolicyGetResponse.AccessDomainRule + | PolicyGetResponse.AccessEveryoneRule + | PolicyGetResponse.AccessIPRule + | PolicyGetResponse.AccessIPListRule + | PolicyGetResponse.AccessCertificateRule + | PolicyGetResponse.AccessAccessGroupRule + | PolicyGetResponse.AccessAzureGroupRule + | PolicyGetResponse.AccessGitHubOrganizationRule + | PolicyGetResponse.AccessGsuiteGroupRule + | PolicyGetResponse.AccessOktaGroupRule + | PolicyGetResponse.AccessSamlGroupRule + | PolicyGetResponse.AccessServiceTokenRule + | PolicyGetResponse.AccessAnyValidServiceTokenRule + | PolicyGetResponse.AccessExternalEvaluationRule + | PolicyGetResponse.AccessCountryRule + | PolicyGetResponse.AccessAuthenticationMethodRule + | PolicyGetResponse.AccessDevicePostureRule >; /** @@ -3533,25 +3533,25 @@ export interface PolicyReplaceResponse { * meet all of the Require rules. */ require?: Array< - | PolicyReplaceResponse.AccessEmailRule - | PolicyReplaceResponse.AccessEmailListRule - | PolicyReplaceResponse.AccessDomainRule - | PolicyReplaceResponse.AccessEveryoneRule - | PolicyReplaceResponse.AccessIPRule - | PolicyReplaceResponse.AccessIPListRule - | PolicyReplaceResponse.AccessCertificateRule - | PolicyReplaceResponse.AccessAccessGroupRule - | PolicyReplaceResponse.AccessAzureGroupRule - | PolicyReplaceResponse.AccessGitHubOrganizationRule - | PolicyReplaceResponse.AccessGsuiteGroupRule - | PolicyReplaceResponse.AccessOktaGroupRule - | PolicyReplaceResponse.AccessSamlGroupRule - | PolicyReplaceResponse.AccessServiceTokenRule - | PolicyReplaceResponse.AccessAnyValidServiceTokenRule - | PolicyReplaceResponse.AccessExternalEvaluationRule - | PolicyReplaceResponse.AccessCountryRule - | PolicyReplaceResponse.AccessAuthenticationMethodRule - | PolicyReplaceResponse.AccessDevicePostureRule + | PolicyGetResponse.AccessEmailRule + | PolicyGetResponse.AccessEmailListRule + | PolicyGetResponse.AccessDomainRule + | PolicyGetResponse.AccessEveryoneRule + | PolicyGetResponse.AccessIPRule + | PolicyGetResponse.AccessIPListRule + | PolicyGetResponse.AccessCertificateRule + | PolicyGetResponse.AccessAccessGroupRule + | PolicyGetResponse.AccessAzureGroupRule + | PolicyGetResponse.AccessGitHubOrganizationRule + | PolicyGetResponse.AccessGsuiteGroupRule + | PolicyGetResponse.AccessOktaGroupRule + | PolicyGetResponse.AccessSamlGroupRule + | PolicyGetResponse.AccessServiceTokenRule + | PolicyGetResponse.AccessAnyValidServiceTokenRule + | PolicyGetResponse.AccessExternalEvaluationRule + | PolicyGetResponse.AccessCountryRule + | PolicyGetResponse.AccessAuthenticationMethodRule + | PolicyGetResponse.AccessDevicePostureRule >; /** @@ -3564,7 +3564,7 @@ export interface PolicyReplaceResponse { updated_at?: string; } -export namespace PolicyReplaceResponse { +export namespace PolicyGetResponse { /** * A group of email addresses that can approve a temporary authentication request. */ @@ -5628,7 +5628,7 @@ export namespace PolicyCreateParams { } } -export interface PolicyReplaceParams { +export interface PolicyUpdateParams { /** * The action Access will take if a user matches this policy. */ @@ -5639,25 +5639,25 @@ export interface PolicyReplaceParams { * the Include rules. */ include: Array< - | PolicyReplaceParams.AccessEmailRule - | PolicyReplaceParams.AccessEmailListRule - | PolicyReplaceParams.AccessDomainRule - | PolicyReplaceParams.AccessEveryoneRule - | PolicyReplaceParams.AccessIPRule - | PolicyReplaceParams.AccessIPListRule - | PolicyReplaceParams.AccessCertificateRule - | PolicyReplaceParams.AccessAccessGroupRule - | PolicyReplaceParams.AccessAzureGroupRule - | PolicyReplaceParams.AccessGitHubOrganizationRule - | PolicyReplaceParams.AccessGsuiteGroupRule - | PolicyReplaceParams.AccessOktaGroupRule - | PolicyReplaceParams.AccessSamlGroupRule - | PolicyReplaceParams.AccessServiceTokenRule - | PolicyReplaceParams.AccessAnyValidServiceTokenRule - | PolicyReplaceParams.AccessExternalEvaluationRule - | PolicyReplaceParams.AccessCountryRule - | PolicyReplaceParams.AccessAuthenticationMethodRule - | PolicyReplaceParams.AccessDevicePostureRule + | PolicyUpdateParams.AccessEmailRule + | PolicyUpdateParams.AccessEmailListRule + | PolicyUpdateParams.AccessDomainRule + | PolicyUpdateParams.AccessEveryoneRule + | PolicyUpdateParams.AccessIPRule + | PolicyUpdateParams.AccessIPListRule + | PolicyUpdateParams.AccessCertificateRule + | PolicyUpdateParams.AccessAccessGroupRule + | PolicyUpdateParams.AccessAzureGroupRule + | PolicyUpdateParams.AccessGitHubOrganizationRule + | PolicyUpdateParams.AccessGsuiteGroupRule + | PolicyUpdateParams.AccessOktaGroupRule + | PolicyUpdateParams.AccessSamlGroupRule + | PolicyUpdateParams.AccessServiceTokenRule + | PolicyUpdateParams.AccessAnyValidServiceTokenRule + | PolicyUpdateParams.AccessExternalEvaluationRule + | PolicyUpdateParams.AccessCountryRule + | PolicyUpdateParams.AccessAuthenticationMethodRule + | PolicyUpdateParams.AccessDevicePostureRule >; /** @@ -5668,7 +5668,7 @@ export interface PolicyReplaceParams { /** * Administrators who can approve a temporary authentication request. */ - approval_groups?: Array; + approval_groups?: Array; /** * Requires the user to request access from an administrator at the start of each @@ -5681,25 +5681,25 @@ export interface PolicyReplaceParams { * meet any of the Exclude rules. */ exclude?: Array< - | PolicyReplaceParams.AccessEmailRule - | PolicyReplaceParams.AccessEmailListRule - | PolicyReplaceParams.AccessDomainRule - | PolicyReplaceParams.AccessEveryoneRule - | PolicyReplaceParams.AccessIPRule - | PolicyReplaceParams.AccessIPListRule - | PolicyReplaceParams.AccessCertificateRule - | PolicyReplaceParams.AccessAccessGroupRule - | PolicyReplaceParams.AccessAzureGroupRule - | PolicyReplaceParams.AccessGitHubOrganizationRule - | PolicyReplaceParams.AccessGsuiteGroupRule - | PolicyReplaceParams.AccessOktaGroupRule - | PolicyReplaceParams.AccessSamlGroupRule - | PolicyReplaceParams.AccessServiceTokenRule - | PolicyReplaceParams.AccessAnyValidServiceTokenRule - | PolicyReplaceParams.AccessExternalEvaluationRule - | PolicyReplaceParams.AccessCountryRule - | PolicyReplaceParams.AccessAuthenticationMethodRule - | PolicyReplaceParams.AccessDevicePostureRule + | PolicyUpdateParams.AccessEmailRule + | PolicyUpdateParams.AccessEmailListRule + | PolicyUpdateParams.AccessDomainRule + | PolicyUpdateParams.AccessEveryoneRule + | PolicyUpdateParams.AccessIPRule + | PolicyUpdateParams.AccessIPListRule + | PolicyUpdateParams.AccessCertificateRule + | PolicyUpdateParams.AccessAccessGroupRule + | PolicyUpdateParams.AccessAzureGroupRule + | PolicyUpdateParams.AccessGitHubOrganizationRule + | PolicyUpdateParams.AccessGsuiteGroupRule + | PolicyUpdateParams.AccessOktaGroupRule + | PolicyUpdateParams.AccessSamlGroupRule + | PolicyUpdateParams.AccessServiceTokenRule + | PolicyUpdateParams.AccessAnyValidServiceTokenRule + | PolicyUpdateParams.AccessExternalEvaluationRule + | PolicyUpdateParams.AccessCountryRule + | PolicyUpdateParams.AccessAuthenticationMethodRule + | PolicyUpdateParams.AccessDevicePostureRule >; /** @@ -5729,25 +5729,25 @@ export interface PolicyReplaceParams { * meet all of the Require rules. */ require?: Array< - | PolicyReplaceParams.AccessEmailRule - | PolicyReplaceParams.AccessEmailListRule - | PolicyReplaceParams.AccessDomainRule - | PolicyReplaceParams.AccessEveryoneRule - | PolicyReplaceParams.AccessIPRule - | PolicyReplaceParams.AccessIPListRule - | PolicyReplaceParams.AccessCertificateRule - | PolicyReplaceParams.AccessAccessGroupRule - | PolicyReplaceParams.AccessAzureGroupRule - | PolicyReplaceParams.AccessGitHubOrganizationRule - | PolicyReplaceParams.AccessGsuiteGroupRule - | PolicyReplaceParams.AccessOktaGroupRule - | PolicyReplaceParams.AccessSamlGroupRule - | PolicyReplaceParams.AccessServiceTokenRule - | PolicyReplaceParams.AccessAnyValidServiceTokenRule - | PolicyReplaceParams.AccessExternalEvaluationRule - | PolicyReplaceParams.AccessCountryRule - | PolicyReplaceParams.AccessAuthenticationMethodRule - | PolicyReplaceParams.AccessDevicePostureRule + | PolicyUpdateParams.AccessEmailRule + | PolicyUpdateParams.AccessEmailListRule + | PolicyUpdateParams.AccessDomainRule + | PolicyUpdateParams.AccessEveryoneRule + | PolicyUpdateParams.AccessIPRule + | PolicyUpdateParams.AccessIPListRule + | PolicyUpdateParams.AccessCertificateRule + | PolicyUpdateParams.AccessAccessGroupRule + | PolicyUpdateParams.AccessAzureGroupRule + | PolicyUpdateParams.AccessGitHubOrganizationRule + | PolicyUpdateParams.AccessGsuiteGroupRule + | PolicyUpdateParams.AccessOktaGroupRule + | PolicyUpdateParams.AccessSamlGroupRule + | PolicyUpdateParams.AccessServiceTokenRule + | PolicyUpdateParams.AccessAnyValidServiceTokenRule + | PolicyUpdateParams.AccessExternalEvaluationRule + | PolicyUpdateParams.AccessCountryRule + | PolicyUpdateParams.AccessAuthenticationMethodRule + | PolicyUpdateParams.AccessDevicePostureRule >; /** @@ -5758,7 +5758,7 @@ export interface PolicyReplaceParams { session_duration?: string; } -export namespace PolicyReplaceParams { +export namespace PolicyUpdateParams { /** * Matches a specific email. */ @@ -6727,10 +6727,10 @@ export namespace PolicyReplaceParams { export namespace Policies { export import PolicyCreateResponse = PoliciesAPI.PolicyCreateResponse; + export import PolicyUpdateResponse = PoliciesAPI.PolicyUpdateResponse; export import PolicyListResponse = PoliciesAPI.PolicyListResponse; export import PolicyDeleteResponse = PoliciesAPI.PolicyDeleteResponse; export import PolicyGetResponse = PoliciesAPI.PolicyGetResponse; - export import PolicyReplaceResponse = PoliciesAPI.PolicyReplaceResponse; export import PolicyCreateParams = PoliciesAPI.PolicyCreateParams; - export import PolicyReplaceParams = PoliciesAPI.PolicyReplaceParams; + export import PolicyUpdateParams = PoliciesAPI.PolicyUpdateParams; } diff --git a/src/resources/access/bookmarks.ts b/src/resources/access/bookmarks.ts index 4549f46b94..aca8000bbf 100644 --- a/src/resources/access/bookmarks.ts +++ b/src/resources/access/bookmarks.ts @@ -5,6 +5,21 @@ import { APIResource } from 'cloudflare/resource'; import * as BookmarksAPI from 'cloudflare/resources/access/bookmarks'; export class Bookmarks extends APIResource { + /** + * Updates a configured Bookmark application. + */ + update( + identifier: unknown, + uuid: string, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/accounts/${identifier}/access/bookmarks/${uuid}`, options) as Core.APIPromise<{ + result: BookmarkUpdateResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + /** * Lists Bookmark applications. */ @@ -45,21 +60,37 @@ export class Bookmarks extends APIResource { }> )._thenUnwrap((obj) => obj.result); } +} +export interface BookmarkUpdateResponse { /** - * Updates a configured Bookmark application. + * The unique identifier for the Bookmark application. */ - replace( - identifier: unknown, - uuid: string, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put(`/accounts/${identifier}/access/bookmarks/${uuid}`, options) as Core.APIPromise<{ - result: BookmarkReplaceResponse; - }> - )._thenUnwrap((obj) => obj.result); - } + id?: unknown; + + /** + * Displays the application in the App Launcher. + */ + app_launcher_visible?: boolean; + + created_at?: string; + + /** + * The domain of the Bookmark application. + */ + domain?: string; + + /** + * The image URL for the logo shown in the App Launcher dashboard. + */ + logo_url?: string; + + /** + * The name of the Bookmark application. + */ + name?: string; + + updated_at?: string; } export type BookmarkListResponse = Array; @@ -135,40 +166,9 @@ export interface BookmarkGetResponse { updated_at?: string; } -export interface BookmarkReplaceResponse { - /** - * The unique identifier for the Bookmark application. - */ - id?: unknown; - - /** - * Displays the application in the App Launcher. - */ - app_launcher_visible?: boolean; - - created_at?: string; - - /** - * The domain of the Bookmark application. - */ - domain?: string; - - /** - * The image URL for the logo shown in the App Launcher dashboard. - */ - logo_url?: string; - - /** - * The name of the Bookmark application. - */ - name?: string; - - updated_at?: string; -} - export namespace Bookmarks { + export import BookmarkUpdateResponse = BookmarksAPI.BookmarkUpdateResponse; export import BookmarkListResponse = BookmarksAPI.BookmarkListResponse; export import BookmarkDeleteResponse = BookmarksAPI.BookmarkDeleteResponse; export import BookmarkGetResponse = BookmarksAPI.BookmarkGetResponse; - export import BookmarkReplaceResponse = BookmarksAPI.BookmarkReplaceResponse; } diff --git a/src/resources/access/certificates/certificates.ts b/src/resources/access/certificates/certificates.ts index 0717dedbcd..908adf479b 100644 --- a/src/resources/access/certificates/certificates.ts +++ b/src/resources/access/certificates/certificates.ts @@ -25,6 +25,24 @@ export class Certificates extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Updates a configured mTLS certificate. + */ + update( + accountOrZone: string, + accountOrZoneId: string, + uuid: string, + body: CertificateUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/${accountOrZone}/${accountOrZoneId}/access/certificates/${uuid}`, { + body, + ...options, + }) as Core.APIPromise<{ result: CertificateUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * Lists all mTLS root certificates. */ @@ -74,27 +92,37 @@ export class Certificates extends APIResource { ) as Core.APIPromise<{ result: CertificateGetResponse }> )._thenUnwrap((obj) => obj.result); } +} +export interface CertificateCreateResponse { /** - * Updates a configured mTLS certificate. + * The ID of the application that will use this certificate. */ - replace( - accountOrZone: string, - accountOrZoneId: string, - uuid: string, - body: CertificateReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put(`/${accountOrZone}/${accountOrZoneId}/access/certificates/${uuid}`, { - body, - ...options, - }) as Core.APIPromise<{ result: CertificateReplaceResponse }> - )._thenUnwrap((obj) => obj.result); - } + id?: unknown; + + /** + * The hostnames of the applications that will use this certificate. + */ + associated_hostnames?: Array; + + created_at?: string; + + expires_on?: string; + + /** + * The MD5 fingerprint of the certificate. + */ + fingerprint?: string; + + /** + * The name of the certificate. + */ + name?: string; + + updated_at?: string; } -export interface CertificateCreateResponse { +export interface CertificateUpdateResponse { /** * The ID of the application that will use this certificate. */ @@ -189,34 +217,6 @@ export interface CertificateGetResponse { updated_at?: string; } -export interface CertificateReplaceResponse { - /** - * The ID of the application that will use this certificate. - */ - id?: unknown; - - /** - * The hostnames of the applications that will use this certificate. - */ - associated_hostnames?: Array; - - created_at?: string; - - expires_on?: string; - - /** - * The MD5 fingerprint of the certificate. - */ - fingerprint?: string; - - /** - * The name of the certificate. - */ - name?: string; - - updated_at?: string; -} - export interface CertificateCreateParams { /** * The certificate content. @@ -234,7 +234,7 @@ export interface CertificateCreateParams { associated_hostnames?: Array; } -export interface CertificateReplaceParams { +export interface CertificateUpdateParams { /** * The hostnames of the applications that will use this certificate. */ @@ -248,14 +248,14 @@ export interface CertificateReplaceParams { export namespace Certificates { export import CertificateCreateResponse = CertificatesAPI.CertificateCreateResponse; + export import CertificateUpdateResponse = CertificatesAPI.CertificateUpdateResponse; export import CertificateListResponse = CertificatesAPI.CertificateListResponse; export import CertificateDeleteResponse = CertificatesAPI.CertificateDeleteResponse; export import CertificateGetResponse = CertificatesAPI.CertificateGetResponse; - export import CertificateReplaceResponse = CertificatesAPI.CertificateReplaceResponse; export import CertificateCreateParams = CertificatesAPI.CertificateCreateParams; - export import CertificateReplaceParams = CertificatesAPI.CertificateReplaceParams; + export import CertificateUpdateParams = CertificatesAPI.CertificateUpdateParams; export import Settings = SettingsAPI.Settings; + export import SettingUpdateResponse = SettingsAPI.SettingUpdateResponse; export import SettingListResponse = SettingsAPI.SettingListResponse; - export import SettingReplaceResponse = SettingsAPI.SettingReplaceResponse; - export import SettingReplaceParams = SettingsAPI.SettingReplaceParams; + export import SettingUpdateParams = SettingsAPI.SettingUpdateParams; } diff --git a/src/resources/access/certificates/index.ts b/src/resources/access/certificates/index.ts index 9baee4c5b9..e381ae5ffe 100644 --- a/src/resources/access/certificates/index.ts +++ b/src/resources/access/certificates/index.ts @@ -2,12 +2,12 @@ export { CertificateCreateResponse, + CertificateUpdateResponse, CertificateListResponse, CertificateDeleteResponse, CertificateGetResponse, - CertificateReplaceResponse, CertificateCreateParams, - CertificateReplaceParams, + CertificateUpdateParams, Certificates, } from './certificates'; -export { SettingListResponse, SettingReplaceResponse, SettingReplaceParams, Settings } from './settings'; +export { SettingUpdateResponse, SettingListResponse, SettingUpdateParams, Settings } from './settings'; diff --git a/src/resources/access/certificates/settings.ts b/src/resources/access/certificates/settings.ts index 058a9c0a19..6c95df02c1 100644 --- a/src/resources/access/certificates/settings.ts +++ b/src/resources/access/certificates/settings.ts @@ -6,43 +6,43 @@ import * as SettingsAPI from 'cloudflare/resources/access/certificates/settings' export class Settings extends APIResource { /** - * List all mTLS hostname settings for this account or zone. + * Updates an mTLS certificate's hostname settings. */ - list( + update( accountOrZone: string, accountOrZoneId: string, + body: SettingUpdateParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( - this._client.get( - `/${accountOrZone}/${accountOrZoneId}/access/certificates/settings`, - options, - ) as Core.APIPromise<{ result: SettingListResponse | null }> + this._client.put(`/${accountOrZone}/${accountOrZoneId}/access/certificates/settings`, { + body, + ...options, + }) as Core.APIPromise<{ result: SettingUpdateResponse | null }> )._thenUnwrap((obj) => obj.result); } /** - * Updates an mTLS certificate's hostname settings. + * List all mTLS hostname settings for this account or zone. */ - replace( + list( accountOrZone: string, accountOrZoneId: string, - body: SettingReplaceParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( - this._client.put(`/${accountOrZone}/${accountOrZoneId}/access/certificates/settings`, { - body, - ...options, - }) as Core.APIPromise<{ result: SettingReplaceResponse | null }> + this._client.get( + `/${accountOrZone}/${accountOrZoneId}/access/certificates/settings`, + options, + ) as Core.APIPromise<{ result: SettingListResponse | null }> )._thenUnwrap((obj) => obj.result); } } -export type SettingListResponse = Array; +export type SettingUpdateResponse = Array; -export namespace SettingListResponse { - export interface SettingListResponseItem { +export namespace SettingUpdateResponse { + export interface SettingUpdateResponseItem { /** * Request client certificates for this hostname in China. Can only be set to true * if this zone is china network enabled. @@ -63,10 +63,10 @@ export namespace SettingListResponse { } } -export type SettingReplaceResponse = Array; +export type SettingListResponse = Array; -export namespace SettingReplaceResponse { - export interface SettingReplaceResponseItem { +export namespace SettingListResponse { + export interface SettingListResponseItem { /** * Request client certificates for this hostname in China. Can only be set to true * if this zone is china network enabled. @@ -87,11 +87,11 @@ export namespace SettingReplaceResponse { } } -export interface SettingReplaceParams { - settings: Array; +export interface SettingUpdateParams { + settings: Array; } -export namespace SettingReplaceParams { +export namespace SettingUpdateParams { export interface Setting { /** * Request client certificates for this hostname in China. Can only be set to true @@ -114,7 +114,7 @@ export namespace SettingReplaceParams { } export namespace Settings { + export import SettingUpdateResponse = SettingsAPI.SettingUpdateResponse; export import SettingListResponse = SettingsAPI.SettingListResponse; - export import SettingReplaceResponse = SettingsAPI.SettingReplaceResponse; - export import SettingReplaceParams = SettingsAPI.SettingReplaceParams; + export import SettingUpdateParams = SettingsAPI.SettingUpdateParams; } diff --git a/src/resources/access/custom-pages.ts b/src/resources/access/custom-pages.ts index 671ec659b5..8eb09c4033 100644 --- a/src/resources/access/custom-pages.ts +++ b/src/resources/access/custom-pages.ts @@ -21,6 +21,23 @@ export class CustomPages extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Update a custom page + */ + update( + identifier: string, + uuid: string, + body: CustomPageUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/accounts/${identifier}/access/custom_pages/${uuid}`, { + body, + ...options, + }) as Core.APIPromise<{ result: CustomPageUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * List custom pages */ @@ -61,26 +78,35 @@ export class CustomPages extends APIResource { }> )._thenUnwrap((obj) => obj.result); } +} +export interface CustomPageCreateResponse { /** - * Update a custom page + * Custom page name. */ - replace( - identifier: string, - uuid: string, - body: CustomPageReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put(`/accounts/${identifier}/access/custom_pages/${uuid}`, { - body, - ...options, - }) as Core.APIPromise<{ result: CustomPageReplaceResponse }> - )._thenUnwrap((obj) => obj.result); - } + name: string; + + /** + * Custom page type. + */ + type: 'identity_denied' | 'forbidden'; + + /** + * Number of apps the custom page is assigned to. + */ + app_count?: number; + + created_at?: string; + + /** + * UUID + */ + uid?: string; + + updated_at?: string; } -export interface CustomPageCreateResponse { +export interface CustomPageUpdateResponse { /** * Custom page name. */ @@ -174,32 +200,6 @@ export interface CustomPageGetResponse { updated_at?: string; } -export interface CustomPageReplaceResponse { - /** - * Custom page name. - */ - name: string; - - /** - * Custom page type. - */ - type: 'identity_denied' | 'forbidden'; - - /** - * Number of apps the custom page is assigned to. - */ - app_count?: number; - - created_at?: string; - - /** - * UUID - */ - uid?: string; - - updated_at?: string; -} - export interface CustomPageCreateParams { /** * Custom page HTML. @@ -222,7 +222,7 @@ export interface CustomPageCreateParams { app_count?: number; } -export interface CustomPageReplaceParams { +export interface CustomPageUpdateParams { /** * Custom page HTML. */ @@ -246,10 +246,10 @@ export interface CustomPageReplaceParams { export namespace CustomPages { export import CustomPageCreateResponse = CustomPagesAPI.CustomPageCreateResponse; + export import CustomPageUpdateResponse = CustomPagesAPI.CustomPageUpdateResponse; export import CustomPageListResponse = CustomPagesAPI.CustomPageListResponse; export import CustomPageDeleteResponse = CustomPagesAPI.CustomPageDeleteResponse; export import CustomPageGetResponse = CustomPagesAPI.CustomPageGetResponse; - export import CustomPageReplaceResponse = CustomPagesAPI.CustomPageReplaceResponse; export import CustomPageCreateParams = CustomPagesAPI.CustomPageCreateParams; - export import CustomPageReplaceParams = CustomPagesAPI.CustomPageReplaceParams; + export import CustomPageUpdateParams = CustomPagesAPI.CustomPageUpdateParams; } diff --git a/src/resources/access/groups.ts b/src/resources/access/groups.ts index d97add1b83..b7baa957a4 100644 --- a/src/resources/access/groups.ts +++ b/src/resources/access/groups.ts @@ -22,6 +22,24 @@ export class Groups extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Updates a configured Access group. + */ + update( + accountOrZone: string, + accountOrZoneId: string, + uuid: string, + body: GroupUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/${accountOrZone}/${accountOrZoneId}/access/groups/${uuid}`, { + body, + ...options, + }) as Core.APIPromise<{ result: GroupUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * Lists all Access groups. */ @@ -70,24 +88,6 @@ export class Groups extends APIResource { ) as Core.APIPromise<{ result: GroupGetResponse }> )._thenUnwrap((obj) => obj.result); } - - /** - * Updates a configured Access group. - */ - replace( - accountOrZone: string, - accountOrZoneId: string, - uuid: string, - body: GroupReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put(`/${accountOrZone}/${accountOrZoneId}/access/groups/${uuid}`, { - body, - ...options, - }) as Core.APIPromise<{ result: GroupReplaceResponse }> - )._thenUnwrap((obj) => obj.result); - } } export interface GroupCreateResponse { @@ -1472,2782 +1472,2782 @@ export namespace GroupCreateResponse { } } -export type GroupListResponse = Array; +export interface GroupUpdateResponse { + /** + * UUID + */ + id?: string; -export namespace GroupListResponse { - export interface GroupListResponseItem { - /** - * UUID - */ - id?: string; + created_at?: string; - created_at?: string; + /** + * Rules evaluated with a NOT logical operator. To match a policy, a user cannot + * meet any of the Exclude rules. + */ + exclude?: Array< + | GroupUpdateResponse.AccessEmailRule + | GroupUpdateResponse.AccessEmailListRule + | GroupUpdateResponse.AccessDomainRule + | GroupUpdateResponse.AccessEveryoneRule + | GroupUpdateResponse.AccessIPRule + | GroupUpdateResponse.AccessIPListRule + | GroupUpdateResponse.AccessCertificateRule + | GroupUpdateResponse.AccessAccessGroupRule + | GroupUpdateResponse.AccessAzureGroupRule + | GroupUpdateResponse.AccessGitHubOrganizationRule + | GroupUpdateResponse.AccessGsuiteGroupRule + | GroupUpdateResponse.AccessOktaGroupRule + | GroupUpdateResponse.AccessSamlGroupRule + | GroupUpdateResponse.AccessServiceTokenRule + | GroupUpdateResponse.AccessAnyValidServiceTokenRule + | GroupUpdateResponse.AccessExternalEvaluationRule + | GroupUpdateResponse.AccessCountryRule + | GroupUpdateResponse.AccessAuthenticationMethodRule + | GroupUpdateResponse.AccessDevicePostureRule + >; - /** - * Rules evaluated with a NOT logical operator. To match a policy, a user cannot - * meet any of the Exclude rules. - */ - exclude?: Array< - | GroupListResponseItem.AccessEmailRule - | GroupListResponseItem.AccessEmailListRule - | GroupListResponseItem.AccessDomainRule - | GroupListResponseItem.AccessEveryoneRule - | GroupListResponseItem.AccessIPRule - | GroupListResponseItem.AccessIPListRule - | GroupListResponseItem.AccessCertificateRule - | GroupListResponseItem.AccessAccessGroupRule - | GroupListResponseItem.AccessAzureGroupRule - | GroupListResponseItem.AccessGitHubOrganizationRule - | GroupListResponseItem.AccessGsuiteGroupRule - | GroupListResponseItem.AccessOktaGroupRule - | GroupListResponseItem.AccessSamlGroupRule - | GroupListResponseItem.AccessServiceTokenRule - | GroupListResponseItem.AccessAnyValidServiceTokenRule - | GroupListResponseItem.AccessExternalEvaluationRule - | GroupListResponseItem.AccessCountryRule - | GroupListResponseItem.AccessAuthenticationMethodRule - | GroupListResponseItem.AccessDevicePostureRule - >; + /** + * Rules evaluated with an OR logical operator. A user needs to meet only one of + * the Include rules. + */ + include?: Array< + | GroupUpdateResponse.AccessEmailRule + | GroupUpdateResponse.AccessEmailListRule + | GroupUpdateResponse.AccessDomainRule + | GroupUpdateResponse.AccessEveryoneRule + | GroupUpdateResponse.AccessIPRule + | GroupUpdateResponse.AccessIPListRule + | GroupUpdateResponse.AccessCertificateRule + | GroupUpdateResponse.AccessAccessGroupRule + | GroupUpdateResponse.AccessAzureGroupRule + | GroupUpdateResponse.AccessGitHubOrganizationRule + | GroupUpdateResponse.AccessGsuiteGroupRule + | GroupUpdateResponse.AccessOktaGroupRule + | GroupUpdateResponse.AccessSamlGroupRule + | GroupUpdateResponse.AccessServiceTokenRule + | GroupUpdateResponse.AccessAnyValidServiceTokenRule + | GroupUpdateResponse.AccessExternalEvaluationRule + | GroupUpdateResponse.AccessCountryRule + | GroupUpdateResponse.AccessAuthenticationMethodRule + | GroupUpdateResponse.AccessDevicePostureRule + >; - /** - * Rules evaluated with an OR logical operator. A user needs to meet only one of - * the Include rules. - */ - include?: Array< - | GroupListResponseItem.AccessEmailRule - | GroupListResponseItem.AccessEmailListRule - | GroupListResponseItem.AccessDomainRule - | GroupListResponseItem.AccessEveryoneRule - | GroupListResponseItem.AccessIPRule - | GroupListResponseItem.AccessIPListRule - | GroupListResponseItem.AccessCertificateRule - | GroupListResponseItem.AccessAccessGroupRule - | GroupListResponseItem.AccessAzureGroupRule - | GroupListResponseItem.AccessGitHubOrganizationRule - | GroupListResponseItem.AccessGsuiteGroupRule - | GroupListResponseItem.AccessOktaGroupRule - | GroupListResponseItem.AccessSamlGroupRule - | GroupListResponseItem.AccessServiceTokenRule - | GroupListResponseItem.AccessAnyValidServiceTokenRule - | GroupListResponseItem.AccessExternalEvaluationRule - | GroupListResponseItem.AccessCountryRule - | GroupListResponseItem.AccessAuthenticationMethodRule - | GroupListResponseItem.AccessDevicePostureRule - >; + /** + * Rules evaluated with an AND logical operator. To match a policy, a user must + * meet all of the Require rules. + */ + is_default?: Array< + | GroupUpdateResponse.AccessEmailRule + | GroupUpdateResponse.AccessEmailListRule + | GroupUpdateResponse.AccessDomainRule + | GroupUpdateResponse.AccessEveryoneRule + | GroupUpdateResponse.AccessIPRule + | GroupUpdateResponse.AccessIPListRule + | GroupUpdateResponse.AccessCertificateRule + | GroupUpdateResponse.AccessAccessGroupRule + | GroupUpdateResponse.AccessAzureGroupRule + | GroupUpdateResponse.AccessGitHubOrganizationRule + | GroupUpdateResponse.AccessGsuiteGroupRule + | GroupUpdateResponse.AccessOktaGroupRule + | GroupUpdateResponse.AccessSamlGroupRule + | GroupUpdateResponse.AccessServiceTokenRule + | GroupUpdateResponse.AccessAnyValidServiceTokenRule + | GroupUpdateResponse.AccessExternalEvaluationRule + | GroupUpdateResponse.AccessCountryRule + | GroupUpdateResponse.AccessAuthenticationMethodRule + | GroupUpdateResponse.AccessDevicePostureRule + >; - /** - * Rules evaluated with an AND logical operator. To match a policy, a user must - * meet all of the Require rules. - */ - is_default?: Array< - | GroupListResponseItem.AccessEmailRule - | GroupListResponseItem.AccessEmailListRule - | GroupListResponseItem.AccessDomainRule - | GroupListResponseItem.AccessEveryoneRule - | GroupListResponseItem.AccessIPRule - | GroupListResponseItem.AccessIPListRule - | GroupListResponseItem.AccessCertificateRule - | GroupListResponseItem.AccessAccessGroupRule - | GroupListResponseItem.AccessAzureGroupRule - | GroupListResponseItem.AccessGitHubOrganizationRule - | GroupListResponseItem.AccessGsuiteGroupRule - | GroupListResponseItem.AccessOktaGroupRule - | GroupListResponseItem.AccessSamlGroupRule - | GroupListResponseItem.AccessServiceTokenRule - | GroupListResponseItem.AccessAnyValidServiceTokenRule - | GroupListResponseItem.AccessExternalEvaluationRule - | GroupListResponseItem.AccessCountryRule - | GroupListResponseItem.AccessAuthenticationMethodRule - | GroupListResponseItem.AccessDevicePostureRule - >; + /** + * The name of the Access group. + */ + name?: string; - /** - * The name of the Access group. - */ - name?: string; + /** + * Rules evaluated with an AND logical operator. To match a policy, a user must + * meet all of the Require rules. + */ + require?: Array< + | GroupUpdateResponse.AccessEmailRule + | GroupUpdateResponse.AccessEmailListRule + | GroupUpdateResponse.AccessDomainRule + | GroupUpdateResponse.AccessEveryoneRule + | GroupUpdateResponse.AccessIPRule + | GroupUpdateResponse.AccessIPListRule + | GroupUpdateResponse.AccessCertificateRule + | GroupUpdateResponse.AccessAccessGroupRule + | GroupUpdateResponse.AccessAzureGroupRule + | GroupUpdateResponse.AccessGitHubOrganizationRule + | GroupUpdateResponse.AccessGsuiteGroupRule + | GroupUpdateResponse.AccessOktaGroupRule + | GroupUpdateResponse.AccessSamlGroupRule + | GroupUpdateResponse.AccessServiceTokenRule + | GroupUpdateResponse.AccessAnyValidServiceTokenRule + | GroupUpdateResponse.AccessExternalEvaluationRule + | GroupUpdateResponse.AccessCountryRule + | GroupUpdateResponse.AccessAuthenticationMethodRule + | GroupUpdateResponse.AccessDevicePostureRule + >; - /** - * Rules evaluated with an AND logical operator. To match a policy, a user must - * meet all of the Require rules. - */ - require?: Array< - | GroupListResponseItem.AccessEmailRule - | GroupListResponseItem.AccessEmailListRule - | GroupListResponseItem.AccessDomainRule - | GroupListResponseItem.AccessEveryoneRule - | GroupListResponseItem.AccessIPRule - | GroupListResponseItem.AccessIPListRule - | GroupListResponseItem.AccessCertificateRule - | GroupListResponseItem.AccessAccessGroupRule - | GroupListResponseItem.AccessAzureGroupRule - | GroupListResponseItem.AccessGitHubOrganizationRule - | GroupListResponseItem.AccessGsuiteGroupRule - | GroupListResponseItem.AccessOktaGroupRule - | GroupListResponseItem.AccessSamlGroupRule - | GroupListResponseItem.AccessServiceTokenRule - | GroupListResponseItem.AccessAnyValidServiceTokenRule - | GroupListResponseItem.AccessExternalEvaluationRule - | GroupListResponseItem.AccessCountryRule - | GroupListResponseItem.AccessAuthenticationMethodRule - | GroupListResponseItem.AccessDevicePostureRule - >; + updated_at?: string; +} - updated_at?: string; +export namespace GroupUpdateResponse { + /** + * Matches a specific email. + */ + export interface AccessEmailRule { + email: AccessEmailRule.Email; } - export namespace GroupListResponseItem { - /** - * Matches a specific email. - */ - export interface AccessEmailRule { - email: AccessEmailRule.Email; + export namespace AccessEmailRule { + export interface Email { + /** + * The email of the user. + */ + email: string; } + } - export namespace AccessEmailRule { - export interface Email { - /** - * The email of the user. - */ - email: string; - } - } + /** + * Matches an email address from a list. + */ + export interface AccessEmailListRule { + email_list: AccessEmailListRule.EmailList; + } - /** - * Matches an email address from a list. - */ - export interface AccessEmailListRule { - email_list: AccessEmailListRule.EmailList; + export namespace AccessEmailListRule { + export interface EmailList { + /** + * The ID of a previously created email list. + */ + id: string; } + } - export namespace AccessEmailListRule { - export interface EmailList { - /** - * The ID of a previously created email list. - */ - id: string; - } + /** + * Match an entire email domain. + */ + export interface AccessDomainRule { + email_domain: AccessDomainRule.EmailDomain; + } + + export namespace AccessDomainRule { + export interface EmailDomain { + /** + * The email domain to match. + */ + domain: string; } + } + /** + * Matches everyone. + */ + export interface AccessEveryoneRule { /** - * Match an entire email domain. + * An empty object which matches on all users. */ - export interface AccessDomainRule { - email_domain: AccessDomainRule.EmailDomain; - } + everyone: unknown; + } - export namespace AccessDomainRule { - export interface EmailDomain { - /** - * The email domain to match. - */ - domain: string; - } - } + /** + * Matches an IP address block. + */ + export interface AccessIPRule { + ip: AccessIPRule.IP; + } - /** - * Matches everyone. - */ - export interface AccessEveryoneRule { + export namespace AccessIPRule { + export interface IP { /** - * An empty object which matches on all users. + * An IPv4 or IPv6 CIDR block. */ - everyone: unknown; + ip: string; } + } - /** - * Matches an IP address block. - */ - export interface AccessIPRule { - ip: AccessIPRule.IP; - } + /** + * Matches an IP address from a list. + */ + export interface AccessIPListRule { + ip_list: AccessIPListRule.IPList; + } - export namespace AccessIPRule { - export interface IP { - /** - * An IPv4 or IPv6 CIDR block. - */ - ip: string; - } + export namespace AccessIPListRule { + export interface IPList { + /** + * The ID of a previously created IP list. + */ + id: string; } + } - /** - * Matches an IP address from a list. - */ - export interface AccessIPListRule { - ip_list: AccessIPListRule.IPList; - } + /** + * Matches any valid client certificate. + */ + export interface AccessCertificateRule { + certificate: unknown; + } - export namespace AccessIPListRule { - export interface IPList { - /** - * The ID of a previously created IP list. - */ - id: string; - } - } + /** + * Matches an Access group. + */ + export interface AccessAccessGroupRule { + group: AccessAccessGroupRule.Group; + } - /** - * Matches any valid client certificate. - */ - export interface AccessCertificateRule { - certificate: unknown; + export namespace AccessAccessGroupRule { + export interface Group { + /** + * The ID of a previously created Access group. + */ + id: string; } + } - /** - * Matches an Access group. - */ - export interface AccessAccessGroupRule { - group: AccessAccessGroupRule.Group; - } + /** + * Matches an Azure group. Requires an Azure identity provider. + */ + export interface AccessAzureGroupRule { + azureAD: AccessAzureGroupRule.AzureAd; + } - export namespace AccessAccessGroupRule { - export interface Group { - /** - * The ID of a previously created Access group. - */ - id: string; - } - } + export namespace AccessAzureGroupRule { + export interface AzureAd { + /** + * The ID of an Azure group. + */ + id: string; - /** - * Matches an Azure group. Requires an Azure identity provider. - */ - export interface AccessAzureGroupRule { - azureAD: AccessAzureGroupRule.AzureAd; + /** + * The ID of your Azure identity provider. + */ + connection_id: string; } + } - export namespace AccessAzureGroupRule { - export interface AzureAd { - /** - * The ID of an Azure group. - */ - id: string; + /** + * Matches a Github organization. Requires a Github identity provider. + */ + export interface AccessGitHubOrganizationRule { + 'github-organization': AccessGitHubOrganizationRule.GitHubOrganization; + } - /** - * The ID of your Azure identity provider. - */ - connection_id: string; - } - } + export namespace AccessGitHubOrganizationRule { + export interface GitHubOrganization { + /** + * The ID of your Github identity provider. + */ + connection_id: string; - /** - * Matches a Github organization. Requires a Github identity provider. - */ - export interface AccessGitHubOrganizationRule { - 'github-organization': AccessGitHubOrganizationRule.GitHubOrganization; + /** + * The name of the organization. + */ + name: string; } + } - export namespace AccessGitHubOrganizationRule { - export interface GitHubOrganization { - /** - * The ID of your Github identity provider. - */ - connection_id: string; + /** + * Matches a group in Google Workspace. Requires a Google Workspace identity + * provider. + */ + export interface AccessGsuiteGroupRule { + gsuite: AccessGsuiteGroupRule.Gsuite; + } - /** - * The name of the organization. - */ - name: string; - } - } + export namespace AccessGsuiteGroupRule { + export interface Gsuite { + /** + * The ID of your Google Workspace identity provider. + */ + connection_id: string; - /** - * Matches a group in Google Workspace. Requires a Google Workspace identity - * provider. - */ - export interface AccessGsuiteGroupRule { - gsuite: AccessGsuiteGroupRule.Gsuite; + /** + * The email of the Google Workspace group. + */ + email: string; } + } - export namespace AccessGsuiteGroupRule { - export interface Gsuite { - /** - * The ID of your Google Workspace identity provider. - */ - connection_id: string; + /** + * Matches an Okta group. Requires an Okta identity provider. + */ + export interface AccessOktaGroupRule { + okta: AccessOktaGroupRule.Okta; + } - /** - * The email of the Google Workspace group. - */ - email: string; - } - } + export namespace AccessOktaGroupRule { + export interface Okta { + /** + * The ID of your Okta identity provider. + */ + connection_id: string; - /** - * Matches an Okta group. Requires an Okta identity provider. - */ - export interface AccessOktaGroupRule { - okta: AccessOktaGroupRule.Okta; + /** + * The email of the Okta group. + */ + email: string; } + } - export namespace AccessOktaGroupRule { - export interface Okta { - /** - * The ID of your Okta identity provider. - */ - connection_id: string; + /** + * Matches a SAML group. Requires a SAML identity provider. + */ + export interface AccessSamlGroupRule { + saml: AccessSamlGroupRule.Saml; + } - /** - * The email of the Okta group. - */ - email: string; - } + export namespace AccessSamlGroupRule { + export interface Saml { + /** + * The name of the SAML attribute. + */ + attribute_name: string; + + /** + * The SAML attribute value to look for. + */ + attribute_value: string; } + } - /** - * Matches a SAML group. Requires a SAML identity provider. - */ - export interface AccessSamlGroupRule { - saml: AccessSamlGroupRule.Saml; - } - - export namespace AccessSamlGroupRule { - export interface Saml { - /** - * The name of the SAML attribute. - */ - attribute_name: string; + /** + * Matches a specific Access Service Token + */ + export interface AccessServiceTokenRule { + service_token: AccessServiceTokenRule.ServiceToken; + } - /** - * The SAML attribute value to look for. - */ - attribute_value: string; - } + export namespace AccessServiceTokenRule { + export interface ServiceToken { + /** + * The ID of a Service Token. + */ + token_id: string; } + } + /** + * Matches any valid Access Service Token + */ + export interface AccessAnyValidServiceTokenRule { /** - * Matches a specific Access Service Token + * An empty object which matches on all service tokens. */ - export interface AccessServiceTokenRule { - service_token: AccessServiceTokenRule.ServiceToken; - } + any_valid_service_token: unknown; + } - export namespace AccessServiceTokenRule { - export interface ServiceToken { - /** - * The ID of a Service Token. - */ - token_id: string; - } - } + /** + * Create Allow or Block policies which evaluate the user based on custom criteria. + */ + export interface AccessExternalEvaluationRule { + external_evaluation: AccessExternalEvaluationRule.ExternalEvaluation; + } - /** - * Matches any valid Access Service Token - */ - export interface AccessAnyValidServiceTokenRule { + export namespace AccessExternalEvaluationRule { + export interface ExternalEvaluation { /** - * An empty object which matches on all service tokens. + * The API endpoint containing your business logic. */ - any_valid_service_token: unknown; - } + evaluate_url: string; - /** - * Create Allow or Block policies which evaluate the user based on custom criteria. - */ - export interface AccessExternalEvaluationRule { - external_evaluation: AccessExternalEvaluationRule.ExternalEvaluation; + /** + * The API endpoint containing the key that Access uses to verify that the response + * came from your API. + */ + keys_url: string; } + } - export namespace AccessExternalEvaluationRule { - export interface ExternalEvaluation { - /** - * The API endpoint containing your business logic. - */ - evaluate_url: string; + /** + * Matches a specific country + */ + export interface AccessCountryRule { + geo: AccessCountryRule.Geo; + } - /** - * The API endpoint containing the key that Access uses to verify that the response - * came from your API. - */ - keys_url: string; - } + export namespace AccessCountryRule { + export interface Geo { + /** + * The country code that should be matched. + */ + country_code: string; } + } - /** - * Matches a specific country - */ - export interface AccessCountryRule { - geo: AccessCountryRule.Geo; - } + /** + * Enforce different MFA options + */ + export interface AccessAuthenticationMethodRule { + auth_method: AccessAuthenticationMethodRule.AuthMethod; + } - export namespace AccessCountryRule { - export interface Geo { - /** - * The country code that should be matched. - */ - country_code: string; - } + export namespace AccessAuthenticationMethodRule { + export interface AuthMethod { + /** + * The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. + */ + auth_method: string; } + } - /** - * Enforce different MFA options - */ - export interface AccessAuthenticationMethodRule { - auth_method: AccessAuthenticationMethodRule.AuthMethod; - } + /** + * Enforces a device posture rule has run successfully + */ + export interface AccessDevicePostureRule { + device_posture: AccessDevicePostureRule.DevicePosture; + } - export namespace AccessAuthenticationMethodRule { - export interface AuthMethod { - /** - * The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. - */ - auth_method: string; - } + export namespace AccessDevicePostureRule { + export interface DevicePosture { + /** + * The ID of a device posture integration. + */ + integration_uid: string; } + } - /** - * Enforces a device posture rule has run successfully - */ - export interface AccessDevicePostureRule { - device_posture: AccessDevicePostureRule.DevicePosture; - } + /** + * Matches a specific email. + */ + export interface AccessEmailRule { + email: AccessEmailRule.Email; + } - export namespace AccessDevicePostureRule { - export interface DevicePosture { - /** - * The ID of a device posture integration. - */ - integration_uid: string; - } + export namespace AccessEmailRule { + export interface Email { + /** + * The email of the user. + */ + email: string; } + } - /** - * Matches a specific email. - */ - export interface AccessEmailRule { - email: AccessEmailRule.Email; - } + /** + * Matches an email address from a list. + */ + export interface AccessEmailListRule { + email_list: AccessEmailListRule.EmailList; + } - export namespace AccessEmailRule { - export interface Email { - /** - * The email of the user. - */ - email: string; - } + export namespace AccessEmailListRule { + export interface EmailList { + /** + * The ID of a previously created email list. + */ + id: string; } + } - /** - * Matches an email address from a list. - */ - export interface AccessEmailListRule { - email_list: AccessEmailListRule.EmailList; - } + /** + * Match an entire email domain. + */ + export interface AccessDomainRule { + email_domain: AccessDomainRule.EmailDomain; + } - export namespace AccessEmailListRule { - export interface EmailList { - /** - * The ID of a previously created email list. - */ - id: string; - } + export namespace AccessDomainRule { + export interface EmailDomain { + /** + * The email domain to match. + */ + domain: string; } + } + /** + * Matches everyone. + */ + export interface AccessEveryoneRule { /** - * Match an entire email domain. + * An empty object which matches on all users. */ - export interface AccessDomainRule { - email_domain: AccessDomainRule.EmailDomain; - } + everyone: unknown; + } - export namespace AccessDomainRule { - export interface EmailDomain { - /** - * The email domain to match. - */ - domain: string; - } - } + /** + * Matches an IP address block. + */ + export interface AccessIPRule { + ip: AccessIPRule.IP; + } - /** - * Matches everyone. - */ - export interface AccessEveryoneRule { + export namespace AccessIPRule { + export interface IP { /** - * An empty object which matches on all users. + * An IPv4 or IPv6 CIDR block. */ - everyone: unknown; + ip: string; } + } - /** - * Matches an IP address block. - */ - export interface AccessIPRule { - ip: AccessIPRule.IP; - } + /** + * Matches an IP address from a list. + */ + export interface AccessIPListRule { + ip_list: AccessIPListRule.IPList; + } - export namespace AccessIPRule { - export interface IP { - /** - * An IPv4 or IPv6 CIDR block. - */ - ip: string; - } + export namespace AccessIPListRule { + export interface IPList { + /** + * The ID of a previously created IP list. + */ + id: string; } + } - /** - * Matches an IP address from a list. - */ - export interface AccessIPListRule { - ip_list: AccessIPListRule.IPList; - } + /** + * Matches any valid client certificate. + */ + export interface AccessCertificateRule { + certificate: unknown; + } - export namespace AccessIPListRule { - export interface IPList { - /** - * The ID of a previously created IP list. - */ - id: string; - } - } + /** + * Matches an Access group. + */ + export interface AccessAccessGroupRule { + group: AccessAccessGroupRule.Group; + } - /** - * Matches any valid client certificate. - */ - export interface AccessCertificateRule { - certificate: unknown; + export namespace AccessAccessGroupRule { + export interface Group { + /** + * The ID of a previously created Access group. + */ + id: string; } + } - /** - * Matches an Access group. - */ - export interface AccessAccessGroupRule { - group: AccessAccessGroupRule.Group; - } + /** + * Matches an Azure group. Requires an Azure identity provider. + */ + export interface AccessAzureGroupRule { + azureAD: AccessAzureGroupRule.AzureAd; + } - export namespace AccessAccessGroupRule { - export interface Group { - /** - * The ID of a previously created Access group. - */ - id: string; - } - } + export namespace AccessAzureGroupRule { + export interface AzureAd { + /** + * The ID of an Azure group. + */ + id: string; - /** - * Matches an Azure group. Requires an Azure identity provider. - */ - export interface AccessAzureGroupRule { - azureAD: AccessAzureGroupRule.AzureAd; + /** + * The ID of your Azure identity provider. + */ + connection_id: string; } + } - export namespace AccessAzureGroupRule { - export interface AzureAd { - /** - * The ID of an Azure group. - */ - id: string; + /** + * Matches a Github organization. Requires a Github identity provider. + */ + export interface AccessGitHubOrganizationRule { + 'github-organization': AccessGitHubOrganizationRule.GitHubOrganization; + } - /** - * The ID of your Azure identity provider. - */ - connection_id: string; - } - } + export namespace AccessGitHubOrganizationRule { + export interface GitHubOrganization { + /** + * The ID of your Github identity provider. + */ + connection_id: string; - /** - * Matches a Github organization. Requires a Github identity provider. - */ - export interface AccessGitHubOrganizationRule { - 'github-organization': AccessGitHubOrganizationRule.GitHubOrganization; + /** + * The name of the organization. + */ + name: string; } + } - export namespace AccessGitHubOrganizationRule { - export interface GitHubOrganization { - /** - * The ID of your Github identity provider. - */ - connection_id: string; + /** + * Matches a group in Google Workspace. Requires a Google Workspace identity + * provider. + */ + export interface AccessGsuiteGroupRule { + gsuite: AccessGsuiteGroupRule.Gsuite; + } - /** - * The name of the organization. - */ - name: string; - } - } + export namespace AccessGsuiteGroupRule { + export interface Gsuite { + /** + * The ID of your Google Workspace identity provider. + */ + connection_id: string; - /** - * Matches a group in Google Workspace. Requires a Google Workspace identity - * provider. - */ - export interface AccessGsuiteGroupRule { - gsuite: AccessGsuiteGroupRule.Gsuite; + /** + * The email of the Google Workspace group. + */ + email: string; } + } - export namespace AccessGsuiteGroupRule { - export interface Gsuite { - /** - * The ID of your Google Workspace identity provider. - */ - connection_id: string; + /** + * Matches an Okta group. Requires an Okta identity provider. + */ + export interface AccessOktaGroupRule { + okta: AccessOktaGroupRule.Okta; + } - /** - * The email of the Google Workspace group. - */ - email: string; - } - } + export namespace AccessOktaGroupRule { + export interface Okta { + /** + * The ID of your Okta identity provider. + */ + connection_id: string; - /** - * Matches an Okta group. Requires an Okta identity provider. - */ - export interface AccessOktaGroupRule { - okta: AccessOktaGroupRule.Okta; + /** + * The email of the Okta group. + */ + email: string; } + } - export namespace AccessOktaGroupRule { - export interface Okta { - /** - * The ID of your Okta identity provider. - */ - connection_id: string; + /** + * Matches a SAML group. Requires a SAML identity provider. + */ + export interface AccessSamlGroupRule { + saml: AccessSamlGroupRule.Saml; + } - /** - * The email of the Okta group. - */ - email: string; - } - } + export namespace AccessSamlGroupRule { + export interface Saml { + /** + * The name of the SAML attribute. + */ + attribute_name: string; - /** - * Matches a SAML group. Requires a SAML identity provider. - */ - export interface AccessSamlGroupRule { - saml: AccessSamlGroupRule.Saml; + /** + * The SAML attribute value to look for. + */ + attribute_value: string; } + } - export namespace AccessSamlGroupRule { - export interface Saml { - /** - * The name of the SAML attribute. - */ - attribute_name: string; - - /** - * The SAML attribute value to look for. - */ - attribute_value: string; - } + /** + * Matches a specific Access Service Token + */ + export interface AccessServiceTokenRule { + service_token: AccessServiceTokenRule.ServiceToken; + } + + export namespace AccessServiceTokenRule { + export interface ServiceToken { + /** + * The ID of a Service Token. + */ + token_id: string; } + } + /** + * Matches any valid Access Service Token + */ + export interface AccessAnyValidServiceTokenRule { /** - * Matches a specific Access Service Token + * An empty object which matches on all service tokens. */ - export interface AccessServiceTokenRule { - service_token: AccessServiceTokenRule.ServiceToken; - } + any_valid_service_token: unknown; + } - export namespace AccessServiceTokenRule { - export interface ServiceToken { - /** - * The ID of a Service Token. - */ - token_id: string; - } - } + /** + * Create Allow or Block policies which evaluate the user based on custom criteria. + */ + export interface AccessExternalEvaluationRule { + external_evaluation: AccessExternalEvaluationRule.ExternalEvaluation; + } - /** - * Matches any valid Access Service Token - */ - export interface AccessAnyValidServiceTokenRule { + export namespace AccessExternalEvaluationRule { + export interface ExternalEvaluation { /** - * An empty object which matches on all service tokens. + * The API endpoint containing your business logic. */ - any_valid_service_token: unknown; - } + evaluate_url: string; - /** - * Create Allow or Block policies which evaluate the user based on custom criteria. - */ - export interface AccessExternalEvaluationRule { - external_evaluation: AccessExternalEvaluationRule.ExternalEvaluation; + /** + * The API endpoint containing the key that Access uses to verify that the response + * came from your API. + */ + keys_url: string; } + } - export namespace AccessExternalEvaluationRule { - export interface ExternalEvaluation { - /** - * The API endpoint containing your business logic. - */ - evaluate_url: string; + /** + * Matches a specific country + */ + export interface AccessCountryRule { + geo: AccessCountryRule.Geo; + } - /** - * The API endpoint containing the key that Access uses to verify that the response - * came from your API. - */ - keys_url: string; - } + export namespace AccessCountryRule { + export interface Geo { + /** + * The country code that should be matched. + */ + country_code: string; } + } - /** - * Matches a specific country - */ - export interface AccessCountryRule { - geo: AccessCountryRule.Geo; - } + /** + * Enforce different MFA options + */ + export interface AccessAuthenticationMethodRule { + auth_method: AccessAuthenticationMethodRule.AuthMethod; + } - export namespace AccessCountryRule { - export interface Geo { - /** - * The country code that should be matched. - */ - country_code: string; - } + export namespace AccessAuthenticationMethodRule { + export interface AuthMethod { + /** + * The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. + */ + auth_method: string; } + } - /** - * Enforce different MFA options - */ - export interface AccessAuthenticationMethodRule { - auth_method: AccessAuthenticationMethodRule.AuthMethod; - } + /** + * Enforces a device posture rule has run successfully + */ + export interface AccessDevicePostureRule { + device_posture: AccessDevicePostureRule.DevicePosture; + } - export namespace AccessAuthenticationMethodRule { - export interface AuthMethod { - /** - * The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. - */ - auth_method: string; - } + export namespace AccessDevicePostureRule { + export interface DevicePosture { + /** + * The ID of a device posture integration. + */ + integration_uid: string; } + } - /** - * Enforces a device posture rule has run successfully - */ - export interface AccessDevicePostureRule { - device_posture: AccessDevicePostureRule.DevicePosture; - } + /** + * Matches a specific email. + */ + export interface AccessEmailRule { + email: AccessEmailRule.Email; + } - export namespace AccessDevicePostureRule { - export interface DevicePosture { - /** - * The ID of a device posture integration. - */ - integration_uid: string; - } + export namespace AccessEmailRule { + export interface Email { + /** + * The email of the user. + */ + email: string; } + } - /** - * Matches a specific email. - */ - export interface AccessEmailRule { - email: AccessEmailRule.Email; - } + /** + * Matches an email address from a list. + */ + export interface AccessEmailListRule { + email_list: AccessEmailListRule.EmailList; + } - export namespace AccessEmailRule { - export interface Email { - /** - * The email of the user. - */ - email: string; - } + export namespace AccessEmailListRule { + export interface EmailList { + /** + * The ID of a previously created email list. + */ + id: string; } + } - /** - * Matches an email address from a list. - */ - export interface AccessEmailListRule { - email_list: AccessEmailListRule.EmailList; - } + /** + * Match an entire email domain. + */ + export interface AccessDomainRule { + email_domain: AccessDomainRule.EmailDomain; + } - export namespace AccessEmailListRule { - export interface EmailList { - /** - * The ID of a previously created email list. - */ - id: string; - } + export namespace AccessDomainRule { + export interface EmailDomain { + /** + * The email domain to match. + */ + domain: string; } + } + /** + * Matches everyone. + */ + export interface AccessEveryoneRule { /** - * Match an entire email domain. + * An empty object which matches on all users. */ - export interface AccessDomainRule { - email_domain: AccessDomainRule.EmailDomain; - } + everyone: unknown; + } - export namespace AccessDomainRule { - export interface EmailDomain { - /** - * The email domain to match. - */ - domain: string; - } - } + /** + * Matches an IP address block. + */ + export interface AccessIPRule { + ip: AccessIPRule.IP; + } - /** - * Matches everyone. - */ - export interface AccessEveryoneRule { + export namespace AccessIPRule { + export interface IP { /** - * An empty object which matches on all users. + * An IPv4 or IPv6 CIDR block. */ - everyone: unknown; + ip: string; } + } - /** - * Matches an IP address block. - */ - export interface AccessIPRule { - ip: AccessIPRule.IP; - } + /** + * Matches an IP address from a list. + */ + export interface AccessIPListRule { + ip_list: AccessIPListRule.IPList; + } - export namespace AccessIPRule { - export interface IP { - /** - * An IPv4 or IPv6 CIDR block. - */ - ip: string; - } + export namespace AccessIPListRule { + export interface IPList { + /** + * The ID of a previously created IP list. + */ + id: string; } + } - /** - * Matches an IP address from a list. - */ - export interface AccessIPListRule { - ip_list: AccessIPListRule.IPList; - } + /** + * Matches any valid client certificate. + */ + export interface AccessCertificateRule { + certificate: unknown; + } - export namespace AccessIPListRule { - export interface IPList { - /** - * The ID of a previously created IP list. - */ - id: string; - } - } + /** + * Matches an Access group. + */ + export interface AccessAccessGroupRule { + group: AccessAccessGroupRule.Group; + } - /** - * Matches any valid client certificate. - */ - export interface AccessCertificateRule { - certificate: unknown; + export namespace AccessAccessGroupRule { + export interface Group { + /** + * The ID of a previously created Access group. + */ + id: string; } + } - /** - * Matches an Access group. - */ - export interface AccessAccessGroupRule { - group: AccessAccessGroupRule.Group; - } + /** + * Matches an Azure group. Requires an Azure identity provider. + */ + export interface AccessAzureGroupRule { + azureAD: AccessAzureGroupRule.AzureAd; + } - export namespace AccessAccessGroupRule { - export interface Group { - /** - * The ID of a previously created Access group. - */ - id: string; - } - } + export namespace AccessAzureGroupRule { + export interface AzureAd { + /** + * The ID of an Azure group. + */ + id: string; - /** - * Matches an Azure group. Requires an Azure identity provider. - */ - export interface AccessAzureGroupRule { - azureAD: AccessAzureGroupRule.AzureAd; + /** + * The ID of your Azure identity provider. + */ + connection_id: string; } + } - export namespace AccessAzureGroupRule { - export interface AzureAd { - /** - * The ID of an Azure group. - */ - id: string; + /** + * Matches a Github organization. Requires a Github identity provider. + */ + export interface AccessGitHubOrganizationRule { + 'github-organization': AccessGitHubOrganizationRule.GitHubOrganization; + } - /** - * The ID of your Azure identity provider. - */ - connection_id: string; - } - } + export namespace AccessGitHubOrganizationRule { + export interface GitHubOrganization { + /** + * The ID of your Github identity provider. + */ + connection_id: string; - /** - * Matches a Github organization. Requires a Github identity provider. - */ - export interface AccessGitHubOrganizationRule { - 'github-organization': AccessGitHubOrganizationRule.GitHubOrganization; + /** + * The name of the organization. + */ + name: string; } + } - export namespace AccessGitHubOrganizationRule { - export interface GitHubOrganization { - /** - * The ID of your Github identity provider. - */ - connection_id: string; + /** + * Matches a group in Google Workspace. Requires a Google Workspace identity + * provider. + */ + export interface AccessGsuiteGroupRule { + gsuite: AccessGsuiteGroupRule.Gsuite; + } - /** - * The name of the organization. - */ - name: string; - } - } + export namespace AccessGsuiteGroupRule { + export interface Gsuite { + /** + * The ID of your Google Workspace identity provider. + */ + connection_id: string; - /** - * Matches a group in Google Workspace. Requires a Google Workspace identity - * provider. - */ - export interface AccessGsuiteGroupRule { - gsuite: AccessGsuiteGroupRule.Gsuite; + /** + * The email of the Google Workspace group. + */ + email: string; } + } - export namespace AccessGsuiteGroupRule { - export interface Gsuite { - /** - * The ID of your Google Workspace identity provider. - */ - connection_id: string; + /** + * Matches an Okta group. Requires an Okta identity provider. + */ + export interface AccessOktaGroupRule { + okta: AccessOktaGroupRule.Okta; + } - /** - * The email of the Google Workspace group. - */ - email: string; - } + export namespace AccessOktaGroupRule { + export interface Okta { + /** + * The ID of your Okta identity provider. + */ + connection_id: string; + + /** + * The email of the Okta group. + */ + email: string; } + } - /** - * Matches an Okta group. Requires an Okta identity provider. - */ - export interface AccessOktaGroupRule { - okta: AccessOktaGroupRule.Okta; + /** + * Matches a SAML group. Requires a SAML identity provider. + */ + export interface AccessSamlGroupRule { + saml: AccessSamlGroupRule.Saml; + } + + export namespace AccessSamlGroupRule { + export interface Saml { + /** + * The name of the SAML attribute. + */ + attribute_name: string; + + /** + * The SAML attribute value to look for. + */ + attribute_value: string; } + } - export namespace AccessOktaGroupRule { - export interface Okta { - /** - * The ID of your Okta identity provider. - */ - connection_id: string; + /** + * Matches a specific Access Service Token + */ + export interface AccessServiceTokenRule { + service_token: AccessServiceTokenRule.ServiceToken; + } - /** - * The email of the Okta group. - */ - email: string; - } + export namespace AccessServiceTokenRule { + export interface ServiceToken { + /** + * The ID of a Service Token. + */ + token_id: string; } + } + /** + * Matches any valid Access Service Token + */ + export interface AccessAnyValidServiceTokenRule { /** - * Matches a SAML group. Requires a SAML identity provider. + * An empty object which matches on all service tokens. */ - export interface AccessSamlGroupRule { - saml: AccessSamlGroupRule.Saml; - } - - export namespace AccessSamlGroupRule { - export interface Saml { - /** - * The name of the SAML attribute. - */ - attribute_name: string; - - /** - * The SAML attribute value to look for. - */ - attribute_value: string; - } - } - - /** - * Matches a specific Access Service Token - */ - export interface AccessServiceTokenRule { - service_token: AccessServiceTokenRule.ServiceToken; - } + any_valid_service_token: unknown; + } - export namespace AccessServiceTokenRule { - export interface ServiceToken { - /** - * The ID of a Service Token. - */ - token_id: string; - } - } + /** + * Create Allow or Block policies which evaluate the user based on custom criteria. + */ + export interface AccessExternalEvaluationRule { + external_evaluation: AccessExternalEvaluationRule.ExternalEvaluation; + } - /** - * Matches any valid Access Service Token - */ - export interface AccessAnyValidServiceTokenRule { + export namespace AccessExternalEvaluationRule { + export interface ExternalEvaluation { /** - * An empty object which matches on all service tokens. + * The API endpoint containing your business logic. */ - any_valid_service_token: unknown; - } + evaluate_url: string; - /** - * Create Allow or Block policies which evaluate the user based on custom criteria. - */ - export interface AccessExternalEvaluationRule { - external_evaluation: AccessExternalEvaluationRule.ExternalEvaluation; + /** + * The API endpoint containing the key that Access uses to verify that the response + * came from your API. + */ + keys_url: string; } + } - export namespace AccessExternalEvaluationRule { - export interface ExternalEvaluation { - /** - * The API endpoint containing your business logic. - */ - evaluate_url: string; + /** + * Matches a specific country + */ + export interface AccessCountryRule { + geo: AccessCountryRule.Geo; + } - /** - * The API endpoint containing the key that Access uses to verify that the response - * came from your API. - */ - keys_url: string; - } + export namespace AccessCountryRule { + export interface Geo { + /** + * The country code that should be matched. + */ + country_code: string; } + } - /** - * Matches a specific country - */ - export interface AccessCountryRule { - geo: AccessCountryRule.Geo; - } + /** + * Enforce different MFA options + */ + export interface AccessAuthenticationMethodRule { + auth_method: AccessAuthenticationMethodRule.AuthMethod; + } - export namespace AccessCountryRule { - export interface Geo { - /** - * The country code that should be matched. - */ - country_code: string; - } + export namespace AccessAuthenticationMethodRule { + export interface AuthMethod { + /** + * The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. + */ + auth_method: string; } + } - /** - * Enforce different MFA options - */ - export interface AccessAuthenticationMethodRule { - auth_method: AccessAuthenticationMethodRule.AuthMethod; - } + /** + * Enforces a device posture rule has run successfully + */ + export interface AccessDevicePostureRule { + device_posture: AccessDevicePostureRule.DevicePosture; + } - export namespace AccessAuthenticationMethodRule { - export interface AuthMethod { - /** - * The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. - */ - auth_method: string; - } + export namespace AccessDevicePostureRule { + export interface DevicePosture { + /** + * The ID of a device posture integration. + */ + integration_uid: string; } + } - /** - * Enforces a device posture rule has run successfully - */ - export interface AccessDevicePostureRule { - device_posture: AccessDevicePostureRule.DevicePosture; - } + /** + * Matches a specific email. + */ + export interface AccessEmailRule { + email: AccessEmailRule.Email; + } - export namespace AccessDevicePostureRule { - export interface DevicePosture { - /** - * The ID of a device posture integration. - */ - integration_uid: string; - } + export namespace AccessEmailRule { + export interface Email { + /** + * The email of the user. + */ + email: string; } + } - /** - * Matches a specific email. - */ - export interface AccessEmailRule { - email: AccessEmailRule.Email; - } + /** + * Matches an email address from a list. + */ + export interface AccessEmailListRule { + email_list: AccessEmailListRule.EmailList; + } - export namespace AccessEmailRule { - export interface Email { - /** - * The email of the user. - */ - email: string; - } + export namespace AccessEmailListRule { + export interface EmailList { + /** + * The ID of a previously created email list. + */ + id: string; } + } - /** - * Matches an email address from a list. - */ - export interface AccessEmailListRule { - email_list: AccessEmailListRule.EmailList; - } + /** + * Match an entire email domain. + */ + export interface AccessDomainRule { + email_domain: AccessDomainRule.EmailDomain; + } - export namespace AccessEmailListRule { - export interface EmailList { - /** - * The ID of a previously created email list. - */ - id: string; - } + export namespace AccessDomainRule { + export interface EmailDomain { + /** + * The email domain to match. + */ + domain: string; } + } + /** + * Matches everyone. + */ + export interface AccessEveryoneRule { /** - * Match an entire email domain. + * An empty object which matches on all users. */ - export interface AccessDomainRule { - email_domain: AccessDomainRule.EmailDomain; - } + everyone: unknown; + } - export namespace AccessDomainRule { - export interface EmailDomain { - /** - * The email domain to match. - */ - domain: string; - } - } + /** + * Matches an IP address block. + */ + export interface AccessIPRule { + ip: AccessIPRule.IP; + } - /** - * Matches everyone. - */ - export interface AccessEveryoneRule { + export namespace AccessIPRule { + export interface IP { /** - * An empty object which matches on all users. + * An IPv4 or IPv6 CIDR block. */ - everyone: unknown; + ip: string; } + } - /** - * Matches an IP address block. - */ - export interface AccessIPRule { - ip: AccessIPRule.IP; - } + /** + * Matches an IP address from a list. + */ + export interface AccessIPListRule { + ip_list: AccessIPListRule.IPList; + } - export namespace AccessIPRule { - export interface IP { - /** - * An IPv4 or IPv6 CIDR block. - */ - ip: string; - } + export namespace AccessIPListRule { + export interface IPList { + /** + * The ID of a previously created IP list. + */ + id: string; } + } - /** - * Matches an IP address from a list. - */ - export interface AccessIPListRule { - ip_list: AccessIPListRule.IPList; - } + /** + * Matches any valid client certificate. + */ + export interface AccessCertificateRule { + certificate: unknown; + } - export namespace AccessIPListRule { - export interface IPList { - /** - * The ID of a previously created IP list. - */ - id: string; - } - } + /** + * Matches an Access group. + */ + export interface AccessAccessGroupRule { + group: AccessAccessGroupRule.Group; + } - /** - * Matches any valid client certificate. - */ - export interface AccessCertificateRule { - certificate: unknown; + export namespace AccessAccessGroupRule { + export interface Group { + /** + * The ID of a previously created Access group. + */ + id: string; } + } - /** - * Matches an Access group. - */ - export interface AccessAccessGroupRule { - group: AccessAccessGroupRule.Group; - } + /** + * Matches an Azure group. Requires an Azure identity provider. + */ + export interface AccessAzureGroupRule { + azureAD: AccessAzureGroupRule.AzureAd; + } - export namespace AccessAccessGroupRule { - export interface Group { - /** - * The ID of a previously created Access group. - */ - id: string; - } - } + export namespace AccessAzureGroupRule { + export interface AzureAd { + /** + * The ID of an Azure group. + */ + id: string; - /** - * Matches an Azure group. Requires an Azure identity provider. - */ - export interface AccessAzureGroupRule { - azureAD: AccessAzureGroupRule.AzureAd; + /** + * The ID of your Azure identity provider. + */ + connection_id: string; } + } - export namespace AccessAzureGroupRule { - export interface AzureAd { - /** - * The ID of an Azure group. - */ - id: string; + /** + * Matches a Github organization. Requires a Github identity provider. + */ + export interface AccessGitHubOrganizationRule { + 'github-organization': AccessGitHubOrganizationRule.GitHubOrganization; + } - /** - * The ID of your Azure identity provider. - */ - connection_id: string; - } - } + export namespace AccessGitHubOrganizationRule { + export interface GitHubOrganization { + /** + * The ID of your Github identity provider. + */ + connection_id: string; - /** - * Matches a Github organization. Requires a Github identity provider. - */ - export interface AccessGitHubOrganizationRule { - 'github-organization': AccessGitHubOrganizationRule.GitHubOrganization; + /** + * The name of the organization. + */ + name: string; } + } - export namespace AccessGitHubOrganizationRule { - export interface GitHubOrganization { - /** - * The ID of your Github identity provider. - */ - connection_id: string; + /** + * Matches a group in Google Workspace. Requires a Google Workspace identity + * provider. + */ + export interface AccessGsuiteGroupRule { + gsuite: AccessGsuiteGroupRule.Gsuite; + } - /** - * The name of the organization. - */ - name: string; - } - } + export namespace AccessGsuiteGroupRule { + export interface Gsuite { + /** + * The ID of your Google Workspace identity provider. + */ + connection_id: string; - /** - * Matches a group in Google Workspace. Requires a Google Workspace identity - * provider. - */ - export interface AccessGsuiteGroupRule { - gsuite: AccessGsuiteGroupRule.Gsuite; + /** + * The email of the Google Workspace group. + */ + email: string; } + } - export namespace AccessGsuiteGroupRule { - export interface Gsuite { - /** - * The ID of your Google Workspace identity provider. - */ - connection_id: string; + /** + * Matches an Okta group. Requires an Okta identity provider. + */ + export interface AccessOktaGroupRule { + okta: AccessOktaGroupRule.Okta; + } - /** - * The email of the Google Workspace group. - */ - email: string; - } + export namespace AccessOktaGroupRule { + export interface Okta { + /** + * The ID of your Okta identity provider. + */ + connection_id: string; + + /** + * The email of the Okta group. + */ + email: string; } + } - /** - * Matches an Okta group. Requires an Okta identity provider. - */ - export interface AccessOktaGroupRule { - okta: AccessOktaGroupRule.Okta; + /** + * Matches a SAML group. Requires a SAML identity provider. + */ + export interface AccessSamlGroupRule { + saml: AccessSamlGroupRule.Saml; + } + + export namespace AccessSamlGroupRule { + export interface Saml { + /** + * The name of the SAML attribute. + */ + attribute_name: string; + + /** + * The SAML attribute value to look for. + */ + attribute_value: string; } + } - export namespace AccessOktaGroupRule { - export interface Okta { - /** - * The ID of your Okta identity provider. - */ - connection_id: string; + /** + * Matches a specific Access Service Token + */ + export interface AccessServiceTokenRule { + service_token: AccessServiceTokenRule.ServiceToken; + } - /** - * The email of the Okta group. - */ - email: string; - } + export namespace AccessServiceTokenRule { + export interface ServiceToken { + /** + * The ID of a Service Token. + */ + token_id: string; } + } + /** + * Matches any valid Access Service Token + */ + export interface AccessAnyValidServiceTokenRule { /** - * Matches a SAML group. Requires a SAML identity provider. + * An empty object which matches on all service tokens. */ - export interface AccessSamlGroupRule { - saml: AccessSamlGroupRule.Saml; - } + any_valid_service_token: unknown; + } - export namespace AccessSamlGroupRule { - export interface Saml { - /** - * The name of the SAML attribute. - */ - attribute_name: string; + /** + * Create Allow or Block policies which evaluate the user based on custom criteria. + */ + export interface AccessExternalEvaluationRule { + external_evaluation: AccessExternalEvaluationRule.ExternalEvaluation; + } - /** - * The SAML attribute value to look for. - */ - attribute_value: string; - } + export namespace AccessExternalEvaluationRule { + export interface ExternalEvaluation { + /** + * The API endpoint containing your business logic. + */ + evaluate_url: string; + + /** + * The API endpoint containing the key that Access uses to verify that the response + * came from your API. + */ + keys_url: string; } + } - /** - * Matches a specific Access Service Token - */ - export interface AccessServiceTokenRule { - service_token: AccessServiceTokenRule.ServiceToken; + /** + * Matches a specific country + */ + export interface AccessCountryRule { + geo: AccessCountryRule.Geo; + } + + export namespace AccessCountryRule { + export interface Geo { + /** + * The country code that should be matched. + */ + country_code: string; } + } - export namespace AccessServiceTokenRule { - export interface ServiceToken { - /** - * The ID of a Service Token. - */ - token_id: string; - } + /** + * Enforce different MFA options + */ + export interface AccessAuthenticationMethodRule { + auth_method: AccessAuthenticationMethodRule.AuthMethod; + } + + export namespace AccessAuthenticationMethodRule { + export interface AuthMethod { + /** + * The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. + */ + auth_method: string; } + } - /** - * Matches any valid Access Service Token - */ - export interface AccessAnyValidServiceTokenRule { + /** + * Enforces a device posture rule has run successfully + */ + export interface AccessDevicePostureRule { + device_posture: AccessDevicePostureRule.DevicePosture; + } + + export namespace AccessDevicePostureRule { + export interface DevicePosture { /** - * An empty object which matches on all service tokens. + * The ID of a device posture integration. */ - any_valid_service_token: unknown; + integration_uid: string; } + } +} + +export type GroupListResponse = Array; +export namespace GroupListResponse { + export interface GroupListResponseItem { /** - * Create Allow or Block policies which evaluate the user based on custom criteria. + * UUID */ - export interface AccessExternalEvaluationRule { - external_evaluation: AccessExternalEvaluationRule.ExternalEvaluation; - } + id?: string; - export namespace AccessExternalEvaluationRule { - export interface ExternalEvaluation { - /** - * The API endpoint containing your business logic. - */ - evaluate_url: string; + created_at?: string; - /** - * The API endpoint containing the key that Access uses to verify that the response - * came from your API. - */ - keys_url: string; - } - } + /** + * Rules evaluated with a NOT logical operator. To match a policy, a user cannot + * meet any of the Exclude rules. + */ + exclude?: Array< + | GroupListResponseItem.AccessEmailRule + | GroupListResponseItem.AccessEmailListRule + | GroupListResponseItem.AccessDomainRule + | GroupListResponseItem.AccessEveryoneRule + | GroupListResponseItem.AccessIPRule + | GroupListResponseItem.AccessIPListRule + | GroupListResponseItem.AccessCertificateRule + | GroupListResponseItem.AccessAccessGroupRule + | GroupListResponseItem.AccessAzureGroupRule + | GroupListResponseItem.AccessGitHubOrganizationRule + | GroupListResponseItem.AccessGsuiteGroupRule + | GroupListResponseItem.AccessOktaGroupRule + | GroupListResponseItem.AccessSamlGroupRule + | GroupListResponseItem.AccessServiceTokenRule + | GroupListResponseItem.AccessAnyValidServiceTokenRule + | GroupListResponseItem.AccessExternalEvaluationRule + | GroupListResponseItem.AccessCountryRule + | GroupListResponseItem.AccessAuthenticationMethodRule + | GroupListResponseItem.AccessDevicePostureRule + >; /** - * Matches a specific country + * Rules evaluated with an OR logical operator. A user needs to meet only one of + * the Include rules. */ - export interface AccessCountryRule { - geo: AccessCountryRule.Geo; - } + include?: Array< + | GroupListResponseItem.AccessEmailRule + | GroupListResponseItem.AccessEmailListRule + | GroupListResponseItem.AccessDomainRule + | GroupListResponseItem.AccessEveryoneRule + | GroupListResponseItem.AccessIPRule + | GroupListResponseItem.AccessIPListRule + | GroupListResponseItem.AccessCertificateRule + | GroupListResponseItem.AccessAccessGroupRule + | GroupListResponseItem.AccessAzureGroupRule + | GroupListResponseItem.AccessGitHubOrganizationRule + | GroupListResponseItem.AccessGsuiteGroupRule + | GroupListResponseItem.AccessOktaGroupRule + | GroupListResponseItem.AccessSamlGroupRule + | GroupListResponseItem.AccessServiceTokenRule + | GroupListResponseItem.AccessAnyValidServiceTokenRule + | GroupListResponseItem.AccessExternalEvaluationRule + | GroupListResponseItem.AccessCountryRule + | GroupListResponseItem.AccessAuthenticationMethodRule + | GroupListResponseItem.AccessDevicePostureRule + >; - export namespace AccessCountryRule { - export interface Geo { - /** - * The country code that should be matched. - */ - country_code: string; - } - } + /** + * Rules evaluated with an AND logical operator. To match a policy, a user must + * meet all of the Require rules. + */ + is_default?: Array< + | GroupListResponseItem.AccessEmailRule + | GroupListResponseItem.AccessEmailListRule + | GroupListResponseItem.AccessDomainRule + | GroupListResponseItem.AccessEveryoneRule + | GroupListResponseItem.AccessIPRule + | GroupListResponseItem.AccessIPListRule + | GroupListResponseItem.AccessCertificateRule + | GroupListResponseItem.AccessAccessGroupRule + | GroupListResponseItem.AccessAzureGroupRule + | GroupListResponseItem.AccessGitHubOrganizationRule + | GroupListResponseItem.AccessGsuiteGroupRule + | GroupListResponseItem.AccessOktaGroupRule + | GroupListResponseItem.AccessSamlGroupRule + | GroupListResponseItem.AccessServiceTokenRule + | GroupListResponseItem.AccessAnyValidServiceTokenRule + | GroupListResponseItem.AccessExternalEvaluationRule + | GroupListResponseItem.AccessCountryRule + | GroupListResponseItem.AccessAuthenticationMethodRule + | GroupListResponseItem.AccessDevicePostureRule + >; /** - * Enforce different MFA options + * The name of the Access group. */ - export interface AccessAuthenticationMethodRule { - auth_method: AccessAuthenticationMethodRule.AuthMethod; - } + name?: string; - export namespace AccessAuthenticationMethodRule { - export interface AuthMethod { - /** - * The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. - */ - auth_method: string; - } - } + /** + * Rules evaluated with an AND logical operator. To match a policy, a user must + * meet all of the Require rules. + */ + require?: Array< + | GroupListResponseItem.AccessEmailRule + | GroupListResponseItem.AccessEmailListRule + | GroupListResponseItem.AccessDomainRule + | GroupListResponseItem.AccessEveryoneRule + | GroupListResponseItem.AccessIPRule + | GroupListResponseItem.AccessIPListRule + | GroupListResponseItem.AccessCertificateRule + | GroupListResponseItem.AccessAccessGroupRule + | GroupListResponseItem.AccessAzureGroupRule + | GroupListResponseItem.AccessGitHubOrganizationRule + | GroupListResponseItem.AccessGsuiteGroupRule + | GroupListResponseItem.AccessOktaGroupRule + | GroupListResponseItem.AccessSamlGroupRule + | GroupListResponseItem.AccessServiceTokenRule + | GroupListResponseItem.AccessAnyValidServiceTokenRule + | GroupListResponseItem.AccessExternalEvaluationRule + | GroupListResponseItem.AccessCountryRule + | GroupListResponseItem.AccessAuthenticationMethodRule + | GroupListResponseItem.AccessDevicePostureRule + >; + updated_at?: string; + } + + export namespace GroupListResponseItem { /** - * Enforces a device posture rule has run successfully + * Matches a specific email. */ - export interface AccessDevicePostureRule { - device_posture: AccessDevicePostureRule.DevicePosture; + export interface AccessEmailRule { + email: AccessEmailRule.Email; } - export namespace AccessDevicePostureRule { - export interface DevicePosture { + export namespace AccessEmailRule { + export interface Email { /** - * The ID of a device posture integration. + * The email of the user. */ - integration_uid: string; + email: string; } } - } -} -export interface GroupDeleteResponse { - /** - * UUID - */ - id?: string; -} - -export interface GroupGetResponse { - /** - * UUID - */ - id?: string; - - created_at?: string; - - /** - * Rules evaluated with a NOT logical operator. To match a policy, a user cannot - * meet any of the Exclude rules. - */ - exclude?: Array< - | GroupGetResponse.AccessEmailRule - | GroupGetResponse.AccessEmailListRule - | GroupGetResponse.AccessDomainRule - | GroupGetResponse.AccessEveryoneRule - | GroupGetResponse.AccessIPRule - | GroupGetResponse.AccessIPListRule - | GroupGetResponse.AccessCertificateRule - | GroupGetResponse.AccessAccessGroupRule - | GroupGetResponse.AccessAzureGroupRule - | GroupGetResponse.AccessGitHubOrganizationRule - | GroupGetResponse.AccessGsuiteGroupRule - | GroupGetResponse.AccessOktaGroupRule - | GroupGetResponse.AccessSamlGroupRule - | GroupGetResponse.AccessServiceTokenRule - | GroupGetResponse.AccessAnyValidServiceTokenRule - | GroupGetResponse.AccessExternalEvaluationRule - | GroupGetResponse.AccessCountryRule - | GroupGetResponse.AccessAuthenticationMethodRule - | GroupGetResponse.AccessDevicePostureRule - >; - - /** - * Rules evaluated with an OR logical operator. A user needs to meet only one of - * the Include rules. - */ - include?: Array< - | GroupGetResponse.AccessEmailRule - | GroupGetResponse.AccessEmailListRule - | GroupGetResponse.AccessDomainRule - | GroupGetResponse.AccessEveryoneRule - | GroupGetResponse.AccessIPRule - | GroupGetResponse.AccessIPListRule - | GroupGetResponse.AccessCertificateRule - | GroupGetResponse.AccessAccessGroupRule - | GroupGetResponse.AccessAzureGroupRule - | GroupGetResponse.AccessGitHubOrganizationRule - | GroupGetResponse.AccessGsuiteGroupRule - | GroupGetResponse.AccessOktaGroupRule - | GroupGetResponse.AccessSamlGroupRule - | GroupGetResponse.AccessServiceTokenRule - | GroupGetResponse.AccessAnyValidServiceTokenRule - | GroupGetResponse.AccessExternalEvaluationRule - | GroupGetResponse.AccessCountryRule - | GroupGetResponse.AccessAuthenticationMethodRule - | GroupGetResponse.AccessDevicePostureRule - >; - - /** - * Rules evaluated with an AND logical operator. To match a policy, a user must - * meet all of the Require rules. - */ - is_default?: Array< - | GroupGetResponse.AccessEmailRule - | GroupGetResponse.AccessEmailListRule - | GroupGetResponse.AccessDomainRule - | GroupGetResponse.AccessEveryoneRule - | GroupGetResponse.AccessIPRule - | GroupGetResponse.AccessIPListRule - | GroupGetResponse.AccessCertificateRule - | GroupGetResponse.AccessAccessGroupRule - | GroupGetResponse.AccessAzureGroupRule - | GroupGetResponse.AccessGitHubOrganizationRule - | GroupGetResponse.AccessGsuiteGroupRule - | GroupGetResponse.AccessOktaGroupRule - | GroupGetResponse.AccessSamlGroupRule - | GroupGetResponse.AccessServiceTokenRule - | GroupGetResponse.AccessAnyValidServiceTokenRule - | GroupGetResponse.AccessExternalEvaluationRule - | GroupGetResponse.AccessCountryRule - | GroupGetResponse.AccessAuthenticationMethodRule - | GroupGetResponse.AccessDevicePostureRule - >; - - /** - * The name of the Access group. - */ - name?: string; - - /** - * Rules evaluated with an AND logical operator. To match a policy, a user must - * meet all of the Require rules. - */ - require?: Array< - | GroupGetResponse.AccessEmailRule - | GroupGetResponse.AccessEmailListRule - | GroupGetResponse.AccessDomainRule - | GroupGetResponse.AccessEveryoneRule - | GroupGetResponse.AccessIPRule - | GroupGetResponse.AccessIPListRule - | GroupGetResponse.AccessCertificateRule - | GroupGetResponse.AccessAccessGroupRule - | GroupGetResponse.AccessAzureGroupRule - | GroupGetResponse.AccessGitHubOrganizationRule - | GroupGetResponse.AccessGsuiteGroupRule - | GroupGetResponse.AccessOktaGroupRule - | GroupGetResponse.AccessSamlGroupRule - | GroupGetResponse.AccessServiceTokenRule - | GroupGetResponse.AccessAnyValidServiceTokenRule - | GroupGetResponse.AccessExternalEvaluationRule - | GroupGetResponse.AccessCountryRule - | GroupGetResponse.AccessAuthenticationMethodRule - | GroupGetResponse.AccessDevicePostureRule - >; - - updated_at?: string; -} - -export namespace GroupGetResponse { - /** - * Matches a specific email. - */ - export interface AccessEmailRule { - email: AccessEmailRule.Email; - } - - export namespace AccessEmailRule { - export interface Email { - /** - * The email of the user. - */ - email: string; + /** + * Matches an email address from a list. + */ + export interface AccessEmailListRule { + email_list: AccessEmailListRule.EmailList; } - } - /** - * Matches an email address from a list. - */ - export interface AccessEmailListRule { - email_list: AccessEmailListRule.EmailList; - } + export namespace AccessEmailListRule { + export interface EmailList { + /** + * The ID of a previously created email list. + */ + id: string; + } + } - export namespace AccessEmailListRule { - export interface EmailList { - /** - * The ID of a previously created email list. - */ - id: string; + /** + * Match an entire email domain. + */ + export interface AccessDomainRule { + email_domain: AccessDomainRule.EmailDomain; } - } - /** - * Match an entire email domain. - */ - export interface AccessDomainRule { - email_domain: AccessDomainRule.EmailDomain; - } + export namespace AccessDomainRule { + export interface EmailDomain { + /** + * The email domain to match. + */ + domain: string; + } + } - export namespace AccessDomainRule { - export interface EmailDomain { + /** + * Matches everyone. + */ + export interface AccessEveryoneRule { /** - * The email domain to match. + * An empty object which matches on all users. */ - domain: string; + everyone: unknown; } - } - /** - * Matches everyone. - */ - export interface AccessEveryoneRule { /** - * An empty object which matches on all users. + * Matches an IP address block. */ - everyone: unknown; - } + export interface AccessIPRule { + ip: AccessIPRule.IP; + } - /** - * Matches an IP address block. - */ - export interface AccessIPRule { - ip: AccessIPRule.IP; - } + export namespace AccessIPRule { + export interface IP { + /** + * An IPv4 or IPv6 CIDR block. + */ + ip: string; + } + } - export namespace AccessIPRule { - export interface IP { - /** - * An IPv4 or IPv6 CIDR block. - */ - ip: string; + /** + * Matches an IP address from a list. + */ + export interface AccessIPListRule { + ip_list: AccessIPListRule.IPList; } - } - /** - * Matches an IP address from a list. - */ - export interface AccessIPListRule { - ip_list: AccessIPListRule.IPList; - } + export namespace AccessIPListRule { + export interface IPList { + /** + * The ID of a previously created IP list. + */ + id: string; + } + } - export namespace AccessIPListRule { - export interface IPList { - /** - * The ID of a previously created IP list. - */ - id: string; + /** + * Matches any valid client certificate. + */ + export interface AccessCertificateRule { + certificate: unknown; } - } - /** - * Matches any valid client certificate. - */ - export interface AccessCertificateRule { - certificate: unknown; - } + /** + * Matches an Access group. + */ + export interface AccessAccessGroupRule { + group: AccessAccessGroupRule.Group; + } - /** - * Matches an Access group. - */ - export interface AccessAccessGroupRule { - group: AccessAccessGroupRule.Group; - } + export namespace AccessAccessGroupRule { + export interface Group { + /** + * The ID of a previously created Access group. + */ + id: string; + } + } - export namespace AccessAccessGroupRule { - export interface Group { - /** - * The ID of a previously created Access group. - */ - id: string; + /** + * Matches an Azure group. Requires an Azure identity provider. + */ + export interface AccessAzureGroupRule { + azureAD: AccessAzureGroupRule.AzureAd; } - } - /** - * Matches an Azure group. Requires an Azure identity provider. - */ - export interface AccessAzureGroupRule { - azureAD: AccessAzureGroupRule.AzureAd; - } + export namespace AccessAzureGroupRule { + export interface AzureAd { + /** + * The ID of an Azure group. + */ + id: string; - export namespace AccessAzureGroupRule { - export interface AzureAd { - /** - * The ID of an Azure group. - */ - id: string; + /** + * The ID of your Azure identity provider. + */ + connection_id: string; + } + } - /** - * The ID of your Azure identity provider. - */ - connection_id: string; + /** + * Matches a Github organization. Requires a Github identity provider. + */ + export interface AccessGitHubOrganizationRule { + 'github-organization': AccessGitHubOrganizationRule.GitHubOrganization; } - } - /** - * Matches a Github organization. Requires a Github identity provider. - */ - export interface AccessGitHubOrganizationRule { - 'github-organization': AccessGitHubOrganizationRule.GitHubOrganization; - } + export namespace AccessGitHubOrganizationRule { + export interface GitHubOrganization { + /** + * The ID of your Github identity provider. + */ + connection_id: string; - export namespace AccessGitHubOrganizationRule { - export interface GitHubOrganization { - /** - * The ID of your Github identity provider. - */ - connection_id: string; + /** + * The name of the organization. + */ + name: string; + } + } - /** - * The name of the organization. - */ - name: string; + /** + * Matches a group in Google Workspace. Requires a Google Workspace identity + * provider. + */ + export interface AccessGsuiteGroupRule { + gsuite: AccessGsuiteGroupRule.Gsuite; } - } - /** - * Matches a group in Google Workspace. Requires a Google Workspace identity - * provider. - */ - export interface AccessGsuiteGroupRule { - gsuite: AccessGsuiteGroupRule.Gsuite; - } + export namespace AccessGsuiteGroupRule { + export interface Gsuite { + /** + * The ID of your Google Workspace identity provider. + */ + connection_id: string; - export namespace AccessGsuiteGroupRule { - export interface Gsuite { - /** - * The ID of your Google Workspace identity provider. - */ - connection_id: string; + /** + * The email of the Google Workspace group. + */ + email: string; + } + } - /** - * The email of the Google Workspace group. - */ - email: string; + /** + * Matches an Okta group. Requires an Okta identity provider. + */ + export interface AccessOktaGroupRule { + okta: AccessOktaGroupRule.Okta; } - } - /** - * Matches an Okta group. Requires an Okta identity provider. - */ - export interface AccessOktaGroupRule { - okta: AccessOktaGroupRule.Okta; - } + export namespace AccessOktaGroupRule { + export interface Okta { + /** + * The ID of your Okta identity provider. + */ + connection_id: string; - export namespace AccessOktaGroupRule { - export interface Okta { - /** - * The ID of your Okta identity provider. - */ - connection_id: string; + /** + * The email of the Okta group. + */ + email: string; + } + } - /** - * The email of the Okta group. - */ - email: string; + /** + * Matches a SAML group. Requires a SAML identity provider. + */ + export interface AccessSamlGroupRule { + saml: AccessSamlGroupRule.Saml; } - } - /** - * Matches a SAML group. Requires a SAML identity provider. - */ - export interface AccessSamlGroupRule { - saml: AccessSamlGroupRule.Saml; - } + export namespace AccessSamlGroupRule { + export interface Saml { + /** + * The name of the SAML attribute. + */ + attribute_name: string; - export namespace AccessSamlGroupRule { - export interface Saml { - /** - * The name of the SAML attribute. - */ - attribute_name: string; + /** + * The SAML attribute value to look for. + */ + attribute_value: string; + } + } - /** - * The SAML attribute value to look for. - */ - attribute_value: string; + /** + * Matches a specific Access Service Token + */ + export interface AccessServiceTokenRule { + service_token: AccessServiceTokenRule.ServiceToken; } - } - /** - * Matches a specific Access Service Token - */ - export interface AccessServiceTokenRule { - service_token: AccessServiceTokenRule.ServiceToken; - } + export namespace AccessServiceTokenRule { + export interface ServiceToken { + /** + * The ID of a Service Token. + */ + token_id: string; + } + } - export namespace AccessServiceTokenRule { - export interface ServiceToken { + /** + * Matches any valid Access Service Token + */ + export interface AccessAnyValidServiceTokenRule { /** - * The ID of a Service Token. + * An empty object which matches on all service tokens. */ - token_id: string; + any_valid_service_token: unknown; } - } - /** - * Matches any valid Access Service Token - */ - export interface AccessAnyValidServiceTokenRule { /** - * An empty object which matches on all service tokens. + * Create Allow or Block policies which evaluate the user based on custom criteria. */ - any_valid_service_token: unknown; - } + export interface AccessExternalEvaluationRule { + external_evaluation: AccessExternalEvaluationRule.ExternalEvaluation; + } - /** - * Create Allow or Block policies which evaluate the user based on custom criteria. - */ - export interface AccessExternalEvaluationRule { - external_evaluation: AccessExternalEvaluationRule.ExternalEvaluation; - } + export namespace AccessExternalEvaluationRule { + export interface ExternalEvaluation { + /** + * The API endpoint containing your business logic. + */ + evaluate_url: string; - export namespace AccessExternalEvaluationRule { - export interface ExternalEvaluation { - /** - * The API endpoint containing your business logic. - */ - evaluate_url: string; + /** + * The API endpoint containing the key that Access uses to verify that the response + * came from your API. + */ + keys_url: string; + } + } - /** - * The API endpoint containing the key that Access uses to verify that the response - * came from your API. - */ - keys_url: string; + /** + * Matches a specific country + */ + export interface AccessCountryRule { + geo: AccessCountryRule.Geo; } - } - /** - * Matches a specific country - */ - export interface AccessCountryRule { - geo: AccessCountryRule.Geo; - } + export namespace AccessCountryRule { + export interface Geo { + /** + * The country code that should be matched. + */ + country_code: string; + } + } - export namespace AccessCountryRule { - export interface Geo { - /** - * The country code that should be matched. - */ - country_code: string; + /** + * Enforce different MFA options + */ + export interface AccessAuthenticationMethodRule { + auth_method: AccessAuthenticationMethodRule.AuthMethod; } - } - /** - * Enforce different MFA options - */ - export interface AccessAuthenticationMethodRule { - auth_method: AccessAuthenticationMethodRule.AuthMethod; - } + export namespace AccessAuthenticationMethodRule { + export interface AuthMethod { + /** + * The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. + */ + auth_method: string; + } + } - export namespace AccessAuthenticationMethodRule { - export interface AuthMethod { - /** - * The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. - */ - auth_method: string; + /** + * Enforces a device posture rule has run successfully + */ + export interface AccessDevicePostureRule { + device_posture: AccessDevicePostureRule.DevicePosture; } - } - /** - * Enforces a device posture rule has run successfully - */ - export interface AccessDevicePostureRule { - device_posture: AccessDevicePostureRule.DevicePosture; - } + export namespace AccessDevicePostureRule { + export interface DevicePosture { + /** + * The ID of a device posture integration. + */ + integration_uid: string; + } + } - export namespace AccessDevicePostureRule { - export interface DevicePosture { - /** - * The ID of a device posture integration. - */ - integration_uid: string; + /** + * Matches a specific email. + */ + export interface AccessEmailRule { + email: AccessEmailRule.Email; } - } - /** - * Matches a specific email. - */ - export interface AccessEmailRule { - email: AccessEmailRule.Email; - } + export namespace AccessEmailRule { + export interface Email { + /** + * The email of the user. + */ + email: string; + } + } - export namespace AccessEmailRule { - export interface Email { - /** - * The email of the user. - */ - email: string; + /** + * Matches an email address from a list. + */ + export interface AccessEmailListRule { + email_list: AccessEmailListRule.EmailList; } - } - /** - * Matches an email address from a list. - */ - export interface AccessEmailListRule { - email_list: AccessEmailListRule.EmailList; - } + export namespace AccessEmailListRule { + export interface EmailList { + /** + * The ID of a previously created email list. + */ + id: string; + } + } - export namespace AccessEmailListRule { - export interface EmailList { - /** - * The ID of a previously created email list. - */ - id: string; + /** + * Match an entire email domain. + */ + export interface AccessDomainRule { + email_domain: AccessDomainRule.EmailDomain; } - } - /** - * Match an entire email domain. - */ - export interface AccessDomainRule { - email_domain: AccessDomainRule.EmailDomain; - } + export namespace AccessDomainRule { + export interface EmailDomain { + /** + * The email domain to match. + */ + domain: string; + } + } - export namespace AccessDomainRule { - export interface EmailDomain { + /** + * Matches everyone. + */ + export interface AccessEveryoneRule { /** - * The email domain to match. + * An empty object which matches on all users. */ - domain: string; + everyone: unknown; } - } - /** - * Matches everyone. - */ - export interface AccessEveryoneRule { /** - * An empty object which matches on all users. + * Matches an IP address block. */ - everyone: unknown; - } + export interface AccessIPRule { + ip: AccessIPRule.IP; + } - /** - * Matches an IP address block. - */ - export interface AccessIPRule { - ip: AccessIPRule.IP; - } + export namespace AccessIPRule { + export interface IP { + /** + * An IPv4 or IPv6 CIDR block. + */ + ip: string; + } + } - export namespace AccessIPRule { - export interface IP { - /** - * An IPv4 or IPv6 CIDR block. - */ - ip: string; + /** + * Matches an IP address from a list. + */ + export interface AccessIPListRule { + ip_list: AccessIPListRule.IPList; } - } - /** - * Matches an IP address from a list. - */ - export interface AccessIPListRule { - ip_list: AccessIPListRule.IPList; - } + export namespace AccessIPListRule { + export interface IPList { + /** + * The ID of a previously created IP list. + */ + id: string; + } + } - export namespace AccessIPListRule { - export interface IPList { - /** - * The ID of a previously created IP list. - */ - id: string; + /** + * Matches any valid client certificate. + */ + export interface AccessCertificateRule { + certificate: unknown; } - } - /** - * Matches any valid client certificate. - */ - export interface AccessCertificateRule { - certificate: unknown; - } + /** + * Matches an Access group. + */ + export interface AccessAccessGroupRule { + group: AccessAccessGroupRule.Group; + } - /** - * Matches an Access group. - */ - export interface AccessAccessGroupRule { - group: AccessAccessGroupRule.Group; - } + export namespace AccessAccessGroupRule { + export interface Group { + /** + * The ID of a previously created Access group. + */ + id: string; + } + } - export namespace AccessAccessGroupRule { - export interface Group { - /** - * The ID of a previously created Access group. - */ - id: string; + /** + * Matches an Azure group. Requires an Azure identity provider. + */ + export interface AccessAzureGroupRule { + azureAD: AccessAzureGroupRule.AzureAd; } - } - /** - * Matches an Azure group. Requires an Azure identity provider. - */ - export interface AccessAzureGroupRule { - azureAD: AccessAzureGroupRule.AzureAd; - } + export namespace AccessAzureGroupRule { + export interface AzureAd { + /** + * The ID of an Azure group. + */ + id: string; - export namespace AccessAzureGroupRule { - export interface AzureAd { - /** - * The ID of an Azure group. - */ - id: string; + /** + * The ID of your Azure identity provider. + */ + connection_id: string; + } + } - /** - * The ID of your Azure identity provider. - */ - connection_id: string; + /** + * Matches a Github organization. Requires a Github identity provider. + */ + export interface AccessGitHubOrganizationRule { + 'github-organization': AccessGitHubOrganizationRule.GitHubOrganization; } - } - /** - * Matches a Github organization. Requires a Github identity provider. - */ - export interface AccessGitHubOrganizationRule { - 'github-organization': AccessGitHubOrganizationRule.GitHubOrganization; - } + export namespace AccessGitHubOrganizationRule { + export interface GitHubOrganization { + /** + * The ID of your Github identity provider. + */ + connection_id: string; - export namespace AccessGitHubOrganizationRule { - export interface GitHubOrganization { - /** - * The ID of your Github identity provider. - */ - connection_id: string; + /** + * The name of the organization. + */ + name: string; + } + } - /** - * The name of the organization. - */ - name: string; + /** + * Matches a group in Google Workspace. Requires a Google Workspace identity + * provider. + */ + export interface AccessGsuiteGroupRule { + gsuite: AccessGsuiteGroupRule.Gsuite; } - } - /** - * Matches a group in Google Workspace. Requires a Google Workspace identity - * provider. - */ - export interface AccessGsuiteGroupRule { - gsuite: AccessGsuiteGroupRule.Gsuite; - } + export namespace AccessGsuiteGroupRule { + export interface Gsuite { + /** + * The ID of your Google Workspace identity provider. + */ + connection_id: string; - export namespace AccessGsuiteGroupRule { - export interface Gsuite { - /** - * The ID of your Google Workspace identity provider. - */ - connection_id: string; + /** + * The email of the Google Workspace group. + */ + email: string; + } + } - /** - * The email of the Google Workspace group. - */ - email: string; + /** + * Matches an Okta group. Requires an Okta identity provider. + */ + export interface AccessOktaGroupRule { + okta: AccessOktaGroupRule.Okta; } - } - /** - * Matches an Okta group. Requires an Okta identity provider. - */ - export interface AccessOktaGroupRule { - okta: AccessOktaGroupRule.Okta; - } + export namespace AccessOktaGroupRule { + export interface Okta { + /** + * The ID of your Okta identity provider. + */ + connection_id: string; - export namespace AccessOktaGroupRule { - export interface Okta { - /** - * The ID of your Okta identity provider. - */ - connection_id: string; + /** + * The email of the Okta group. + */ + email: string; + } + } - /** - * The email of the Okta group. - */ - email: string; + /** + * Matches a SAML group. Requires a SAML identity provider. + */ + export interface AccessSamlGroupRule { + saml: AccessSamlGroupRule.Saml; } - } - /** - * Matches a SAML group. Requires a SAML identity provider. - */ - export interface AccessSamlGroupRule { - saml: AccessSamlGroupRule.Saml; - } + export namespace AccessSamlGroupRule { + export interface Saml { + /** + * The name of the SAML attribute. + */ + attribute_name: string; - export namespace AccessSamlGroupRule { - export interface Saml { - /** - * The name of the SAML attribute. - */ - attribute_name: string; + /** + * The SAML attribute value to look for. + */ + attribute_value: string; + } + } - /** - * The SAML attribute value to look for. - */ - attribute_value: string; + /** + * Matches a specific Access Service Token + */ + export interface AccessServiceTokenRule { + service_token: AccessServiceTokenRule.ServiceToken; } - } - /** - * Matches a specific Access Service Token - */ - export interface AccessServiceTokenRule { - service_token: AccessServiceTokenRule.ServiceToken; - } + export namespace AccessServiceTokenRule { + export interface ServiceToken { + /** + * The ID of a Service Token. + */ + token_id: string; + } + } - export namespace AccessServiceTokenRule { - export interface ServiceToken { + /** + * Matches any valid Access Service Token + */ + export interface AccessAnyValidServiceTokenRule { /** - * The ID of a Service Token. + * An empty object which matches on all service tokens. */ - token_id: string; + any_valid_service_token: unknown; } - } - /** - * Matches any valid Access Service Token - */ - export interface AccessAnyValidServiceTokenRule { /** - * An empty object which matches on all service tokens. + * Create Allow or Block policies which evaluate the user based on custom criteria. */ - any_valid_service_token: unknown; - } + export interface AccessExternalEvaluationRule { + external_evaluation: AccessExternalEvaluationRule.ExternalEvaluation; + } - /** - * Create Allow or Block policies which evaluate the user based on custom criteria. - */ - export interface AccessExternalEvaluationRule { - external_evaluation: AccessExternalEvaluationRule.ExternalEvaluation; - } + export namespace AccessExternalEvaluationRule { + export interface ExternalEvaluation { + /** + * The API endpoint containing your business logic. + */ + evaluate_url: string; - export namespace AccessExternalEvaluationRule { - export interface ExternalEvaluation { - /** - * The API endpoint containing your business logic. - */ - evaluate_url: string; + /** + * The API endpoint containing the key that Access uses to verify that the response + * came from your API. + */ + keys_url: string; + } + } - /** - * The API endpoint containing the key that Access uses to verify that the response - * came from your API. - */ - keys_url: string; + /** + * Matches a specific country + */ + export interface AccessCountryRule { + geo: AccessCountryRule.Geo; } - } - /** - * Matches a specific country - */ - export interface AccessCountryRule { - geo: AccessCountryRule.Geo; - } + export namespace AccessCountryRule { + export interface Geo { + /** + * The country code that should be matched. + */ + country_code: string; + } + } - export namespace AccessCountryRule { - export interface Geo { - /** - * The country code that should be matched. - */ - country_code: string; + /** + * Enforce different MFA options + */ + export interface AccessAuthenticationMethodRule { + auth_method: AccessAuthenticationMethodRule.AuthMethod; } - } - /** - * Enforce different MFA options - */ - export interface AccessAuthenticationMethodRule { - auth_method: AccessAuthenticationMethodRule.AuthMethod; - } + export namespace AccessAuthenticationMethodRule { + export interface AuthMethod { + /** + * The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. + */ + auth_method: string; + } + } - export namespace AccessAuthenticationMethodRule { - export interface AuthMethod { - /** - * The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. - */ - auth_method: string; + /** + * Enforces a device posture rule has run successfully + */ + export interface AccessDevicePostureRule { + device_posture: AccessDevicePostureRule.DevicePosture; } - } - /** - * Enforces a device posture rule has run successfully - */ - export interface AccessDevicePostureRule { - device_posture: AccessDevicePostureRule.DevicePosture; - } + export namespace AccessDevicePostureRule { + export interface DevicePosture { + /** + * The ID of a device posture integration. + */ + integration_uid: string; + } + } - export namespace AccessDevicePostureRule { - export interface DevicePosture { - /** - * The ID of a device posture integration. - */ - integration_uid: string; + /** + * Matches a specific email. + */ + export interface AccessEmailRule { + email: AccessEmailRule.Email; } - } - /** - * Matches a specific email. - */ - export interface AccessEmailRule { - email: AccessEmailRule.Email; - } + export namespace AccessEmailRule { + export interface Email { + /** + * The email of the user. + */ + email: string; + } + } - export namespace AccessEmailRule { - export interface Email { - /** - * The email of the user. - */ - email: string; + /** + * Matches an email address from a list. + */ + export interface AccessEmailListRule { + email_list: AccessEmailListRule.EmailList; } - } - /** - * Matches an email address from a list. - */ - export interface AccessEmailListRule { - email_list: AccessEmailListRule.EmailList; - } + export namespace AccessEmailListRule { + export interface EmailList { + /** + * The ID of a previously created email list. + */ + id: string; + } + } - export namespace AccessEmailListRule { - export interface EmailList { - /** - * The ID of a previously created email list. - */ - id: string; + /** + * Match an entire email domain. + */ + export interface AccessDomainRule { + email_domain: AccessDomainRule.EmailDomain; + } + + export namespace AccessDomainRule { + export interface EmailDomain { + /** + * The email domain to match. + */ + domain: string; + } } - } - - /** - * Match an entire email domain. - */ - export interface AccessDomainRule { - email_domain: AccessDomainRule.EmailDomain; - } - export namespace AccessDomainRule { - export interface EmailDomain { + /** + * Matches everyone. + */ + export interface AccessEveryoneRule { /** - * The email domain to match. + * An empty object which matches on all users. */ - domain: string; + everyone: unknown; } - } - /** - * Matches everyone. - */ - export interface AccessEveryoneRule { /** - * An empty object which matches on all users. + * Matches an IP address block. */ - everyone: unknown; - } + export interface AccessIPRule { + ip: AccessIPRule.IP; + } - /** - * Matches an IP address block. - */ - export interface AccessIPRule { - ip: AccessIPRule.IP; - } + export namespace AccessIPRule { + export interface IP { + /** + * An IPv4 or IPv6 CIDR block. + */ + ip: string; + } + } - export namespace AccessIPRule { - export interface IP { - /** - * An IPv4 or IPv6 CIDR block. - */ - ip: string; + /** + * Matches an IP address from a list. + */ + export interface AccessIPListRule { + ip_list: AccessIPListRule.IPList; } - } - /** - * Matches an IP address from a list. - */ - export interface AccessIPListRule { - ip_list: AccessIPListRule.IPList; - } + export namespace AccessIPListRule { + export interface IPList { + /** + * The ID of a previously created IP list. + */ + id: string; + } + } - export namespace AccessIPListRule { - export interface IPList { - /** - * The ID of a previously created IP list. - */ - id: string; + /** + * Matches any valid client certificate. + */ + export interface AccessCertificateRule { + certificate: unknown; } - } - /** - * Matches any valid client certificate. - */ - export interface AccessCertificateRule { - certificate: unknown; - } + /** + * Matches an Access group. + */ + export interface AccessAccessGroupRule { + group: AccessAccessGroupRule.Group; + } - /** - * Matches an Access group. - */ - export interface AccessAccessGroupRule { - group: AccessAccessGroupRule.Group; - } + export namespace AccessAccessGroupRule { + export interface Group { + /** + * The ID of a previously created Access group. + */ + id: string; + } + } - export namespace AccessAccessGroupRule { - export interface Group { - /** - * The ID of a previously created Access group. - */ - id: string; + /** + * Matches an Azure group. Requires an Azure identity provider. + */ + export interface AccessAzureGroupRule { + azureAD: AccessAzureGroupRule.AzureAd; } - } - /** - * Matches an Azure group. Requires an Azure identity provider. - */ - export interface AccessAzureGroupRule { - azureAD: AccessAzureGroupRule.AzureAd; - } + export namespace AccessAzureGroupRule { + export interface AzureAd { + /** + * The ID of an Azure group. + */ + id: string; - export namespace AccessAzureGroupRule { - export interface AzureAd { - /** - * The ID of an Azure group. - */ - id: string; + /** + * The ID of your Azure identity provider. + */ + connection_id: string; + } + } - /** - * The ID of your Azure identity provider. - */ - connection_id: string; + /** + * Matches a Github organization. Requires a Github identity provider. + */ + export interface AccessGitHubOrganizationRule { + 'github-organization': AccessGitHubOrganizationRule.GitHubOrganization; } - } - /** - * Matches a Github organization. Requires a Github identity provider. - */ - export interface AccessGitHubOrganizationRule { - 'github-organization': AccessGitHubOrganizationRule.GitHubOrganization; - } + export namespace AccessGitHubOrganizationRule { + export interface GitHubOrganization { + /** + * The ID of your Github identity provider. + */ + connection_id: string; - export namespace AccessGitHubOrganizationRule { - export interface GitHubOrganization { - /** - * The ID of your Github identity provider. - */ - connection_id: string; + /** + * The name of the organization. + */ + name: string; + } + } - /** - * The name of the organization. - */ - name: string; + /** + * Matches a group in Google Workspace. Requires a Google Workspace identity + * provider. + */ + export interface AccessGsuiteGroupRule { + gsuite: AccessGsuiteGroupRule.Gsuite; } - } - /** - * Matches a group in Google Workspace. Requires a Google Workspace identity - * provider. - */ - export interface AccessGsuiteGroupRule { - gsuite: AccessGsuiteGroupRule.Gsuite; - } + export namespace AccessGsuiteGroupRule { + export interface Gsuite { + /** + * The ID of your Google Workspace identity provider. + */ + connection_id: string; - export namespace AccessGsuiteGroupRule { - export interface Gsuite { - /** - * The ID of your Google Workspace identity provider. - */ - connection_id: string; + /** + * The email of the Google Workspace group. + */ + email: string; + } + } - /** - * The email of the Google Workspace group. - */ - email: string; + /** + * Matches an Okta group. Requires an Okta identity provider. + */ + export interface AccessOktaGroupRule { + okta: AccessOktaGroupRule.Okta; } - } - /** - * Matches an Okta group. Requires an Okta identity provider. - */ - export interface AccessOktaGroupRule { - okta: AccessOktaGroupRule.Okta; - } + export namespace AccessOktaGroupRule { + export interface Okta { + /** + * The ID of your Okta identity provider. + */ + connection_id: string; - export namespace AccessOktaGroupRule { - export interface Okta { - /** - * The ID of your Okta identity provider. - */ - connection_id: string; + /** + * The email of the Okta group. + */ + email: string; + } + } - /** - * The email of the Okta group. - */ - email: string; + /** + * Matches a SAML group. Requires a SAML identity provider. + */ + export interface AccessSamlGroupRule { + saml: AccessSamlGroupRule.Saml; } - } - /** - * Matches a SAML group. Requires a SAML identity provider. - */ - export interface AccessSamlGroupRule { - saml: AccessSamlGroupRule.Saml; - } + export namespace AccessSamlGroupRule { + export interface Saml { + /** + * The name of the SAML attribute. + */ + attribute_name: string; - export namespace AccessSamlGroupRule { - export interface Saml { - /** - * The name of the SAML attribute. - */ - attribute_name: string; + /** + * The SAML attribute value to look for. + */ + attribute_value: string; + } + } - /** - * The SAML attribute value to look for. - */ - attribute_value: string; + /** + * Matches a specific Access Service Token + */ + export interface AccessServiceTokenRule { + service_token: AccessServiceTokenRule.ServiceToken; } - } - /** - * Matches a specific Access Service Token - */ - export interface AccessServiceTokenRule { - service_token: AccessServiceTokenRule.ServiceToken; - } + export namespace AccessServiceTokenRule { + export interface ServiceToken { + /** + * The ID of a Service Token. + */ + token_id: string; + } + } - export namespace AccessServiceTokenRule { - export interface ServiceToken { + /** + * Matches any valid Access Service Token + */ + export interface AccessAnyValidServiceTokenRule { /** - * The ID of a Service Token. + * An empty object which matches on all service tokens. */ - token_id: string; + any_valid_service_token: unknown; } - } - /** - * Matches any valid Access Service Token - */ - export interface AccessAnyValidServiceTokenRule { /** - * An empty object which matches on all service tokens. + * Create Allow or Block policies which evaluate the user based on custom criteria. */ - any_valid_service_token: unknown; - } + export interface AccessExternalEvaluationRule { + external_evaluation: AccessExternalEvaluationRule.ExternalEvaluation; + } - /** - * Create Allow or Block policies which evaluate the user based on custom criteria. - */ - export interface AccessExternalEvaluationRule { - external_evaluation: AccessExternalEvaluationRule.ExternalEvaluation; - } + export namespace AccessExternalEvaluationRule { + export interface ExternalEvaluation { + /** + * The API endpoint containing your business logic. + */ + evaluate_url: string; - export namespace AccessExternalEvaluationRule { - export interface ExternalEvaluation { - /** - * The API endpoint containing your business logic. - */ - evaluate_url: string; + /** + * The API endpoint containing the key that Access uses to verify that the response + * came from your API. + */ + keys_url: string; + } + } - /** - * The API endpoint containing the key that Access uses to verify that the response - * came from your API. - */ - keys_url: string; + /** + * Matches a specific country + */ + export interface AccessCountryRule { + geo: AccessCountryRule.Geo; } - } - /** - * Matches a specific country - */ - export interface AccessCountryRule { - geo: AccessCountryRule.Geo; - } + export namespace AccessCountryRule { + export interface Geo { + /** + * The country code that should be matched. + */ + country_code: string; + } + } - export namespace AccessCountryRule { - export interface Geo { - /** - * The country code that should be matched. - */ - country_code: string; + /** + * Enforce different MFA options + */ + export interface AccessAuthenticationMethodRule { + auth_method: AccessAuthenticationMethodRule.AuthMethod; } - } - /** - * Enforce different MFA options - */ - export interface AccessAuthenticationMethodRule { - auth_method: AccessAuthenticationMethodRule.AuthMethod; - } + export namespace AccessAuthenticationMethodRule { + export interface AuthMethod { + /** + * The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. + */ + auth_method: string; + } + } - export namespace AccessAuthenticationMethodRule { - export interface AuthMethod { - /** - * The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. - */ - auth_method: string; + /** + * Enforces a device posture rule has run successfully + */ + export interface AccessDevicePostureRule { + device_posture: AccessDevicePostureRule.DevicePosture; } - } - /** - * Enforces a device posture rule has run successfully - */ - export interface AccessDevicePostureRule { - device_posture: AccessDevicePostureRule.DevicePosture; - } + export namespace AccessDevicePostureRule { + export interface DevicePosture { + /** + * The ID of a device posture integration. + */ + integration_uid: string; + } + } - export namespace AccessDevicePostureRule { - export interface DevicePosture { - /** - * The ID of a device posture integration. - */ - integration_uid: string; + /** + * Matches a specific email. + */ + export interface AccessEmailRule { + email: AccessEmailRule.Email; } - } - /** - * Matches a specific email. - */ - export interface AccessEmailRule { - email: AccessEmailRule.Email; - } + export namespace AccessEmailRule { + export interface Email { + /** + * The email of the user. + */ + email: string; + } + } - export namespace AccessEmailRule { - export interface Email { - /** - * The email of the user. - */ - email: string; + /** + * Matches an email address from a list. + */ + export interface AccessEmailListRule { + email_list: AccessEmailListRule.EmailList; } - } - /** - * Matches an email address from a list. - */ - export interface AccessEmailListRule { - email_list: AccessEmailListRule.EmailList; - } + export namespace AccessEmailListRule { + export interface EmailList { + /** + * The ID of a previously created email list. + */ + id: string; + } + } - export namespace AccessEmailListRule { - export interface EmailList { - /** - * The ID of a previously created email list. - */ - id: string; + /** + * Match an entire email domain. + */ + export interface AccessDomainRule { + email_domain: AccessDomainRule.EmailDomain; } - } - /** - * Match an entire email domain. - */ - export interface AccessDomainRule { - email_domain: AccessDomainRule.EmailDomain; - } + export namespace AccessDomainRule { + export interface EmailDomain { + /** + * The email domain to match. + */ + domain: string; + } + } - export namespace AccessDomainRule { - export interface EmailDomain { + /** + * Matches everyone. + */ + export interface AccessEveryoneRule { /** - * The email domain to match. + * An empty object which matches on all users. */ - domain: string; + everyone: unknown; } - } - /** - * Matches everyone. - */ - export interface AccessEveryoneRule { /** - * An empty object which matches on all users. + * Matches an IP address block. */ - everyone: unknown; - } + export interface AccessIPRule { + ip: AccessIPRule.IP; + } - /** - * Matches an IP address block. - */ - export interface AccessIPRule { - ip: AccessIPRule.IP; - } + export namespace AccessIPRule { + export interface IP { + /** + * An IPv4 or IPv6 CIDR block. + */ + ip: string; + } + } - export namespace AccessIPRule { - export interface IP { - /** - * An IPv4 or IPv6 CIDR block. - */ - ip: string; + /** + * Matches an IP address from a list. + */ + export interface AccessIPListRule { + ip_list: AccessIPListRule.IPList; } - } - /** - * Matches an IP address from a list. - */ - export interface AccessIPListRule { - ip_list: AccessIPListRule.IPList; - } + export namespace AccessIPListRule { + export interface IPList { + /** + * The ID of a previously created IP list. + */ + id: string; + } + } - export namespace AccessIPListRule { - export interface IPList { - /** - * The ID of a previously created IP list. - */ - id: string; + /** + * Matches any valid client certificate. + */ + export interface AccessCertificateRule { + certificate: unknown; } - } - /** - * Matches any valid client certificate. - */ - export interface AccessCertificateRule { - certificate: unknown; - } + /** + * Matches an Access group. + */ + export interface AccessAccessGroupRule { + group: AccessAccessGroupRule.Group; + } - /** - * Matches an Access group. - */ - export interface AccessAccessGroupRule { - group: AccessAccessGroupRule.Group; - } + export namespace AccessAccessGroupRule { + export interface Group { + /** + * The ID of a previously created Access group. + */ + id: string; + } + } - export namespace AccessAccessGroupRule { - export interface Group { - /** - * The ID of a previously created Access group. - */ - id: string; + /** + * Matches an Azure group. Requires an Azure identity provider. + */ + export interface AccessAzureGroupRule { + azureAD: AccessAzureGroupRule.AzureAd; } - } - /** - * Matches an Azure group. Requires an Azure identity provider. - */ - export interface AccessAzureGroupRule { - azureAD: AccessAzureGroupRule.AzureAd; - } + export namespace AccessAzureGroupRule { + export interface AzureAd { + /** + * The ID of an Azure group. + */ + id: string; - export namespace AccessAzureGroupRule { - export interface AzureAd { - /** - * The ID of an Azure group. - */ - id: string; + /** + * The ID of your Azure identity provider. + */ + connection_id: string; + } + } - /** - * The ID of your Azure identity provider. - */ - connection_id: string; + /** + * Matches a Github organization. Requires a Github identity provider. + */ + export interface AccessGitHubOrganizationRule { + 'github-organization': AccessGitHubOrganizationRule.GitHubOrganization; } - } - /** - * Matches a Github organization. Requires a Github identity provider. - */ - export interface AccessGitHubOrganizationRule { - 'github-organization': AccessGitHubOrganizationRule.GitHubOrganization; - } + export namespace AccessGitHubOrganizationRule { + export interface GitHubOrganization { + /** + * The ID of your Github identity provider. + */ + connection_id: string; - export namespace AccessGitHubOrganizationRule { - export interface GitHubOrganization { - /** - * The ID of your Github identity provider. - */ - connection_id: string; + /** + * The name of the organization. + */ + name: string; + } + } - /** - * The name of the organization. - */ - name: string; + /** + * Matches a group in Google Workspace. Requires a Google Workspace identity + * provider. + */ + export interface AccessGsuiteGroupRule { + gsuite: AccessGsuiteGroupRule.Gsuite; } - } - /** - * Matches a group in Google Workspace. Requires a Google Workspace identity - * provider. - */ - export interface AccessGsuiteGroupRule { - gsuite: AccessGsuiteGroupRule.Gsuite; - } + export namespace AccessGsuiteGroupRule { + export interface Gsuite { + /** + * The ID of your Google Workspace identity provider. + */ + connection_id: string; - export namespace AccessGsuiteGroupRule { - export interface Gsuite { - /** - * The ID of your Google Workspace identity provider. - */ - connection_id: string; + /** + * The email of the Google Workspace group. + */ + email: string; + } + } - /** - * The email of the Google Workspace group. - */ - email: string; + /** + * Matches an Okta group. Requires an Okta identity provider. + */ + export interface AccessOktaGroupRule { + okta: AccessOktaGroupRule.Okta; } - } - /** - * Matches an Okta group. Requires an Okta identity provider. - */ - export interface AccessOktaGroupRule { - okta: AccessOktaGroupRule.Okta; - } + export namespace AccessOktaGroupRule { + export interface Okta { + /** + * The ID of your Okta identity provider. + */ + connection_id: string; - export namespace AccessOktaGroupRule { - export interface Okta { - /** - * The ID of your Okta identity provider. - */ - connection_id: string; + /** + * The email of the Okta group. + */ + email: string; + } + } + + /** + * Matches a SAML group. Requires a SAML identity provider. + */ + export interface AccessSamlGroupRule { + saml: AccessSamlGroupRule.Saml; + } + + export namespace AccessSamlGroupRule { + export interface Saml { + /** + * The name of the SAML attribute. + */ + attribute_name: string; + + /** + * The SAML attribute value to look for. + */ + attribute_value: string; + } + } - /** - * The email of the Okta group. - */ - email: string; + /** + * Matches a specific Access Service Token + */ + export interface AccessServiceTokenRule { + service_token: AccessServiceTokenRule.ServiceToken; } - } - /** - * Matches a SAML group. Requires a SAML identity provider. - */ - export interface AccessSamlGroupRule { - saml: AccessSamlGroupRule.Saml; - } + export namespace AccessServiceTokenRule { + export interface ServiceToken { + /** + * The ID of a Service Token. + */ + token_id: string; + } + } - export namespace AccessSamlGroupRule { - export interface Saml { + /** + * Matches any valid Access Service Token + */ + export interface AccessAnyValidServiceTokenRule { /** - * The name of the SAML attribute. + * An empty object which matches on all service tokens. */ - attribute_name: string; + any_valid_service_token: unknown; + } - /** - * The SAML attribute value to look for. - */ - attribute_value: string; + /** + * Create Allow or Block policies which evaluate the user based on custom criteria. + */ + export interface AccessExternalEvaluationRule { + external_evaluation: AccessExternalEvaluationRule.ExternalEvaluation; } - } - /** - * Matches a specific Access Service Token - */ - export interface AccessServiceTokenRule { - service_token: AccessServiceTokenRule.ServiceToken; - } + export namespace AccessExternalEvaluationRule { + export interface ExternalEvaluation { + /** + * The API endpoint containing your business logic. + */ + evaluate_url: string; - export namespace AccessServiceTokenRule { - export interface ServiceToken { - /** - * The ID of a Service Token. - */ - token_id: string; + /** + * The API endpoint containing the key that Access uses to verify that the response + * came from your API. + */ + keys_url: string; + } } - } - /** - * Matches any valid Access Service Token - */ - export interface AccessAnyValidServiceTokenRule { /** - * An empty object which matches on all service tokens. + * Matches a specific country */ - any_valid_service_token: unknown; - } - - /** - * Create Allow or Block policies which evaluate the user based on custom criteria. - */ - export interface AccessExternalEvaluationRule { - external_evaluation: AccessExternalEvaluationRule.ExternalEvaluation; - } - - export namespace AccessExternalEvaluationRule { - export interface ExternalEvaluation { - /** - * The API endpoint containing your business logic. - */ - evaluate_url: string; + export interface AccessCountryRule { + geo: AccessCountryRule.Geo; + } - /** - * The API endpoint containing the key that Access uses to verify that the response - * came from your API. - */ - keys_url: string; + export namespace AccessCountryRule { + export interface Geo { + /** + * The country code that should be matched. + */ + country_code: string; + } } - } - /** - * Matches a specific country - */ - export interface AccessCountryRule { - geo: AccessCountryRule.Geo; - } + /** + * Enforce different MFA options + */ + export interface AccessAuthenticationMethodRule { + auth_method: AccessAuthenticationMethodRule.AuthMethod; + } - export namespace AccessCountryRule { - export interface Geo { - /** - * The country code that should be matched. - */ - country_code: string; + export namespace AccessAuthenticationMethodRule { + export interface AuthMethod { + /** + * The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. + */ + auth_method: string; + } } - } - /** - * Enforce different MFA options - */ - export interface AccessAuthenticationMethodRule { - auth_method: AccessAuthenticationMethodRule.AuthMethod; - } + /** + * Enforces a device posture rule has run successfully + */ + export interface AccessDevicePostureRule { + device_posture: AccessDevicePostureRule.DevicePosture; + } - export namespace AccessAuthenticationMethodRule { - export interface AuthMethod { - /** - * The type of authentication method https://datatracker.ietf.org/doc/html/rfc8176. - */ - auth_method: string; + export namespace AccessDevicePostureRule { + export interface DevicePosture { + /** + * The ID of a device posture integration. + */ + integration_uid: string; + } } } +} +export interface GroupDeleteResponse { /** - * Enforces a device posture rule has run successfully + * UUID */ - export interface AccessDevicePostureRule { - device_posture: AccessDevicePostureRule.DevicePosture; - } - - export namespace AccessDevicePostureRule { - export interface DevicePosture { - /** - * The ID of a device posture integration. - */ - integration_uid: string; - } - } + id?: string; } -export interface GroupReplaceResponse { +export interface GroupGetResponse { /** * UUID */ @@ -4260,25 +4260,25 @@ export interface GroupReplaceResponse { * meet any of the Exclude rules. */ exclude?: Array< - | GroupReplaceResponse.AccessEmailRule - | GroupReplaceResponse.AccessEmailListRule - | GroupReplaceResponse.AccessDomainRule - | GroupReplaceResponse.AccessEveryoneRule - | GroupReplaceResponse.AccessIPRule - | GroupReplaceResponse.AccessIPListRule - | GroupReplaceResponse.AccessCertificateRule - | GroupReplaceResponse.AccessAccessGroupRule - | GroupReplaceResponse.AccessAzureGroupRule - | GroupReplaceResponse.AccessGitHubOrganizationRule - | GroupReplaceResponse.AccessGsuiteGroupRule - | GroupReplaceResponse.AccessOktaGroupRule - | GroupReplaceResponse.AccessSamlGroupRule - | GroupReplaceResponse.AccessServiceTokenRule - | GroupReplaceResponse.AccessAnyValidServiceTokenRule - | GroupReplaceResponse.AccessExternalEvaluationRule - | GroupReplaceResponse.AccessCountryRule - | GroupReplaceResponse.AccessAuthenticationMethodRule - | GroupReplaceResponse.AccessDevicePostureRule + | GroupGetResponse.AccessEmailRule + | GroupGetResponse.AccessEmailListRule + | GroupGetResponse.AccessDomainRule + | GroupGetResponse.AccessEveryoneRule + | GroupGetResponse.AccessIPRule + | GroupGetResponse.AccessIPListRule + | GroupGetResponse.AccessCertificateRule + | GroupGetResponse.AccessAccessGroupRule + | GroupGetResponse.AccessAzureGroupRule + | GroupGetResponse.AccessGitHubOrganizationRule + | GroupGetResponse.AccessGsuiteGroupRule + | GroupGetResponse.AccessOktaGroupRule + | GroupGetResponse.AccessSamlGroupRule + | GroupGetResponse.AccessServiceTokenRule + | GroupGetResponse.AccessAnyValidServiceTokenRule + | GroupGetResponse.AccessExternalEvaluationRule + | GroupGetResponse.AccessCountryRule + | GroupGetResponse.AccessAuthenticationMethodRule + | GroupGetResponse.AccessDevicePostureRule >; /** @@ -4286,25 +4286,25 @@ export interface GroupReplaceResponse { * the Include rules. */ include?: Array< - | GroupReplaceResponse.AccessEmailRule - | GroupReplaceResponse.AccessEmailListRule - | GroupReplaceResponse.AccessDomainRule - | GroupReplaceResponse.AccessEveryoneRule - | GroupReplaceResponse.AccessIPRule - | GroupReplaceResponse.AccessIPListRule - | GroupReplaceResponse.AccessCertificateRule - | GroupReplaceResponse.AccessAccessGroupRule - | GroupReplaceResponse.AccessAzureGroupRule - | GroupReplaceResponse.AccessGitHubOrganizationRule - | GroupReplaceResponse.AccessGsuiteGroupRule - | GroupReplaceResponse.AccessOktaGroupRule - | GroupReplaceResponse.AccessSamlGroupRule - | GroupReplaceResponse.AccessServiceTokenRule - | GroupReplaceResponse.AccessAnyValidServiceTokenRule - | GroupReplaceResponse.AccessExternalEvaluationRule - | GroupReplaceResponse.AccessCountryRule - | GroupReplaceResponse.AccessAuthenticationMethodRule - | GroupReplaceResponse.AccessDevicePostureRule + | GroupGetResponse.AccessEmailRule + | GroupGetResponse.AccessEmailListRule + | GroupGetResponse.AccessDomainRule + | GroupGetResponse.AccessEveryoneRule + | GroupGetResponse.AccessIPRule + | GroupGetResponse.AccessIPListRule + | GroupGetResponse.AccessCertificateRule + | GroupGetResponse.AccessAccessGroupRule + | GroupGetResponse.AccessAzureGroupRule + | GroupGetResponse.AccessGitHubOrganizationRule + | GroupGetResponse.AccessGsuiteGroupRule + | GroupGetResponse.AccessOktaGroupRule + | GroupGetResponse.AccessSamlGroupRule + | GroupGetResponse.AccessServiceTokenRule + | GroupGetResponse.AccessAnyValidServiceTokenRule + | GroupGetResponse.AccessExternalEvaluationRule + | GroupGetResponse.AccessCountryRule + | GroupGetResponse.AccessAuthenticationMethodRule + | GroupGetResponse.AccessDevicePostureRule >; /** @@ -4312,25 +4312,25 @@ export interface GroupReplaceResponse { * meet all of the Require rules. */ is_default?: Array< - | GroupReplaceResponse.AccessEmailRule - | GroupReplaceResponse.AccessEmailListRule - | GroupReplaceResponse.AccessDomainRule - | GroupReplaceResponse.AccessEveryoneRule - | GroupReplaceResponse.AccessIPRule - | GroupReplaceResponse.AccessIPListRule - | GroupReplaceResponse.AccessCertificateRule - | GroupReplaceResponse.AccessAccessGroupRule - | GroupReplaceResponse.AccessAzureGroupRule - | GroupReplaceResponse.AccessGitHubOrganizationRule - | GroupReplaceResponse.AccessGsuiteGroupRule - | GroupReplaceResponse.AccessOktaGroupRule - | GroupReplaceResponse.AccessSamlGroupRule - | GroupReplaceResponse.AccessServiceTokenRule - | GroupReplaceResponse.AccessAnyValidServiceTokenRule - | GroupReplaceResponse.AccessExternalEvaluationRule - | GroupReplaceResponse.AccessCountryRule - | GroupReplaceResponse.AccessAuthenticationMethodRule - | GroupReplaceResponse.AccessDevicePostureRule + | GroupGetResponse.AccessEmailRule + | GroupGetResponse.AccessEmailListRule + | GroupGetResponse.AccessDomainRule + | GroupGetResponse.AccessEveryoneRule + | GroupGetResponse.AccessIPRule + | GroupGetResponse.AccessIPListRule + | GroupGetResponse.AccessCertificateRule + | GroupGetResponse.AccessAccessGroupRule + | GroupGetResponse.AccessAzureGroupRule + | GroupGetResponse.AccessGitHubOrganizationRule + | GroupGetResponse.AccessGsuiteGroupRule + | GroupGetResponse.AccessOktaGroupRule + | GroupGetResponse.AccessSamlGroupRule + | GroupGetResponse.AccessServiceTokenRule + | GroupGetResponse.AccessAnyValidServiceTokenRule + | GroupGetResponse.AccessExternalEvaluationRule + | GroupGetResponse.AccessCountryRule + | GroupGetResponse.AccessAuthenticationMethodRule + | GroupGetResponse.AccessDevicePostureRule >; /** @@ -4343,31 +4343,31 @@ export interface GroupReplaceResponse { * meet all of the Require rules. */ require?: Array< - | GroupReplaceResponse.AccessEmailRule - | GroupReplaceResponse.AccessEmailListRule - | GroupReplaceResponse.AccessDomainRule - | GroupReplaceResponse.AccessEveryoneRule - | GroupReplaceResponse.AccessIPRule - | GroupReplaceResponse.AccessIPListRule - | GroupReplaceResponse.AccessCertificateRule - | GroupReplaceResponse.AccessAccessGroupRule - | GroupReplaceResponse.AccessAzureGroupRule - | GroupReplaceResponse.AccessGitHubOrganizationRule - | GroupReplaceResponse.AccessGsuiteGroupRule - | GroupReplaceResponse.AccessOktaGroupRule - | GroupReplaceResponse.AccessSamlGroupRule - | GroupReplaceResponse.AccessServiceTokenRule - | GroupReplaceResponse.AccessAnyValidServiceTokenRule - | GroupReplaceResponse.AccessExternalEvaluationRule - | GroupReplaceResponse.AccessCountryRule - | GroupReplaceResponse.AccessAuthenticationMethodRule - | GroupReplaceResponse.AccessDevicePostureRule + | GroupGetResponse.AccessEmailRule + | GroupGetResponse.AccessEmailListRule + | GroupGetResponse.AccessDomainRule + | GroupGetResponse.AccessEveryoneRule + | GroupGetResponse.AccessIPRule + | GroupGetResponse.AccessIPListRule + | GroupGetResponse.AccessCertificateRule + | GroupGetResponse.AccessAccessGroupRule + | GroupGetResponse.AccessAzureGroupRule + | GroupGetResponse.AccessGitHubOrganizationRule + | GroupGetResponse.AccessGsuiteGroupRule + | GroupGetResponse.AccessOktaGroupRule + | GroupGetResponse.AccessSamlGroupRule + | GroupGetResponse.AccessServiceTokenRule + | GroupGetResponse.AccessAnyValidServiceTokenRule + | GroupGetResponse.AccessExternalEvaluationRule + | GroupGetResponse.AccessCountryRule + | GroupGetResponse.AccessAuthenticationMethodRule + | GroupGetResponse.AccessDevicePostureRule >; updated_at?: string; } -export namespace GroupReplaceResponse { +export namespace GroupGetResponse { /** * Matches a specific email. */ @@ -6666,31 +6666,31 @@ export namespace GroupCreateParams { } } -export interface GroupReplaceParams { +export interface GroupUpdateParams { /** * Rules evaluated with an OR logical operator. A user needs to meet only one of * the Include rules. */ include: Array< - | GroupReplaceParams.AccessEmailRule - | GroupReplaceParams.AccessEmailListRule - | GroupReplaceParams.AccessDomainRule - | GroupReplaceParams.AccessEveryoneRule - | GroupReplaceParams.AccessIPRule - | GroupReplaceParams.AccessIPListRule - | GroupReplaceParams.AccessCertificateRule - | GroupReplaceParams.AccessAccessGroupRule - | GroupReplaceParams.AccessAzureGroupRule - | GroupReplaceParams.AccessGitHubOrganizationRule - | GroupReplaceParams.AccessGsuiteGroupRule - | GroupReplaceParams.AccessOktaGroupRule - | GroupReplaceParams.AccessSamlGroupRule - | GroupReplaceParams.AccessServiceTokenRule - | GroupReplaceParams.AccessAnyValidServiceTokenRule - | GroupReplaceParams.AccessExternalEvaluationRule - | GroupReplaceParams.AccessCountryRule - | GroupReplaceParams.AccessAuthenticationMethodRule - | GroupReplaceParams.AccessDevicePostureRule + | GroupUpdateParams.AccessEmailRule + | GroupUpdateParams.AccessEmailListRule + | GroupUpdateParams.AccessDomainRule + | GroupUpdateParams.AccessEveryoneRule + | GroupUpdateParams.AccessIPRule + | GroupUpdateParams.AccessIPListRule + | GroupUpdateParams.AccessCertificateRule + | GroupUpdateParams.AccessAccessGroupRule + | GroupUpdateParams.AccessAzureGroupRule + | GroupUpdateParams.AccessGitHubOrganizationRule + | GroupUpdateParams.AccessGsuiteGroupRule + | GroupUpdateParams.AccessOktaGroupRule + | GroupUpdateParams.AccessSamlGroupRule + | GroupUpdateParams.AccessServiceTokenRule + | GroupUpdateParams.AccessAnyValidServiceTokenRule + | GroupUpdateParams.AccessExternalEvaluationRule + | GroupUpdateParams.AccessCountryRule + | GroupUpdateParams.AccessAuthenticationMethodRule + | GroupUpdateParams.AccessDevicePostureRule >; /** @@ -6703,25 +6703,25 @@ export interface GroupReplaceParams { * meet any of the Exclude rules. */ exclude?: Array< - | GroupReplaceParams.AccessEmailRule - | GroupReplaceParams.AccessEmailListRule - | GroupReplaceParams.AccessDomainRule - | GroupReplaceParams.AccessEveryoneRule - | GroupReplaceParams.AccessIPRule - | GroupReplaceParams.AccessIPListRule - | GroupReplaceParams.AccessCertificateRule - | GroupReplaceParams.AccessAccessGroupRule - | GroupReplaceParams.AccessAzureGroupRule - | GroupReplaceParams.AccessGitHubOrganizationRule - | GroupReplaceParams.AccessGsuiteGroupRule - | GroupReplaceParams.AccessOktaGroupRule - | GroupReplaceParams.AccessSamlGroupRule - | GroupReplaceParams.AccessServiceTokenRule - | GroupReplaceParams.AccessAnyValidServiceTokenRule - | GroupReplaceParams.AccessExternalEvaluationRule - | GroupReplaceParams.AccessCountryRule - | GroupReplaceParams.AccessAuthenticationMethodRule - | GroupReplaceParams.AccessDevicePostureRule + | GroupUpdateParams.AccessEmailRule + | GroupUpdateParams.AccessEmailListRule + | GroupUpdateParams.AccessDomainRule + | GroupUpdateParams.AccessEveryoneRule + | GroupUpdateParams.AccessIPRule + | GroupUpdateParams.AccessIPListRule + | GroupUpdateParams.AccessCertificateRule + | GroupUpdateParams.AccessAccessGroupRule + | GroupUpdateParams.AccessAzureGroupRule + | GroupUpdateParams.AccessGitHubOrganizationRule + | GroupUpdateParams.AccessGsuiteGroupRule + | GroupUpdateParams.AccessOktaGroupRule + | GroupUpdateParams.AccessSamlGroupRule + | GroupUpdateParams.AccessServiceTokenRule + | GroupUpdateParams.AccessAnyValidServiceTokenRule + | GroupUpdateParams.AccessExternalEvaluationRule + | GroupUpdateParams.AccessCountryRule + | GroupUpdateParams.AccessAuthenticationMethodRule + | GroupUpdateParams.AccessDevicePostureRule >; /** @@ -6734,29 +6734,29 @@ export interface GroupReplaceParams { * meet all of the Require rules. */ require?: Array< - | GroupReplaceParams.AccessEmailRule - | GroupReplaceParams.AccessEmailListRule - | GroupReplaceParams.AccessDomainRule - | GroupReplaceParams.AccessEveryoneRule - | GroupReplaceParams.AccessIPRule - | GroupReplaceParams.AccessIPListRule - | GroupReplaceParams.AccessCertificateRule - | GroupReplaceParams.AccessAccessGroupRule - | GroupReplaceParams.AccessAzureGroupRule - | GroupReplaceParams.AccessGitHubOrganizationRule - | GroupReplaceParams.AccessGsuiteGroupRule - | GroupReplaceParams.AccessOktaGroupRule - | GroupReplaceParams.AccessSamlGroupRule - | GroupReplaceParams.AccessServiceTokenRule - | GroupReplaceParams.AccessAnyValidServiceTokenRule - | GroupReplaceParams.AccessExternalEvaluationRule - | GroupReplaceParams.AccessCountryRule - | GroupReplaceParams.AccessAuthenticationMethodRule - | GroupReplaceParams.AccessDevicePostureRule + | GroupUpdateParams.AccessEmailRule + | GroupUpdateParams.AccessEmailListRule + | GroupUpdateParams.AccessDomainRule + | GroupUpdateParams.AccessEveryoneRule + | GroupUpdateParams.AccessIPRule + | GroupUpdateParams.AccessIPListRule + | GroupUpdateParams.AccessCertificateRule + | GroupUpdateParams.AccessAccessGroupRule + | GroupUpdateParams.AccessAzureGroupRule + | GroupUpdateParams.AccessGitHubOrganizationRule + | GroupUpdateParams.AccessGsuiteGroupRule + | GroupUpdateParams.AccessOktaGroupRule + | GroupUpdateParams.AccessSamlGroupRule + | GroupUpdateParams.AccessServiceTokenRule + | GroupUpdateParams.AccessAnyValidServiceTokenRule + | GroupUpdateParams.AccessExternalEvaluationRule + | GroupUpdateParams.AccessCountryRule + | GroupUpdateParams.AccessAuthenticationMethodRule + | GroupUpdateParams.AccessDevicePostureRule >; } -export namespace GroupReplaceParams { +export namespace GroupUpdateParams { /** * Matches a specific email. */ @@ -7705,10 +7705,10 @@ export namespace GroupReplaceParams { export namespace Groups { export import GroupCreateResponse = GroupsAPI.GroupCreateResponse; + export import GroupUpdateResponse = GroupsAPI.GroupUpdateResponse; export import GroupListResponse = GroupsAPI.GroupListResponse; export import GroupDeleteResponse = GroupsAPI.GroupDeleteResponse; export import GroupGetResponse = GroupsAPI.GroupGetResponse; - export import GroupReplaceResponse = GroupsAPI.GroupReplaceResponse; export import GroupCreateParams = GroupsAPI.GroupCreateParams; - export import GroupReplaceParams = GroupsAPI.GroupReplaceParams; + export import GroupUpdateParams = GroupsAPI.GroupUpdateParams; } diff --git a/src/resources/access/identity-providers.ts b/src/resources/access/identity-providers.ts index 4ed9bcca63..8911137e80 100644 --- a/src/resources/access/identity-providers.ts +++ b/src/resources/access/identity-providers.ts @@ -22,6 +22,24 @@ export class IdentityProviders extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Updates a configured identity provider. + */ + update( + accountOrZone: string, + accountOrZoneId: string, + uuid: string, + body: IdentityProviderUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/${accountOrZone}/${accountOrZoneId}/access/identity_providers/${uuid}`, { + body, + ...options, + }) as Core.APIPromise<{ result: IdentityProviderUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * Lists all configured identity providers. */ @@ -71,24 +89,6 @@ export class IdentityProviders extends APIResource { ) as Core.APIPromise<{ result: IdentityProviderGetResponse }> )._thenUnwrap((obj) => obj.result); } - - /** - * Updates a configured identity provider. - */ - replace( - accountOrZone: string, - accountOrZoneId: string, - uuid: string, - body: IdentityProviderReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put(`/${accountOrZone}/${accountOrZoneId}/access/identity_providers/${uuid}`, { - body, - ...options, - }) as Core.APIPromise<{ result: IdentityProviderReplaceResponse }> - )._thenUnwrap((obj) => obj.result); - } } export type IdentityProviderCreateResponse = @@ -1726,23 +1726,23 @@ export namespace IdentityProviderCreateResponse { } } -export type IdentityProviderListResponse = Array< - | IdentityProviderListResponse.AccessAzureAd - | IdentityProviderListResponse.AccessCentrify - | IdentityProviderListResponse.AccessFacebook - | IdentityProviderListResponse.AccessGitHub - | IdentityProviderListResponse.AccessGoogle - | IdentityProviderListResponse.AccessGoogleApps - | IdentityProviderListResponse.AccessLinkedin - | IdentityProviderListResponse.AccessOidc - | IdentityProviderListResponse.AccessOkta - | IdentityProviderListResponse.AccessOnelogin - | IdentityProviderListResponse.AccessPingone - | IdentityProviderListResponse.AccessSaml - | IdentityProviderListResponse.AccessYandex ->; - -export namespace IdentityProviderListResponse { +export type IdentityProviderUpdateResponse = + | IdentityProviderUpdateResponse.AccessAzureAd + | IdentityProviderUpdateResponse.AccessCentrify + | IdentityProviderUpdateResponse.AccessFacebook + | IdentityProviderUpdateResponse.AccessGitHub + | IdentityProviderUpdateResponse.AccessGoogle + | IdentityProviderUpdateResponse.AccessGoogleApps + | IdentityProviderUpdateResponse.AccessLinkedin + | IdentityProviderUpdateResponse.AccessOidc + | IdentityProviderUpdateResponse.AccessOkta + | IdentityProviderUpdateResponse.AccessOnelogin + | IdentityProviderUpdateResponse.AccessPingone + | IdentityProviderUpdateResponse.AccessSaml + | IdentityProviderUpdateResponse.AccessYandex + | IdentityProviderUpdateResponse.AccessOnetimepin; + +export namespace IdentityProviderUpdateResponse { export interface AccessAzureAd { /** * The configuration parameters for the identity provider. To view the required @@ -3273,32 +3273,111 @@ export namespace IdentityProviderListResponse { user_deprovision?: boolean; } } -} -export interface IdentityProviderDeleteResponse { - /** - * UUID - */ - id?: string; + export interface AccessOnetimepin { + /** + * The configuration parameters for the identity provider. To view the required + * parameters for a specific provider, refer to our + * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + */ + config: unknown; + + /** + * The name of the identity provider, shown to users on the login page. + */ + name: string; + + /** + * The type of identity provider. To determine the value for a specific provider, + * refer to our + * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + */ + type: + | 'onetimepin' + | 'azureAD' + | 'saml' + | 'centrify' + | 'facebook' + | 'github' + | 'google-apps' + | 'google' + | 'linkedin' + | 'oidc' + | 'okta' + | 'onelogin' + | 'pingone' + | 'yandex'; + + /** + * UUID + */ + id?: string; + + /** + * The configuration settings for enabling a System for Cross-Domain Identity + * Management (SCIM) with the identity provider. + */ + scim_config?: AccessOnetimepin.ScimConfig; + } + + export namespace AccessOnetimepin { + /** + * The configuration settings for enabling a System for Cross-Domain Identity + * Management (SCIM) with the identity provider. + */ + export interface ScimConfig { + /** + * A flag to enable or disable SCIM for the identity provider. + */ + enabled?: boolean; + + /** + * A flag to revoke a user's session in Access and force a reauthentication on the + * user's Gateway session when they have been added or removed from a group in the + * Identity Provider. + */ + group_member_deprovision?: boolean; + + /** + * A flag to remove a user's seat in Zero Trust when they have been deprovisioned + * in the Identity Provider. This cannot be enabled unless user_deprovision is also + * enabled. + */ + seat_deprovision?: boolean; + + /** + * A read-only token generated when the SCIM integration is enabled for the first + * time. It is redacted on subsequent requests. If you lose this you will need to + * refresh it token at /access/identity_providers/:idpID/refresh_scim_secret. + */ + secret?: string; + + /** + * A flag to enable revoking a user's session in Access and Gateway when they have + * been deprovisioned in the Identity Provider. + */ + user_deprovision?: boolean; + } + } } -export type IdentityProviderGetResponse = - | IdentityProviderGetResponse.AccessAzureAd - | IdentityProviderGetResponse.AccessCentrify - | IdentityProviderGetResponse.AccessFacebook - | IdentityProviderGetResponse.AccessGitHub - | IdentityProviderGetResponse.AccessGoogle - | IdentityProviderGetResponse.AccessGoogleApps - | IdentityProviderGetResponse.AccessLinkedin - | IdentityProviderGetResponse.AccessOidc - | IdentityProviderGetResponse.AccessOkta - | IdentityProviderGetResponse.AccessOnelogin - | IdentityProviderGetResponse.AccessPingone - | IdentityProviderGetResponse.AccessSaml - | IdentityProviderGetResponse.AccessYandex - | IdentityProviderGetResponse.AccessOnetimepin; +export type IdentityProviderListResponse = Array< + | IdentityProviderListResponse.AccessAzureAd + | IdentityProviderListResponse.AccessCentrify + | IdentityProviderListResponse.AccessFacebook + | IdentityProviderListResponse.AccessGitHub + | IdentityProviderListResponse.AccessGoogle + | IdentityProviderListResponse.AccessGoogleApps + | IdentityProviderListResponse.AccessLinkedin + | IdentityProviderListResponse.AccessOidc + | IdentityProviderListResponse.AccessOkta + | IdentityProviderListResponse.AccessOnelogin + | IdentityProviderListResponse.AccessPingone + | IdentityProviderListResponse.AccessSaml + | IdentityProviderListResponse.AccessYandex +>; -export namespace IdentityProviderGetResponse { +export namespace IdentityProviderListResponse { export interface AccessAzureAd { /** * The configuration parameters for the identity provider. To view the required @@ -4829,111 +4908,32 @@ export namespace IdentityProviderGetResponse { user_deprovision?: boolean; } } +} - export interface AccessOnetimepin { - /** - * The configuration parameters for the identity provider. To view the required - * parameters for a specific provider, refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - */ - config: unknown; - - /** - * The name of the identity provider, shown to users on the login page. - */ - name: string; - - /** - * The type of identity provider. To determine the value for a specific provider, - * refer to our - * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). - */ - type: - | 'onetimepin' - | 'azureAD' - | 'saml' - | 'centrify' - | 'facebook' - | 'github' - | 'google-apps' - | 'google' - | 'linkedin' - | 'oidc' - | 'okta' - | 'onelogin' - | 'pingone' - | 'yandex'; - - /** - * UUID - */ - id?: string; - - /** - * The configuration settings for enabling a System for Cross-Domain Identity - * Management (SCIM) with the identity provider. - */ - scim_config?: AccessOnetimepin.ScimConfig; - } - - export namespace AccessOnetimepin { - /** - * The configuration settings for enabling a System for Cross-Domain Identity - * Management (SCIM) with the identity provider. - */ - export interface ScimConfig { - /** - * A flag to enable or disable SCIM for the identity provider. - */ - enabled?: boolean; - - /** - * A flag to revoke a user's session in Access and force a reauthentication on the - * user's Gateway session when they have been added or removed from a group in the - * Identity Provider. - */ - group_member_deprovision?: boolean; - - /** - * A flag to remove a user's seat in Zero Trust when they have been deprovisioned - * in the Identity Provider. This cannot be enabled unless user_deprovision is also - * enabled. - */ - seat_deprovision?: boolean; - - /** - * A read-only token generated when the SCIM integration is enabled for the first - * time. It is redacted on subsequent requests. If you lose this you will need to - * refresh it token at /access/identity_providers/:idpID/refresh_scim_secret. - */ - secret?: string; - - /** - * A flag to enable revoking a user's session in Access and Gateway when they have - * been deprovisioned in the Identity Provider. - */ - user_deprovision?: boolean; - } - } +export interface IdentityProviderDeleteResponse { + /** + * UUID + */ + id?: string; } -export type IdentityProviderReplaceResponse = - | IdentityProviderReplaceResponse.AccessAzureAd - | IdentityProviderReplaceResponse.AccessCentrify - | IdentityProviderReplaceResponse.AccessFacebook - | IdentityProviderReplaceResponse.AccessGitHub - | IdentityProviderReplaceResponse.AccessGoogle - | IdentityProviderReplaceResponse.AccessGoogleApps - | IdentityProviderReplaceResponse.AccessLinkedin - | IdentityProviderReplaceResponse.AccessOidc - | IdentityProviderReplaceResponse.AccessOkta - | IdentityProviderReplaceResponse.AccessOnelogin - | IdentityProviderReplaceResponse.AccessPingone - | IdentityProviderReplaceResponse.AccessSaml - | IdentityProviderReplaceResponse.AccessYandex - | IdentityProviderReplaceResponse.AccessOnetimepin; - -export namespace IdentityProviderReplaceResponse { +export type IdentityProviderGetResponse = + | IdentityProviderGetResponse.AccessAzureAd + | IdentityProviderGetResponse.AccessCentrify + | IdentityProviderGetResponse.AccessFacebook + | IdentityProviderGetResponse.AccessGitHub + | IdentityProviderGetResponse.AccessGoogle + | IdentityProviderGetResponse.AccessGoogleApps + | IdentityProviderGetResponse.AccessLinkedin + | IdentityProviderGetResponse.AccessOidc + | IdentityProviderGetResponse.AccessOkta + | IdentityProviderGetResponse.AccessOnelogin + | IdentityProviderGetResponse.AccessPingone + | IdentityProviderGetResponse.AccessSaml + | IdentityProviderGetResponse.AccessYandex + | IdentityProviderGetResponse.AccessOnetimepin; + +export namespace IdentityProviderGetResponse { export interface AccessAzureAd { /** * The configuration parameters for the identity provider. To view the required @@ -8117,30 +8117,30 @@ export namespace IdentityProviderCreateParams { } } -export type IdentityProviderReplaceParams = - | IdentityProviderReplaceParams.AccessAzureAd - | IdentityProviderReplaceParams.AccessCentrify - | IdentityProviderReplaceParams.AccessFacebook - | IdentityProviderReplaceParams.AccessGitHub - | IdentityProviderReplaceParams.AccessGoogle - | IdentityProviderReplaceParams.AccessGoogleApps - | IdentityProviderReplaceParams.AccessLinkedin - | IdentityProviderReplaceParams.AccessOidc - | IdentityProviderReplaceParams.AccessOkta - | IdentityProviderReplaceParams.AccessOnelogin - | IdentityProviderReplaceParams.AccessPingone - | IdentityProviderReplaceParams.AccessSaml - | IdentityProviderReplaceParams.AccessYandex - | IdentityProviderReplaceParams.AccessOnetimepin; - -export namespace IdentityProviderReplaceParams { +export type IdentityProviderUpdateParams = + | IdentityProviderUpdateParams.AccessAzureAd + | IdentityProviderUpdateParams.AccessCentrify + | IdentityProviderUpdateParams.AccessFacebook + | IdentityProviderUpdateParams.AccessGitHub + | IdentityProviderUpdateParams.AccessGoogle + | IdentityProviderUpdateParams.AccessGoogleApps + | IdentityProviderUpdateParams.AccessLinkedin + | IdentityProviderUpdateParams.AccessOidc + | IdentityProviderUpdateParams.AccessOkta + | IdentityProviderUpdateParams.AccessOnelogin + | IdentityProviderUpdateParams.AccessPingone + | IdentityProviderUpdateParams.AccessSaml + | IdentityProviderUpdateParams.AccessYandex + | IdentityProviderUpdateParams.AccessOnetimepin; + +export namespace IdentityProviderUpdateParams { export interface AccessAzureAd { /** * The configuration parameters for the identity provider. To view the required * parameters for a specific provider, refer to our * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). */ - config: IdentityProviderReplaceParams.AccessAzureAd.Config; + config: IdentityProviderUpdateParams.AccessAzureAd.Config; /** * The name of the identity provider, shown to users on the login page. @@ -8172,7 +8172,7 @@ export namespace IdentityProviderReplaceParams { * The configuration settings for enabling a System for Cross-Domain Identity * Management (SCIM) with the identity provider. */ - scim_config?: IdentityProviderReplaceParams.AccessAzureAd.ScimConfig; + scim_config?: IdentityProviderUpdateParams.AccessAzureAd.ScimConfig; } export namespace AccessAzureAd { @@ -8263,7 +8263,7 @@ export namespace IdentityProviderReplaceParams { * parameters for a specific provider, refer to our * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). */ - config: IdentityProviderReplaceParams.AccessCentrify.Config; + config: IdentityProviderUpdateParams.AccessCentrify.Config; /** * The name of the identity provider, shown to users on the login page. @@ -8295,7 +8295,7 @@ export namespace IdentityProviderReplaceParams { * The configuration settings for enabling a System for Cross-Domain Identity * Management (SCIM) with the identity provider. */ - scim_config?: IdentityProviderReplaceParams.AccessCentrify.ScimConfig; + scim_config?: IdentityProviderUpdateParams.AccessCentrify.ScimConfig; } export namespace AccessCentrify { @@ -8381,7 +8381,7 @@ export namespace IdentityProviderReplaceParams { * parameters for a specific provider, refer to our * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). */ - config: IdentityProviderReplaceParams.AccessFacebook.Config; + config: IdentityProviderUpdateParams.AccessFacebook.Config; /** * The name of the identity provider, shown to users on the login page. @@ -8413,7 +8413,7 @@ export namespace IdentityProviderReplaceParams { * The configuration settings for enabling a System for Cross-Domain Identity * Management (SCIM) with the identity provider. */ - scim_config?: IdentityProviderReplaceParams.AccessFacebook.ScimConfig; + scim_config?: IdentityProviderUpdateParams.AccessFacebook.ScimConfig; } export namespace AccessFacebook { @@ -8479,7 +8479,7 @@ export namespace IdentityProviderReplaceParams { * parameters for a specific provider, refer to our * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). */ - config: IdentityProviderReplaceParams.AccessGitHub.Config; + config: IdentityProviderUpdateParams.AccessGitHub.Config; /** * The name of the identity provider, shown to users on the login page. @@ -8511,7 +8511,7 @@ export namespace IdentityProviderReplaceParams { * The configuration settings for enabling a System for Cross-Domain Identity * Management (SCIM) with the identity provider. */ - scim_config?: IdentityProviderReplaceParams.AccessGitHub.ScimConfig; + scim_config?: IdentityProviderUpdateParams.AccessGitHub.ScimConfig; } export namespace AccessGitHub { @@ -8577,7 +8577,7 @@ export namespace IdentityProviderReplaceParams { * parameters for a specific provider, refer to our * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). */ - config: IdentityProviderReplaceParams.AccessGoogle.Config; + config: IdentityProviderUpdateParams.AccessGoogle.Config; /** * The name of the identity provider, shown to users on the login page. @@ -8609,7 +8609,7 @@ export namespace IdentityProviderReplaceParams { * The configuration settings for enabling a System for Cross-Domain Identity * Management (SCIM) with the identity provider. */ - scim_config?: IdentityProviderReplaceParams.AccessGoogle.ScimConfig; + scim_config?: IdentityProviderUpdateParams.AccessGoogle.ScimConfig; } export namespace AccessGoogle { @@ -8685,7 +8685,7 @@ export namespace IdentityProviderReplaceParams { * parameters for a specific provider, refer to our * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). */ - config: IdentityProviderReplaceParams.AccessGoogleApps.Config; + config: IdentityProviderUpdateParams.AccessGoogleApps.Config; /** * The name of the identity provider, shown to users on the login page. @@ -8717,7 +8717,7 @@ export namespace IdentityProviderReplaceParams { * The configuration settings for enabling a System for Cross-Domain Identity * Management (SCIM) with the identity provider. */ - scim_config?: IdentityProviderReplaceParams.AccessGoogleApps.ScimConfig; + scim_config?: IdentityProviderUpdateParams.AccessGoogleApps.ScimConfig; } export namespace AccessGoogleApps { @@ -8798,7 +8798,7 @@ export namespace IdentityProviderReplaceParams { * parameters for a specific provider, refer to our * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). */ - config: IdentityProviderReplaceParams.AccessLinkedin.Config; + config: IdentityProviderUpdateParams.AccessLinkedin.Config; /** * The name of the identity provider, shown to users on the login page. @@ -8830,7 +8830,7 @@ export namespace IdentityProviderReplaceParams { * The configuration settings for enabling a System for Cross-Domain Identity * Management (SCIM) with the identity provider. */ - scim_config?: IdentityProviderReplaceParams.AccessLinkedin.ScimConfig; + scim_config?: IdentityProviderUpdateParams.AccessLinkedin.ScimConfig; } export namespace AccessLinkedin { @@ -8896,7 +8896,7 @@ export namespace IdentityProviderReplaceParams { * parameters for a specific provider, refer to our * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). */ - config: IdentityProviderReplaceParams.AccessOidc.Config; + config: IdentityProviderUpdateParams.AccessOidc.Config; /** * The name of the identity provider, shown to users on the login page. @@ -8928,7 +8928,7 @@ export namespace IdentityProviderReplaceParams { * The configuration settings for enabling a System for Cross-Domain Identity * Management (SCIM) with the identity provider. */ - scim_config?: IdentityProviderReplaceParams.AccessOidc.ScimConfig; + scim_config?: IdentityProviderUpdateParams.AccessOidc.ScimConfig; } export namespace AccessOidc { @@ -9024,7 +9024,7 @@ export namespace IdentityProviderReplaceParams { * parameters for a specific provider, refer to our * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). */ - config: IdentityProviderReplaceParams.AccessOkta.Config; + config: IdentityProviderUpdateParams.AccessOkta.Config; /** * The name of the identity provider, shown to users on the login page. @@ -9056,7 +9056,7 @@ export namespace IdentityProviderReplaceParams { * The configuration settings for enabling a System for Cross-Domain Identity * Management (SCIM) with the identity provider. */ - scim_config?: IdentityProviderReplaceParams.AccessOkta.ScimConfig; + scim_config?: IdentityProviderUpdateParams.AccessOkta.ScimConfig; } export namespace AccessOkta { @@ -9142,7 +9142,7 @@ export namespace IdentityProviderReplaceParams { * parameters for a specific provider, refer to our * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). */ - config: IdentityProviderReplaceParams.AccessOnelogin.Config; + config: IdentityProviderUpdateParams.AccessOnelogin.Config; /** * The name of the identity provider, shown to users on the login page. @@ -9174,7 +9174,7 @@ export namespace IdentityProviderReplaceParams { * The configuration settings for enabling a System for Cross-Domain Identity * Management (SCIM) with the identity provider. */ - scim_config?: IdentityProviderReplaceParams.AccessOnelogin.ScimConfig; + scim_config?: IdentityProviderUpdateParams.AccessOnelogin.ScimConfig; } export namespace AccessOnelogin { @@ -9255,7 +9255,7 @@ export namespace IdentityProviderReplaceParams { * parameters for a specific provider, refer to our * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). */ - config: IdentityProviderReplaceParams.AccessPingone.Config; + config: IdentityProviderUpdateParams.AccessPingone.Config; /** * The name of the identity provider, shown to users on the login page. @@ -9287,7 +9287,7 @@ export namespace IdentityProviderReplaceParams { * The configuration settings for enabling a System for Cross-Domain Identity * Management (SCIM) with the identity provider. */ - scim_config?: IdentityProviderReplaceParams.AccessPingone.ScimConfig; + scim_config?: IdentityProviderUpdateParams.AccessPingone.ScimConfig; } export namespace AccessPingone { @@ -9368,7 +9368,7 @@ export namespace IdentityProviderReplaceParams { * parameters for a specific provider, refer to our * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). */ - config: IdentityProviderReplaceParams.AccessSaml.Config; + config: IdentityProviderUpdateParams.AccessSaml.Config; /** * The name of the identity provider, shown to users on the login page. @@ -9400,7 +9400,7 @@ export namespace IdentityProviderReplaceParams { * The configuration settings for enabling a System for Cross-Domain Identity * Management (SCIM) with the identity provider. */ - scim_config?: IdentityProviderReplaceParams.AccessSaml.ScimConfig; + scim_config?: IdentityProviderUpdateParams.AccessSaml.ScimConfig; } export namespace AccessSaml { @@ -9508,7 +9508,7 @@ export namespace IdentityProviderReplaceParams { * parameters for a specific provider, refer to our * [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). */ - config: IdentityProviderReplaceParams.AccessYandex.Config; + config: IdentityProviderUpdateParams.AccessYandex.Config; /** * The name of the identity provider, shown to users on the login page. @@ -9540,7 +9540,7 @@ export namespace IdentityProviderReplaceParams { * The configuration settings for enabling a System for Cross-Domain Identity * Management (SCIM) with the identity provider. */ - scim_config?: IdentityProviderReplaceParams.AccessYandex.ScimConfig; + scim_config?: IdentityProviderUpdateParams.AccessYandex.ScimConfig; } export namespace AccessYandex { @@ -9638,7 +9638,7 @@ export namespace IdentityProviderReplaceParams { * The configuration settings for enabling a System for Cross-Domain Identity * Management (SCIM) with the identity provider. */ - scim_config?: IdentityProviderReplaceParams.AccessOnetimepin.ScimConfig; + scim_config?: IdentityProviderUpdateParams.AccessOnetimepin.ScimConfig; } export namespace AccessOnetimepin { @@ -9684,10 +9684,10 @@ export namespace IdentityProviderReplaceParams { export namespace IdentityProviders { export import IdentityProviderCreateResponse = IdentityProvidersAPI.IdentityProviderCreateResponse; + export import IdentityProviderUpdateResponse = IdentityProvidersAPI.IdentityProviderUpdateResponse; export import IdentityProviderListResponse = IdentityProvidersAPI.IdentityProviderListResponse; export import IdentityProviderDeleteResponse = IdentityProvidersAPI.IdentityProviderDeleteResponse; export import IdentityProviderGetResponse = IdentityProvidersAPI.IdentityProviderGetResponse; - export import IdentityProviderReplaceResponse = IdentityProvidersAPI.IdentityProviderReplaceResponse; export import IdentityProviderCreateParams = IdentityProvidersAPI.IdentityProviderCreateParams; - export import IdentityProviderReplaceParams = IdentityProvidersAPI.IdentityProviderReplaceParams; + export import IdentityProviderUpdateParams = IdentityProvidersAPI.IdentityProviderUpdateParams; } diff --git a/src/resources/access/index.ts b/src/resources/access/index.ts index 057e1ca6cc..bb6019ca54 100644 --- a/src/resources/access/index.ts +++ b/src/resources/access/index.ts @@ -3,94 +3,94 @@ export { Access } from './access'; export { ApplicationCreateResponse, + ApplicationUpdateResponse, ApplicationListResponse, ApplicationDeleteResponse, ApplicationGetResponse, - ApplicationReplaceResponse, ApplicationRevokeTokensResponse, ApplicationCreateParams, - ApplicationReplaceParams, + ApplicationUpdateParams, Applications, } from './applications/index'; export { + BookmarkUpdateResponse, BookmarkListResponse, BookmarkDeleteResponse, BookmarkGetResponse, - BookmarkReplaceResponse, Bookmarks, } from './bookmarks'; export { CertificateCreateResponse, + CertificateUpdateResponse, CertificateListResponse, CertificateDeleteResponse, CertificateGetResponse, - CertificateReplaceResponse, CertificateCreateParams, - CertificateReplaceParams, + CertificateUpdateParams, Certificates, } from './certificates/index'; export { CustomPageCreateResponse, + CustomPageUpdateResponse, CustomPageListResponse, CustomPageDeleteResponse, CustomPageGetResponse, - CustomPageReplaceResponse, CustomPageCreateParams, - CustomPageReplaceParams, + CustomPageUpdateParams, CustomPages, } from './custom-pages'; export { GroupCreateResponse, + GroupUpdateResponse, GroupListResponse, GroupDeleteResponse, GroupGetResponse, - GroupReplaceResponse, GroupCreateParams, - GroupReplaceParams, + GroupUpdateParams, Groups, } from './groups'; export { IdentityProviderCreateResponse, + IdentityProviderUpdateResponse, IdentityProviderListResponse, IdentityProviderDeleteResponse, IdentityProviderGetResponse, - IdentityProviderReplaceResponse, IdentityProviderCreateParams, - IdentityProviderReplaceParams, + IdentityProviderUpdateParams, IdentityProviders, } from './identity-providers'; -export { KeyListResponse, KeyReplaceResponse, KeyRotateResponse, KeyReplaceParams, Keys } from './keys'; +export { KeyUpdateResponse, KeyListResponse, KeyRotateResponse, KeyUpdateParams, Keys } from './keys'; export { Logs } from './logs/index'; export { OrganizationCreateResponse, + OrganizationUpdateResponse, OrganizationListResponse, - OrganizationReplaceResponse, OrganizationRevokeUsersResponse, OrganizationCreateParams, - OrganizationReplaceParams, + OrganizationUpdateParams, OrganizationRevokeUsersParams, Organizations, } from './organizations'; -export { SeatUpdateResponse, SeatUpdateParams, Seats } from './seats'; +export { SeatEditResponse, SeatEditParams, Seats } from './seats'; export { ServiceTokenCreateResponse, + ServiceTokenUpdateResponse, ServiceTokenListResponse, ServiceTokenDeleteResponse, ServiceTokenRefreshResponse, - ServiceTokenReplaceResponse, ServiceTokenRotateResponse, ServiceTokenCreateParams, - ServiceTokenReplaceParams, + ServiceTokenUpdateParams, ServiceTokens, } from './service-tokens'; export { TagCreateResponse, + TagUpdateResponse, TagListResponse, TagDeleteResponse, TagGetResponse, - TagReplaceResponse, TagCreateParams, - TagReplaceParams, + TagUpdateParams, Tags, } from './tags'; export { UserListResponse, Users } from './users/index'; diff --git a/src/resources/access/keys.ts b/src/resources/access/keys.ts index bcfc3e41c7..8f869229f2 100644 --- a/src/resources/access/keys.ts +++ b/src/resources/access/keys.ts @@ -6,27 +6,27 @@ import * as KeysAPI from 'cloudflare/resources/access/keys'; export class Keys extends APIResource { /** - * Gets the Access key rotation settings for an account. + * Updates the Access key rotation settings for an account. */ - list(identifier: string, options?: Core.RequestOptions): Core.APIPromise { + update( + identifier: string, + body: KeyUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { return ( - this._client.get(`/accounts/${identifier}/access/keys`, options) as Core.APIPromise<{ - result: KeyListResponse; + this._client.put(`/accounts/${identifier}/access/keys`, { body, ...options }) as Core.APIPromise<{ + result: KeyUpdateResponse; }> )._thenUnwrap((obj) => obj.result); } /** - * Updates the Access key rotation settings for an account. + * Gets the Access key rotation settings for an account. */ - replace( - identifier: string, - body: KeyReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { + list(identifier: string, options?: Core.RequestOptions): Core.APIPromise { return ( - this._client.put(`/accounts/${identifier}/access/keys`, { body, ...options }) as Core.APIPromise<{ - result: KeyReplaceResponse; + this._client.get(`/accounts/${identifier}/access/keys`, options) as Core.APIPromise<{ + result: KeyListResponse; }> )._thenUnwrap((obj) => obj.result); } @@ -43,13 +43,13 @@ export class Keys extends APIResource { } } -export type KeyListResponse = unknown | string; +export type KeyUpdateResponse = unknown | string; -export type KeyReplaceResponse = unknown | string; +export type KeyListResponse = unknown | string; export type KeyRotateResponse = unknown | string; -export interface KeyReplaceParams { +export interface KeyUpdateParams { /** * The number of days between key rotations. */ @@ -57,8 +57,8 @@ export interface KeyReplaceParams { } export namespace Keys { + export import KeyUpdateResponse = KeysAPI.KeyUpdateResponse; export import KeyListResponse = KeysAPI.KeyListResponse; - export import KeyReplaceResponse = KeysAPI.KeyReplaceResponse; export import KeyRotateResponse = KeysAPI.KeyRotateResponse; - export import KeyReplaceParams = KeysAPI.KeyReplaceParams; + export import KeyUpdateParams = KeysAPI.KeyUpdateParams; } diff --git a/src/resources/access/organizations.ts b/src/resources/access/organizations.ts index 527089807a..f82f8fa79b 100644 --- a/src/resources/access/organizations.ts +++ b/src/resources/access/organizations.ts @@ -23,35 +23,35 @@ export class Organizations extends APIResource { } /** - * Returns the configuration for your Zero Trust organization. + * Updates the configuration for your Zero Trust organization. */ - list( + update( accountOrZone: string, accountOrZoneId: string, + body: OrganizationUpdateParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( - this._client.get( - `/${accountOrZone}/${accountOrZoneId}/access/organizations`, - options, - ) as Core.APIPromise<{ result: OrganizationListResponse }> + this._client.put(`/${accountOrZone}/${accountOrZoneId}/access/organizations`, { + body, + ...options, + }) as Core.APIPromise<{ result: OrganizationUpdateResponse }> )._thenUnwrap((obj) => obj.result); } /** - * Updates the configuration for your Zero Trust organization. + * Returns the configuration for your Zero Trust organization. */ - replace( + list( accountOrZone: string, accountOrZoneId: string, - body: OrganizationReplaceParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( - this._client.put(`/${accountOrZone}/${accountOrZoneId}/access/organizations`, { - body, - ...options, - }) as Core.APIPromise<{ result: OrganizationReplaceResponse }> + this._client.get( + `/${accountOrZone}/${accountOrZoneId}/access/organizations`, + options, + ) as Core.APIPromise<{ result: OrganizationListResponse }> )._thenUnwrap((obj) => obj.result); } @@ -179,7 +179,7 @@ export namespace OrganizationCreateResponse { } } -export interface OrganizationListResponse { +export interface OrganizationUpdateResponse { /** * When set to true, users can authenticate via WARP for any application in your * organization. Application settings will take precedence over this value. @@ -199,7 +199,7 @@ export interface OrganizationListResponse { created_at?: string; - custom_pages?: OrganizationListResponse.CustomPages; + custom_pages?: OrganizationUpdateResponse.CustomPages; /** * Lock all settings as Read-Only in the Dashboard, regardless of user permission. @@ -207,7 +207,7 @@ export interface OrganizationListResponse { */ is_ui_read_only?: boolean; - login_design?: OrganizationListResponse.LoginDesign; + login_design?: OrganizationUpdateResponse.LoginDesign; /** * The name of your Zero Trust organization. @@ -243,7 +243,7 @@ export interface OrganizationListResponse { warp_auth_session_duration?: string; } -export namespace OrganizationListResponse { +export namespace OrganizationUpdateResponse { export interface CustomPages { /** * The uid of the custom page to use when a user is denied access after failing a @@ -285,7 +285,7 @@ export namespace OrganizationListResponse { } } -export interface OrganizationReplaceResponse { +export interface OrganizationListResponse { /** * When set to true, users can authenticate via WARP for any application in your * organization. Application settings will take precedence over this value. @@ -305,7 +305,7 @@ export interface OrganizationReplaceResponse { created_at?: string; - custom_pages?: OrganizationReplaceResponse.CustomPages; + custom_pages?: OrganizationListResponse.CustomPages; /** * Lock all settings as Read-Only in the Dashboard, regardless of user permission. @@ -313,7 +313,7 @@ export interface OrganizationReplaceResponse { */ is_ui_read_only?: boolean; - login_design?: OrganizationReplaceResponse.LoginDesign; + login_design?: OrganizationListResponse.LoginDesign; /** * The name of your Zero Trust organization. @@ -349,7 +349,7 @@ export interface OrganizationReplaceResponse { warp_auth_session_duration?: string; } -export namespace OrganizationReplaceResponse { +export namespace OrganizationListResponse { export interface CustomPages { /** * The uid of the custom page to use when a user is denied access after failing a @@ -480,7 +480,7 @@ export namespace OrganizationCreateParams { } } -export interface OrganizationReplaceParams { +export interface OrganizationUpdateParams { /** * When set to true, users can authenticate via WARP for any application in your * organization. Application settings will take precedence over this value. @@ -498,7 +498,7 @@ export interface OrganizationReplaceParams { */ auto_redirect_to_identity?: boolean; - custom_pages?: OrganizationReplaceParams.CustomPages; + custom_pages?: OrganizationUpdateParams.CustomPages; /** * Lock all settings as Read-Only in the Dashboard, regardless of user permission. @@ -506,7 +506,7 @@ export interface OrganizationReplaceParams { */ is_ui_read_only?: boolean; - login_design?: OrganizationReplaceParams.LoginDesign; + login_design?: OrganizationUpdateParams.LoginDesign; /** * The name of your Zero Trust organization. @@ -540,7 +540,7 @@ export interface OrganizationReplaceParams { warp_auth_session_duration?: string; } -export namespace OrganizationReplaceParams { +export namespace OrganizationUpdateParams { export interface CustomPages { /** * The uid of the custom page to use when a user is denied access after failing a @@ -591,10 +591,10 @@ export interface OrganizationRevokeUsersParams { export namespace Organizations { export import OrganizationCreateResponse = OrganizationsAPI.OrganizationCreateResponse; + export import OrganizationUpdateResponse = OrganizationsAPI.OrganizationUpdateResponse; export import OrganizationListResponse = OrganizationsAPI.OrganizationListResponse; - export import OrganizationReplaceResponse = OrganizationsAPI.OrganizationReplaceResponse; export import OrganizationRevokeUsersResponse = OrganizationsAPI.OrganizationRevokeUsersResponse; export import OrganizationCreateParams = OrganizationsAPI.OrganizationCreateParams; - export import OrganizationReplaceParams = OrganizationsAPI.OrganizationReplaceParams; + export import OrganizationUpdateParams = OrganizationsAPI.OrganizationUpdateParams; export import OrganizationRevokeUsersParams = OrganizationsAPI.OrganizationRevokeUsersParams; } diff --git a/src/resources/access/seats.ts b/src/resources/access/seats.ts index 536e097d0e..51be553768 100644 --- a/src/resources/access/seats.ts +++ b/src/resources/access/seats.ts @@ -9,23 +9,23 @@ export class Seats extends APIResource { * Removes a user from a Zero Trust seat when both `access_seat` and `gateway_seat` * are set to false. */ - update( + edit( identifier: string, - body: SeatUpdateParams, + body: SeatEditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.patch(`/accounts/${identifier}/access/seats`, { body, ...options }) as Core.APIPromise<{ - result: SeatUpdateResponse | null; + result: SeatEditResponse | null; }> )._thenUnwrap((obj) => obj.result); } } -export type SeatUpdateResponse = Array; +export type SeatEditResponse = Array; -export namespace SeatUpdateResponse { - export interface SeatUpdateResponseItem { +export namespace SeatEditResponse { + export interface SeatEditResponseItem { /** * True if the seat is part of Access. */ @@ -47,9 +47,9 @@ export namespace SeatUpdateResponse { } } -export type SeatUpdateParams = Array; +export type SeatEditParams = Array; -export namespace SeatUpdateParams { +export namespace SeatEditParams { export interface Body { /** * True if the seat is part of Access. @@ -64,6 +64,6 @@ export namespace SeatUpdateParams { } export namespace Seats { - export import SeatUpdateResponse = SeatsAPI.SeatUpdateResponse; - export import SeatUpdateParams = SeatsAPI.SeatUpdateParams; + export import SeatEditResponse = SeatsAPI.SeatEditResponse; + export import SeatEditParams = SeatsAPI.SeatEditParams; } diff --git a/src/resources/access/service-tokens.ts b/src/resources/access/service-tokens.ts index c322e5a4cf..c3c2f7ed56 100644 --- a/src/resources/access/service-tokens.ts +++ b/src/resources/access/service-tokens.ts @@ -24,6 +24,24 @@ export class ServiceTokens extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Updates a configured service token. + */ + update( + accountOrZone: string, + accountOrZoneId: string, + uuid: string, + body: ServiceTokenUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/${accountOrZone}/${accountOrZoneId}/access/service_tokens/${uuid}`, { + body, + ...options, + }) as Core.APIPromise<{ result: ServiceTokenUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * Lists all service tokens. */ @@ -73,24 +91,6 @@ export class ServiceTokens extends APIResource { )._thenUnwrap((obj) => obj.result); } - /** - * Updates a configured service token. - */ - replace( - accountOrZone: string, - accountOrZoneId: string, - uuid: string, - body: ServiceTokenReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put(`/${accountOrZone}/${accountOrZoneId}/access/service_tokens/${uuid}`, { - body, - ...options, - }) as Core.APIPromise<{ result: ServiceTokenReplaceResponse }> - )._thenUnwrap((obj) => obj.result); - } - /** * Generates a new Client Secret for a service token and revokes the old one. */ @@ -143,6 +143,35 @@ export interface ServiceTokenCreateResponse { updated_at?: string; } +export interface ServiceTokenUpdateResponse { + /** + * The ID of the service token. + */ + id?: unknown; + + /** + * The Client ID for the service token. Access will check for this value in the + * `CF-Access-Client-ID` request header. + */ + client_id?: string; + + created_at?: string; + + /** + * The duration for how long the service token will be valid. Must be in the format + * `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, m, h. The + * default is 1 year in hours (8760h). + */ + duration?: string; + + /** + * The name of the service token. + */ + name?: string; + + updated_at?: string; +} + export type ServiceTokenListResponse = Array; export namespace ServiceTokenListResponse { @@ -234,35 +263,6 @@ export interface ServiceTokenRefreshResponse { updated_at?: string; } -export interface ServiceTokenReplaceResponse { - /** - * The ID of the service token. - */ - id?: unknown; - - /** - * The Client ID for the service token. Access will check for this value in the - * `CF-Access-Client-ID` request header. - */ - client_id?: string; - - created_at?: string; - - /** - * The duration for how long the service token will be valid. Must be in the format - * `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, m, h. The - * default is 1 year in hours (8760h). - */ - duration?: string; - - /** - * The name of the service token. - */ - name?: string; - - updated_at?: string; -} - export interface ServiceTokenRotateResponse { /** * The ID of the service token. @@ -312,7 +312,7 @@ export interface ServiceTokenCreateParams { duration?: string; } -export interface ServiceTokenReplaceParams { +export interface ServiceTokenUpdateParams { /** * The duration for how long the service token will be valid. Must be in the format * `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, m, h. The @@ -328,11 +328,11 @@ export interface ServiceTokenReplaceParams { export namespace ServiceTokens { export import ServiceTokenCreateResponse = ServiceTokensAPI.ServiceTokenCreateResponse; + export import ServiceTokenUpdateResponse = ServiceTokensAPI.ServiceTokenUpdateResponse; export import ServiceTokenListResponse = ServiceTokensAPI.ServiceTokenListResponse; export import ServiceTokenDeleteResponse = ServiceTokensAPI.ServiceTokenDeleteResponse; export import ServiceTokenRefreshResponse = ServiceTokensAPI.ServiceTokenRefreshResponse; - export import ServiceTokenReplaceResponse = ServiceTokensAPI.ServiceTokenReplaceResponse; export import ServiceTokenRotateResponse = ServiceTokensAPI.ServiceTokenRotateResponse; export import ServiceTokenCreateParams = ServiceTokensAPI.ServiceTokenCreateParams; - export import ServiceTokenReplaceParams = ServiceTokensAPI.ServiceTokenReplaceParams; + export import ServiceTokenUpdateParams = ServiceTokensAPI.ServiceTokenUpdateParams; } diff --git a/src/resources/access/tags.ts b/src/resources/access/tags.ts index 6d963a4b38..c1222e4505 100644 --- a/src/resources/access/tags.ts +++ b/src/resources/access/tags.ts @@ -20,6 +20,23 @@ export class Tags extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Update a tag + */ + update( + identifier: string, + tagName: string, + body: TagUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/accounts/${identifier}/access/tags/${tagName}`, { + body, + ...options, + }) as Core.APIPromise<{ result: TagUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * List tags */ @@ -56,29 +73,31 @@ export class Tags extends APIResource { }> )._thenUnwrap((obj) => obj.result); } +} +/** + * A tag + */ +export interface TagCreateResponse { /** - * Update a tag + * The name of the tag */ - replace( - identifier: string, - tagName: string, - body: TagReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put(`/accounts/${identifier}/access/tags/${tagName}`, { - body, - ...options, - }) as Core.APIPromise<{ result: TagReplaceResponse }> - )._thenUnwrap((obj) => obj.result); - } + name: string; + + /** + * The number of applications that have this tag + */ + app_count?: number; + + created_at?: string; + + updated_at?: string; } /** * A tag */ -export interface TagCreateResponse { +export interface TagUpdateResponse { /** * The name of the tag */ @@ -143,25 +162,6 @@ export interface TagGetResponse { updated_at?: string; } -/** - * A tag - */ -export interface TagReplaceResponse { - /** - * The name of the tag - */ - name: string; - - /** - * The number of applications that have this tag - */ - app_count?: number; - - created_at?: string; - - updated_at?: string; -} - export interface TagCreateParams { /** * The name of the tag @@ -169,7 +169,7 @@ export interface TagCreateParams { name: string; } -export interface TagReplaceParams { +export interface TagUpdateParams { /** * The name of the tag */ @@ -178,10 +178,10 @@ export interface TagReplaceParams { export namespace Tags { export import TagCreateResponse = TagsAPI.TagCreateResponse; + export import TagUpdateResponse = TagsAPI.TagUpdateResponse; export import TagListResponse = TagsAPI.TagListResponse; export import TagDeleteResponse = TagsAPI.TagDeleteResponse; export import TagGetResponse = TagsAPI.TagGetResponse; - export import TagReplaceResponse = TagsAPI.TagReplaceResponse; export import TagCreateParams = TagsAPI.TagCreateParams; - export import TagReplaceParams = TagsAPI.TagReplaceParams; + export import TagUpdateParams = TagsAPI.TagUpdateParams; } diff --git a/src/resources/account-members.ts b/src/resources/account-members.ts index f029c12f58..0d9d415597 100644 --- a/src/resources/account-members.ts +++ b/src/resources/account-members.ts @@ -22,6 +22,23 @@ export class AccountMembers extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Modify an account member. + */ + update( + accountId: unknown, + memberId: string, + body: AccountMemberUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/accounts/${accountId}/members/${memberId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: AccountMemberUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * List all members of an account. */ @@ -78,23 +95,6 @@ export class AccountMembers extends APIResource { }> )._thenUnwrap((obj) => obj.result); } - - /** - * Modify an account member. - */ - replace( - accountId: unknown, - memberId: string, - body: AccountMemberReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put(`/accounts/${accountId}/members/${memberId}`, { - body, - ...options, - }) as Core.APIPromise<{ result: AccountMemberReplaceResponse }> - )._thenUnwrap((obj) => obj.result); - } } export class AccountMemberListResponsesV4PagePaginationArray extends V4PagePaginationArray {} @@ -271,65 +271,7 @@ export namespace AccountMemberCreateResponse { } } -export interface AccountMemberListResponse { - /** - * Identifier - */ - id: string; - - /** - * The contact email address of the user. - */ - email: string; - - /** - * Member Name. - */ - name: string | null; - - /** - * Roles assigned to this Member. - */ - roles: Array; - - /** - * A member's status in the organization. - */ - status: 'accepted' | 'invited'; -} - -export namespace AccountMemberListResponse { - export interface Role { - /** - * Role identifier tag. - */ - id: string; - - /** - * Description of role's permissions. - */ - description: string; - - /** - * Role Name. - */ - name: string; - - /** - * Access permissions for this User. - */ - permissions: Array; - } -} - -export interface AccountMemberDeleteResponse { - /** - * Identifier - */ - id: string; -} - -export interface AccountMemberGetResponse { +export interface AccountMemberUpdateResponse { /** * Membership identifier tag. */ @@ -338,14 +280,14 @@ export interface AccountMemberGetResponse { /** * Roles assigned to this member. */ - roles: Array; + roles: Array; status: unknown; - user: AccountMemberGetResponse.User; + user: AccountMemberUpdateResponse.User; } -export namespace AccountMemberGetResponse { +export namespace AccountMemberUpdateResponse { export interface Role { /** * Role identifier tag. @@ -496,7 +438,65 @@ export namespace AccountMemberGetResponse { } } -export interface AccountMemberReplaceResponse { +export interface AccountMemberListResponse { + /** + * Identifier + */ + id: string; + + /** + * The contact email address of the user. + */ + email: string; + + /** + * Member Name. + */ + name: string | null; + + /** + * Roles assigned to this Member. + */ + roles: Array; + + /** + * A member's status in the organization. + */ + status: 'accepted' | 'invited'; +} + +export namespace AccountMemberListResponse { + export interface Role { + /** + * Role identifier tag. + */ + id: string; + + /** + * Description of role's permissions. + */ + description: string; + + /** + * Role Name. + */ + name: string; + + /** + * Access permissions for this User. + */ + permissions: Array; + } +} + +export interface AccountMemberDeleteResponse { + /** + * Identifier + */ + id: string; +} + +export interface AccountMemberGetResponse { /** * Membership identifier tag. */ @@ -505,14 +505,14 @@ export interface AccountMemberReplaceResponse { /** * Roles assigned to this member. */ - roles: Array; + roles: Array; status: unknown; - user: AccountMemberReplaceResponse.User; + user: AccountMemberGetResponse.User; } -export namespace AccountMemberReplaceResponse { +export namespace AccountMemberGetResponse { export interface Role { /** * Role identifier tag. @@ -677,6 +677,22 @@ export interface AccountMemberCreateParams { status?: 'accepted' | 'pending'; } +export interface AccountMemberUpdateParams { + /** + * Roles assigned to this member. + */ + roles: Array; +} + +export namespace AccountMemberUpdateParams { + export interface Role { + /** + * Role identifier tag. + */ + id: string; + } +} + export interface AccountMemberListParams extends V4PagePaginationArrayParams { /** * Direction to order results. @@ -694,30 +710,14 @@ export interface AccountMemberListParams extends V4PagePaginationArrayParams { status?: 'accepted' | 'pending' | 'rejected'; } -export interface AccountMemberReplaceParams { - /** - * Roles assigned to this member. - */ - roles: Array; -} - -export namespace AccountMemberReplaceParams { - export interface Role { - /** - * Role identifier tag. - */ - id: string; - } -} - export namespace AccountMembers { export import AccountMemberCreateResponse = AccountMembersAPI.AccountMemberCreateResponse; + export import AccountMemberUpdateResponse = AccountMembersAPI.AccountMemberUpdateResponse; export import AccountMemberListResponse = AccountMembersAPI.AccountMemberListResponse; export import AccountMemberDeleteResponse = AccountMembersAPI.AccountMemberDeleteResponse; export import AccountMemberGetResponse = AccountMembersAPI.AccountMemberGetResponse; - export import AccountMemberReplaceResponse = AccountMembersAPI.AccountMemberReplaceResponse; export import AccountMemberListResponsesV4PagePaginationArray = AccountMembersAPI.AccountMemberListResponsesV4PagePaginationArray; export import AccountMemberCreateParams = AccountMembersAPI.AccountMemberCreateParams; + export import AccountMemberUpdateParams = AccountMembersAPI.AccountMemberUpdateParams; export import AccountMemberListParams = AccountMembersAPI.AccountMemberListParams; - export import AccountMemberReplaceParams = AccountMembersAPI.AccountMemberReplaceParams; } diff --git a/src/resources/accounts.ts b/src/resources/accounts.ts index 7a4a57df7a..77daa91a59 100644 --- a/src/resources/accounts.ts +++ b/src/resources/accounts.ts @@ -7,6 +7,21 @@ import * as AccountsAPI from 'cloudflare/resources/accounts'; import { V4PagePaginationArray, type V4PagePaginationArrayParams } from 'cloudflare/pagination'; export class Accounts extends APIResource { + /** + * Update an existing account. + */ + update( + accountId: unknown, + body: AccountUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/accounts/${accountId}`, { body, ...options }) as Core.APIPromise<{ + result: AccountUpdateResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + /** * List all accounts you have ownership or verified access to. */ @@ -38,39 +53,17 @@ export class Accounts extends APIResource { this._client.get(`/accounts/${accountId}`, options) as Core.APIPromise<{ result: AccountGetResponse }> )._thenUnwrap((obj) => obj.result); } - - /** - * Update an existing account. - */ - replace( - accountId: unknown, - body: AccountReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put(`/accounts/${accountId}`, { body, ...options }) as Core.APIPromise<{ - result: AccountReplaceResponse; - }> - )._thenUnwrap((obj) => obj.result); - } } export class AccountListResponsesV4PagePaginationArray extends V4PagePaginationArray {} +export type AccountUpdateResponse = unknown | string | null; + export type AccountListResponse = unknown; export type AccountGetResponse = unknown | string | null; -export type AccountReplaceResponse = unknown | string | null; - -export interface AccountListParams extends V4PagePaginationArrayParams { - /** - * Direction to order results. - */ - direction?: 'asc' | 'desc'; -} - -export interface AccountReplaceParams { +export interface AccountUpdateParams { /** * Account name */ @@ -79,10 +72,10 @@ export interface AccountReplaceParams { /** * Account settings */ - settings?: AccountReplaceParams.Settings; + settings?: AccountUpdateParams.Settings; } -export namespace AccountReplaceParams { +export namespace AccountUpdateParams { /** * Account settings */ @@ -117,11 +110,18 @@ export namespace AccountReplaceParams { } } +export interface AccountListParams extends V4PagePaginationArrayParams { + /** + * Direction to order results. + */ + direction?: 'asc' | 'desc'; +} + export namespace Accounts { + export import AccountUpdateResponse = AccountsAPI.AccountUpdateResponse; export import AccountListResponse = AccountsAPI.AccountListResponse; export import AccountGetResponse = AccountsAPI.AccountGetResponse; - export import AccountReplaceResponse = AccountsAPI.AccountReplaceResponse; export import AccountListResponsesV4PagePaginationArray = AccountsAPI.AccountListResponsesV4PagePaginationArray; + export import AccountUpdateParams = AccountsAPI.AccountUpdateParams; export import AccountListParams = AccountsAPI.AccountListParams; - export import AccountReplaceParams = AccountsAPI.AccountReplaceParams; } diff --git a/src/resources/activation-checks.ts b/src/resources/activation-checks.ts index 1121c78314..ef7251bcad 100644 --- a/src/resources/activation-checks.ts +++ b/src/resources/activation-checks.ts @@ -9,16 +9,16 @@ export class ActivationChecks extends APIResource { * Triggeres a new activation check for a PENDING Zone. This can be triggered every * 5 min for paygo/ent customers, every hour for FREE Zones. */ - replace(zoneId: string, options?: Core.RequestOptions): Core.APIPromise { + update(zoneId: string, options?: Core.RequestOptions): Core.APIPromise { return ( this._client.put(`/zones/${zoneId}/activation_check`, options) as Core.APIPromise<{ - result: ActivationCheckReplaceResponse; + result: ActivationCheckUpdateResponse; }> )._thenUnwrap((obj) => obj.result); } } -export interface ActivationCheckReplaceResponse { +export interface ActivationCheckUpdateResponse { /** * Identifier */ @@ -26,5 +26,5 @@ export interface ActivationCheckReplaceResponse { } export namespace ActivationChecks { - export import ActivationCheckReplaceResponse = ActivationChecksAPI.ActivationCheckReplaceResponse; + export import ActivationCheckUpdateResponse = ActivationChecksAPI.ActivationCheckUpdateResponse; } diff --git a/src/resources/addresses/address-maps/accounts.ts b/src/resources/addresses/address-maps/accounts.ts index 09615127c6..1249583725 100644 --- a/src/resources/addresses/address-maps/accounts.ts +++ b/src/resources/addresses/address-maps/accounts.ts @@ -6,43 +6,43 @@ import * as AccountsAPI from 'cloudflare/resources/addresses/address-maps/accoun export class Accounts extends APIResource { /** - * Remove an account as a member of a particular address map. + * Add an account as a member of a particular address map. */ - delete( + update( accountId: string, addressMapId: string, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( - this._client.delete( + this._client.put( `/accounts/${accountId}/addressing/address_maps/${addressMapId}/accounts/:account_id`, options, - ) as Core.APIPromise<{ result: AccountDeleteResponse | null }> + ) as Core.APIPromise<{ result: AccountUpdateResponse | null }> )._thenUnwrap((obj) => obj.result); } /** - * Add an account as a member of a particular address map. + * Remove an account as a member of a particular address map. */ - replace( + delete( accountId: string, addressMapId: string, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( - this._client.put( + this._client.delete( `/accounts/${accountId}/addressing/address_maps/${addressMapId}/accounts/:account_id`, options, - ) as Core.APIPromise<{ result: AccountReplaceResponse | null }> + ) as Core.APIPromise<{ result: AccountDeleteResponse | null }> )._thenUnwrap((obj) => obj.result); } } -export type AccountDeleteResponse = unknown | Array | string; +export type AccountUpdateResponse = unknown | Array | string; -export type AccountReplaceResponse = unknown | Array | string; +export type AccountDeleteResponse = unknown | Array | string; export namespace Accounts { + export import AccountUpdateResponse = AccountsAPI.AccountUpdateResponse; export import AccountDeleteResponse = AccountsAPI.AccountDeleteResponse; - export import AccountReplaceResponse = AccountsAPI.AccountReplaceResponse; } diff --git a/src/resources/addresses/address-maps/address-maps.ts b/src/resources/addresses/address-maps/address-maps.ts index d9ed094f63..3ce08cfdc6 100644 --- a/src/resources/addresses/address-maps/address-maps.ts +++ b/src/resources/addresses/address-maps/address-maps.ts @@ -28,23 +28,6 @@ export class AddressMaps extends APIResource { )._thenUnwrap((obj) => obj.result); } - /** - * Modify properties of an address map owned by the account. - */ - update( - accountId: string, - addressMapId: string, - body: AddressMapUpdateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.patch(`/accounts/${accountId}/addressing/address_maps/${addressMapId}`, { - body, - ...options, - }) as Core.APIPromise<{ result: AddressMapUpdateResponse }> - )._thenUnwrap((obj) => obj.result); - } - /** * List all address maps owned by the account. */ @@ -73,6 +56,23 @@ export class AddressMaps extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Modify properties of an address map owned by the account. + */ + edit( + accountId: string, + addressMapId: string, + body: AddressMapEditParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.patch(`/accounts/${accountId}/addressing/address_maps/${addressMapId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: AddressMapEditResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * Show a particular address map owned by the account. */ @@ -175,50 +175,6 @@ export namespace AddressMapCreateResponse { } } -export interface AddressMapUpdateResponse { - /** - * Identifier - */ - id?: string; - - /** - * If set to false, then the Address Map cannot be deleted via API. This is true - * for Cloudflare-managed maps. - */ - can_delete?: boolean; - - /** - * If set to false, then the IPs on the Address Map cannot be modified via the API. - * This is true for Cloudflare-managed maps. - */ - can_modify_ips?: boolean; - - created_at?: string; - - /** - * If you have legacy TLS clients which do not send the TLS server name indicator, - * then you can specify one default SNI on the map. If Cloudflare receives a TLS - * handshake from a client without an SNI, it will respond with the default SNI on - * those IPs. The default SNI can be any valid zone or subdomain owned by the - * account. - */ - default_sni?: string | null; - - /** - * An optional description field which may be used to describe the types of IPs or - * zones on the map. - */ - description?: string | null; - - /** - * Whether the Address Map is enabled or not. Cloudflare's DNS will not respond - * with IP addresses on an Address Map until the map is enabled. - */ - enabled?: boolean | null; - - modified_at?: string; -} - export type AddressMapListResponse = Array; export namespace AddressMapListResponse { @@ -269,6 +225,50 @@ export namespace AddressMapListResponse { export type AddressMapDeleteResponse = unknown | Array | string; +export interface AddressMapEditResponse { + /** + * Identifier + */ + id?: string; + + /** + * If set to false, then the Address Map cannot be deleted via API. This is true + * for Cloudflare-managed maps. + */ + can_delete?: boolean; + + /** + * If set to false, then the IPs on the Address Map cannot be modified via the API. + * This is true for Cloudflare-managed maps. + */ + can_modify_ips?: boolean; + + created_at?: string; + + /** + * If you have legacy TLS clients which do not send the TLS server name indicator, + * then you can specify one default SNI on the map. If Cloudflare receives a TLS + * handshake from a client without an SNI, it will respond with the default SNI on + * those IPs. The default SNI can be any valid zone or subdomain owned by the + * account. + */ + default_sni?: string | null; + + /** + * An optional description field which may be used to describe the types of IPs or + * zones on the map. + */ + description?: string | null; + + /** + * Whether the Address Map is enabled or not. Cloudflare's DNS will not respond + * with IP addresses on an Address Map until the map is enabled. + */ + enabled?: boolean | null; + + modified_at?: string; +} + export interface AddressMapGetResponse { /** * Identifier @@ -368,7 +368,7 @@ export interface AddressMapCreateParams { enabled?: boolean | null; } -export interface AddressMapUpdateParams { +export interface AddressMapEditParams { /** * If you have legacy TLS clients which do not send the TLS server name indicator, * then you can specify one default SNI on the map. If Cloudflare receives a TLS @@ -393,19 +393,19 @@ export interface AddressMapUpdateParams { export namespace AddressMaps { export import AddressMapCreateResponse = AddressMapsAPI.AddressMapCreateResponse; - export import AddressMapUpdateResponse = AddressMapsAPI.AddressMapUpdateResponse; export import AddressMapListResponse = AddressMapsAPI.AddressMapListResponse; export import AddressMapDeleteResponse = AddressMapsAPI.AddressMapDeleteResponse; + export import AddressMapEditResponse = AddressMapsAPI.AddressMapEditResponse; export import AddressMapGetResponse = AddressMapsAPI.AddressMapGetResponse; export import AddressMapCreateParams = AddressMapsAPI.AddressMapCreateParams; - export import AddressMapUpdateParams = AddressMapsAPI.AddressMapUpdateParams; + export import AddressMapEditParams = AddressMapsAPI.AddressMapEditParams; export import Accounts = AccountsAPI.Accounts; + export import AccountUpdateResponse = AccountsAPI.AccountUpdateResponse; export import AccountDeleteResponse = AccountsAPI.AccountDeleteResponse; - export import AccountReplaceResponse = AccountsAPI.AccountReplaceResponse; export import IPs = IPsAPI.IPs; + export import IPUpdateResponse = IPsAPI.IPUpdateResponse; export import IPDeleteResponse = IPsAPI.IPDeleteResponse; - export import IPReplaceResponse = IPsAPI.IPReplaceResponse; export import Zones = ZonesAPI.Zones; + export import ZoneUpdateResponse = ZonesAPI.ZoneUpdateResponse; export import ZoneDeleteResponse = ZonesAPI.ZoneDeleteResponse; - export import ZoneReplaceResponse = ZonesAPI.ZoneReplaceResponse; } diff --git a/src/resources/addresses/address-maps/index.ts b/src/resources/addresses/address-maps/index.ts index 74261c09ae..55c30479f7 100644 --- a/src/resources/addresses/address-maps/index.ts +++ b/src/resources/addresses/address-maps/index.ts @@ -1,15 +1,15 @@ // File generated from our OpenAPI spec by Stainless. -export { AccountDeleteResponse, AccountReplaceResponse, Accounts } from './accounts'; +export { AccountUpdateResponse, AccountDeleteResponse, Accounts } from './accounts'; export { AddressMapCreateResponse, - AddressMapUpdateResponse, AddressMapListResponse, AddressMapDeleteResponse, + AddressMapEditResponse, AddressMapGetResponse, AddressMapCreateParams, - AddressMapUpdateParams, + AddressMapEditParams, AddressMaps, } from './address-maps'; -export { IPDeleteResponse, IPReplaceResponse, IPs } from './ips'; -export { ZoneDeleteResponse, ZoneReplaceResponse, Zones } from './zones'; +export { IPUpdateResponse, IPDeleteResponse, IPs } from './ips'; +export { ZoneUpdateResponse, ZoneDeleteResponse, Zones } from './zones'; diff --git a/src/resources/addresses/address-maps/ips.ts b/src/resources/addresses/address-maps/ips.ts index feed34a51b..d34941a5d3 100644 --- a/src/resources/addresses/address-maps/ips.ts +++ b/src/resources/addresses/address-maps/ips.ts @@ -6,45 +6,45 @@ import * as IPsAPI from 'cloudflare/resources/addresses/address-maps/ips'; export class IPs extends APIResource { /** - * Remove an IP from a particular address map. + * Add an IP from a prefix owned by the account to a particular address map. */ - delete( + update( accountId: string, addressMapId: string, ipAddress: string, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( - this._client.delete( + this._client.put( `/accounts/${accountId}/addressing/address_maps/${addressMapId}/ips/${ipAddress}`, options, - ) as Core.APIPromise<{ result: IPDeleteResponse | null }> + ) as Core.APIPromise<{ result: IPUpdateResponse | null }> )._thenUnwrap((obj) => obj.result); } /** - * Add an IP from a prefix owned by the account to a particular address map. + * Remove an IP from a particular address map. */ - replace( + delete( accountId: string, addressMapId: string, ipAddress: string, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( - this._client.put( + this._client.delete( `/accounts/${accountId}/addressing/address_maps/${addressMapId}/ips/${ipAddress}`, options, - ) as Core.APIPromise<{ result: IPReplaceResponse | null }> + ) as Core.APIPromise<{ result: IPDeleteResponse | null }> )._thenUnwrap((obj) => obj.result); } } -export type IPDeleteResponse = unknown | Array | string; +export type IPUpdateResponse = unknown | Array | string; -export type IPReplaceResponse = unknown | Array | string; +export type IPDeleteResponse = unknown | Array | string; export namespace IPs { + export import IPUpdateResponse = IPsAPI.IPUpdateResponse; export import IPDeleteResponse = IPsAPI.IPDeleteResponse; - export import IPReplaceResponse = IPsAPI.IPReplaceResponse; } diff --git a/src/resources/addresses/address-maps/zones.ts b/src/resources/addresses/address-maps/zones.ts index 3a03d3c76e..b2fe8bd66b 100644 --- a/src/resources/addresses/address-maps/zones.ts +++ b/src/resources/addresses/address-maps/zones.ts @@ -6,45 +6,45 @@ import * as ZonesAPI from 'cloudflare/resources/addresses/address-maps/zones'; export class Zones extends APIResource { /** - * Remove a zone as a member of a particular address map. + * Add a zone as a member of a particular address map. */ - delete( + update( accountId: string, addressMapId: string, zoneId: string, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( - this._client.delete( + this._client.put( `/accounts/${accountId}/addressing/address_maps/${addressMapId}/zones/${zoneId}`, options, - ) as Core.APIPromise<{ result: ZoneDeleteResponse | null }> + ) as Core.APIPromise<{ result: ZoneUpdateResponse | null }> )._thenUnwrap((obj) => obj.result); } /** - * Add a zone as a member of a particular address map. + * Remove a zone as a member of a particular address map. */ - replace( + delete( accountId: string, addressMapId: string, zoneId: string, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( - this._client.put( + this._client.delete( `/accounts/${accountId}/addressing/address_maps/${addressMapId}/zones/${zoneId}`, options, - ) as Core.APIPromise<{ result: ZoneReplaceResponse | null }> + ) as Core.APIPromise<{ result: ZoneDeleteResponse | null }> )._thenUnwrap((obj) => obj.result); } } -export type ZoneDeleteResponse = unknown | Array | string; +export type ZoneUpdateResponse = unknown | Array | string; -export type ZoneReplaceResponse = unknown | Array | string; +export type ZoneDeleteResponse = unknown | Array | string; export namespace Zones { + export import ZoneUpdateResponse = ZonesAPI.ZoneUpdateResponse; export import ZoneDeleteResponse = ZonesAPI.ZoneDeleteResponse; - export import ZoneReplaceResponse = ZonesAPI.ZoneReplaceResponse; } diff --git a/src/resources/addresses/addresses.ts b/src/resources/addresses/addresses.ts index 6725683ca1..1c1ba328c4 100644 --- a/src/resources/addresses/addresses.ts +++ b/src/resources/addresses/addresses.ts @@ -14,21 +14,21 @@ export class Addresses extends APIResource { export namespace Addresses { export import AddressMaps = AddressMapsAPI.AddressMaps; export import AddressMapCreateResponse = AddressMapsAPI.AddressMapCreateResponse; - export import AddressMapUpdateResponse = AddressMapsAPI.AddressMapUpdateResponse; export import AddressMapListResponse = AddressMapsAPI.AddressMapListResponse; export import AddressMapDeleteResponse = AddressMapsAPI.AddressMapDeleteResponse; + export import AddressMapEditResponse = AddressMapsAPI.AddressMapEditResponse; export import AddressMapGetResponse = AddressMapsAPI.AddressMapGetResponse; export import AddressMapCreateParams = AddressMapsAPI.AddressMapCreateParams; - export import AddressMapUpdateParams = AddressMapsAPI.AddressMapUpdateParams; + export import AddressMapEditParams = AddressMapsAPI.AddressMapEditParams; export import LoaDocuments = LoaDocumentsAPI.LoaDocuments; export import LoaDocumentCreateResponse = LoaDocumentsAPI.LoaDocumentCreateResponse; export import LoaDocumentCreateParams = LoaDocumentsAPI.LoaDocumentCreateParams; export import Prefixes = PrefixesAPI.Prefixes; export import PrefixCreateResponse = PrefixesAPI.PrefixCreateResponse; - export import PrefixUpdateResponse = PrefixesAPI.PrefixUpdateResponse; export import PrefixListResponse = PrefixesAPI.PrefixListResponse; export import PrefixDeleteResponse = PrefixesAPI.PrefixDeleteResponse; + export import PrefixEditResponse = PrefixesAPI.PrefixEditResponse; export import PrefixGetResponse = PrefixesAPI.PrefixGetResponse; export import PrefixCreateParams = PrefixesAPI.PrefixCreateParams; - export import PrefixUpdateParams = PrefixesAPI.PrefixUpdateParams; + export import PrefixEditParams = PrefixesAPI.PrefixEditParams; } diff --git a/src/resources/addresses/index.ts b/src/resources/addresses/index.ts index 0ac3f30ba1..a8ae2707eb 100644 --- a/src/resources/addresses/index.ts +++ b/src/resources/addresses/index.ts @@ -2,23 +2,23 @@ export { AddressMapCreateResponse, - AddressMapUpdateResponse, AddressMapListResponse, AddressMapDeleteResponse, + AddressMapEditResponse, AddressMapGetResponse, AddressMapCreateParams, - AddressMapUpdateParams, + AddressMapEditParams, AddressMaps, } from './address-maps/index'; export { Addresses } from './addresses'; export { LoaDocumentCreateResponse, LoaDocumentCreateParams, LoaDocuments } from './loa-documents/index'; export { PrefixCreateResponse, - PrefixUpdateResponse, PrefixListResponse, PrefixDeleteResponse, + PrefixEditResponse, PrefixGetResponse, PrefixCreateParams, - PrefixUpdateParams, + PrefixEditParams, Prefixes, } from './prefixes/index'; diff --git a/src/resources/addresses/prefixes/bgps/bgps.ts b/src/resources/addresses/prefixes/bgps/bgps.ts index 1f361aca42..ec6de9d6d3 100644 --- a/src/resources/addresses/prefixes/bgps/bgps.ts +++ b/src/resources/addresses/prefixes/bgps/bgps.ts @@ -9,7 +9,7 @@ export class BGPs extends APIResource { export namespace BGPs { export import Statuses = StatusesAPI.Statuses; - export import StatusUpdateResponse = StatusesAPI.StatusUpdateResponse; + export import StatusEditResponse = StatusesAPI.StatusEditResponse; export import StatusGetResponse = StatusesAPI.StatusGetResponse; - export import StatusUpdateParams = StatusesAPI.StatusUpdateParams; + export import StatusEditParams = StatusesAPI.StatusEditParams; } diff --git a/src/resources/addresses/prefixes/bgps/index.ts b/src/resources/addresses/prefixes/bgps/index.ts index 18f1cadfd1..b69350f718 100644 --- a/src/resources/addresses/prefixes/bgps/index.ts +++ b/src/resources/addresses/prefixes/bgps/index.ts @@ -1,4 +1,4 @@ // File generated from our OpenAPI spec by Stainless. export { BGPs } from './bgps'; -export { StatusUpdateResponse, StatusGetResponse, StatusUpdateParams, Statuses } from './statuses'; +export { StatusEditResponse, StatusGetResponse, StatusEditParams, Statuses } from './statuses'; diff --git a/src/resources/addresses/prefixes/bgps/statuses.ts b/src/resources/addresses/prefixes/bgps/statuses.ts index b618ba8f9d..ed22ce855f 100644 --- a/src/resources/addresses/prefixes/bgps/statuses.ts +++ b/src/resources/addresses/prefixes/bgps/statuses.ts @@ -8,17 +8,17 @@ export class Statuses extends APIResource { /** * Advertise or withdraw BGP route for a prefix. */ - update( + edit( accountId: string, prefixId: string, - body: StatusUpdateParams, + body: StatusEditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.patch(`/accounts/${accountId}/addressing/prefixes/${prefixId}/bgp/status`, { body, ...options, - }) as Core.APIPromise<{ result: StatusUpdateResponse }> + }) as Core.APIPromise<{ result: StatusEditResponse }> )._thenUnwrap((obj) => obj.result); } @@ -39,7 +39,7 @@ export class Statuses extends APIResource { } } -export interface StatusUpdateResponse { +export interface StatusEditResponse { /** * Enablement of prefix advertisement to the Internet. */ @@ -65,7 +65,7 @@ export interface StatusGetResponse { advertised_modified_at?: string | null; } -export interface StatusUpdateParams { +export interface StatusEditParams { /** * Enablement of prefix advertisement to the Internet. */ @@ -73,7 +73,7 @@ export interface StatusUpdateParams { } export namespace Statuses { - export import StatusUpdateResponse = StatusesAPI.StatusUpdateResponse; + export import StatusEditResponse = StatusesAPI.StatusEditResponse; export import StatusGetResponse = StatusesAPI.StatusGetResponse; - export import StatusUpdateParams = StatusesAPI.StatusUpdateParams; + export import StatusEditParams = StatusesAPI.StatusEditParams; } diff --git a/src/resources/addresses/prefixes/index.ts b/src/resources/addresses/prefixes/index.ts index 938cedfbe8..c583cf9c5e 100644 --- a/src/resources/addresses/prefixes/index.ts +++ b/src/resources/addresses/prefixes/index.ts @@ -10,11 +10,11 @@ export { } from './delegations'; export { PrefixCreateResponse, - PrefixUpdateResponse, PrefixListResponse, PrefixDeleteResponse, + PrefixEditResponse, PrefixGetResponse, PrefixCreateParams, - PrefixUpdateParams, + PrefixEditParams, Prefixes, } from './prefixes'; diff --git a/src/resources/addresses/prefixes/prefixes.ts b/src/resources/addresses/prefixes/prefixes.ts index eeb31ce056..df1c25163c 100644 --- a/src/resources/addresses/prefixes/prefixes.ts +++ b/src/resources/addresses/prefixes/prefixes.ts @@ -26,23 +26,6 @@ export class Prefixes extends APIResource { )._thenUnwrap((obj) => obj.result); } - /** - * Modify the description for a prefix owned by the account. - */ - update( - accountId: string, - prefixId: string, - body: PrefixUpdateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.patch(`/accounts/${accountId}/addressing/prefixes/${prefixId}`, { - body, - ...options, - }) as Core.APIPromise<{ result: PrefixUpdateResponse }> - )._thenUnwrap((obj) => obj.result); - } - /** * List all prefixes owned by the account. */ @@ -70,6 +53,23 @@ export class Prefixes extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Modify the description for a prefix owned by the account. + */ + edit( + accountId: string, + prefixId: string, + body: PrefixEditParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.patch(`/accounts/${accountId}/addressing/prefixes/${prefixId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: PrefixEditResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * List a particular prefix owned by the account. */ @@ -151,71 +151,6 @@ export interface PrefixCreateResponse { on_demand_locked?: boolean; } -export interface PrefixUpdateResponse { - /** - * Identifier - */ - id?: string; - - /** - * Identifier - */ - account_id?: string; - - /** - * Prefix advertisement status to the Internet. This field is only not 'null' if on - * demand is enabled. - */ - advertised?: boolean | null; - - /** - * Last time the advertisement status was changed. This field is only not 'null' if - * on demand is enabled. - */ - advertised_modified_at?: string | null; - - /** - * Approval state of the prefix (P = pending, V = active). - */ - approved?: string; - - /** - * Autonomous System Number (ASN) the prefix will be advertised under. - */ - asn?: number | null; - - /** - * IP Prefix in Classless Inter-Domain Routing format. - */ - cidr?: string; - - created_at?: string; - - /** - * Description of the prefix. - */ - description?: string; - - /** - * Identifier for the uploaded LOA document. - */ - loa_document_id?: string | null; - - modified_at?: string; - - /** - * Whether advertisement of the prefix to the Internet may be dynamically enabled - * or disabled. - */ - on_demand_enabled?: boolean; - - /** - * Whether advertisement status of the prefix is locked, meaning it cannot be - * changed. - */ - on_demand_locked?: boolean; -} - export type PrefixListResponse = Array; export namespace PrefixListResponse { @@ -287,6 +222,71 @@ export namespace PrefixListResponse { export type PrefixDeleteResponse = unknown | Array | string; +export interface PrefixEditResponse { + /** + * Identifier + */ + id?: string; + + /** + * Identifier + */ + account_id?: string; + + /** + * Prefix advertisement status to the Internet. This field is only not 'null' if on + * demand is enabled. + */ + advertised?: boolean | null; + + /** + * Last time the advertisement status was changed. This field is only not 'null' if + * on demand is enabled. + */ + advertised_modified_at?: string | null; + + /** + * Approval state of the prefix (P = pending, V = active). + */ + approved?: string; + + /** + * Autonomous System Number (ASN) the prefix will be advertised under. + */ + asn?: number | null; + + /** + * IP Prefix in Classless Inter-Domain Routing format. + */ + cidr?: string; + + created_at?: string; + + /** + * Description of the prefix. + */ + description?: string; + + /** + * Identifier for the uploaded LOA document. + */ + loa_document_id?: string | null; + + modified_at?: string; + + /** + * Whether advertisement of the prefix to the Internet may be dynamically enabled + * or disabled. + */ + on_demand_enabled?: boolean; + + /** + * Whether advertisement status of the prefix is locked, meaning it cannot be + * changed. + */ + on_demand_locked?: boolean; +} + export interface PrefixGetResponse { /** * Identifier @@ -369,7 +369,7 @@ export interface PrefixCreateParams { loa_document_id: string | null; } -export interface PrefixUpdateParams { +export interface PrefixEditParams { /** * Description of the prefix. */ @@ -378,12 +378,12 @@ export interface PrefixUpdateParams { export namespace Prefixes { export import PrefixCreateResponse = PrefixesAPI.PrefixCreateResponse; - export import PrefixUpdateResponse = PrefixesAPI.PrefixUpdateResponse; export import PrefixListResponse = PrefixesAPI.PrefixListResponse; export import PrefixDeleteResponse = PrefixesAPI.PrefixDeleteResponse; + export import PrefixEditResponse = PrefixesAPI.PrefixEditResponse; export import PrefixGetResponse = PrefixesAPI.PrefixGetResponse; export import PrefixCreateParams = PrefixesAPI.PrefixCreateParams; - export import PrefixUpdateParams = PrefixesAPI.PrefixUpdateParams; + export import PrefixEditParams = PrefixesAPI.PrefixEditParams; export import BGPs = BGPsAPI.BGPs; export import Delegations = DelegationsAPI.Delegations; export import DelegationCreateResponse = DelegationsAPI.DelegationCreateResponse; diff --git a/src/resources/addressing/prefixes/bgp-prefixes.ts b/src/resources/addressing/prefixes/bgp-prefixes.ts index 75a9662123..faf11cd008 100644 --- a/src/resources/addressing/prefixes/bgp-prefixes.ts +++ b/src/resources/addressing/prefixes/bgp-prefixes.ts @@ -5,25 +5,6 @@ import { APIResource } from 'cloudflare/resource'; import * as BGPPrefixesAPI from 'cloudflare/resources/addressing/prefixes/bgp-prefixes'; export class BGPPrefixes extends APIResource { - /** - * Update the properties of a BGP Prefix, such as the on demand advertisement - * status (advertised or withdrawn). - */ - update( - accountId: string, - prefixId: string, - bgpPrefixId: string, - body: BGPPrefixUpdateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.patch( - `/accounts/${accountId}/addressing/prefixes/${prefixId}/bgp/prefixes/${bgpPrefixId}`, - { body, ...options }, - ) as Core.APIPromise<{ result: BGPPrefixUpdateResponse }> - )._thenUnwrap((obj) => obj.result); - } - /** * List all BGP Prefixes within the specified IP Prefix. BGP Prefixes are used to * control which specific subnets are advertised to the Internet. It is possible to @@ -43,6 +24,25 @@ export class BGPPrefixes extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Update the properties of a BGP Prefix, such as the on demand advertisement + * status (advertised or withdrawn). + */ + edit( + accountId: string, + prefixId: string, + bgpPrefixId: string, + body: BGPPrefixEditParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.patch( + `/accounts/${accountId}/addressing/prefixes/${prefixId}/bgp/prefixes/${bgpPrefixId}`, + { body, ...options }, + ) as Core.APIPromise<{ result: BGPPrefixEditResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * Retrieve a single BGP Prefix according to its identifier */ @@ -61,73 +61,6 @@ export class BGPPrefixes extends APIResource { } } -export interface BGPPrefixUpdateResponse { - /** - * Identifier - */ - id?: string; - - /** - * Autonomous System Number (ASN) the prefix will be advertised under. - */ - asn?: number | null; - - bgp_signal_opts?: BGPPrefixUpdateResponse.BGPSignalOpts; - - /** - * IP Prefix in Classless Inter-Domain Routing format. - */ - cidr?: string; - - created_at?: string; - - modified_at?: string; - - on_demand?: BGPPrefixUpdateResponse.OnDemand; -} - -export namespace BGPPrefixUpdateResponse { - export interface BGPSignalOpts { - /** - * Whether control of advertisement of the prefix to the Internet is enabled to be - * performed via BGP signal - */ - enabled?: boolean; - - /** - * Last time BGP signaling control was toggled. This field is null if BGP signaling - * has never been enabled. - */ - modified_at?: string | null; - } - - export interface OnDemand { - /** - * Prefix advertisement status to the Internet. This field is only not 'null' if on - * demand is enabled. - */ - advertised?: boolean | null; - - /** - * Last time the advertisement status was changed. This field is only not 'null' if - * on demand is enabled. - */ - advertised_modified_at?: string | null; - - /** - * Whether advertisement of the prefix to the Internet may be dynamically enabled - * or disabled. - */ - on_demand_enabled?: boolean; - - /** - * Whether advertisement status of the prefix is locked, meaning it cannot be - * changed. - */ - on_demand_locked?: boolean; - } -} - export type BGPPrefixListResponse = Array; export namespace BGPPrefixListResponse { @@ -199,6 +132,73 @@ export namespace BGPPrefixListResponse { } } +export interface BGPPrefixEditResponse { + /** + * Identifier + */ + id?: string; + + /** + * Autonomous System Number (ASN) the prefix will be advertised under. + */ + asn?: number | null; + + bgp_signal_opts?: BGPPrefixEditResponse.BGPSignalOpts; + + /** + * IP Prefix in Classless Inter-Domain Routing format. + */ + cidr?: string; + + created_at?: string; + + modified_at?: string; + + on_demand?: BGPPrefixEditResponse.OnDemand; +} + +export namespace BGPPrefixEditResponse { + export interface BGPSignalOpts { + /** + * Whether control of advertisement of the prefix to the Internet is enabled to be + * performed via BGP signal + */ + enabled?: boolean; + + /** + * Last time BGP signaling control was toggled. This field is null if BGP signaling + * has never been enabled. + */ + modified_at?: string | null; + } + + export interface OnDemand { + /** + * Prefix advertisement status to the Internet. This field is only not 'null' if on + * demand is enabled. + */ + advertised?: boolean | null; + + /** + * Last time the advertisement status was changed. This field is only not 'null' if + * on demand is enabled. + */ + advertised_modified_at?: string | null; + + /** + * Whether advertisement of the prefix to the Internet may be dynamically enabled + * or disabled. + */ + on_demand_enabled?: boolean; + + /** + * Whether advertisement status of the prefix is locked, meaning it cannot be + * changed. + */ + on_demand_locked?: boolean; + } +} + export interface BGPPrefixGetResponse { /** * Identifier @@ -266,19 +266,19 @@ export namespace BGPPrefixGetResponse { } } -export interface BGPPrefixUpdateParams { - on_demand?: BGPPrefixUpdateParams.OnDemand; +export interface BGPPrefixEditParams { + on_demand?: BGPPrefixEditParams.OnDemand; } -export namespace BGPPrefixUpdateParams { +export namespace BGPPrefixEditParams { export interface OnDemand { advertised?: boolean; } } export namespace BGPPrefixes { - export import BGPPrefixUpdateResponse = BGPPrefixesAPI.BGPPrefixUpdateResponse; export import BGPPrefixListResponse = BGPPrefixesAPI.BGPPrefixListResponse; + export import BGPPrefixEditResponse = BGPPrefixesAPI.BGPPrefixEditResponse; export import BGPPrefixGetResponse = BGPPrefixesAPI.BGPPrefixGetResponse; - export import BGPPrefixUpdateParams = BGPPrefixesAPI.BGPPrefixUpdateParams; + export import BGPPrefixEditParams = BGPPrefixesAPI.BGPPrefixEditParams; } diff --git a/src/resources/addressing/prefixes/index.ts b/src/resources/addressing/prefixes/index.ts index 42508f7e71..9981e5dad7 100644 --- a/src/resources/addressing/prefixes/index.ts +++ b/src/resources/addressing/prefixes/index.ts @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. export { - BGPPrefixUpdateResponse, BGPPrefixListResponse, + BGPPrefixEditResponse, BGPPrefixGetResponse, - BGPPrefixUpdateParams, + BGPPrefixEditParams, BGPPrefixes, } from './bgp-prefixes'; export { diff --git a/src/resources/addressing/prefixes/prefixes.ts b/src/resources/addressing/prefixes/prefixes.ts index ad5b6d0a84..bc70fb12c9 100644 --- a/src/resources/addressing/prefixes/prefixes.ts +++ b/src/resources/addressing/prefixes/prefixes.ts @@ -11,10 +11,10 @@ export class Prefixes extends APIResource { export namespace Prefixes { export import BGPPrefixes = BGPPrefixesAPI.BGPPrefixes; - export import BGPPrefixUpdateResponse = BGPPrefixesAPI.BGPPrefixUpdateResponse; export import BGPPrefixListResponse = BGPPrefixesAPI.BGPPrefixListResponse; + export import BGPPrefixEditResponse = BGPPrefixesAPI.BGPPrefixEditResponse; export import BGPPrefixGetResponse = BGPPrefixesAPI.BGPPrefixGetResponse; - export import BGPPrefixUpdateParams = BGPPrefixesAPI.BGPPrefixUpdateParams; + export import BGPPrefixEditParams = BGPPrefixesAPI.BGPPrefixEditParams; export import Bindings = BindingsAPI.Bindings; export import BindingCreateResponse = BindingsAPI.BindingCreateResponse; export import BindingListResponse = BindingsAPI.BindingListResponse; diff --git a/src/resources/alerting/v3/destinations/destinations.ts b/src/resources/alerting/v3/destinations/destinations.ts index 7c56bfbabd..907dfee08c 100644 --- a/src/resources/alerting/v3/destinations/destinations.ts +++ b/src/resources/alerting/v3/destinations/destinations.ts @@ -21,10 +21,10 @@ export namespace Destinations { export import PagerdutyLinkResponse = PagerdutyAPI.PagerdutyLinkResponse; export import Webhooks = WebhooksAPI.Webhooks; export import WebhookCreateResponse = WebhooksAPI.WebhookCreateResponse; + export import WebhookUpdateResponse = WebhooksAPI.WebhookUpdateResponse; export import WebhookListResponse = WebhooksAPI.WebhookListResponse; export import WebhookDeleteResponse = WebhooksAPI.WebhookDeleteResponse; export import WebhookGetResponse = WebhooksAPI.WebhookGetResponse; - export import WebhookReplaceResponse = WebhooksAPI.WebhookReplaceResponse; export import WebhookCreateParams = WebhooksAPI.WebhookCreateParams; - export import WebhookReplaceParams = WebhooksAPI.WebhookReplaceParams; + export import WebhookUpdateParams = WebhooksAPI.WebhookUpdateParams; } diff --git a/src/resources/alerting/v3/destinations/index.ts b/src/resources/alerting/v3/destinations/index.ts index 445c920bfe..c902804024 100644 --- a/src/resources/alerting/v3/destinations/index.ts +++ b/src/resources/alerting/v3/destinations/index.ts @@ -11,11 +11,11 @@ export { } from './pagerduty'; export { WebhookCreateResponse, + WebhookUpdateResponse, WebhookListResponse, WebhookDeleteResponse, WebhookGetResponse, - WebhookReplaceResponse, WebhookCreateParams, - WebhookReplaceParams, + WebhookUpdateParams, Webhooks, } from './webhooks'; diff --git a/src/resources/alerting/v3/destinations/webhooks.ts b/src/resources/alerting/v3/destinations/webhooks.ts index 65cfee88d7..13aa4215c3 100644 --- a/src/resources/alerting/v3/destinations/webhooks.ts +++ b/src/resources/alerting/v3/destinations/webhooks.ts @@ -21,6 +21,23 @@ export class Webhooks extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Update a webhook destination. + */ + update( + accountId: string, + webhookId: string, + body: WebhookUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/accounts/${accountId}/alerting/v3/destinations/webhooks/${webhookId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: WebhookUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * Gets a list of all configured webhook destinations. */ @@ -64,26 +81,16 @@ export class Webhooks extends APIResource { ) as Core.APIPromise<{ result: WebhookGetResponse }> )._thenUnwrap((obj) => obj.result); } +} +export interface WebhookCreateResponse { /** - * Update a webhook destination. + * UUID */ - replace( - accountId: string, - webhookId: string, - body: WebhookReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put(`/accounts/${accountId}/alerting/v3/destinations/webhooks/${webhookId}`, { - body, - ...options, - }) as Core.APIPromise<{ result: WebhookReplaceResponse }> - )._thenUnwrap((obj) => obj.result); - } + id?: string; } -export interface WebhookCreateResponse { +export interface WebhookUpdateResponse { /** * UUID */ @@ -190,13 +197,6 @@ export interface WebhookGetResponse { url?: string; } -export interface WebhookReplaceResponse { - /** - * UUID - */ - id?: string; -} - export interface WebhookCreateParams { /** * The name of the webhook destination. This will be included in the request body @@ -217,7 +217,7 @@ export interface WebhookCreateParams { secret?: string; } -export interface WebhookReplaceParams { +export interface WebhookUpdateParams { /** * The name of the webhook destination. This will be included in the request body * when you receive a webhook notification. @@ -239,10 +239,10 @@ export interface WebhookReplaceParams { export namespace Webhooks { export import WebhookCreateResponse = WebhooksAPI.WebhookCreateResponse; + export import WebhookUpdateResponse = WebhooksAPI.WebhookUpdateResponse; export import WebhookListResponse = WebhooksAPI.WebhookListResponse; export import WebhookDeleteResponse = WebhooksAPI.WebhookDeleteResponse; export import WebhookGetResponse = WebhooksAPI.WebhookGetResponse; - export import WebhookReplaceResponse = WebhooksAPI.WebhookReplaceResponse; export import WebhookCreateParams = WebhooksAPI.WebhookCreateParams; - export import WebhookReplaceParams = WebhooksAPI.WebhookReplaceParams; + export import WebhookUpdateParams = WebhooksAPI.WebhookUpdateParams; } diff --git a/src/resources/alerting/v3/index.ts b/src/resources/alerting/v3/index.ts index 01a40a9876..0596245947 100644 --- a/src/resources/alerting/v3/index.ts +++ b/src/resources/alerting/v3/index.ts @@ -9,12 +9,12 @@ export { } from './histories'; export { PolicyCreateResponse, + PolicyUpdateResponse, PolicyListResponse, PolicyDeleteResponse, PolicyGetResponse, - PolicyReplaceResponse, PolicyCreateParams, - PolicyReplaceParams, + PolicyUpdateParams, Policies, } from './policies'; export { V3ListResponse, V3 } from './v3'; diff --git a/src/resources/alerting/v3/policies.ts b/src/resources/alerting/v3/policies.ts index 65bdef8706..764b29e4bc 100644 --- a/src/resources/alerting/v3/policies.ts +++ b/src/resources/alerting/v3/policies.ts @@ -21,6 +21,23 @@ export class Policies extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Update a Notification policy. + */ + update( + accountId: string, + policyId: string, + body: PolicyUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/accounts/${accountId}/alerting/v3/policies/${policyId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: PolicyUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * Get a list of all Notification policies. */ @@ -63,26 +80,16 @@ export class Policies extends APIResource { ) as Core.APIPromise<{ result: PolicyGetResponse }> )._thenUnwrap((obj) => obj.result); } +} +export interface PolicyCreateResponse { /** - * Update a Notification policy. + * UUID */ - replace( - accountId: string, - policyId: string, - body: PolicyReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put(`/accounts/${accountId}/alerting/v3/policies/${policyId}`, { - body, - ...options, - }) as Core.APIPromise<{ result: PolicyReplaceResponse }> - )._thenUnwrap((obj) => obj.result); - } + id?: string; } -export interface PolicyCreateResponse { +export interface PolicyUpdateResponse { /** * UUID */ @@ -734,13 +741,6 @@ export namespace PolicyGetResponse { } } -export interface PolicyReplaceResponse { - /** - * UUID - */ - id?: string; -} - export interface PolicyCreateParams { /** * Refers to which event will trigger a Notification dispatch. You can use the @@ -1050,7 +1050,7 @@ export namespace PolicyCreateParams { } } -export interface PolicyReplaceParams { +export interface PolicyUpdateParams { /** * 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 @@ -1127,13 +1127,13 @@ export interface PolicyReplaceParams { * that alert type based on some criteria. This is only available for select alert * types. See alert type documentation for more details. */ - filters?: PolicyReplaceParams.Filters; + filters?: PolicyUpdateParams.Filters; /** * List of IDs that will be used when dispatching a notification. IDs for email * type will be the email address. */ - mechanisms?: Record>; + mechanisms?: Record>; /** * Name of the policy. @@ -1141,7 +1141,7 @@ export interface PolicyReplaceParams { name?: string; } -export namespace PolicyReplaceParams { +export namespace PolicyUpdateParams { /** * 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 @@ -1361,10 +1361,10 @@ export namespace PolicyReplaceParams { export namespace Policies { export import PolicyCreateResponse = PoliciesAPI.PolicyCreateResponse; + export import PolicyUpdateResponse = PoliciesAPI.PolicyUpdateResponse; export import PolicyListResponse = PoliciesAPI.PolicyListResponse; export import PolicyDeleteResponse = PoliciesAPI.PolicyDeleteResponse; export import PolicyGetResponse = PoliciesAPI.PolicyGetResponse; - export import PolicyReplaceResponse = PoliciesAPI.PolicyReplaceResponse; export import PolicyCreateParams = PoliciesAPI.PolicyCreateParams; - export import PolicyReplaceParams = PoliciesAPI.PolicyReplaceParams; + export import PolicyUpdateParams = PoliciesAPI.PolicyUpdateParams; } diff --git a/src/resources/alerting/v3/v3.ts b/src/resources/alerting/v3/v3.ts index 1d363914b2..cca26041f2 100644 --- a/src/resources/alerting/v3/v3.ts +++ b/src/resources/alerting/v3/v3.ts @@ -35,10 +35,10 @@ export namespace V3 { export import HistoryListParams = HistoriesAPI.HistoryListParams; export import Policies = PoliciesAPI.Policies; export import PolicyCreateResponse = PoliciesAPI.PolicyCreateResponse; + export import PolicyUpdateResponse = PoliciesAPI.PolicyUpdateResponse; export import PolicyListResponse = PoliciesAPI.PolicyListResponse; export import PolicyDeleteResponse = PoliciesAPI.PolicyDeleteResponse; export import PolicyGetResponse = PoliciesAPI.PolicyGetResponse; - export import PolicyReplaceResponse = PoliciesAPI.PolicyReplaceResponse; export import PolicyCreateParams = PoliciesAPI.PolicyCreateParams; - export import PolicyReplaceParams = PoliciesAPI.PolicyReplaceParams; + export import PolicyUpdateParams = PoliciesAPI.PolicyUpdateParams; } diff --git a/src/resources/argo/argo.ts b/src/resources/argo/argo.ts index c09a4c7338..72541c8660 100644 --- a/src/resources/argo/argo.ts +++ b/src/resources/argo/argo.ts @@ -11,11 +11,11 @@ export class Argo extends APIResource { export namespace Argo { export import SmartRouting = SmartRoutingAPI.SmartRouting; - export import SmartRoutingUpdateResponse = SmartRoutingAPI.SmartRoutingUpdateResponse; + export import SmartRoutingEditResponse = SmartRoutingAPI.SmartRoutingEditResponse; export import SmartRoutingGetResponse = SmartRoutingAPI.SmartRoutingGetResponse; - export import SmartRoutingUpdateParams = SmartRoutingAPI.SmartRoutingUpdateParams; + export import SmartRoutingEditParams = SmartRoutingAPI.SmartRoutingEditParams; export import TieredCaching = TieredCachingAPI.TieredCaching; - export import TieredCachingUpdateResponse = TieredCachingAPI.TieredCachingUpdateResponse; + export import TieredCachingEditResponse = TieredCachingAPI.TieredCachingEditResponse; export import TieredCachingGetResponse = TieredCachingAPI.TieredCachingGetResponse; - export import TieredCachingUpdateParams = TieredCachingAPI.TieredCachingUpdateParams; + export import TieredCachingEditParams = TieredCachingAPI.TieredCachingEditParams; } diff --git a/src/resources/argo/index.ts b/src/resources/argo/index.ts index 2b765b1e8c..14f276282e 100644 --- a/src/resources/argo/index.ts +++ b/src/resources/argo/index.ts @@ -2,14 +2,14 @@ export { Argo } from './argo'; export { - SmartRoutingUpdateResponse, + SmartRoutingEditResponse, SmartRoutingGetResponse, - SmartRoutingUpdateParams, + SmartRoutingEditParams, SmartRouting, } from './smart-routing'; export { - TieredCachingUpdateResponse, + TieredCachingEditResponse, TieredCachingGetResponse, - TieredCachingUpdateParams, + TieredCachingEditParams, TieredCaching, } from './tiered-caching'; diff --git a/src/resources/argo/smart-routing.ts b/src/resources/argo/smart-routing.ts index 47d4f66c49..7bd998f942 100644 --- a/src/resources/argo/smart-routing.ts +++ b/src/resources/argo/smart-routing.ts @@ -8,14 +8,14 @@ export class SmartRouting extends APIResource { /** * Updates enablement of Argo Smart Routing. */ - update( + edit( zoneId: string, - body: SmartRoutingUpdateParams, + body: SmartRoutingEditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.patch(`/zones/${zoneId}/argo/smart_routing`, { body, ...options }) as Core.APIPromise<{ - result: SmartRoutingUpdateResponse; + result: SmartRoutingEditResponse; }> )._thenUnwrap((obj) => obj.result); } @@ -32,11 +32,11 @@ export class SmartRouting extends APIResource { } } -export type SmartRoutingUpdateResponse = unknown | string | null; +export type SmartRoutingEditResponse = unknown | string | null; export type SmartRoutingGetResponse = unknown | string | null; -export interface SmartRoutingUpdateParams { +export interface SmartRoutingEditParams { /** * Enables Argo Smart Routing. */ @@ -44,7 +44,7 @@ export interface SmartRoutingUpdateParams { } export namespace SmartRouting { - export import SmartRoutingUpdateResponse = SmartRoutingAPI.SmartRoutingUpdateResponse; + export import SmartRoutingEditResponse = SmartRoutingAPI.SmartRoutingEditResponse; export import SmartRoutingGetResponse = SmartRoutingAPI.SmartRoutingGetResponse; - export import SmartRoutingUpdateParams = SmartRoutingAPI.SmartRoutingUpdateParams; + export import SmartRoutingEditParams = SmartRoutingAPI.SmartRoutingEditParams; } diff --git a/src/resources/argo/tiered-caching.ts b/src/resources/argo/tiered-caching.ts index a4a5c89643..62b1a88845 100644 --- a/src/resources/argo/tiered-caching.ts +++ b/src/resources/argo/tiered-caching.ts @@ -8,14 +8,14 @@ export class TieredCaching extends APIResource { /** * Updates enablement of Tiered Caching */ - update( + edit( zoneId: string, - body: TieredCachingUpdateParams, + body: TieredCachingEditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.patch(`/zones/${zoneId}/argo/tiered_caching`, { body, ...options }) as Core.APIPromise<{ - result: TieredCachingUpdateResponse; + result: TieredCachingEditResponse; }> )._thenUnwrap((obj) => obj.result); } @@ -32,11 +32,11 @@ export class TieredCaching extends APIResource { } } -export type TieredCachingUpdateResponse = unknown | string | null; +export type TieredCachingEditResponse = unknown | string | null; export type TieredCachingGetResponse = unknown | string | null; -export interface TieredCachingUpdateParams { +export interface TieredCachingEditParams { /** * Enables Tiered Caching. */ @@ -44,7 +44,7 @@ export interface TieredCachingUpdateParams { } export namespace TieredCaching { - export import TieredCachingUpdateResponse = TieredCachingAPI.TieredCachingUpdateResponse; + export import TieredCachingEditResponse = TieredCachingAPI.TieredCachingEditResponse; export import TieredCachingGetResponse = TieredCachingAPI.TieredCachingGetResponse; - export import TieredCachingUpdateParams = TieredCachingAPI.TieredCachingUpdateParams; + export import TieredCachingEditParams = TieredCachingAPI.TieredCachingEditParams; } diff --git a/src/resources/bot-management.ts b/src/resources/bot-management.ts index ee277adc14..f032957b46 100644 --- a/src/resources/bot-management.ts +++ b/src/resources/bot-management.ts @@ -5,17 +5,6 @@ import { APIResource } from 'cloudflare/resource'; import * as BotManagementAPI from 'cloudflare/resources/bot-management'; export class BotManagement extends APIResource { - /** - * Retrieve a zone's Bot Management Config - */ - get(zoneId: string, options?: Core.RequestOptions): Core.APIPromise { - return ( - this._client.get(`/zones/${zoneId}/bot_management`, options) as Core.APIPromise<{ - result: BotManagementGetResponse; - }> - )._thenUnwrap((obj) => obj.result); - } - /** * Updates the Bot Management configuration for a zone. * @@ -28,26 +17,37 @@ export class BotManagement extends APIResource { * See [Bot Plans](https://developers.cloudflare.com/bots/plans/) for more * information on the different plans */ - replace( + update( zoneId: string, - body: BotManagementReplaceParams, + body: BotManagementUpdateParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.put(`/zones/${zoneId}/bot_management`, { body, ...options }) as Core.APIPromise<{ - result: BotManagementReplaceResponse; + result: BotManagementUpdateResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieve a zone's Bot Management Config + */ + get(zoneId: string, options?: Core.RequestOptions): Core.APIPromise { + return ( + this._client.get(`/zones/${zoneId}/bot_management`, options) as Core.APIPromise<{ + result: BotManagementGetResponse; }> )._thenUnwrap((obj) => obj.result); } } -export type BotManagementGetResponse = - | BotManagementGetResponse.BotManagementBotFightModeConfig - | BotManagementGetResponse.BotManagementSbfmDefinitelyConfig - | BotManagementGetResponse.BotManagementSbfmLikelyConfig - | BotManagementGetResponse.BotManagementBmSubscriptionConfig; +export type BotManagementUpdateResponse = + | BotManagementUpdateResponse.BotManagementBotFightModeConfig + | BotManagementUpdateResponse.BotManagementSbfmDefinitelyConfig + | BotManagementUpdateResponse.BotManagementSbfmLikelyConfig + | BotManagementUpdateResponse.BotManagementBmSubscriptionConfig; -export namespace BotManagementGetResponse { +export namespace BotManagementUpdateResponse { export interface BotManagementBotFightModeConfig { /** * Use lightweight, invisible JavaScript detections to improve Bot Management. @@ -172,13 +172,13 @@ export namespace BotManagementGetResponse { } } -export type BotManagementReplaceResponse = - | BotManagementReplaceResponse.BotManagementBotFightModeConfig - | BotManagementReplaceResponse.BotManagementSbfmDefinitelyConfig - | BotManagementReplaceResponse.BotManagementSbfmLikelyConfig - | BotManagementReplaceResponse.BotManagementBmSubscriptionConfig; +export type BotManagementGetResponse = + | BotManagementGetResponse.BotManagementBotFightModeConfig + | BotManagementGetResponse.BotManagementSbfmDefinitelyConfig + | BotManagementGetResponse.BotManagementSbfmLikelyConfig + | BotManagementGetResponse.BotManagementBmSubscriptionConfig; -export namespace BotManagementReplaceResponse { +export namespace BotManagementGetResponse { export interface BotManagementBotFightModeConfig { /** * Use lightweight, invisible JavaScript detections to improve Bot Management. @@ -303,13 +303,13 @@ export namespace BotManagementReplaceResponse { } } -export type BotManagementReplaceParams = - | BotManagementReplaceParams.BotManagementBotFightModeConfig - | BotManagementReplaceParams.BotManagementSbfmDefinitelyConfig - | BotManagementReplaceParams.BotManagementSbfmLikelyConfig - | BotManagementReplaceParams.BotManagementBmSubscriptionConfig; +export type BotManagementUpdateParams = + | BotManagementUpdateParams.BotManagementBotFightModeConfig + | BotManagementUpdateParams.BotManagementSbfmDefinitelyConfig + | BotManagementUpdateParams.BotManagementSbfmLikelyConfig + | BotManagementUpdateParams.BotManagementBmSubscriptionConfig; -export namespace BotManagementReplaceParams { +export namespace BotManagementUpdateParams { export interface BotManagementBotFightModeConfig { /** * Use lightweight, invisible JavaScript detections to improve Bot Management. @@ -411,7 +411,7 @@ export namespace BotManagementReplaceParams { } export namespace BotManagement { + export import BotManagementUpdateResponse = BotManagementAPI.BotManagementUpdateResponse; export import BotManagementGetResponse = BotManagementAPI.BotManagementGetResponse; - export import BotManagementReplaceResponse = BotManagementAPI.BotManagementReplaceResponse; - export import BotManagementReplaceParams = BotManagementAPI.BotManagementReplaceParams; + export import BotManagementUpdateParams = BotManagementAPI.BotManagementUpdateParams; } diff --git a/src/resources/cache/cache-reserves.ts b/src/resources/cache/cache-reserves.ts index 01d3a01320..71a2e9aa35 100644 --- a/src/resources/cache/cache-reserves.ts +++ b/src/resources/cache/cache-reserves.ts @@ -13,14 +13,10 @@ export class CacheReserves extends APIResource { * [developer docs](https://developers.cloudflare.com/cache/about/cache-reserve) * for more information. */ - update( - zoneId: string, - body: CacheReserveUpdateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { + list(zoneId: string, options?: Core.RequestOptions): Core.APIPromise { return ( - this._client.patch(`/zones/${zoneId}/cache/cache_reserve`, { body, ...options }) as Core.APIPromise<{ - result: CacheReserveUpdateResponse; + this._client.get(`/zones/${zoneId}/cache/cache_reserve`, options) as Core.APIPromise<{ + result: CacheReserveListResponse; }> )._thenUnwrap((obj) => obj.result); } @@ -33,10 +29,14 @@ export class CacheReserves extends APIResource { * [developer docs](https://developers.cloudflare.com/cache/about/cache-reserve) * for more information. */ - list(zoneId: string, options?: Core.RequestOptions): Core.APIPromise { + edit( + zoneId: string, + body: CacheReserveEditParams, + options?: Core.RequestOptions, + ): Core.APIPromise { return ( - this._client.get(`/zones/${zoneId}/cache/cache_reserve`, options) as Core.APIPromise<{ - result: CacheReserveListResponse; + this._client.patch(`/zones/${zoneId}/cache/cache_reserve`, { body, ...options }) as Core.APIPromise<{ + result: CacheReserveEditResponse; }> )._thenUnwrap((obj) => obj.result); } @@ -50,7 +50,7 @@ export class CacheReserves extends APIResource { * [developer docs](https://developers.cloudflare.com/cache/about/cache-reserve) * for more information. */ -export interface CacheReserveUpdateResponse { +export interface CacheReserveListResponse { /** * ID of the zone setting. */ @@ -75,7 +75,7 @@ export interface CacheReserveUpdateResponse { * [developer docs](https://developers.cloudflare.com/cache/about/cache-reserve) * for more information. */ -export interface CacheReserveListResponse { +export interface CacheReserveEditResponse { /** * ID of the zone setting. */ @@ -92,7 +92,7 @@ export interface CacheReserveListResponse { value: 'on' | 'off'; } -export interface CacheReserveUpdateParams { +export interface CacheReserveEditParams { /** * Value of the Cache Reserve zone setting. */ @@ -100,7 +100,7 @@ export interface CacheReserveUpdateParams { } export namespace CacheReserves { - export import CacheReserveUpdateResponse = CacheReservesAPI.CacheReserveUpdateResponse; export import CacheReserveListResponse = CacheReservesAPI.CacheReserveListResponse; - export import CacheReserveUpdateParams = CacheReservesAPI.CacheReserveUpdateParams; + export import CacheReserveEditResponse = CacheReservesAPI.CacheReserveEditResponse; + export import CacheReserveEditParams = CacheReservesAPI.CacheReserveEditParams; } diff --git a/src/resources/cache/cache.ts b/src/resources/cache/cache.ts index 789dd75fe2..04da9f7d58 100644 --- a/src/resources/cache/cache.ts +++ b/src/resources/cache/cache.ts @@ -1,6 +1,8 @@ // File generated from our OpenAPI spec by Stainless. +import * as Core from 'cloudflare/core'; import { APIResource } from 'cloudflare/resource'; +import * as CacheAPI from 'cloudflare/resources/cache/cache'; import * as CacheReservesAPI from 'cloudflare/resources/cache/cache-reserves'; import * as RegionalTieredCacheAPI from 'cloudflare/resources/cache/regional-tiered-cache'; import * as TieredCacheSmartTopologyAPI from 'cloudflare/resources/cache/tiered-cache-smart-topology'; @@ -13,25 +15,107 @@ export class Cache extends APIResource { variants: VariantsAPI.Variants = new VariantsAPI.Variants(this._client); regionalTieredCache: RegionalTieredCacheAPI.RegionalTieredCache = new RegionalTieredCacheAPI.RegionalTieredCache(this._client); + + /** + * ### Purge All Cached Content + * + * Removes ALL files from Cloudflare's cache. All tiers can purge everything. + * + * ### Purge Cached Content by URL + * + * Granularly removes one or more files from Cloudflare's cache by specifying URLs. + * All tiers can purge by URL. + * + * To purge files with custom cache keys, include the headers used to compute the + * cache key as in the example. If you have a device type or geo in your cache key, + * you will need to include the CF-Device-Type or CF-IPCountry headers. If you have + * lang in your cache key, you will need to include the Accept-Language header. + * + * **NB:** When including the Origin header, be sure to include the **scheme** and + * **hostname**. The port number can be omitted if it is the default port (80 for + * http, 443 for https), but must be included otherwise. + * + * ### Purge Cached Content by Tag, Host or Prefix + * + * Granularly removes one or more files from Cloudflare's cache either by + * specifying the host, the associated Cache-Tag, or a Prefix. Only Enterprise + * customers are permitted to purge by Tag, Host or Prefix. + * + * **NB:** Cache-Tag, host, and prefix purging each have a rate limit of 30,000 + * purge API calls in every 24 hour period. You may purge up to 30 tags, hosts, or + * prefixes in one API call. This rate limit can be raised for customers who need + * to purge at higher volume. + */ + purge( + zoneId: string, + body: CachePurgeParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.post(`/zones/${zoneId}/purge_cache`, { body, ...options }) as Core.APIPromise<{ + result: CachePurgeResponse | null; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface CachePurgeResponse { + /** + * Identifier + */ + id: string; +} + +export type CachePurgeParams = + | CachePurgeParams.CachePurgeFlex + | CachePurgeParams.CachePurgeEverything + | CachePurgeParams.CachePurgeFiles; + +export namespace CachePurgeParams { + export interface CachePurgeFlex { + hosts?: Array; + + prefixes?: Array; + + tags?: Array; + } + + export interface CachePurgeEverything { + purge_everything?: boolean; + } + + export interface CachePurgeFiles { + files?: Array; + } + + export namespace CachePurgeFiles { + export interface CachePurgeURLAndHeaders { + headers?: unknown; + + url?: string; + } + } } export namespace Cache { + export import CachePurgeResponse = CacheAPI.CachePurgeResponse; + export import CachePurgeParams = CacheAPI.CachePurgeParams; export import CacheReserves = CacheReservesAPI.CacheReserves; - export import CacheReserveUpdateResponse = CacheReservesAPI.CacheReserveUpdateResponse; export import CacheReserveListResponse = CacheReservesAPI.CacheReserveListResponse; - export import CacheReserveUpdateParams = CacheReservesAPI.CacheReserveUpdateParams; + export import CacheReserveEditResponse = CacheReservesAPI.CacheReserveEditResponse; + export import CacheReserveEditParams = CacheReservesAPI.CacheReserveEditParams; export import TieredCacheSmartTopology = TieredCacheSmartTopologyAPI.TieredCacheSmartTopology; - export import TieredCacheSmartTopologyUpdateResponse = TieredCacheSmartTopologyAPI.TieredCacheSmartTopologyUpdateResponse; export import TieredCacheSmartTopologyDeleteResponse = TieredCacheSmartTopologyAPI.TieredCacheSmartTopologyDeleteResponse; + export import TieredCacheSmartTopologyEditResponse = TieredCacheSmartTopologyAPI.TieredCacheSmartTopologyEditResponse; export import TieredCacheSmartTopologyGetResponse = TieredCacheSmartTopologyAPI.TieredCacheSmartTopologyGetResponse; - export import TieredCacheSmartTopologyUpdateParams = TieredCacheSmartTopologyAPI.TieredCacheSmartTopologyUpdateParams; + export import TieredCacheSmartTopologyEditParams = TieredCacheSmartTopologyAPI.TieredCacheSmartTopologyEditParams; export import Variants = VariantsAPI.Variants; - export import VariantUpdateResponse = VariantsAPI.VariantUpdateResponse; export import VariantListResponse = VariantsAPI.VariantListResponse; export import VariantDeleteResponse = VariantsAPI.VariantDeleteResponse; - export import VariantUpdateParams = VariantsAPI.VariantUpdateParams; + export import VariantEditResponse = VariantsAPI.VariantEditResponse; + export import VariantEditParams = VariantsAPI.VariantEditParams; export import RegionalTieredCache = RegionalTieredCacheAPI.RegionalTieredCache; - export import RegionalTieredCacheUpdateResponse = RegionalTieredCacheAPI.RegionalTieredCacheUpdateResponse; + export import RegionalTieredCacheEditResponse = RegionalTieredCacheAPI.RegionalTieredCacheEditResponse; export import RegionalTieredCacheGetResponse = RegionalTieredCacheAPI.RegionalTieredCacheGetResponse; - export import RegionalTieredCacheUpdateParams = RegionalTieredCacheAPI.RegionalTieredCacheUpdateParams; + export import RegionalTieredCacheEditParams = RegionalTieredCacheAPI.RegionalTieredCacheEditParams; } diff --git a/src/resources/cache/index.ts b/src/resources/cache/index.ts index 3447948bb6..aa8cfdd787 100644 --- a/src/resources/cache/index.ts +++ b/src/resources/cache/index.ts @@ -1,29 +1,29 @@ // File generated from our OpenAPI spec by Stainless. -export { Cache } from './cache'; +export { CachePurgeResponse, CachePurgeParams, Cache } from './cache'; export { - CacheReserveUpdateResponse, CacheReserveListResponse, - CacheReserveUpdateParams, + CacheReserveEditResponse, + CacheReserveEditParams, CacheReserves, } from './cache-reserves'; export { - RegionalTieredCacheUpdateResponse, + RegionalTieredCacheEditResponse, RegionalTieredCacheGetResponse, - RegionalTieredCacheUpdateParams, + RegionalTieredCacheEditParams, RegionalTieredCache, } from './regional-tiered-cache'; export { - TieredCacheSmartTopologyUpdateResponse, TieredCacheSmartTopologyDeleteResponse, + TieredCacheSmartTopologyEditResponse, TieredCacheSmartTopologyGetResponse, - TieredCacheSmartTopologyUpdateParams, + TieredCacheSmartTopologyEditParams, TieredCacheSmartTopology, } from './tiered-cache-smart-topology'; export { - VariantUpdateResponse, VariantListResponse, VariantDeleteResponse, - VariantUpdateParams, + VariantEditResponse, + VariantEditParams, Variants, } from './variants'; diff --git a/src/resources/cache/regional-tiered-cache.ts b/src/resources/cache/regional-tiered-cache.ts index efe99042ac..cc929b8573 100644 --- a/src/resources/cache/regional-tiered-cache.ts +++ b/src/resources/cache/regional-tiered-cache.ts @@ -10,16 +10,16 @@ export class RegionalTieredCache extends APIResource { * upper tier. This can help improve performance for smart and custom tiered cache * topologies. */ - update( + edit( zoneId: string, - body: RegionalTieredCacheUpdateParams, + body: RegionalTieredCacheEditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.patch(`/zones/${zoneId}/cache/regional_tiered_cache`, { body, ...options, - }) as Core.APIPromise<{ result: RegionalTieredCacheUpdateResponse }> + }) as Core.APIPromise<{ result: RegionalTieredCacheEditResponse }> )._thenUnwrap((obj) => obj.result); } @@ -42,7 +42,7 @@ export class RegionalTieredCache extends APIResource { * upper tier. This can help improve performance for smart and custom tiered cache * topologies. */ -export interface RegionalTieredCacheUpdateResponse { +export interface RegionalTieredCacheEditResponse { /** * ID of the zone setting. */ @@ -58,10 +58,10 @@ export interface RegionalTieredCacheUpdateResponse { * upper tier. This can help improve performance for smart and custom tiered cache * topologies. */ - value: RegionalTieredCacheUpdateResponse.Value; + value: RegionalTieredCacheEditResponse.Value; } -export namespace RegionalTieredCacheUpdateResponse { +export namespace RegionalTieredCacheEditResponse { /** * Instructs Cloudflare to check a regional hub data center on the way to your * upper tier. This can help improve performance for smart and custom tiered cache @@ -123,7 +123,7 @@ export namespace RegionalTieredCacheGetResponse { } } -export interface RegionalTieredCacheUpdateParams { +export interface RegionalTieredCacheEditParams { /** * Value of the Regional Tiered Cache zone setting. */ @@ -131,7 +131,7 @@ export interface RegionalTieredCacheUpdateParams { } export namespace RegionalTieredCache { - export import RegionalTieredCacheUpdateResponse = RegionalTieredCacheAPI.RegionalTieredCacheUpdateResponse; + export import RegionalTieredCacheEditResponse = RegionalTieredCacheAPI.RegionalTieredCacheEditResponse; export import RegionalTieredCacheGetResponse = RegionalTieredCacheAPI.RegionalTieredCacheGetResponse; - export import RegionalTieredCacheUpdateParams = RegionalTieredCacheAPI.RegionalTieredCacheUpdateParams; + export import RegionalTieredCacheEditParams = RegionalTieredCacheAPI.RegionalTieredCacheEditParams; } diff --git a/src/resources/cache/tiered-cache-smart-topology.ts b/src/resources/cache/tiered-cache-smart-topology.ts index f7e553e4f6..0191e36902 100644 --- a/src/resources/cache/tiered-cache-smart-topology.ts +++ b/src/resources/cache/tiered-cache-smart-topology.ts @@ -6,33 +6,33 @@ import * as TieredCacheSmartTopologyAPI from 'cloudflare/resources/cache/tiered- export class TieredCacheSmartTopology extends APIResource { /** - * Updates enablement of Tiered Cache + * Remvoves enablement of Smart Tiered Cache */ - update( + delete( zoneId: string, - body: TieredCacheSmartTopologyUpdateParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( - this._client.patch(`/zones/${zoneId}/cache/tiered_cache_smart_topology_enable`, { - body, - ...options, - }) as Core.APIPromise<{ result: TieredCacheSmartTopologyUpdateResponse }> + this._client.delete( + `/zones/${zoneId}/cache/tiered_cache_smart_topology_enable`, + options, + ) as Core.APIPromise<{ result: TieredCacheSmartTopologyDeleteResponse }> )._thenUnwrap((obj) => obj.result); } /** - * Remvoves enablement of Smart Tiered Cache + * Updates enablement of Tiered Cache */ - delete( + edit( zoneId: string, + body: TieredCacheSmartTopologyEditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( - this._client.delete( - `/zones/${zoneId}/cache/tiered_cache_smart_topology_enable`, - options, - ) as Core.APIPromise<{ result: TieredCacheSmartTopologyDeleteResponse }> + this._client.patch(`/zones/${zoneId}/cache/tiered_cache_smart_topology_enable`, { + body, + ...options, + }) as Core.APIPromise<{ result: TieredCacheSmartTopologyEditResponse }> )._thenUnwrap((obj) => obj.result); } @@ -49,13 +49,13 @@ export class TieredCacheSmartTopology extends APIResource { } } -export type TieredCacheSmartTopologyUpdateResponse = unknown | string | null; - export type TieredCacheSmartTopologyDeleteResponse = unknown | string | null; +export type TieredCacheSmartTopologyEditResponse = unknown | string | null; + export type TieredCacheSmartTopologyGetResponse = unknown | string | null; -export interface TieredCacheSmartTopologyUpdateParams { +export interface TieredCacheSmartTopologyEditParams { /** * Enables Tiered Cache. */ @@ -63,8 +63,8 @@ export interface TieredCacheSmartTopologyUpdateParams { } export namespace TieredCacheSmartTopology { - export import TieredCacheSmartTopologyUpdateResponse = TieredCacheSmartTopologyAPI.TieredCacheSmartTopologyUpdateResponse; export import TieredCacheSmartTopologyDeleteResponse = TieredCacheSmartTopologyAPI.TieredCacheSmartTopologyDeleteResponse; + export import TieredCacheSmartTopologyEditResponse = TieredCacheSmartTopologyAPI.TieredCacheSmartTopologyEditResponse; export import TieredCacheSmartTopologyGetResponse = TieredCacheSmartTopologyAPI.TieredCacheSmartTopologyGetResponse; - export import TieredCacheSmartTopologyUpdateParams = TieredCacheSmartTopologyAPI.TieredCacheSmartTopologyUpdateParams; + export import TieredCacheSmartTopologyEditParams = TieredCacheSmartTopologyAPI.TieredCacheSmartTopologyEditParams; } diff --git a/src/resources/cache/variants.ts b/src/resources/cache/variants.ts index 968a3f1ef5..a95c707083 100644 --- a/src/resources/cache/variants.ts +++ b/src/resources/cache/variants.ts @@ -12,14 +12,10 @@ export class Variants extends APIResource { * does not serve the variant requested, the response will not be cached. This will * be indicated with BYPASS cache status in the response headers. */ - update( - zoneId: string, - body: VariantUpdateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { + list(zoneId: string, options?: Core.RequestOptions): Core.APIPromise { return ( - this._client.patch(`/zones/${zoneId}/cache/variants`, { body, ...options }) as Core.APIPromise<{ - result: VariantUpdateResponse; + this._client.get(`/zones/${zoneId}/cache/variants`, options) as Core.APIPromise<{ + result: VariantListResponse; }> )._thenUnwrap((obj) => obj.result); } @@ -31,10 +27,10 @@ export class Variants extends APIResource { * does not serve the variant requested, the response will not be cached. This will * be indicated with BYPASS cache status in the response headers. */ - list(zoneId: string, options?: Core.RequestOptions): Core.APIPromise { + delete(zoneId: string, options?: Core.RequestOptions): Core.APIPromise { return ( - this._client.get(`/zones/${zoneId}/cache/variants`, options) as Core.APIPromise<{ - result: VariantListResponse; + this._client.delete(`/zones/${zoneId}/cache/variants`, options) as Core.APIPromise<{ + result: VariantDeleteResponse; }> )._thenUnwrap((obj) => obj.result); } @@ -46,10 +42,14 @@ export class Variants extends APIResource { * does not serve the variant requested, the response will not be cached. This will * be indicated with BYPASS cache status in the response headers. */ - delete(zoneId: string, options?: Core.RequestOptions): Core.APIPromise { + edit( + zoneId: string, + body: VariantEditParams, + options?: Core.RequestOptions, + ): Core.APIPromise { return ( - this._client.delete(`/zones/${zoneId}/cache/variants`, options) as Core.APIPromise<{ - result: VariantDeleteResponse; + this._client.patch(`/zones/${zoneId}/cache/variants`, { body, ...options }) as Core.APIPromise<{ + result: VariantEditResponse; }> )._thenUnwrap((obj) => obj.result); } @@ -62,7 +62,7 @@ export class Variants extends APIResource { * does not serve the variant requested, the response will not be cached. This will * be indicated with BYPASS cache status in the response headers. */ -export interface VariantUpdateResponse { +export interface VariantListResponse { /** * ID of the zone setting. */ @@ -76,10 +76,10 @@ export interface VariantUpdateResponse { /** * Value of the zone setting. */ - value: VariantUpdateResponse.Value; + value: VariantListResponse.Value; } -export namespace VariantUpdateResponse { +export namespace VariantListResponse { /** * Value of the zone setting. */ @@ -159,7 +159,26 @@ export namespace VariantUpdateResponse { * does not serve the variant requested, the response will not be cached. This will * be indicated with BYPASS cache status in the response headers. */ -export interface VariantListResponse { +export interface VariantDeleteResponse { + /** + * ID of the zone setting. + */ + id: 'variants'; + + /** + * last time this setting was modified. + */ + modified_on: string | null; +} + +/** + * Variant support enables caching variants of images with certain file extensions + * in addition to the original. This only applies when the origin server sends the + * 'Vary: Accept' response header. If the origin server sends 'Vary: Accept' but + * does not serve the variant requested, the response will not be cached. This will + * be indicated with BYPASS cache status in the response headers. + */ +export interface VariantEditResponse { /** * ID of the zone setting. */ @@ -173,10 +192,10 @@ export interface VariantListResponse { /** * Value of the zone setting. */ - value: VariantListResponse.Value; + value: VariantEditResponse.Value; } -export namespace VariantListResponse { +export namespace VariantEditResponse { /** * Value of the zone setting. */ @@ -249,33 +268,14 @@ export namespace VariantListResponse { } } -/** - * Variant support enables caching variants of images with certain file extensions - * in addition to the original. This only applies when the origin server sends the - * 'Vary: Accept' response header. If the origin server sends 'Vary: Accept' but - * does not serve the variant requested, the response will not be cached. This will - * be indicated with BYPASS cache status in the response headers. - */ -export interface VariantDeleteResponse { - /** - * ID of the zone setting. - */ - id: 'variants'; - - /** - * last time this setting was modified. - */ - modified_on: string | null; -} - -export interface VariantUpdateParams { +export interface VariantEditParams { /** * Value of the zone setting. */ - value: VariantUpdateParams.Value; + value: VariantEditParams.Value; } -export namespace VariantUpdateParams { +export namespace VariantEditParams { /** * Value of the zone setting. */ @@ -349,8 +349,8 @@ export namespace VariantUpdateParams { } export namespace Variants { - export import VariantUpdateResponse = VariantsAPI.VariantUpdateResponse; export import VariantListResponse = VariantsAPI.VariantListResponse; export import VariantDeleteResponse = VariantsAPI.VariantDeleteResponse; - export import VariantUpdateParams = VariantsAPI.VariantUpdateParams; + export import VariantEditResponse = VariantsAPI.VariantEditResponse; + export import VariantEditParams = VariantsAPI.VariantEditParams; } diff --git a/src/resources/calls.ts b/src/resources/calls.ts index 065e875194..6ce5ddaf64 100644 --- a/src/resources/calls.ts +++ b/src/resources/calls.ts @@ -21,6 +21,23 @@ export class Calls extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Edit details for a single app. + */ + update( + accountId: string, + appId: string, + body: CallUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/accounts/${accountId}/calls/apps/${appId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: CallUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * Lists all apps in the Cloudflare account */ @@ -57,23 +74,6 @@ export class Calls extends APIResource { }> )._thenUnwrap((obj) => obj.result); } - - /** - * Edit details for a single app. - */ - replace( - accountId: string, - appId: string, - body: CallReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put(`/accounts/${accountId}/calls/apps/${appId}`, { - body, - ...options, - }) as Core.APIPromise<{ result: CallReplaceResponse }> - )._thenUnwrap((obj) => obj.result); - } } export interface CallCreateResponse { @@ -103,6 +103,28 @@ export interface CallCreateResponse { uid?: string; } +export interface CallUpdateResponse { + /** + * The date and time the item was created. + */ + created?: string; + + /** + * The date and time the item was last modified. + */ + modified?: string; + + /** + * A short description of Calls app, not shown to end users. + */ + name?: string; + + /** + * A Cloudflare-generated unique identifier for a item. + */ + uid?: string; +} + export type CallListResponse = Array; export namespace CallListResponse { @@ -173,28 +195,6 @@ export interface CallGetResponse { uid?: string; } -export interface CallReplaceResponse { - /** - * The date and time the item was created. - */ - created?: string; - - /** - * The date and time the item was last modified. - */ - modified?: string; - - /** - * A short description of Calls app, not shown to end users. - */ - name?: string; - - /** - * A Cloudflare-generated unique identifier for a item. - */ - uid?: string; -} - export interface CallCreateParams { /** * A short description of Calls app, not shown to end users. @@ -202,7 +202,7 @@ export interface CallCreateParams { name?: string; } -export interface CallReplaceParams { +export interface CallUpdateParams { /** * A short description of Calls app, not shown to end users. */ @@ -211,10 +211,10 @@ export interface CallReplaceParams { export namespace Calls { export import CallCreateResponse = CallsAPI.CallCreateResponse; + export import CallUpdateResponse = CallsAPI.CallUpdateResponse; export import CallListResponse = CallsAPI.CallListResponse; export import CallDeleteResponse = CallsAPI.CallDeleteResponse; export import CallGetResponse = CallsAPI.CallGetResponse; - export import CallReplaceResponse = CallsAPI.CallReplaceResponse; export import CallCreateParams = CallsAPI.CallCreateParams; - export import CallReplaceParams = CallsAPI.CallReplaceParams; + export import CallUpdateParams = CallsAPI.CallUpdateParams; } diff --git a/src/resources/certificate-authorities/certificate-authorities.ts b/src/resources/certificate-authorities/certificate-authorities.ts index 539f616aec..dc53dd21d0 100644 --- a/src/resources/certificate-authorities/certificate-authorities.ts +++ b/src/resources/certificate-authorities/certificate-authorities.ts @@ -10,8 +10,8 @@ export class CertificateAuthorities extends APIResource { export namespace CertificateAuthorities { export import HostnameAssociations = HostnameAssociationsAPI.HostnameAssociations; + export import HostnameAssociationUpdateResponse = HostnameAssociationsAPI.HostnameAssociationUpdateResponse; export import HostnameAssociationListResponse = HostnameAssociationsAPI.HostnameAssociationListResponse; - export import HostnameAssociationReplaceResponse = HostnameAssociationsAPI.HostnameAssociationReplaceResponse; + export import HostnameAssociationUpdateParams = HostnameAssociationsAPI.HostnameAssociationUpdateParams; export import HostnameAssociationListParams = HostnameAssociationsAPI.HostnameAssociationListParams; - export import HostnameAssociationReplaceParams = HostnameAssociationsAPI.HostnameAssociationReplaceParams; } diff --git a/src/resources/certificate-authorities/hostname-associations.ts b/src/resources/certificate-authorities/hostname-associations.ts index 672e7e3c9b..ba7d38b05c 100644 --- a/src/resources/certificate-authorities/hostname-associations.ts +++ b/src/resources/certificate-authorities/hostname-associations.ts @@ -6,6 +6,22 @@ import { isRequestOptions } from 'cloudflare/core'; import * as HostnameAssociationsAPI from 'cloudflare/resources/certificate-authorities/hostname-associations'; export class HostnameAssociations extends APIResource { + /** + * Replace Hostname Associations + */ + update( + zoneId: string, + body: HostnameAssociationUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/zones/${zoneId}/certificate_authorities/hostname_associations`, { + body, + ...options, + }) as Core.APIPromise<{ result: HostnameAssociationUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * List Hostname Associations */ @@ -30,22 +46,17 @@ export class HostnameAssociations extends APIResource { }) as Core.APIPromise<{ result: HostnameAssociationListResponse }> )._thenUnwrap((obj) => obj.result); } +} + +export interface HostnameAssociationUpdateResponse { + hostnames?: Array; /** - * Replace Hostname Associations + * The UUID for a certificate that was uploaded to the mTLS Certificate Management + * endpoint. If no mtls_certificate_id is given, the hostnames will be associated + * to your active Cloudflare Managed CA. */ - replace( - zoneId: string, - body: HostnameAssociationReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put(`/zones/${zoneId}/certificate_authorities/hostname_associations`, { - body, - ...options, - }) as Core.APIPromise<{ result: HostnameAssociationReplaceResponse }> - )._thenUnwrap((obj) => obj.result); - } + mtls_certificate_id?: string; } export interface HostnameAssociationListResponse { @@ -59,7 +70,7 @@ export interface HostnameAssociationListResponse { mtls_certificate_id?: string; } -export interface HostnameAssociationReplaceResponse { +export interface HostnameAssociationUpdateParams { hostnames?: Array; /** @@ -79,20 +90,9 @@ export interface HostnameAssociationListParams { mtls_certificate_id?: string; } -export interface HostnameAssociationReplaceParams { - hostnames?: Array; - - /** - * The UUID for a certificate that was uploaded to the mTLS Certificate Management - * endpoint. If no mtls_certificate_id is given, the hostnames will be associated - * to your active Cloudflare Managed CA. - */ - mtls_certificate_id?: string; -} - export namespace HostnameAssociations { + export import HostnameAssociationUpdateResponse = HostnameAssociationsAPI.HostnameAssociationUpdateResponse; export import HostnameAssociationListResponse = HostnameAssociationsAPI.HostnameAssociationListResponse; - export import HostnameAssociationReplaceResponse = HostnameAssociationsAPI.HostnameAssociationReplaceResponse; + export import HostnameAssociationUpdateParams = HostnameAssociationsAPI.HostnameAssociationUpdateParams; export import HostnameAssociationListParams = HostnameAssociationsAPI.HostnameAssociationListParams; - export import HostnameAssociationReplaceParams = HostnameAssociationsAPI.HostnameAssociationReplaceParams; } diff --git a/src/resources/certificate-authorities/index.ts b/src/resources/certificate-authorities/index.ts index 768d917732..f9f3fa9712 100644 --- a/src/resources/certificate-authorities/index.ts +++ b/src/resources/certificate-authorities/index.ts @@ -2,9 +2,9 @@ export { CertificateAuthorities } from './certificate-authorities'; export { + HostnameAssociationUpdateResponse, HostnameAssociationListResponse, - HostnameAssociationReplaceResponse, + HostnameAssociationUpdateParams, HostnameAssociationListParams, - HostnameAssociationReplaceParams, HostnameAssociations, } from './hostname-associations'; diff --git a/src/resources/challenges/challenges.ts b/src/resources/challenges/challenges.ts index 3c9c544eda..10a943f87f 100644 --- a/src/resources/challenges/challenges.ts +++ b/src/resources/challenges/challenges.ts @@ -10,14 +10,14 @@ export class Challenges extends APIResource { export namespace Challenges { export import Widgets = WidgetsAPI.Widgets; export import WidgetCreateResponse = WidgetsAPI.WidgetCreateResponse; + export import WidgetUpdateResponse = WidgetsAPI.WidgetUpdateResponse; export import WidgetListResponse = WidgetsAPI.WidgetListResponse; export import WidgetDeleteResponse = WidgetsAPI.WidgetDeleteResponse; export import WidgetGetResponse = WidgetsAPI.WidgetGetResponse; - export import WidgetReplaceResponse = WidgetsAPI.WidgetReplaceResponse; export import WidgetRotateSecretResponse = WidgetsAPI.WidgetRotateSecretResponse; export import WidgetListResponsesV4PagePaginationArray = WidgetsAPI.WidgetListResponsesV4PagePaginationArray; export import WidgetCreateParams = WidgetsAPI.WidgetCreateParams; + export import WidgetUpdateParams = WidgetsAPI.WidgetUpdateParams; export import WidgetListParams = WidgetsAPI.WidgetListParams; - export import WidgetReplaceParams = WidgetsAPI.WidgetReplaceParams; export import WidgetRotateSecretParams = WidgetsAPI.WidgetRotateSecretParams; } diff --git a/src/resources/challenges/index.ts b/src/resources/challenges/index.ts index d1db622839..08dd43ba3d 100644 --- a/src/resources/challenges/index.ts +++ b/src/resources/challenges/index.ts @@ -3,14 +3,14 @@ export { Challenges } from './challenges'; export { WidgetCreateResponse, + WidgetUpdateResponse, WidgetListResponse, WidgetDeleteResponse, WidgetGetResponse, - WidgetReplaceResponse, WidgetRotateSecretResponse, WidgetCreateParams, + WidgetUpdateParams, WidgetListParams, - WidgetReplaceParams, WidgetRotateSecretParams, WidgetListResponsesV4PagePaginationArray, Widgets, diff --git a/src/resources/challenges/widgets.ts b/src/resources/challenges/widgets.ts index 98c10c3a68..3044459b03 100644 --- a/src/resources/challenges/widgets.ts +++ b/src/resources/challenges/widgets.ts @@ -25,6 +25,23 @@ export class Widgets extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Update the configuration of a widget. + */ + update( + accountIdentifier: string, + sitekey: string, + body: WidgetUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/accounts/${accountIdentifier}/challenges/widgets/${sitekey}`, { + body, + ...options, + }) as Core.APIPromise<{ result: WidgetUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * Lists all turnstile widgets of an account. */ @@ -84,23 +101,6 @@ export class Widgets extends APIResource { )._thenUnwrap((obj) => obj.result); } - /** - * Update the configuration of a widget. - */ - replace( - accountIdentifier: string, - sitekey: string, - body: WidgetReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put(`/accounts/${accountIdentifier}/challenges/widgets/${sitekey}`, { - body, - ...options, - }) as Core.APIPromise<{ result: WidgetReplaceResponse }> - )._thenUnwrap((obj) => obj.result); - } - /** * Generate a new secret key for this widget. If `invalidate_immediately` is set to * `false`, the previous secret remains valid for 2 hours. @@ -186,9 +186,9 @@ export interface WidgetCreateResponse { } /** - * A Turnstile Widgets configuration as it appears in listings + * A Turnstile widget's detailed configuration */ -export interface WidgetListResponse { +export interface WidgetUpdateResponse { /** * If bot_fight_mode is set to `true`, Cloudflare issues computationally expensive * challenges in response to malicious bots (ENT only). @@ -235,6 +235,11 @@ export interface WidgetListResponse { */ region: 'world'; + /** + * Secret key for this widget. + */ + secret: string; + /** * Widget item identifier tag. */ @@ -242,9 +247,9 @@ export interface WidgetListResponse { } /** - * A Turnstile widget's detailed configuration + * A Turnstile Widgets configuration as it appears in listings */ -export interface WidgetDeleteResponse { +export interface WidgetListResponse { /** * If bot_fight_mode is set to `true`, Cloudflare issues computationally expensive * challenges in response to malicious bots (ENT only). @@ -291,11 +296,6 @@ export interface WidgetDeleteResponse { */ region: 'world'; - /** - * Secret key for this widget. - */ - secret: string; - /** * Widget item identifier tag. */ @@ -305,7 +305,7 @@ export interface WidgetDeleteResponse { /** * A Turnstile widget's detailed configuration */ -export interface WidgetGetResponse { +export interface WidgetDeleteResponse { /** * If bot_fight_mode is set to `true`, Cloudflare issues computationally expensive * challenges in response to malicious bots (ENT only). @@ -366,7 +366,7 @@ export interface WidgetGetResponse { /** * A Turnstile widget's detailed configuration */ -export interface WidgetReplaceResponse { +export interface WidgetGetResponse { /** * If bot_fight_mode is set to `true`, Cloudflare issues computationally expensive * challenges in response to malicious bots (ENT only). @@ -547,19 +547,7 @@ export interface WidgetCreateParams { region?: 'world'; } -export interface WidgetListParams extends V4PagePaginationArrayParams { - /** - * Direction to order widgets. - */ - direction?: 'asc' | 'desc'; - - /** - * Field to order widgets by. - */ - order?: 'id' | 'sitekey' | 'name' | 'created_on' | 'modified_on'; -} - -export interface WidgetReplaceParams { +export interface WidgetUpdateParams { domains: Array; /** @@ -592,6 +580,18 @@ export interface WidgetReplaceParams { offlabel?: boolean; } +export interface WidgetListParams extends V4PagePaginationArrayParams { + /** + * Direction to order widgets. + */ + direction?: 'asc' | 'desc'; + + /** + * Field to order widgets by. + */ + order?: 'id' | 'sitekey' | 'name' | 'created_on' | 'modified_on'; +} + export interface WidgetRotateSecretParams { /** * If `invalidate_immediately` is set to `false`, the previous secret will remain @@ -603,14 +603,14 @@ export interface WidgetRotateSecretParams { export namespace Widgets { export import WidgetCreateResponse = WidgetsAPI.WidgetCreateResponse; + export import WidgetUpdateResponse = WidgetsAPI.WidgetUpdateResponse; export import WidgetListResponse = WidgetsAPI.WidgetListResponse; export import WidgetDeleteResponse = WidgetsAPI.WidgetDeleteResponse; export import WidgetGetResponse = WidgetsAPI.WidgetGetResponse; - export import WidgetReplaceResponse = WidgetsAPI.WidgetReplaceResponse; export import WidgetRotateSecretResponse = WidgetsAPI.WidgetRotateSecretResponse; export import WidgetListResponsesV4PagePaginationArray = WidgetsAPI.WidgetListResponsesV4PagePaginationArray; export import WidgetCreateParams = WidgetsAPI.WidgetCreateParams; + export import WidgetUpdateParams = WidgetsAPI.WidgetUpdateParams; export import WidgetListParams = WidgetsAPI.WidgetListParams; - export import WidgetReplaceParams = WidgetsAPI.WidgetReplaceParams; export import WidgetRotateSecretParams = WidgetsAPI.WidgetRotateSecretParams; } diff --git a/src/resources/client-certificates.ts b/src/resources/client-certificates.ts index 70bf5cbb17..5c7f71381c 100644 --- a/src/resources/client-certificates.ts +++ b/src/resources/client-certificates.ts @@ -22,23 +22,6 @@ export class ClientCertificates extends APIResource { )._thenUnwrap((obj) => obj.result); } - /** - * If a API Shield mTLS Client Certificate is in a pending_revocation state, you - * may reactivate it with this endpoint. - */ - update( - zoneId: string, - clientCertificateId: string, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.patch( - `/zones/${zoneId}/client_certificates/${clientCertificateId}`, - options, - ) as Core.APIPromise<{ result: ClientCertificateUpdateResponse }> - )._thenUnwrap((obj) => obj.result); - } - /** * List all of your Zone's API Shield mTLS Client Certificates by Status and/or * using Pagination @@ -84,6 +67,23 @@ export class ClientCertificates extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * If a API Shield mTLS Client Certificate is in a pending_revocation state, you + * may reactivate it with this endpoint. + */ + edit( + zoneId: string, + clientCertificateId: string, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.patch( + `/zones/${zoneId}/client_certificates/${clientCertificateId}`, + options, + ) as Core.APIPromise<{ result: ClientCertificateEditResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * Get Details for a single mTLS API Shield Client Certificate */ @@ -207,7 +207,7 @@ export namespace ClientCertificateCreateResponse { } } -export interface ClientCertificateUpdateResponse { +export interface ClientCertificateListResponse { /** * Identifier */ @@ -221,7 +221,7 @@ export interface ClientCertificateUpdateResponse { /** * Certificate Authority used to issue the Client Certificate */ - certificate_authority?: ClientCertificateUpdateResponse.CertificateAuthority; + certificate_authority?: ClientCertificateListResponse.CertificateAuthority; /** * Common Name of the Client Certificate @@ -300,7 +300,7 @@ export interface ClientCertificateUpdateResponse { validity_days?: number; } -export namespace ClientCertificateUpdateResponse { +export namespace ClientCertificateListResponse { /** * Certificate Authority used to issue the Client Certificate */ @@ -311,7 +311,7 @@ export namespace ClientCertificateUpdateResponse { } } -export interface ClientCertificateListResponse { +export interface ClientCertificateDeleteResponse { /** * Identifier */ @@ -325,7 +325,7 @@ export interface ClientCertificateListResponse { /** * Certificate Authority used to issue the Client Certificate */ - certificate_authority?: ClientCertificateListResponse.CertificateAuthority; + certificate_authority?: ClientCertificateDeleteResponse.CertificateAuthority; /** * Common Name of the Client Certificate @@ -404,7 +404,7 @@ export interface ClientCertificateListResponse { validity_days?: number; } -export namespace ClientCertificateListResponse { +export namespace ClientCertificateDeleteResponse { /** * Certificate Authority used to issue the Client Certificate */ @@ -415,7 +415,7 @@ export namespace ClientCertificateListResponse { } } -export interface ClientCertificateDeleteResponse { +export interface ClientCertificateEditResponse { /** * Identifier */ @@ -429,7 +429,7 @@ export interface ClientCertificateDeleteResponse { /** * Certificate Authority used to issue the Client Certificate */ - certificate_authority?: ClientCertificateDeleteResponse.CertificateAuthority; + certificate_authority?: ClientCertificateEditResponse.CertificateAuthority; /** * Common Name of the Client Certificate @@ -508,7 +508,7 @@ export interface ClientCertificateDeleteResponse { validity_days?: number; } -export namespace ClientCertificateDeleteResponse { +export namespace ClientCertificateEditResponse { /** * Certificate Authority used to issue the Client Certificate */ @@ -654,9 +654,9 @@ export interface ClientCertificateListParams extends V4PagePaginationArrayParams export namespace ClientCertificates { export import ClientCertificateCreateResponse = ClientCertificatesAPI.ClientCertificateCreateResponse; - export import ClientCertificateUpdateResponse = ClientCertificatesAPI.ClientCertificateUpdateResponse; export import ClientCertificateListResponse = ClientCertificatesAPI.ClientCertificateListResponse; export import ClientCertificateDeleteResponse = ClientCertificatesAPI.ClientCertificateDeleteResponse; + export import ClientCertificateEditResponse = ClientCertificatesAPI.ClientCertificateEditResponse; export import ClientCertificateGetResponse = ClientCertificatesAPI.ClientCertificateGetResponse; export import ClientCertificateListResponsesV4PagePaginationArray = ClientCertificatesAPI.ClientCertificateListResponsesV4PagePaginationArray; export import ClientCertificateCreateParams = ClientCertificatesAPI.ClientCertificateCreateParams; diff --git a/src/resources/custom-certificates/custom-certificates.ts b/src/resources/custom-certificates/custom-certificates.ts index a2626eff55..3061635d27 100644 --- a/src/resources/custom-certificates/custom-certificates.ts +++ b/src/resources/custom-certificates/custom-certificates.ts @@ -25,25 +25,6 @@ export class CustomCertificates extends APIResource { )._thenUnwrap((obj) => obj.result); } - /** - * Upload a new private key and/or PEM/CRT for the SSL certificate. Note: PATCHing - * a configuration for sni_custom certificates will result in a new resource id - * being returned, and the previous one being deleted. - */ - update( - zoneId: string, - customCertificateId: string, - body: CustomCertificateUpdateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.patch(`/zones/${zoneId}/custom_certificates/${customCertificateId}`, { - body, - ...options, - }) as Core.APIPromise<{ result: CustomCertificateUpdateResponse }> - )._thenUnwrap((obj) => obj.result); - } - /** * List, search, and filter all of your custom SSL certificates. The higher * priority will break ties across overlapping 'legacy_custom' certificates, but @@ -89,6 +70,25 @@ export class CustomCertificates extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Upload a new private key and/or PEM/CRT for the SSL certificate. Note: PATCHing + * a configuration for sni_custom certificates will result in a new resource id + * being returned, and the previous one being deleted. + */ + edit( + zoneId: string, + customCertificateId: string, + body: CustomCertificateEditParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.patch(`/zones/${zoneId}/custom_certificates/${customCertificateId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: CustomCertificateEditResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * SSL Configuration Details */ @@ -110,8 +110,6 @@ export class CustomCertificateListResponsesV4PagePaginationArray extends V4PageP export type CustomCertificateCreateResponse = unknown | string; -export type CustomCertificateUpdateResponse = unknown | string; - export interface CustomCertificateListResponse { /** * Identifier @@ -291,6 +289,8 @@ export interface CustomCertificateDeleteResponse { id?: string; } +export type CustomCertificateEditResponse = unknown | string; + export type CustomCertificateGetResponse = unknown | string; export interface CustomCertificateCreateParams { @@ -358,7 +358,14 @@ export namespace CustomCertificateCreateParams { } } -export interface CustomCertificateUpdateParams { +export interface CustomCertificateListParams extends V4PagePaginationArrayParams { + /** + * Whether to match all search requirements or at least one (any). + */ + match?: 'any' | 'all'; +} + +export interface CustomCertificateEditParams { /** * A ubiquitous bundle has the highest probability of being verified everywhere, * even by clients using outdated or unusual trust stores. An optimal bundle uses @@ -381,7 +388,7 @@ export interface CustomCertificateUpdateParams { * security data centers. Default distribution is to all Cloudflare datacenters, * for optimal performance. */ - geo_restrictions?: CustomCertificateUpdateParams.GeoRestrictions; + geo_restrictions?: CustomCertificateEditParams.GeoRestrictions; /** * Specify the policy that determines the region where your private key will be @@ -402,7 +409,7 @@ export interface CustomCertificateUpdateParams { private_key?: string; } -export namespace CustomCertificateUpdateParams { +export namespace CustomCertificateEditParams { /** * Specify the region where your private key can be held locally for optimal TLS * performance. HTTPS connections to any excluded data center will still be fully @@ -417,24 +424,17 @@ export namespace CustomCertificateUpdateParams { } } -export interface CustomCertificateListParams extends V4PagePaginationArrayParams { - /** - * Whether to match all search requirements or at least one (any). - */ - match?: 'any' | 'all'; -} - export namespace CustomCertificates { export import CustomCertificateCreateResponse = CustomCertificatesAPI.CustomCertificateCreateResponse; - export import CustomCertificateUpdateResponse = CustomCertificatesAPI.CustomCertificateUpdateResponse; export import CustomCertificateListResponse = CustomCertificatesAPI.CustomCertificateListResponse; export import CustomCertificateDeleteResponse = CustomCertificatesAPI.CustomCertificateDeleteResponse; + export import CustomCertificateEditResponse = CustomCertificatesAPI.CustomCertificateEditResponse; export import CustomCertificateGetResponse = CustomCertificatesAPI.CustomCertificateGetResponse; export import CustomCertificateListResponsesV4PagePaginationArray = CustomCertificatesAPI.CustomCertificateListResponsesV4PagePaginationArray; export import CustomCertificateCreateParams = CustomCertificatesAPI.CustomCertificateCreateParams; - export import CustomCertificateUpdateParams = CustomCertificatesAPI.CustomCertificateUpdateParams; export import CustomCertificateListParams = CustomCertificatesAPI.CustomCertificateListParams; + export import CustomCertificateEditParams = CustomCertificatesAPI.CustomCertificateEditParams; export import Prioritize = PrioritizeAPI.Prioritize; - export import PrioritizeReplaceResponse = PrioritizeAPI.PrioritizeReplaceResponse; - export import PrioritizeReplaceParams = PrioritizeAPI.PrioritizeReplaceParams; + export import PrioritizeUpdateResponse = PrioritizeAPI.PrioritizeUpdateResponse; + export import PrioritizeUpdateParams = PrioritizeAPI.PrioritizeUpdateParams; } diff --git a/src/resources/custom-certificates/index.ts b/src/resources/custom-certificates/index.ts index 8b003ea770..0d012b7b72 100644 --- a/src/resources/custom-certificates/index.ts +++ b/src/resources/custom-certificates/index.ts @@ -2,14 +2,14 @@ export { CustomCertificateCreateResponse, - CustomCertificateUpdateResponse, CustomCertificateListResponse, CustomCertificateDeleteResponse, + CustomCertificateEditResponse, CustomCertificateGetResponse, CustomCertificateCreateParams, - CustomCertificateUpdateParams, CustomCertificateListParams, + CustomCertificateEditParams, CustomCertificateListResponsesV4PagePaginationArray, CustomCertificates, } from './custom-certificates'; -export { PrioritizeReplaceResponse, PrioritizeReplaceParams, Prioritize } from './prioritize'; +export { PrioritizeUpdateResponse, PrioritizeUpdateParams, Prioritize } from './prioritize'; diff --git a/src/resources/custom-certificates/prioritize.ts b/src/resources/custom-certificates/prioritize.ts index 4db50348af..6374f76d24 100644 --- a/src/resources/custom-certificates/prioritize.ts +++ b/src/resources/custom-certificates/prioritize.ts @@ -10,24 +10,24 @@ export class Prioritize extends APIResource { * should be used during a request. The higher priority will break ties across * overlapping 'legacy_custom' certificates. */ - replace( + update( zoneId: string, - body: PrioritizeReplaceParams, + body: PrioritizeUpdateParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.put(`/zones/${zoneId}/custom_certificates/prioritize`, { body, ...options, - }) as Core.APIPromise<{ result: PrioritizeReplaceResponse | null }> + }) as Core.APIPromise<{ result: PrioritizeUpdateResponse | null }> )._thenUnwrap((obj) => obj.result); } } -export type PrioritizeReplaceResponse = Array; +export type PrioritizeUpdateResponse = Array; -export namespace PrioritizeReplaceResponse { - export interface PrioritizeReplaceResponseItem { +export namespace PrioritizeUpdateResponse { + export interface PrioritizeUpdateResponseItem { /** * Identifier */ @@ -95,9 +95,9 @@ export namespace PrioritizeReplaceResponse { * security data centers. Default distribution is to all Cloudflare datacenters, * for optimal performance. */ - geo_restrictions?: PrioritizeReplaceResponseItem.GeoRestrictions; + geo_restrictions?: PrioritizeUpdateResponseItem.GeoRestrictions; - keyless_server?: PrioritizeReplaceResponseItem.KeylessServer; + keyless_server?: PrioritizeUpdateResponseItem.KeylessServer; /** * Specify the policy that determines the region where your private key will be @@ -113,7 +113,7 @@ export namespace PrioritizeReplaceResponse { policy?: string; } - export namespace PrioritizeReplaceResponseItem { + export namespace PrioritizeUpdateResponseItem { /** * Specify the region where your private key can be held locally for optimal TLS * performance. HTTPS connections to any excluded data center will still be fully @@ -200,14 +200,14 @@ export namespace PrioritizeReplaceResponse { } } -export interface PrioritizeReplaceParams { +export interface PrioritizeUpdateParams { /** * Array of ordered certificates. */ - certificates: Array; + certificates: Array; } -export namespace PrioritizeReplaceParams { +export namespace PrioritizeUpdateParams { export interface Certificate { /** * The order/priority in which the certificate will be used in a request. The @@ -220,6 +220,6 @@ export namespace PrioritizeReplaceParams { } export namespace Prioritize { - export import PrioritizeReplaceResponse = PrioritizeAPI.PrioritizeReplaceResponse; - export import PrioritizeReplaceParams = PrioritizeAPI.PrioritizeReplaceParams; + export import PrioritizeUpdateResponse = PrioritizeAPI.PrioritizeUpdateResponse; + export import PrioritizeUpdateParams = PrioritizeAPI.PrioritizeUpdateParams; } diff --git a/src/resources/custom-hostnames/custom-hostnames.ts b/src/resources/custom-hostnames/custom-hostnames.ts index 822dd7d830..1373aa2948 100644 --- a/src/resources/custom-hostnames/custom-hostnames.ts +++ b/src/resources/custom-hostnames/custom-hostnames.ts @@ -31,26 +31,6 @@ export class CustomHostnames extends APIResource { )._thenUnwrap((obj) => obj.result); } - /** - * Modify SSL configuration for a custom hostname. When sent with SSL config that - * matches existing config, used to indicate that hostname should pass domain - * control validation (DCV). Can also be used to change validation type, e.g., from - * 'http' to 'email'. - */ - update( - zoneId: string, - customHostnameId: string, - body: CustomHostnameUpdateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.patch(`/zones/${zoneId}/custom_hostnames/${customHostnameId}`, { - body, - ...options, - }) as Core.APIPromise<{ result: CustomHostnameUpdateResponse }> - )._thenUnwrap((obj) => obj.result); - } - /** * List, search, sort, and filter all of your custom hostnames. */ @@ -89,6 +69,26 @@ export class CustomHostnames extends APIResource { return this._client.delete(`/zones/${zoneId}/custom_hostnames/${customHostnameId}`, options); } + /** + * Modify SSL configuration for a custom hostname. When sent with SSL config that + * matches existing config, used to indicate that hostname should pass domain + * control validation (DCV). Can also be used to change validation type, e.g., from + * 'http' to 'email'. + */ + edit( + zoneId: string, + customHostnameId: string, + body: CustomHostnameEditParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.patch(`/zones/${zoneId}/custom_hostnames/${customHostnameId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: CustomHostnameEditResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * Custom Hostname Details */ @@ -323,7 +323,7 @@ export namespace CustomHostnameCreateResponse { } } -export interface CustomHostnameUpdateResponse { +export interface CustomHostnameListResponse { /** * Identifier */ @@ -337,10 +337,10 @@ export interface CustomHostnameUpdateResponse { /** * SSL properties for the custom hostname. */ - ssl: CustomHostnameUpdateResponse.SSL; + ssl: CustomHostnameListResponse.SSL; } -export namespace CustomHostnameUpdateResponse { +export namespace CustomHostnameListResponse { /** * SSL properties for the custom hostname. */ @@ -539,7 +539,14 @@ export namespace CustomHostnameUpdateResponse { } } -export interface CustomHostnameListResponse { +export interface CustomHostnameDeleteResponse { + /** + * Identifier + */ + id?: string; +} + +export interface CustomHostnameEditResponse { /** * Identifier */ @@ -553,10 +560,10 @@ export interface CustomHostnameListResponse { /** * SSL properties for the custom hostname. */ - ssl: CustomHostnameListResponse.SSL; + ssl: CustomHostnameEditResponse.SSL; } -export namespace CustomHostnameListResponse { +export namespace CustomHostnameEditResponse { /** * SSL properties for the custom hostname. */ @@ -755,13 +762,6 @@ export namespace CustomHostnameListResponse { } } -export interface CustomHostnameDeleteResponse { - /** - * Identifier - */ - id?: string; -} - export interface CustomHostnameGetResponse { /** * Identifier @@ -1089,11 +1089,41 @@ export namespace CustomHostnameCreateParams { } } -export interface CustomHostnameUpdateParams { +export interface CustomHostnameListParams extends V4PagePaginationArrayParams { + /** + * Hostname ID to match against. This ID was generated and returned during the + * initial custom_hostname creation. This parameter cannot be used with the + * 'hostname' parameter. + */ + id?: string; + + /** + * Direction to order hostnames. + */ + direction?: 'asc' | 'desc'; + + /** + * Fully qualified domain name to match against. This parameter cannot be used with + * the 'id' parameter. + */ + hostname?: string; + + /** + * Field to order hostnames by. + */ + order?: 'ssl' | 'ssl_status'; + + /** + * Whether to filter hostnames based on if they have SSL enabled. + */ + ssl?: 0 | 1; +} + +export interface CustomHostnameEditParams { /** * These are per-hostname (customer) settings. */ - custom_metadata?: CustomHostnameUpdateParams.CustomMetadata; + custom_metadata?: CustomHostnameEditParams.CustomMetadata; /** * a valid hostname that’s been added to your DNS zone as an A, AAAA, or CNAME @@ -1113,10 +1143,10 @@ export interface CustomHostnameUpdateParams { /** * SSL properties used when creating the custom hostname. */ - ssl?: CustomHostnameUpdateParams.SSL; + ssl?: CustomHostnameEditParams.SSL; } -export namespace CustomHostnameUpdateParams { +export namespace CustomHostnameEditParams { /** * These are per-hostname (customer) settings. */ @@ -1210,49 +1240,19 @@ export namespace CustomHostnameUpdateParams { } } -export interface CustomHostnameListParams extends V4PagePaginationArrayParams { - /** - * Hostname ID to match against. This ID was generated and returned during the - * initial custom_hostname creation. This parameter cannot be used with the - * 'hostname' parameter. - */ - id?: string; - - /** - * Direction to order hostnames. - */ - direction?: 'asc' | 'desc'; - - /** - * Fully qualified domain name to match against. This parameter cannot be used with - * the 'id' parameter. - */ - hostname?: string; - - /** - * Field to order hostnames by. - */ - order?: 'ssl' | 'ssl_status'; - - /** - * Whether to filter hostnames based on if they have SSL enabled. - */ - ssl?: 0 | 1; -} - export namespace CustomHostnames { export import CustomHostnameCreateResponse = CustomHostnamesAPI.CustomHostnameCreateResponse; - export import CustomHostnameUpdateResponse = CustomHostnamesAPI.CustomHostnameUpdateResponse; export import CustomHostnameListResponse = CustomHostnamesAPI.CustomHostnameListResponse; export import CustomHostnameDeleteResponse = CustomHostnamesAPI.CustomHostnameDeleteResponse; + export import CustomHostnameEditResponse = CustomHostnamesAPI.CustomHostnameEditResponse; export import CustomHostnameGetResponse = CustomHostnamesAPI.CustomHostnameGetResponse; export import CustomHostnameListResponsesV4PagePaginationArray = CustomHostnamesAPI.CustomHostnameListResponsesV4PagePaginationArray; export import CustomHostnameCreateParams = CustomHostnamesAPI.CustomHostnameCreateParams; - export import CustomHostnameUpdateParams = CustomHostnamesAPI.CustomHostnameUpdateParams; export import CustomHostnameListParams = CustomHostnamesAPI.CustomHostnameListParams; + export import CustomHostnameEditParams = CustomHostnamesAPI.CustomHostnameEditParams; export import FallbackOrigin = FallbackOriginAPI.FallbackOrigin; + export import FallbackOriginUpdateResponse = FallbackOriginAPI.FallbackOriginUpdateResponse; export import FallbackOriginDeleteResponse = FallbackOriginAPI.FallbackOriginDeleteResponse; export import FallbackOriginGetResponse = FallbackOriginAPI.FallbackOriginGetResponse; - export import FallbackOriginReplaceResponse = FallbackOriginAPI.FallbackOriginReplaceResponse; - export import FallbackOriginReplaceParams = FallbackOriginAPI.FallbackOriginReplaceParams; + export import FallbackOriginUpdateParams = FallbackOriginAPI.FallbackOriginUpdateParams; } diff --git a/src/resources/custom-hostnames/fallback-origin.ts b/src/resources/custom-hostnames/fallback-origin.ts index f7ce1f1256..9471e0ff3e 100644 --- a/src/resources/custom-hostnames/fallback-origin.ts +++ b/src/resources/custom-hostnames/fallback-origin.ts @@ -5,6 +5,22 @@ import { APIResource } from 'cloudflare/resource'; import * as FallbackOriginAPI from 'cloudflare/resources/custom-hostnames/fallback-origin'; export class FallbackOrigin extends APIResource { + /** + * Update Fallback Origin for Custom Hostnames + */ + update( + zoneId: string, + body: FallbackOriginUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/zones/${zoneId}/custom_hostnames/fallback_origin`, { + body, + ...options, + }) as Core.APIPromise<{ result: FallbackOriginUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * Delete Fallback Origin for Custom Hostnames */ @@ -26,31 +42,15 @@ export class FallbackOrigin extends APIResource { }> )._thenUnwrap((obj) => obj.result); } - - /** - * Update Fallback Origin for Custom Hostnames - */ - replace( - zoneId: string, - body: FallbackOriginReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put(`/zones/${zoneId}/custom_hostnames/fallback_origin`, { - body, - ...options, - }) as Core.APIPromise<{ result: FallbackOriginReplaceResponse }> - )._thenUnwrap((obj) => obj.result); - } } +export type FallbackOriginUpdateResponse = unknown | string; + export type FallbackOriginDeleteResponse = unknown | string; export type FallbackOriginGetResponse = unknown | string; -export type FallbackOriginReplaceResponse = unknown | string; - -export interface FallbackOriginReplaceParams { +export interface FallbackOriginUpdateParams { /** * Your origin hostname that requests to your custom hostnames will be sent to. */ @@ -58,8 +58,8 @@ export interface FallbackOriginReplaceParams { } export namespace FallbackOrigin { + export import FallbackOriginUpdateResponse = FallbackOriginAPI.FallbackOriginUpdateResponse; export import FallbackOriginDeleteResponse = FallbackOriginAPI.FallbackOriginDeleteResponse; export import FallbackOriginGetResponse = FallbackOriginAPI.FallbackOriginGetResponse; - export import FallbackOriginReplaceResponse = FallbackOriginAPI.FallbackOriginReplaceResponse; - export import FallbackOriginReplaceParams = FallbackOriginAPI.FallbackOriginReplaceParams; + export import FallbackOriginUpdateParams = FallbackOriginAPI.FallbackOriginUpdateParams; } diff --git a/src/resources/custom-hostnames/index.ts b/src/resources/custom-hostnames/index.ts index 3bc5aa7801..8030b233cc 100644 --- a/src/resources/custom-hostnames/index.ts +++ b/src/resources/custom-hostnames/index.ts @@ -2,20 +2,20 @@ export { CustomHostnameCreateResponse, - CustomHostnameUpdateResponse, CustomHostnameListResponse, CustomHostnameDeleteResponse, + CustomHostnameEditResponse, CustomHostnameGetResponse, CustomHostnameCreateParams, - CustomHostnameUpdateParams, CustomHostnameListParams, + CustomHostnameEditParams, CustomHostnameListResponsesV4PagePaginationArray, CustomHostnames, } from './custom-hostnames'; export { + FallbackOriginUpdateResponse, FallbackOriginDeleteResponse, FallbackOriginGetResponse, - FallbackOriginReplaceResponse, - FallbackOriginReplaceParams, + FallbackOriginUpdateParams, FallbackOrigin, } from './fallback-origin'; diff --git a/src/resources/devices/devices.ts b/src/resources/devices/devices.ts index c63e30f106..4eff880a6b 100644 --- a/src/resources/devices/devices.ts +++ b/src/resources/devices/devices.ts @@ -179,43 +179,43 @@ export namespace Devices { export import DeviceGetResponse = DevicesAPI.DeviceGetResponse; export import DEXTests = DEXTestsAPI.DEXTests; export import DEXTestCreateResponse = DEXTestsAPI.DEXTestCreateResponse; + export import DEXTestUpdateResponse = DEXTestsAPI.DEXTestUpdateResponse; export import DEXTestListResponse = DEXTestsAPI.DEXTestListResponse; export import DEXTestDeleteResponse = DEXTestsAPI.DEXTestDeleteResponse; export import DEXTestGetResponse = DEXTestsAPI.DEXTestGetResponse; - export import DEXTestReplaceResponse = DEXTestsAPI.DEXTestReplaceResponse; export import DEXTestCreateParams = DEXTestsAPI.DEXTestCreateParams; - export import DEXTestReplaceParams = DEXTestsAPI.DEXTestReplaceParams; + export import DEXTestUpdateParams = DEXTestsAPI.DEXTestUpdateParams; export import Networks = NetworksAPI.Networks; export import NetworkCreateResponse = NetworksAPI.NetworkCreateResponse; + export import NetworkUpdateResponse = NetworksAPI.NetworkUpdateResponse; export import NetworkListResponse = NetworksAPI.NetworkListResponse; export import NetworkDeleteResponse = NetworksAPI.NetworkDeleteResponse; export import NetworkGetResponse = NetworksAPI.NetworkGetResponse; - export import NetworkReplaceResponse = NetworksAPI.NetworkReplaceResponse; export import NetworkCreateParams = NetworksAPI.NetworkCreateParams; - export import NetworkReplaceParams = NetworksAPI.NetworkReplaceParams; + export import NetworkUpdateParams = NetworksAPI.NetworkUpdateParams; export import Policies = PoliciesAPI.Policies; export import PolicyCreateResponse = PoliciesAPI.PolicyCreateResponse; - export import PolicyUpdateResponse = PoliciesAPI.PolicyUpdateResponse; export import PolicyListResponse = PoliciesAPI.PolicyListResponse; export import PolicyDeleteResponse = PoliciesAPI.PolicyDeleteResponse; + export import PolicyEditResponse = PoliciesAPI.PolicyEditResponse; export import PolicyGetResponse = PoliciesAPI.PolicyGetResponse; export import PolicyCreateParams = PoliciesAPI.PolicyCreateParams; - export import PolicyUpdateParams = PoliciesAPI.PolicyUpdateParams; + export import PolicyEditParams = PoliciesAPI.PolicyEditParams; export import Postures = PosturesAPI.Postures; export import PostureCreateResponse = PosturesAPI.PostureCreateResponse; + export import PostureUpdateResponse = PosturesAPI.PostureUpdateResponse; export import PostureListResponse = PosturesAPI.PostureListResponse; export import PostureDeleteResponse = PosturesAPI.PostureDeleteResponse; export import PostureGetResponse = PosturesAPI.PostureGetResponse; - export import PostureReplaceResponse = PosturesAPI.PostureReplaceResponse; export import PostureCreateParams = PosturesAPI.PostureCreateParams; - export import PostureReplaceParams = PosturesAPI.PostureReplaceParams; + export import PostureUpdateParams = PosturesAPI.PostureUpdateParams; export import Revokes = RevokesAPI.Revokes; export import RevokeCreateResponse = RevokesAPI.RevokeCreateResponse; export import RevokeCreateParams = RevokesAPI.RevokeCreateParams; export import Settings = SettingsAPI.Settings; + export import SettingUpdateResponse = SettingsAPI.SettingUpdateResponse; export import SettingListResponse = SettingsAPI.SettingListResponse; - export import SettingReplaceResponse = SettingsAPI.SettingReplaceResponse; - export import SettingReplaceParams = SettingsAPI.SettingReplaceParams; + export import SettingUpdateParams = SettingsAPI.SettingUpdateParams; export import Unrevokes = UnrevokesAPI.Unrevokes; export import UnrevokeCreateResponse = UnrevokesAPI.UnrevokeCreateResponse; export import UnrevokeCreateParams = UnrevokesAPI.UnrevokeCreateParams; diff --git a/src/resources/devices/dex-tests.ts b/src/resources/devices/dex-tests.ts index 6faa471132..42fdc2f3db 100644 --- a/src/resources/devices/dex-tests.ts +++ b/src/resources/devices/dex-tests.ts @@ -21,6 +21,23 @@ export class DEXTests extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Update a DEX test. + */ + update( + identifier: unknown, + uuid: string, + body: DEXTestUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/accounts/${identifier}/devices/dex_tests/${uuid}`, { + body, + ...options, + }) as Core.APIPromise<{ result: DEXTestUpdateResponse | null }> + )._thenUnwrap((obj) => obj.result); + } + /** * Fetch all DEX tests. */ @@ -62,31 +79,65 @@ export class DEXTests extends APIResource { }> )._thenUnwrap((obj) => obj.result); } +} +export interface DEXTestCreateResponse { /** - * Update a DEX test. + * The configuration object which contains the details for the WARP client to + * conduct the test. */ - replace( - identifier: unknown, - uuid: string, - body: DEXTestReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put(`/accounts/${identifier}/devices/dex_tests/${uuid}`, { - body, - ...options, - }) as Core.APIPromise<{ result: DEXTestReplaceResponse | null }> - )._thenUnwrap((obj) => obj.result); + data: DEXTestCreateResponse.Data; + + /** + * Determines whether or not the test is active. + */ + enabled: boolean; + + /** + * How often the test will run. + */ + interval: string; + + /** + * The name of the DEX test. Must be unique. + */ + name: string; + + /** + * Additional details about the test. + */ + description?: string; +} + +export namespace DEXTestCreateResponse { + /** + * The configuration object which contains the details for the WARP client to + * conduct the test. + */ + export interface Data { + /** + * The desired endpoint to test. + */ + host?: string; + + /** + * The type of test. + */ + kind?: string; + + /** + * The HTTP request method type. + */ + method?: string; } } -export interface DEXTestCreateResponse { +export interface DEXTestUpdateResponse { /** * The configuration object which contains the details for the WARP client to * conduct the test. */ - data: DEXTestCreateResponse.Data; + data: DEXTestUpdateResponse.Data; /** * Determines whether or not the test is active. @@ -109,7 +160,7 @@ export interface DEXTestCreateResponse { description?: string; } -export namespace DEXTestCreateResponse { +export namespace DEXTestUpdateResponse { /** * The configuration object which contains the details for the WARP client to * conduct the test. @@ -293,57 +344,6 @@ export namespace DEXTestGetResponse { } } -export interface DEXTestReplaceResponse { - /** - * The configuration object which contains the details for the WARP client to - * conduct the test. - */ - data: DEXTestReplaceResponse.Data; - - /** - * Determines whether or not the test is active. - */ - enabled: boolean; - - /** - * How often the test will run. - */ - interval: string; - - /** - * The name of the DEX test. Must be unique. - */ - name: string; - - /** - * Additional details about the test. - */ - description?: string; -} - -export namespace DEXTestReplaceResponse { - /** - * The configuration object which contains the details for the WARP client to - * conduct the test. - */ - export interface Data { - /** - * The desired endpoint to test. - */ - host?: string; - - /** - * The type of test. - */ - kind?: string; - - /** - * The HTTP request method type. - */ - method?: string; - } -} - export interface DEXTestCreateParams { /** * The configuration object which contains the details for the WARP client to @@ -395,12 +395,12 @@ export namespace DEXTestCreateParams { } } -export interface DEXTestReplaceParams { +export interface DEXTestUpdateParams { /** * The configuration object which contains the details for the WARP client to * conduct the test. */ - data: DEXTestReplaceParams.Data; + data: DEXTestUpdateParams.Data; /** * Determines whether or not the test is active. @@ -423,7 +423,7 @@ export interface DEXTestReplaceParams { description?: string; } -export namespace DEXTestReplaceParams { +export namespace DEXTestUpdateParams { /** * The configuration object which contains the details for the WARP client to * conduct the test. @@ -448,10 +448,10 @@ export namespace DEXTestReplaceParams { export namespace DEXTests { export import DEXTestCreateResponse = DEXTestsAPI.DEXTestCreateResponse; + export import DEXTestUpdateResponse = DEXTestsAPI.DEXTestUpdateResponse; export import DEXTestListResponse = DEXTestsAPI.DEXTestListResponse; export import DEXTestDeleteResponse = DEXTestsAPI.DEXTestDeleteResponse; export import DEXTestGetResponse = DEXTestsAPI.DEXTestGetResponse; - export import DEXTestReplaceResponse = DEXTestsAPI.DEXTestReplaceResponse; export import DEXTestCreateParams = DEXTestsAPI.DEXTestCreateParams; - export import DEXTestReplaceParams = DEXTestsAPI.DEXTestReplaceParams; + export import DEXTestUpdateParams = DEXTestsAPI.DEXTestUpdateParams; } diff --git a/src/resources/devices/index.ts b/src/resources/devices/index.ts index 3c57b6bd0a..0497b2dd45 100644 --- a/src/resources/devices/index.ts +++ b/src/resources/devices/index.ts @@ -2,46 +2,46 @@ export { DEXTestCreateResponse, + DEXTestUpdateResponse, DEXTestListResponse, DEXTestDeleteResponse, DEXTestGetResponse, - DEXTestReplaceResponse, DEXTestCreateParams, - DEXTestReplaceParams, + DEXTestUpdateParams, DEXTests, } from './dex-tests'; export { DeviceDevicesListDevicesResponse, DeviceGetResponse, Devices } from './devices'; export { NetworkCreateResponse, + NetworkUpdateResponse, NetworkListResponse, NetworkDeleteResponse, NetworkGetResponse, - NetworkReplaceResponse, NetworkCreateParams, - NetworkReplaceParams, + NetworkUpdateParams, Networks, } from './networks'; export { OverrideCodeListResponse, OverrideCodes } from './override-codes'; export { PolicyCreateResponse, - PolicyUpdateResponse, PolicyListResponse, PolicyDeleteResponse, + PolicyEditResponse, PolicyGetResponse, PolicyCreateParams, - PolicyUpdateParams, + PolicyEditParams, Policies, } from './policies/index'; export { PostureCreateResponse, + PostureUpdateResponse, PostureListResponse, PostureDeleteResponse, PostureGetResponse, - PostureReplaceResponse, PostureCreateParams, - PostureReplaceParams, + PostureUpdateParams, Postures, } from './postures/index'; export { RevokeCreateResponse, RevokeCreateParams, Revokes } from './revokes'; -export { SettingListResponse, SettingReplaceResponse, SettingReplaceParams, Settings } from './settings'; +export { SettingUpdateResponse, SettingListResponse, SettingUpdateParams, Settings } from './settings'; export { UnrevokeCreateResponse, UnrevokeCreateParams, Unrevokes } from './unrevokes'; diff --git a/src/resources/devices/networks.ts b/src/resources/devices/networks.ts index c91c95cc61..cf96406d03 100644 --- a/src/resources/devices/networks.ts +++ b/src/resources/devices/networks.ts @@ -20,6 +20,23 @@ export class Networks extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Updates a configured device managed network. + */ + update( + identifier: unknown, + uuid: string, + body: NetworkUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/accounts/${identifier}/devices/networks/${uuid}`, { + body, + ...options, + }) as Core.APIPromise<{ result: NetworkUpdateResponse | null }> + )._thenUnwrap((obj) => obj.result); + } + /** * Fetches a list of managed networks for an account. */ @@ -61,31 +78,58 @@ export class Networks extends APIResource { }> )._thenUnwrap((obj) => obj.result); } +} +export interface NetworkCreateResponse { /** - * Updates a configured device managed network. + * The configuration object containing information for the WARP client to detect + * the managed network. */ - replace( - identifier: unknown, - uuid: string, - body: NetworkReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put(`/accounts/${identifier}/devices/networks/${uuid}`, { - body, - ...options, - }) as Core.APIPromise<{ result: NetworkReplaceResponse | null }> - )._thenUnwrap((obj) => obj.result); + config?: NetworkCreateResponse.Config; + + /** + * The name of the device managed network. This name must be unique. + */ + name?: string; + + /** + * API UUID. + */ + network_id?: string; + + /** + * The type of device managed network. + */ + type?: 'tls'; +} + +export namespace NetworkCreateResponse { + /** + * The configuration object containing information for the WARP client to detect + * the managed network. + */ + export interface Config { + /** + * A network address of the form "host:port" that the WARP client will use to + * detect the presence of a TLS host. + */ + tls_sockaddr: string; + + /** + * The SHA-256 hash of the TLS certificate presented by the host found at + * tls_sockaddr. If absent, regular certificate verification (trusted roots, valid + * timestamp, etc) will be used to validate the certificate. + */ + sha256?: string; } } -export interface NetworkCreateResponse { +export interface NetworkUpdateResponse { /** * The configuration object containing information for the WARP client to detect * the managed network. */ - config?: NetworkCreateResponse.Config; + config?: NetworkUpdateResponse.Config; /** * The name of the device managed network. This name must be unique. @@ -103,7 +147,7 @@ export interface NetworkCreateResponse { type?: 'tls'; } -export namespace NetworkCreateResponse { +export namespace NetworkUpdateResponse { /** * The configuration object containing information for the WARP client to detect * the managed network. @@ -264,50 +308,6 @@ export namespace NetworkGetResponse { } } -export interface NetworkReplaceResponse { - /** - * The configuration object containing information for the WARP client to detect - * the managed network. - */ - config?: NetworkReplaceResponse.Config; - - /** - * The name of the device managed network. This name must be unique. - */ - name?: string; - - /** - * API UUID. - */ - network_id?: string; - - /** - * The type of device managed network. - */ - type?: 'tls'; -} - -export namespace NetworkReplaceResponse { - /** - * The configuration object containing information for the WARP client to detect - * the managed network. - */ - export interface Config { - /** - * A network address of the form "host:port" that the WARP client will use to - * detect the presence of a TLS host. - */ - tls_sockaddr: string; - - /** - * The SHA-256 hash of the TLS certificate presented by the host found at - * tls_sockaddr. If absent, regular certificate verification (trusted roots, valid - * timestamp, etc) will be used to validate the certificate. - */ - sha256?: string; - } -} - export interface NetworkCreateParams { /** * The configuration object containing information for the WARP client to detect @@ -347,12 +347,12 @@ export namespace NetworkCreateParams { } } -export interface NetworkReplaceParams { +export interface NetworkUpdateParams { /** * The configuration object containing information for the WARP client to detect * the managed network. */ - config?: NetworkReplaceParams.Config; + config?: NetworkUpdateParams.Config; /** * The name of the device managed network. This name must be unique. @@ -365,7 +365,7 @@ export interface NetworkReplaceParams { type?: 'tls'; } -export namespace NetworkReplaceParams { +export namespace NetworkUpdateParams { /** * The configuration object containing information for the WARP client to detect * the managed network. @@ -388,10 +388,10 @@ export namespace NetworkReplaceParams { export namespace Networks { export import NetworkCreateResponse = NetworksAPI.NetworkCreateResponse; + export import NetworkUpdateResponse = NetworksAPI.NetworkUpdateResponse; export import NetworkListResponse = NetworksAPI.NetworkListResponse; export import NetworkDeleteResponse = NetworksAPI.NetworkDeleteResponse; export import NetworkGetResponse = NetworksAPI.NetworkGetResponse; - export import NetworkReplaceResponse = NetworksAPI.NetworkReplaceResponse; export import NetworkCreateParams = NetworksAPI.NetworkCreateParams; - export import NetworkReplaceParams = NetworksAPI.NetworkReplaceParams; + export import NetworkUpdateParams = NetworksAPI.NetworkUpdateParams; } diff --git a/src/resources/devices/policies/excludes.ts b/src/resources/devices/policies/excludes.ts index 3af51bd907..8972d7fec6 100644 --- a/src/resources/devices/policies/excludes.ts +++ b/src/resources/devices/policies/excludes.ts @@ -5,38 +5,38 @@ import { APIResource } from 'cloudflare/resource'; import * as ExcludesAPI from 'cloudflare/resources/devices/policies/excludes'; export class Excludes extends APIResource { - /** - * Fetches the list of routes excluded from the WARP client's tunnel. - */ - list(identifier: unknown, options?: Core.RequestOptions): Core.APIPromise { - return ( - this._client.get(`/accounts/${identifier}/devices/policy/exclude`, options) as Core.APIPromise<{ - result: ExcludeListResponse | null; - }> - )._thenUnwrap((obj) => obj.result); - } - /** * Sets the list of routes excluded from the WARP client's tunnel. */ - replace( + update( identifier: unknown, - body: ExcludeReplaceParams, + body: ExcludeUpdateParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.put(`/accounts/${identifier}/devices/policy/exclude`, { body, ...options, - }) as Core.APIPromise<{ result: ExcludeReplaceResponse | null }> + }) as Core.APIPromise<{ result: ExcludeUpdateResponse | null }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Fetches the list of routes excluded from the WARP client's tunnel. + */ + list(identifier: unknown, options?: Core.RequestOptions): Core.APIPromise { + return ( + this._client.get(`/accounts/${identifier}/devices/policy/exclude`, options) as Core.APIPromise<{ + result: ExcludeListResponse | null; + }> )._thenUnwrap((obj) => obj.result); } } -export type ExcludeListResponse = Array; +export type ExcludeUpdateResponse = Array; -export namespace ExcludeListResponse { - export interface ExcludeListResponseItem { +export namespace ExcludeUpdateResponse { + export interface ExcludeUpdateResponseItem { /** * The address in CIDR format to exclude from the tunnel. If `address` is present, * `host` must not be present. @@ -56,10 +56,10 @@ export namespace ExcludeListResponse { } } -export type ExcludeReplaceResponse = Array; +export type ExcludeListResponse = Array; -export namespace ExcludeReplaceResponse { - export interface ExcludeReplaceResponseItem { +export namespace ExcludeListResponse { + export interface ExcludeListResponseItem { /** * The address in CIDR format to exclude from the tunnel. If `address` is present, * `host` must not be present. @@ -79,9 +79,9 @@ export namespace ExcludeReplaceResponse { } } -export type ExcludeReplaceParams = Array; +export type ExcludeUpdateParams = Array; -export namespace ExcludeReplaceParams { +export namespace ExcludeUpdateParams { export interface Body { /** * The address in CIDR format to exclude from the tunnel. If `address` is present, @@ -103,7 +103,7 @@ export namespace ExcludeReplaceParams { } export namespace Excludes { + export import ExcludeUpdateResponse = ExcludesAPI.ExcludeUpdateResponse; export import ExcludeListResponse = ExcludesAPI.ExcludeListResponse; - export import ExcludeReplaceResponse = ExcludesAPI.ExcludeReplaceResponse; - export import ExcludeReplaceParams = ExcludesAPI.ExcludeReplaceParams; + export import ExcludeUpdateParams = ExcludesAPI.ExcludeUpdateParams; } diff --git a/src/resources/devices/policies/fallback-domains.ts b/src/resources/devices/policies/fallback-domains.ts index d9546d8bbb..bebbca5f06 100644 --- a/src/resources/devices/policies/fallback-domains.ts +++ b/src/resources/devices/policies/fallback-domains.ts @@ -6,47 +6,48 @@ import * as FallbackDomainsAPI from 'cloudflare/resources/devices/policies/fallb export class FallbackDomains extends APIResource { /** - * Fetches the list of domains to bypass Gateway DNS resolution from a specified - * device settings profile. These domains will use the specified local DNS resolver - * instead. + * Sets the list of domains to bypass Gateway DNS resolution. These domains will + * use the specified local DNS resolver instead. This will only apply to the + * specified device settings profile. */ - list( + update( identifier: unknown, uuid: string, + body: FallbackDomainUpdateParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( - this._client.get( - `/accounts/${identifier}/devices/policy/${uuid}/fallback_domains`, - options, - ) as Core.APIPromise<{ result: FallbackDomainListResponse | null }> + this._client.put(`/accounts/${identifier}/devices/policy/${uuid}/fallback_domains`, { + body, + ...options, + }) as Core.APIPromise<{ result: FallbackDomainUpdateResponse | null }> )._thenUnwrap((obj) => obj.result); } /** - * Sets the list of domains to bypass Gateway DNS resolution. These domains will - * use the specified local DNS resolver instead. This will only apply to the - * specified device settings profile. + * Fetches the list of domains to bypass Gateway DNS resolution from a specified + * device settings profile. These domains will use the specified local DNS resolver + * instead. */ - replace( + list( identifier: unknown, uuid: string, - body: FallbackDomainReplaceParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( - this._client.put(`/accounts/${identifier}/devices/policy/${uuid}/fallback_domains`, { - body, - ...options, - }) as Core.APIPromise<{ result: FallbackDomainReplaceResponse | null }> + this._client.get( + `/accounts/${identifier}/devices/policy/${uuid}/fallback_domains`, + options, + ) as Core.APIPromise<{ result: FallbackDomainListResponse | null }> )._thenUnwrap((obj) => obj.result); } } -export type FallbackDomainListResponse = Array; +export type FallbackDomainUpdateResponse = + Array; -export namespace FallbackDomainListResponse { - export interface FallbackDomainListResponseItem { +export namespace FallbackDomainUpdateResponse { + export interface FallbackDomainUpdateResponseItem { /** * The domain suffix to match when resolving locally. */ @@ -64,11 +65,10 @@ export namespace FallbackDomainListResponse { } } -export type FallbackDomainReplaceResponse = - Array; +export type FallbackDomainListResponse = Array; -export namespace FallbackDomainReplaceResponse { - export interface FallbackDomainReplaceResponseItem { +export namespace FallbackDomainListResponse { + export interface FallbackDomainListResponseItem { /** * The domain suffix to match when resolving locally. */ @@ -86,9 +86,9 @@ export namespace FallbackDomainReplaceResponse { } } -export type FallbackDomainReplaceParams = Array; +export type FallbackDomainUpdateParams = Array; -export namespace FallbackDomainReplaceParams { +export namespace FallbackDomainUpdateParams { export interface Body { /** * The domain suffix to match when resolving locally. @@ -108,7 +108,7 @@ export namespace FallbackDomainReplaceParams { } export namespace FallbackDomains { + export import FallbackDomainUpdateResponse = FallbackDomainsAPI.FallbackDomainUpdateResponse; export import FallbackDomainListResponse = FallbackDomainsAPI.FallbackDomainListResponse; - export import FallbackDomainReplaceResponse = FallbackDomainsAPI.FallbackDomainReplaceResponse; - export import FallbackDomainReplaceParams = FallbackDomainsAPI.FallbackDomainReplaceParams; + export import FallbackDomainUpdateParams = FallbackDomainsAPI.FallbackDomainUpdateParams; } diff --git a/src/resources/devices/policies/includes.ts b/src/resources/devices/policies/includes.ts index c3cfaa0434..3c0f0de2a3 100644 --- a/src/resources/devices/policies/includes.ts +++ b/src/resources/devices/policies/includes.ts @@ -5,38 +5,38 @@ import { APIResource } from 'cloudflare/resource'; import * as IncludesAPI from 'cloudflare/resources/devices/policies/includes'; export class Includes extends APIResource { - /** - * Fetches the list of routes included in the WARP client's tunnel. - */ - list(identifier: unknown, options?: Core.RequestOptions): Core.APIPromise { - return ( - this._client.get(`/accounts/${identifier}/devices/policy/include`, options) as Core.APIPromise<{ - result: IncludeListResponse | null; - }> - )._thenUnwrap((obj) => obj.result); - } - /** * Sets the list of routes included in the WARP client's tunnel. */ - replace( + update( identifier: unknown, - body: IncludeReplaceParams, + body: IncludeUpdateParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.put(`/accounts/${identifier}/devices/policy/include`, { body, ...options, - }) as Core.APIPromise<{ result: IncludeReplaceResponse | null }> + }) as Core.APIPromise<{ result: IncludeUpdateResponse | null }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Fetches the list of routes included in the WARP client's tunnel. + */ + list(identifier: unknown, options?: Core.RequestOptions): Core.APIPromise { + return ( + this._client.get(`/accounts/${identifier}/devices/policy/include`, options) as Core.APIPromise<{ + result: IncludeListResponse | null; + }> )._thenUnwrap((obj) => obj.result); } } -export type IncludeListResponse = Array; +export type IncludeUpdateResponse = Array; -export namespace IncludeListResponse { - export interface IncludeListResponseItem { +export namespace IncludeUpdateResponse { + export interface IncludeUpdateResponseItem { /** * The address in CIDR format to include in the tunnel. If address is present, host * must not be present. @@ -56,10 +56,10 @@ export namespace IncludeListResponse { } } -export type IncludeReplaceResponse = Array; +export type IncludeListResponse = Array; -export namespace IncludeReplaceResponse { - export interface IncludeReplaceResponseItem { +export namespace IncludeListResponse { + export interface IncludeListResponseItem { /** * The address in CIDR format to include in the tunnel. If address is present, host * must not be present. @@ -79,9 +79,9 @@ export namespace IncludeReplaceResponse { } } -export type IncludeReplaceParams = Array; +export type IncludeUpdateParams = Array; -export namespace IncludeReplaceParams { +export namespace IncludeUpdateParams { export interface Body { /** * The address in CIDR format to include in the tunnel. If address is present, host @@ -103,7 +103,7 @@ export namespace IncludeReplaceParams { } export namespace Includes { + export import IncludeUpdateResponse = IncludesAPI.IncludeUpdateResponse; export import IncludeListResponse = IncludesAPI.IncludeListResponse; - export import IncludeReplaceResponse = IncludesAPI.IncludeReplaceResponse; - export import IncludeReplaceParams = IncludesAPI.IncludeReplaceParams; + export import IncludeUpdateParams = IncludesAPI.IncludeUpdateParams; } diff --git a/src/resources/devices/policies/index.ts b/src/resources/devices/policies/index.ts index ff88f8c784..68d2b884de 100644 --- a/src/resources/devices/policies/index.ts +++ b/src/resources/devices/policies/index.ts @@ -1,21 +1,21 @@ // File generated from our OpenAPI spec by Stainless. export { DefaultPolicyGetResponse, DefaultPolicy } from './default-policy'; -export { ExcludeListResponse, ExcludeReplaceResponse, ExcludeReplaceParams, Excludes } from './excludes'; +export { ExcludeUpdateResponse, ExcludeListResponse, ExcludeUpdateParams, Excludes } from './excludes'; export { + FallbackDomainUpdateResponse, FallbackDomainListResponse, - FallbackDomainReplaceResponse, - FallbackDomainReplaceParams, + FallbackDomainUpdateParams, FallbackDomains, } from './fallback-domains'; -export { IncludeListResponse, IncludeReplaceResponse, IncludeReplaceParams, Includes } from './includes'; +export { IncludeUpdateResponse, IncludeListResponse, IncludeUpdateParams, Includes } from './includes'; export { PolicyCreateResponse, - PolicyUpdateResponse, PolicyListResponse, PolicyDeleteResponse, + PolicyEditResponse, PolicyGetResponse, PolicyCreateParams, - PolicyUpdateParams, + PolicyEditParams, Policies, } from './policies'; diff --git a/src/resources/devices/policies/policies.ts b/src/resources/devices/policies/policies.ts index fa9d6c118b..2af4ac4316 100644 --- a/src/resources/devices/policies/policies.ts +++ b/src/resources/devices/policies/policies.ts @@ -30,23 +30,6 @@ export class Policies extends APIResource { )._thenUnwrap((obj) => obj.result); } - /** - * Updates a configured device settings profile. - */ - update( - identifier: unknown, - uuid: string, - body: PolicyUpdateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.patch(`/accounts/${identifier}/devices/policy/${uuid}`, { - body, - ...options, - }) as Core.APIPromise<{ result: PolicyUpdateResponse | null }> - )._thenUnwrap((obj) => obj.result); - } - /** * Fetches a list of the device settings profiles for an account. */ @@ -74,6 +57,23 @@ export class Policies extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Updates a configured device settings profile. + */ + edit( + identifier: unknown, + uuid: string, + body: PolicyEditParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.patch(`/accounts/${identifier}/devices/policy/${uuid}`, { + body, + ...options, + }) as Core.APIPromise<{ result: PolicyEditResponse | null }> + )._thenUnwrap((obj) => obj.result); + } + /** * Fetches a device settings profile by ID. */ @@ -92,8 +92,6 @@ export class Policies extends APIResource { export type PolicyCreateResponse = Array; -export type PolicyUpdateResponse = Array; - export type PolicyListResponse = Array; export namespace PolicyListResponse { @@ -460,6 +458,8 @@ export namespace PolicyDeleteResponse { } } +export type PolicyEditResponse = Array; + export type PolicyGetResponse = Array; export interface PolicyCreateParams { @@ -568,7 +568,7 @@ export namespace PolicyCreateParams { } } -export interface PolicyUpdateParams { +export interface PolicyEditParams { /** * Whether to allow the user to switch WARP between modes. */ @@ -633,7 +633,7 @@ export interface PolicyUpdateParams { */ precedence?: number; - service_mode_v2?: PolicyUpdateParams.ServiceModeV2; + service_mode_v2?: PolicyEditParams.ServiceModeV2; /** * The URL to launch when the Send Feedback button is clicked. @@ -646,7 +646,7 @@ export interface PolicyUpdateParams { switch_locked?: boolean; } -export namespace PolicyUpdateParams { +export namespace PolicyEditParams { export interface ServiceModeV2 { /** * The mode to run the WARP client under. @@ -662,24 +662,24 @@ export namespace PolicyUpdateParams { export namespace Policies { export import PolicyCreateResponse = PoliciesAPI.PolicyCreateResponse; - export import PolicyUpdateResponse = PoliciesAPI.PolicyUpdateResponse; export import PolicyListResponse = PoliciesAPI.PolicyListResponse; export import PolicyDeleteResponse = PoliciesAPI.PolicyDeleteResponse; + export import PolicyEditResponse = PoliciesAPI.PolicyEditResponse; export import PolicyGetResponse = PoliciesAPI.PolicyGetResponse; export import PolicyCreateParams = PoliciesAPI.PolicyCreateParams; - export import PolicyUpdateParams = PoliciesAPI.PolicyUpdateParams; + export import PolicyEditParams = PoliciesAPI.PolicyEditParams; export import DefaultPolicy = DefaultPolicyAPI.DefaultPolicy; export import DefaultPolicyGetResponse = DefaultPolicyAPI.DefaultPolicyGetResponse; export import Excludes = ExcludesAPI.Excludes; + export import ExcludeUpdateResponse = ExcludesAPI.ExcludeUpdateResponse; export import ExcludeListResponse = ExcludesAPI.ExcludeListResponse; - export import ExcludeReplaceResponse = ExcludesAPI.ExcludeReplaceResponse; - export import ExcludeReplaceParams = ExcludesAPI.ExcludeReplaceParams; + export import ExcludeUpdateParams = ExcludesAPI.ExcludeUpdateParams; export import FallbackDomains = FallbackDomainsAPI.FallbackDomains; + export import FallbackDomainUpdateResponse = FallbackDomainsAPI.FallbackDomainUpdateResponse; export import FallbackDomainListResponse = FallbackDomainsAPI.FallbackDomainListResponse; - export import FallbackDomainReplaceResponse = FallbackDomainsAPI.FallbackDomainReplaceResponse; - export import FallbackDomainReplaceParams = FallbackDomainsAPI.FallbackDomainReplaceParams; + export import FallbackDomainUpdateParams = FallbackDomainsAPI.FallbackDomainUpdateParams; export import Includes = IncludesAPI.Includes; + export import IncludeUpdateResponse = IncludesAPI.IncludeUpdateResponse; export import IncludeListResponse = IncludesAPI.IncludeListResponse; - export import IncludeReplaceResponse = IncludesAPI.IncludeReplaceResponse; - export import IncludeReplaceParams = IncludesAPI.IncludeReplaceParams; + export import IncludeUpdateParams = IncludesAPI.IncludeUpdateParams; } diff --git a/src/resources/devices/postures/index.ts b/src/resources/devices/postures/index.ts index a6b62ef630..f79dd97c3e 100644 --- a/src/resources/devices/postures/index.ts +++ b/src/resources/devices/postures/index.ts @@ -2,20 +2,20 @@ export { IntegrationCreateResponse, - IntegrationUpdateResponse, IntegrationDeleteResponse, + IntegrationEditResponse, IntegrationGetResponse, IntegrationCreateParams, - IntegrationUpdateParams, + IntegrationEditParams, Integrations, } from './integrations'; export { PostureCreateResponse, + PostureUpdateResponse, PostureListResponse, PostureDeleteResponse, PostureGetResponse, - PostureReplaceResponse, PostureCreateParams, - PostureReplaceParams, + PostureUpdateParams, Postures, } from './postures'; diff --git a/src/resources/devices/postures/integrations.ts b/src/resources/devices/postures/integrations.ts index 1f9b9c8451..40bac4d725 100644 --- a/src/resources/devices/postures/integrations.ts +++ b/src/resources/devices/postures/integrations.ts @@ -22,35 +22,35 @@ export class Integrations extends APIResource { } /** - * Updates a configured device posture integration. + * Delete a configured device posture integration. */ - update( + delete( identifier: unknown, uuid: string, - body: IntegrationUpdateParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( - this._client.patch(`/accounts/${identifier}/devices/posture/integration/${uuid}`, { - body, - ...options, - }) as Core.APIPromise<{ result: IntegrationUpdateResponse | null }> + this._client.delete( + `/accounts/${identifier}/devices/posture/integration/${uuid}`, + options, + ) as Core.APIPromise<{ result: IntegrationDeleteResponse | null }> )._thenUnwrap((obj) => obj.result); } /** - * Delete a configured device posture integration. + * Updates a configured device posture integration. */ - delete( + edit( identifier: unknown, uuid: string, + body: IntegrationEditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( - this._client.delete( - `/accounts/${identifier}/devices/posture/integration/${uuid}`, - options, - ) as Core.APIPromise<{ result: IntegrationDeleteResponse | null }> + this._client.patch(`/accounts/${identifier}/devices/posture/integration/${uuid}`, { + body, + ...options, + }) as Core.APIPromise<{ result: IntegrationEditResponse | null }> )._thenUnwrap((obj) => obj.result); } @@ -121,7 +121,9 @@ export namespace IntegrationCreateResponse { } } -export interface IntegrationUpdateResponse { +export type IntegrationDeleteResponse = unknown | string; + +export interface IntegrationEditResponse { /** * API UUID. */ @@ -130,7 +132,7 @@ export interface IntegrationUpdateResponse { /** * The configuration object containing third-party integration information. */ - config?: IntegrationUpdateResponse.Config; + config?: IntegrationEditResponse.Config; /** * The interval between each posture check with the third-party API. Use `m` for @@ -149,7 +151,7 @@ export interface IntegrationUpdateResponse { type?: 'workspace_one' | 'crowdstrike_s2s' | 'uptycs' | 'intune' | 'kolide' | 'tanium' | 'sentinelone_s2s'; } -export namespace IntegrationUpdateResponse { +export namespace IntegrationEditResponse { /** * The configuration object containing third-party integration information. */ @@ -171,8 +173,6 @@ export namespace IntegrationUpdateResponse { } } -export type IntegrationDeleteResponse = unknown | string; - export interface IntegrationGetResponse { /** * API UUID. @@ -386,18 +386,18 @@ export namespace IntegrationCreateParams { } } -export interface IntegrationUpdateParams { +export interface IntegrationEditParams { /** * The configuration object containing third-party integration information. */ config?: - | IntegrationUpdateParams.TeamsDevicesWorkspaceOneConfigRequest - | IntegrationUpdateParams.TeamsDevicesCrowdstrikeConfigRequest - | IntegrationUpdateParams.TeamsDevicesUptycsConfigRequest - | IntegrationUpdateParams.TeamsDevicesIntuneConfigRequest - | IntegrationUpdateParams.TeamsDevicesKolideConfigRequest - | IntegrationUpdateParams.TeamsDevicesTaniumConfigRequest - | IntegrationUpdateParams.TeamsDevicesSentineloneS2sConfigRequest; + | IntegrationEditParams.TeamsDevicesWorkspaceOneConfigRequest + | IntegrationEditParams.TeamsDevicesCrowdstrikeConfigRequest + | IntegrationEditParams.TeamsDevicesUptycsConfigRequest + | IntegrationEditParams.TeamsDevicesIntuneConfigRequest + | IntegrationEditParams.TeamsDevicesKolideConfigRequest + | IntegrationEditParams.TeamsDevicesTaniumConfigRequest + | IntegrationEditParams.TeamsDevicesSentineloneS2sConfigRequest; /** * The interval between each posture check with the third-party API. Use `m` for @@ -416,7 +416,7 @@ export interface IntegrationUpdateParams { type?: 'workspace_one' | 'crowdstrike_s2s' | 'uptycs' | 'intune' | 'kolide' | 'tanium' | 'sentinelone_s2s'; } -export namespace IntegrationUpdateParams { +export namespace IntegrationEditParams { export interface TeamsDevicesWorkspaceOneConfigRequest { /** * The Workspace One API URL provided in the Workspace One Admin Dashboard. @@ -551,9 +551,9 @@ export namespace IntegrationUpdateParams { export namespace Integrations { export import IntegrationCreateResponse = IntegrationsAPI.IntegrationCreateResponse; - export import IntegrationUpdateResponse = IntegrationsAPI.IntegrationUpdateResponse; export import IntegrationDeleteResponse = IntegrationsAPI.IntegrationDeleteResponse; + export import IntegrationEditResponse = IntegrationsAPI.IntegrationEditResponse; export import IntegrationGetResponse = IntegrationsAPI.IntegrationGetResponse; export import IntegrationCreateParams = IntegrationsAPI.IntegrationCreateParams; - export import IntegrationUpdateParams = IntegrationsAPI.IntegrationUpdateParams; + export import IntegrationEditParams = IntegrationsAPI.IntegrationEditParams; } diff --git a/src/resources/devices/postures/postures.ts b/src/resources/devices/postures/postures.ts index 9e776c877a..b6ceb0801d 100644 --- a/src/resources/devices/postures/postures.ts +++ b/src/resources/devices/postures/postures.ts @@ -23,6 +23,23 @@ export class Postures extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Updates a device posture rule. + */ + update( + identifier: unknown, + uuid: string, + body: PostureUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/accounts/${identifier}/devices/posture/${uuid}`, { + body, + ...options, + }) as Core.APIPromise<{ result: PostureUpdateResponse | null }> + )._thenUnwrap((obj) => obj.result); + } + /** * Fetches device posture rules for a Zero Trust account. */ @@ -63,23 +80,6 @@ export class Postures extends APIResource { }> )._thenUnwrap((obj) => obj.result); } - - /** - * Updates a device posture rule. - */ - replace( - identifier: unknown, - uuid: string, - body: PostureReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put(`/accounts/${identifier}/devices/posture/${uuid}`, { - body, - ...options, - }) as Core.APIPromise<{ result: PostureReplaceResponse | null }> - )._thenUnwrap((obj) => obj.result); - } } export interface PostureCreateResponse { @@ -495,850 +495,850 @@ export namespace PostureCreateResponse { } } -export type PostureListResponse = Array; +export interface PostureUpdateResponse { + /** + * API UUID. + */ + id?: string; -export namespace PostureListResponse { - export interface PostureListResponseItem { + /** + * The description of the device posture rule. + */ + description?: string; + + /** + * 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. + */ + expiration?: string; + + /** + * The value to be checked against. + */ + input?: + | PostureUpdateResponse.TeamsDevicesFileInputRequest + | PostureUpdateResponse.TeamsDevicesUniqueClientIDInputRequest + | PostureUpdateResponse.TeamsDevicesDomainJoinedInputRequest + | PostureUpdateResponse.TeamsDevicesOsVersionInputRequest + | PostureUpdateResponse.TeamsDevicesFirewallInputRequest + | PostureUpdateResponse.TeamsDevicesSentineloneInputRequest + | PostureUpdateResponse.TeamsDevicesCarbonblackInputRequest + | PostureUpdateResponse.TeamsDevicesDiskEncryptionInputRequest + | PostureUpdateResponse.TeamsDevicesApplicationInputRequest + | PostureUpdateResponse.TeamsDevicesClientCertificateInputRequest + | PostureUpdateResponse.TeamsDevicesWorkspaceOneInputRequest + | PostureUpdateResponse.TeamsDevicesCrowdstrikeInputRequest + | PostureUpdateResponse.TeamsDevicesIntuneInputRequest + | PostureUpdateResponse.TeamsDevicesKolideInputRequest + | PostureUpdateResponse.TeamsDevicesTaniumInputRequest + | PostureUpdateResponse.TeamsDevicesSentineloneS2sInputRequest; + + /** + * The conditions that the client must match to run the rule. + */ + match?: Array; + + /** + * The name of the device posture rule. + */ + name?: string; + + /** + * Polling frequency for the WARP client posture check. Default: `5m` (poll every + * five minutes). Minimum: `1m`. + */ + schedule?: string; + + /** + * The type of device posture rule. + */ + type?: + | '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'; +} + +export namespace PostureUpdateResponse { + export interface TeamsDevicesFileInputRequest { /** - * API UUID. + * Operating system */ - id?: string; + operating_system: 'windows' | 'linux' | 'mac'; /** - * The description of the device posture rule. + * File path. */ - description?: string; + path: string; /** - * 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. + * Whether or not file exists */ - expiration?: string; + exists?: boolean; /** - * The value to be checked against. + * SHA-256. */ - input?: - | PostureListResponseItem.TeamsDevicesFileInputRequest - | PostureListResponseItem.TeamsDevicesUniqueClientIDInputRequest - | PostureListResponseItem.TeamsDevicesDomainJoinedInputRequest - | PostureListResponseItem.TeamsDevicesOsVersionInputRequest - | PostureListResponseItem.TeamsDevicesFirewallInputRequest - | PostureListResponseItem.TeamsDevicesSentineloneInputRequest - | PostureListResponseItem.TeamsDevicesCarbonblackInputRequest - | PostureListResponseItem.TeamsDevicesDiskEncryptionInputRequest - | PostureListResponseItem.TeamsDevicesApplicationInputRequest - | PostureListResponseItem.TeamsDevicesClientCertificateInputRequest - | PostureListResponseItem.TeamsDevicesWorkspaceOneInputRequest - | PostureListResponseItem.TeamsDevicesCrowdstrikeInputRequest - | PostureListResponseItem.TeamsDevicesIntuneInputRequest - | PostureListResponseItem.TeamsDevicesKolideInputRequest - | PostureListResponseItem.TeamsDevicesTaniumInputRequest - | PostureListResponseItem.TeamsDevicesSentineloneS2sInputRequest; + sha256?: string; /** - * The conditions that the client must match to run the rule. + * Signing certificate thumbprint. */ - match?: Array; + thumbprint?: string; + } + export interface TeamsDevicesUniqueClientIDInputRequest { /** - * The name of the device posture rule. + * List ID. */ - name?: string; + id: string; /** - * Polling frequency for the WARP client posture check. Default: `5m` (poll every - * five minutes). Minimum: `1m`. + * Operating System */ - schedule?: string; + operating_system: 'android' | 'ios' | 'chromeos'; + } + export interface TeamsDevicesDomainJoinedInputRequest { /** - * The type of device posture rule. + * Operating System */ - type?: - | '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'; + operating_system: 'windows'; + + /** + * Domain + */ + domain?: string; } - export namespace PostureListResponseItem { - export interface TeamsDevicesFileInputRequest { - /** - * Operating system - */ - operating_system: 'windows' | 'linux' | 'mac'; + export interface TeamsDevicesOsVersionInputRequest { + /** + * Operating System + */ + operating_system: 'windows'; - /** - * File path. - */ - path: string; + /** + * Operator + */ + operator: '<' | '<=' | '>' | '>=' | '=='; - /** - * Whether or not file exists - */ - exists?: boolean; + /** + * Version of OS + */ + version: string; - /** - * SHA-256. - */ - sha256?: string; + /** + * Operating System Distribution Name (linux only) + */ + os_distro_name?: string; - /** - * Signing certificate thumbprint. - */ - thumbprint?: string; - } + /** + * Version of OS Distribution (linux only) + */ + os_distro_revision?: string; - export interface TeamsDevicesUniqueClientIDInputRequest { - /** - * List ID. - */ - id: string; + /** + * Additional version data. For Mac or iOS, the Product Verison Extra. For Linux, + * the kernel release version. (Mac, iOS, and Linux only) + */ + os_version_extra?: string; + } - /** - * Operating System - */ - operating_system: 'android' | 'ios' | 'chromeos'; - } + export interface TeamsDevicesFirewallInputRequest { + /** + * Enabled + */ + enabled: boolean; - export interface TeamsDevicesDomainJoinedInputRequest { - /** - * Operating System - */ - operating_system: 'windows'; + /** + * Operating System + */ + operating_system: 'windows' | 'mac'; + } - /** - * Domain - */ - domain?: string; - } + export interface TeamsDevicesSentineloneInputRequest { + /** + * Operating system + */ + operating_system: 'windows' | 'linux' | 'mac'; - export interface TeamsDevicesOsVersionInputRequest { - /** - * Operating System - */ - operating_system: 'windows'; + /** + * File path. + */ + path: string; - /** - * Operator - */ - operator: '<' | '<=' | '>' | '>=' | '=='; + /** + * SHA-256. + */ + sha256?: string; - /** - * Version of OS - */ - version: string; + /** + * Signing certificate thumbprint. + */ + thumbprint?: string; + } - /** - * Operating System Distribution Name (linux only) - */ - os_distro_name?: string; + export interface TeamsDevicesCarbonblackInputRequest { + /** + * Operating system + */ + operating_system: 'windows' | 'linux' | 'mac'; - /** - * Version of OS Distribution (linux only) - */ - os_distro_revision?: string; + /** + * File path. + */ + path: string; - /** - * Additional version data. For Mac or iOS, the Product Verison Extra. For Linux, - * the kernel release version. (Mac, iOS, and Linux only) - */ - os_version_extra?: string; - } + /** + * SHA-256. + */ + sha256?: string; - export interface TeamsDevicesFirewallInputRequest { - /** - * Enabled - */ - enabled: boolean; + /** + * Signing certificate thumbprint. + */ + thumbprint?: string; + } - /** - * Operating System - */ - operating_system: 'windows' | 'mac'; - } + export interface TeamsDevicesDiskEncryptionInputRequest { + /** + * List of volume names to be checked for encryption. + */ + checkDisks?: Array; - export interface TeamsDevicesSentineloneInputRequest { - /** - * Operating system - */ - operating_system: 'windows' | 'linux' | 'mac'; + /** + * Whether to check all disks for encryption. + */ + requireAll?: boolean; + } - /** - * File path. - */ - path: string; + export interface TeamsDevicesApplicationInputRequest { + /** + * Operating system + */ + operating_system: 'windows' | 'linux' | 'mac'; - /** - * SHA-256. - */ - sha256?: string; + /** + * Path for the application. + */ + path: string; - /** - * Signing certificate thumbprint. - */ - thumbprint?: string; - } + /** + * SHA-256. + */ + sha256?: string; - export interface TeamsDevicesCarbonblackInputRequest { - /** - * Operating system - */ - operating_system: 'windows' | 'linux' | 'mac'; + /** + * Signing certificate thumbprint. + */ + thumbprint?: string; + } - /** - * File path. - */ - path: string; + export interface TeamsDevicesClientCertificateInputRequest { + /** + * UUID of Cloudflare managed certificate. + */ + certificate_id: string; - /** - * SHA-256. - */ - sha256?: string; + /** + * Common Name that is protected by the certificate + */ + cn: string; + } - /** - * Signing certificate thumbprint. - */ - thumbprint?: string; - } + export interface TeamsDevicesWorkspaceOneInputRequest { + /** + * Compliance Status + */ + compliance_status: 'compliant' | 'noncompliant' | 'unknown'; - export interface TeamsDevicesDiskEncryptionInputRequest { - /** - * List of volume names to be checked for encryption. - */ - checkDisks?: Array; + /** + * Posture Integration ID. + */ + connection_id: string; + } - /** - * Whether to check all disks for encryption. - */ - requireAll?: boolean; - } + export interface TeamsDevicesCrowdstrikeInputRequest { + /** + * Posture Integration ID. + */ + connection_id: string; - export interface TeamsDevicesApplicationInputRequest { - /** - * Operating system - */ - operating_system: 'windows' | 'linux' | 'mac'; + /** + * Operator + */ + operator?: '<' | '<=' | '>' | '>=' | '=='; - /** - * Path for the application. - */ - path: string; + /** + * Os Version + */ + os?: string; - /** - * SHA-256. - */ - sha256?: string; + /** + * overall + */ + overall?: string; - /** - * Signing certificate thumbprint. - */ - thumbprint?: string; - } + /** + * SensorConfig + */ + sensor_config?: string; - export interface TeamsDevicesClientCertificateInputRequest { - /** - * UUID of Cloudflare managed certificate. - */ - certificate_id: string; + /** + * Version + */ + version?: string; - /** - * Common Name that is protected by the certificate - */ - cn: string; - } + /** + * Version Operator + */ + versionOperator?: '<' | '<=' | '>' | '>=' | '=='; + } - export interface TeamsDevicesWorkspaceOneInputRequest { - /** - * Compliance Status - */ - compliance_status: 'compliant' | 'noncompliant' | 'unknown'; + export interface TeamsDevicesIntuneInputRequest { + /** + * Compliance Status + */ + compliance_status: 'compliant' | 'noncompliant' | 'unknown' | 'notapplicable' | 'ingraceperiod' | 'error'; - /** - * Posture Integration ID. - */ - connection_id: string; - } + /** + * Posture Integration ID. + */ + connection_id: string; + } - export interface TeamsDevicesCrowdstrikeInputRequest { - /** - * Posture Integration ID. - */ - connection_id: string; + export interface TeamsDevicesKolideInputRequest { + /** + * Posture Integration ID. + */ + connection_id: string; - /** - * Operator - */ - operator?: '<' | '<=' | '>' | '>=' | '=='; + /** + * Count Operator + */ + countOperator: '<' | '<=' | '>' | '>=' | '=='; - /** - * Os Version - */ - os?: string; + /** + * The Number of Issues. + */ + issue_count: string; + } + + export interface TeamsDevicesTaniumInputRequest { + /** + * Posture Integration ID. + */ + connection_id: string; + + /** + * For more details on eid last seen, refer to the Tanium documentation. + */ + eid_last_seen?: string; + + /** + * Operator to evaluate risk_level or eid_last_seen. + */ + operator?: '<' | '<=' | '>' | '>=' | '=='; + + /** + * For more details on risk level, refer to the Tanium documentation. + */ + risk_level?: 'low' | 'medium' | 'high' | 'critical'; + + /** + * Score Operator + */ + scoreOperator?: '<' | '<=' | '>' | '>=' | '=='; + + /** + * For more details on total score, refer to the Tanium documentation. + */ + total_score?: number; + } + + export interface TeamsDevicesSentineloneS2sInputRequest { + /** + * Posture Integration ID. + */ + connection_id: string; + + /** + * The Number of active threats. + */ + active_threats?: number; + + /** + * Whether device is infected. + */ + infected?: boolean; + + /** + * Whether device is active. + */ + is_active?: boolean; + + /** + * Network status of device. + */ + network_status?: 'connected' | 'disconnected' | 'disconnecting' | 'connecting'; + + /** + * operator + */ + operator?: '<' | '<=' | '>' | '>=' | '=='; + } + + export interface Match { + platform?: 'windows' | 'mac' | 'linux' | 'android' | 'ios'; + } +} + +export type PostureListResponse = Array; + +export namespace PostureListResponse { + export interface PostureListResponseItem { + /** + * API UUID. + */ + id?: string; + + /** + * The description of the device posture rule. + */ + description?: string; + + /** + * 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. + */ + expiration?: string; + + /** + * The value to be checked against. + */ + input?: + | PostureListResponseItem.TeamsDevicesFileInputRequest + | PostureListResponseItem.TeamsDevicesUniqueClientIDInputRequest + | PostureListResponseItem.TeamsDevicesDomainJoinedInputRequest + | PostureListResponseItem.TeamsDevicesOsVersionInputRequest + | PostureListResponseItem.TeamsDevicesFirewallInputRequest + | PostureListResponseItem.TeamsDevicesSentineloneInputRequest + | PostureListResponseItem.TeamsDevicesCarbonblackInputRequest + | PostureListResponseItem.TeamsDevicesDiskEncryptionInputRequest + | PostureListResponseItem.TeamsDevicesApplicationInputRequest + | PostureListResponseItem.TeamsDevicesClientCertificateInputRequest + | PostureListResponseItem.TeamsDevicesWorkspaceOneInputRequest + | PostureListResponseItem.TeamsDevicesCrowdstrikeInputRequest + | PostureListResponseItem.TeamsDevicesIntuneInputRequest + | PostureListResponseItem.TeamsDevicesKolideInputRequest + | PostureListResponseItem.TeamsDevicesTaniumInputRequest + | PostureListResponseItem.TeamsDevicesSentineloneS2sInputRequest; + + /** + * The conditions that the client must match to run the rule. + */ + match?: Array; + + /** + * The name of the device posture rule. + */ + name?: string; + /** + * Polling frequency for the WARP client posture check. Default: `5m` (poll every + * five minutes). Minimum: `1m`. + */ + schedule?: string; + + /** + * The type of device posture rule. + */ + type?: + | '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'; + } + + export namespace PostureListResponseItem { + export interface TeamsDevicesFileInputRequest { /** - * overall + * Operating system */ - overall?: string; + operating_system: 'windows' | 'linux' | 'mac'; /** - * SensorConfig + * File path. */ - sensor_config?: string; + path: string; /** - * Version + * Whether or not file exists */ - version?: string; + exists?: boolean; /** - * Version Operator + * SHA-256. */ - versionOperator?: '<' | '<=' | '>' | '>=' | '=='; - } + sha256?: string; - export interface TeamsDevicesIntuneInputRequest { /** - * Compliance Status + * Signing certificate thumbprint. */ - compliance_status: - | 'compliant' - | 'noncompliant' - | 'unknown' - | 'notapplicable' - | 'ingraceperiod' - | 'error'; + thumbprint?: string; + } + export interface TeamsDevicesUniqueClientIDInputRequest { /** - * Posture Integration ID. + * List ID. */ - connection_id: string; - } + id: string; - export interface TeamsDevicesKolideInputRequest { /** - * Posture Integration ID. + * Operating System */ - connection_id: string; + operating_system: 'android' | 'ios' | 'chromeos'; + } + export interface TeamsDevicesDomainJoinedInputRequest { /** - * Count Operator + * Operating System */ - countOperator: '<' | '<=' | '>' | '>=' | '=='; + operating_system: 'windows'; /** - * The Number of Issues. + * Domain */ - issue_count: string; + domain?: string; } - export interface TeamsDevicesTaniumInputRequest { + export interface TeamsDevicesOsVersionInputRequest { /** - * Posture Integration ID. + * Operating System */ - connection_id: string; + operating_system: 'windows'; /** - * For more details on eid last seen, refer to the Tanium documentation. + * Operator */ - eid_last_seen?: string; + operator: '<' | '<=' | '>' | '>=' | '=='; /** - * Operator to evaluate risk_level or eid_last_seen. + * Version of OS */ - operator?: '<' | '<=' | '>' | '>=' | '=='; + version: string; /** - * For more details on risk level, refer to the Tanium documentation. + * Operating System Distribution Name (linux only) */ - risk_level?: 'low' | 'medium' | 'high' | 'critical'; + os_distro_name?: string; /** - * Score Operator + * Version of OS Distribution (linux only) */ - scoreOperator?: '<' | '<=' | '>' | '>=' | '=='; + os_distro_revision?: string; /** - * For more details on total score, refer to the Tanium documentation. + * Additional version data. For Mac or iOS, the Product Verison Extra. For Linux, + * the kernel release version. (Mac, iOS, and Linux only) */ - total_score?: number; + os_version_extra?: string; } - export interface TeamsDevicesSentineloneS2sInputRequest { + export interface TeamsDevicesFirewallInputRequest { /** - * Posture Integration ID. + * Enabled */ - connection_id: string; + enabled: boolean; /** - * The Number of active threats. + * Operating System */ - active_threats?: number; + operating_system: 'windows' | 'mac'; + } + export interface TeamsDevicesSentineloneInputRequest { /** - * Whether device is infected. + * Operating system */ - infected?: boolean; + operating_system: 'windows' | 'linux' | 'mac'; /** - * Whether device is active. + * File path. */ - is_active?: boolean; + path: string; /** - * Network status of device. + * SHA-256. */ - network_status?: 'connected' | 'disconnected' | 'disconnecting' | 'connecting'; + sha256?: string; /** - * operator + * Signing certificate thumbprint. */ - operator?: '<' | '<=' | '>' | '>=' | '=='; - } - - export interface Match { - platform?: 'windows' | 'mac' | 'linux' | 'android' | 'ios'; + thumbprint?: string; } - } -} - -export interface PostureDeleteResponse { - /** - * API UUID. - */ - id?: string; -} - -export interface PostureGetResponse { - /** - * API UUID. - */ - id?: string; - - /** - * The description of the device posture rule. - */ - description?: string; - - /** - * 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. - */ - expiration?: string; - - /** - * The value to be checked against. - */ - input?: - | PostureGetResponse.TeamsDevicesFileInputRequest - | PostureGetResponse.TeamsDevicesUniqueClientIDInputRequest - | PostureGetResponse.TeamsDevicesDomainJoinedInputRequest - | PostureGetResponse.TeamsDevicesOsVersionInputRequest - | PostureGetResponse.TeamsDevicesFirewallInputRequest - | PostureGetResponse.TeamsDevicesSentineloneInputRequest - | PostureGetResponse.TeamsDevicesCarbonblackInputRequest - | PostureGetResponse.TeamsDevicesDiskEncryptionInputRequest - | PostureGetResponse.TeamsDevicesApplicationInputRequest - | PostureGetResponse.TeamsDevicesClientCertificateInputRequest - | PostureGetResponse.TeamsDevicesWorkspaceOneInputRequest - | PostureGetResponse.TeamsDevicesCrowdstrikeInputRequest - | PostureGetResponse.TeamsDevicesIntuneInputRequest - | PostureGetResponse.TeamsDevicesKolideInputRequest - | PostureGetResponse.TeamsDevicesTaniumInputRequest - | PostureGetResponse.TeamsDevicesSentineloneS2sInputRequest; - - /** - * The conditions that the client must match to run the rule. - */ - match?: Array; - - /** - * The name of the device posture rule. - */ - name?: string; - - /** - * Polling frequency for the WARP client posture check. Default: `5m` (poll every - * five minutes). Minimum: `1m`. - */ - schedule?: string; - - /** - * The type of device posture rule. - */ - type?: - | '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'; -} - -export namespace PostureGetResponse { - export interface TeamsDevicesFileInputRequest { - /** - * Operating system - */ - operating_system: 'windows' | 'linux' | 'mac'; - - /** - * File path. - */ - path: string; - - /** - * Whether or not file exists - */ - exists?: boolean; - - /** - * SHA-256. - */ - sha256?: string; - - /** - * Signing certificate thumbprint. - */ - thumbprint?: string; - } - - export interface TeamsDevicesUniqueClientIDInputRequest { - /** - * List ID. - */ - id: string; - - /** - * Operating System - */ - operating_system: 'android' | 'ios' | 'chromeos'; - } - - export interface TeamsDevicesDomainJoinedInputRequest { - /** - * Operating System - */ - operating_system: 'windows'; - - /** - * Domain - */ - domain?: string; - } - - export interface TeamsDevicesOsVersionInputRequest { - /** - * Operating System - */ - operating_system: 'windows'; - - /** - * Operator - */ - operator: '<' | '<=' | '>' | '>=' | '=='; - - /** - * Version of OS - */ - version: string; - - /** - * Operating System Distribution Name (linux only) - */ - os_distro_name?: string; - - /** - * Version of OS Distribution (linux only) - */ - os_distro_revision?: string; - - /** - * Additional version data. For Mac or iOS, the Product Verison Extra. For Linux, - * the kernel release version. (Mac, iOS, and Linux only) - */ - os_version_extra?: string; - } - - export interface TeamsDevicesFirewallInputRequest { - /** - * Enabled - */ - enabled: boolean; - - /** - * Operating System - */ - operating_system: 'windows' | 'mac'; - } - - export interface TeamsDevicesSentineloneInputRequest { - /** - * Operating system - */ - operating_system: 'windows' | 'linux' | 'mac'; - - /** - * File path. - */ - path: string; - - /** - * SHA-256. - */ - sha256?: string; - /** - * Signing certificate thumbprint. - */ - thumbprint?: string; - } + export interface TeamsDevicesCarbonblackInputRequest { + /** + * Operating system + */ + operating_system: 'windows' | 'linux' | 'mac'; - export interface TeamsDevicesCarbonblackInputRequest { - /** - * Operating system - */ - operating_system: 'windows' | 'linux' | 'mac'; + /** + * File path. + */ + path: string; - /** - * File path. - */ - path: string; + /** + * SHA-256. + */ + sha256?: string; - /** - * SHA-256. - */ - sha256?: string; + /** + * Signing certificate thumbprint. + */ + thumbprint?: string; + } - /** - * Signing certificate thumbprint. - */ - thumbprint?: string; - } + export interface TeamsDevicesDiskEncryptionInputRequest { + /** + * List of volume names to be checked for encryption. + */ + checkDisks?: Array; - export interface TeamsDevicesDiskEncryptionInputRequest { - /** - * List of volume names to be checked for encryption. - */ - checkDisks?: Array; + /** + * Whether to check all disks for encryption. + */ + requireAll?: boolean; + } - /** - * Whether to check all disks for encryption. - */ - requireAll?: boolean; - } + export interface TeamsDevicesApplicationInputRequest { + /** + * Operating system + */ + operating_system: 'windows' | 'linux' | 'mac'; - export interface TeamsDevicesApplicationInputRequest { - /** - * Operating system - */ - operating_system: 'windows' | 'linux' | 'mac'; + /** + * Path for the application. + */ + path: string; - /** - * Path for the application. - */ - path: string; + /** + * SHA-256. + */ + sha256?: string; - /** - * SHA-256. - */ - sha256?: string; + /** + * Signing certificate thumbprint. + */ + thumbprint?: string; + } - /** - * Signing certificate thumbprint. - */ - thumbprint?: string; - } + export interface TeamsDevicesClientCertificateInputRequest { + /** + * UUID of Cloudflare managed certificate. + */ + certificate_id: string; - export interface TeamsDevicesClientCertificateInputRequest { - /** - * UUID of Cloudflare managed certificate. - */ - certificate_id: string; + /** + * Common Name that is protected by the certificate + */ + cn: string; + } - /** - * Common Name that is protected by the certificate - */ - cn: string; - } + export interface TeamsDevicesWorkspaceOneInputRequest { + /** + * Compliance Status + */ + compliance_status: 'compliant' | 'noncompliant' | 'unknown'; - export interface TeamsDevicesWorkspaceOneInputRequest { - /** - * Compliance Status - */ - compliance_status: 'compliant' | 'noncompliant' | 'unknown'; + /** + * Posture Integration ID. + */ + connection_id: string; + } - /** - * Posture Integration ID. - */ - connection_id: string; - } + export interface TeamsDevicesCrowdstrikeInputRequest { + /** + * Posture Integration ID. + */ + connection_id: string; - export interface TeamsDevicesCrowdstrikeInputRequest { - /** - * Posture Integration ID. - */ - connection_id: string; + /** + * Operator + */ + operator?: '<' | '<=' | '>' | '>=' | '=='; - /** - * Operator - */ - operator?: '<' | '<=' | '>' | '>=' | '=='; + /** + * Os Version + */ + os?: string; - /** - * Os Version - */ - os?: string; + /** + * overall + */ + overall?: string; - /** - * overall - */ - overall?: string; + /** + * SensorConfig + */ + sensor_config?: string; - /** - * SensorConfig - */ - sensor_config?: string; + /** + * Version + */ + version?: string; - /** - * Version - */ - version?: string; + /** + * Version Operator + */ + versionOperator?: '<' | '<=' | '>' | '>=' | '=='; + } - /** - * Version Operator - */ - versionOperator?: '<' | '<=' | '>' | '>=' | '=='; - } + export interface TeamsDevicesIntuneInputRequest { + /** + * Compliance Status + */ + compliance_status: + | 'compliant' + | 'noncompliant' + | 'unknown' + | 'notapplicable' + | 'ingraceperiod' + | 'error'; - export interface TeamsDevicesIntuneInputRequest { - /** - * Compliance Status - */ - compliance_status: 'compliant' | 'noncompliant' | 'unknown' | 'notapplicable' | 'ingraceperiod' | 'error'; + /** + * Posture Integration ID. + */ + connection_id: string; + } - /** - * Posture Integration ID. - */ - connection_id: string; - } + export interface TeamsDevicesKolideInputRequest { + /** + * Posture Integration ID. + */ + connection_id: string; - export interface TeamsDevicesKolideInputRequest { - /** - * Posture Integration ID. - */ - connection_id: string; + /** + * Count Operator + */ + countOperator: '<' | '<=' | '>' | '>=' | '=='; - /** - * Count Operator - */ - countOperator: '<' | '<=' | '>' | '>=' | '=='; + /** + * The Number of Issues. + */ + issue_count: string; + } - /** - * The Number of Issues. - */ - issue_count: string; - } + export interface TeamsDevicesTaniumInputRequest { + /** + * Posture Integration ID. + */ + connection_id: string; - export interface TeamsDevicesTaniumInputRequest { - /** - * Posture Integration ID. - */ - connection_id: string; + /** + * For more details on eid last seen, refer to the Tanium documentation. + */ + eid_last_seen?: string; - /** - * For more details on eid last seen, refer to the Tanium documentation. - */ - eid_last_seen?: string; + /** + * Operator to evaluate risk_level or eid_last_seen. + */ + operator?: '<' | '<=' | '>' | '>=' | '=='; - /** - * Operator to evaluate risk_level or eid_last_seen. - */ - operator?: '<' | '<=' | '>' | '>=' | '=='; + /** + * For more details on risk level, refer to the Tanium documentation. + */ + risk_level?: 'low' | 'medium' | 'high' | 'critical'; - /** - * For more details on risk level, refer to the Tanium documentation. - */ - risk_level?: 'low' | 'medium' | 'high' | 'critical'; + /** + * Score Operator + */ + scoreOperator?: '<' | '<=' | '>' | '>=' | '=='; - /** - * Score Operator - */ - scoreOperator?: '<' | '<=' | '>' | '>=' | '=='; + /** + * For more details on total score, refer to the Tanium documentation. + */ + total_score?: number; + } - /** - * For more details on total score, refer to the Tanium documentation. - */ - total_score?: number; - } + export interface TeamsDevicesSentineloneS2sInputRequest { + /** + * Posture Integration ID. + */ + connection_id: string; - export interface TeamsDevicesSentineloneS2sInputRequest { - /** - * Posture Integration ID. - */ - connection_id: string; + /** + * The Number of active threats. + */ + active_threats?: number; - /** - * The Number of active threats. - */ - active_threats?: number; + /** + * Whether device is infected. + */ + infected?: boolean; - /** - * Whether device is infected. - */ - infected?: boolean; + /** + * Whether device is active. + */ + is_active?: boolean; - /** - * Whether device is active. - */ - is_active?: boolean; + /** + * Network status of device. + */ + network_status?: 'connected' | 'disconnected' | 'disconnecting' | 'connecting'; - /** - * Network status of device. - */ - network_status?: 'connected' | 'disconnected' | 'disconnecting' | 'connecting'; + /** + * operator + */ + operator?: '<' | '<=' | '>' | '>=' | '=='; + } - /** - * operator - */ - operator?: '<' | '<=' | '>' | '>=' | '=='; + export interface Match { + platform?: 'windows' | 'mac' | 'linux' | 'android' | 'ios'; + } } +} - export interface Match { - platform?: 'windows' | 'mac' | 'linux' | 'android' | 'ios'; - } +export interface PostureDeleteResponse { + /** + * API UUID. + */ + id?: string; } -export interface PostureReplaceResponse { +export interface PostureGetResponse { /** * API UUID. */ @@ -1359,27 +1359,27 @@ export interface PostureReplaceResponse { * The value to be checked against. */ input?: - | PostureReplaceResponse.TeamsDevicesFileInputRequest - | PostureReplaceResponse.TeamsDevicesUniqueClientIDInputRequest - | PostureReplaceResponse.TeamsDevicesDomainJoinedInputRequest - | PostureReplaceResponse.TeamsDevicesOsVersionInputRequest - | PostureReplaceResponse.TeamsDevicesFirewallInputRequest - | PostureReplaceResponse.TeamsDevicesSentineloneInputRequest - | PostureReplaceResponse.TeamsDevicesCarbonblackInputRequest - | PostureReplaceResponse.TeamsDevicesDiskEncryptionInputRequest - | PostureReplaceResponse.TeamsDevicesApplicationInputRequest - | PostureReplaceResponse.TeamsDevicesClientCertificateInputRequest - | PostureReplaceResponse.TeamsDevicesWorkspaceOneInputRequest - | PostureReplaceResponse.TeamsDevicesCrowdstrikeInputRequest - | PostureReplaceResponse.TeamsDevicesIntuneInputRequest - | PostureReplaceResponse.TeamsDevicesKolideInputRequest - | PostureReplaceResponse.TeamsDevicesTaniumInputRequest - | PostureReplaceResponse.TeamsDevicesSentineloneS2sInputRequest; + | PostureGetResponse.TeamsDevicesFileInputRequest + | PostureGetResponse.TeamsDevicesUniqueClientIDInputRequest + | PostureGetResponse.TeamsDevicesDomainJoinedInputRequest + | PostureGetResponse.TeamsDevicesOsVersionInputRequest + | PostureGetResponse.TeamsDevicesFirewallInputRequest + | PostureGetResponse.TeamsDevicesSentineloneInputRequest + | PostureGetResponse.TeamsDevicesCarbonblackInputRequest + | PostureGetResponse.TeamsDevicesDiskEncryptionInputRequest + | PostureGetResponse.TeamsDevicesApplicationInputRequest + | PostureGetResponse.TeamsDevicesClientCertificateInputRequest + | PostureGetResponse.TeamsDevicesWorkspaceOneInputRequest + | PostureGetResponse.TeamsDevicesCrowdstrikeInputRequest + | PostureGetResponse.TeamsDevicesIntuneInputRequest + | PostureGetResponse.TeamsDevicesKolideInputRequest + | PostureGetResponse.TeamsDevicesTaniumInputRequest + | PostureGetResponse.TeamsDevicesSentineloneS2sInputRequest; /** * The conditions that the client must match to run the rule. */ - match?: Array; + match?: Array; /** * The name of the device posture rule. @@ -1417,7 +1417,7 @@ export interface PostureReplaceResponse { | 'sentinelone_s2s'; } -export namespace PostureReplaceResponse { +export namespace PostureGetResponse { export interface TeamsDevicesFileInputRequest { /** * Operating system @@ -2159,7 +2159,7 @@ export namespace PostureCreateParams { } } -export interface PostureReplaceParams { +export interface PostureUpdateParams { /** * The name of the device posture rule. */ @@ -2204,27 +2204,27 @@ export interface PostureReplaceParams { * The value to be checked against. */ input?: - | PostureReplaceParams.TeamsDevicesFileInputRequest - | PostureReplaceParams.TeamsDevicesUniqueClientIDInputRequest - | PostureReplaceParams.TeamsDevicesDomainJoinedInputRequest - | PostureReplaceParams.TeamsDevicesOsVersionInputRequest - | PostureReplaceParams.TeamsDevicesFirewallInputRequest - | PostureReplaceParams.TeamsDevicesSentineloneInputRequest - | PostureReplaceParams.TeamsDevicesCarbonblackInputRequest - | PostureReplaceParams.TeamsDevicesDiskEncryptionInputRequest - | PostureReplaceParams.TeamsDevicesApplicationInputRequest - | PostureReplaceParams.TeamsDevicesClientCertificateInputRequest - | PostureReplaceParams.TeamsDevicesWorkspaceOneInputRequest - | PostureReplaceParams.TeamsDevicesCrowdstrikeInputRequest - | PostureReplaceParams.TeamsDevicesIntuneInputRequest - | PostureReplaceParams.TeamsDevicesKolideInputRequest - | PostureReplaceParams.TeamsDevicesTaniumInputRequest - | PostureReplaceParams.TeamsDevicesSentineloneS2sInputRequest; + | PostureUpdateParams.TeamsDevicesFileInputRequest + | PostureUpdateParams.TeamsDevicesUniqueClientIDInputRequest + | PostureUpdateParams.TeamsDevicesDomainJoinedInputRequest + | PostureUpdateParams.TeamsDevicesOsVersionInputRequest + | PostureUpdateParams.TeamsDevicesFirewallInputRequest + | PostureUpdateParams.TeamsDevicesSentineloneInputRequest + | PostureUpdateParams.TeamsDevicesCarbonblackInputRequest + | PostureUpdateParams.TeamsDevicesDiskEncryptionInputRequest + | PostureUpdateParams.TeamsDevicesApplicationInputRequest + | PostureUpdateParams.TeamsDevicesClientCertificateInputRequest + | PostureUpdateParams.TeamsDevicesWorkspaceOneInputRequest + | PostureUpdateParams.TeamsDevicesCrowdstrikeInputRequest + | PostureUpdateParams.TeamsDevicesIntuneInputRequest + | PostureUpdateParams.TeamsDevicesKolideInputRequest + | PostureUpdateParams.TeamsDevicesTaniumInputRequest + | PostureUpdateParams.TeamsDevicesSentineloneS2sInputRequest; /** * The conditions that the client must match to run the rule. */ - match?: Array; + match?: Array; /** * Polling frequency for the WARP client posture check. Default: `5m` (poll every @@ -2233,7 +2233,7 @@ export interface PostureReplaceParams { schedule?: string; } -export namespace PostureReplaceParams { +export namespace PostureUpdateParams { export interface TeamsDevicesFileInputRequest { /** * Operating system @@ -2569,17 +2569,17 @@ export namespace PostureReplaceParams { export namespace Postures { export import PostureCreateResponse = PosturesAPI.PostureCreateResponse; + export import PostureUpdateResponse = PosturesAPI.PostureUpdateResponse; export import PostureListResponse = PosturesAPI.PostureListResponse; export import PostureDeleteResponse = PosturesAPI.PostureDeleteResponse; export import PostureGetResponse = PosturesAPI.PostureGetResponse; - export import PostureReplaceResponse = PosturesAPI.PostureReplaceResponse; export import PostureCreateParams = PosturesAPI.PostureCreateParams; - export import PostureReplaceParams = PosturesAPI.PostureReplaceParams; + export import PostureUpdateParams = PosturesAPI.PostureUpdateParams; export import Integrations = IntegrationsAPI.Integrations; export import IntegrationCreateResponse = IntegrationsAPI.IntegrationCreateResponse; - export import IntegrationUpdateResponse = IntegrationsAPI.IntegrationUpdateResponse; export import IntegrationDeleteResponse = IntegrationsAPI.IntegrationDeleteResponse; + export import IntegrationEditResponse = IntegrationsAPI.IntegrationEditResponse; export import IntegrationGetResponse = IntegrationsAPI.IntegrationGetResponse; export import IntegrationCreateParams = IntegrationsAPI.IntegrationCreateParams; - export import IntegrationUpdateParams = IntegrationsAPI.IntegrationUpdateParams; + export import IntegrationEditParams = IntegrationsAPI.IntegrationEditParams; } diff --git a/src/resources/devices/settings.ts b/src/resources/devices/settings.ts index 27bb9ae569..75504e929e 100644 --- a/src/resources/devices/settings.ts +++ b/src/resources/devices/settings.ts @@ -6,33 +6,33 @@ import * as SettingsAPI from 'cloudflare/resources/devices/settings'; export class Settings extends APIResource { /** - * Describes the current device settings for a Zero Trust account. + * Updates the current device settings for a Zero Trust account. */ - list(identifier: unknown, options?: Core.RequestOptions): Core.APIPromise { + update( + identifier: unknown, + body: SettingUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { return ( - this._client.get(`/accounts/${identifier}/devices/settings`, options) as Core.APIPromise<{ - result: SettingListResponse | null; + this._client.put(`/accounts/${identifier}/devices/settings`, { body, ...options }) as Core.APIPromise<{ + result: SettingUpdateResponse | null; }> )._thenUnwrap((obj) => obj.result); } /** - * Updates the current device settings for a Zero Trust account. + * Describes the current device settings for a Zero Trust account. */ - replace( - identifier: unknown, - body: SettingReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { + list(identifier: unknown, options?: Core.RequestOptions): Core.APIPromise { return ( - this._client.put(`/accounts/${identifier}/devices/settings`, { body, ...options }) as Core.APIPromise<{ - result: SettingReplaceResponse | null; + this._client.get(`/accounts/${identifier}/devices/settings`, options) as Core.APIPromise<{ + result: SettingListResponse | null; }> )._thenUnwrap((obj) => obj.result); } } -export interface SettingListResponse { +export interface SettingUpdateResponse { /** * Enable gateway proxy filtering on TCP. */ @@ -54,7 +54,7 @@ export interface SettingListResponse { use_zt_virtual_ip?: boolean; } -export interface SettingReplaceResponse { +export interface SettingListResponse { /** * Enable gateway proxy filtering on TCP. */ @@ -76,7 +76,7 @@ export interface SettingReplaceResponse { use_zt_virtual_ip?: boolean; } -export interface SettingReplaceParams { +export interface SettingUpdateParams { /** * Enable gateway proxy filtering on TCP. */ @@ -99,7 +99,7 @@ export interface SettingReplaceParams { } export namespace Settings { + export import SettingUpdateResponse = SettingsAPI.SettingUpdateResponse; export import SettingListResponse = SettingsAPI.SettingListResponse; - export import SettingReplaceResponse = SettingsAPI.SettingReplaceResponse; - export import SettingReplaceParams = SettingsAPI.SettingReplaceParams; + export import SettingUpdateParams = SettingsAPI.SettingUpdateParams; } diff --git a/src/resources/dispatchers/dispatchers.ts b/src/resources/dispatchers/dispatchers.ts index 10327e38e5..0f69f7ba9f 100644 --- a/src/resources/dispatchers/dispatchers.ts +++ b/src/resources/dispatchers/dispatchers.ts @@ -9,8 +9,8 @@ export class Dispatchers extends APIResource { export namespace Dispatchers { export import Scripts = ScriptsAPI.Scripts; + export import ScriptUpdateResponse = ScriptsAPI.ScriptUpdateResponse; export import ScriptGetResponse = ScriptsAPI.ScriptGetResponse; - export import ScriptReplaceResponse = ScriptsAPI.ScriptReplaceResponse; + export import ScriptUpdateParams = ScriptsAPI.ScriptUpdateParams; export import ScriptDeleteParams = ScriptsAPI.ScriptDeleteParams; - export import ScriptReplaceParams = ScriptsAPI.ScriptReplaceParams; } diff --git a/src/resources/dispatchers/index.ts b/src/resources/dispatchers/index.ts index 7228562e30..9b2f148e0d 100644 --- a/src/resources/dispatchers/index.ts +++ b/src/resources/dispatchers/index.ts @@ -2,9 +2,9 @@ export { Dispatchers } from './dispatchers'; export { + ScriptUpdateResponse, ScriptGetResponse, - ScriptReplaceResponse, + ScriptUpdateParams, ScriptDeleteParams, - ScriptReplaceParams, Scripts, } from './scripts'; diff --git a/src/resources/dispatchers/scripts.ts b/src/resources/dispatchers/scripts.ts index e7b3a8b37a..468254ca84 100644 --- a/src/resources/dispatchers/scripts.ts +++ b/src/resources/dispatchers/scripts.ts @@ -6,6 +6,24 @@ import * as ScriptsAPI from 'cloudflare/resources/dispatchers/scripts'; import { type Uploadable, maybeMultipartFormRequestOptions } from 'cloudflare/core'; export class Scripts extends APIResource { + /** + * Upload a worker module to a Workers for Platforms namespace. + */ + update( + accountId: string, + dispatchNamespace: string, + scriptName: string, + body: ScriptUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put( + `/accounts/${accountId}/workers/dispatch/namespaces/${dispatchNamespace}/scripts/${scriptName}`, + maybeMultipartFormRequestOptions({ body, ...options }), + ) as Core.APIPromise<{ result: ScriptUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * Delete a worker from a Workers for Platforms namespace. This call has no * response body on a successful delete. @@ -40,23 +58,74 @@ export class Scripts extends APIResource { ) as Core.APIPromise<{ result: ScriptGetResponse }> )._thenUnwrap((obj) => obj.result); } +} +export interface ScriptUpdateResponse { /** - * Upload a worker module to a Workers for Platforms namespace. + * The id of the script in the Workers system. Usually the script name. */ - replace( - accountId: string, - dispatchNamespace: string, - scriptName: string, - body: ScriptReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put( - `/accounts/${accountId}/workers/dispatch/namespaces/${dispatchNamespace}/scripts/${scriptName}`, - maybeMultipartFormRequestOptions({ body, ...options }), - ) as Core.APIPromise<{ result: ScriptReplaceResponse }> - )._thenUnwrap((obj) => obj.result); + id?: string; + + /** + * When the script was created. + */ + created_on?: string; + + /** + * Hashed script content, can be used in a If-None-Match header when updating. + */ + etag?: string; + + /** + * Whether Logpush is turned on for the Worker. + */ + logpush?: boolean; + + /** + * When the script was last modified. + */ + modified_on?: string; + + /** + * Deprecated. Deployment metadata for internal usage. + */ + pipeline_hash?: string; + + /** + * Specifies the placement mode for the Worker (e.g. 'smart'). + */ + placement_mode?: string; + + /** + * List of Workers that will consume logs from the attached Worker. + */ + tail_consumers?: Array; + + /** + * Specifies the usage model for the Worker (e.g. 'bundled' or 'unbound'). + */ + usage_model?: string; +} + +export namespace ScriptUpdateResponse { + /** + * A reference to a script that will consume logs from the attached Worker. + */ + export interface TailConsumer { + /** + * Name of Worker that is to be the consumer. + */ + service: string; + + /** + * Optional environment if the Worker utilizes one. + */ + environment?: string; + + /** + * Optional dispatch namespace the script belongs to. + */ + namespace?: string; } } @@ -153,87 +222,9 @@ export namespace ScriptGetResponse { } } -export interface ScriptReplaceResponse { - /** - * The id of the script in the Workers system. Usually the script name. - */ - id?: string; - - /** - * When the script was created. - */ - created_on?: string; - - /** - * Hashed script content, can be used in a If-None-Match header when updating. - */ - etag?: string; +export type ScriptUpdateParams = ScriptUpdateParams.Variant0 | ScriptUpdateParams.Variant1; - /** - * Whether Logpush is turned on for the Worker. - */ - logpush?: boolean; - - /** - * When the script was last modified. - */ - modified_on?: string; - - /** - * Deprecated. Deployment metadata for internal usage. - */ - pipeline_hash?: string; - - /** - * Specifies the placement mode for the Worker (e.g. 'smart'). - */ - placement_mode?: string; - - /** - * List of Workers that will consume logs from the attached Worker. - */ - tail_consumers?: Array; - - /** - * Specifies the usage model for the Worker (e.g. 'bundled' or 'unbound'). - */ - usage_model?: string; -} - -export namespace ScriptReplaceResponse { - /** - * A reference to a script that will consume logs from the attached Worker. - */ - export interface TailConsumer { - /** - * Name of Worker that is to be the consumer. - */ - service: string; - - /** - * Optional environment if the Worker utilizes one. - */ - environment?: string; - - /** - * Optional dispatch namespace the script belongs to. - */ - namespace?: string; - } -} - -export interface ScriptDeleteParams { - /** - * If set to true, delete will not be stopped by associated service binding, - * durable object, or other binding. Any of these associated bindings/durable - * objects will be deleted along with the script. - */ - force?: boolean; -} - -export type ScriptReplaceParams = ScriptReplaceParams.Variant0 | ScriptReplaceParams.Variant1; - -export namespace ScriptReplaceParams { +export namespace ScriptUpdateParams { export interface Variant0 { /** * A module comprising a Worker script, often a javascript file. Multiple modules @@ -245,7 +236,7 @@ export namespace ScriptReplaceParams { /** * JSON encoded metadata about the uploaded parts and Worker configuration. */ - metadata?: ScriptReplaceParams.Variant0.Metadata; + metadata?: ScriptUpdateParams.Variant0.Metadata; } export namespace Variant0 { @@ -475,9 +466,18 @@ export namespace ScriptReplaceParams { } } +export interface ScriptDeleteParams { + /** + * If set to true, delete will not be stopped by associated service binding, + * durable object, or other binding. Any of these associated bindings/durable + * objects will be deleted along with the script. + */ + force?: boolean; +} + export namespace Scripts { + export import ScriptUpdateResponse = ScriptsAPI.ScriptUpdateResponse; export import ScriptGetResponse = ScriptsAPI.ScriptGetResponse; - export import ScriptReplaceResponse = ScriptsAPI.ScriptReplaceResponse; + export import ScriptUpdateParams = ScriptsAPI.ScriptUpdateParams; export import ScriptDeleteParams = ScriptsAPI.ScriptDeleteParams; - export import ScriptReplaceParams = ScriptsAPI.ScriptReplaceParams; } diff --git a/src/resources/dlp/datasets/datasets.ts b/src/resources/dlp/datasets/datasets.ts index f051422a83..ead383a215 100644 --- a/src/resources/dlp/datasets/datasets.ts +++ b/src/resources/dlp/datasets/datasets.ts @@ -23,6 +23,23 @@ export class Datasets extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Update details about a dataset. + */ + update( + accountId: string, + datasetId: string, + body: DatasetUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/accounts/${accountId}/dlp/datasets/${datasetId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: DatasetUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * Fetch all datasets with information about available versions. */ @@ -60,23 +77,6 @@ export class Datasets extends APIResource { }> )._thenUnwrap((obj) => obj.result); } - - /** - * Update details about a dataset. - */ - replace( - accountId: string, - datasetId: string, - body: DatasetReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put(`/accounts/${accountId}/dlp/datasets/${datasetId}`, { - body, - ...options, - }) as Core.APIPromise<{ result: DatasetReplaceResponse }> - )._thenUnwrap((obj) => obj.result); - } } export interface DatasetCreateResponse { @@ -128,6 +128,36 @@ export namespace DatasetCreateResponse { } } +export interface DatasetUpdateResponse { + id: string; + + created_at: string; + + name: string; + + num_cells: number; + + secret: boolean; + + status: 'empty' | 'uploading' | 'failed' | 'complete'; + + updated_at: string; + + uploads: Array; + + description?: string | null; +} + +export namespace DatasetUpdateResponse { + export interface Upload { + num_cells: number; + + status: 'empty' | 'uploading' | 'failed' | 'complete'; + + version: number; + } +} + export type DatasetListResponse = Array; export namespace DatasetListResponse { @@ -192,36 +222,6 @@ export namespace DatasetGetResponse { } } -export interface DatasetReplaceResponse { - id: string; - - created_at: string; - - name: string; - - num_cells: number; - - secret: boolean; - - status: 'empty' | 'uploading' | 'failed' | 'complete'; - - updated_at: string; - - uploads: Array; - - description?: string | null; -} - -export namespace DatasetReplaceResponse { - export interface Upload { - num_cells: number; - - status: 'empty' | 'uploading' | 'failed' | 'complete'; - - version: number; - } -} - export interface DatasetCreateParams { name: string; @@ -236,7 +236,7 @@ export interface DatasetCreateParams { secret?: boolean; } -export interface DatasetReplaceParams { +export interface DatasetUpdateParams { description?: string | null; name?: string | null; @@ -244,13 +244,13 @@ export interface DatasetReplaceParams { export namespace Datasets { export import DatasetCreateResponse = DatasetsAPI.DatasetCreateResponse; + export import DatasetUpdateResponse = DatasetsAPI.DatasetUpdateResponse; export import DatasetListResponse = DatasetsAPI.DatasetListResponse; export import DatasetGetResponse = DatasetsAPI.DatasetGetResponse; - export import DatasetReplaceResponse = DatasetsAPI.DatasetReplaceResponse; export import DatasetCreateParams = DatasetsAPI.DatasetCreateParams; - export import DatasetReplaceParams = DatasetsAPI.DatasetReplaceParams; + export import DatasetUpdateParams = DatasetsAPI.DatasetUpdateParams; export import Upload = UploadAPI.Upload; export import UploadCreateResponse = UploadAPI.UploadCreateResponse; - export import UploadUpdateResponse = UploadAPI.UploadUpdateResponse; - export import UploadUpdateParams = UploadAPI.UploadUpdateParams; + export import UploadEditResponse = UploadAPI.UploadEditResponse; + export import UploadEditParams = UploadAPI.UploadEditParams; } diff --git a/src/resources/dlp/datasets/index.ts b/src/resources/dlp/datasets/index.ts index 065b8b159e..608549c5fd 100644 --- a/src/resources/dlp/datasets/index.ts +++ b/src/resources/dlp/datasets/index.ts @@ -2,11 +2,11 @@ export { DatasetCreateResponse, + DatasetUpdateResponse, DatasetListResponse, DatasetGetResponse, - DatasetReplaceResponse, DatasetCreateParams, - DatasetReplaceParams, + DatasetUpdateParams, Datasets, } from './datasets'; -export { UploadCreateResponse, UploadUpdateResponse, UploadUpdateParams, Upload } from './upload'; +export { UploadCreateResponse, UploadEditResponse, UploadEditParams, Upload } from './upload'; diff --git a/src/resources/dlp/datasets/upload.ts b/src/resources/dlp/datasets/upload.ts index bbf41adea3..f6ca79742f 100644 --- a/src/resources/dlp/datasets/upload.ts +++ b/src/resources/dlp/datasets/upload.ts @@ -24,18 +24,18 @@ export class Upload extends APIResource { /** * Upload a new version of a dataset. */ - update( + edit( accountId: string, datasetId: string, version: number, - body: UploadUpdateParams, + body: UploadEditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.post( `/accounts/${accountId}/dlp/datasets/${datasetId}/upload/${version}`, options, - ) as Core.APIPromise<{ result: UploadUpdateResponse }> + ) as Core.APIPromise<{ result: UploadEditResponse }> )._thenUnwrap((obj) => obj.result); } } @@ -48,7 +48,7 @@ export interface UploadCreateResponse { secret?: string; } -export interface UploadUpdateResponse { +export interface UploadEditResponse { id: string; created_at: string; @@ -63,12 +63,12 @@ export interface UploadUpdateResponse { updated_at: string; - uploads: Array; + uploads: Array; description?: string | null; } -export namespace UploadUpdateResponse { +export namespace UploadEditResponse { export interface Upload { num_cells: number; @@ -78,10 +78,10 @@ export namespace UploadUpdateResponse { } } -export interface UploadUpdateParams {} +export interface UploadEditParams {} export namespace Upload { export import UploadCreateResponse = UploadAPI.UploadCreateResponse; - export import UploadUpdateResponse = UploadAPI.UploadUpdateResponse; - export import UploadUpdateParams = UploadAPI.UploadUpdateParams; + export import UploadEditResponse = UploadAPI.UploadEditResponse; + export import UploadEditParams = UploadAPI.UploadEditParams; } diff --git a/src/resources/dlp/dlp.ts b/src/resources/dlp/dlp.ts index 33188897bb..9edffb51f0 100644 --- a/src/resources/dlp/dlp.ts +++ b/src/resources/dlp/dlp.ts @@ -16,18 +16,18 @@ export class DLP extends APIResource { export namespace DLP { export import Datasets = DatasetsAPI.Datasets; export import DatasetCreateResponse = DatasetsAPI.DatasetCreateResponse; + export import DatasetUpdateResponse = DatasetsAPI.DatasetUpdateResponse; export import DatasetListResponse = DatasetsAPI.DatasetListResponse; export import DatasetGetResponse = DatasetsAPI.DatasetGetResponse; - export import DatasetReplaceResponse = DatasetsAPI.DatasetReplaceResponse; export import DatasetCreateParams = DatasetsAPI.DatasetCreateParams; - export import DatasetReplaceParams = DatasetsAPI.DatasetReplaceParams; + export import DatasetUpdateParams = DatasetsAPI.DatasetUpdateParams; export import Patterns = PatternsAPI.Patterns; export import PatternValidateResponse = PatternsAPI.PatternValidateResponse; export import PatternValidateParams = PatternsAPI.PatternValidateParams; export import PayloadLogs = PayloadLogsAPI.PayloadLogs; + export import PayloadLogUpdateResponse = PayloadLogsAPI.PayloadLogUpdateResponse; export import PayloadLogGetResponse = PayloadLogsAPI.PayloadLogGetResponse; - export import PayloadLogReplaceResponse = PayloadLogsAPI.PayloadLogReplaceResponse; - export import PayloadLogReplaceParams = PayloadLogsAPI.PayloadLogReplaceParams; + export import PayloadLogUpdateParams = PayloadLogsAPI.PayloadLogUpdateParams; export import Profiles = ProfilesAPI.Profiles; export import ProfileListResponse = ProfilesAPI.ProfileListResponse; export import ProfileGetResponse = ProfilesAPI.ProfileGetResponse; diff --git a/src/resources/dlp/index.ts b/src/resources/dlp/index.ts index b6ef1bc50d..a0f3592c32 100644 --- a/src/resources/dlp/index.ts +++ b/src/resources/dlp/index.ts @@ -3,18 +3,18 @@ export { DLP } from './dlp'; export { DatasetCreateResponse, + DatasetUpdateResponse, DatasetListResponse, DatasetGetResponse, - DatasetReplaceResponse, DatasetCreateParams, - DatasetReplaceParams, + DatasetUpdateParams, Datasets, } from './datasets/index'; export { PatternValidateResponse, PatternValidateParams, Patterns } from './patterns'; export { + PayloadLogUpdateResponse, PayloadLogGetResponse, - PayloadLogReplaceResponse, - PayloadLogReplaceParams, + PayloadLogUpdateParams, PayloadLogs, } from './payload-logs'; export { ProfileListResponse, ProfileGetResponse, Profiles } from './profiles/index'; diff --git a/src/resources/dlp/payload-logs.ts b/src/resources/dlp/payload-logs.ts index 77a419ce45..20fa11959c 100644 --- a/src/resources/dlp/payload-logs.ts +++ b/src/resources/dlp/payload-logs.ts @@ -6,41 +6,41 @@ import * as PayloadLogsAPI from 'cloudflare/resources/dlp/payload-logs'; export class PayloadLogs extends APIResource { /** - * Gets the current DLP payload log settings for this account. + * Updates the DLP payload log settings for this account. */ - get(accountId: string, options?: Core.RequestOptions): Core.APIPromise { + update( + accountId: string, + body: PayloadLogUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { return ( - this._client.get(`/accounts/${accountId}/dlp/payload_log`, options) as Core.APIPromise<{ - result: PayloadLogGetResponse; + this._client.put(`/accounts/${accountId}/dlp/payload_log`, { body, ...options }) as Core.APIPromise<{ + result: PayloadLogUpdateResponse; }> )._thenUnwrap((obj) => obj.result); } /** - * Updates the DLP payload log settings for this account. + * Gets the current DLP payload log settings for this account. */ - replace( - accountId: string, - body: PayloadLogReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { + get(accountId: string, options?: Core.RequestOptions): Core.APIPromise { return ( - this._client.put(`/accounts/${accountId}/dlp/payload_log`, { body, ...options }) as Core.APIPromise<{ - result: PayloadLogReplaceResponse; + this._client.get(`/accounts/${accountId}/dlp/payload_log`, options) as Core.APIPromise<{ + result: PayloadLogGetResponse; }> )._thenUnwrap((obj) => obj.result); } } -export interface PayloadLogGetResponse { +export interface PayloadLogUpdateResponse { public_key: string | null; } -export interface PayloadLogReplaceResponse { +export interface PayloadLogGetResponse { public_key: string | null; } -export interface PayloadLogReplaceParams { +export interface PayloadLogUpdateParams { /** * The public key to use when encrypting extracted payloads, as a base64 string */ @@ -48,7 +48,7 @@ export interface PayloadLogReplaceParams { } export namespace PayloadLogs { + export import PayloadLogUpdateResponse = PayloadLogsAPI.PayloadLogUpdateResponse; export import PayloadLogGetResponse = PayloadLogsAPI.PayloadLogGetResponse; - export import PayloadLogReplaceResponse = PayloadLogsAPI.PayloadLogReplaceResponse; - export import PayloadLogReplaceParams = PayloadLogsAPI.PayloadLogReplaceParams; + export import PayloadLogUpdateParams = PayloadLogsAPI.PayloadLogUpdateParams; } diff --git a/src/resources/dlp/profiles/customs.ts b/src/resources/dlp/profiles/customs.ts index 6ed404495e..57002ce879 100644 --- a/src/resources/dlp/profiles/customs.ts +++ b/src/resources/dlp/profiles/customs.ts @@ -21,6 +21,18 @@ export class Customs extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Updates a DLP custom profile. + */ + update( + accountId: string, + profileId: string, + body: CustomUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return this._client.put(`/accounts/${accountId}/dlp/profiles/custom/${profileId}`, { body, ...options }); + } + /** * Deletes a DLP custom profile. */ @@ -52,18 +64,6 @@ export class Customs extends APIResource { ) as Core.APIPromise<{ result: CustomGetResponse }> )._thenUnwrap((obj) => obj.result); } - - /** - * Updates a DLP custom profile. - */ - replace( - accountId: string, - profileId: string, - body: CustomReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return this._client.put(`/accounts/${accountId}/dlp/profiles/custom/${profileId}`, { body, ...options }); - } } export type CustomCreateResponse = Array; @@ -160,9 +160,7 @@ export namespace CustomCreateResponse { } } -export type CustomDeleteResponse = unknown | string | null; - -export interface CustomGetResponse { +export interface CustomUpdateResponse { /** * The ID for this profile */ @@ -183,7 +181,7 @@ export interface CustomGetResponse { /** * The entries for this profile. */ - entries?: Array; + entries?: Array; /** * The name of the profile. @@ -198,7 +196,7 @@ export interface CustomGetResponse { updated_at?: string; } -export namespace CustomGetResponse { +export namespace CustomUpdateResponse { /** * A custom entry that matches a profile */ @@ -252,7 +250,9 @@ export namespace CustomGetResponse { } } -export interface CustomReplaceResponse { +export type CustomDeleteResponse = unknown | string | null; + +export interface CustomGetResponse { /** * The ID for this profile */ @@ -273,7 +273,7 @@ export interface CustomReplaceResponse { /** * The entries for this profile. */ - entries?: Array; + entries?: Array; /** * The name of the profile. @@ -288,7 +288,7 @@ export interface CustomReplaceResponse { updated_at?: string; } -export namespace CustomReplaceResponse { +export namespace CustomGetResponse { /** * A custom entry that matches a profile */ @@ -410,7 +410,7 @@ export namespace CustomCreateParams { } } -export interface CustomReplaceParams { +export interface CustomUpdateParams { /** * Related DLP policies will trigger when the match count exceeds the number set. */ @@ -426,7 +426,7 @@ export interface CustomReplaceParams { * existing entry with that ID. Elements without ID will create new entries. Any * entry not in the list will be deleted. */ - entries?: Array; + entries?: Array; /** * The name of the profile. @@ -438,11 +438,11 @@ export interface CustomReplaceParams { * Microsoft Information Protection profiles). */ shared_entries?: Array< - CustomReplaceParams.DLPSharedEntryUpdatePredefined | CustomReplaceParams.DLPSharedEntryUpdateIntegration + CustomUpdateParams.DLPSharedEntryUpdatePredefined | CustomUpdateParams.DLPSharedEntryUpdateIntegration >; } -export namespace CustomReplaceParams { +export namespace CustomUpdateParams { /** * A custom entry that matches a profile */ @@ -509,9 +509,9 @@ export namespace CustomReplaceParams { export namespace Customs { export import CustomCreateResponse = CustomsAPI.CustomCreateResponse; + export import CustomUpdateResponse = CustomsAPI.CustomUpdateResponse; export import CustomDeleteResponse = CustomsAPI.CustomDeleteResponse; export import CustomGetResponse = CustomsAPI.CustomGetResponse; - export import CustomReplaceResponse = CustomsAPI.CustomReplaceResponse; export import CustomCreateParams = CustomsAPI.CustomCreateParams; - export import CustomReplaceParams = CustomsAPI.CustomReplaceParams; + export import CustomUpdateParams = CustomsAPI.CustomUpdateParams; } diff --git a/src/resources/dlp/profiles/index.ts b/src/resources/dlp/profiles/index.ts index 790994aa53..880ee3e191 100644 --- a/src/resources/dlp/profiles/index.ts +++ b/src/resources/dlp/profiles/index.ts @@ -2,17 +2,17 @@ export { CustomCreateResponse, + CustomUpdateResponse, CustomDeleteResponse, CustomGetResponse, - CustomReplaceResponse, CustomCreateParams, - CustomReplaceParams, + CustomUpdateParams, Customs, } from './customs'; export { + PredefinedUpdateResponse, PredefinedGetResponse, - PredefinedReplaceResponse, - PredefinedReplaceParams, + PredefinedUpdateParams, Predefineds, } from './predefineds'; export { ProfileListResponse, ProfileGetResponse, Profiles } from './profiles'; diff --git a/src/resources/dlp/profiles/predefineds.ts b/src/resources/dlp/profiles/predefineds.ts index 83d6eb4088..c77c5489ab 100644 --- a/src/resources/dlp/profiles/predefineds.ts +++ b/src/resources/dlp/profiles/predefineds.ts @@ -5,6 +5,21 @@ import { APIResource } from 'cloudflare/resource'; import * as PredefinedsAPI from 'cloudflare/resources/dlp/profiles/predefineds'; export class Predefineds extends APIResource { + /** + * Updates a DLP predefined profile. Only supports enabling/disabling entries. + */ + update( + accountId: string, + profileId: string, + body: PredefinedUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return this._client.put(`/accounts/${accountId}/dlp/profiles/predefined/${profileId}`, { + body, + ...options, + }); + } + /** * Fetches a predefined DLP profile. */ @@ -20,24 +35,9 @@ export class Predefineds extends APIResource { ) as Core.APIPromise<{ result: PredefinedGetResponse }> )._thenUnwrap((obj) => obj.result); } - - /** - * Updates a DLP predefined profile. Only supports enabling/disabling entries. - */ - replace( - accountId: string, - profileId: string, - body: PredefinedReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return this._client.put(`/accounts/${accountId}/dlp/profiles/predefined/${profileId}`, { - body, - ...options, - }); - } } -export interface PredefinedGetResponse { +export interface PredefinedUpdateResponse { /** * The ID for this profile */ @@ -51,7 +51,7 @@ export interface PredefinedGetResponse { /** * The entries for this profile. */ - entries?: Array; + entries?: Array; /** * The name of the profile. @@ -64,7 +64,7 @@ export interface PredefinedGetResponse { type?: 'predefined'; } -export namespace PredefinedGetResponse { +export namespace PredefinedUpdateResponse { /** * A predefined entry that matches a profile */ @@ -91,7 +91,7 @@ export namespace PredefinedGetResponse { } } -export interface PredefinedReplaceResponse { +export interface PredefinedGetResponse { /** * The ID for this profile */ @@ -105,7 +105,7 @@ export interface PredefinedReplaceResponse { /** * The entries for this profile. */ - entries?: Array; + entries?: Array; /** * The name of the profile. @@ -118,7 +118,7 @@ export interface PredefinedReplaceResponse { type?: 'predefined'; } -export namespace PredefinedReplaceResponse { +export namespace PredefinedGetResponse { /** * A predefined entry that matches a profile */ @@ -145,7 +145,7 @@ export namespace PredefinedReplaceResponse { } } -export interface PredefinedReplaceParams { +export interface PredefinedUpdateParams { /** * Related DLP policies will trigger when the match count exceeds the number set. */ @@ -154,10 +154,10 @@ export interface PredefinedReplaceParams { /** * The entries for this profile. */ - entries?: Array; + entries?: Array; } -export namespace PredefinedReplaceParams { +export namespace PredefinedUpdateParams { export interface Entry { /** * Whether the entry is enabled or not. @@ -167,7 +167,7 @@ export namespace PredefinedReplaceParams { } export namespace Predefineds { + export import PredefinedUpdateResponse = PredefinedsAPI.PredefinedUpdateResponse; export import PredefinedGetResponse = PredefinedsAPI.PredefinedGetResponse; - export import PredefinedReplaceResponse = PredefinedsAPI.PredefinedReplaceResponse; - export import PredefinedReplaceParams = PredefinedsAPI.PredefinedReplaceParams; + export import PredefinedUpdateParams = PredefinedsAPI.PredefinedUpdateParams; } diff --git a/src/resources/dlp/profiles/profiles.ts b/src/resources/dlp/profiles/profiles.ts index 6036a6841d..1dcaca2fba 100644 --- a/src/resources/dlp/profiles/profiles.ts +++ b/src/resources/dlp/profiles/profiles.ts @@ -469,13 +469,13 @@ export namespace Profiles { export import ProfileGetResponse = ProfilesAPI.ProfileGetResponse; export import Customs = CustomsAPI.Customs; export import CustomCreateResponse = CustomsAPI.CustomCreateResponse; + export import CustomUpdateResponse = CustomsAPI.CustomUpdateResponse; export import CustomDeleteResponse = CustomsAPI.CustomDeleteResponse; export import CustomGetResponse = CustomsAPI.CustomGetResponse; - export import CustomReplaceResponse = CustomsAPI.CustomReplaceResponse; export import CustomCreateParams = CustomsAPI.CustomCreateParams; - export import CustomReplaceParams = CustomsAPI.CustomReplaceParams; + export import CustomUpdateParams = CustomsAPI.CustomUpdateParams; export import Predefineds = PredefinedsAPI.Predefineds; + export import PredefinedUpdateResponse = PredefinedsAPI.PredefinedUpdateResponse; export import PredefinedGetResponse = PredefinedsAPI.PredefinedGetResponse; - export import PredefinedReplaceResponse = PredefinedsAPI.PredefinedReplaceResponse; - export import PredefinedReplaceParams = PredefinedsAPI.PredefinedReplaceParams; + export import PredefinedUpdateParams = PredefinedsAPI.PredefinedUpdateParams; } diff --git a/src/resources/dns-firewall/dns-firewall.ts b/src/resources/dns-firewall/dns-firewall.ts index dd6cd09258..4a6e496134 100644 --- a/src/resources/dns-firewall/dns-firewall.ts +++ b/src/resources/dns-firewall/dns-firewall.ts @@ -25,23 +25,6 @@ export class DNSFirewall extends APIResource { )._thenUnwrap((obj) => obj.result); } - /** - * Modify a DNS Firewall Cluster configuration. - */ - update( - accountId: string, - dnsFirewallId: string, - body: DNSFirewallUpdateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.patch(`/accounts/${accountId}/dns_firewall/${dnsFirewallId}`, { - body, - ...options, - }) as Core.APIPromise<{ result: DNSFirewallUpdateResponse }> - )._thenUnwrap((obj) => obj.result); - } - /** * List configured DNS Firewall clusters for an account. */ @@ -85,6 +68,23 @@ export class DNSFirewall extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Modify a DNS Firewall Cluster configuration. + */ + edit( + accountId: string, + dnsFirewallId: string, + body: DNSFirewallEditParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.patch(`/accounts/${accountId}/dns_firewall/${dnsFirewallId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: DNSFirewallEditResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * Show a single configured DNS Firewall cluster for an account. */ @@ -194,7 +194,7 @@ export namespace DNSFirewallCreateResponse { } } -export interface DNSFirewallUpdateResponse { +export interface DNSFirewallListResponse { /** * Identifier */ @@ -237,7 +237,7 @@ export interface DNSFirewallUpdateResponse { /** * Attack mitigation settings. */ - attack_mitigation?: DNSFirewallUpdateResponse.AttackMitigation | null; + attack_mitigation?: DNSFirewallListResponse.AttackMitigation | null; /** * Negative DNS Cache TTL. @@ -262,7 +262,7 @@ export interface DNSFirewallUpdateResponse { retries?: number; } -export namespace DNSFirewallUpdateResponse { +export namespace DNSFirewallListResponse { /** * Attack mitigation settings. */ @@ -285,7 +285,14 @@ export namespace DNSFirewallUpdateResponse { } } -export interface DNSFirewallListResponse { +export interface DNSFirewallDeleteResponse { + /** + * Identifier + */ + id?: string; +} + +export interface DNSFirewallEditResponse { /** * Identifier */ @@ -328,7 +335,7 @@ export interface DNSFirewallListResponse { /** * Attack mitigation settings. */ - attack_mitigation?: DNSFirewallListResponse.AttackMitigation | null; + attack_mitigation?: DNSFirewallEditResponse.AttackMitigation | null; /** * Negative DNS Cache TTL. @@ -353,7 +360,7 @@ export interface DNSFirewallListResponse { retries?: number; } -export namespace DNSFirewallListResponse { +export namespace DNSFirewallEditResponse { /** * Attack mitigation settings. */ @@ -376,13 +383,6 @@ export namespace DNSFirewallListResponse { } } -export interface DNSFirewallDeleteResponse { - /** - * Identifier - */ - id?: string; -} - export interface DNSFirewallGetResponse { /** * Identifier @@ -553,7 +553,9 @@ export namespace DNSFirewallCreateParams { } } -export interface DNSFirewallUpdateParams { +export interface DNSFirewallListParams extends V4PagePaginationArrayParams {} + +export interface DNSFirewallEditParams { /** * Deprecate the response to ANY requests. */ @@ -586,7 +588,7 @@ export interface DNSFirewallUpdateParams { /** * Attack mitigation settings. */ - attack_mitigation?: DNSFirewallUpdateParams.AttackMitigation | null; + attack_mitigation?: DNSFirewallEditParams.AttackMitigation | null; /** * Negative DNS Cache TTL. @@ -611,7 +613,7 @@ export interface DNSFirewallUpdateParams { retries?: number; } -export namespace DNSFirewallUpdateParams { +export namespace DNSFirewallEditParams { /** * Attack mitigation settings. */ @@ -634,17 +636,15 @@ export namespace DNSFirewallUpdateParams { } } -export interface DNSFirewallListParams extends V4PagePaginationArrayParams {} - export namespace DNSFirewall { export import DNSFirewallCreateResponse = DNSFirewallAPI.DNSFirewallCreateResponse; - export import DNSFirewallUpdateResponse = DNSFirewallAPI.DNSFirewallUpdateResponse; export import DNSFirewallListResponse = DNSFirewallAPI.DNSFirewallListResponse; export import DNSFirewallDeleteResponse = DNSFirewallAPI.DNSFirewallDeleteResponse; + export import DNSFirewallEditResponse = DNSFirewallAPI.DNSFirewallEditResponse; export import DNSFirewallGetResponse = DNSFirewallAPI.DNSFirewallGetResponse; export import DNSFirewallListResponsesV4PagePaginationArray = DNSFirewallAPI.DNSFirewallListResponsesV4PagePaginationArray; export import DNSFirewallCreateParams = DNSFirewallAPI.DNSFirewallCreateParams; - export import DNSFirewallUpdateParams = DNSFirewallAPI.DNSFirewallUpdateParams; export import DNSFirewallListParams = DNSFirewallAPI.DNSFirewallListParams; + export import DNSFirewallEditParams = DNSFirewallAPI.DNSFirewallEditParams; export import DNSAnalytics = DNSAnalyticsAPI.DNSAnalytics; } diff --git a/src/resources/dns-firewall/index.ts b/src/resources/dns-firewall/index.ts index e42b9801b8..b30bb1468c 100644 --- a/src/resources/dns-firewall/index.ts +++ b/src/resources/dns-firewall/index.ts @@ -3,13 +3,13 @@ export { DNSAnalytics } from './dns-analytics/index'; export { DNSFirewallCreateResponse, - DNSFirewallUpdateResponse, DNSFirewallListResponse, DNSFirewallDeleteResponse, + DNSFirewallEditResponse, DNSFirewallGetResponse, DNSFirewallCreateParams, - DNSFirewallUpdateParams, DNSFirewallListParams, + DNSFirewallEditParams, DNSFirewallListResponsesV4PagePaginationArray, DNSFirewall, } from './dns-firewall'; diff --git a/src/resources/dns-records.ts b/src/resources/dns-records.ts index d66a47d7b8..6017c65f73 100644 --- a/src/resources/dns-records.ts +++ b/src/resources/dns-records.ts @@ -30,6 +30,28 @@ export class DNSRecords extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Overwrite an existing DNS record. Notes: + * + * - A/AAAA records cannot exist on the same name as CNAME records. + * - NS records cannot exist on the same name as any other record type. + * - Domain names are always represented in Punycode, even if Unicode characters + * were used when creating the record. + */ + update( + zoneId: string, + dnsRecordId: string, + body: DNSRecordUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/zones/${zoneId}/dns_records/${dnsRecordId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: DNSRecordUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * List, search, sort, and filter a zones' DNS records. */ @@ -126,28 +148,6 @@ export class DNSRecords extends APIResource { )._thenUnwrap((obj) => obj.result); } - /** - * Overwrite an existing DNS record. Notes: - * - * - A/AAAA records cannot exist on the same name as CNAME records. - * - NS records cannot exist on the same name as any other record type. - * - Domain names are always represented in Punycode, even if Unicode characters - * were used when creating the record. - */ - replace( - zoneId: string, - dnsRecordId: string, - body: DNSRecordReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put(`/zones/${zoneId}/dns_records/${dnsRecordId}`, { - body, - ...options, - }) as Core.APIPromise<{ result: DNSRecordReplaceResponse }> - )._thenUnwrap((obj) => obj.result); - } - /** * Scan for common DNS records on your domain and automatically add them to your * zone. Useful if you haven't updated your nameservers yet. @@ -2532,29 +2532,29 @@ export namespace DNSRecordCreateResponse { } } -export type DNSRecordListResponse = - | DNSRecordListResponse.DNSRecordsARecord - | DNSRecordListResponse.DNSRecordsAaaaRecord - | DNSRecordListResponse.DNSRecordsCaaRecord - | DNSRecordListResponse.DNSRecordsCertRecord - | DNSRecordListResponse.DNSRecordsCnameRecord - | DNSRecordListResponse.DNSRecordsDnskeyRecord - | DNSRecordListResponse.DNSRecordsDsRecord - | DNSRecordListResponse.DNSRecordsHTTPSRecord - | DNSRecordListResponse.DNSRecordsLocRecord - | DNSRecordListResponse.DNSRecordsMxRecord - | DNSRecordListResponse.DNSRecordsNaptrRecord - | DNSRecordListResponse.DNSRecordsNsRecord - | DNSRecordListResponse.DNSRecordsPtrRecord - | DNSRecordListResponse.DNSRecordsSmimeaRecord - | DNSRecordListResponse.DNSRecordsSrvRecord - | DNSRecordListResponse.DNSRecordsSshfpRecord - | DNSRecordListResponse.DNSRecordsSvcbRecord - | DNSRecordListResponse.DNSRecordsTlsaRecord - | DNSRecordListResponse.DNSRecordsTxtRecord - | DNSRecordListResponse.DNSRecordsUriRecord; - -export namespace DNSRecordListResponse { +export type DNSRecordUpdateResponse = + | DNSRecordUpdateResponse.DNSRecordsARecord + | DNSRecordUpdateResponse.DNSRecordsAaaaRecord + | DNSRecordUpdateResponse.DNSRecordsCaaRecord + | DNSRecordUpdateResponse.DNSRecordsCertRecord + | DNSRecordUpdateResponse.DNSRecordsCnameRecord + | DNSRecordUpdateResponse.DNSRecordsDnskeyRecord + | DNSRecordUpdateResponse.DNSRecordsDsRecord + | DNSRecordUpdateResponse.DNSRecordsHTTPSRecord + | DNSRecordUpdateResponse.DNSRecordsLocRecord + | DNSRecordUpdateResponse.DNSRecordsMxRecord + | DNSRecordUpdateResponse.DNSRecordsNaptrRecord + | DNSRecordUpdateResponse.DNSRecordsNsRecord + | DNSRecordUpdateResponse.DNSRecordsPtrRecord + | DNSRecordUpdateResponse.DNSRecordsSmimeaRecord + | DNSRecordUpdateResponse.DNSRecordsSrvRecord + | DNSRecordUpdateResponse.DNSRecordsSshfpRecord + | DNSRecordUpdateResponse.DNSRecordsSvcbRecord + | DNSRecordUpdateResponse.DNSRecordsTlsaRecord + | DNSRecordUpdateResponse.DNSRecordsTxtRecord + | DNSRecordUpdateResponse.DNSRecordsUriRecord; + +export namespace DNSRecordUpdateResponse { export interface DNSRecordsARecord { /** * A valid IPv4 address. @@ -4901,41 +4901,29 @@ export namespace DNSRecordListResponse { } } -export interface DNSRecordDeleteResponse { - /** - * Identifier - */ - id?: string; -} - -/** - * Exported BIND zone file. - */ -export type DNSRecordExportResponse = string; - -export type DNSRecordGetResponse = - | DNSRecordGetResponse.DNSRecordsARecord - | DNSRecordGetResponse.DNSRecordsAaaaRecord - | DNSRecordGetResponse.DNSRecordsCaaRecord - | DNSRecordGetResponse.DNSRecordsCertRecord - | DNSRecordGetResponse.DNSRecordsCnameRecord - | DNSRecordGetResponse.DNSRecordsDnskeyRecord - | DNSRecordGetResponse.DNSRecordsDsRecord - | DNSRecordGetResponse.DNSRecordsHTTPSRecord - | DNSRecordGetResponse.DNSRecordsLocRecord - | DNSRecordGetResponse.DNSRecordsMxRecord - | DNSRecordGetResponse.DNSRecordsNaptrRecord - | DNSRecordGetResponse.DNSRecordsNsRecord - | DNSRecordGetResponse.DNSRecordsPtrRecord - | DNSRecordGetResponse.DNSRecordsSmimeaRecord - | DNSRecordGetResponse.DNSRecordsSrvRecord - | DNSRecordGetResponse.DNSRecordsSshfpRecord - | DNSRecordGetResponse.DNSRecordsSvcbRecord - | DNSRecordGetResponse.DNSRecordsTlsaRecord - | DNSRecordGetResponse.DNSRecordsTxtRecord - | DNSRecordGetResponse.DNSRecordsUriRecord; +export type DNSRecordListResponse = + | DNSRecordListResponse.DNSRecordsARecord + | DNSRecordListResponse.DNSRecordsAaaaRecord + | DNSRecordListResponse.DNSRecordsCaaRecord + | DNSRecordListResponse.DNSRecordsCertRecord + | DNSRecordListResponse.DNSRecordsCnameRecord + | DNSRecordListResponse.DNSRecordsDnskeyRecord + | DNSRecordListResponse.DNSRecordsDsRecord + | DNSRecordListResponse.DNSRecordsHTTPSRecord + | DNSRecordListResponse.DNSRecordsLocRecord + | DNSRecordListResponse.DNSRecordsMxRecord + | DNSRecordListResponse.DNSRecordsNaptrRecord + | DNSRecordListResponse.DNSRecordsNsRecord + | DNSRecordListResponse.DNSRecordsPtrRecord + | DNSRecordListResponse.DNSRecordsSmimeaRecord + | DNSRecordListResponse.DNSRecordsSrvRecord + | DNSRecordListResponse.DNSRecordsSshfpRecord + | DNSRecordListResponse.DNSRecordsSvcbRecord + | DNSRecordListResponse.DNSRecordsTlsaRecord + | DNSRecordListResponse.DNSRecordsTxtRecord + | DNSRecordListResponse.DNSRecordsUriRecord; -export namespace DNSRecordGetResponse { +export namespace DNSRecordListResponse { export interface DNSRecordsARecord { /** * A valid IPv4 address. @@ -7282,41 +7270,41 @@ export namespace DNSRecordGetResponse { } } -export interface DNSRecordImportResponse { - /** - * Number of DNS records added. - */ - recs_added?: number; - +export interface DNSRecordDeleteResponse { /** - * Total number of DNS records parsed. + * Identifier */ - total_records_parsed?: number; + id?: string; } -export type DNSRecordReplaceResponse = - | DNSRecordReplaceResponse.DNSRecordsARecord - | DNSRecordReplaceResponse.DNSRecordsAaaaRecord - | DNSRecordReplaceResponse.DNSRecordsCaaRecord - | DNSRecordReplaceResponse.DNSRecordsCertRecord - | DNSRecordReplaceResponse.DNSRecordsCnameRecord - | DNSRecordReplaceResponse.DNSRecordsDnskeyRecord - | DNSRecordReplaceResponse.DNSRecordsDsRecord - | DNSRecordReplaceResponse.DNSRecordsHTTPSRecord - | DNSRecordReplaceResponse.DNSRecordsLocRecord - | DNSRecordReplaceResponse.DNSRecordsMxRecord - | DNSRecordReplaceResponse.DNSRecordsNaptrRecord - | DNSRecordReplaceResponse.DNSRecordsNsRecord - | DNSRecordReplaceResponse.DNSRecordsPtrRecord - | DNSRecordReplaceResponse.DNSRecordsSmimeaRecord - | DNSRecordReplaceResponse.DNSRecordsSrvRecord - | DNSRecordReplaceResponse.DNSRecordsSshfpRecord - | DNSRecordReplaceResponse.DNSRecordsSvcbRecord - | DNSRecordReplaceResponse.DNSRecordsTlsaRecord - | DNSRecordReplaceResponse.DNSRecordsTxtRecord - | DNSRecordReplaceResponse.DNSRecordsUriRecord; - -export namespace DNSRecordReplaceResponse { +/** + * Exported BIND zone file. + */ +export type DNSRecordExportResponse = string; + +export type DNSRecordGetResponse = + | DNSRecordGetResponse.DNSRecordsARecord + | DNSRecordGetResponse.DNSRecordsAaaaRecord + | DNSRecordGetResponse.DNSRecordsCaaRecord + | DNSRecordGetResponse.DNSRecordsCertRecord + | DNSRecordGetResponse.DNSRecordsCnameRecord + | DNSRecordGetResponse.DNSRecordsDnskeyRecord + | DNSRecordGetResponse.DNSRecordsDsRecord + | DNSRecordGetResponse.DNSRecordsHTTPSRecord + | DNSRecordGetResponse.DNSRecordsLocRecord + | DNSRecordGetResponse.DNSRecordsMxRecord + | DNSRecordGetResponse.DNSRecordsNaptrRecord + | DNSRecordGetResponse.DNSRecordsNsRecord + | DNSRecordGetResponse.DNSRecordsPtrRecord + | DNSRecordGetResponse.DNSRecordsSmimeaRecord + | DNSRecordGetResponse.DNSRecordsSrvRecord + | DNSRecordGetResponse.DNSRecordsSshfpRecord + | DNSRecordGetResponse.DNSRecordsSvcbRecord + | DNSRecordGetResponse.DNSRecordsTlsaRecord + | DNSRecordGetResponse.DNSRecordsTxtRecord + | DNSRecordGetResponse.DNSRecordsUriRecord; + +export namespace DNSRecordGetResponse { export interface DNSRecordsARecord { /** * A valid IPv4 address. @@ -9663,6 +9651,18 @@ export namespace DNSRecordReplaceResponse { } } +export interface DNSRecordImportResponse { + /** + * Number of DNS records added. + */ + recs_added?: number; + + /** + * Total number of DNS records parsed. + */ + total_records_parsed?: number; +} + export interface DNSRecordScanResponse { /** * Number of DNS records added. @@ -10824,256 +10824,80 @@ export namespace DNSRecordCreateParams { } } -export interface DNSRecordListParams extends V4PagePaginationArrayParams { - comment?: DNSRecordListParams.Comment; - - /** - * DNS record content. - */ - content?: string; +export type DNSRecordUpdateParams = + | DNSRecordUpdateParams.DNSRecordsARecord + | DNSRecordUpdateParams.DNSRecordsAaaaRecord + | DNSRecordUpdateParams.DNSRecordsCaaRecord + | DNSRecordUpdateParams.DNSRecordsCertRecord + | DNSRecordUpdateParams.DNSRecordsCnameRecord + | DNSRecordUpdateParams.DNSRecordsDnskeyRecord + | DNSRecordUpdateParams.DNSRecordsDsRecord + | DNSRecordUpdateParams.DNSRecordsHTTPSRecord + | DNSRecordUpdateParams.DNSRecordsLocRecord + | DNSRecordUpdateParams.DNSRecordsMxRecord + | DNSRecordUpdateParams.DNSRecordsNaptrRecord + | DNSRecordUpdateParams.DNSRecordsNsRecord + | DNSRecordUpdateParams.DNSRecordsPtrRecord + | DNSRecordUpdateParams.DNSRecordsSmimeaRecord + | DNSRecordUpdateParams.DNSRecordsSrvRecord + | DNSRecordUpdateParams.DNSRecordsSshfpRecord + | DNSRecordUpdateParams.DNSRecordsSvcbRecord + | DNSRecordUpdateParams.DNSRecordsTlsaRecord + | DNSRecordUpdateParams.DNSRecordsTxtRecord + | DNSRecordUpdateParams.DNSRecordsUriRecord; + +export namespace DNSRecordUpdateParams { + export interface DNSRecordsARecord { + /** + * A valid IPv4 address. + */ + content: string; - /** - * Direction to order DNS records in. - */ - direction?: 'asc' | 'desc'; + /** + * DNS record name (or @ for the zone apex) in Punycode. + */ + name: string; - /** - * Whether to match all search requirements or at least one (any). If set to `all`, - * acts like a logical AND between filters. If set to `any`, acts like a logical OR - * instead. Note that the interaction between tag filters is controlled by the - * `tag-match` parameter instead. - */ - match?: 'any' | 'all'; + /** + * Record type. + */ + type: 'A'; - /** - * DNS record name (or @ for the zone apex) in Punycode. - */ - name?: string; + /** + * Comments or notes about the DNS record. This field has no effect on DNS + * responses. + */ + comment?: string; - /** - * Field to order DNS records by. - */ - order?: 'type' | 'name' | 'content' | 'ttl' | 'proxied'; + /** + * Whether the record is receiving the performance and security benefits of + * Cloudflare. + */ + proxied?: boolean; - /** - * Whether the record is receiving the performance and security benefits of - * Cloudflare. - */ - proxied?: boolean; + /** + * Custom tags for the DNS record. This field has no effect on DNS responses. + */ + tags?: Array; - /** - * Allows searching in multiple properties of a DNS record simultaneously. This - * parameter is intended for human users, not automation. Its exact behavior is - * intentionally left unspecified and is subject to change in the future. This - * parameter works independently of the `match` setting. For automated searches, - * please use the other available parameters. - */ - search?: string; + /** + * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + * Value must be between 60 and 86400, with the minimum reduced to 30 for + * Enterprise zones. + */ + ttl?: number | 1; + } - tag?: DNSRecordListParams.Tag; + export interface DNSRecordsAaaaRecord { + /** + * A valid IPv6 address. + */ + content: string; - /** - * Whether to match all tag search requirements or at least one (any). If set to - * `all`, acts like a logical AND between tag filters. If set to `any`, acts like a - * logical OR instead. Note that the regular `match` parameter is still used to - * combine the resulting condition with other filters that aren't related to tags. - */ - tag_match?: 'any' | 'all'; - - /** - * Record type. - */ - type?: - | 'A' - | 'AAAA' - | 'CAA' - | 'CERT' - | 'CNAME' - | 'DNSKEY' - | 'DS' - | 'HTTPS' - | 'LOC' - | 'MX' - | 'NAPTR' - | 'NS' - | 'PTR' - | 'SMIMEA' - | 'SRV' - | 'SSHFP' - | 'SVCB' - | 'TLSA' - | 'TXT' - | 'URI'; -} - -export namespace DNSRecordListParams { - export interface Comment { - /** - * If this parameter is present, only records _without_ a comment are returned. - */ - absent?: string; - - /** - * Substring of the DNS record comment. Comment filters are case-insensitive. - */ - contains?: string; - - /** - * Suffix of the DNS record comment. Comment filters are case-insensitive. - */ - endswith?: string; - - /** - * Exact value of the DNS record comment. Comment filters are case-insensitive. - */ - exact?: string; - - /** - * If this parameter is present, only records _with_ a comment are returned. - */ - present?: string; - - /** - * Prefix of the DNS record comment. Comment filters are case-insensitive. - */ - startswith?: string; - } - - export interface Tag { - /** - * Name of a tag which must _not_ be present on the DNS record. Tag filters are - * case-insensitive. - */ - absent?: string; - - /** - * A tag and value, of the form `:`. The API will only return - * DNS records that have a tag named `` whose value contains - * ``. Tag filters are case-insensitive. - */ - contains?: string; - - /** - * A tag and value, of the form `:`. The API will only return - * DNS records that have a tag named `` whose value ends with - * ``. Tag filters are case-insensitive. - */ - endswith?: string; - - /** - * A tag and value, of the form `:`. The API will only return - * DNS records that have a tag named `` whose value is ``. Tag - * filters are case-insensitive. - */ - exact?: string; - - /** - * Name of a tag which must be present on the DNS record. Tag filters are - * case-insensitive. - */ - present?: string; - - /** - * A tag and value, of the form `:`. The API will only return - * DNS records that have a tag named `` whose value starts with - * ``. Tag filters are case-insensitive. - */ - startswith?: string; - } -} - -export interface DNSRecordImportParams { - /** - * BIND config to import. - * - * **Tip:** When using cURL, a file can be uploaded using - * `--form 'file=@bind_config.txt'`. - */ - file: string; - - /** - * Whether or not proxiable records should receive the performance and security - * benefits of Cloudflare. - * - * The value should be either `true` or `false`. - */ - proxied?: string; -} - -export type DNSRecordReplaceParams = - | DNSRecordReplaceParams.DNSRecordsARecord - | DNSRecordReplaceParams.DNSRecordsAaaaRecord - | DNSRecordReplaceParams.DNSRecordsCaaRecord - | DNSRecordReplaceParams.DNSRecordsCertRecord - | DNSRecordReplaceParams.DNSRecordsCnameRecord - | DNSRecordReplaceParams.DNSRecordsDnskeyRecord - | DNSRecordReplaceParams.DNSRecordsDsRecord - | DNSRecordReplaceParams.DNSRecordsHTTPSRecord - | DNSRecordReplaceParams.DNSRecordsLocRecord - | DNSRecordReplaceParams.DNSRecordsMxRecord - | DNSRecordReplaceParams.DNSRecordsNaptrRecord - | DNSRecordReplaceParams.DNSRecordsNsRecord - | DNSRecordReplaceParams.DNSRecordsPtrRecord - | DNSRecordReplaceParams.DNSRecordsSmimeaRecord - | DNSRecordReplaceParams.DNSRecordsSrvRecord - | DNSRecordReplaceParams.DNSRecordsSshfpRecord - | DNSRecordReplaceParams.DNSRecordsSvcbRecord - | DNSRecordReplaceParams.DNSRecordsTlsaRecord - | DNSRecordReplaceParams.DNSRecordsTxtRecord - | DNSRecordReplaceParams.DNSRecordsUriRecord; - -export namespace DNSRecordReplaceParams { - export interface DNSRecordsARecord { - /** - * A valid IPv4 address. - */ - content: string; - - /** - * DNS record name (or @ for the zone apex) in Punycode. - */ - name: string; - - /** - * Record type. - */ - type: 'A'; - - /** - * Comments or notes about the DNS record. This field has no effect on DNS - * responses. - */ - comment?: string; - - /** - * Whether the record is receiving the performance and security benefits of - * Cloudflare. - */ - proxied?: boolean; - - /** - * Custom tags for the DNS record. This field has no effect on DNS responses. - */ - tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: number | 1; - } - - export interface DNSRecordsAaaaRecord { - /** - * A valid IPv6 address. - */ - content: string; - - /** - * DNS record name (or @ for the zone apex) in Punycode. - */ - name: string; + /** + * DNS record name (or @ for the zone apex) in Punycode. + */ + name: string; /** * Record type. @@ -11109,7 +10933,7 @@ export namespace DNSRecordReplaceParams { /** * Components of a CAA record. */ - data: DNSRecordReplaceParams.DNSRecordsCaaRecord.Data; + data: DNSRecordUpdateParams.DNSRecordsCaaRecord.Data; /** * DNS record name (or @ for the zone apex) in Punycode. @@ -11166,7 +10990,7 @@ export namespace DNSRecordReplaceParams { /** * Components of a CERT record. */ - data: DNSRecordReplaceParams.DNSRecordsCertRecord.Data; + data: DNSRecordUpdateParams.DNSRecordsCertRecord.Data; /** * DNS record name (or @ for the zone apex) in Punycode. @@ -11269,7 +11093,7 @@ export namespace DNSRecordReplaceParams { /** * Components of a DNSKEY record. */ - data: DNSRecordReplaceParams.DNSRecordsDnskeyRecord.Data; + data: DNSRecordUpdateParams.DNSRecordsDnskeyRecord.Data; /** * DNS record name (or @ for the zone apex) in Punycode. @@ -11331,7 +11155,7 @@ export namespace DNSRecordReplaceParams { /** * Components of a DS record. */ - data: DNSRecordReplaceParams.DNSRecordsDsRecord.Data; + data: DNSRecordUpdateParams.DNSRecordsDsRecord.Data; /** * DNS record name (or @ for the zone apex) in Punycode. @@ -11393,7 +11217,7 @@ export namespace DNSRecordReplaceParams { /** * Components of a HTTPS record. */ - data: DNSRecordReplaceParams.DNSRecordsHTTPSRecord.Data; + data: DNSRecordUpdateParams.DNSRecordsHTTPSRecord.Data; /** * DNS record name (or @ for the zone apex) in Punycode. @@ -11450,7 +11274,7 @@ export namespace DNSRecordReplaceParams { /** * Components of a LOC record. */ - data: DNSRecordReplaceParams.DNSRecordsLocRecord.Data; + data: DNSRecordUpdateParams.DNSRecordsLocRecord.Data; /** * DNS record name (or @ for the zone apex) in Punycode. @@ -11593,7 +11417,7 @@ export namespace DNSRecordReplaceParams { /** * Components of a NAPTR record. */ - data: DNSRecordReplaceParams.DNSRecordsNaptrRecord.Data; + data: DNSRecordUpdateParams.DNSRecordsNaptrRecord.Data; /** * DNS record name (or @ for the zone apex) in Punycode. @@ -11735,7 +11559,7 @@ export namespace DNSRecordReplaceParams { /** * Components of a SMIMEA record. */ - data: DNSRecordReplaceParams.DNSRecordsSmimeaRecord.Data; + data: DNSRecordUpdateParams.DNSRecordsSmimeaRecord.Data; /** * DNS record name (or @ for the zone apex) in Punycode. @@ -11797,7 +11621,7 @@ export namespace DNSRecordReplaceParams { /** * Components of a SRV record. */ - data: DNSRecordReplaceParams.DNSRecordsSrvRecord.Data; + data: DNSRecordUpdateParams.DNSRecordsSrvRecord.Data; /** * DNS record name (or @ for the zone apex) in Punycode. For SRV records, the first @@ -11883,7 +11707,7 @@ export namespace DNSRecordReplaceParams { /** * Components of a SSHFP record. */ - data: DNSRecordReplaceParams.DNSRecordsSshfpRecord.Data; + data: DNSRecordUpdateParams.DNSRecordsSshfpRecord.Data; /** * DNS record name (or @ for the zone apex) in Punycode. @@ -11940,7 +11764,7 @@ export namespace DNSRecordReplaceParams { /** * Components of a SVCB record. */ - data: DNSRecordReplaceParams.DNSRecordsSvcbRecord.Data; + data: DNSRecordUpdateParams.DNSRecordsSvcbRecord.Data; /** * DNS record name (or @ for the zone apex) in Punycode. @@ -11997,7 +11821,7 @@ export namespace DNSRecordReplaceParams { /** * Components of a TLSA record. */ - data: DNSRecordReplaceParams.DNSRecordsTlsaRecord.Data; + data: DNSRecordUpdateParams.DNSRecordsTlsaRecord.Data; /** * DNS record name (or @ for the zone apex) in Punycode. @@ -12094,7 +11918,7 @@ export namespace DNSRecordReplaceParams { /** * Components of a URI record. */ - data: DNSRecordReplaceParams.DNSRecordsUriRecord.Data; + data: DNSRecordUpdateParams.DNSRecordsUriRecord.Data; /** * DNS record name (or @ for the zone apex) in Punycode. @@ -12149,18 +11973,194 @@ export namespace DNSRecordReplaceParams { } } +export interface DNSRecordListParams extends V4PagePaginationArrayParams { + comment?: DNSRecordListParams.Comment; + + /** + * DNS record content. + */ + content?: string; + + /** + * Direction to order DNS records in. + */ + direction?: 'asc' | 'desc'; + + /** + * Whether to match all search requirements or at least one (any). If set to `all`, + * acts like a logical AND between filters. If set to `any`, acts like a logical OR + * instead. Note that the interaction between tag filters is controlled by the + * `tag-match` parameter instead. + */ + match?: 'any' | 'all'; + + /** + * DNS record name (or @ for the zone apex) in Punycode. + */ + name?: string; + + /** + * Field to order DNS records by. + */ + order?: 'type' | 'name' | 'content' | 'ttl' | 'proxied'; + + /** + * Whether the record is receiving the performance and security benefits of + * Cloudflare. + */ + proxied?: boolean; + + /** + * Allows searching in multiple properties of a DNS record simultaneously. This + * parameter is intended for human users, not automation. Its exact behavior is + * intentionally left unspecified and is subject to change in the future. This + * parameter works independently of the `match` setting. For automated searches, + * please use the other available parameters. + */ + search?: string; + + tag?: DNSRecordListParams.Tag; + + /** + * Whether to match all tag search requirements or at least one (any). If set to + * `all`, acts like a logical AND between tag filters. If set to `any`, acts like a + * logical OR instead. Note that the regular `match` parameter is still used to + * combine the resulting condition with other filters that aren't related to tags. + */ + tag_match?: 'any' | 'all'; + + /** + * Record type. + */ + type?: + | 'A' + | 'AAAA' + | 'CAA' + | 'CERT' + | 'CNAME' + | 'DNSKEY' + | 'DS' + | 'HTTPS' + | 'LOC' + | 'MX' + | 'NAPTR' + | 'NS' + | 'PTR' + | 'SMIMEA' + | 'SRV' + | 'SSHFP' + | 'SVCB' + | 'TLSA' + | 'TXT' + | 'URI'; +} + +export namespace DNSRecordListParams { + export interface Comment { + /** + * If this parameter is present, only records _without_ a comment are returned. + */ + absent?: string; + + /** + * Substring of the DNS record comment. Comment filters are case-insensitive. + */ + contains?: string; + + /** + * Suffix of the DNS record comment. Comment filters are case-insensitive. + */ + endswith?: string; + + /** + * Exact value of the DNS record comment. Comment filters are case-insensitive. + */ + exact?: string; + + /** + * If this parameter is present, only records _with_ a comment are returned. + */ + present?: string; + + /** + * Prefix of the DNS record comment. Comment filters are case-insensitive. + */ + startswith?: string; + } + + export interface Tag { + /** + * Name of a tag which must _not_ be present on the DNS record. Tag filters are + * case-insensitive. + */ + absent?: string; + + /** + * A tag and value, of the form `:`. The API will only return + * DNS records that have a tag named `` whose value contains + * ``. Tag filters are case-insensitive. + */ + contains?: string; + + /** + * A tag and value, of the form `:`. The API will only return + * DNS records that have a tag named `` whose value ends with + * ``. Tag filters are case-insensitive. + */ + endswith?: string; + + /** + * A tag and value, of the form `:`. The API will only return + * DNS records that have a tag named `` whose value is ``. Tag + * filters are case-insensitive. + */ + exact?: string; + + /** + * Name of a tag which must be present on the DNS record. Tag filters are + * case-insensitive. + */ + present?: string; + + /** + * A tag and value, of the form `:`. The API will only return + * DNS records that have a tag named `` whose value starts with + * ``. Tag filters are case-insensitive. + */ + startswith?: string; + } +} + +export interface DNSRecordImportParams { + /** + * BIND config to import. + * + * **Tip:** When using cURL, a file can be uploaded using + * `--form 'file=@bind_config.txt'`. + */ + file: string; + + /** + * Whether or not proxiable records should receive the performance and security + * benefits of Cloudflare. + * + * The value should be either `true` or `false`. + */ + proxied?: string; +} + export namespace DNSRecords { export import DNSRecordCreateResponse = DNSRecordsAPI.DNSRecordCreateResponse; + export import DNSRecordUpdateResponse = DNSRecordsAPI.DNSRecordUpdateResponse; export import DNSRecordListResponse = DNSRecordsAPI.DNSRecordListResponse; export import DNSRecordDeleteResponse = DNSRecordsAPI.DNSRecordDeleteResponse; export import DNSRecordExportResponse = DNSRecordsAPI.DNSRecordExportResponse; export import DNSRecordGetResponse = DNSRecordsAPI.DNSRecordGetResponse; export import DNSRecordImportResponse = DNSRecordsAPI.DNSRecordImportResponse; - export import DNSRecordReplaceResponse = DNSRecordsAPI.DNSRecordReplaceResponse; export import DNSRecordScanResponse = DNSRecordsAPI.DNSRecordScanResponse; export import DNSRecordListResponsesV4PagePaginationArray = DNSRecordsAPI.DNSRecordListResponsesV4PagePaginationArray; export import DNSRecordCreateParams = DNSRecordsAPI.DNSRecordCreateParams; + export import DNSRecordUpdateParams = DNSRecordsAPI.DNSRecordUpdateParams; export import DNSRecordListParams = DNSRecordsAPI.DNSRecordListParams; export import DNSRecordImportParams = DNSRecordsAPI.DNSRecordImportParams; - export import DNSRecordReplaceParams = DNSRecordsAPI.DNSRecordReplaceParams; } diff --git a/src/resources/dnssec.ts b/src/resources/dnssec.ts index d4aa988082..d9cb56c4f0 100644 --- a/src/resources/dnssec.ts +++ b/src/resources/dnssec.ts @@ -6,27 +6,27 @@ import * as DNSSECAPI from 'cloudflare/resources/dnssec'; export class DNSSEC extends APIResource { /** - * Enable or disable DNSSEC. + * Delete DNSSEC. */ - update( - zoneId: string, - body: DNSSECUpdateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { + delete(zoneId: string, options?: Core.RequestOptions): Core.APIPromise { return ( - this._client.patch(`/zones/${zoneId}/dnssec`, { body, ...options }) as Core.APIPromise<{ - result: DNSSECUpdateResponse; + this._client.delete(`/zones/${zoneId}/dnssec`, options) as Core.APIPromise<{ + result: DNSSECDeleteResponse; }> )._thenUnwrap((obj) => obj.result); } /** - * Delete DNSSEC. + * Enable or disable DNSSEC. */ - delete(zoneId: string, options?: Core.RequestOptions): Core.APIPromise { + edit( + zoneId: string, + body: DNSSECEditParams, + options?: Core.RequestOptions, + ): Core.APIPromise { return ( - this._client.delete(`/zones/${zoneId}/dnssec`, options) as Core.APIPromise<{ - result: DNSSECDeleteResponse; + this._client.patch(`/zones/${zoneId}/dnssec`, { body, ...options }) as Core.APIPromise<{ + result: DNSSECEditResponse; }> )._thenUnwrap((obj) => obj.result); } @@ -41,7 +41,9 @@ export class DNSSEC extends APIResource { } } -export interface DNSSECUpdateResponse { +export type DNSSECDeleteResponse = unknown | string; + +export interface DNSSECEditResponse { /** * Algorithm key code. */ @@ -121,8 +123,6 @@ export interface DNSSECUpdateResponse { status?: 'active' | 'pending' | 'disabled' | 'pending-disabled' | 'error'; } -export type DNSSECDeleteResponse = unknown | string; - export interface DNSSECGetResponse { /** * Algorithm key code. @@ -203,7 +203,7 @@ export interface DNSSECGetResponse { status?: 'active' | 'pending' | 'disabled' | 'pending-disabled' | 'error'; } -export interface DNSSECUpdateParams { +export interface DNSSECEditParams { /** * If true, multi-signer DNSSEC is enabled on the zone, allowing multiple providers * to serve a DNSSEC-signed zone at the same time. This is required for DNSKEY @@ -234,8 +234,8 @@ export interface DNSSECUpdateParams { } export namespace DNSSEC { - export import DNSSECUpdateResponse = DNSSECAPI.DNSSECUpdateResponse; export import DNSSECDeleteResponse = DNSSECAPI.DNSSECDeleteResponse; + export import DNSSECEditResponse = DNSSECAPI.DNSSECEditResponse; export import DNSSECGetResponse = DNSSECAPI.DNSSECGetResponse; - export import DNSSECUpdateParams = DNSSECAPI.DNSSECUpdateParams; + export import DNSSECEditParams = DNSSECAPI.DNSSECEditParams; } diff --git a/src/resources/emails/routing/index.ts b/src/resources/emails/routing/index.ts index 9ee65d5260..b72c9249c7 100644 --- a/src/resources/emails/routing/index.ts +++ b/src/resources/emails/routing/index.ts @@ -15,13 +15,13 @@ export { EnableCreateResponse, Enables } from './enables'; export { RoutingGetResponse, Routing } from './routing'; export { RuleCreateResponse, + RuleUpdateResponse, RuleListResponse, RuleDeleteResponse, RuleGetResponse, - RuleReplaceResponse, RuleCreateParams, + RuleUpdateParams, RuleListParams, - RuleReplaceParams, RuleListResponsesV4PagePaginationArray, Rules, } from './rules/index'; diff --git a/src/resources/emails/routing/routing.ts b/src/resources/emails/routing/routing.ts index 61b84014cd..f4bf08dd49 100644 --- a/src/resources/emails/routing/routing.ts +++ b/src/resources/emails/routing/routing.ts @@ -81,14 +81,14 @@ export namespace Routing { export import EnableCreateResponse = EnablesAPI.EnableCreateResponse; export import Rules = RulesAPI.Rules; export import RuleCreateResponse = RulesAPI.RuleCreateResponse; + export import RuleUpdateResponse = RulesAPI.RuleUpdateResponse; export import RuleListResponse = RulesAPI.RuleListResponse; export import RuleDeleteResponse = RulesAPI.RuleDeleteResponse; export import RuleGetResponse = RulesAPI.RuleGetResponse; - export import RuleReplaceResponse = RulesAPI.RuleReplaceResponse; export import RuleListResponsesV4PagePaginationArray = RulesAPI.RuleListResponsesV4PagePaginationArray; export import RuleCreateParams = RulesAPI.RuleCreateParams; + export import RuleUpdateParams = RulesAPI.RuleUpdateParams; export import RuleListParams = RulesAPI.RuleListParams; - export import RuleReplaceParams = RulesAPI.RuleReplaceParams; export import Addresses = AddressesAPI.Addresses; export import AddressCreateResponse = AddressesAPI.AddressCreateResponse; export import AddressDeleteResponse = AddressesAPI.AddressDeleteResponse; diff --git a/src/resources/emails/routing/rules/catch-alls.ts b/src/resources/emails/routing/rules/catch-alls.ts index 57624e3316..4344b80777 100644 --- a/src/resources/emails/routing/rules/catch-alls.ts +++ b/src/resources/emails/routing/rules/catch-alls.ts @@ -5,36 +5,36 @@ import { APIResource } from 'cloudflare/resource'; import * as CatchAllsAPI from 'cloudflare/resources/emails/routing/rules/catch-alls'; export class CatchAlls extends APIResource { - /** - * Get information on the default catch-all routing rule. - */ - get(zoneIdentifier: string, options?: Core.RequestOptions): Core.APIPromise { - return ( - this._client.get(`/zones/${zoneIdentifier}/email/routing/rules/catch_all`, options) as Core.APIPromise<{ - result: CatchAllGetResponse; - }> - )._thenUnwrap((obj) => obj.result); - } - /** * Enable or disable catch-all routing rule, or change action to forward to * specific destination address. */ - replace( + update( zoneIdentifier: string, - body: CatchAllReplaceParams, + body: CatchAllUpdateParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.put(`/zones/${zoneIdentifier}/email/routing/rules/catch_all`, { body, ...options, - }) as Core.APIPromise<{ result: CatchAllReplaceResponse }> + }) as Core.APIPromise<{ result: CatchAllUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Get information on the default catch-all routing rule. + */ + get(zoneIdentifier: string, options?: Core.RequestOptions): Core.APIPromise { + return ( + this._client.get(`/zones/${zoneIdentifier}/email/routing/rules/catch_all`, options) as Core.APIPromise<{ + result: CatchAllGetResponse; + }> )._thenUnwrap((obj) => obj.result); } } -export interface CatchAllGetResponse { +export interface CatchAllUpdateResponse { /** * Routing rule identifier. */ @@ -43,7 +43,7 @@ export interface CatchAllGetResponse { /** * List actions for the catch-all routing rule. */ - actions?: Array; + actions?: Array; /** * Routing rule status. @@ -53,7 +53,7 @@ export interface CatchAllGetResponse { /** * List of matchers for the catch-all routing rule. */ - matchers?: Array; + matchers?: Array; /** * Routing rule name. @@ -66,7 +66,7 @@ export interface CatchAllGetResponse { tag?: string; } -export namespace CatchAllGetResponse { +export namespace CatchAllUpdateResponse { /** * Action for the catch-all routing rule. */ @@ -90,7 +90,7 @@ export namespace CatchAllGetResponse { } } -export interface CatchAllReplaceResponse { +export interface CatchAllGetResponse { /** * Routing rule identifier. */ @@ -99,7 +99,7 @@ export interface CatchAllReplaceResponse { /** * List actions for the catch-all routing rule. */ - actions?: Array; + actions?: Array; /** * Routing rule status. @@ -109,7 +109,7 @@ export interface CatchAllReplaceResponse { /** * List of matchers for the catch-all routing rule. */ - matchers?: Array; + matchers?: Array; /** * Routing rule name. @@ -122,7 +122,7 @@ export interface CatchAllReplaceResponse { tag?: string; } -export namespace CatchAllReplaceResponse { +export namespace CatchAllGetResponse { /** * Action for the catch-all routing rule. */ @@ -146,16 +146,16 @@ export namespace CatchAllReplaceResponse { } } -export interface CatchAllReplaceParams { +export interface CatchAllUpdateParams { /** * List actions for the catch-all routing rule. */ - actions: Array; + actions: Array; /** * List of matchers for the catch-all routing rule. */ - matchers: Array; + matchers: Array; /** * Routing rule status. @@ -168,7 +168,7 @@ export interface CatchAllReplaceParams { name?: string; } -export namespace CatchAllReplaceParams { +export namespace CatchAllUpdateParams { /** * Action for the catch-all routing rule. */ @@ -193,7 +193,7 @@ export namespace CatchAllReplaceParams { } export namespace CatchAlls { + export import CatchAllUpdateResponse = CatchAllsAPI.CatchAllUpdateResponse; export import CatchAllGetResponse = CatchAllsAPI.CatchAllGetResponse; - export import CatchAllReplaceResponse = CatchAllsAPI.CatchAllReplaceResponse; - export import CatchAllReplaceParams = CatchAllsAPI.CatchAllReplaceParams; + export import CatchAllUpdateParams = CatchAllsAPI.CatchAllUpdateParams; } diff --git a/src/resources/emails/routing/rules/index.ts b/src/resources/emails/routing/rules/index.ts index 2c1b0c702f..6af4ba58ad 100644 --- a/src/resources/emails/routing/rules/index.ts +++ b/src/resources/emails/routing/rules/index.ts @@ -1,15 +1,15 @@ // File generated from our OpenAPI spec by Stainless. -export { CatchAllGetResponse, CatchAllReplaceResponse, CatchAllReplaceParams, CatchAlls } from './catch-alls'; +export { CatchAllUpdateResponse, CatchAllGetResponse, CatchAllUpdateParams, CatchAlls } from './catch-alls'; export { RuleCreateResponse, + RuleUpdateResponse, RuleListResponse, RuleDeleteResponse, RuleGetResponse, - RuleReplaceResponse, RuleCreateParams, + RuleUpdateParams, RuleListParams, - RuleReplaceParams, RuleListResponsesV4PagePaginationArray, Rules, } from './rules'; diff --git a/src/resources/emails/routing/rules/rules.ts b/src/resources/emails/routing/rules/rules.ts index 048007a8c3..51dc3eddc4 100644 --- a/src/resources/emails/routing/rules/rules.ts +++ b/src/resources/emails/routing/rules/rules.ts @@ -28,6 +28,23 @@ export class Rules extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Update actions and matches, or enable/disable specific routing rules. + */ + update( + zoneIdentifier: string, + ruleIdentifier: string, + body: RuleUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/zones/${zoneIdentifier}/email/routing/rules/${ruleIdentifier}`, { + body, + ...options, + }) as Core.APIPromise<{ result: RuleUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * Lists existing routing rules. */ @@ -86,23 +103,6 @@ export class Rules extends APIResource { ) as Core.APIPromise<{ result: RuleGetResponse }> )._thenUnwrap((obj) => obj.result); } - - /** - * Update actions and matches, or enable/disable specific routing rules. - */ - replace( - zoneIdentifier: string, - ruleIdentifier: string, - body: RuleReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put(`/zones/${zoneIdentifier}/email/routing/rules/${ruleIdentifier}`, { - body, - ...options, - }) as Core.APIPromise<{ result: RuleReplaceResponse }> - )._thenUnwrap((obj) => obj.result); - } } export class RuleListResponsesV4PagePaginationArray extends V4PagePaginationArray {} @@ -178,7 +178,7 @@ export namespace RuleCreateResponse { } } -export interface RuleListResponse { +export interface RuleUpdateResponse { /** * Routing rule identifier. */ @@ -187,7 +187,7 @@ export interface RuleListResponse { /** * List actions patterns. */ - actions?: Array; + actions?: Array; /** * Routing rule status. @@ -197,7 +197,7 @@ export interface RuleListResponse { /** * Matching patterns to forward to your actions. */ - matchers?: Array; + matchers?: Array; /** * Routing rule name. @@ -215,7 +215,7 @@ export interface RuleListResponse { tag?: string; } -export namespace RuleListResponse { +export namespace RuleUpdateResponse { /** * Actions pattern. */ @@ -249,7 +249,7 @@ export namespace RuleListResponse { } } -export interface RuleDeleteResponse { +export interface RuleListResponse { /** * Routing rule identifier. */ @@ -258,7 +258,7 @@ export interface RuleDeleteResponse { /** * List actions patterns. */ - actions?: Array; + actions?: Array; /** * Routing rule status. @@ -268,7 +268,7 @@ export interface RuleDeleteResponse { /** * Matching patterns to forward to your actions. */ - matchers?: Array; + matchers?: Array; /** * Routing rule name. @@ -286,7 +286,7 @@ export interface RuleDeleteResponse { tag?: string; } -export namespace RuleDeleteResponse { +export namespace RuleListResponse { /** * Actions pattern. */ @@ -320,7 +320,7 @@ export namespace RuleDeleteResponse { } } -export interface RuleGetResponse { +export interface RuleDeleteResponse { /** * Routing rule identifier. */ @@ -329,7 +329,7 @@ export interface RuleGetResponse { /** * List actions patterns. */ - actions?: Array; + actions?: Array; /** * Routing rule status. @@ -339,7 +339,7 @@ export interface RuleGetResponse { /** * Matching patterns to forward to your actions. */ - matchers?: Array; + matchers?: Array; /** * Routing rule name. @@ -357,7 +357,7 @@ export interface RuleGetResponse { tag?: string; } -export namespace RuleGetResponse { +export namespace RuleDeleteResponse { /** * Actions pattern. */ @@ -391,7 +391,7 @@ export namespace RuleGetResponse { } } -export interface RuleReplaceResponse { +export interface RuleGetResponse { /** * Routing rule identifier. */ @@ -400,7 +400,7 @@ export interface RuleReplaceResponse { /** * List actions patterns. */ - actions?: Array; + actions?: Array; /** * Routing rule status. @@ -410,7 +410,7 @@ export interface RuleReplaceResponse { /** * Matching patterns to forward to your actions. */ - matchers?: Array; + matchers?: Array; /** * Routing rule name. @@ -428,7 +428,7 @@ export interface RuleReplaceResponse { tag?: string; } -export namespace RuleReplaceResponse { +export namespace RuleGetResponse { /** * Actions pattern. */ @@ -523,23 +523,16 @@ export namespace RuleCreateParams { } } -export interface RuleListParams extends V4PagePaginationArrayParams { - /** - * Filter by enabled routing rules. - */ - enabled?: true | false; -} - -export interface RuleReplaceParams { +export interface RuleUpdateParams { /** * List actions patterns. */ - actions: Array; + actions: Array; /** * Matching patterns to forward to your actions. */ - matchers: Array; + matchers: Array; /** * Routing rule status. @@ -557,7 +550,7 @@ export interface RuleReplaceParams { priority?: number; } -export namespace RuleReplaceParams { +export namespace RuleUpdateParams { /** * Actions pattern. */ @@ -591,18 +584,25 @@ export namespace RuleReplaceParams { } } +export interface RuleListParams extends V4PagePaginationArrayParams { + /** + * Filter by enabled routing rules. + */ + enabled?: true | false; +} + export namespace Rules { export import RuleCreateResponse = RulesAPI.RuleCreateResponse; + export import RuleUpdateResponse = RulesAPI.RuleUpdateResponse; export import RuleListResponse = RulesAPI.RuleListResponse; export import RuleDeleteResponse = RulesAPI.RuleDeleteResponse; export import RuleGetResponse = RulesAPI.RuleGetResponse; - export import RuleReplaceResponse = RulesAPI.RuleReplaceResponse; export import RuleListResponsesV4PagePaginationArray = RulesAPI.RuleListResponsesV4PagePaginationArray; export import RuleCreateParams = RulesAPI.RuleCreateParams; + export import RuleUpdateParams = RulesAPI.RuleUpdateParams; export import RuleListParams = RulesAPI.RuleListParams; - export import RuleReplaceParams = RulesAPI.RuleReplaceParams; export import CatchAlls = CatchAllsAPI.CatchAlls; + export import CatchAllUpdateResponse = CatchAllsAPI.CatchAllUpdateResponse; export import CatchAllGetResponse = CatchAllsAPI.CatchAllGetResponse; - export import CatchAllReplaceResponse = CatchAllsAPI.CatchAllReplaceResponse; - export import CatchAllReplaceParams = CatchAllsAPI.CatchAllReplaceParams; + export import CatchAllUpdateParams = CatchAllsAPI.CatchAllUpdateParams; } diff --git a/src/resources/filters.ts b/src/resources/filters.ts index 5f37512875..62f7dde2ea 100644 --- a/src/resources/filters.ts +++ b/src/resources/filters.ts @@ -22,6 +22,22 @@ export class Filters extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Updates an existing filter. + */ + update( + zoneIdentifier: string, + id: string, + body: FilterUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/zones/${zoneIdentifier}/filters/${id}`, { body, ...options }) as Core.APIPromise<{ + result: FilterUpdateResponse | null; + }> + )._thenUnwrap((obj) => obj.result); + } + /** * Fetches filters in a zone. You can filter the results using several optional * parameters. @@ -79,22 +95,6 @@ export class Filters extends APIResource { }> )._thenUnwrap((obj) => obj.result); } - - /** - * Updates an existing filter. - */ - replace( - zoneIdentifier: string, - id: string, - body: FilterReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put(`/zones/${zoneIdentifier}/filters/${id}`, { body, ...options }) as Core.APIPromise<{ - result: FilterReplaceResponse | null; - }> - )._thenUnwrap((obj) => obj.result); - } } export class FilterListResponsesV4PagePaginationArray extends V4PagePaginationArray {} @@ -131,7 +131,7 @@ export namespace FilterCreateResponse { } } -export interface FilterListResponse { +export interface FilterUpdateResponse { /** * The unique identifier of the filter. */ @@ -159,27 +159,27 @@ export interface FilterListResponse { ref?: string; } -export interface FilterDeleteResponse { +export interface FilterListResponse { /** * The unique identifier of the filter. */ id: string; - /** - * An informative summary of the filter. - */ - description?: string; - /** * The filter expression. For more information, refer to * [Expressions](https://developers.cloudflare.com/ruleset-engine/rules-language/expressions/). */ - expression?: string; + expression: string; /** * When true, indicates that the filter is currently paused. */ - paused?: boolean; + paused: boolean; + + /** + * An informative summary of the filter. + */ + description?: string; /** * A short reference tag. Allows you to select related filters. @@ -187,27 +187,27 @@ export interface FilterDeleteResponse { ref?: string; } -export interface FilterGetResponse { +export interface FilterDeleteResponse { /** * The unique identifier of the filter. */ id: string; /** - * The filter expression. For more information, refer to - * [Expressions](https://developers.cloudflare.com/ruleset-engine/rules-language/expressions/). + * An informative summary of the filter. */ - expression: string; + description?: string; /** - * When true, indicates that the filter is currently paused. + * The filter expression. For more information, refer to + * [Expressions](https://developers.cloudflare.com/ruleset-engine/rules-language/expressions/). */ - paused: boolean; + expression?: string; /** - * An informative summary of the filter. + * When true, indicates that the filter is currently paused. */ - description?: string; + paused?: boolean; /** * A short reference tag. Allows you to select related filters. @@ -215,7 +215,7 @@ export interface FilterGetResponse { ref?: string; } -export interface FilterReplaceResponse { +export interface FilterGetResponse { /** * The unique identifier of the filter. */ @@ -245,6 +245,8 @@ export interface FilterReplaceResponse { export type FilterCreateParams = unknown; +export type FilterUpdateParams = unknown; + export interface FilterListParams extends V4PagePaginationArrayParams { /** * A case-insensitive string to find in the description. @@ -267,16 +269,14 @@ export interface FilterListParams extends V4PagePaginationArrayParams { ref?: string; } -export type FilterReplaceParams = unknown; - export namespace Filters { export import FilterCreateResponse = FiltersAPI.FilterCreateResponse; + export import FilterUpdateResponse = FiltersAPI.FilterUpdateResponse; export import FilterListResponse = FiltersAPI.FilterListResponse; export import FilterDeleteResponse = FiltersAPI.FilterDeleteResponse; export import FilterGetResponse = FiltersAPI.FilterGetResponse; - export import FilterReplaceResponse = FiltersAPI.FilterReplaceResponse; export import FilterListResponsesV4PagePaginationArray = FiltersAPI.FilterListResponsesV4PagePaginationArray; export import FilterCreateParams = FiltersAPI.FilterCreateParams; + export import FilterUpdateParams = FiltersAPI.FilterUpdateParams; export import FilterListParams = FiltersAPI.FilterListParams; - export import FilterReplaceParams = FiltersAPI.FilterReplaceParams; } diff --git a/src/resources/firewall/waf/packages/groups.ts b/src/resources/firewall/waf/packages/groups.ts index fb9c2eb4bc..7a40858f1b 100644 --- a/src/resources/firewall/waf/packages/groups.ts +++ b/src/resources/firewall/waf/packages/groups.ts @@ -7,28 +7,6 @@ import * as GroupsAPI from 'cloudflare/resources/firewall/waf/packages/groups'; import { V4PagePaginationArray, type V4PagePaginationArrayParams } from 'cloudflare/pagination'; export class Groups extends APIResource { - /** - * Updates a WAF rule group. You can update the state (`mode` parameter) of a rule - * group. - * - * **Note:** Applies only to the - * [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/). - */ - update( - zoneId: string, - packageId: string, - groupId: string, - body: GroupUpdateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.patch(`/zones/${zoneId}/firewall/waf/packages/${packageId}/groups/${groupId}`, { - body, - ...options, - }) as Core.APIPromise<{ result: GroupUpdateResponse }> - )._thenUnwrap((obj) => obj.result); - } - /** * Fetches the WAF rule groups in a WAF package. * @@ -62,6 +40,28 @@ export class Groups extends APIResource { ); } + /** + * Updates a WAF rule group. You can update the state (`mode` parameter) of a rule + * group. + * + * **Note:** Applies only to the + * [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/). + */ + edit( + zoneId: string, + packageId: string, + groupId: string, + body: GroupEditParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.patch(`/zones/${zoneId}/firewall/waf/packages/${packageId}/groups/${groupId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: GroupEditResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * Fetches the details of a WAF rule group. * @@ -85,8 +85,6 @@ export class Groups extends APIResource { export class GroupListResponsesV4PagePaginationArray extends V4PagePaginationArray {} -export type GroupUpdateResponse = unknown | Array | string; - export interface GroupListResponse { /** * The unique identifier of the rule group. @@ -131,15 +129,9 @@ export interface GroupListResponse { package_id?: string; } -export type GroupGetResponse = unknown | Array | string; +export type GroupEditResponse = unknown | Array | string; -export interface GroupUpdateParams { - /** - * The state of the rules contained in the rule group. When `on`, the rules in the - * group are configurable/usable. - */ - mode?: 'on' | 'off'; -} +export type GroupGetResponse = unknown | Array | string; export interface GroupListParams extends V4PagePaginationArrayParams { /** @@ -165,11 +157,19 @@ export interface GroupListParams extends V4PagePaginationArrayParams { order?: 'mode' | 'rules_count'; } +export interface GroupEditParams { + /** + * The state of the rules contained in the rule group. When `on`, the rules in the + * group are configurable/usable. + */ + mode?: 'on' | 'off'; +} + export namespace Groups { - export import GroupUpdateResponse = GroupsAPI.GroupUpdateResponse; export import GroupListResponse = GroupsAPI.GroupListResponse; + export import GroupEditResponse = GroupsAPI.GroupEditResponse; export import GroupGetResponse = GroupsAPI.GroupGetResponse; export import GroupListResponsesV4PagePaginationArray = GroupsAPI.GroupListResponsesV4PagePaginationArray; - export import GroupUpdateParams = GroupsAPI.GroupUpdateParams; export import GroupListParams = GroupsAPI.GroupListParams; + export import GroupEditParams = GroupsAPI.GroupEditParams; } diff --git a/src/resources/firewall/waf/packages/index.ts b/src/resources/firewall/waf/packages/index.ts index c876f7c631..c879e08c41 100644 --- a/src/resources/firewall/waf/packages/index.ts +++ b/src/resources/firewall/waf/packages/index.ts @@ -1,13 +1,13 @@ // File generated from our OpenAPI spec by Stainless. export { - GroupUpdateResponse, GroupListResponse, + GroupEditResponse, GroupGetResponse, - GroupUpdateParams, GroupListParams, + GroupEditParams, GroupListResponsesV4PagePaginationArray, Groups, } from './groups'; export { Packages } from './packages'; -export { RuleUpdateResponse, RuleGetResponse, RuleUpdateParams, Rules } from './rules'; +export { RuleEditResponse, RuleGetResponse, RuleEditParams, Rules } from './rules'; diff --git a/src/resources/firewall/waf/packages/packages.ts b/src/resources/firewall/waf/packages/packages.ts index c44d3a5172..169b03bda1 100644 --- a/src/resources/firewall/waf/packages/packages.ts +++ b/src/resources/firewall/waf/packages/packages.ts @@ -11,14 +11,14 @@ export class Packages extends APIResource { export namespace Packages { export import Groups = GroupsAPI.Groups; - export import GroupUpdateResponse = GroupsAPI.GroupUpdateResponse; export import GroupListResponse = GroupsAPI.GroupListResponse; + export import GroupEditResponse = GroupsAPI.GroupEditResponse; export import GroupGetResponse = GroupsAPI.GroupGetResponse; export import GroupListResponsesV4PagePaginationArray = GroupsAPI.GroupListResponsesV4PagePaginationArray; - export import GroupUpdateParams = GroupsAPI.GroupUpdateParams; export import GroupListParams = GroupsAPI.GroupListParams; + export import GroupEditParams = GroupsAPI.GroupEditParams; export import Rules = RulesAPI.Rules; - export import RuleUpdateResponse = RulesAPI.RuleUpdateResponse; + export import RuleEditResponse = RulesAPI.RuleEditResponse; export import RuleGetResponse = RulesAPI.RuleGetResponse; - export import RuleUpdateParams = RulesAPI.RuleUpdateParams; + export import RuleEditParams = RulesAPI.RuleEditParams; } diff --git a/src/resources/firewall/waf/packages/rules.ts b/src/resources/firewall/waf/packages/rules.ts index e8642253f3..c32c8d39ce 100644 --- a/src/resources/firewall/waf/packages/rules.ts +++ b/src/resources/firewall/waf/packages/rules.ts @@ -11,18 +11,18 @@ export class Rules extends APIResource { * **Note:** Applies only to the * [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/). */ - update( + edit( zoneId: string, packageId: string, ruleId: string, - body: RuleUpdateParams, + body: RuleEditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.patch(`/zones/${zoneId}/firewall/waf/packages/${packageId}/rules/${ruleId}`, { body, ...options, - }) as Core.APIPromise<{ result: RuleUpdateResponse }> + }) as Core.APIPromise<{ result: RuleEditResponse }> )._thenUnwrap((obj) => obj.result); } @@ -53,12 +53,12 @@ export class Rules extends APIResource { * configure the total scoring threshold through the 'sensitivity' property of the * WAF package. */ -export type RuleUpdateResponse = - | RuleUpdateResponse.WAFManagedRulesAnomalyRule - | RuleUpdateResponse.WAFManagedRulesTraditionalDenyRule - | RuleUpdateResponse.WAFManagedRulesTraditionalAllowRule; +export type RuleEditResponse = + | RuleEditResponse.WAFManagedRulesAnomalyRule + | RuleEditResponse.WAFManagedRulesTraditionalDenyRule + | RuleEditResponse.WAFManagedRulesTraditionalAllowRule; -export namespace RuleUpdateResponse { +export namespace RuleEditResponse { /** * When triggered, anomaly detection WAF rules contribute to an overall threat * score that will determine if a request is considered malicious. You can @@ -250,7 +250,7 @@ export namespace RuleUpdateResponse { export type RuleGetResponse = unknown | Array | string; -export interface RuleUpdateParams { +export interface RuleEditParams { /** * The mode/action of the rule when triggered. You must use a value from the * `allowed_modes` array of the current rule. @@ -259,7 +259,7 @@ export interface RuleUpdateParams { } export namespace Rules { - export import RuleUpdateResponse = RulesAPI.RuleUpdateResponse; + export import RuleEditResponse = RulesAPI.RuleEditResponse; export import RuleGetResponse = RulesAPI.RuleGetResponse; - export import RuleUpdateParams = RulesAPI.RuleUpdateParams; + export import RuleEditParams = RulesAPI.RuleEditParams; } diff --git a/src/resources/firewalls/access-rules.ts b/src/resources/firewalls/access-rules.ts index 0c37dee64c..3bc0e440f1 100644 --- a/src/resources/firewalls/access-rules.ts +++ b/src/resources/firewalls/access-rules.ts @@ -28,25 +28,6 @@ export class AccessRules extends APIResource { )._thenUnwrap((obj) => obj.result); } - /** - * Updates an IP Access rule defined at the account level. - * - * Note: This operation will affect all zones in the account. - */ - update( - identifier: unknown, - params: AccessRuleUpdateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_identifier, ...body } = params; - return ( - this._client.patch(`/${account_identifier}/${identifier}/firewall/access_rules/rules/:identifier`, { - body, - ...options, - }) as Core.APIPromise<{ result: AccessRuleUpdateResponse | null }> - )._thenUnwrap((obj) => obj.result); - } - /** * Fetches IP Access rules of an account or zone. These rules apply to all the * zones in the account or zone. You can filter the results using several optional @@ -98,6 +79,25 @@ export class AccessRules extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Updates an IP Access rule defined at the account level. + * + * Note: This operation will affect all zones in the account. + */ + edit( + identifier: unknown, + params: AccessRuleEditParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_identifier, ...body } = params; + return ( + this._client.patch(`/${account_identifier}/${identifier}/firewall/access_rules/rules/:identifier`, { + body, + ...options, + }) as Core.APIPromise<{ result: AccessRuleEditResponse | null }> + )._thenUnwrap((obj) => obj.result); + } + /** * Fetches the details of an IP Access rule defined. */ @@ -120,8 +120,6 @@ export class AccessRuleListResponsesV4PagePaginationArray extends V4PagePaginati export type AccessRuleCreateResponse = unknown | string; -export type AccessRuleUpdateResponse = unknown | string; - export type AccessRuleListResponse = unknown; export interface AccessRuleDeleteResponse { @@ -131,6 +129,8 @@ export interface AccessRuleDeleteResponse { id: string; } +export type AccessRuleEditResponse = unknown | string; + export type AccessRuleGetResponse = unknown | string; export interface AccessRuleCreateParams { @@ -225,7 +225,77 @@ export namespace AccessRuleCreateParams { } } -export interface AccessRuleUpdateParams { +export interface AccessRuleListParams extends V4PagePaginationArrayParams { + /** + * The direction used to sort returned rules. + */ + direction?: 'asc' | 'desc'; + + 'egs-pagination'?: AccessRuleListParams.EgsPagination; + + filters?: AccessRuleListParams.Filters; + + /** + * The field used to sort returned rules. + */ + order?: 'configuration.target' | 'configuration.value' | 'mode'; +} + +export namespace AccessRuleListParams { + export interface EgsPagination { + json?: EgsPagination.Json; + } + + export namespace EgsPagination { + export interface Json { + /** + * The page number of paginated results. + */ + page?: number; + + /** + * The maximum number of results per page. You can only set the value to `1` or to + * a multiple of 5 such as `5`, `10`, `15`, or `20`. + */ + per_page?: number; + } + } + + export interface Filters { + /** + * The target to search in existing rules. + */ + 'configuration.target'?: 'ip' | 'ip_range' | 'asn' | 'country'; + + /** + * The target value to search for in existing rules: an IP address, an IP address + * range, or a country code, depending on the provided `configuration.target`. + * Notes: You can search for a single IPv4 address, an IP address range with a + * subnet of '/16' or '/24', or a two-letter ISO-3166-1 alpha-2 country code. + */ + 'configuration.value'?: string; + + /** + * When set to `all`, all the search requirements must match. When set to `any`, + * only one of the search requirements has to match. + */ + match?: 'any' | 'all'; + + /** + * The action to apply to a matched request. + */ + mode?: 'block' | 'challenge' | 'whitelist' | 'js_challenge' | 'managed_challenge'; + + /** + * The string to search for in the notes of existing IP Access rules. Notes: For + * example, the string 'attack' would match IP Access rules with notes 'Attack + * 26/02' and 'Attack 27/02'. The search is case insensitive. + */ + notes?: string; + } +} + +export interface AccessRuleEditParams { /** * Path param: */ @@ -235,11 +305,11 @@ export interface AccessRuleUpdateParams { * Body param: The rule configuration. */ configuration: - | AccessRuleUpdateParams.LegacyJhsIPConfiguration - | AccessRuleUpdateParams.LegacyJhsIPV6Configuration - | AccessRuleUpdateParams.LegacyJhsCidrConfiguration - | AccessRuleUpdateParams.LegacyJhsAsnConfiguration - | AccessRuleUpdateParams.LegacyJhsCountryConfiguration; + | AccessRuleEditParams.LegacyJhsIPConfiguration + | AccessRuleEditParams.LegacyJhsIPV6Configuration + | AccessRuleEditParams.LegacyJhsCidrConfiguration + | AccessRuleEditParams.LegacyJhsAsnConfiguration + | AccessRuleEditParams.LegacyJhsCountryConfiguration; /** * Body param: The action to apply to a matched request. @@ -253,7 +323,7 @@ export interface AccessRuleUpdateParams { notes?: string; } -export namespace AccessRuleUpdateParams { +export namespace AccessRuleEditParams { export interface LegacyJhsIPConfiguration { /** * The configuration target. You must set the target to `ip` when specifying an IP @@ -323,84 +393,14 @@ export namespace AccessRuleUpdateParams { } } -export interface AccessRuleListParams extends V4PagePaginationArrayParams { - /** - * The direction used to sort returned rules. - */ - direction?: 'asc' | 'desc'; - - 'egs-pagination'?: AccessRuleListParams.EgsPagination; - - filters?: AccessRuleListParams.Filters; - - /** - * The field used to sort returned rules. - */ - order?: 'configuration.target' | 'configuration.value' | 'mode'; -} - -export namespace AccessRuleListParams { - export interface EgsPagination { - json?: EgsPagination.Json; - } - - export namespace EgsPagination { - export interface Json { - /** - * The page number of paginated results. - */ - page?: number; - - /** - * The maximum number of results per page. You can only set the value to `1` or to - * a multiple of 5 such as `5`, `10`, `15`, or `20`. - */ - per_page?: number; - } - } - - export interface Filters { - /** - * The target to search in existing rules. - */ - 'configuration.target'?: 'ip' | 'ip_range' | 'asn' | 'country'; - - /** - * The target value to search for in existing rules: an IP address, an IP address - * range, or a country code, depending on the provided `configuration.target`. - * Notes: You can search for a single IPv4 address, an IP address range with a - * subnet of '/16' or '/24', or a two-letter ISO-3166-1 alpha-2 country code. - */ - 'configuration.value'?: string; - - /** - * When set to `all`, all the search requirements must match. When set to `any`, - * only one of the search requirements has to match. - */ - match?: 'any' | 'all'; - - /** - * The action to apply to a matched request. - */ - mode?: 'block' | 'challenge' | 'whitelist' | 'js_challenge' | 'managed_challenge'; - - /** - * The string to search for in the notes of existing IP Access rules. Notes: For - * example, the string 'attack' would match IP Access rules with notes 'Attack - * 26/02' and 'Attack 27/02'. The search is case insensitive. - */ - notes?: string; - } -} - export namespace AccessRules { export import AccessRuleCreateResponse = AccessRulesAPI.AccessRuleCreateResponse; - export import AccessRuleUpdateResponse = AccessRulesAPI.AccessRuleUpdateResponse; export import AccessRuleListResponse = AccessRulesAPI.AccessRuleListResponse; export import AccessRuleDeleteResponse = AccessRulesAPI.AccessRuleDeleteResponse; + export import AccessRuleEditResponse = AccessRulesAPI.AccessRuleEditResponse; export import AccessRuleGetResponse = AccessRulesAPI.AccessRuleGetResponse; export import AccessRuleListResponsesV4PagePaginationArray = AccessRulesAPI.AccessRuleListResponsesV4PagePaginationArray; export import AccessRuleCreateParams = AccessRulesAPI.AccessRuleCreateParams; - export import AccessRuleUpdateParams = AccessRulesAPI.AccessRuleUpdateParams; export import AccessRuleListParams = AccessRulesAPI.AccessRuleListParams; + export import AccessRuleEditParams = AccessRulesAPI.AccessRuleEditParams; } diff --git a/src/resources/firewalls/firewalls.ts b/src/resources/firewalls/firewalls.ts index a3b7c9af91..354807dae7 100644 --- a/src/resources/firewalls/firewalls.ts +++ b/src/resources/firewalls/firewalls.ts @@ -18,46 +18,46 @@ export class Firewalls extends APIResource { export namespace Firewalls { export import Lockdowns = LockdownsAPI.Lockdowns; export import LockdownCreateResponse = LockdownsAPI.LockdownCreateResponse; + export import LockdownUpdateResponse = LockdownsAPI.LockdownUpdateResponse; export import LockdownListResponse = LockdownsAPI.LockdownListResponse; export import LockdownDeleteResponse = LockdownsAPI.LockdownDeleteResponse; export import LockdownGetResponse = LockdownsAPI.LockdownGetResponse; - export import LockdownReplaceResponse = LockdownsAPI.LockdownReplaceResponse; export import LockdownListResponsesV4PagePaginationArray = LockdownsAPI.LockdownListResponsesV4PagePaginationArray; export import LockdownCreateParams = LockdownsAPI.LockdownCreateParams; + export import LockdownUpdateParams = LockdownsAPI.LockdownUpdateParams; export import LockdownListParams = LockdownsAPI.LockdownListParams; - export import LockdownReplaceParams = LockdownsAPI.LockdownReplaceParams; export import Rules = RulesAPI.Rules; export import RuleCreateResponse = RulesAPI.RuleCreateResponse; export import RuleUpdateResponse = RulesAPI.RuleUpdateResponse; export import RuleListResponse = RulesAPI.RuleListResponse; export import RuleDeleteResponse = RulesAPI.RuleDeleteResponse; + export import RuleEditResponse = RulesAPI.RuleEditResponse; export import RuleGetResponse = RulesAPI.RuleGetResponse; - export import RuleReplaceResponse = RulesAPI.RuleReplaceResponse; export import RuleListResponsesV4PagePaginationArray = RulesAPI.RuleListResponsesV4PagePaginationArray; export import RuleCreateParams = RulesAPI.RuleCreateParams; export import RuleUpdateParams = RulesAPI.RuleUpdateParams; export import RuleListParams = RulesAPI.RuleListParams; export import RuleDeleteParams = RulesAPI.RuleDeleteParams; - export import RuleReplaceParams = RulesAPI.RuleReplaceParams; + export import RuleEditParams = RulesAPI.RuleEditParams; export import AccessRules = AccessRulesAPI.AccessRules; export import AccessRuleCreateResponse = AccessRulesAPI.AccessRuleCreateResponse; - export import AccessRuleUpdateResponse = AccessRulesAPI.AccessRuleUpdateResponse; export import AccessRuleListResponse = AccessRulesAPI.AccessRuleListResponse; export import AccessRuleDeleteResponse = AccessRulesAPI.AccessRuleDeleteResponse; + export import AccessRuleEditResponse = AccessRulesAPI.AccessRuleEditResponse; export import AccessRuleGetResponse = AccessRulesAPI.AccessRuleGetResponse; export import AccessRuleListResponsesV4PagePaginationArray = AccessRulesAPI.AccessRuleListResponsesV4PagePaginationArray; export import AccessRuleCreateParams = AccessRulesAPI.AccessRuleCreateParams; - export import AccessRuleUpdateParams = AccessRulesAPI.AccessRuleUpdateParams; export import AccessRuleListParams = AccessRulesAPI.AccessRuleListParams; + export import AccessRuleEditParams = AccessRulesAPI.AccessRuleEditParams; export import UaRules = UaRulesAPI.UaRules; export import UaRuleCreateResponse = UaRulesAPI.UaRuleCreateResponse; + export import UaRuleUpdateResponse = UaRulesAPI.UaRuleUpdateResponse; export import UaRuleListResponse = UaRulesAPI.UaRuleListResponse; export import UaRuleDeleteResponse = UaRulesAPI.UaRuleDeleteResponse; export import UaRuleGetResponse = UaRulesAPI.UaRuleGetResponse; - export import UaRuleReplaceResponse = UaRulesAPI.UaRuleReplaceResponse; export import UaRuleListResponsesV4PagePaginationArray = UaRulesAPI.UaRuleListResponsesV4PagePaginationArray; export import UaRuleCreateParams = UaRulesAPI.UaRuleCreateParams; + export import UaRuleUpdateParams = UaRulesAPI.UaRuleUpdateParams; export import UaRuleListParams = UaRulesAPI.UaRuleListParams; - export import UaRuleReplaceParams = UaRulesAPI.UaRuleReplaceParams; export import WAF = WAFAPI.WAF; } diff --git a/src/resources/firewalls/index.ts b/src/resources/firewalls/index.ts index 4e8d0777e9..26b6cf16f8 100644 --- a/src/resources/firewalls/index.ts +++ b/src/resources/firewalls/index.ts @@ -2,26 +2,26 @@ export { AccessRuleCreateResponse, - AccessRuleUpdateResponse, AccessRuleListResponse, AccessRuleDeleteResponse, + AccessRuleEditResponse, AccessRuleGetResponse, AccessRuleCreateParams, - AccessRuleUpdateParams, AccessRuleListParams, + AccessRuleEditParams, AccessRuleListResponsesV4PagePaginationArray, AccessRules, } from './access-rules'; export { Firewalls } from './firewalls'; export { LockdownCreateResponse, + LockdownUpdateResponse, LockdownListResponse, LockdownDeleteResponse, LockdownGetResponse, - LockdownReplaceResponse, LockdownCreateParams, + LockdownUpdateParams, LockdownListParams, - LockdownReplaceParams, LockdownListResponsesV4PagePaginationArray, Lockdowns, } from './lockdowns'; @@ -30,25 +30,25 @@ export { RuleUpdateResponse, RuleListResponse, RuleDeleteResponse, + RuleEditResponse, RuleGetResponse, - RuleReplaceResponse, RuleCreateParams, RuleUpdateParams, RuleListParams, RuleDeleteParams, - RuleReplaceParams, + RuleEditParams, RuleListResponsesV4PagePaginationArray, Rules, } from './rules'; export { UaRuleCreateResponse, + UaRuleUpdateResponse, UaRuleListResponse, UaRuleDeleteResponse, UaRuleGetResponse, - UaRuleReplaceResponse, UaRuleCreateParams, + UaRuleUpdateParams, UaRuleListParams, - UaRuleReplaceParams, UaRuleListResponsesV4PagePaginationArray, UaRules, } from './ua-rules'; diff --git a/src/resources/firewalls/lockdowns.ts b/src/resources/firewalls/lockdowns.ts index 5dcc2ceaa2..7bfb231f9e 100644 --- a/src/resources/firewalls/lockdowns.ts +++ b/src/resources/firewalls/lockdowns.ts @@ -23,6 +23,23 @@ export class Lockdowns extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Updates an existing Zone Lockdown rule. + */ + update( + zoneIdentifier: string, + id: string, + body: LockdownUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/zones/${zoneIdentifier}/firewall/lockdowns/${id}`, { + body, + ...options, + }) as Core.APIPromise<{ result: LockdownUpdateResponse | null }> + )._thenUnwrap((obj) => obj.result); + } + /** * Fetches Zone Lockdown rules. You can filter the results using several optional * parameters. @@ -80,23 +97,6 @@ export class Lockdowns extends APIResource { }> )._thenUnwrap((obj) => obj.result); } - - /** - * Updates an existing Zone Lockdown rule. - */ - replace( - zoneIdentifier: string, - id: string, - body: LockdownReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put(`/zones/${zoneIdentifier}/firewall/lockdowns/${id}`, { - body, - ...options, - }) as Core.APIPromise<{ result: LockdownReplaceResponse | null }> - )._thenUnwrap((obj) => obj.result); - } } export class LockdownListResponsesV4PagePaginationArray extends V4PagePaginationArray {} @@ -173,7 +173,7 @@ export namespace LockdownCreateResponse { } } -export interface LockdownListResponse { +export interface LockdownUpdateResponse { /** * The unique identifier of the Zone Lockdown rule. */ @@ -185,8 +185,8 @@ export interface LockdownListResponse { * `ip_range` configurations. */ configurations: - | LockdownListResponse.LegacyJhsSchemasIPConfiguration - | LockdownListResponse.LegacyJhsSchemasCidrConfiguration; + | LockdownUpdateResponse.LegacyJhsSchemasIPConfiguration + | LockdownUpdateResponse.LegacyJhsSchemasCidrConfiguration; /** * The timestamp of when the rule was created. @@ -216,7 +216,7 @@ export interface LockdownListResponse { urls: Array; } -export namespace LockdownListResponse { +export namespace LockdownUpdateResponse { export interface LegacyJhsSchemasIPConfiguration { /** * The configuration target. You must set the target to `ip` when specifying an IP @@ -245,14 +245,7 @@ export namespace LockdownListResponse { } } -export interface LockdownDeleteResponse { - /** - * The unique identifier of the Zone Lockdown rule. - */ - id?: string; -} - -export interface LockdownGetResponse { +export interface LockdownListResponse { /** * The unique identifier of the Zone Lockdown rule. */ @@ -264,8 +257,8 @@ export interface LockdownGetResponse { * `ip_range` configurations. */ configurations: - | LockdownGetResponse.LegacyJhsSchemasIPConfiguration - | LockdownGetResponse.LegacyJhsSchemasCidrConfiguration; + | LockdownListResponse.LegacyJhsSchemasIPConfiguration + | LockdownListResponse.LegacyJhsSchemasCidrConfiguration; /** * The timestamp of when the rule was created. @@ -295,7 +288,7 @@ export interface LockdownGetResponse { urls: Array; } -export namespace LockdownGetResponse { +export namespace LockdownListResponse { export interface LegacyJhsSchemasIPConfiguration { /** * The configuration target. You must set the target to `ip` when specifying an IP @@ -324,7 +317,14 @@ export namespace LockdownGetResponse { } } -export interface LockdownReplaceResponse { +export interface LockdownDeleteResponse { + /** + * The unique identifier of the Zone Lockdown rule. + */ + id?: string; +} + +export interface LockdownGetResponse { /** * The unique identifier of the Zone Lockdown rule. */ @@ -336,8 +336,8 @@ export interface LockdownReplaceResponse { * `ip_range` configurations. */ configurations: - | LockdownReplaceResponse.LegacyJhsSchemasIPConfiguration - | LockdownReplaceResponse.LegacyJhsSchemasCidrConfiguration; + | LockdownGetResponse.LegacyJhsSchemasIPConfiguration + | LockdownGetResponse.LegacyJhsSchemasCidrConfiguration; /** * The timestamp of when the rule was created. @@ -367,7 +367,7 @@ export interface LockdownReplaceResponse { urls: Array; } -export namespace LockdownReplaceResponse { +export namespace LockdownGetResponse { export interface LegacyJhsSchemasIPConfiguration { /** * The configuration target. You must set the target to `ip` when specifying an IP @@ -398,6 +398,8 @@ export namespace LockdownReplaceResponse { export type LockdownCreateParams = unknown; +export type LockdownUpdateParams = unknown; + export interface LockdownListParams extends V4PagePaginationArrayParams { /** * A string to search for in the description of existing rules. @@ -437,16 +439,14 @@ export interface LockdownListParams extends V4PagePaginationArrayParams { uri_search?: string; } -export type LockdownReplaceParams = unknown; - export namespace Lockdowns { export import LockdownCreateResponse = LockdownsAPI.LockdownCreateResponse; + export import LockdownUpdateResponse = LockdownsAPI.LockdownUpdateResponse; export import LockdownListResponse = LockdownsAPI.LockdownListResponse; export import LockdownDeleteResponse = LockdownsAPI.LockdownDeleteResponse; export import LockdownGetResponse = LockdownsAPI.LockdownGetResponse; - export import LockdownReplaceResponse = LockdownsAPI.LockdownReplaceResponse; export import LockdownListResponsesV4PagePaginationArray = LockdownsAPI.LockdownListResponsesV4PagePaginationArray; export import LockdownCreateParams = LockdownsAPI.LockdownCreateParams; + export import LockdownUpdateParams = LockdownsAPI.LockdownUpdateParams; export import LockdownListParams = LockdownsAPI.LockdownListParams; - export import LockdownReplaceParams = LockdownsAPI.LockdownReplaceParams; } diff --git a/src/resources/firewalls/rules.ts b/src/resources/firewalls/rules.ts index 875b218a51..e25e0eae81 100644 --- a/src/resources/firewalls/rules.ts +++ b/src/resources/firewalls/rules.ts @@ -23,17 +23,19 @@ export class Rules extends APIResource { } /** - * Updates the priority of existing firewall rules. + * Updates an existing firewall rule. */ update( zoneIdentifier: string, + id: string, body: RuleUpdateParams, options?: Core.RequestOptions, ): Core.APIPromise { return ( - this._client.patch(`/zones/${zoneIdentifier}/firewall/rules`, { body, ...options }) as Core.APIPromise<{ - result: RuleUpdateResponse | null; - }> + this._client.put(`/zones/${zoneIdentifier}/firewall/rules/${id}`, { + body, + ...options, + }) as Core.APIPromise<{ result: RuleUpdateResponse | null }> )._thenUnwrap((obj) => obj.result); } @@ -83,34 +85,32 @@ export class Rules extends APIResource { } /** - * Fetches the details of a firewall rule. + * Updates the priority of existing firewall rules. */ - get( + edit( zoneIdentifier: string, - id: string, + body: RuleEditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( - this._client.get(`/zones/${zoneIdentifier}/firewall/rules/${id}`, options) as Core.APIPromise<{ - result: RuleGetResponse | null; + this._client.patch(`/zones/${zoneIdentifier}/firewall/rules`, { body, ...options }) as Core.APIPromise<{ + result: RuleEditResponse | null; }> )._thenUnwrap((obj) => obj.result); } /** - * Updates an existing firewall rule. + * Fetches the details of a firewall rule. */ - replace( + get( zoneIdentifier: string, id: string, - body: RuleReplaceParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( - this._client.put(`/zones/${zoneIdentifier}/firewall/rules/${id}`, { - body, - ...options, - }) as Core.APIPromise<{ result: RuleReplaceResponse | null }> + this._client.get(`/zones/${zoneIdentifier}/firewall/rules/${id}`, options) as Core.APIPromise<{ + result: RuleGetResponse | null; + }> )._thenUnwrap((obj) => obj.result); } } @@ -202,92 +202,7 @@ export namespace RuleCreateResponse { } } -export type RuleUpdateResponse = Array; - -export namespace RuleUpdateResponse { - export interface RuleUpdateResponseItem { - /** - * The unique identifier of the firewall rule. - */ - id: string; - - /** - * The action to apply to a matched request. The `log` action is only available on - * an Enterprise plan. - */ - action: 'block' | 'challenge' | 'js_challenge' | 'managed_challenge' | 'allow' | 'log' | 'bypass'; - - filter: RuleUpdateResponseItem.LegacyJhsFilter | RuleUpdateResponseItem.LegacyJhsDeletedFilter; - - /** - * When true, indicates that the firewall rule is currently paused. - */ - paused: boolean; - - /** - * An informative summary of the firewall rule. - */ - description?: string; - - /** - * 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. - */ - priority?: number; - - products?: Array<'zoneLockdown' | 'uaBlock' | 'bic' | 'hot' | 'securityLevel' | 'rateLimit' | 'waf'>; - - /** - * A short reference tag. Allows you to select related firewall rules. - */ - ref?: string; - } - - export namespace RuleUpdateResponseItem { - export interface LegacyJhsFilter { - /** - * The unique identifier of the filter. - */ - id?: string; - - /** - * An informative summary of the filter. - */ - description?: string; - - /** - * The filter expression. For more information, refer to - * [Expressions](https://developers.cloudflare.com/ruleset-engine/rules-language/expressions/). - */ - expression?: string; - - /** - * When true, indicates that the filter is currently paused. - */ - paused?: boolean; - - /** - * A short reference tag. Allows you to select related filters. - */ - ref?: string; - } - - export interface LegacyJhsDeletedFilter { - /** - * The unique identifier of the filter. - */ - id: string; - - /** - * When true, indicates that the firewall rule was deleted. - */ - deleted: boolean; - } - } -} - -export interface RuleListResponse { +export interface RuleUpdateResponse { /** * The unique identifier of the firewall rule. */ @@ -299,7 +214,7 @@ export interface RuleListResponse { */ action: 'block' | 'challenge' | 'js_challenge' | 'managed_challenge' | 'allow' | 'log' | 'bypass'; - filter: RuleListResponse.LegacyJhsFilter | RuleListResponse.LegacyJhsDeletedFilter; + filter: RuleUpdateResponse.LegacyJhsFilter | RuleUpdateResponse.LegacyJhsDeletedFilter; /** * When true, indicates that the firewall rule is currently paused. @@ -326,7 +241,7 @@ export interface RuleListResponse { ref?: string; } -export namespace RuleListResponse { +export namespace RuleUpdateResponse { export interface LegacyJhsFilter { /** * The unique identifier of the filter. @@ -368,7 +283,7 @@ export namespace RuleListResponse { } } -export interface RuleDeleteResponse { +export interface RuleListResponse { /** * The unique identifier of the firewall rule. */ @@ -378,19 +293,19 @@ export interface RuleDeleteResponse { * The action to apply to a matched request. The `log` action is only available on * an Enterprise plan. */ - action?: 'block' | 'challenge' | 'js_challenge' | 'managed_challenge' | 'allow' | 'log' | 'bypass'; + action: 'block' | 'challenge' | 'js_challenge' | 'managed_challenge' | 'allow' | 'log' | 'bypass'; + + filter: RuleListResponse.LegacyJhsFilter | RuleListResponse.LegacyJhsDeletedFilter; /** - * An informative summary of the firewall rule. + * When true, indicates that the firewall rule is currently paused. */ - description?: string; - - filter?: RuleDeleteResponse.LegacyJhsFilter | RuleDeleteResponse.LegacyJhsDeletedFilter; + paused: boolean; /** - * When true, indicates that the firewall rule is currently paused. + * An informative summary of the firewall rule. */ - paused?: boolean; + description?: string; /** * The priority of the rule. Optional value used to define the processing order. A @@ -407,7 +322,7 @@ export interface RuleDeleteResponse { ref?: string; } -export namespace RuleDeleteResponse { +export namespace RuleListResponse { export interface LegacyJhsFilter { /** * The unique identifier of the filter. @@ -449,7 +364,7 @@ export namespace RuleDeleteResponse { } } -export interface RuleGetResponse { +export interface RuleDeleteResponse { /** * The unique identifier of the firewall rule. */ @@ -459,19 +374,19 @@ export interface RuleGetResponse { * The action to apply to a matched request. The `log` action is only available on * an Enterprise plan. */ - action: 'block' | 'challenge' | 'js_challenge' | 'managed_challenge' | 'allow' | 'log' | 'bypass'; - - filter: RuleGetResponse.LegacyJhsFilter | RuleGetResponse.LegacyJhsDeletedFilter; + action?: 'block' | 'challenge' | 'js_challenge' | 'managed_challenge' | 'allow' | 'log' | 'bypass'; /** - * When true, indicates that the firewall rule is currently paused. + * An informative summary of the firewall rule. */ - paused: boolean; + description?: string; + + filter?: RuleDeleteResponse.LegacyJhsFilter | RuleDeleteResponse.LegacyJhsDeletedFilter; /** - * An informative summary of the firewall rule. + * When true, indicates that the firewall rule is currently paused. */ - description?: string; + paused?: boolean; /** * The priority of the rule. Optional value used to define the processing order. A @@ -488,7 +403,7 @@ export interface RuleGetResponse { ref?: string; } -export namespace RuleGetResponse { +export namespace RuleDeleteResponse { export interface LegacyJhsFilter { /** * The unique identifier of the filter. @@ -530,7 +445,92 @@ export namespace RuleGetResponse { } } -export interface RuleReplaceResponse { +export type RuleEditResponse = Array; + +export namespace RuleEditResponse { + export interface RuleEditResponseItem { + /** + * The unique identifier of the firewall rule. + */ + id: string; + + /** + * The action to apply to a matched request. The `log` action is only available on + * an Enterprise plan. + */ + action: 'block' | 'challenge' | 'js_challenge' | 'managed_challenge' | 'allow' | 'log' | 'bypass'; + + filter: RuleEditResponseItem.LegacyJhsFilter | RuleEditResponseItem.LegacyJhsDeletedFilter; + + /** + * When true, indicates that the firewall rule is currently paused. + */ + paused: boolean; + + /** + * An informative summary of the firewall rule. + */ + description?: string; + + /** + * 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. + */ + priority?: number; + + products?: Array<'zoneLockdown' | 'uaBlock' | 'bic' | 'hot' | 'securityLevel' | 'rateLimit' | 'waf'>; + + /** + * A short reference tag. Allows you to select related firewall rules. + */ + ref?: string; + } + + export namespace RuleEditResponseItem { + export interface LegacyJhsFilter { + /** + * The unique identifier of the filter. + */ + id?: string; + + /** + * An informative summary of the filter. + */ + description?: string; + + /** + * The filter expression. For more information, refer to + * [Expressions](https://developers.cloudflare.com/ruleset-engine/rules-language/expressions/). + */ + expression?: string; + + /** + * When true, indicates that the filter is currently paused. + */ + paused?: boolean; + + /** + * A short reference tag. Allows you to select related filters. + */ + ref?: string; + } + + export interface LegacyJhsDeletedFilter { + /** + * The unique identifier of the filter. + */ + id: string; + + /** + * When true, indicates that the firewall rule was deleted. + */ + deleted: boolean; + } + } +} + +export interface RuleGetResponse { /** * The unique identifier of the firewall rule. */ @@ -542,7 +542,7 @@ export interface RuleReplaceResponse { */ action: 'block' | 'challenge' | 'js_challenge' | 'managed_challenge' | 'allow' | 'log' | 'bypass'; - filter: RuleReplaceResponse.LegacyJhsFilter | RuleReplaceResponse.LegacyJhsDeletedFilter; + filter: RuleGetResponse.LegacyJhsFilter | RuleGetResponse.LegacyJhsDeletedFilter; /** * When true, indicates that the firewall rule is currently paused. @@ -569,7 +569,7 @@ export interface RuleReplaceResponse { ref?: string; } -export namespace RuleReplaceResponse { +export namespace RuleGetResponse { export interface LegacyJhsFilter { /** * The unique identifier of the filter. @@ -640,19 +640,19 @@ export interface RuleDeleteParams { delete_filter_if_unused?: boolean; } -export type RuleReplaceParams = unknown; +export type RuleEditParams = unknown; export namespace Rules { export import RuleCreateResponse = RulesAPI.RuleCreateResponse; export import RuleUpdateResponse = RulesAPI.RuleUpdateResponse; export import RuleListResponse = RulesAPI.RuleListResponse; export import RuleDeleteResponse = RulesAPI.RuleDeleteResponse; + export import RuleEditResponse = RulesAPI.RuleEditResponse; export import RuleGetResponse = RulesAPI.RuleGetResponse; - export import RuleReplaceResponse = RulesAPI.RuleReplaceResponse; export import RuleListResponsesV4PagePaginationArray = RulesAPI.RuleListResponsesV4PagePaginationArray; export import RuleCreateParams = RulesAPI.RuleCreateParams; export import RuleUpdateParams = RulesAPI.RuleUpdateParams; export import RuleListParams = RulesAPI.RuleListParams; export import RuleDeleteParams = RulesAPI.RuleDeleteParams; - export import RuleReplaceParams = RulesAPI.RuleReplaceParams; + export import RuleEditParams = RulesAPI.RuleEditParams; } diff --git a/src/resources/firewalls/ua-rules.ts b/src/resources/firewalls/ua-rules.ts index 278f79aa5d..ca9ac0a2b2 100644 --- a/src/resources/firewalls/ua-rules.ts +++ b/src/resources/firewalls/ua-rules.ts @@ -23,6 +23,23 @@ export class UaRules extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Updates an existing User Agent Blocking rule. + */ + update( + zoneIdentifier: string, + id: string, + body: UaRuleUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/zones/${zoneIdentifier}/firewall/ua_rules/${id}`, { + body, + ...options, + }) as Core.APIPromise<{ result: UaRuleUpdateResponse | null }> + )._thenUnwrap((obj) => obj.result); + } + /** * Fetches User Agent Blocking rules in a zone. You can filter the results using * several optional parameters. @@ -80,29 +97,14 @@ export class UaRules extends APIResource { }> )._thenUnwrap((obj) => obj.result); } - - /** - * Updates an existing User Agent Blocking rule. - */ - replace( - zoneIdentifier: string, - id: string, - body: UaRuleReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put(`/zones/${zoneIdentifier}/firewall/ua_rules/${id}`, { - body, - ...options, - }) as Core.APIPromise<{ result: UaRuleReplaceResponse | null }> - )._thenUnwrap((obj) => obj.result); - } } export class UaRuleListResponsesV4PagePaginationArray extends V4PagePaginationArray {} export type UaRuleCreateResponse = unknown | string; +export type UaRuleUpdateResponse = unknown | string; + export interface UaRuleListResponse { /** * The unique identifier of the User Agent Blocking rule. @@ -158,10 +160,10 @@ export interface UaRuleDeleteResponse { export type UaRuleGetResponse = unknown | string; -export type UaRuleReplaceResponse = unknown | string; - export type UaRuleCreateParams = unknown; +export type UaRuleUpdateParams = unknown; + export interface UaRuleListParams extends V4PagePaginationArrayParams { /** * A string to search for in the description of existing rules. @@ -179,16 +181,14 @@ export interface UaRuleListParams extends V4PagePaginationArrayParams { ua_search?: string; } -export type UaRuleReplaceParams = unknown; - export namespace UaRules { export import UaRuleCreateResponse = UaRulesAPI.UaRuleCreateResponse; + export import UaRuleUpdateResponse = UaRulesAPI.UaRuleUpdateResponse; export import UaRuleListResponse = UaRulesAPI.UaRuleListResponse; export import UaRuleDeleteResponse = UaRulesAPI.UaRuleDeleteResponse; export import UaRuleGetResponse = UaRulesAPI.UaRuleGetResponse; - export import UaRuleReplaceResponse = UaRulesAPI.UaRuleReplaceResponse; export import UaRuleListResponsesV4PagePaginationArray = UaRulesAPI.UaRuleListResponsesV4PagePaginationArray; export import UaRuleCreateParams = UaRulesAPI.UaRuleCreateParams; + export import UaRuleUpdateParams = UaRulesAPI.UaRuleUpdateParams; export import UaRuleListParams = UaRulesAPI.UaRuleListParams; - export import UaRuleReplaceParams = UaRulesAPI.UaRuleReplaceParams; } diff --git a/src/resources/firewalls/waf/index.ts b/src/resources/firewalls/waf/index.ts index 3a6e78ad57..c3b89ccfb9 100644 --- a/src/resources/firewalls/waf/index.ts +++ b/src/resources/firewalls/waf/index.ts @@ -2,13 +2,13 @@ export { OverrideCreateResponse, + OverrideUpdateResponse, OverrideListResponse, OverrideDeleteResponse, OverrideGetResponse, - OverrideReplaceResponse, OverrideCreateParams, + OverrideUpdateParams, OverrideListParams, - OverrideReplaceParams, OverrideListResponsesV4PagePaginationArray, Overrides, } from './overrides'; diff --git a/src/resources/firewalls/waf/overrides.ts b/src/resources/firewalls/waf/overrides.ts index 912311d946..a7ec0a83fe 100644 --- a/src/resources/firewalls/waf/overrides.ts +++ b/src/resources/firewalls/waf/overrides.ts @@ -26,6 +26,26 @@ export class Overrides extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Updates an existing URI-based WAF override. + * + * **Note:** Applies only to the + * [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/). + */ + update( + zoneIdentifier: string, + id: string, + body: OverrideUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/zones/${zoneIdentifier}/firewall/waf/overrides/${id}`, { + body, + ...options, + }) as Core.APIPromise<{ result: OverrideUpdateResponse | null }> + )._thenUnwrap((obj) => obj.result); + } + /** * Fetches the URI-based WAF overrides in a zone. * @@ -92,26 +112,6 @@ export class Overrides extends APIResource { }> )._thenUnwrap((obj) => obj.result); } - - /** - * Updates an existing URI-based WAF override. - * - * **Note:** Applies only to the - * [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/). - */ - replace( - zoneIdentifier: string, - id: string, - body: OverrideReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put(`/zones/${zoneIdentifier}/firewall/waf/overrides/${id}`, { - body, - ...options, - }) as Core.APIPromise<{ result: OverrideReplaceResponse | null }> - )._thenUnwrap((obj) => obj.result); - } } export class OverrideListResponsesV4PagePaginationArray extends V4PagePaginationArray {} @@ -195,30 +195,11 @@ export namespace OverrideCreateResponse { } } -export interface OverrideListResponse { +export interface OverrideUpdateResponse { /** * The unique identifier of the WAF override. */ - id: string; - - /** - * When true, indicates that the WAF package is currently paused. - */ - paused: boolean; - - /** - * The relative priority of the current URI-based WAF override when multiple - * overrides match a single URL. A lower number indicates higher priority. Higher - * priority overrides may overwrite values set by lower priority overrides. - */ - priority: number; - - /** - * The URLs to include in the current WAF override. You can use wildcards. Each - * entered URL will be escaped before use, which means you can only use simple - * wildcard patterns. - */ - urls: Array; + id?: string; /** * An informative summary of the current URI-based WAF override. @@ -234,11 +215,23 @@ export interface OverrideListResponse { */ groups?: Record; + /** + * When true, indicates that the WAF package is currently paused. + */ + paused?: boolean; + + /** + * The relative priority of the current URI-based WAF override when multiple + * overrides match a single URL. A lower number indicates higher priority. Higher + * priority overrides may overwrite values set by lower priority overrides. + */ + priority?: number; + /** * Specifies that, when a WAF rule matches, its configured action will be replaced * by the action configured in this object. */ - rewrite_action?: OverrideListResponse.RewriteAction; + rewrite_action?: OverrideUpdateResponse.RewriteAction; /** * An object that allows you to override the action of specific WAF rules. Each key @@ -248,9 +241,16 @@ export interface OverrideListResponse { * you must provide a `groups` object or a `rules` object. */ rules?: Record; + + /** + * The URLs to include in the current WAF override. You can use wildcards. Each + * entered URL will be escaped before use, which means you can only use simple + * wildcard patterns. + */ + urls?: Array; } -export namespace OverrideListResponse { +export namespace OverrideUpdateResponse { /** * Specifies that, when a WAF rule matches, its configured action will be replaced * by the action configured in this object. @@ -274,18 +274,30 @@ export namespace OverrideListResponse { } } -export interface OverrideDeleteResponse { +export interface OverrideListResponse { /** * The unique identifier of the WAF override. */ - id?: string; -} + id: string; -export interface OverrideGetResponse { /** - * The unique identifier of the WAF override. + * When true, indicates that the WAF package is currently paused. */ - id?: string; + paused: boolean; + + /** + * The relative priority of the current URI-based WAF override when multiple + * overrides match a single URL. A lower number indicates higher priority. Higher + * priority overrides may overwrite values set by lower priority overrides. + */ + priority: number; + + /** + * The URLs to include in the current WAF override. You can use wildcards. Each + * entered URL will be escaped before use, which means you can only use simple + * wildcard patterns. + */ + urls: Array; /** * An informative summary of the current URI-based WAF override. @@ -301,23 +313,11 @@ export interface OverrideGetResponse { */ groups?: Record; - /** - * When true, indicates that the WAF package is currently paused. - */ - paused?: boolean; - - /** - * The relative priority of the current URI-based WAF override when multiple - * overrides match a single URL. A lower number indicates higher priority. Higher - * priority overrides may overwrite values set by lower priority overrides. - */ - priority?: number; - /** * Specifies that, when a WAF rule matches, its configured action will be replaced * by the action configured in this object. */ - rewrite_action?: OverrideGetResponse.RewriteAction; + rewrite_action?: OverrideListResponse.RewriteAction; /** * An object that allows you to override the action of specific WAF rules. Each key @@ -327,16 +327,9 @@ export interface OverrideGetResponse { * you must provide a `groups` object or a `rules` object. */ rules?: Record; - - /** - * The URLs to include in the current WAF override. You can use wildcards. Each - * entered URL will be escaped before use, which means you can only use simple - * wildcard patterns. - */ - urls?: Array; } -export namespace OverrideGetResponse { +export namespace OverrideListResponse { /** * Specifies that, when a WAF rule matches, its configured action will be replaced * by the action configured in this object. @@ -360,7 +353,14 @@ export namespace OverrideGetResponse { } } -export interface OverrideReplaceResponse { +export interface OverrideDeleteResponse { + /** + * The unique identifier of the WAF override. + */ + id?: string; +} + +export interface OverrideGetResponse { /** * The unique identifier of the WAF override. */ @@ -396,7 +396,7 @@ export interface OverrideReplaceResponse { * Specifies that, when a WAF rule matches, its configured action will be replaced * by the action configured in this object. */ - rewrite_action?: OverrideReplaceResponse.RewriteAction; + rewrite_action?: OverrideGetResponse.RewriteAction; /** * An object that allows you to override the action of specific WAF rules. Each key @@ -415,7 +415,7 @@ export interface OverrideReplaceResponse { urls?: Array; } -export namespace OverrideReplaceResponse { +export namespace OverrideGetResponse { /** * Specifies that, when a WAF rule matches, its configured action will be replaced * by the action configured in this object. @@ -441,18 +441,18 @@ export namespace OverrideReplaceResponse { export type OverrideCreateParams = unknown; -export interface OverrideListParams extends V4PagePaginationArrayParams {} +export type OverrideUpdateParams = unknown; -export type OverrideReplaceParams = unknown; +export interface OverrideListParams extends V4PagePaginationArrayParams {} export namespace Overrides { export import OverrideCreateResponse = OverridesAPI.OverrideCreateResponse; + export import OverrideUpdateResponse = OverridesAPI.OverrideUpdateResponse; export import OverrideListResponse = OverridesAPI.OverrideListResponse; export import OverrideDeleteResponse = OverridesAPI.OverrideDeleteResponse; export import OverrideGetResponse = OverridesAPI.OverrideGetResponse; - export import OverrideReplaceResponse = OverridesAPI.OverrideReplaceResponse; export import OverrideListResponsesV4PagePaginationArray = OverridesAPI.OverrideListResponsesV4PagePaginationArray; export import OverrideCreateParams = OverridesAPI.OverrideCreateParams; + export import OverrideUpdateParams = OverridesAPI.OverrideUpdateParams; export import OverrideListParams = OverridesAPI.OverrideListParams; - export import OverrideReplaceParams = OverridesAPI.OverrideReplaceParams; } diff --git a/src/resources/firewalls/waf/packages/groups.ts b/src/resources/firewalls/waf/packages/groups.ts index f58b43cf82..17da3ddb31 100644 --- a/src/resources/firewalls/waf/packages/groups.ts +++ b/src/resources/firewalls/waf/packages/groups.ts @@ -7,28 +7,6 @@ import * as GroupsAPI from 'cloudflare/resources/firewalls/waf/packages/groups'; import { V4PagePaginationArray, type V4PagePaginationArrayParams } from 'cloudflare/pagination'; export class Groups extends APIResource { - /** - * Updates a WAF rule group. You can update the state (`mode` parameter) of a rule - * group. - * - * **Note:** Applies only to the - * [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/). - */ - update( - zoneId: string, - packageId: string, - groupId: string, - body: GroupUpdateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.patch(`/zones/${zoneId}/firewall/waf/packages/${packageId}/groups/${groupId}`, { - body, - ...options, - }) as Core.APIPromise<{ result: GroupUpdateResponse }> - )._thenUnwrap((obj) => obj.result); - } - /** * Fetches the WAF rule groups in a WAF package. * @@ -62,6 +40,28 @@ export class Groups extends APIResource { ); } + /** + * Updates a WAF rule group. You can update the state (`mode` parameter) of a rule + * group. + * + * **Note:** Applies only to the + * [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/). + */ + edit( + zoneId: string, + packageId: string, + groupId: string, + body: GroupEditParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.patch(`/zones/${zoneId}/firewall/waf/packages/${packageId}/groups/${groupId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: GroupEditResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * Fetches the details of a WAF rule group. * @@ -85,8 +85,6 @@ export class Groups extends APIResource { export class GroupListResponsesV4PagePaginationArray extends V4PagePaginationArray {} -export type GroupUpdateResponse = unknown | Array | string; - export interface GroupListResponse { /** * The unique identifier of the rule group. @@ -131,15 +129,9 @@ export interface GroupListResponse { package_id?: string; } -export type GroupGetResponse = unknown | Array | string; +export type GroupEditResponse = unknown | Array | string; -export interface GroupUpdateParams { - /** - * The state of the rules contained in the rule group. When `on`, the rules in the - * group are configurable/usable. - */ - mode?: 'on' | 'off'; -} +export type GroupGetResponse = unknown | Array | string; export interface GroupListParams extends V4PagePaginationArrayParams { /** @@ -165,11 +157,19 @@ export interface GroupListParams extends V4PagePaginationArrayParams { order?: 'mode' | 'rules_count'; } +export interface GroupEditParams { + /** + * The state of the rules contained in the rule group. When `on`, the rules in the + * group are configurable/usable. + */ + mode?: 'on' | 'off'; +} + export namespace Groups { - export import GroupUpdateResponse = GroupsAPI.GroupUpdateResponse; export import GroupListResponse = GroupsAPI.GroupListResponse; + export import GroupEditResponse = GroupsAPI.GroupEditResponse; export import GroupGetResponse = GroupsAPI.GroupGetResponse; export import GroupListResponsesV4PagePaginationArray = GroupsAPI.GroupListResponsesV4PagePaginationArray; - export import GroupUpdateParams = GroupsAPI.GroupUpdateParams; export import GroupListParams = GroupsAPI.GroupListParams; + export import GroupEditParams = GroupsAPI.GroupEditParams; } diff --git a/src/resources/firewalls/waf/packages/index.ts b/src/resources/firewalls/waf/packages/index.ts index 83638dedc8..1e9b48b084 100644 --- a/src/resources/firewalls/waf/packages/index.ts +++ b/src/resources/firewalls/waf/packages/index.ts @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. export { - GroupUpdateResponse, GroupListResponse, + GroupEditResponse, GroupGetResponse, - GroupUpdateParams, GroupListParams, + GroupEditParams, GroupListResponsesV4PagePaginationArray, Groups, } from './groups'; @@ -17,10 +17,10 @@ export { Packages, } from './packages'; export { - RuleUpdateResponse, + RuleEditResponse, RuleGetResponse, RuleWAFRulesListWAFRulesResponse, - RuleUpdateParams, + RuleEditParams, RuleWAFRulesListWAFRulesParams, Rules, } from './rules'; diff --git a/src/resources/firewalls/waf/packages/packages.ts b/src/resources/firewalls/waf/packages/packages.ts index a7fb7f2dde..d62fd36ced 100644 --- a/src/resources/firewalls/waf/packages/packages.ts +++ b/src/resources/firewalls/waf/packages/packages.ts @@ -267,16 +267,16 @@ export namespace Packages { export import PackageListResponsesV4PagePaginationArray = PackagesAPI.PackageListResponsesV4PagePaginationArray; export import PackageListParams = PackagesAPI.PackageListParams; export import Groups = GroupsAPI.Groups; - export import GroupUpdateResponse = GroupsAPI.GroupUpdateResponse; export import GroupListResponse = GroupsAPI.GroupListResponse; + export import GroupEditResponse = GroupsAPI.GroupEditResponse; export import GroupGetResponse = GroupsAPI.GroupGetResponse; export import GroupListResponsesV4PagePaginationArray = GroupsAPI.GroupListResponsesV4PagePaginationArray; - export import GroupUpdateParams = GroupsAPI.GroupUpdateParams; export import GroupListParams = GroupsAPI.GroupListParams; + export import GroupEditParams = GroupsAPI.GroupEditParams; export import Rules = RulesAPI.Rules; - export import RuleUpdateResponse = RulesAPI.RuleUpdateResponse; + export import RuleEditResponse = RulesAPI.RuleEditResponse; export import RuleGetResponse = RulesAPI.RuleGetResponse; export import RuleWAFRulesListWAFRulesResponse = RulesAPI.RuleWAFRulesListWAFRulesResponse; - export import RuleUpdateParams = RulesAPI.RuleUpdateParams; + export import RuleEditParams = RulesAPI.RuleEditParams; export import RuleWAFRulesListWAFRulesParams = RulesAPI.RuleWAFRulesListWAFRulesParams; } diff --git a/src/resources/firewalls/waf/packages/rules.ts b/src/resources/firewalls/waf/packages/rules.ts index d568b8bc37..523620bcf8 100644 --- a/src/resources/firewalls/waf/packages/rules.ts +++ b/src/resources/firewalls/waf/packages/rules.ts @@ -12,18 +12,18 @@ export class Rules extends APIResource { * **Note:** Applies only to the * [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/). */ - update( + edit( zoneId: string, packageId: string, ruleId: string, - body: RuleUpdateParams, + body: RuleEditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.patch(`/zones/${zoneId}/firewall/waf/packages/${packageId}/rules/${ruleId}`, { body, ...options, - }) as Core.APIPromise<{ result: RuleUpdateResponse }> + }) as Core.APIPromise<{ result: RuleEditResponse }> )._thenUnwrap((obj) => obj.result); } @@ -88,12 +88,12 @@ export class Rules extends APIResource { * configure the total scoring threshold through the 'sensitivity' property of the * WAF package. */ -export type RuleUpdateResponse = - | RuleUpdateResponse.WAFManagedRulesAnomalyRule - | RuleUpdateResponse.WAFManagedRulesTraditionalDenyRule - | RuleUpdateResponse.WAFManagedRulesTraditionalAllowRule; +export type RuleEditResponse = + | RuleEditResponse.WAFManagedRulesAnomalyRule + | RuleEditResponse.WAFManagedRulesTraditionalDenyRule + | RuleEditResponse.WAFManagedRulesTraditionalAllowRule; -export namespace RuleUpdateResponse { +export namespace RuleEditResponse { /** * When triggered, anomaly detection WAF rules contribute to an overall threat * score that will determine if a request is considered malicious. You can @@ -481,7 +481,7 @@ export namespace RuleWAFRulesListWAFRulesResponse { } } -export interface RuleUpdateParams { +export interface RuleEditParams { /** * The mode/action of the rule when triggered. You must use a value from the * `allowed_modes` array of the current rule. @@ -523,9 +523,9 @@ export interface RuleWAFRulesListWAFRulesParams { } export namespace Rules { - export import RuleUpdateResponse = RulesAPI.RuleUpdateResponse; + export import RuleEditResponse = RulesAPI.RuleEditResponse; export import RuleGetResponse = RulesAPI.RuleGetResponse; export import RuleWAFRulesListWAFRulesResponse = RulesAPI.RuleWAFRulesListWAFRulesResponse; - export import RuleUpdateParams = RulesAPI.RuleUpdateParams; + export import RuleEditParams = RulesAPI.RuleEditParams; export import RuleWAFRulesListWAFRulesParams = RulesAPI.RuleWAFRulesListWAFRulesParams; } diff --git a/src/resources/firewalls/waf/waf.ts b/src/resources/firewalls/waf/waf.ts index 0c005974c5..4541cff718 100644 --- a/src/resources/firewalls/waf/waf.ts +++ b/src/resources/firewalls/waf/waf.ts @@ -12,14 +12,14 @@ export class WAF extends APIResource { export namespace WAF { export import Overrides = OverridesAPI.Overrides; export import OverrideCreateResponse = OverridesAPI.OverrideCreateResponse; + export import OverrideUpdateResponse = OverridesAPI.OverrideUpdateResponse; export import OverrideListResponse = OverridesAPI.OverrideListResponse; export import OverrideDeleteResponse = OverridesAPI.OverrideDeleteResponse; export import OverrideGetResponse = OverridesAPI.OverrideGetResponse; - export import OverrideReplaceResponse = OverridesAPI.OverrideReplaceResponse; export import OverrideListResponsesV4PagePaginationArray = OverridesAPI.OverrideListResponsesV4PagePaginationArray; export import OverrideCreateParams = OverridesAPI.OverrideCreateParams; + export import OverrideUpdateParams = OverridesAPI.OverrideUpdateParams; export import OverrideListParams = OverridesAPI.OverrideListParams; - export import OverrideReplaceParams = OverridesAPI.OverrideReplaceParams; export import Packages = PackagesAPI.Packages; export import PackageListResponse = PackagesAPI.PackageListResponse; export import PackageGetResponse = PackagesAPI.PackageGetResponse; diff --git a/src/resources/gateways/audit-ssh-settings.ts b/src/resources/gateways/audit-ssh-settings.ts index 88ccc38c81..3ee086999a 100644 --- a/src/resources/gateways/audit-ssh-settings.ts +++ b/src/resources/gateways/audit-ssh-settings.ts @@ -5,35 +5,35 @@ import { APIResource } from 'cloudflare/resource'; import * as AuditSSHSettingsAPI from 'cloudflare/resources/gateways/audit-ssh-settings'; export class AuditSSHSettings extends APIResource { - /** - * Get all Zero Trust Audit SSH settings for an account. - */ - get(accountId: unknown, options?: Core.RequestOptions): Core.APIPromise { - return ( - this._client.get(`/accounts/${accountId}/gateway/audit_ssh_settings`, options) as Core.APIPromise<{ - result: AuditSSHSettingGetResponse; - }> - )._thenUnwrap((obj) => obj.result); - } - /** * Updates Zero Trust Audit SSH settings. */ - replace( + update( accountId: unknown, - body: AuditSSHSettingReplaceParams, + body: AuditSSHSettingUpdateParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.put(`/accounts/${accountId}/gateway/audit_ssh_settings`, { body, ...options, - }) as Core.APIPromise<{ result: AuditSSHSettingReplaceResponse }> + }) as Core.APIPromise<{ result: AuditSSHSettingUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Get all Zero Trust Audit SSH settings for an account. + */ + get(accountId: unknown, options?: Core.RequestOptions): Core.APIPromise { + return ( + this._client.get(`/accounts/${accountId}/gateway/audit_ssh_settings`, options) as Core.APIPromise<{ + result: AuditSSHSettingGetResponse; + }> )._thenUnwrap((obj) => obj.result); } } -export interface AuditSSHSettingGetResponse { +export interface AuditSSHSettingUpdateResponse { created_at?: string; /** @@ -49,7 +49,7 @@ export interface AuditSSHSettingGetResponse { updated_at?: string; } -export interface AuditSSHSettingReplaceResponse { +export interface AuditSSHSettingGetResponse { created_at?: string; /** @@ -65,7 +65,7 @@ export interface AuditSSHSettingReplaceResponse { updated_at?: string; } -export interface AuditSSHSettingReplaceParams { +export interface AuditSSHSettingUpdateParams { /** * SSH encryption public key */ @@ -78,7 +78,7 @@ export interface AuditSSHSettingReplaceParams { } export namespace AuditSSHSettings { + export import AuditSSHSettingUpdateResponse = AuditSSHSettingsAPI.AuditSSHSettingUpdateResponse; export import AuditSSHSettingGetResponse = AuditSSHSettingsAPI.AuditSSHSettingGetResponse; - export import AuditSSHSettingReplaceResponse = AuditSSHSettingsAPI.AuditSSHSettingReplaceResponse; - export import AuditSSHSettingReplaceParams = AuditSSHSettingsAPI.AuditSSHSettingReplaceParams; + export import AuditSSHSettingUpdateParams = AuditSSHSettingsAPI.AuditSSHSettingUpdateParams; } diff --git a/src/resources/gateways/configurations.ts b/src/resources/gateways/configurations.ts index d3f0373900..8db9cfd497 100644 --- a/src/resources/gateways/configurations.ts +++ b/src/resources/gateways/configurations.ts @@ -5,6 +5,22 @@ import { APIResource } from 'cloudflare/resource'; import * as ConfigurationsAPI from 'cloudflare/resources/gateways/configurations'; export class Configurations extends APIResource { + /** + * Updates the current Zero Trust account configuration. + */ + update( + accountId: unknown, + body: ConfigurationUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/accounts/${accountId}/gateway/configuration`, { + body, + ...options, + }) as Core.APIPromise<{ result: ConfigurationUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * Patches the current Zero Trust account configuration. This endpoint can update a * single subcollection of settings such as `antivirus`, `tls_decrypt`, @@ -12,16 +28,16 @@ export class Configurations extends APIResource { * `custom_certificate`, without updating the entire configuration object. Returns * an error if any collection of settings is not properly configured. */ - update( + edit( accountId: unknown, - body: ConfigurationUpdateParams, + body: ConfigurationEditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.patch(`/accounts/${accountId}/gateway/configuration`, { body, ...options, - }) as Core.APIPromise<{ result: ConfigurationUpdateResponse }> + }) as Core.APIPromise<{ result: ConfigurationEditResponse }> )._thenUnwrap((obj) => obj.result); } @@ -35,22 +51,6 @@ export class Configurations extends APIResource { }> )._thenUnwrap((obj) => obj.result); } - - /** - * Updates the current Zero Trust account configuration. - */ - replace( - accountId: unknown, - body: ConfigurationReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put(`/accounts/${accountId}/gateway/configuration`, { - body, - ...options, - }) as Core.APIPromise<{ result: ConfigurationReplaceResponse }> - )._thenUnwrap((obj) => obj.result); - } } /** @@ -327,18 +327,18 @@ export namespace ConfigurationUpdateResponse { /** * account settings. */ -export interface ConfigurationGetResponse { +export interface ConfigurationEditResponse { created_at?: string; /** * account settings. */ - settings?: ConfigurationGetResponse.Settings; + settings?: ConfigurationEditResponse.Settings; updated_at?: string; } -export namespace ConfigurationGetResponse { +export namespace ConfigurationEditResponse { /** * account settings. */ @@ -598,18 +598,18 @@ export namespace ConfigurationGetResponse { /** * account settings. */ -export interface ConfigurationReplaceResponse { +export interface ConfigurationGetResponse { created_at?: string; /** * account settings. */ - settings?: ConfigurationReplaceResponse.Settings; + settings?: ConfigurationGetResponse.Settings; updated_at?: string; } -export namespace ConfigurationReplaceResponse { +export namespace ConfigurationGetResponse { /** * account settings. */ @@ -1123,14 +1123,14 @@ export namespace ConfigurationUpdateParams { } } -export interface ConfigurationReplaceParams { +export interface ConfigurationEditParams { /** * account settings. */ - settings?: ConfigurationReplaceParams.Settings; + settings?: ConfigurationEditParams.Settings; } -export namespace ConfigurationReplaceParams { +export namespace ConfigurationEditParams { /** * account settings. */ @@ -1382,8 +1382,8 @@ export namespace ConfigurationReplaceParams { export namespace Configurations { export import ConfigurationUpdateResponse = ConfigurationsAPI.ConfigurationUpdateResponse; + export import ConfigurationEditResponse = ConfigurationsAPI.ConfigurationEditResponse; export import ConfigurationGetResponse = ConfigurationsAPI.ConfigurationGetResponse; - export import ConfigurationReplaceResponse = ConfigurationsAPI.ConfigurationReplaceResponse; export import ConfigurationUpdateParams = ConfigurationsAPI.ConfigurationUpdateParams; - export import ConfigurationReplaceParams = ConfigurationsAPI.ConfigurationReplaceParams; + export import ConfigurationEditParams = ConfigurationsAPI.ConfigurationEditParams; } diff --git a/src/resources/gateways/gateways.ts b/src/resources/gateways/gateways.ts index 0c637fc6d8..6450b46e78 100644 --- a/src/resources/gateways/gateways.ts +++ b/src/resources/gateways/gateways.ts @@ -87,53 +87,53 @@ export namespace Gateways { export import GatewayCreateResponse = GatewaysAPI.GatewayCreateResponse; export import GatewayListResponse = GatewaysAPI.GatewayListResponse; export import AuditSSHSettings = AuditSSHSettingsAPI.AuditSSHSettings; + export import AuditSSHSettingUpdateResponse = AuditSSHSettingsAPI.AuditSSHSettingUpdateResponse; export import AuditSSHSettingGetResponse = AuditSSHSettingsAPI.AuditSSHSettingGetResponse; - export import AuditSSHSettingReplaceResponse = AuditSSHSettingsAPI.AuditSSHSettingReplaceResponse; - export import AuditSSHSettingReplaceParams = AuditSSHSettingsAPI.AuditSSHSettingReplaceParams; + export import AuditSSHSettingUpdateParams = AuditSSHSettingsAPI.AuditSSHSettingUpdateParams; export import Categories = CategoriesAPI.Categories; export import CategoryListResponse = CategoriesAPI.CategoryListResponse; export import AppTypes = AppTypesAPI.AppTypes; export import AppTypeListResponse = AppTypesAPI.AppTypeListResponse; export import Configurations = ConfigurationsAPI.Configurations; export import ConfigurationUpdateResponse = ConfigurationsAPI.ConfigurationUpdateResponse; + export import ConfigurationEditResponse = ConfigurationsAPI.ConfigurationEditResponse; export import ConfigurationGetResponse = ConfigurationsAPI.ConfigurationGetResponse; - export import ConfigurationReplaceResponse = ConfigurationsAPI.ConfigurationReplaceResponse; export import ConfigurationUpdateParams = ConfigurationsAPI.ConfigurationUpdateParams; - export import ConfigurationReplaceParams = ConfigurationsAPI.ConfigurationReplaceParams; + export import ConfigurationEditParams = ConfigurationsAPI.ConfigurationEditParams; export import Lists = ListsAPI.Lists; export import ListCreateResponse = ListsAPI.ListCreateResponse; + export import ListUpdateResponse = ListsAPI.ListUpdateResponse; export import ListListResponse = ListsAPI.ListListResponse; export import ListDeleteResponse = ListsAPI.ListDeleteResponse; export import ListGetResponse = ListsAPI.ListGetResponse; - export import ListReplaceResponse = ListsAPI.ListReplaceResponse; export import ListCreateParams = ListsAPI.ListCreateParams; - export import ListReplaceParams = ListsAPI.ListReplaceParams; + export import ListUpdateParams = ListsAPI.ListUpdateParams; export import Locations = LocationsAPI.Locations; export import LocationCreateResponse = LocationsAPI.LocationCreateResponse; + export import LocationUpdateResponse = LocationsAPI.LocationUpdateResponse; export import LocationListResponse = LocationsAPI.LocationListResponse; export import LocationDeleteResponse = LocationsAPI.LocationDeleteResponse; export import LocationGetResponse = LocationsAPI.LocationGetResponse; - export import LocationReplaceResponse = LocationsAPI.LocationReplaceResponse; export import LocationCreateParams = LocationsAPI.LocationCreateParams; - export import LocationReplaceParams = LocationsAPI.LocationReplaceParams; + export import LocationUpdateParams = LocationsAPI.LocationUpdateParams; export import Loggings = LoggingsAPI.Loggings; + export import LoggingUpdateResponse = LoggingsAPI.LoggingUpdateResponse; export import LoggingGetResponse = LoggingsAPI.LoggingGetResponse; - export import LoggingReplaceResponse = LoggingsAPI.LoggingReplaceResponse; - export import LoggingReplaceParams = LoggingsAPI.LoggingReplaceParams; + export import LoggingUpdateParams = LoggingsAPI.LoggingUpdateParams; export import ProxyEndpoints = ProxyEndpointsAPI.ProxyEndpoints; export import ProxyEndpointCreateResponse = ProxyEndpointsAPI.ProxyEndpointCreateResponse; - export import ProxyEndpointUpdateResponse = ProxyEndpointsAPI.ProxyEndpointUpdateResponse; export import ProxyEndpointListResponse = ProxyEndpointsAPI.ProxyEndpointListResponse; export import ProxyEndpointDeleteResponse = ProxyEndpointsAPI.ProxyEndpointDeleteResponse; + export import ProxyEndpointEditResponse = ProxyEndpointsAPI.ProxyEndpointEditResponse; export import ProxyEndpointGetResponse = ProxyEndpointsAPI.ProxyEndpointGetResponse; export import ProxyEndpointCreateParams = ProxyEndpointsAPI.ProxyEndpointCreateParams; - export import ProxyEndpointUpdateParams = ProxyEndpointsAPI.ProxyEndpointUpdateParams; + export import ProxyEndpointEditParams = ProxyEndpointsAPI.ProxyEndpointEditParams; export import Rules = RulesAPI.Rules; export import RuleCreateResponse = RulesAPI.RuleCreateResponse; + export import RuleUpdateResponse = RulesAPI.RuleUpdateResponse; export import RuleListResponse = RulesAPI.RuleListResponse; export import RuleDeleteResponse = RulesAPI.RuleDeleteResponse; export import RuleGetResponse = RulesAPI.RuleGetResponse; - export import RuleReplaceResponse = RulesAPI.RuleReplaceResponse; export import RuleCreateParams = RulesAPI.RuleCreateParams; - export import RuleReplaceParams = RulesAPI.RuleReplaceParams; + export import RuleUpdateParams = RulesAPI.RuleUpdateParams; } diff --git a/src/resources/gateways/index.ts b/src/resources/gateways/index.ts index c9c9f7379d..27c78256ed 100644 --- a/src/resources/gateways/index.ts +++ b/src/resources/gateways/index.ts @@ -2,59 +2,59 @@ export { AppTypeListResponse, AppTypes } from './app-types'; export { + AuditSSHSettingUpdateResponse, AuditSSHSettingGetResponse, - AuditSSHSettingReplaceResponse, - AuditSSHSettingReplaceParams, + AuditSSHSettingUpdateParams, AuditSSHSettings, } from './audit-ssh-settings'; export { CategoryListResponse, Categories } from './categories'; export { ConfigurationUpdateResponse, + ConfigurationEditResponse, ConfigurationGetResponse, - ConfigurationReplaceResponse, ConfigurationUpdateParams, - ConfigurationReplaceParams, + ConfigurationEditParams, Configurations, } from './configurations'; export { GatewayCreateResponse, GatewayListResponse, Gateways } from './gateways'; export { ListCreateResponse, + ListUpdateResponse, ListListResponse, ListDeleteResponse, ListGetResponse, - ListReplaceResponse, ListCreateParams, - ListReplaceParams, + ListUpdateParams, Lists, } from './lists/index'; export { LocationCreateResponse, + LocationUpdateResponse, LocationListResponse, LocationDeleteResponse, LocationGetResponse, - LocationReplaceResponse, LocationCreateParams, - LocationReplaceParams, + LocationUpdateParams, Locations, } from './locations'; -export { LoggingGetResponse, LoggingReplaceResponse, LoggingReplaceParams, Loggings } from './loggings'; +export { LoggingUpdateResponse, LoggingGetResponse, LoggingUpdateParams, Loggings } from './loggings'; export { ProxyEndpointCreateResponse, - ProxyEndpointUpdateResponse, ProxyEndpointListResponse, ProxyEndpointDeleteResponse, + ProxyEndpointEditResponse, ProxyEndpointGetResponse, ProxyEndpointCreateParams, - ProxyEndpointUpdateParams, + ProxyEndpointEditParams, ProxyEndpoints, } from './proxy-endpoints'; export { RuleCreateResponse, + RuleUpdateResponse, RuleListResponse, RuleDeleteResponse, RuleGetResponse, - RuleReplaceResponse, RuleCreateParams, - RuleReplaceParams, + RuleUpdateParams, Rules, } from './rules'; diff --git a/src/resources/gateways/lists/index.ts b/src/resources/gateways/lists/index.ts index a3910bc949..fdad771371 100644 --- a/src/resources/gateways/lists/index.ts +++ b/src/resources/gateways/lists/index.ts @@ -3,11 +3,11 @@ export { ItemListResponse, Items } from './items'; export { ListCreateResponse, + ListUpdateResponse, ListListResponse, ListDeleteResponse, ListGetResponse, - ListReplaceResponse, ListCreateParams, - ListReplaceParams, + ListUpdateParams, Lists, } from './lists'; diff --git a/src/resources/gateways/lists/lists.ts b/src/resources/gateways/lists/lists.ts index 376ad6e1ae..d492587717 100644 --- a/src/resources/gateways/lists/lists.ts +++ b/src/resources/gateways/lists/lists.ts @@ -23,6 +23,23 @@ export class Lists extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Updates a configured Zero Trust list. + */ + update( + accountId: unknown, + listId: string, + body: ListUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/accounts/${accountId}/gateway/lists/${listId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: ListUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * Fetches all Zero Trust lists for an account. */ @@ -59,23 +76,6 @@ export class Lists extends APIResource { }> )._thenUnwrap((obj) => obj.result); } - - /** - * Updates a configured Zero Trust list. - */ - replace( - accountId: unknown, - listId: string, - body: ListReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put(`/accounts/${accountId}/gateway/lists/${listId}`, { - body, - ...options, - }) as Core.APIPromise<{ result: ListReplaceResponse }> - )._thenUnwrap((obj) => obj.result); - } } export interface ListCreateResponse { @@ -120,6 +120,37 @@ export namespace ListCreateResponse { } } +export interface ListUpdateResponse { + /** + * API Resource UUID tag. + */ + id?: string; + + /** + * The number of items in the list. + */ + count?: number; + + created_at?: string; + + /** + * The description of the list. + */ + description?: string; + + /** + * The name of the list. + */ + name?: string; + + /** + * The type of list. + */ + type?: 'SERIAL' | 'URL' | 'DOMAIN' | 'EMAIL' | 'IP'; + + updated_at?: string; +} + export type ListListResponse = Array; export namespace ListListResponse { @@ -188,37 +219,6 @@ export interface ListGetResponse { updated_at?: string; } -export interface ListReplaceResponse { - /** - * API Resource UUID tag. - */ - id?: string; - - /** - * The number of items in the list. - */ - count?: number; - - created_at?: string; - - /** - * The description of the list. - */ - description?: string; - - /** - * The name of the list. - */ - name?: string; - - /** - * The type of list. - */ - type?: 'SERIAL' | 'URL' | 'DOMAIN' | 'EMAIL' | 'IP'; - - updated_at?: string; -} - export interface ListCreateParams { /** * The name of the list. @@ -250,7 +250,7 @@ export namespace ListCreateParams { } } -export interface ListReplaceParams { +export interface ListUpdateParams { /** * The name of the list. */ @@ -264,12 +264,12 @@ export interface ListReplaceParams { export namespace Lists { export import ListCreateResponse = ListsAPI.ListCreateResponse; + export import ListUpdateResponse = ListsAPI.ListUpdateResponse; export import ListListResponse = ListsAPI.ListListResponse; export import ListDeleteResponse = ListsAPI.ListDeleteResponse; export import ListGetResponse = ListsAPI.ListGetResponse; - export import ListReplaceResponse = ListsAPI.ListReplaceResponse; export import ListCreateParams = ListsAPI.ListCreateParams; - export import ListReplaceParams = ListsAPI.ListReplaceParams; + export import ListUpdateParams = ListsAPI.ListUpdateParams; export import Items = ItemsAPI.Items; export import ItemListResponse = ItemsAPI.ItemListResponse; } diff --git a/src/resources/gateways/locations.ts b/src/resources/gateways/locations.ts index 90f2ff81ba..d9f96f56e1 100644 --- a/src/resources/gateways/locations.ts +++ b/src/resources/gateways/locations.ts @@ -20,6 +20,23 @@ export class Locations extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Updates a configured Zero Trust Gateway location. + */ + update( + accountId: unknown, + locationId: unknown, + body: LocationUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/accounts/${accountId}/gateway/locations/${locationId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: LocationUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * Fetches Zero Trust Gateway locations for an account. */ @@ -61,26 +78,59 @@ export class Locations extends APIResource { }> )._thenUnwrap((obj) => obj.result); } +} + +export interface LocationCreateResponse { + id?: unknown; /** - * Updates a configured Zero Trust Gateway location. + * True if the location is the default location. */ - replace( - accountId: unknown, - locationId: unknown, - body: LocationReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put(`/accounts/${accountId}/gateway/locations/${locationId}`, { - body, - ...options, - }) as Core.APIPromise<{ result: LocationReplaceResponse }> - )._thenUnwrap((obj) => obj.result); + client_default?: boolean; + + created_at?: string; + + /** + * The DNS over HTTPS domain to send DNS requests to. This field is auto-generated + * by Gateway. + */ + doh_subdomain?: string; + + /** + * True if the location needs to resolve EDNS queries. + */ + ecs_support?: boolean; + + /** + * IPV6 destination ip assigned to this location. DNS requests sent to this IP will + * counted as the request under this location. This field is auto-generated by + * Gateway. + */ + ip?: string; + + /** + * The name of the location. + */ + name?: string; + + /** + * A list of network ranges that requests from this location would originate from. + */ + networks?: Array; + + updated_at?: string; +} + +export namespace LocationCreateResponse { + export interface Network { + /** + * The IPv4 address or IPv4 CIDR. IPv4 CIDRs are limited to a maximum of /24. + */ + network: string; } } -export interface LocationCreateResponse { +export interface LocationUpdateResponse { id?: unknown; /** @@ -116,12 +166,12 @@ export interface LocationCreateResponse { /** * A list of network ranges that requests from this location would originate from. */ - networks?: Array; + networks?: Array; updated_at?: string; } -export namespace LocationCreateResponse { +export namespace LocationUpdateResponse { export interface Network { /** * The IPv4 address or IPv4 CIDR. IPv4 CIDRs are limited to a maximum of /24. @@ -236,56 +286,6 @@ export namespace LocationGetResponse { } } -export interface LocationReplaceResponse { - id?: unknown; - - /** - * True if the location is the default location. - */ - client_default?: boolean; - - created_at?: string; - - /** - * The DNS over HTTPS domain to send DNS requests to. This field is auto-generated - * by Gateway. - */ - doh_subdomain?: string; - - /** - * True if the location needs to resolve EDNS queries. - */ - ecs_support?: boolean; - - /** - * IPV6 destination ip assigned to this location. DNS requests sent to this IP will - * counted as the request under this location. This field is auto-generated by - * Gateway. - */ - ip?: string; - - /** - * The name of the location. - */ - name?: string; - - /** - * A list of network ranges that requests from this location would originate from. - */ - networks?: Array; - - updated_at?: string; -} - -export namespace LocationReplaceResponse { - export interface Network { - /** - * The IPv4 address or IPv4 CIDR. IPv4 CIDRs are limited to a maximum of /24. - */ - network: string; - } -} - export interface LocationCreateParams { /** * The name of the location. @@ -317,7 +317,7 @@ export namespace LocationCreateParams { } } -export interface LocationReplaceParams { +export interface LocationUpdateParams { /** * The name of the location. */ @@ -336,10 +336,10 @@ export interface LocationReplaceParams { /** * A list of network ranges that requests from this location would originate from. */ - networks?: Array; + networks?: Array; } -export namespace LocationReplaceParams { +export namespace LocationUpdateParams { export interface Network { /** * The IPv4 address or IPv4 CIDR. IPv4 CIDRs are limited to a maximum of /24. @@ -350,10 +350,10 @@ export namespace LocationReplaceParams { export namespace Locations { export import LocationCreateResponse = LocationsAPI.LocationCreateResponse; + export import LocationUpdateResponse = LocationsAPI.LocationUpdateResponse; export import LocationListResponse = LocationsAPI.LocationListResponse; export import LocationDeleteResponse = LocationsAPI.LocationDeleteResponse; export import LocationGetResponse = LocationsAPI.LocationGetResponse; - export import LocationReplaceResponse = LocationsAPI.LocationReplaceResponse; export import LocationCreateParams = LocationsAPI.LocationCreateParams; - export import LocationReplaceParams = LocationsAPI.LocationReplaceParams; + export import LocationUpdateParams = LocationsAPI.LocationUpdateParams; } diff --git a/src/resources/gateways/loggings.ts b/src/resources/gateways/loggings.ts index 3513953974..8decfb48db 100644 --- a/src/resources/gateways/loggings.ts +++ b/src/resources/gateways/loggings.ts @@ -6,33 +6,33 @@ import * as LoggingsAPI from 'cloudflare/resources/gateways/loggings'; export class Loggings extends APIResource { /** - * Fetches the current logging settings for Zero Trust account. + * Updates logging settings for the current Zero Trust account. */ - get(accountId: unknown, options?: Core.RequestOptions): Core.APIPromise { + update( + accountId: unknown, + body: LoggingUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { return ( - this._client.get(`/accounts/${accountId}/gateway/logging`, options) as Core.APIPromise<{ - result: LoggingGetResponse; + this._client.put(`/accounts/${accountId}/gateway/logging`, { body, ...options }) as Core.APIPromise<{ + result: LoggingUpdateResponse; }> )._thenUnwrap((obj) => obj.result); } /** - * Updates logging settings for the current Zero Trust account. + * Fetches the current logging settings for Zero Trust account. */ - replace( - accountId: unknown, - body: LoggingReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { + get(accountId: unknown, options?: Core.RequestOptions): Core.APIPromise { return ( - this._client.put(`/accounts/${accountId}/gateway/logging`, { body, ...options }) as Core.APIPromise<{ - result: LoggingReplaceResponse; + this._client.get(`/accounts/${accountId}/gateway/logging`, options) as Core.APIPromise<{ + result: LoggingGetResponse; }> )._thenUnwrap((obj) => obj.result); } } -export interface LoggingGetResponse { +export interface LoggingUpdateResponse { /** * Redact personally identifiable information from activity logging (PII fields * are: source IP, user email, user ID, device ID, URL, referrer, user agent). @@ -42,10 +42,10 @@ export interface LoggingGetResponse { /** * Logging settings by rule type. */ - settings_by_rule_type?: LoggingGetResponse.SettingsByRuleType; + settings_by_rule_type?: LoggingUpdateResponse.SettingsByRuleType; } -export namespace LoggingGetResponse { +export namespace LoggingUpdateResponse { /** * Logging settings by rule type. */ @@ -67,7 +67,7 @@ export namespace LoggingGetResponse { } } -export interface LoggingReplaceResponse { +export interface LoggingGetResponse { /** * Redact personally identifiable information from activity logging (PII fields * are: source IP, user email, user ID, device ID, URL, referrer, user agent). @@ -77,10 +77,10 @@ export interface LoggingReplaceResponse { /** * Logging settings by rule type. */ - settings_by_rule_type?: LoggingReplaceResponse.SettingsByRuleType; + settings_by_rule_type?: LoggingGetResponse.SettingsByRuleType; } -export namespace LoggingReplaceResponse { +export namespace LoggingGetResponse { /** * Logging settings by rule type. */ @@ -102,7 +102,7 @@ export namespace LoggingReplaceResponse { } } -export interface LoggingReplaceParams { +export interface LoggingUpdateParams { /** * Redact personally identifiable information from activity logging (PII fields * are: source IP, user email, user ID, device ID, URL, referrer, user agent). @@ -112,10 +112,10 @@ export interface LoggingReplaceParams { /** * Logging settings by rule type. */ - settings_by_rule_type?: LoggingReplaceParams.SettingsByRuleType; + settings_by_rule_type?: LoggingUpdateParams.SettingsByRuleType; } -export namespace LoggingReplaceParams { +export namespace LoggingUpdateParams { /** * Logging settings by rule type. */ @@ -138,7 +138,7 @@ export namespace LoggingReplaceParams { } export namespace Loggings { + export import LoggingUpdateResponse = LoggingsAPI.LoggingUpdateResponse; export import LoggingGetResponse = LoggingsAPI.LoggingGetResponse; - export import LoggingReplaceResponse = LoggingsAPI.LoggingReplaceResponse; - export import LoggingReplaceParams = LoggingsAPI.LoggingReplaceParams; + export import LoggingUpdateParams = LoggingsAPI.LoggingUpdateParams; } diff --git a/src/resources/gateways/proxy-endpoints.ts b/src/resources/gateways/proxy-endpoints.ts index 3a733286bd..e528e18ad4 100644 --- a/src/resources/gateways/proxy-endpoints.ts +++ b/src/resources/gateways/proxy-endpoints.ts @@ -21,23 +21,6 @@ export class ProxyEndpoints extends APIResource { )._thenUnwrap((obj) => obj.result); } - /** - * Updates a configured Zero Trust Gateway proxy endpoint. - */ - update( - accountId: unknown, - proxyEndpointId: unknown, - body: ProxyEndpointUpdateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.patch(`/accounts/${accountId}/gateway/proxy_endpoints/${proxyEndpointId}`, { - body, - ...options, - }) as Core.APIPromise<{ result: ProxyEndpointUpdateResponse }> - )._thenUnwrap((obj) => obj.result); - } - /** * Fetches a single Zero Trust Gateway proxy endpoint. */ @@ -65,6 +48,23 @@ export class ProxyEndpoints extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Updates a configured Zero Trust Gateway proxy endpoint. + */ + edit( + accountId: unknown, + proxyEndpointId: unknown, + body: ProxyEndpointEditParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.patch(`/accounts/${accountId}/gateway/proxy_endpoints/${proxyEndpointId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: ProxyEndpointEditResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * Fetches all Zero Trust Gateway proxy endpoints for an account. */ @@ -105,29 +105,6 @@ export interface ProxyEndpointCreateResponse { updated_at?: string; } -export interface ProxyEndpointUpdateResponse { - id?: unknown; - - created_at?: string; - - /** - * A list of CIDRs to restrict ingress connections. - */ - ips?: Array; - - /** - * The name of the proxy endpoint. - */ - name?: string; - - /** - * The subdomain to be used as the destination in the proxy client. - */ - subdomain?: string; - - updated_at?: string; -} - export type ProxyEndpointListResponse = Array; export namespace ProxyEndpointListResponse { @@ -157,6 +134,29 @@ export namespace ProxyEndpointListResponse { export type ProxyEndpointDeleteResponse = unknown | string; +export interface ProxyEndpointEditResponse { + id?: unknown; + + created_at?: string; + + /** + * A list of CIDRs to restrict ingress connections. + */ + ips?: Array; + + /** + * The name of the proxy endpoint. + */ + name?: string; + + /** + * The subdomain to be used as the destination in the proxy client. + */ + subdomain?: string; + + updated_at?: string; +} + export interface ProxyEndpointGetResponse { id?: unknown; @@ -197,7 +197,7 @@ export interface ProxyEndpointCreateParams { subdomain?: string; } -export interface ProxyEndpointUpdateParams { +export interface ProxyEndpointEditParams { /** * A list of CIDRs to restrict ingress connections. */ @@ -216,10 +216,10 @@ export interface ProxyEndpointUpdateParams { export namespace ProxyEndpoints { export import ProxyEndpointCreateResponse = ProxyEndpointsAPI.ProxyEndpointCreateResponse; - export import ProxyEndpointUpdateResponse = ProxyEndpointsAPI.ProxyEndpointUpdateResponse; export import ProxyEndpointListResponse = ProxyEndpointsAPI.ProxyEndpointListResponse; export import ProxyEndpointDeleteResponse = ProxyEndpointsAPI.ProxyEndpointDeleteResponse; + export import ProxyEndpointEditResponse = ProxyEndpointsAPI.ProxyEndpointEditResponse; export import ProxyEndpointGetResponse = ProxyEndpointsAPI.ProxyEndpointGetResponse; export import ProxyEndpointCreateParams = ProxyEndpointsAPI.ProxyEndpointCreateParams; - export import ProxyEndpointUpdateParams = ProxyEndpointsAPI.ProxyEndpointUpdateParams; + export import ProxyEndpointEditParams = ProxyEndpointsAPI.ProxyEndpointEditParams; } diff --git a/src/resources/gateways/rules.ts b/src/resources/gateways/rules.ts index 3ac72d7625..5892e2f07f 100644 --- a/src/resources/gateways/rules.ts +++ b/src/resources/gateways/rules.ts @@ -20,6 +20,23 @@ export class Rules extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Updates a configured Zero Trust Gateway rule. + */ + update( + accountId: unknown, + ruleId: string, + body: RuleUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/accounts/${accountId}/gateway/rules/${ruleId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: RuleUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * Fetches the Zero Trust Gateway rules for an account. */ @@ -56,23 +73,6 @@ export class Rules extends APIResource { }> )._thenUnwrap((obj) => obj.result); } - - /** - * Updates a configured Zero Trust Gateway rule. - */ - replace( - accountId: unknown, - ruleId: string, - body: RuleReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put(`/accounts/${accountId}/gateway/rules/${ruleId}`, { - body, - ...options, - }) as Core.APIPromise<{ result: RuleReplaceResponse }> - )._thenUnwrap((obj) => obj.result); - } } export interface RuleCreateResponse { @@ -548,959 +548,959 @@ export namespace RuleCreateResponse { } } -export type RuleListResponse = Array; +export interface RuleUpdateResponse { + /** + * The API resource UUID. + */ + id?: string; -export namespace RuleListResponse { - export interface RuleListResponseItem { + /** + * The action to preform when the associated traffic, identity, and device posture + * expressions are either absent or evaluate to `true`. + */ + action?: + | 'on' + | 'off' + | 'allow' + | 'block' + | 'scan' + | 'noscan' + | 'safesearch' + | 'ytrestricted' + | 'isolate' + | 'noisolate' + | 'override' + | 'l4_override' + | 'egress' + | 'audit_ssh'; + + created_at?: string; + + /** + * Date of deletion, if any. + */ + deleted_at?: string | null; + + /** + * The description of the rule. + */ + description?: string; + + /** + * The wirefilter expression used for device posture check matching. + */ + device_posture?: string; + + /** + * True if the rule is enabled. + */ + enabled?: boolean; + + /** + * The protocol or layer to evaluate the traffic, identity, and device posture + * expressions. + */ + filters?: Array<'http' | 'dns' | 'l4' | 'egress'>; + + /** + * The wirefilter expression used for identity matching. + */ + identity?: string; + + /** + * The name of the rule. + */ + name?: string; + + /** + * 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. + */ + precedence?: number; + + /** + * Additional settings that modify the rule's action. + */ + rule_settings?: RuleUpdateResponse.RuleSettings; + + /** + * The schedule for activating DNS policies. This does not apply to HTTP or network + * policies. + */ + schedule?: RuleUpdateResponse.Schedule; + + /** + * The wirefilter expression used for traffic matching. + */ + traffic?: string; + + updated_at?: string; +} + +export namespace RuleUpdateResponse { + /** + * Additional settings that modify the rule's action. + */ + export interface RuleSettings { /** - * The API resource UUID. + * Add custom headers to allowed requests, in the form of key-value pairs. Keys are + * header names, pointing to an array with its header value(s). */ - id?: string; + add_headers?: unknown; /** - * The action to preform when the associated traffic, identity, and device posture - * expressions are either absent or evaluate to `true`. + * Set by parent MSP accounts to enable their children to bypass this rule. */ - action?: - | 'on' - | 'off' - | 'allow' - | 'block' - | 'scan' - | 'noscan' - | 'safesearch' - | 'ytrestricted' - | 'isolate' - | 'noisolate' - | 'override' - | 'l4_override' - | 'egress' - | 'audit_ssh'; + allow_child_bypass?: boolean; - created_at?: string; + /** + * Settings for the Audit SSH action. + */ + audit_ssh?: RuleSettings.AuditSSH; /** - * Date of deletion, if any. + * Configure how browser isolation behaves. */ - deleted_at?: string | null; + biso_admin_controls?: RuleSettings.BisoAdminControls; /** - * The description of the rule. + * Enable the custom block page. */ - description?: string; + block_page_enabled?: boolean; /** - * The wirefilter expression used for device posture check matching. + * The text describing why this block occurred, displayed on the custom block page + * (if enabled). */ - device_posture?: string; + block_reason?: string; /** - * True if the rule is enabled. + * Set by children MSP accounts to bypass their parent's rules. */ - enabled?: boolean; + bypass_parent_rule?: boolean; /** - * The protocol or layer to evaluate the traffic, identity, and device posture - * expressions. + * Configure how session check behaves. */ - filters?: Array<'http' | 'dns' | 'l4' | 'egress'>; + check_session?: RuleSettings.CheckSession; /** - * The wirefilter expression used for identity matching. + * Add your own custom resolvers to route queries that match the resolver policy. + * Cannot be used when resolve_dns_through_cloudflare is set. DNS queries will + * route to the address closest to their origin. */ - identity?: string; + dns_resolvers?: RuleSettings.DNSResolvers; /** - * The name of the rule. + * Configure how Gateway Proxy traffic egresses. You can enable this setting for + * rules with Egress actions and filters, or omit it to indicate local egress via + * WARP IPs. */ - name?: string; + egress?: RuleSettings.Egress; /** - * 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. + * INSECURE - disable DNSSEC validation (for Allow actions). */ - precedence?: number; + insecure_disable_dnssec_validation?: boolean; /** - * Additional settings that modify the rule's action. + * Set to true to enable IPs in DNS resolver category blocks. By default categories + * only block based on domain names. */ - rule_settings?: RuleListResponseItem.RuleSettings; + ip_categories?: boolean; /** - * The schedule for activating DNS policies. This does not apply to HTTP or network - * policies. + * Set to true to include IPs in DNS resolver indicator feed blocks. By default + * indicator feeds only block based on domain names. */ - schedule?: RuleListResponseItem.Schedule; + ip_indicator_feeds?: boolean; /** - * The wirefilter expression used for traffic matching. + * Send matching traffic to the supplied destination IP address and port. */ - traffic?: string; + l4override?: RuleSettings.L4override; - updated_at?: string; + /** + * Configure a notification to display on the user's device when this rule is + * matched. + */ + notification_settings?: RuleSettings.NotificationSettings; + + /** + * Override matching DNS queries with a hostname. + */ + override_host?: string; + + /** + * Override matching DNS queries with an IP or set of IPs. + */ + override_ips?: Array; + + /** + * Configure DLP payload logging. + */ + payload_log?: RuleSettings.PayloadLog; + + /** + * Enable to send queries that match the policy to Cloudflare's default 1.1.1.1 DNS + * resolver. Cannot be set when dns_resolvers are specified. + */ + resolve_dns_through_cloudflare?: boolean; + + /** + * Configure behavior when an upstream cert is invalid or an SSL error occurs. + */ + untrusted_cert?: RuleSettings.UntrustedCert; } - export namespace RuleListResponseItem { + export namespace RuleSettings { /** - * Additional settings that modify the rule's action. + * Settings for the Audit SSH action. */ - export interface RuleSettings { + export interface AuditSSH { /** - * Add custom headers to allowed requests, in the form of key-value pairs. Keys are - * header names, pointing to an array with its header value(s). + * Enable to turn on SSH command logging. */ - add_headers?: unknown; + command_logging?: boolean; + } + /** + * Configure how browser isolation behaves. + */ + export interface BisoAdminControls { /** - * Set by parent MSP accounts to enable their children to bypass this rule. + * Set to true to enable copy-pasting. */ - allow_child_bypass?: boolean; + dcp?: boolean; /** - * Settings for the Audit SSH action. + * Set to true to enable downloading. */ - audit_ssh?: RuleSettings.AuditSSH; + dd?: boolean; /** - * Configure how browser isolation behaves. + * Set to true to enable keyboard usage. */ - biso_admin_controls?: RuleSettings.BisoAdminControls; + dk?: boolean; /** - * Enable the custom block page. + * Set to true to enable printing. */ - block_page_enabled?: boolean; + dp?: boolean; /** - * The text describing why this block occurred, displayed on the custom block page - * (if enabled). + * Set to true to enable uploading. */ - block_reason?: string; + du?: boolean; + } + /** + * Configure how session check behaves. + */ + export interface CheckSession { /** - * Set by children MSP accounts to bypass their parent's rules. + * Configure how fresh the session needs to be to be considered valid. */ - bypass_parent_rule?: boolean; + duration?: string; /** - * Configure how session check behaves. + * Set to true to enable session enforcement. */ - check_session?: RuleSettings.CheckSession; + enforce?: boolean; + } - /** - * Add your own custom resolvers to route queries that match the resolver policy. - * Cannot be used when resolve_dns_through_cloudflare is set. DNS queries will - * route to the address closest to their origin. - */ - dns_resolvers?: RuleSettings.DNSResolvers; + /** + * Add your own custom resolvers to route queries that match the resolver policy. + * Cannot be used when resolve_dns_through_cloudflare is set. DNS queries will + * route to the address closest to their origin. + */ + export interface DNSResolvers { + ipv4?: Array; - /** - * Configure how Gateway Proxy traffic egresses. You can enable this setting for - * rules with Egress actions and filters, or omit it to indicate local egress via - * WARP IPs. - */ - egress?: RuleSettings.Egress; + ipv6?: Array; + } - /** - * INSECURE - disable DNSSEC validation (for Allow actions). - */ - insecure_disable_dnssec_validation?: boolean; + export namespace DNSResolvers { + export interface IPV4 { + /** + * IP address of upstream resolver. + */ + ip: string; - /** - * Set to true to enable IPs in DNS resolver category blocks. By default categories - * only block based on domain names. - */ - ip_categories?: boolean; + /** + * A port number to use for upstream resolver. + */ + port?: number; + + /** + * Whether to connect to this resolver over a private network. Must be set when + * vnet_id is set. + */ + route_through_private_network?: boolean; + + /** + * Optionally specify a virtual network for this resolver. Uses default virtual + * network id if omitted. + */ + vnet_id?: string; + } + + export interface IPV6 { + /** + * IP address of upstream resolver. + */ + ip: string; + + /** + * A port number to use for upstream resolver. + */ + port?: number; + + /** + * Whether to connect to this resolver over a private network. Must be set when + * vnet_id is set. + */ + route_through_private_network?: boolean; + + /** + * Optionally specify a virtual network for this resolver. Uses default virtual + * network id if omitted. + */ + vnet_id?: string; + } + } + /** + * Configure how Gateway Proxy traffic egresses. You can enable this setting for + * rules with Egress actions and filters, or omit it to indicate local egress via + * WARP IPs. + */ + export interface Egress { /** - * Set to true to include IPs in DNS resolver indicator feed blocks. By default - * indicator feeds only block based on domain names. + * The IPv4 address to be used for egress. */ - ip_indicator_feeds?: boolean; + ipv4?: string; /** - * Send matching traffic to the supplied destination IP address and port. + * The fallback IPv4 address to be used for egress in the event of an error + * egressing with the primary IPv4. Can be '0.0.0.0' to indicate local egress via + * WARP IPs. */ - l4override?: RuleSettings.L4override; + ipv4_fallback?: string; /** - * Configure a notification to display on the user's device when this rule is - * matched. + * The IPv6 range to be used for egress. */ - notification_settings?: RuleSettings.NotificationSettings; + ipv6?: string; + } + /** + * Send matching traffic to the supplied destination IP address and port. + */ + export interface L4override { /** - * Override matching DNS queries with a hostname. + * IPv4 or IPv6 address. */ - override_host?: string; + ip?: string; /** - * Override matching DNS queries with an IP or set of IPs. + * A port number to use for TCP/UDP overrides. */ - override_ips?: Array; + port?: number; + } + /** + * Configure a notification to display on the user's device when this rule is + * matched. + */ + export interface NotificationSettings { /** - * Configure DLP payload logging. + * Set notification on */ - payload_log?: RuleSettings.PayloadLog; + enabled?: boolean; /** - * Enable to send queries that match the policy to Cloudflare's default 1.1.1.1 DNS - * resolver. Cannot be set when dns_resolvers are specified. + * Customize the message shown in the notification. */ - resolve_dns_through_cloudflare?: boolean; + msg?: string; /** - * Configure behavior when an upstream cert is invalid or an SSL error occurs. + * Optional URL to direct users to additional information. If not set, the + * notification will open a block page. */ - untrusted_cert?: RuleSettings.UntrustedCert; + support_url?: string; } - export namespace RuleSettings { + /** + * Configure DLP payload logging. + */ + export interface PayloadLog { /** - * Settings for the Audit SSH action. + * Set to true to enable DLP payload logging for this rule. */ - export interface AuditSSH { - /** - * Enable to turn on SSH command logging. - */ - command_logging?: boolean; - } + enabled?: boolean; + } + /** + * Configure behavior when an upstream cert is invalid or an SSL error occurs. + */ + export interface UntrustedCert { /** - * Configure how browser isolation behaves. + * The action performed when an untrusted certificate is seen. The default action + * is an error with HTTP code 526. */ - export interface BisoAdminControls { - /** - * Set to true to enable copy-pasting. - */ - dcp?: boolean; + action?: 'pass_through' | 'block' | 'error'; + } + } - /** - * Set to true to enable downloading. - */ - dd?: boolean; + /** + * The schedule for activating DNS policies. This does not apply to HTTP or network + * policies. + */ + export interface Schedule { + /** + * The time intervals when the rule will be active on Fridays, in increasing order + * from 00:00-24:00. If this parameter is omitted, the rule will be deactivated on + * Fridays. + */ + fri?: string; - /** - * Set to true to enable keyboard usage. - */ - dk?: boolean; + /** + * The time intervals when the rule will be active on Mondays, in increasing order + * from 00:00-24:00. If this parameter is omitted, the rule will be deactivated on + * Mondays. + */ + mon?: string; - /** - * Set to true to enable printing. - */ - dp?: boolean; + /** + * The time intervals when the rule will be active on Saturdays, in increasing + * order from 00:00-24:00. If this parameter is omitted, the rule will be + * deactivated on Saturdays. + */ + sat?: string; - /** - * Set to true to enable uploading. - */ - du?: boolean; - } + /** + * The time intervals when the rule will be active on Sundays, in increasing order + * from 00:00-24:00. If this parameter is omitted, the rule will be deactivated on + * Sundays. + */ + sun?: string; - /** - * Configure how session check behaves. - */ - export interface CheckSession { - /** - * Configure how fresh the session needs to be to be considered valid. - */ - duration?: string; + /** + * The time intervals when the rule will be active on Thursdays, in increasing + * order from 00:00-24:00. If this parameter is omitted, the rule will be + * deactivated on Thursdays. + */ + thu?: string; - /** - * Set to true to enable session enforcement. - */ - enforce?: boolean; - } - - /** - * Add your own custom resolvers to route queries that match the resolver policy. - * Cannot be used when resolve_dns_through_cloudflare is set. DNS queries will - * route to the address closest to their origin. - */ - export interface DNSResolvers { - ipv4?: Array; - - ipv6?: Array; - } - - export namespace DNSResolvers { - export interface IPV4 { - /** - * IP address of upstream resolver. - */ - ip: string; - - /** - * A port number to use for upstream resolver. - */ - port?: number; - - /** - * Whether to connect to this resolver over a private network. Must be set when - * vnet_id is set. - */ - route_through_private_network?: boolean; - - /** - * Optionally specify a virtual network for this resolver. Uses default virtual - * network id if omitted. - */ - vnet_id?: string; - } - - export interface IPV6 { - /** - * IP address of upstream resolver. - */ - ip: string; - - /** - * A port number to use for upstream resolver. - */ - port?: number; - - /** - * Whether to connect to this resolver over a private network. Must be set when - * vnet_id is set. - */ - route_through_private_network?: boolean; - - /** - * Optionally specify a virtual network for this resolver. Uses default virtual - * network id if omitted. - */ - vnet_id?: string; - } - } - - /** - * Configure how Gateway Proxy traffic egresses. You can enable this setting for - * rules with Egress actions and filters, or omit it to indicate local egress via - * WARP IPs. - */ - export interface Egress { - /** - * The IPv4 address to be used for egress. - */ - ipv4?: string; - - /** - * The fallback IPv4 address to be used for egress in the event of an error - * egressing with the primary IPv4. Can be '0.0.0.0' to indicate local egress via - * WARP IPs. - */ - ipv4_fallback?: string; - - /** - * The IPv6 range to be used for egress. - */ - ipv6?: string; - } - - /** - * Send matching traffic to the supplied destination IP address and port. - */ - export interface L4override { - /** - * IPv4 or IPv6 address. - */ - ip?: string; - - /** - * A port number to use for TCP/UDP overrides. - */ - port?: number; - } - - /** - * Configure a notification to display on the user's device when this rule is - * matched. - */ - export interface NotificationSettings { - /** - * Set notification on - */ - enabled?: boolean; - - /** - * Customize the message shown in the notification. - */ - msg?: string; - - /** - * Optional URL to direct users to additional information. If not set, the - * notification will open a block page. - */ - support_url?: string; - } - - /** - * Configure DLP payload logging. - */ - export interface PayloadLog { - /** - * Set to true to enable DLP payload logging for this rule. - */ - enabled?: boolean; - } - - /** - * Configure behavior when an upstream cert is invalid or an SSL error occurs. - */ - export interface UntrustedCert { - /** - * The action performed when an untrusted certificate is seen. The default action - * is an error with HTTP code 526. - */ - action?: 'pass_through' | 'block' | 'error'; - } - } - - /** - * The schedule for activating DNS policies. This does not apply to HTTP or network - * policies. - */ - export interface Schedule { - /** - * The time intervals when the rule will be active on Fridays, in increasing order - * from 00:00-24:00. If this parameter is omitted, the rule will be deactivated on - * Fridays. - */ - fri?: string; - - /** - * The time intervals when the rule will be active on Mondays, in increasing order - * from 00:00-24:00. If this parameter is omitted, the rule will be deactivated on - * Mondays. - */ - mon?: string; - - /** - * The time intervals when the rule will be active on Saturdays, in increasing - * order from 00:00-24:00. If this parameter is omitted, the rule will be - * deactivated on Saturdays. - */ - sat?: string; - - /** - * The time intervals when the rule will be active on Sundays, in increasing order - * from 00:00-24:00. If this parameter is omitted, the rule will be deactivated on - * Sundays. - */ - sun?: string; - - /** - * The time intervals when the rule will be active on Thursdays, in increasing - * order from 00:00-24:00. If this parameter is omitted, the rule will be - * deactivated on Thursdays. - */ - thu?: string; - - /** - * The time zone the rule will be evaluated against. If a - * [valid time zone city name](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List) - * is provided, Gateway will always use the current time at that time zone. If this - * parameter is omitted, then Gateway will use the time zone inferred from the - * user's source IP to evaluate the rule. If Gateway cannot determine the time zone - * from the IP, we will fall back to the time zone of the user's connected data - * center. - */ - time_zone?: string; - - /** - * The time intervals when the rule will be active on Tuesdays, in increasing order - * from 00:00-24:00. If this parameter is omitted, the rule will be deactivated on - * Tuesdays. - */ - tue?: string; - - /** - * The time intervals when the rule will be active on Wednesdays, in increasing - * order from 00:00-24:00. If this parameter is omitted, the rule will be - * deactivated on Wednesdays. - */ - wed?: string; - } - } -} - -export type RuleDeleteResponse = unknown | string; - -export interface RuleGetResponse { - /** - * The API resource UUID. - */ - id?: string; - - /** - * The action to preform when the associated traffic, identity, and device posture - * expressions are either absent or evaluate to `true`. - */ - action?: - | 'on' - | 'off' - | 'allow' - | 'block' - | 'scan' - | 'noscan' - | 'safesearch' - | 'ytrestricted' - | 'isolate' - | 'noisolate' - | 'override' - | 'l4_override' - | 'egress' - | 'audit_ssh'; - - created_at?: string; - - /** - * Date of deletion, if any. - */ - deleted_at?: string | null; - - /** - * The description of the rule. - */ - description?: string; - - /** - * The wirefilter expression used for device posture check matching. - */ - device_posture?: string; - - /** - * True if the rule is enabled. - */ - enabled?: boolean; - - /** - * The protocol or layer to evaluate the traffic, identity, and device posture - * expressions. - */ - filters?: Array<'http' | 'dns' | 'l4' | 'egress'>; - - /** - * The wirefilter expression used for identity matching. - */ - identity?: string; - - /** - * The name of the rule. - */ - name?: string; - - /** - * 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. - */ - precedence?: number; - - /** - * Additional settings that modify the rule's action. - */ - rule_settings?: RuleGetResponse.RuleSettings; - - /** - * The schedule for activating DNS policies. This does not apply to HTTP or network - * policies. - */ - schedule?: RuleGetResponse.Schedule; - - /** - * The wirefilter expression used for traffic matching. - */ - traffic?: string; - - updated_at?: string; -} - -export namespace RuleGetResponse { - /** - * Additional settings that modify the rule's action. - */ - export interface RuleSettings { /** - * Add custom headers to allowed requests, in the form of key-value pairs. Keys are - * header names, pointing to an array with its header value(s). - */ - add_headers?: unknown; - - /** - * Set by parent MSP accounts to enable their children to bypass this rule. - */ - allow_child_bypass?: boolean; - - /** - * Settings for the Audit SSH action. + * The time zone the rule will be evaluated against. If a + * [valid time zone city name](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List) + * is provided, Gateway will always use the current time at that time zone. If this + * parameter is omitted, then Gateway will use the time zone inferred from the + * user's source IP to evaluate the rule. If Gateway cannot determine the time zone + * from the IP, we will fall back to the time zone of the user's connected data + * center. */ - audit_ssh?: RuleSettings.AuditSSH; + time_zone?: string; /** - * Configure how browser isolation behaves. + * The time intervals when the rule will be active on Tuesdays, in increasing order + * from 00:00-24:00. If this parameter is omitted, the rule will be deactivated on + * Tuesdays. */ - biso_admin_controls?: RuleSettings.BisoAdminControls; + tue?: string; /** - * Enable the custom block page. + * The time intervals when the rule will be active on Wednesdays, in increasing + * order from 00:00-24:00. If this parameter is omitted, the rule will be + * deactivated on Wednesdays. */ - block_page_enabled?: boolean; + wed?: string; + } +} - /** - * The text describing why this block occurred, displayed on the custom block page - * (if enabled). - */ - block_reason?: string; +export type RuleListResponse = Array; +export namespace RuleListResponse { + export interface RuleListResponseItem { /** - * Set by children MSP accounts to bypass their parent's rules. + * The API resource UUID. */ - bypass_parent_rule?: boolean; + id?: string; /** - * Configure how session check behaves. + * The action to preform when the associated traffic, identity, and device posture + * expressions are either absent or evaluate to `true`. */ - check_session?: RuleSettings.CheckSession; + action?: + | 'on' + | 'off' + | 'allow' + | 'block' + | 'scan' + | 'noscan' + | 'safesearch' + | 'ytrestricted' + | 'isolate' + | 'noisolate' + | 'override' + | 'l4_override' + | 'egress' + | 'audit_ssh'; - /** - * Add your own custom resolvers to route queries that match the resolver policy. - * Cannot be used when resolve_dns_through_cloudflare is set. DNS queries will - * route to the address closest to their origin. - */ - dns_resolvers?: RuleSettings.DNSResolvers; + created_at?: string; /** - * Configure how Gateway Proxy traffic egresses. You can enable this setting for - * rules with Egress actions and filters, or omit it to indicate local egress via - * WARP IPs. + * Date of deletion, if any. */ - egress?: RuleSettings.Egress; + deleted_at?: string | null; /** - * INSECURE - disable DNSSEC validation (for Allow actions). + * The description of the rule. */ - insecure_disable_dnssec_validation?: boolean; + description?: string; /** - * Set to true to enable IPs in DNS resolver category blocks. By default categories - * only block based on domain names. + * The wirefilter expression used for device posture check matching. */ - ip_categories?: boolean; + device_posture?: string; /** - * Set to true to include IPs in DNS resolver indicator feed blocks. By default - * indicator feeds only block based on domain names. + * True if the rule is enabled. */ - ip_indicator_feeds?: boolean; + enabled?: boolean; /** - * Send matching traffic to the supplied destination IP address and port. + * The protocol or layer to evaluate the traffic, identity, and device posture + * expressions. */ - l4override?: RuleSettings.L4override; + filters?: Array<'http' | 'dns' | 'l4' | 'egress'>; /** - * Configure a notification to display on the user's device when this rule is - * matched. + * The wirefilter expression used for identity matching. */ - notification_settings?: RuleSettings.NotificationSettings; + identity?: string; /** - * Override matching DNS queries with a hostname. + * The name of the rule. */ - override_host?: string; + name?: string; /** - * Override matching DNS queries with an IP or set of IPs. + * 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. */ - override_ips?: Array; + precedence?: number; /** - * Configure DLP payload logging. + * Additional settings that modify the rule's action. */ - payload_log?: RuleSettings.PayloadLog; + rule_settings?: RuleListResponseItem.RuleSettings; /** - * Enable to send queries that match the policy to Cloudflare's default 1.1.1.1 DNS - * resolver. Cannot be set when dns_resolvers are specified. + * The schedule for activating DNS policies. This does not apply to HTTP or network + * policies. */ - resolve_dns_through_cloudflare?: boolean; + schedule?: RuleListResponseItem.Schedule; /** - * Configure behavior when an upstream cert is invalid or an SSL error occurs. + * The wirefilter expression used for traffic matching. */ - untrusted_cert?: RuleSettings.UntrustedCert; + traffic?: string; + + updated_at?: string; } - export namespace RuleSettings { + export namespace RuleListResponseItem { /** - * Settings for the Audit SSH action. + * Additional settings that modify the rule's action. */ - export interface AuditSSH { + export interface RuleSettings { /** - * Enable to turn on SSH command logging. + * Add custom headers to allowed requests, in the form of key-value pairs. Keys are + * header names, pointing to an array with its header value(s). */ - command_logging?: boolean; - } + add_headers?: unknown; - /** - * Configure how browser isolation behaves. - */ - export interface BisoAdminControls { /** - * Set to true to enable copy-pasting. + * Set by parent MSP accounts to enable their children to bypass this rule. */ - dcp?: boolean; + allow_child_bypass?: boolean; /** - * Set to true to enable downloading. + * Settings for the Audit SSH action. */ - dd?: boolean; + audit_ssh?: RuleSettings.AuditSSH; /** - * Set to true to enable keyboard usage. + * Configure how browser isolation behaves. */ - dk?: boolean; + biso_admin_controls?: RuleSettings.BisoAdminControls; /** - * Set to true to enable printing. + * Enable the custom block page. */ - dp?: boolean; + block_page_enabled?: boolean; /** - * Set to true to enable uploading. + * The text describing why this block occurred, displayed on the custom block page + * (if enabled). */ - du?: boolean; + block_reason?: string; + + /** + * Set by children MSP accounts to bypass their parent's rules. + */ + bypass_parent_rule?: boolean; + + /** + * Configure how session check behaves. + */ + check_session?: RuleSettings.CheckSession; + + /** + * Add your own custom resolvers to route queries that match the resolver policy. + * Cannot be used when resolve_dns_through_cloudflare is set. DNS queries will + * route to the address closest to their origin. + */ + dns_resolvers?: RuleSettings.DNSResolvers; + + /** + * Configure how Gateway Proxy traffic egresses. You can enable this setting for + * rules with Egress actions and filters, or omit it to indicate local egress via + * WARP IPs. + */ + egress?: RuleSettings.Egress; + + /** + * INSECURE - disable DNSSEC validation (for Allow actions). + */ + insecure_disable_dnssec_validation?: boolean; + + /** + * Set to true to enable IPs in DNS resolver category blocks. By default categories + * only block based on domain names. + */ + ip_categories?: boolean; + + /** + * Set to true to include IPs in DNS resolver indicator feed blocks. By default + * indicator feeds only block based on domain names. + */ + ip_indicator_feeds?: boolean; + + /** + * Send matching traffic to the supplied destination IP address and port. + */ + l4override?: RuleSettings.L4override; + + /** + * Configure a notification to display on the user's device when this rule is + * matched. + */ + notification_settings?: RuleSettings.NotificationSettings; + + /** + * Override matching DNS queries with a hostname. + */ + override_host?: string; + + /** + * Override matching DNS queries with an IP or set of IPs. + */ + override_ips?: Array; + + /** + * Configure DLP payload logging. + */ + payload_log?: RuleSettings.PayloadLog; + + /** + * Enable to send queries that match the policy to Cloudflare's default 1.1.1.1 DNS + * resolver. Cannot be set when dns_resolvers are specified. + */ + resolve_dns_through_cloudflare?: boolean; + + /** + * Configure behavior when an upstream cert is invalid or an SSL error occurs. + */ + untrusted_cert?: RuleSettings.UntrustedCert; } - /** - * Configure how session check behaves. - */ - export interface CheckSession { + export namespace RuleSettings { /** - * Configure how fresh the session needs to be to be considered valid. + * Settings for the Audit SSH action. */ - duration?: string; + export interface AuditSSH { + /** + * Enable to turn on SSH command logging. + */ + command_logging?: boolean; + } + + /** + * Configure how browser isolation behaves. + */ + export interface BisoAdminControls { + /** + * Set to true to enable copy-pasting. + */ + dcp?: boolean; + + /** + * Set to true to enable downloading. + */ + dd?: boolean; + + /** + * Set to true to enable keyboard usage. + */ + dk?: boolean; + + /** + * Set to true to enable printing. + */ + dp?: boolean; + + /** + * Set to true to enable uploading. + */ + du?: boolean; + } + + /** + * Configure how session check behaves. + */ + export interface CheckSession { + /** + * Configure how fresh the session needs to be to be considered valid. + */ + duration?: string; + + /** + * Set to true to enable session enforcement. + */ + enforce?: boolean; + } + + /** + * Add your own custom resolvers to route queries that match the resolver policy. + * Cannot be used when resolve_dns_through_cloudflare is set. DNS queries will + * route to the address closest to their origin. + */ + export interface DNSResolvers { + ipv4?: Array; + + ipv6?: Array; + } + + export namespace DNSResolvers { + export interface IPV4 { + /** + * IP address of upstream resolver. + */ + ip: string; + + /** + * A port number to use for upstream resolver. + */ + port?: number; + + /** + * Whether to connect to this resolver over a private network. Must be set when + * vnet_id is set. + */ + route_through_private_network?: boolean; + + /** + * Optionally specify a virtual network for this resolver. Uses default virtual + * network id if omitted. + */ + vnet_id?: string; + } + + export interface IPV6 { + /** + * IP address of upstream resolver. + */ + ip: string; + + /** + * A port number to use for upstream resolver. + */ + port?: number; + + /** + * Whether to connect to this resolver over a private network. Must be set when + * vnet_id is set. + */ + route_through_private_network?: boolean; + + /** + * Optionally specify a virtual network for this resolver. Uses default virtual + * network id if omitted. + */ + vnet_id?: string; + } + } /** - * Set to true to enable session enforcement. + * Configure how Gateway Proxy traffic egresses. You can enable this setting for + * rules with Egress actions and filters, or omit it to indicate local egress via + * WARP IPs. */ - enforce?: boolean; - } - - /** - * Add your own custom resolvers to route queries that match the resolver policy. - * Cannot be used when resolve_dns_through_cloudflare is set. DNS queries will - * route to the address closest to their origin. - */ - export interface DNSResolvers { - ipv4?: Array; - - ipv6?: Array; - } - - export namespace DNSResolvers { - export interface IPV4 { + export interface Egress { /** - * IP address of upstream resolver. + * The IPv4 address to be used for egress. */ - ip: string; + ipv4?: string; /** - * A port number to use for upstream resolver. + * The fallback IPv4 address to be used for egress in the event of an error + * egressing with the primary IPv4. Can be '0.0.0.0' to indicate local egress via + * WARP IPs. */ - port?: number; + ipv4_fallback?: string; /** - * Whether to connect to this resolver over a private network. Must be set when - * vnet_id is set. + * The IPv6 range to be used for egress. */ - route_through_private_network?: boolean; + ipv6?: string; + } + /** + * Send matching traffic to the supplied destination IP address and port. + */ + export interface L4override { /** - * Optionally specify a virtual network for this resolver. Uses default virtual - * network id if omitted. + * IPv4 or IPv6 address. */ - vnet_id?: string; - } + ip?: string; - export interface IPV6 { /** - * IP address of upstream resolver. + * A port number to use for TCP/UDP overrides. */ - ip: string; + port?: number; + } + /** + * Configure a notification to display on the user's device when this rule is + * matched. + */ + export interface NotificationSettings { /** - * A port number to use for upstream resolver. + * Set notification on */ - port?: number; + enabled?: boolean; /** - * Whether to connect to this resolver over a private network. Must be set when - * vnet_id is set. + * Customize the message shown in the notification. */ - route_through_private_network?: boolean; + msg?: string; /** - * Optionally specify a virtual network for this resolver. Uses default virtual - * network id if omitted. + * Optional URL to direct users to additional information. If not set, the + * notification will open a block page. */ - vnet_id?: string; + support_url?: string; } - } - - /** - * Configure how Gateway Proxy traffic egresses. You can enable this setting for - * rules with Egress actions and filters, or omit it to indicate local egress via - * WARP IPs. - */ - export interface Egress { - /** - * The IPv4 address to be used for egress. - */ - ipv4?: string; /** - * The fallback IPv4 address to be used for egress in the event of an error - * egressing with the primary IPv4. Can be '0.0.0.0' to indicate local egress via - * WARP IPs. + * Configure DLP payload logging. */ - ipv4_fallback?: string; + export interface PayloadLog { + /** + * Set to true to enable DLP payload logging for this rule. + */ + enabled?: boolean; + } /** - * The IPv6 range to be used for egress. + * Configure behavior when an upstream cert is invalid or an SSL error occurs. */ - ipv6?: string; + export interface UntrustedCert { + /** + * The action performed when an untrusted certificate is seen. The default action + * is an error with HTTP code 526. + */ + action?: 'pass_through' | 'block' | 'error'; + } } /** - * Send matching traffic to the supplied destination IP address and port. + * The schedule for activating DNS policies. This does not apply to HTTP or network + * policies. */ - export interface L4override { + export interface Schedule { /** - * IPv4 or IPv6 address. + * The time intervals when the rule will be active on Fridays, in increasing order + * from 00:00-24:00. If this parameter is omitted, the rule will be deactivated on + * Fridays. */ - ip?: string; + fri?: string; /** - * A port number to use for TCP/UDP overrides. + * The time intervals when the rule will be active on Mondays, in increasing order + * from 00:00-24:00. If this parameter is omitted, the rule will be deactivated on + * Mondays. */ - port?: number; - } + mon?: string; - /** - * Configure a notification to display on the user's device when this rule is - * matched. - */ - export interface NotificationSettings { /** - * Set notification on + * The time intervals when the rule will be active on Saturdays, in increasing + * order from 00:00-24:00. If this parameter is omitted, the rule will be + * deactivated on Saturdays. */ - enabled?: boolean; + sat?: string; /** - * Customize the message shown in the notification. + * The time intervals when the rule will be active on Sundays, in increasing order + * from 00:00-24:00. If this parameter is omitted, the rule will be deactivated on + * Sundays. */ - msg?: string; + sun?: string; /** - * Optional URL to direct users to additional information. If not set, the - * notification will open a block page. + * The time intervals when the rule will be active on Thursdays, in increasing + * order from 00:00-24:00. If this parameter is omitted, the rule will be + * deactivated on Thursdays. */ - support_url?: string; - } + thu?: string; - /** - * Configure DLP payload logging. - */ - export interface PayloadLog { /** - * Set to true to enable DLP payload logging for this rule. + * The time zone the rule will be evaluated against. If a + * [valid time zone city name](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List) + * is provided, Gateway will always use the current time at that time zone. If this + * parameter is omitted, then Gateway will use the time zone inferred from the + * user's source IP to evaluate the rule. If Gateway cannot determine the time zone + * from the IP, we will fall back to the time zone of the user's connected data + * center. */ - enabled?: boolean; - } + time_zone?: string; - /** - * Configure behavior when an upstream cert is invalid or an SSL error occurs. - */ - export interface UntrustedCert { /** - * The action performed when an untrusted certificate is seen. The default action - * is an error with HTTP code 526. + * The time intervals when the rule will be active on Tuesdays, in increasing order + * from 00:00-24:00. If this parameter is omitted, the rule will be deactivated on + * Tuesdays. */ - action?: 'pass_through' | 'block' | 'error'; - } - } - - /** - * The schedule for activating DNS policies. This does not apply to HTTP or network - * policies. - */ - export interface Schedule { - /** - * The time intervals when the rule will be active on Fridays, in increasing order - * from 00:00-24:00. If this parameter is omitted, the rule will be deactivated on - * Fridays. - */ - fri?: string; - - /** - * The time intervals when the rule will be active on Mondays, in increasing order - * from 00:00-24:00. If this parameter is omitted, the rule will be deactivated on - * Mondays. - */ - mon?: string; - - /** - * The time intervals when the rule will be active on Saturdays, in increasing - * order from 00:00-24:00. If this parameter is omitted, the rule will be - * deactivated on Saturdays. - */ - sat?: string; - - /** - * The time intervals when the rule will be active on Sundays, in increasing order - * from 00:00-24:00. If this parameter is omitted, the rule will be deactivated on - * Sundays. - */ - sun?: string; - - /** - * The time intervals when the rule will be active on Thursdays, in increasing - * order from 00:00-24:00. If this parameter is omitted, the rule will be - * deactivated on Thursdays. - */ - thu?: string; - - /** - * The time zone the rule will be evaluated against. If a - * [valid time zone city name](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List) - * is provided, Gateway will always use the current time at that time zone. If this - * parameter is omitted, then Gateway will use the time zone inferred from the - * user's source IP to evaluate the rule. If Gateway cannot determine the time zone - * from the IP, we will fall back to the time zone of the user's connected data - * center. - */ - time_zone?: string; - - /** - * The time intervals when the rule will be active on Tuesdays, in increasing order - * from 00:00-24:00. If this parameter is omitted, the rule will be deactivated on - * Tuesdays. - */ - tue?: string; + tue?: string; - /** - * The time intervals when the rule will be active on Wednesdays, in increasing - * order from 00:00-24:00. If this parameter is omitted, the rule will be - * deactivated on Wednesdays. - */ - wed?: string; + /** + * The time intervals when the rule will be active on Wednesdays, in increasing + * order from 00:00-24:00. If this parameter is omitted, the rule will be + * deactivated on Wednesdays. + */ + wed?: string; + } } } -export interface RuleReplaceResponse { +export type RuleDeleteResponse = unknown | string; + +export interface RuleGetResponse { /** * The API resource UUID. */ @@ -1574,13 +1574,13 @@ export interface RuleReplaceResponse { /** * Additional settings that modify the rule's action. */ - rule_settings?: RuleReplaceResponse.RuleSettings; + rule_settings?: RuleGetResponse.RuleSettings; /** * The schedule for activating DNS policies. This does not apply to HTTP or network * policies. */ - schedule?: RuleReplaceResponse.Schedule; + schedule?: RuleGetResponse.Schedule; /** * The wirefilter expression used for traffic matching. @@ -1590,7 +1590,7 @@ export interface RuleReplaceResponse { updated_at?: string; } -export namespace RuleReplaceResponse { +export namespace RuleGetResponse { /** * Additional settings that modify the rule's action. */ @@ -2432,7 +2432,7 @@ export namespace RuleCreateParams { } } -export interface RuleReplaceParams { +export interface RuleUpdateParams { /** * The action to preform when the associated traffic, identity, and device posture * expressions are either absent or evaluate to `true`. @@ -2494,13 +2494,13 @@ export interface RuleReplaceParams { /** * Additional settings that modify the rule's action. */ - rule_settings?: RuleReplaceParams.RuleSettings; + rule_settings?: RuleUpdateParams.RuleSettings; /** * The schedule for activating DNS policies. This does not apply to HTTP or network * policies. */ - schedule?: RuleReplaceParams.Schedule; + schedule?: RuleUpdateParams.Schedule; /** * The wirefilter expression used for traffic matching. @@ -2508,7 +2508,7 @@ export interface RuleReplaceParams { traffic?: string; } -export namespace RuleReplaceParams { +export namespace RuleUpdateParams { /** * Additional settings that modify the rule's action. */ @@ -2893,10 +2893,10 @@ export namespace RuleReplaceParams { export namespace Rules { export import RuleCreateResponse = RulesAPI.RuleCreateResponse; + export import RuleUpdateResponse = RulesAPI.RuleUpdateResponse; export import RuleListResponse = RulesAPI.RuleListResponse; export import RuleDeleteResponse = RulesAPI.RuleDeleteResponse; export import RuleGetResponse = RulesAPI.RuleGetResponse; - export import RuleReplaceResponse = RulesAPI.RuleReplaceResponse; export import RuleCreateParams = RulesAPI.RuleCreateParams; - export import RuleReplaceParams = RulesAPI.RuleReplaceParams; + export import RuleUpdateParams = RulesAPI.RuleUpdateParams; } diff --git a/src/resources/healthchecks/healthchecks.ts b/src/resources/healthchecks/healthchecks.ts index fe3db77810..83cfee0fc4 100644 --- a/src/resources/healthchecks/healthchecks.ts +++ b/src/resources/healthchecks/healthchecks.ts @@ -23,6 +23,23 @@ export class Healthchecks extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Update a configured health check. + */ + update( + zoneIdentifier: string, + identifier: string, + body: HealthcheckUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/zones/${zoneIdentifier}/healthchecks/${identifier}`, { + body, + ...options, + }) as Core.APIPromise<{ result: HealthcheckUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * List configured health checks. */ @@ -66,23 +83,6 @@ export class Healthchecks extends APIResource { }> )._thenUnwrap((obj) => obj.result); } - - /** - * Update a configured health check. - */ - replace( - zoneIdentifier: string, - identifier: string, - body: HealthcheckReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put(`/zones/${zoneIdentifier}/healthchecks/${identifier}`, { - body, - ...options, - }) as Core.APIPromise<{ result: HealthcheckReplaceResponse }> - )._thenUnwrap((obj) => obj.result); - } } export interface HealthcheckCreateResponse { @@ -260,6 +260,181 @@ export namespace HealthcheckCreateResponse { } } +export interface HealthcheckUpdateResponse { + /** + * Identifier + */ + id?: string; + + /** + * The hostname or IP address of the origin server to run health checks on. + */ + address?: string; + + /** + * A list of regions from which to run health checks. Null means Cloudflare will + * pick a default region. + */ + check_regions?: Array< + | 'WNAM' + | 'ENAM' + | 'WEU' + | 'EEU' + | 'NSAM' + | 'SSAM' + | 'OC' + | 'ME' + | 'NAF' + | 'SAF' + | 'IN' + | 'SEAS' + | 'NEAS' + | 'ALL_REGIONS' + > | null; + + /** + * The number of consecutive fails required from a health check before changing the + * health to unhealthy. + */ + consecutive_fails?: number; + + /** + * The number of consecutive successes required from a health check before changing + * the health to healthy. + */ + consecutive_successes?: number; + + created_on?: string; + + /** + * A human-readable description of the health check. + */ + description?: string; + + /** + * The current failure reason if status is unhealthy. + */ + failure_reason?: string; + + /** + * Parameters specific to an HTTP or HTTPS health check. + */ + http_config?: HealthcheckUpdateResponse.HTTPConfig | null; + + /** + * The interval between each health check. Shorter intervals may give quicker + * notifications if the origin status changes, but will increase load on the origin + * as we check from multiple locations. + */ + interval?: number; + + modified_on?: string; + + /** + * A short name to identify the health check. Only alphanumeric characters, hyphens + * and underscores are allowed. + */ + name?: string; + + /** + * The number of retries to attempt in case of a timeout before marking the origin + * as unhealthy. Retries are attempted immediately. + */ + retries?: number; + + /** + * The current status of the origin server according to the health check. + */ + status?: 'unknown' | 'healthy' | 'unhealthy' | 'suspended'; + + /** + * If suspended, no health checks are sent to the origin. + */ + suspended?: boolean; + + /** + * Parameters specific to TCP health check. + */ + tcp_config?: HealthcheckUpdateResponse.TcpConfig | null; + + /** + * The timeout (in seconds) before marking the health check as failed. + */ + timeout?: number; + + /** + * The protocol to use for the health check. Currently supported protocols are + * 'HTTP', 'HTTPS' and 'TCP'. + */ + type?: string; +} + +export namespace HealthcheckUpdateResponse { + /** + * Parameters specific to an HTTP or HTTPS health check. + */ + export interface HTTPConfig { + /** + * Do not validate the certificate when the health check uses HTTPS. + */ + allow_insecure?: boolean; + + /** + * A case-insensitive sub-string to look for in the response body. If this string + * is not found, the origin will be marked as unhealthy. + */ + expected_body?: string; + + /** + * The expected HTTP response codes (e.g. "200") or code ranges (e.g. "2xx" for all + * codes starting with 2) of the health check. + */ + expected_codes?: Array | null; + + /** + * Follow redirects if the origin returns a 3xx status code. + */ + follow_redirects?: boolean; + + /** + * The HTTP request headers to send in the health check. It is recommended you set + * a Host header by default. The User-Agent header cannot be overridden. + */ + header?: unknown | null; + + /** + * The HTTP method to use for the health check. + */ + method?: 'GET' | 'HEAD'; + + /** + * The endpoint path to health check against. + */ + path?: string; + + /** + * Port number to connect to for the health check. Defaults to 80 if type is HTTP + * or 443 if type is HTTPS. + */ + port?: number; + } + + /** + * Parameters specific to TCP health check. + */ + export interface TcpConfig { + /** + * The TCP connection method to use for the health check. + */ + method?: 'connection_established'; + + /** + * Port number to connect to for the health check. Defaults to 80. + */ + port?: number; + } +} + export type HealthcheckListResponse = Array; export namespace HealthcheckListResponse { @@ -621,181 +796,6 @@ export namespace HealthcheckGetResponse { } } -export interface HealthcheckReplaceResponse { - /** - * Identifier - */ - id?: string; - - /** - * The hostname or IP address of the origin server to run health checks on. - */ - address?: string; - - /** - * A list of regions from which to run health checks. Null means Cloudflare will - * pick a default region. - */ - check_regions?: Array< - | 'WNAM' - | 'ENAM' - | 'WEU' - | 'EEU' - | 'NSAM' - | 'SSAM' - | 'OC' - | 'ME' - | 'NAF' - | 'SAF' - | 'IN' - | 'SEAS' - | 'NEAS' - | 'ALL_REGIONS' - > | null; - - /** - * The number of consecutive fails required from a health check before changing the - * health to unhealthy. - */ - consecutive_fails?: number; - - /** - * The number of consecutive successes required from a health check before changing - * the health to healthy. - */ - consecutive_successes?: number; - - created_on?: string; - - /** - * A human-readable description of the health check. - */ - description?: string; - - /** - * The current failure reason if status is unhealthy. - */ - failure_reason?: string; - - /** - * Parameters specific to an HTTP or HTTPS health check. - */ - http_config?: HealthcheckReplaceResponse.HTTPConfig | null; - - /** - * The interval between each health check. Shorter intervals may give quicker - * notifications if the origin status changes, but will increase load on the origin - * as we check from multiple locations. - */ - interval?: number; - - modified_on?: string; - - /** - * A short name to identify the health check. Only alphanumeric characters, hyphens - * and underscores are allowed. - */ - name?: string; - - /** - * The number of retries to attempt in case of a timeout before marking the origin - * as unhealthy. Retries are attempted immediately. - */ - retries?: number; - - /** - * The current status of the origin server according to the health check. - */ - status?: 'unknown' | 'healthy' | 'unhealthy' | 'suspended'; - - /** - * If suspended, no health checks are sent to the origin. - */ - suspended?: boolean; - - /** - * Parameters specific to TCP health check. - */ - tcp_config?: HealthcheckReplaceResponse.TcpConfig | null; - - /** - * The timeout (in seconds) before marking the health check as failed. - */ - timeout?: number; - - /** - * The protocol to use for the health check. Currently supported protocols are - * 'HTTP', 'HTTPS' and 'TCP'. - */ - type?: string; -} - -export namespace HealthcheckReplaceResponse { - /** - * Parameters specific to an HTTP or HTTPS health check. - */ - export interface HTTPConfig { - /** - * Do not validate the certificate when the health check uses HTTPS. - */ - allow_insecure?: boolean; - - /** - * A case-insensitive sub-string to look for in the response body. If this string - * is not found, the origin will be marked as unhealthy. - */ - expected_body?: string; - - /** - * The expected HTTP response codes (e.g. "200") or code ranges (e.g. "2xx" for all - * codes starting with 2) of the health check. - */ - expected_codes?: Array | null; - - /** - * Follow redirects if the origin returns a 3xx status code. - */ - follow_redirects?: boolean; - - /** - * The HTTP request headers to send in the health check. It is recommended you set - * a Host header by default. The User-Agent header cannot be overridden. - */ - header?: unknown | null; - - /** - * The HTTP method to use for the health check. - */ - method?: 'GET' | 'HEAD'; - - /** - * The endpoint path to health check against. - */ - path?: string; - - /** - * Port number to connect to for the health check. Defaults to 80 if type is HTTP - * or 443 if type is HTTPS. - */ - port?: number; - } - - /** - * Parameters specific to TCP health check. - */ - export interface TcpConfig { - /** - * The TCP connection method to use for the health check. - */ - method?: 'connection_established'; - - /** - * Port number to connect to for the health check. Defaults to 80. - */ - port?: number; - } -} - export interface HealthcheckCreateParams { /** * The hostname or IP address of the origin server to run health checks on. @@ -952,7 +952,7 @@ export namespace HealthcheckCreateParams { } } -export interface HealthcheckReplaceParams { +export interface HealthcheckUpdateParams { /** * The hostname or IP address of the origin server to run health checks on. */ @@ -1005,7 +1005,7 @@ export interface HealthcheckReplaceParams { /** * Parameters specific to an HTTP or HTTPS health check. */ - http_config?: HealthcheckReplaceParams.HTTPConfig | null; + http_config?: HealthcheckUpdateParams.HTTPConfig | null; /** * The interval between each health check. Shorter intervals may give quicker @@ -1028,7 +1028,7 @@ export interface HealthcheckReplaceParams { /** * Parameters specific to TCP health check. */ - tcp_config?: HealthcheckReplaceParams.TcpConfig | null; + tcp_config?: HealthcheckUpdateParams.TcpConfig | null; /** * The timeout (in seconds) before marking the health check as failed. @@ -1042,7 +1042,7 @@ export interface HealthcheckReplaceParams { type?: string; } -export namespace HealthcheckReplaceParams { +export namespace HealthcheckUpdateParams { /** * Parameters specific to an HTTP or HTTPS health check. */ @@ -1110,12 +1110,12 @@ export namespace HealthcheckReplaceParams { export namespace Healthchecks { export import HealthcheckCreateResponse = HealthchecksAPI.HealthcheckCreateResponse; + export import HealthcheckUpdateResponse = HealthchecksAPI.HealthcheckUpdateResponse; export import HealthcheckListResponse = HealthchecksAPI.HealthcheckListResponse; export import HealthcheckDeleteResponse = HealthchecksAPI.HealthcheckDeleteResponse; export import HealthcheckGetResponse = HealthchecksAPI.HealthcheckGetResponse; - export import HealthcheckReplaceResponse = HealthchecksAPI.HealthcheckReplaceResponse; export import HealthcheckCreateParams = HealthchecksAPI.HealthcheckCreateParams; - export import HealthcheckReplaceParams = HealthchecksAPI.HealthcheckReplaceParams; + export import HealthcheckUpdateParams = HealthchecksAPI.HealthcheckUpdateParams; export import Previews = PreviewsAPI.Previews; export import PreviewCreateResponse = PreviewsAPI.PreviewCreateResponse; export import PreviewDeleteResponse = PreviewsAPI.PreviewDeleteResponse; diff --git a/src/resources/healthchecks/index.ts b/src/resources/healthchecks/index.ts index 406894c657..515d437e71 100644 --- a/src/resources/healthchecks/index.ts +++ b/src/resources/healthchecks/index.ts @@ -2,12 +2,12 @@ export { HealthcheckCreateResponse, + HealthcheckUpdateResponse, HealthcheckListResponse, HealthcheckDeleteResponse, HealthcheckGetResponse, - HealthcheckReplaceResponse, HealthcheckCreateParams, - HealthcheckReplaceParams, + HealthcheckUpdateParams, Healthchecks, } from './healthchecks'; export { diff --git a/src/resources/hostnames/settings/index.ts b/src/resources/hostnames/settings/index.ts index 9d595e7bdd..0f80569913 100644 --- a/src/resources/hostnames/settings/index.ts +++ b/src/resources/hostnames/settings/index.ts @@ -1,4 +1,4 @@ // File generated from our OpenAPI spec by Stainless. export { Settings } from './settings'; -export { TLSDeleteResponse, TLSGetResponse, TLSReplaceResponse, TLSReplaceParams, TLS } from './tls'; +export { TLSUpdateResponse, TLSDeleteResponse, TLSGetResponse, TLSUpdateParams, TLS } from './tls'; diff --git a/src/resources/hostnames/settings/settings.ts b/src/resources/hostnames/settings/settings.ts index 8089519a43..77719b9d99 100644 --- a/src/resources/hostnames/settings/settings.ts +++ b/src/resources/hostnames/settings/settings.ts @@ -9,8 +9,8 @@ export class Settings extends APIResource { export namespace Settings { export import TLS = TLSAPI.TLS; + export import TLSUpdateResponse = TLSAPI.TLSUpdateResponse; export import TLSDeleteResponse = TLSAPI.TLSDeleteResponse; export import TLSGetResponse = TLSAPI.TLSGetResponse; - export import TLSReplaceResponse = TLSAPI.TLSReplaceResponse; - export import TLSReplaceParams = TLSAPI.TLSReplaceParams; + export import TLSUpdateParams = TLSAPI.TLSUpdateParams; } diff --git a/src/resources/hostnames/settings/tls.ts b/src/resources/hostnames/settings/tls.ts index 87c6cfbfdf..1adbc7dd9d 100644 --- a/src/resources/hostnames/settings/tls.ts +++ b/src/resources/hostnames/settings/tls.ts @@ -5,6 +5,24 @@ import { APIResource } from 'cloudflare/resource'; import * as TLSAPI from 'cloudflare/resources/hostnames/settings/tls'; export class TLS extends APIResource { + /** + * Update the tls setting value for the hostname. + */ + update( + zoneId: string, + settingId: 'ciphers' | 'min_tls_version' | 'http2', + hostname: string, + body: TLSUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/zones/${zoneId}/hostnames/settings/${settingId}/${hostname}`, { + body, + ...options, + }) as Core.APIPromise<{ result: TLSUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * Delete the tls setting value for the hostname. */ @@ -36,24 +54,33 @@ export class TLS extends APIResource { }> )._thenUnwrap((obj) => obj.result); } +} +export interface TLSUpdateResponse { /** - * Update the tls setting value for the hostname. + * This is the time the tls setting was originally created for this hostname. */ - replace( - zoneId: string, - settingId: 'ciphers' | 'min_tls_version' | 'http2', - hostname: string, - body: TLSReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put(`/zones/${zoneId}/hostnames/settings/${settingId}/${hostname}`, { - body, - ...options, - }) as Core.APIPromise<{ result: TLSReplaceResponse }> - )._thenUnwrap((obj) => obj.result); - } + created_at?: string; + + /** + * The hostname for which the tls settings are set. + */ + hostname?: string; + + /** + * Deployment status for the given tls setting. + */ + status?: string; + + /** + * This is the time the tls setting was updated. + */ + updated_at?: string; + + /** + * The tls setting value. + */ + value?: number | string | Array; } export interface TLSDeleteResponse { @@ -108,34 +135,7 @@ export namespace TLSGetResponse { } } -export interface TLSReplaceResponse { - /** - * This is the time the tls setting was originally created for this hostname. - */ - created_at?: string; - - /** - * The hostname for which the tls settings are set. - */ - hostname?: string; - - /** - * Deployment status for the given tls setting. - */ - status?: string; - - /** - * This is the time the tls setting was updated. - */ - updated_at?: string; - - /** - * The tls setting value. - */ - value?: number | string | Array; -} - -export interface TLSReplaceParams { +export interface TLSUpdateParams { /** * The tls setting value. */ @@ -143,8 +143,8 @@ export interface TLSReplaceParams { } export namespace TLS { + export import TLSUpdateResponse = TLSAPI.TLSUpdateResponse; export import TLSDeleteResponse = TLSAPI.TLSDeleteResponse; export import TLSGetResponse = TLSAPI.TLSGetResponse; - export import TLSReplaceResponse = TLSAPI.TLSReplaceResponse; - export import TLSReplaceParams = TLSAPI.TLSReplaceParams; + export import TLSUpdateParams = TLSAPI.TLSUpdateParams; } diff --git a/src/resources/hyperdrive/configs.ts b/src/resources/hyperdrive/configs.ts index d165cfbebd..d11ec2afdc 100644 --- a/src/resources/hyperdrive/configs.ts +++ b/src/resources/hyperdrive/configs.ts @@ -21,6 +21,23 @@ export class Configs extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Updates and returns the specified Hyperdrive configuration. + */ + update( + accountId: string, + hyperdriveId: string, + body: ConfigUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/accounts/${accountId}/hyperdrive/configs/${hyperdriveId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: ConfigUpdateResponse | null }> + )._thenUnwrap((obj) => obj.result); + } + /** * Returns a list of Hyperdrives */ @@ -63,26 +80,16 @@ export class Configs extends APIResource { ) as Core.APIPromise<{ result: ConfigGetResponse | null }> )._thenUnwrap((obj) => obj.result); } +} +export interface ConfigCreateResponse { /** - * Updates and returns the specified Hyperdrive configuration. + * Identifier */ - replace( - accountId: string, - hyperdriveId: string, - body: ConfigReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put(`/accounts/${accountId}/hyperdrive/configs/${hyperdriveId}`, { - body, - ...options, - }) as Core.APIPromise<{ result: ConfigReplaceResponse | null }> - )._thenUnwrap((obj) => obj.result); - } + id?: string; } -export interface ConfigCreateResponse { +export interface ConfigUpdateResponse { /** * Identifier */ @@ -109,13 +116,6 @@ export interface ConfigGetResponse { id?: string; } -export interface ConfigReplaceResponse { - /** - * Identifier - */ - id?: string; -} - export interface ConfigCreateParams { origin: ConfigCreateParams.Origin; } @@ -130,11 +130,11 @@ export namespace ConfigCreateParams { } } -export interface ConfigReplaceParams { - origin: ConfigReplaceParams.Origin; +export interface ConfigUpdateParams { + origin: ConfigUpdateParams.Origin; } -export namespace ConfigReplaceParams { +export namespace ConfigUpdateParams { export interface Origin { /** * The password required to access your origin database. This value is write-only @@ -146,10 +146,10 @@ export namespace ConfigReplaceParams { export namespace Configs { export import ConfigCreateResponse = ConfigsAPI.ConfigCreateResponse; + export import ConfigUpdateResponse = ConfigsAPI.ConfigUpdateResponse; export import ConfigListResponse = ConfigsAPI.ConfigListResponse; export import ConfigDeleteResponse = ConfigsAPI.ConfigDeleteResponse; export import ConfigGetResponse = ConfigsAPI.ConfigGetResponse; - export import ConfigReplaceResponse = ConfigsAPI.ConfigReplaceResponse; export import ConfigCreateParams = ConfigsAPI.ConfigCreateParams; - export import ConfigReplaceParams = ConfigsAPI.ConfigReplaceParams; + export import ConfigUpdateParams = ConfigsAPI.ConfigUpdateParams; } diff --git a/src/resources/hyperdrive/hyperdrive.ts b/src/resources/hyperdrive/hyperdrive.ts index 3361a41429..4cb274c8e1 100644 --- a/src/resources/hyperdrive/hyperdrive.ts +++ b/src/resources/hyperdrive/hyperdrive.ts @@ -10,10 +10,10 @@ export class Hyperdrive extends APIResource { export namespace Hyperdrive { export import Configs = ConfigsAPI.Configs; export import ConfigCreateResponse = ConfigsAPI.ConfigCreateResponse; + export import ConfigUpdateResponse = ConfigsAPI.ConfigUpdateResponse; export import ConfigListResponse = ConfigsAPI.ConfigListResponse; export import ConfigDeleteResponse = ConfigsAPI.ConfigDeleteResponse; export import ConfigGetResponse = ConfigsAPI.ConfigGetResponse; - export import ConfigReplaceResponse = ConfigsAPI.ConfigReplaceResponse; export import ConfigCreateParams = ConfigsAPI.ConfigCreateParams; - export import ConfigReplaceParams = ConfigsAPI.ConfigReplaceParams; + export import ConfigUpdateParams = ConfigsAPI.ConfigUpdateParams; } diff --git a/src/resources/hyperdrive/index.ts b/src/resources/hyperdrive/index.ts index 3accfe1ca6..48308b2245 100644 --- a/src/resources/hyperdrive/index.ts +++ b/src/resources/hyperdrive/index.ts @@ -2,12 +2,12 @@ export { ConfigCreateResponse, + ConfigUpdateResponse, ConfigListResponse, ConfigDeleteResponse, ConfigGetResponse, - ConfigReplaceResponse, ConfigCreateParams, - ConfigReplaceParams, + ConfigUpdateParams, Configs, } from './configs'; export { Hyperdrive } from './hyperdrive'; diff --git a/src/resources/images/images.ts b/src/resources/images/images.ts index 877a94628c..68b2a49c4c 100644 --- a/src/resources/images/images.ts +++ b/src/resources/images/images.ts @@ -12,14 +12,14 @@ export class Images extends APIResource { export namespace Images { export import V1s = V1sAPI.V1s; export import V1CreateResponse = V1sAPI.V1CreateResponse; - export import V1UpdateResponse = V1sAPI.V1UpdateResponse; export import V1ListResponse = V1sAPI.V1ListResponse; export import V1DeleteResponse = V1sAPI.V1DeleteResponse; + export import V1EditResponse = V1sAPI.V1EditResponse; export import V1GetResponse = V1sAPI.V1GetResponse; export import V1ListResponsesV4PagePagination = V1sAPI.V1ListResponsesV4PagePagination; export import V1CreateParams = V1sAPI.V1CreateParams; - export import V1UpdateParams = V1sAPI.V1UpdateParams; export import V1ListParams = V1sAPI.V1ListParams; + export import V1EditParams = V1sAPI.V1EditParams; export import V2s = V2sAPI.V2s; export import ImagesImagesListResponseV2 = V2sAPI.ImagesImagesListResponseV2; export import V2ListResponse = V2sAPI.V2ListResponse; diff --git a/src/resources/images/index.ts b/src/resources/images/index.ts index b9ea1378ee..8943f6faa1 100644 --- a/src/resources/images/index.ts +++ b/src/resources/images/index.ts @@ -4,13 +4,13 @@ export { Images } from './images'; export { ImagesImagesListResponseV2, V2ListResponse, V2ListParams, V2s } from './v2s/index'; export { V1CreateResponse, - V1UpdateResponse, V1ListResponse, V1DeleteResponse, + V1EditResponse, V1GetResponse, V1CreateParams, - V1UpdateParams, V1ListParams, + V1EditParams, V1ListResponsesV4PagePagination, V1s, } from './v1s/index'; diff --git a/src/resources/images/v1s/index.ts b/src/resources/images/v1s/index.ts index bbce160a2d..af2156bd86 100644 --- a/src/resources/images/v1s/index.ts +++ b/src/resources/images/v1s/index.ts @@ -5,23 +5,23 @@ export { KeyListResponse, Keys } from './keys'; export { StatGetResponse, Stats } from './stats'; export { V1CreateResponse, - V1UpdateResponse, V1ListResponse, V1DeleteResponse, + V1EditResponse, V1GetResponse, V1CreateParams, - V1UpdateParams, V1ListParams, + V1EditParams, V1ListResponsesV4PagePagination, V1s, } from './v1s'; export { VariantCreateResponse, - VariantUpdateResponse, VariantListResponse, VariantDeleteResponse, + VariantEditResponse, VariantGetResponse, VariantCreateParams, - VariantUpdateParams, + VariantEditParams, Variants, } from './variants'; diff --git a/src/resources/images/v1s/v1s.ts b/src/resources/images/v1s/v1s.ts index 7ad8936740..1d9588af63 100644 --- a/src/resources/images/v1s/v1s.ts +++ b/src/resources/images/v1s/v1s.ts @@ -35,24 +35,6 @@ export class V1s extends APIResource { )._thenUnwrap((obj) => obj.result); } - /** - * Update image access control. On access control change, all copies of the image - * are purged from cache. - */ - update( - accountId: string, - imageId: string, - body: V1UpdateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.patch(`/accounts/${accountId}/images/v1/${imageId}`, { - body, - ...options, - }) as Core.APIPromise<{ result: V1UpdateResponse }> - )._thenUnwrap((obj) => obj.result); - } - /** * List up to 100 images with one request. Use the optional parameters below to get * a specific range of images. @@ -96,6 +78,24 @@ export class V1s extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Update image access control. On access control change, all copies of the image + * are purged from cache. + */ + edit( + accountId: string, + imageId: string, + body: V1EditParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.patch(`/accounts/${accountId}/images/v1/${imageId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: V1EditResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * Fetch details for a single image. */ @@ -144,40 +144,6 @@ export interface V1CreateResponse { variants?: Array; } -export interface V1UpdateResponse { - /** - * Image unique identifier. - */ - id?: string; - - /** - * Image file name. - */ - filename?: string; - - /** - * User modifiable key-value store. Can be used for keeping references to another - * system of record for managing images. Metadata must not exceed 1024 bytes. - */ - meta?: unknown; - - /** - * Indicates whether the image can be a accessed only using it's UID. If set to - * true, a signed token needs to be generated with a signing key to view the image. - */ - requireSignedURLs?: boolean; - - /** - * When the media item was uploaded. - */ - uploaded?: string; - - /** - * Object specifying available variants for an image. - */ - variants?: Array; -} - export interface V1ListResponse { errors: Array; @@ -247,6 +213,40 @@ export namespace V1ListResponse { export type V1DeleteResponse = unknown | string; +export interface V1EditResponse { + /** + * Image unique identifier. + */ + id?: string; + + /** + * Image file name. + */ + filename?: string; + + /** + * User modifiable key-value store. Can be used for keeping references to another + * system of record for managing images. Metadata must not exceed 1024 bytes. + */ + meta?: unknown; + + /** + * Indicates whether the image can be a accessed only using it's UID. If set to + * true, a signed token needs to be generated with a signing key to view the image. + */ + requireSignedURLs?: boolean; + + /** + * When the media item was uploaded. + */ + uploaded?: string; + + /** + * Object specifying available variants for an image. + */ + variants?: Array; +} + export interface V1GetResponse { /** * Image unique identifier. @@ -299,7 +299,9 @@ export namespace V1CreateParams { } } -export interface V1UpdateParams { +export interface V1ListParams extends V4PagePaginationParams {} + +export interface V1EditParams { /** * User modifiable key-value store. Can be used for keeping references to another * system of record for managing images. No change if not specified. @@ -314,29 +316,27 @@ export interface V1UpdateParams { requireSignedURLs?: boolean; } -export interface V1ListParams extends V4PagePaginationParams {} - export namespace V1s { export import V1CreateResponse = V1sAPI.V1CreateResponse; - export import V1UpdateResponse = V1sAPI.V1UpdateResponse; export import V1ListResponse = V1sAPI.V1ListResponse; export import V1DeleteResponse = V1sAPI.V1DeleteResponse; + export import V1EditResponse = V1sAPI.V1EditResponse; export import V1GetResponse = V1sAPI.V1GetResponse; export import V1ListResponsesV4PagePagination = V1sAPI.V1ListResponsesV4PagePagination; export import V1CreateParams = V1sAPI.V1CreateParams; - export import V1UpdateParams = V1sAPI.V1UpdateParams; export import V1ListParams = V1sAPI.V1ListParams; + export import V1EditParams = V1sAPI.V1EditParams; export import Keys = KeysAPI.Keys; export import KeyListResponse = KeysAPI.KeyListResponse; export import Stats = StatsAPI.Stats; export import StatGetResponse = StatsAPI.StatGetResponse; export import Variants = VariantsAPI.Variants; export import VariantCreateResponse = VariantsAPI.VariantCreateResponse; - export import VariantUpdateResponse = VariantsAPI.VariantUpdateResponse; export import VariantListResponse = VariantsAPI.VariantListResponse; export import VariantDeleteResponse = VariantsAPI.VariantDeleteResponse; + export import VariantEditResponse = VariantsAPI.VariantEditResponse; export import VariantGetResponse = VariantsAPI.VariantGetResponse; export import VariantCreateParams = VariantsAPI.VariantCreateParams; - export import VariantUpdateParams = VariantsAPI.VariantUpdateParams; + export import VariantEditParams = VariantsAPI.VariantEditParams; export import Blobs = BlobsAPI.Blobs; } diff --git a/src/resources/images/v1s/variants.ts b/src/resources/images/v1s/variants.ts index 22ef991b43..c033024f5a 100644 --- a/src/resources/images/v1s/variants.ts +++ b/src/resources/images/v1s/variants.ts @@ -21,23 +21,6 @@ export class Variants extends APIResource { )._thenUnwrap((obj) => obj.result); } - /** - * Updating a variant purges the cache for all images associated with the variant. - */ - update( - accountId: string, - variantId: unknown, - body: VariantUpdateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.patch(`/accounts/${accountId}/images/v1/variants/${variantId}`, { - body, - ...options, - }) as Core.APIPromise<{ result: VariantUpdateResponse }> - )._thenUnwrap((obj) => obj.result); - } - /** * Lists existing variants. */ @@ -65,6 +48,23 @@ export class Variants extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Updating a variant purges the cache for all images associated with the variant. + */ + edit( + accountId: string, + variantId: unknown, + body: VariantEditParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.patch(`/accounts/${accountId}/images/v1/variants/${variantId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: VariantEditResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * Fetch details for a single variant. */ @@ -130,55 +130,6 @@ export namespace VariantCreateResponse { } } -export interface VariantUpdateResponse { - variant?: VariantUpdateResponse.Variant; -} - -export namespace VariantUpdateResponse { - export interface Variant { - id: unknown; - - /** - * Allows you to define image resizing sizes for different use cases. - */ - options: Variant.Options; - - /** - * Indicates whether the variant can access an image without a signature, - * regardless of image access control. - */ - neverRequireSignedURLs?: boolean; - } - - export namespace Variant { - /** - * Allows you to define image resizing sizes for different use cases. - */ - export interface Options { - /** - * The fit property describes how the width and height dimensions should be - * interpreted. - */ - fit: 'scale-down' | 'contain' | 'cover' | 'crop' | 'pad'; - - /** - * Maximum height in image pixels. - */ - height: number; - - /** - * What EXIF data should be preserved in the output image. - */ - metadata: 'keep' | 'copyright' | 'none'; - - /** - * Maximum width in image pixels. - */ - width: number; - } - } -} - export interface VariantListResponse { variants?: VariantListResponse.Variants; } @@ -236,6 +187,55 @@ export namespace VariantListResponse { export type VariantDeleteResponse = unknown | string; +export interface VariantEditResponse { + variant?: VariantEditResponse.Variant; +} + +export namespace VariantEditResponse { + export interface Variant { + id: unknown; + + /** + * Allows you to define image resizing sizes for different use cases. + */ + options: Variant.Options; + + /** + * Indicates whether the variant can access an image without a signature, + * regardless of image access control. + */ + neverRequireSignedURLs?: boolean; + } + + export namespace Variant { + /** + * Allows you to define image resizing sizes for different use cases. + */ + export interface Options { + /** + * The fit property describes how the width and height dimensions should be + * interpreted. + */ + fit: 'scale-down' | 'contain' | 'cover' | 'crop' | 'pad'; + + /** + * Maximum height in image pixels. + */ + height: number; + + /** + * What EXIF data should be preserved in the output image. + */ + metadata: 'keep' | 'copyright' | 'none'; + + /** + * Maximum width in image pixels. + */ + width: number; + } + } +} + export interface VariantGetResponse { variant?: VariantGetResponse.Variant; } @@ -328,11 +328,11 @@ export namespace VariantCreateParams { } } -export interface VariantUpdateParams { +export interface VariantEditParams { /** * Allows you to define image resizing sizes for different use cases. */ - options: VariantUpdateParams.Options; + options: VariantEditParams.Options; /** * Indicates whether the variant can access an image without a signature, @@ -341,7 +341,7 @@ export interface VariantUpdateParams { neverRequireSignedURLs?: boolean; } -export namespace VariantUpdateParams { +export namespace VariantEditParams { /** * Allows you to define image resizing sizes for different use cases. */ @@ -371,10 +371,10 @@ export namespace VariantUpdateParams { export namespace Variants { export import VariantCreateResponse = VariantsAPI.VariantCreateResponse; - export import VariantUpdateResponse = VariantsAPI.VariantUpdateResponse; export import VariantListResponse = VariantsAPI.VariantListResponse; export import VariantDeleteResponse = VariantsAPI.VariantDeleteResponse; + export import VariantEditResponse = VariantsAPI.VariantEditResponse; export import VariantGetResponse = VariantsAPI.VariantGetResponse; export import VariantCreateParams = VariantsAPI.VariantCreateParams; - export import VariantUpdateParams = VariantsAPI.VariantUpdateParams; + export import VariantEditParams = VariantsAPI.VariantEditParams; } diff --git a/src/resources/index.ts b/src/resources/index.ts index 76f952bdde..b18692be4b 100644 --- a/src/resources/index.ts +++ b/src/resources/index.ts @@ -2,29 +2,29 @@ export { AICreateResponse, AICreateParams, AI } from './ai'; export { Access } from './access/access'; -export { - AccountListResponse, - AccountGetResponse, - AccountReplaceResponse, - AccountListParams, - AccountReplaceParams, - AccountListResponsesV4PagePaginationArray, - Accounts, -} from './accounts'; export { AccountMemberCreateResponse, + AccountMemberUpdateResponse, AccountMemberListResponse, AccountMemberDeleteResponse, AccountMemberGetResponse, - AccountMemberReplaceResponse, AccountMemberCreateParams, + AccountMemberUpdateParams, AccountMemberListParams, - AccountMemberReplaceParams, AccountMemberListResponsesV4PagePaginationArray, AccountMembers, } from './account-members'; +export { + AccountUpdateResponse, + AccountListResponse, + AccountGetResponse, + AccountUpdateParams, + AccountListParams, + AccountListResponsesV4PagePaginationArray, + Accounts, +} from './accounts'; export { Acm } from './acm/acm'; -export { ActivationCheckReplaceResponse, ActivationChecks } from './activation-checks'; +export { ActivationCheckUpdateResponse, ActivationChecks } from './activation-checks'; export { Addresses } from './addresses/addresses'; export { Addressing } from './addressing/addressing'; export { Alerting } from './alerting/alerting'; @@ -39,22 +39,22 @@ export { AvailablePlanListResponse, AvailablePlanGetResponse, AvailablePlans } f export { AvailableRatePlanListResponse, AvailableRatePlans } from './available-rate-plans'; export { Billings } from './billings/billings'; export { + BotManagementUpdateResponse, BotManagementGetResponse, - BotManagementReplaceResponse, - BotManagementReplaceParams, + BotManagementUpdateParams, BotManagement, } from './bot-management'; export { BrandProtection } from './brand-protection/brand-protection'; -export { Cache } from './cache/cache'; +export { CachePurgeResponse, CachePurgeParams, Cache } from './cache/cache'; export { CacheReserveCreateResponse, CacheReserveGetResponse, CacheReserve } from './cache-reserve'; export { CallCreateResponse, + CallUpdateResponse, CallListResponse, CallDeleteResponse, CallGetResponse, - CallReplaceResponse, CallCreateParams, - CallReplaceParams, + CallUpdateParams, Calls, } from './calls'; export { CertificateAuthorities } from './certificate-authorities/certificate-authorities'; @@ -69,9 +69,9 @@ export { export { Challenges } from './challenges/challenges'; export { ClientCertificateCreateResponse, - ClientCertificateUpdateResponse, ClientCertificateListResponse, ClientCertificateDeleteResponse, + ClientCertificateEditResponse, ClientCertificateGetResponse, ClientCertificateCreateParams, ClientCertificateListParams, @@ -80,25 +80,25 @@ export { } from './client-certificates'; export { CustomCertificateCreateResponse, - CustomCertificateUpdateResponse, CustomCertificateListResponse, CustomCertificateDeleteResponse, + CustomCertificateEditResponse, CustomCertificateGetResponse, CustomCertificateCreateParams, - CustomCertificateUpdateParams, CustomCertificateListParams, + CustomCertificateEditParams, CustomCertificateListResponsesV4PagePaginationArray, CustomCertificates, } from './custom-certificates/custom-certificates'; export { CustomHostnameCreateResponse, - CustomHostnameUpdateResponse, CustomHostnameListResponse, CustomHostnameDeleteResponse, + CustomHostnameEditResponse, CustomHostnameGetResponse, CustomHostnameCreateParams, - CustomHostnameUpdateParams, CustomHostnameListParams, + CustomHostnameEditParams, CustomHostnameListResponsesV4PagePaginationArray, CustomHostnames, } from './custom-hostnames/custom-hostnames'; @@ -117,37 +117,37 @@ export { DLP } from './dlp/dlp'; export { DNSAnalytics } from './dns-analytics/dns-analytics'; export { DNSFirewallCreateResponse, - DNSFirewallUpdateResponse, DNSFirewallListResponse, DNSFirewallDeleteResponse, + DNSFirewallEditResponse, DNSFirewallGetResponse, DNSFirewallCreateParams, - DNSFirewallUpdateParams, DNSFirewallListParams, + DNSFirewallEditParams, DNSFirewallListResponsesV4PagePaginationArray, DNSFirewall, } from './dns-firewall/dns-firewall'; export { DNSRecordCreateResponse, + DNSRecordUpdateResponse, DNSRecordListResponse, DNSRecordDeleteResponse, DNSRecordExportResponse, DNSRecordGetResponse, DNSRecordImportResponse, - DNSRecordReplaceResponse, DNSRecordScanResponse, DNSRecordCreateParams, + DNSRecordUpdateParams, DNSRecordListParams, DNSRecordImportParams, - DNSRecordReplaceParams, DNSRecordListResponsesV4PagePaginationArray, DNSRecords, } from './dns-records'; export { - DNSSECUpdateResponse, DNSSECDeleteResponse, + DNSSECEditResponse, DNSSECGetResponse, - DNSSECUpdateParams, + DNSSECEditParams, DNSSEC, } from './dnssec'; export { DcvDelegation } from './dcv-delegation/dcv-delegation'; @@ -157,13 +157,13 @@ export { Dispatchers } from './dispatchers/dispatchers'; export { Emails } from './emails/emails'; export { FilterCreateResponse, + FilterUpdateResponse, FilterListResponse, FilterDeleteResponse, FilterGetResponse, - FilterReplaceResponse, FilterCreateParams, + FilterUpdateParams, FilterListParams, - FilterReplaceParams, FilterListResponsesV4PagePaginationArray, Filters, } from './filters'; @@ -172,12 +172,12 @@ export { Firewalls } from './firewalls/firewalls'; export { GatewayCreateResponse, GatewayListResponse, Gateways } from './gateways/gateways'; export { HealthcheckCreateResponse, + HealthcheckUpdateResponse, HealthcheckListResponse, HealthcheckDeleteResponse, HealthcheckGetResponse, - HealthcheckReplaceResponse, HealthcheckCreateParams, - HealthcheckReplaceParams, + HealthcheckUpdateParams, Healthchecks, } from './healthchecks/healthchecks'; export { Hostnames } from './hostnames/hostnames'; @@ -187,40 +187,40 @@ export { Images } from './images/images'; export { Intel } from './intel/intel'; export { KeylessCertificateCreateResponse, - KeylessCertificateUpdateResponse, KeylessCertificateListResponse, KeylessCertificateDeleteResponse, + KeylessCertificateEditResponse, KeylessCertificateGetResponse, KeylessCertificateCreateParams, - KeylessCertificateUpdateParams, + KeylessCertificateEditParams, KeylessCertificates, } from './keyless-certificates'; export { LoadBalancerCreateResponse, - LoadBalancerUpdateResponse, LoadBalancerListResponse, LoadBalancerDeleteResponse, + LoadBalancerEditResponse, LoadBalancerGetResponse, LoadBalancerCreateParams, - LoadBalancerUpdateParams, + LoadBalancerEditParams, LoadBalancers, } from './load-balancers/load-balancers'; export { Logpush } from './logpush/logpush'; export { Logs } from './logs/logs'; export { Magics } from './magics/magics'; export { - ManagedHeaderUpdateResponse, ManagedHeaderListResponse, - ManagedHeaderUpdateParams, + ManagedHeaderEditResponse, + ManagedHeaderEditParams, ManagedHeaders, } from './managed-headers'; export { + MembershipUpdateResponse, MembershipListResponse, MembershipDeleteResponse, MembershipGetResponse, - MembershipReplaceResponse, + MembershipUpdateParams, MembershipListParams, - MembershipReplaceParams, MembershipListResponsesV4PagePaginationArray, Memberships, } from './memberships'; @@ -234,9 +234,9 @@ export { MtlsCertificates, } from './mtls-certificates/mtls-certificates'; export { + OriginPostQuantumEncryptionUpdateResponse, OriginPostQuantumEncryptionGetResponse, - OriginPostQuantumEncryptionReplaceResponse, - OriginPostQuantumEncryptionReplaceParams, + OriginPostQuantumEncryptionUpdateParams, OriginPostQuantumEncryption, } from './origin-post-quantum-encryption'; export { @@ -248,20 +248,20 @@ export { OriginTLSClientAuth, } from './origin-tls-client-auth/origin-tls-client-auth'; export { + PageShieldUpdateResponse, PageShieldListResponse, - PageShieldReplaceResponse, - PageShieldReplaceParams, + PageShieldUpdateParams, PageShield, } from './page-shield/page-shield'; export { PageruleCreateResponse, + PageruleUpdateResponse, PageruleListResponse, PageruleDeleteResponse, PageruleGetResponse, - PageruleReplaceResponse, PageruleCreateParams, + PageruleUpdateParams, PageruleListParams, - PageruleReplaceParams, Pagerules, } from './pagerules/pagerules'; export { Pages } from './pages/pages'; @@ -276,13 +276,13 @@ export { R2 } from './r2/r2'; export { Radar } from './radar/radar'; export { RateLimitCreateResponse, - RateLimitUpdateResponse, RateLimitListResponse, RateLimitDeleteResponse, + RateLimitEditResponse, RateLimitGetResponse, RateLimitCreateParams, - RateLimitUpdateParams, RateLimitListParams, + RateLimitEditParams, RateLimitListResponsesV4PagePaginationArray, RateLimits, } from './rate-limits'; @@ -292,11 +292,11 @@ export { RoleListResponse, RoleGetResponse, Roles } from './roles'; export { Rules } from './rules/rules'; export { RulesetCreateResponse, + RulesetUpdateResponse, RulesetListResponse, RulesetGetResponse, - RulesetReplaceResponse, RulesetCreateParams, - RulesetReplaceParams, + RulesetUpdateParams, Rulesets, } from './rulesets/rulesets'; export { Rum } from './rum/rum'; @@ -304,11 +304,11 @@ export { SSL } from './ssl/ssl'; export { SecondaryDNS } from './secondary-dns/secondary-dns'; export { SettingListResponse, SettingEditResponse, SettingEditParams, Settings } from './settings/settings'; export { + SnippetUpdateResponse, SnippetListResponse, SnippetDeleteResponse, SnippetGetResponse, - SnippetReplaceResponse, - SnippetReplaceParams, + SnippetUpdateParams, Snippets, } from './snippets/snippets'; export { Spectrum } from './spectrum/spectrum'; @@ -334,60 +334,60 @@ export { } from './stream/stream'; export { SubscriptionCreateResponse, + SubscriptionUpdateResponse, SubscriptionListResponse, SubscriptionDeleteResponse, SubscriptionGetResponse, - SubscriptionReplaceResponse, SubscriptionCreateParams, - SubscriptionReplaceParams, + SubscriptionUpdateParams, Subscriptions, } from './subscriptions'; export { Teamnet } from './teamnet/teamnet'; export { Teamnets } from './teamnets/teamnets'; export { TunnelCreateResponse, - TunnelUpdateResponse, TunnelListResponse, TunnelDeleteResponse, + TunnelEditResponse, TunnelGetResponse, TunnelCreateParams, - TunnelUpdateParams, TunnelListParams, TunnelDeleteParams, + TunnelEditParams, TunnelListResponsesV4PagePaginationArray, Tunnels, } from './tunnels/tunnels'; export { + URLNormalizationUpdateResponse, URLNormalizationGetResponse, - URLNormalizationReplaceResponse, - URLNormalizationReplaceParams, + URLNormalizationUpdateParams, URLNormalizations, } from './url-normalizations'; export { URLScannerScanResponse, URLScannerScanParams, URLScanner } from './url-scanner/url-scanner'; -export { UserUpdateResponse, UserListResponse, UserUpdateParams, Users } from './users/users'; +export { UserListResponse, UserEditResponse, UserEditParams, Users } from './users/users'; export { Vectorize } from './vectorize/vectorize'; export { WaitingRoomCreateResponse, + WaitingRoomUpdateResponse, WaitingRoomListResponse, WaitingRoomDeleteResponse, WaitingRoomGetResponse, WaitingRoomPreviewResponse, - WaitingRoomReplaceResponse, WaitingRoomCreateParams, + WaitingRoomUpdateParams, WaitingRoomPreviewParams, - WaitingRoomReplaceParams, WaitingRooms, } from './waiting-rooms/waiting-rooms'; export { WarpConnectorCreateResponse, - WarpConnectorUpdateResponse, WarpConnectorListResponse, WarpConnectorDeleteResponse, + WarpConnectorEditResponse, WarpConnectorGetResponse, WarpConnectorCreateParams, - WarpConnectorUpdateParams, WarpConnectorListParams, WarpConnectorDeleteParams, + WarpConnectorEditParams, WarpConnectorListResponsesV4PagePaginationArray, WarpConnector, } from './warp-connector'; @@ -396,17 +396,17 @@ export { WorkerDomainGetResponse, WorkerDomains } from './worker-domains'; export { WorkerScripts } from './worker-scripts/worker-scripts'; export { Workers } from './workers/workers'; export { WorkersForPlatforms } from './workers-for-platforms/workers-for-platforms'; -export { ZarazReplaceResponse, ZarazReplaceParams, Zaraz } from './zaraz/zaraz'; +export { ZarazUpdateResponse, ZarazUpdateParams, Zaraz } from './zaraz/zaraz'; export { Zerotrust } from './zerotrust/zerotrust'; export { ZoneCreateResponse, - ZoneUpdateResponse, ZoneListResponse, ZoneDeleteResponse, + ZoneEditResponse, ZoneGetResponse, ZoneCreateParams, - ZoneUpdateParams, ZoneListParams, + ZoneEditParams, ZoneListResponsesV4PagePaginationArray, Zones, } from './zones/zones'; diff --git a/src/resources/intel/index.ts b/src/resources/intel/index.ts index 965963fcd4..a95e89de32 100644 --- a/src/resources/intel/index.ts +++ b/src/resources/intel/index.ts @@ -8,12 +8,12 @@ export { IPGetResponse, IPGetParams, IPs } from './ips'; export { IPListGetResponse, IPLists } from './ip-lists'; export { IndicatorFeedCreateResponse, + IndicatorFeedUpdateResponse, IndicatorFeedListResponse, IndicatorFeedDataResponse, IndicatorFeedGetResponse, - IndicatorFeedReplaceResponse, IndicatorFeedCreateParams, - IndicatorFeedReplaceParams, + IndicatorFeedUpdateParams, IndicatorFeeds, } from './indicator-feeds/index'; export { Intel } from './intel'; diff --git a/src/resources/intel/indicator-feeds/index.ts b/src/resources/intel/indicator-feeds/index.ts index 1611c823c5..baca0adfbe 100644 --- a/src/resources/intel/indicator-feeds/index.ts +++ b/src/resources/intel/indicator-feeds/index.ts @@ -2,12 +2,12 @@ export { IndicatorFeedCreateResponse, + IndicatorFeedUpdateResponse, IndicatorFeedListResponse, IndicatorFeedDataResponse, IndicatorFeedGetResponse, - IndicatorFeedReplaceResponse, IndicatorFeedCreateParams, - IndicatorFeedReplaceParams, + IndicatorFeedUpdateParams, IndicatorFeeds, } from './indicator-feeds'; export { diff --git a/src/resources/intel/indicator-feeds/indicator-feeds.ts b/src/resources/intel/indicator-feeds/indicator-feeds.ts index b74405faef..faffdf0a6f 100644 --- a/src/resources/intel/indicator-feeds/indicator-feeds.ts +++ b/src/resources/intel/indicator-feeds/indicator-feeds.ts @@ -25,6 +25,23 @@ export class IndicatorFeeds extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Update indicator feed data + */ + update( + accountId: string, + feedId: number, + body: IndicatorFeedUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put( + `/accounts/${accountId}/intel/indicator-feeds/${feedId}/snapshot`, + multipartFormRequestOptions({ body, ...options }), + ) as Core.APIPromise<{ result: IndicatorFeedUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * Get indicator feeds owned by this account */ @@ -60,23 +77,6 @@ export class IndicatorFeeds extends APIResource { }> )._thenUnwrap((obj) => obj.result); } - - /** - * Update indicator feed data - */ - replace( - accountId: string, - feedId: number, - body: IndicatorFeedReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put( - `/accounts/${accountId}/intel/indicator-feeds/${feedId}/snapshot`, - multipartFormRequestOptions({ body, ...options }), - ) as Core.APIPromise<{ result: IndicatorFeedReplaceResponse }> - )._thenUnwrap((obj) => obj.result); - } } export interface IndicatorFeedCreateResponse { @@ -106,6 +106,23 @@ export interface IndicatorFeedCreateResponse { name?: string; } +export interface IndicatorFeedUpdateResponse { + /** + * Feed id + */ + file_id?: number; + + /** + * Name of the file unified in our system + */ + filename?: string; + + /** + * Current status of upload, should be unified + */ + status?: string; +} + export type IndicatorFeedListResponse = Array; export namespace IndicatorFeedListResponse { @@ -171,23 +188,6 @@ export interface IndicatorFeedGetResponse { name?: string; } -export interface IndicatorFeedReplaceResponse { - /** - * Feed id - */ - file_id?: number; - - /** - * Name of the file unified in our system - */ - filename?: string; - - /** - * Current status of upload, should be unified - */ - status?: string; -} - export interface IndicatorFeedCreateParams { /** * The description of the example test @@ -200,7 +200,7 @@ export interface IndicatorFeedCreateParams { name?: string; } -export interface IndicatorFeedReplaceParams { +export interface IndicatorFeedUpdateParams { /** * The file to upload */ @@ -209,12 +209,12 @@ export interface IndicatorFeedReplaceParams { export namespace IndicatorFeeds { export import IndicatorFeedCreateResponse = IndicatorFeedsAPI.IndicatorFeedCreateResponse; + export import IndicatorFeedUpdateResponse = IndicatorFeedsAPI.IndicatorFeedUpdateResponse; export import IndicatorFeedListResponse = IndicatorFeedsAPI.IndicatorFeedListResponse; export import IndicatorFeedDataResponse = IndicatorFeedsAPI.IndicatorFeedDataResponse; export import IndicatorFeedGetResponse = IndicatorFeedsAPI.IndicatorFeedGetResponse; - export import IndicatorFeedReplaceResponse = IndicatorFeedsAPI.IndicatorFeedReplaceResponse; export import IndicatorFeedCreateParams = IndicatorFeedsAPI.IndicatorFeedCreateParams; - export import IndicatorFeedReplaceParams = IndicatorFeedsAPI.IndicatorFeedReplaceParams; + export import IndicatorFeedUpdateParams = IndicatorFeedsAPI.IndicatorFeedUpdateParams; export import Permissions = PermissionsAPI.Permissions; export import PermissionCreateResponse = PermissionsAPI.PermissionCreateResponse; export import PermissionListResponse = PermissionsAPI.PermissionListResponse; diff --git a/src/resources/intel/intel.ts b/src/resources/intel/intel.ts index 4b0fa14d37..bdbd127257 100644 --- a/src/resources/intel/intel.ts +++ b/src/resources/intel/intel.ts @@ -52,12 +52,12 @@ export namespace Intel { export import WhoisGetParams = WhoisAPI.WhoisGetParams; export import IndicatorFeeds = IndicatorFeedsAPI.IndicatorFeeds; export import IndicatorFeedCreateResponse = IndicatorFeedsAPI.IndicatorFeedCreateResponse; + export import IndicatorFeedUpdateResponse = IndicatorFeedsAPI.IndicatorFeedUpdateResponse; export import IndicatorFeedListResponse = IndicatorFeedsAPI.IndicatorFeedListResponse; export import IndicatorFeedDataResponse = IndicatorFeedsAPI.IndicatorFeedDataResponse; export import IndicatorFeedGetResponse = IndicatorFeedsAPI.IndicatorFeedGetResponse; - export import IndicatorFeedReplaceResponse = IndicatorFeedsAPI.IndicatorFeedReplaceResponse; export import IndicatorFeedCreateParams = IndicatorFeedsAPI.IndicatorFeedCreateParams; - export import IndicatorFeedReplaceParams = IndicatorFeedsAPI.IndicatorFeedReplaceParams; + export import IndicatorFeedUpdateParams = IndicatorFeedsAPI.IndicatorFeedUpdateParams; export import Sinkholes = SinkholesAPI.Sinkholes; export import SinkholeListResponse = SinkholesAPI.SinkholeListResponse; } diff --git a/src/resources/keyless-certificates.ts b/src/resources/keyless-certificates.ts index f9ab55bc42..bb76a26459 100644 --- a/src/resources/keyless-certificates.ts +++ b/src/resources/keyless-certificates.ts @@ -20,24 +20,6 @@ export class KeylessCertificates extends APIResource { )._thenUnwrap((obj) => obj.result); } - /** - * This will update attributes of a Keyless SSL. Consists of one or more of the - * following: host,name,port. - */ - update( - zoneId: string, - keylessCertificateId: string, - body: KeylessCertificateUpdateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.patch(`/zones/${zoneId}/keyless_certificates/${keylessCertificateId}`, { - body, - ...options, - }) as Core.APIPromise<{ result: KeylessCertificateUpdateResponse }> - )._thenUnwrap((obj) => obj.result); - } - /** * List all Keyless SSL configurations for a given zone. */ @@ -68,6 +50,24 @@ export class KeylessCertificates extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * This will update attributes of a Keyless SSL. Consists of one or more of the + * following: host,name,port. + */ + edit( + zoneId: string, + keylessCertificateId: string, + body: KeylessCertificateEditParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.patch(`/zones/${zoneId}/keyless_certificates/${keylessCertificateId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: KeylessCertificateEditResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * Get details for one Keyless SSL configuration. */ @@ -156,77 +156,6 @@ export namespace KeylessCertificateCreateResponse { } } -export interface KeylessCertificateUpdateResponse { - /** - * Keyless certificate identifier tag. - */ - id: string; - - /** - * When the Keyless SSL was created. - */ - created_on: string; - - /** - * Whether or not the Keyless SSL is on or off. - */ - enabled: boolean; - - /** - * The keyless SSL name. - */ - host: string; - - /** - * When the Keyless SSL was last modified. - */ - modified_on: string; - - /** - * The keyless SSL name. - */ - name: string; - - /** - * Available permissions for the Keyless SSL for the current user requesting the - * item. - */ - permissions: Array; - - /** - * The keyless SSL port used to communicate between Cloudflare and the client's - * Keyless SSL server. - */ - port: number; - - /** - * Status of the Keyless SSL. - */ - status: 'active' | 'deleted'; - - /** - * Configuration for using Keyless SSL through a Cloudflare Tunnel - */ - tunnel?: KeylessCertificateUpdateResponse.Tunnel; -} - -export namespace KeylessCertificateUpdateResponse { - /** - * Configuration for using Keyless SSL through a Cloudflare Tunnel - */ - export interface Tunnel { - /** - * Private IP of the Key Server Host - */ - private_ip: string; - - /** - * Cloudflare Tunnel Virtual Network ID - */ - vnet_id: string; - } -} - export type KeylessCertificateListResponse = Array; @@ -310,6 +239,77 @@ export interface KeylessCertificateDeleteResponse { id?: string; } +export interface KeylessCertificateEditResponse { + /** + * Keyless certificate identifier tag. + */ + id: string; + + /** + * When the Keyless SSL was created. + */ + created_on: string; + + /** + * Whether or not the Keyless SSL is on or off. + */ + enabled: boolean; + + /** + * The keyless SSL name. + */ + host: string; + + /** + * When the Keyless SSL was last modified. + */ + modified_on: string; + + /** + * The keyless SSL name. + */ + name: string; + + /** + * Available permissions for the Keyless SSL for the current user requesting the + * item. + */ + permissions: Array; + + /** + * The keyless SSL port used to communicate between Cloudflare and the client's + * Keyless SSL server. + */ + port: number; + + /** + * Status of the Keyless SSL. + */ + status: 'active' | 'deleted'; + + /** + * Configuration for using Keyless SSL through a Cloudflare Tunnel + */ + tunnel?: KeylessCertificateEditResponse.Tunnel; +} + +export namespace KeylessCertificateEditResponse { + /** + * Configuration for using Keyless SSL through a Cloudflare Tunnel + */ + export interface Tunnel { + /** + * Private IP of the Key Server Host + */ + private_ip: string; + + /** + * Cloudflare Tunnel Virtual Network ID + */ + vnet_id: string; + } +} + export interface KeylessCertificateGetResponse { /** * Keyless certificate identifier tag. @@ -434,7 +434,7 @@ export namespace KeylessCertificateCreateParams { } } -export interface KeylessCertificateUpdateParams { +export interface KeylessCertificateEditParams { /** * Whether or not the Keyless SSL is on or off. */ @@ -459,10 +459,10 @@ export interface KeylessCertificateUpdateParams { /** * Configuration for using Keyless SSL through a Cloudflare Tunnel */ - tunnel?: KeylessCertificateUpdateParams.Tunnel; + tunnel?: KeylessCertificateEditParams.Tunnel; } -export namespace KeylessCertificateUpdateParams { +export namespace KeylessCertificateEditParams { /** * Configuration for using Keyless SSL through a Cloudflare Tunnel */ @@ -481,10 +481,10 @@ export namespace KeylessCertificateUpdateParams { export namespace KeylessCertificates { export import KeylessCertificateCreateResponse = KeylessCertificatesAPI.KeylessCertificateCreateResponse; - export import KeylessCertificateUpdateResponse = KeylessCertificatesAPI.KeylessCertificateUpdateResponse; export import KeylessCertificateListResponse = KeylessCertificatesAPI.KeylessCertificateListResponse; export import KeylessCertificateDeleteResponse = KeylessCertificatesAPI.KeylessCertificateDeleteResponse; + export import KeylessCertificateEditResponse = KeylessCertificatesAPI.KeylessCertificateEditResponse; export import KeylessCertificateGetResponse = KeylessCertificatesAPI.KeylessCertificateGetResponse; export import KeylessCertificateCreateParams = KeylessCertificatesAPI.KeylessCertificateCreateParams; - export import KeylessCertificateUpdateParams = KeylessCertificatesAPI.KeylessCertificateUpdateParams; + export import KeylessCertificateEditParams = KeylessCertificatesAPI.KeylessCertificateEditParams; } diff --git a/src/resources/load-balancers/index.ts b/src/resources/load-balancers/index.ts index af8b7b9ea8..8f0e46b494 100644 --- a/src/resources/load-balancers/index.ts +++ b/src/resources/load-balancers/index.ts @@ -2,33 +2,33 @@ export { LoadBalancerCreateResponse, - LoadBalancerUpdateResponse, LoadBalancerListResponse, LoadBalancerDeleteResponse, + LoadBalancerEditResponse, LoadBalancerGetResponse, LoadBalancerCreateParams, - LoadBalancerUpdateParams, + LoadBalancerEditParams, LoadBalancers, } from './load-balancers'; export { MonitorCreateResponse, - MonitorUpdateResponse, MonitorListResponse, MonitorDeleteResponse, + MonitorEditResponse, MonitorGetResponse, MonitorCreateParams, - MonitorUpdateParams, + MonitorEditParams, Monitors, } from './monitors/index'; export { PoolCreateResponse, - PoolUpdateResponse, PoolListResponse, PoolDeleteResponse, + PoolEditResponse, PoolGetResponse, PoolCreateParams, - PoolUpdateParams, PoolListParams, + PoolEditParams, Pools, } from './pools/index'; export { PreviewGetResponse, Previews } from './previews'; diff --git a/src/resources/load-balancers/load-balancers.ts b/src/resources/load-balancers/load-balancers.ts index 77bd67df8b..bbec29560a 100644 --- a/src/resources/load-balancers/load-balancers.ts +++ b/src/resources/load-balancers/load-balancers.ts @@ -31,23 +31,6 @@ export class LoadBalancers extends APIResource { )._thenUnwrap((obj) => obj.result); } - /** - * Apply changes to an existing load balancer, overwriting the supplied properties. - */ - update( - zoneId: string, - loadBalancerId: string, - body: LoadBalancerUpdateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.patch(`/zones/${zoneId}/load_balancers/${loadBalancerId}`, { - body, - ...options, - }) as Core.APIPromise<{ result: LoadBalancerUpdateResponse }> - )._thenUnwrap((obj) => obj.result); - } - /** * List configured load balancers. */ @@ -74,6 +57,23 @@ export class LoadBalancers extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Apply changes to an existing load balancer, overwriting the supplied properties. + */ + edit( + zoneId: string, + loadBalancerId: string, + body: LoadBalancerEditParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.patch(`/zones/${zoneId}/load_balancers/${loadBalancerId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: LoadBalancerEditResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * Fetch a single configured load balancer. */ @@ -789,1412 +789,1412 @@ export namespace LoadBalancerCreateResponse { } } -export interface LoadBalancerUpdateResponse { - id?: string; - - /** - * 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. - */ - adaptive_routing?: LoadBalancerUpdateResponse.AdaptiveRouting; +export type LoadBalancerListResponse = Array; - /** - * 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. - */ - country_pools?: unknown; +export namespace LoadBalancerListResponse { + export interface LoadBalancerListResponseItem { + id?: string; - created_on?: string; + /** + * 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. + */ + adaptive_routing?: LoadBalancerListResponseItem.AdaptiveRouting; - /** - * 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. - */ - default_pools?: Array; + /** + * 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. + */ + country_pools?: unknown; - /** - * Object description. - */ - description?: string; + created_on?: string; - /** - * Whether to enable (the default) this load balancer. - */ - enabled?: boolean; + /** + * 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. + */ + default_pools?: Array; - /** - * The pool ID to use when all other pools are detected as unhealthy. - */ - fallback_pool?: unknown; + /** + * Object description. + */ + description?: string; - /** - * Controls location-based steering for non-proxied requests. See `steering_policy` - * to learn how steering is affected. - */ - location_strategy?: LoadBalancerUpdateResponse.LocationStrategy; + /** + * Whether to enable (the default) this load balancer. + */ + enabled?: boolean; - modified_on?: string; + /** + * The pool ID to use when all other pools are detected as unhealthy. + */ + fallback_pool?: unknown; - /** - * The DNS hostname to associate with your Load Balancer. If this hostname already - * exists as a DNS record in Cloudflare's DNS, the Load Balancer will take - * precedence and the DNS record will not be used. - */ - name?: string; + /** + * Controls location-based steering for non-proxied requests. See `steering_policy` + * to learn how steering is affected. + */ + location_strategy?: LoadBalancerListResponseItem.LocationStrategy; - /** - * (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. - */ - pop_pools?: unknown; + modified_on?: string; - /** - * Whether the hostname should be gray clouded (false) or orange clouded (true). - */ - proxied?: boolean; + /** + * The DNS hostname to associate with your Load Balancer. If this hostname already + * exists as a DNS record in Cloudflare's DNS, the Load Balancer will take + * precedence and the DNS record will not be used. + */ + name?: string; - /** - * 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. - */ - random_steering?: LoadBalancerUpdateResponse.RandomSteering; + /** + * (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. + */ + pop_pools?: unknown; - /** - * 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. - */ - region_pools?: unknown; + /** + * Whether the hostname should be gray clouded (false) or orange clouded (true). + */ + proxied?: boolean; - /** - * BETA Field Not General Access: A list of rules for this load balancer to - * execute. - */ - rules?: Array; + /** + * 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. + */ + random_steering?: LoadBalancerListResponseItem.RandomSteering; - /** - * 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?: 'none' | 'cookie' | 'ip_cookie' | 'header' | '""'; + /** + * 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. + */ + region_pools?: unknown; - /** - * Configures attributes for session affinity. - */ - session_affinity_attributes?: LoadBalancerUpdateResponse.SessionAffinityAttributes; + /** + * BETA Field Not General Access: A list of rules for this load balancer to + * execute. + */ + rules?: Array; - /** - * 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. - */ - session_affinity_ttl?: number; + /** + * 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?: 'none' | 'cookie' | 'ip_cookie' | 'header' | '""'; - /** - * 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"`. - */ - steering_policy?: - | 'off' - | 'geo' - | 'random' - | 'dynamic_latency' - | 'proximity' - | 'least_outstanding_requests' - | 'least_connections' - | '""'; - - /** - * 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. - */ - ttl?: number; -} - -export namespace LoadBalancerUpdateResponse { - /** - * 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. - */ - export interface AdaptiveRouting { /** - * Extends zero-downtime failover of requests to healthy origins from alternate - * pools, when no healthy alternate exists in the same pool, according to the - * failover order defined by traffic and origin steering. When set false (the - * default) zero-downtime failover will only occur between origins within the same - * pool. See `session_affinity_attributes` for control over when sessions are - * broken or reassigned. + * Configures attributes for session affinity. */ - failover_across_pools?: boolean; - } + session_affinity_attributes?: LoadBalancerListResponseItem.SessionAffinityAttributes; - /** - * Controls location-based steering for non-proxied requests. See `steering_policy` - * to learn how steering is affected. - */ - export interface LocationStrategy { /** - * Determines the authoritative location when ECS is not preferred, does not exist - * in the request, or its GeoIP lookup is unsuccessful. + * 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: * - * - `"pop"`: Use the Cloudflare PoP location. - * - `"resolver_ip"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is - * unsuccessful, use the Cloudflare PoP location. + * - `"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. */ - mode?: 'pop' | 'resolver_ip'; + session_affinity_ttl?: number; /** - * Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the - * authoritative location. + * Steering Policy for this load balancer. * - * - `"always"`: Always prefer ECS. - * - `"never"`: Never prefer ECS. - * - `"proximity"`: Prefer ECS only when `steering_policy="proximity"`. - * - `"geo"`: Prefer ECS only when `steering_policy="geo"`. - */ - prefer_ecs?: 'always' | 'never' | 'proximity' | 'geo'; - } - - /** - * 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. - */ - export interface RandomSteering { - /** - * The default weight for pools in the load balancer that are not specified in the - * pool_weights map. + * - `"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"`. */ - default_weight?: number; + steering_policy?: + | 'off' + | 'geo' + | 'random' + | 'dynamic_latency' + | 'proximity' + | 'least_outstanding_requests' + | 'least_connections' + | '""'; /** - * A mapping of pool IDs to custom weights. The weight is relative to other pools - * in the load balancer. + * 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. */ - pool_weights?: unknown; + ttl?: number; } - /** - * A rule object containing conditions and overrides for this load balancer to - * evaluate. - */ - export interface Rule { - /** - * 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. - */ - condition?: string; - - /** - * Disable this specific rule. It will no longer be evaluated by this load - * balancer. - */ - disabled?: boolean; - - /** - * 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. - */ - fixed_response?: Rule.FixedResponse; - - /** - * Name of this rule. Only used for human readability. - */ - name?: string; - - /** - * A collection of overrides to apply to the load balancer when this rule's - * condition is true. All fields are optional. - */ - overrides?: Rule.Overrides; - - /** - * 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. - */ - priority?: number; - + export namespace LoadBalancerListResponseItem { /** - * If this rule's condition is true, this causes rule evaluation to stop after - * processing this rule. + * 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. */ - terminates?: boolean; - } + export interface AdaptiveRouting { + /** + * Extends zero-downtime failover of requests to healthy origins from alternate + * pools, when no healthy alternate exists in the same pool, according to the + * failover order defined by traffic and origin steering. When set false (the + * default) zero-downtime failover will only occur between origins within the same + * pool. See `session_affinity_attributes` for control over when sessions are + * broken or reassigned. + */ + failover_across_pools?: boolean; + } - export namespace Rule { /** - * 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. + * Controls location-based steering for non-proxied requests. See `steering_policy` + * to learn how steering is affected. */ - export interface FixedResponse { + export interface LocationStrategy { /** - * The http 'Content-Type' header to include in the response. + * Determines the authoritative location when ECS is not preferred, does not exist + * in the request, or its GeoIP lookup is unsuccessful. + * + * - `"pop"`: Use the Cloudflare PoP location. + * - `"resolver_ip"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is + * unsuccessful, use the Cloudflare PoP location. */ - content_type?: string; + mode?: 'pop' | 'resolver_ip'; /** - * The http 'Location' header to include in the response. + * Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the + * authoritative location. + * + * - `"always"`: Always prefer ECS. + * - `"never"`: Never prefer ECS. + * - `"proximity"`: Prefer ECS only when `steering_policy="proximity"`. + * - `"geo"`: Prefer ECS only when `steering_policy="geo"`. */ - location?: string; + prefer_ecs?: 'always' | 'never' | 'proximity' | 'geo'; + } + /** + * 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. + */ + export interface RandomSteering { /** - * Text to include as the http body. + * The default weight for pools in the load balancer that are not specified in the + * pool_weights map. */ - message_body?: string; + default_weight?: number; /** - * The http status code to respond with. + * A mapping of pool IDs to custom weights. The weight is relative to other pools + * in the load balancer. */ - status_code?: number; + pool_weights?: unknown; } /** - * A collection of overrides to apply to the load balancer when this rule's - * condition is true. All fields are optional. + * A rule object containing conditions and overrides for this load balancer to + * evaluate. */ - export interface Overrides { - /** - * 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. - */ - adaptive_routing?: Overrides.AdaptiveRouting; - - /** - * 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. - */ - country_pools?: unknown; - - /** - * 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. - */ - default_pools?: Array; - - /** - * The pool ID to use when all other pools are detected as unhealthy. - */ - fallback_pool?: unknown; - - /** - * Controls location-based steering for non-proxied requests. See `steering_policy` - * to learn how steering is affected. - */ - location_strategy?: Overrides.LocationStrategy; - - /** - * (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. - */ - pop_pools?: unknown; - + export interface Rule { /** - * 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. + * 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. */ - random_steering?: Overrides.RandomSteering; + condition?: string; /** - * 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. + * Disable this specific rule. It will no longer be evaluated by this load + * balancer. */ - region_pools?: unknown; + disabled?: boolean; /** - * 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. + * 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. */ - session_affinity?: 'none' | 'cookie' | 'ip_cookie' | 'header' | '""'; + fixed_response?: Rule.FixedResponse; /** - * Configures attributes for session affinity. + * Name of this rule. Only used for human readability. */ - session_affinity_attributes?: Overrides.SessionAffinityAttributes; + name?: string; /** - * 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. + * A collection of overrides to apply to the load balancer when this rule's + * condition is true. All fields are optional. */ - session_affinity_ttl?: number; + overrides?: Rule.Overrides; /** - * 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"`. + * 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. */ - steering_policy?: - | 'off' - | 'geo' - | 'random' - | 'dynamic_latency' - | 'proximity' - | 'least_outstanding_requests' - | 'least_connections' - | '""'; + priority?: number; /** - * 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. + * If this rule's condition is true, this causes rule evaluation to stop after + * processing this rule. */ - ttl?: number; + terminates?: boolean; } - export namespace Overrides { + export namespace Rule { /** - * 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. + * 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. */ - export interface AdaptiveRouting { + export interface FixedResponse { /** - * Extends zero-downtime failover of requests to healthy origins from alternate - * pools, when no healthy alternate exists in the same pool, according to the - * failover order defined by traffic and origin steering. When set false (the - * default) zero-downtime failover will only occur between origins within the same - * pool. See `session_affinity_attributes` for control over when sessions are - * broken or reassigned. + * The http 'Content-Type' header to include in the response. */ - failover_across_pools?: boolean; - } + content_type?: string; - /** - * Controls location-based steering for non-proxied requests. See `steering_policy` - * to learn how steering is affected. - */ - export interface LocationStrategy { /** - * Determines the authoritative location when ECS is not preferred, does not exist - * in the request, or its GeoIP lookup is unsuccessful. - * - * - `"pop"`: Use the Cloudflare PoP location. - * - `"resolver_ip"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is - * unsuccessful, use the Cloudflare PoP location. + * The http 'Location' header to include in the response. */ - mode?: 'pop' | 'resolver_ip'; + location?: string; /** - * Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the - * authoritative location. - * - * - `"always"`: Always prefer ECS. - * - `"never"`: Never prefer ECS. - * - `"proximity"`: Prefer ECS only when `steering_policy="proximity"`. - * - `"geo"`: Prefer ECS only when `steering_policy="geo"`. + * Text to include as the http body. */ - prefer_ecs?: 'always' | 'never' | 'proximity' | 'geo'; + message_body?: string; + + /** + * The http status code to respond with. + */ + status_code?: number; } /** - * 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. + * A collection of overrides to apply to the load balancer when this rule's + * condition is true. All fields are optional. */ - export interface RandomSteering { + export interface Overrides { /** - * The default weight for pools in the load balancer that are not specified in the - * pool_weights map. + * 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. */ - default_weight?: number; + adaptive_routing?: Overrides.AdaptiveRouting; /** - * A mapping of pool IDs to custom weights. The weight is relative to other pools - * in the load balancer. + * 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. */ - pool_weights?: unknown; - } + country_pools?: unknown; - /** - * Configures attributes for session affinity. - */ - export interface SessionAffinityAttributes { /** - * Configures the drain duration in seconds. This field is only used when session - * affinity is enabled on the load balancer. + * 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. */ - drain_duration?: number; + default_pools?: Array; /** - * Configures the names of HTTP headers to base session affinity on when header - * `session_affinity` is enabled. At least one HTTP header name must be provided. - * To specify the exact cookies to be used, include an item in the following - * format: `"cookie:,"` (example) where everything - * after the colon is a comma-separated list of cookie names. Providing only - * `"cookie"` will result in all cookies being used. The default max number of HTTP - * header names that can be provided depends on your plan: 5 for Enterprise, 1 for - * all other plans. + * The pool ID to use when all other pools are detected as unhealthy. */ - headers?: Array; + fallback_pool?: unknown; /** - * When header `session_affinity` is enabled, this option can be used to specify - * how HTTP headers on load balancing requests will be used. The supported values - * are: - * - * - `"true"`: Load balancing requests must contain _all_ of the HTTP headers - * specified by the `headers` session affinity attribute, otherwise sessions - * aren't created. - * - `"false"`: Load balancing requests must contain _at least one_ of the HTTP - * headers specified by the `headers` session affinity attribute, otherwise - * sessions aren't created. + * Controls location-based steering for non-proxied requests. See `steering_policy` + * to learn how steering is affected. */ - require_all_headers?: boolean; + location_strategy?: Overrides.LocationStrategy; /** - * Configures the SameSite attribute on session affinity cookie. Value "Auto" will - * be translated to "Lax" or "None" depending if Always Use HTTPS is enabled. Note: - * when using value "None", the secure attribute can not be set to "Never". + * (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. */ - samesite?: 'Auto' | 'Lax' | 'None' | 'Strict'; + pop_pools?: unknown; /** - * Configures the Secure attribute on session affinity cookie. Value "Always" - * indicates the Secure attribute will be set in the Set-Cookie header, "Never" - * indicates the Secure attribute will not be set, and "Auto" will set the Secure - * attribute depending if Always Use HTTPS is enabled. + * 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. */ - secure?: 'Auto' | 'Always' | 'Never'; + random_steering?: Overrides.RandomSteering; /** - * Configures the zero-downtime failover between origins within a pool when session - * affinity is enabled. This feature is currently incompatible with Argo, Tiered - * Cache, and Bandwidth Alliance. The supported values are: - * - * - `"none"`: No failover takes place for sessions pinned to the origin (default). - * - `"temporary"`: Traffic will be sent to another other healthy origin until the - * originally pinned origin is available; note that this can potentially result - * in heavy origin flapping. - * - `"sticky"`: The session affinity cookie is updated and subsequent requests are - * sent to the new origin. Note: Zero-downtime failover with sticky sessions is - * currently not supported for session affinity by header. + * 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. */ - zero_downtime_failover?: 'none' | 'temporary' | 'sticky'; - } - } - } + region_pools?: unknown; - /** - * Configures attributes for session affinity. - */ - export interface SessionAffinityAttributes { - /** - * Configures the drain duration in seconds. This field is only used when session - * affinity is enabled on the load balancer. - */ - drain_duration?: number; + /** + * 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?: 'none' | 'cookie' | 'ip_cookie' | 'header' | '""'; - /** - * Configures the names of HTTP headers to base session affinity on when header - * `session_affinity` is enabled. At least one HTTP header name must be provided. - * To specify the exact cookies to be used, include an item in the following - * format: `"cookie:,"` (example) where everything - * after the colon is a comma-separated list of cookie names. Providing only - * `"cookie"` will result in all cookies being used. The default max number of HTTP - * header names that can be provided depends on your plan: 5 for Enterprise, 1 for - * all other plans. - */ - headers?: Array; + /** + * Configures attributes for session affinity. + */ + session_affinity_attributes?: Overrides.SessionAffinityAttributes; - /** - * When header `session_affinity` is enabled, this option can be used to specify - * how HTTP headers on load balancing requests will be used. The supported values - * are: - * - * - `"true"`: Load balancing requests must contain _all_ of the HTTP headers - * specified by the `headers` session affinity attribute, otherwise sessions - * aren't created. - * - `"false"`: Load balancing requests must contain _at least one_ of the HTTP - * headers specified by the `headers` session affinity attribute, otherwise - * sessions aren't created. - */ - require_all_headers?: boolean; + /** + * 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. + */ + session_affinity_ttl?: number; - /** - * Configures the SameSite attribute on session affinity cookie. Value "Auto" will - * be translated to "Lax" or "None" depending if Always Use HTTPS is enabled. Note: - * when using value "None", the secure attribute can not be set to "Never". - */ - samesite?: 'Auto' | 'Lax' | 'None' | 'Strict'; + /** + * 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"`. + */ + steering_policy?: + | 'off' + | 'geo' + | 'random' + | 'dynamic_latency' + | 'proximity' + | 'least_outstanding_requests' + | 'least_connections' + | '""'; - /** - * Configures the Secure attribute on session affinity cookie. Value "Always" - * indicates the Secure attribute will be set in the Set-Cookie header, "Never" - * indicates the Secure attribute will not be set, and "Auto" will set the Secure - * attribute depending if Always Use HTTPS is enabled. - */ - secure?: 'Auto' | 'Always' | 'Never'; + /** + * 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. + */ + ttl?: number; + } - /** - * Configures the zero-downtime failover between origins within a pool when session - * affinity is enabled. This feature is currently incompatible with Argo, Tiered - * Cache, and Bandwidth Alliance. The supported values are: - * - * - `"none"`: No failover takes place for sessions pinned to the origin (default). - * - `"temporary"`: Traffic will be sent to another other healthy origin until the - * originally pinned origin is available; note that this can potentially result - * in heavy origin flapping. - * - `"sticky"`: The session affinity cookie is updated and subsequent requests are - * sent to the new origin. Note: Zero-downtime failover with sticky sessions is - * currently not supported for session affinity by header. - */ - zero_downtime_failover?: 'none' | 'temporary' | 'sticky'; - } -} + export namespace Overrides { + /** + * 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. + */ + export interface AdaptiveRouting { + /** + * Extends zero-downtime failover of requests to healthy origins from alternate + * pools, when no healthy alternate exists in the same pool, according to the + * failover order defined by traffic and origin steering. When set false (the + * default) zero-downtime failover will only occur between origins within the same + * pool. See `session_affinity_attributes` for control over when sessions are + * broken or reassigned. + */ + failover_across_pools?: boolean; + } -export type LoadBalancerListResponse = Array; + /** + * Controls location-based steering for non-proxied requests. See `steering_policy` + * to learn how steering is affected. + */ + export interface LocationStrategy { + /** + * Determines the authoritative location when ECS is not preferred, does not exist + * in the request, or its GeoIP lookup is unsuccessful. + * + * - `"pop"`: Use the Cloudflare PoP location. + * - `"resolver_ip"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is + * unsuccessful, use the Cloudflare PoP location. + */ + mode?: 'pop' | 'resolver_ip'; -export namespace LoadBalancerListResponse { - export interface LoadBalancerListResponseItem { - id?: string; + /** + * Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the + * authoritative location. + * + * - `"always"`: Always prefer ECS. + * - `"never"`: Never prefer ECS. + * - `"proximity"`: Prefer ECS only when `steering_policy="proximity"`. + * - `"geo"`: Prefer ECS only when `steering_policy="geo"`. + */ + prefer_ecs?: 'always' | 'never' | 'proximity' | 'geo'; + } - /** - * 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. - */ - adaptive_routing?: LoadBalancerListResponseItem.AdaptiveRouting; - - /** - * 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. - */ - country_pools?: unknown; + /** + * 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. + */ + export interface RandomSteering { + /** + * The default weight for pools in the load balancer that are not specified in the + * pool_weights map. + */ + default_weight?: number; - created_on?: string; + /** + * A mapping of pool IDs to custom weights. The weight is relative to other pools + * in the load balancer. + */ + pool_weights?: unknown; + } - /** - * 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. - */ - default_pools?: Array; + /** + * Configures attributes for session affinity. + */ + export interface SessionAffinityAttributes { + /** + * Configures the drain duration in seconds. This field is only used when session + * affinity is enabled on the load balancer. + */ + drain_duration?: number; - /** - * Object description. - */ - description?: string; + /** + * Configures the names of HTTP headers to base session affinity on when header + * `session_affinity` is enabled. At least one HTTP header name must be provided. + * To specify the exact cookies to be used, include an item in the following + * format: `"cookie:,"` (example) where everything + * after the colon is a comma-separated list of cookie names. Providing only + * `"cookie"` will result in all cookies being used. The default max number of HTTP + * header names that can be provided depends on your plan: 5 for Enterprise, 1 for + * all other plans. + */ + headers?: Array; - /** - * Whether to enable (the default) this load balancer. - */ - enabled?: boolean; + /** + * When header `session_affinity` is enabled, this option can be used to specify + * how HTTP headers on load balancing requests will be used. The supported values + * are: + * + * - `"true"`: Load balancing requests must contain _all_ of the HTTP headers + * specified by the `headers` session affinity attribute, otherwise sessions + * aren't created. + * - `"false"`: Load balancing requests must contain _at least one_ of the HTTP + * headers specified by the `headers` session affinity attribute, otherwise + * sessions aren't created. + */ + require_all_headers?: boolean; - /** - * The pool ID to use when all other pools are detected as unhealthy. - */ - fallback_pool?: unknown; + /** + * Configures the SameSite attribute on session affinity cookie. Value "Auto" will + * be translated to "Lax" or "None" depending if Always Use HTTPS is enabled. Note: + * when using value "None", the secure attribute can not be set to "Never". + */ + samesite?: 'Auto' | 'Lax' | 'None' | 'Strict'; - /** - * Controls location-based steering for non-proxied requests. See `steering_policy` - * to learn how steering is affected. - */ - location_strategy?: LoadBalancerListResponseItem.LocationStrategy; + /** + * Configures the Secure attribute on session affinity cookie. Value "Always" + * indicates the Secure attribute will be set in the Set-Cookie header, "Never" + * indicates the Secure attribute will not be set, and "Auto" will set the Secure + * attribute depending if Always Use HTTPS is enabled. + */ + secure?: 'Auto' | 'Always' | 'Never'; - modified_on?: string; + /** + * Configures the zero-downtime failover between origins within a pool when session + * affinity is enabled. This feature is currently incompatible with Argo, Tiered + * Cache, and Bandwidth Alliance. The supported values are: + * + * - `"none"`: No failover takes place for sessions pinned to the origin (default). + * - `"temporary"`: Traffic will be sent to another other healthy origin until the + * originally pinned origin is available; note that this can potentially result + * in heavy origin flapping. + * - `"sticky"`: The session affinity cookie is updated and subsequent requests are + * sent to the new origin. Note: Zero-downtime failover with sticky sessions is + * currently not supported for session affinity by header. + */ + zero_downtime_failover?: 'none' | 'temporary' | 'sticky'; + } + } + } /** - * The DNS hostname to associate with your Load Balancer. If this hostname already - * exists as a DNS record in Cloudflare's DNS, the Load Balancer will take - * precedence and the DNS record will not be used. + * Configures attributes for session affinity. */ - name?: string; + export interface SessionAffinityAttributes { + /** + * Configures the drain duration in seconds. This field is only used when session + * affinity is enabled on the load balancer. + */ + drain_duration?: number; - /** - * (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. - */ - pop_pools?: unknown; + /** + * Configures the names of HTTP headers to base session affinity on when header + * `session_affinity` is enabled. At least one HTTP header name must be provided. + * To specify the exact cookies to be used, include an item in the following + * format: `"cookie:,"` (example) where everything + * after the colon is a comma-separated list of cookie names. Providing only + * `"cookie"` will result in all cookies being used. The default max number of HTTP + * header names that can be provided depends on your plan: 5 for Enterprise, 1 for + * all other plans. + */ + headers?: Array; - /** - * Whether the hostname should be gray clouded (false) or orange clouded (true). - */ - proxied?: boolean; + /** + * When header `session_affinity` is enabled, this option can be used to specify + * how HTTP headers on load balancing requests will be used. The supported values + * are: + * + * - `"true"`: Load balancing requests must contain _all_ of the HTTP headers + * specified by the `headers` session affinity attribute, otherwise sessions + * aren't created. + * - `"false"`: Load balancing requests must contain _at least one_ of the HTTP + * headers specified by the `headers` session affinity attribute, otherwise + * sessions aren't created. + */ + require_all_headers?: boolean; - /** - * 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. - */ - random_steering?: LoadBalancerListResponseItem.RandomSteering; + /** + * Configures the SameSite attribute on session affinity cookie. Value "Auto" will + * be translated to "Lax" or "None" depending if Always Use HTTPS is enabled. Note: + * when using value "None", the secure attribute can not be set to "Never". + */ + samesite?: 'Auto' | 'Lax' | 'None' | 'Strict'; - /** - * 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. - */ - region_pools?: unknown; + /** + * Configures the Secure attribute on session affinity cookie. Value "Always" + * indicates the Secure attribute will be set in the Set-Cookie header, "Never" + * indicates the Secure attribute will not be set, and "Auto" will set the Secure + * attribute depending if Always Use HTTPS is enabled. + */ + secure?: 'Auto' | 'Always' | 'Never'; - /** - * BETA Field Not General Access: A list of rules for this load balancer to - * execute. - */ - rules?: Array; + /** + * Configures the zero-downtime failover between origins within a pool when session + * affinity is enabled. This feature is currently incompatible with Argo, Tiered + * Cache, and Bandwidth Alliance. The supported values are: + * + * - `"none"`: No failover takes place for sessions pinned to the origin (default). + * - `"temporary"`: Traffic will be sent to another other healthy origin until the + * originally pinned origin is available; note that this can potentially result + * in heavy origin flapping. + * - `"sticky"`: The session affinity cookie is updated and subsequent requests are + * sent to the new origin. Note: Zero-downtime failover with sticky sessions is + * currently not supported for session affinity by header. + */ + zero_downtime_failover?: 'none' | 'temporary' | 'sticky'; + } + } +} - /** - * 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?: 'none' | 'cookie' | 'ip_cookie' | 'header' | '""'; +export interface LoadBalancerDeleteResponse { + id?: string; +} - /** - * Configures attributes for session affinity. - */ - session_affinity_attributes?: LoadBalancerListResponseItem.SessionAffinityAttributes; +export interface LoadBalancerEditResponse { + id?: string; + + /** + * 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. + */ + adaptive_routing?: LoadBalancerEditResponse.AdaptiveRouting; + + /** + * 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. + */ + country_pools?: unknown; + + created_on?: string; + + /** + * 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. + */ + default_pools?: Array; + + /** + * Object description. + */ + description?: string; + + /** + * Whether to enable (the default) this load balancer. + */ + enabled?: boolean; + + /** + * The pool ID to use when all other pools are detected as unhealthy. + */ + fallback_pool?: unknown; + + /** + * Controls location-based steering for non-proxied requests. See `steering_policy` + * to learn how steering is affected. + */ + location_strategy?: LoadBalancerEditResponse.LocationStrategy; + + modified_on?: string; + + /** + * The DNS hostname to associate with your Load Balancer. If this hostname already + * exists as a DNS record in Cloudflare's DNS, the Load Balancer will take + * precedence and the DNS record will not be used. + */ + name?: string; + + /** + * (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. + */ + pop_pools?: unknown; + + /** + * Whether the hostname should be gray clouded (false) or orange clouded (true). + */ + proxied?: boolean; + + /** + * 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. + */ + random_steering?: LoadBalancerEditResponse.RandomSteering; + + /** + * 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. + */ + region_pools?: unknown; + + /** + * BETA Field Not General Access: A list of rules for this load balancer to + * execute. + */ + rules?: Array; + + /** + * 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?: 'none' | 'cookie' | 'ip_cookie' | 'header' | '""'; + + /** + * Configures attributes for session affinity. + */ + session_affinity_attributes?: LoadBalancerEditResponse.SessionAffinityAttributes; + + /** + * 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. + */ + session_affinity_ttl?: number; + + /** + * 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"`. + */ + steering_policy?: + | 'off' + | 'geo' + | 'random' + | 'dynamic_latency' + | 'proximity' + | 'least_outstanding_requests' + | 'least_connections' + | '""'; + /** + * 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. + */ + ttl?: number; +} + +export namespace LoadBalancerEditResponse { + /** + * 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. + */ + export interface AdaptiveRouting { /** - * 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: + * Extends zero-downtime failover of requests to healthy origins from alternate + * pools, when no healthy alternate exists in the same pool, according to the + * failover order defined by traffic and origin steering. When set false (the + * default) zero-downtime failover will only occur between origins within the same + * pool. See `session_affinity_attributes` for control over when sessions are + * broken or reassigned. + */ + failover_across_pools?: boolean; + } + + /** + * Controls location-based steering for non-proxied requests. See `steering_policy` + * to learn how steering is affected. + */ + export interface LocationStrategy { + /** + * Determines the authoritative location when ECS is not preferred, does not exist + * in the request, or its GeoIP lookup is unsuccessful. * - * - `"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. + * - `"pop"`: Use the Cloudflare PoP location. + * - `"resolver_ip"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is + * unsuccessful, use the Cloudflare PoP location. */ - session_affinity_ttl?: number; + mode?: 'pop' | 'resolver_ip'; /** - * Steering Policy for this load balancer. + * Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the + * authoritative location. * - * - `"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"`. + * - `"always"`: Always prefer ECS. + * - `"never"`: Never prefer ECS. + * - `"proximity"`: Prefer ECS only when `steering_policy="proximity"`. + * - `"geo"`: Prefer ECS only when `steering_policy="geo"`. + */ + prefer_ecs?: 'always' | 'never' | 'proximity' | 'geo'; + } + + /** + * 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. + */ + export interface RandomSteering { + /** + * The default weight for pools in the load balancer that are not specified in the + * pool_weights map. + */ + default_weight?: number; + + /** + * A mapping of pool IDs to custom weights. The weight is relative to other pools + * in the load balancer. + */ + pool_weights?: unknown; + } + + /** + * A rule object containing conditions and overrides for this load balancer to + * evaluate. + */ + export interface Rule { + /** + * 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. + */ + condition?: string; + + /** + * Disable this specific rule. It will no longer be evaluated by this load + * balancer. + */ + disabled?: boolean; + + /** + * 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. + */ + fixed_response?: Rule.FixedResponse; + + /** + * Name of this rule. Only used for human readability. + */ + name?: string; + + /** + * A collection of overrides to apply to the load balancer when this rule's + * condition is true. All fields are optional. */ - steering_policy?: - | 'off' - | 'geo' - | 'random' - | 'dynamic_latency' - | 'proximity' - | 'least_outstanding_requests' - | 'least_connections' - | '""'; + overrides?: Rule.Overrides; /** - * 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. + * 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. */ - ttl?: number; - } + priority?: number; - export namespace LoadBalancerListResponseItem { /** - * 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. + * If this rule's condition is true, this causes rule evaluation to stop after + * processing this rule. */ - export interface AdaptiveRouting { - /** - * Extends zero-downtime failover of requests to healthy origins from alternate - * pools, when no healthy alternate exists in the same pool, according to the - * failover order defined by traffic and origin steering. When set false (the - * default) zero-downtime failover will only occur between origins within the same - * pool. See `session_affinity_attributes` for control over when sessions are - * broken or reassigned. - */ - failover_across_pools?: boolean; - } + terminates?: boolean; + } + export namespace Rule { /** - * Controls location-based steering for non-proxied requests. See `steering_policy` - * to learn how steering is affected. + * 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. */ - export interface LocationStrategy { + export interface FixedResponse { /** - * Determines the authoritative location when ECS is not preferred, does not exist - * in the request, or its GeoIP lookup is unsuccessful. - * - * - `"pop"`: Use the Cloudflare PoP location. - * - `"resolver_ip"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is - * unsuccessful, use the Cloudflare PoP location. + * The http 'Content-Type' header to include in the response. */ - mode?: 'pop' | 'resolver_ip'; + content_type?: string; /** - * Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the - * authoritative location. - * - * - `"always"`: Always prefer ECS. - * - `"never"`: Never prefer ECS. - * - `"proximity"`: Prefer ECS only when `steering_policy="proximity"`. - * - `"geo"`: Prefer ECS only when `steering_policy="geo"`. + * The http 'Location' header to include in the response. */ - prefer_ecs?: 'always' | 'never' | 'proximity' | 'geo'; - } + location?: string; - /** - * 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. - */ - export interface RandomSteering { /** - * The default weight for pools in the load balancer that are not specified in the - * pool_weights map. + * Text to include as the http body. */ - default_weight?: number; + message_body?: string; /** - * A mapping of pool IDs to custom weights. The weight is relative to other pools - * in the load balancer. + * The http status code to respond with. */ - pool_weights?: unknown; + status_code?: number; } /** - * A rule object containing conditions and overrides for this load balancer to - * evaluate. + * A collection of overrides to apply to the load balancer when this rule's + * condition is true. All fields are optional. */ - export interface Rule { + export interface Overrides { /** - * 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. + * 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. */ - condition?: string; + adaptive_routing?: Overrides.AdaptiveRouting; /** - * Disable this specific rule. It will no longer be evaluated by this load - * balancer. + * 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. */ - disabled?: boolean; + country_pools?: unknown; /** - * 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. + * 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. */ - fixed_response?: Rule.FixedResponse; + default_pools?: Array; /** - * Name of this rule. Only used for human readability. + * The pool ID to use when all other pools are detected as unhealthy. */ - name?: string; + fallback_pool?: unknown; /** - * A collection of overrides to apply to the load balancer when this rule's - * condition is true. All fields are optional. + * Controls location-based steering for non-proxied requests. See `steering_policy` + * to learn how steering is affected. */ - overrides?: Rule.Overrides; + location_strategy?: Overrides.LocationStrategy; /** - * 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. + * (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. */ - priority?: number; + pop_pools?: unknown; /** - * If this rule's condition is true, this causes rule evaluation to stop after - * processing this rule. + * 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. */ - terminates?: boolean; - } + random_steering?: Overrides.RandomSteering; - export namespace Rule { /** - * 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. + * 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. */ - export interface FixedResponse { - /** - * The http 'Content-Type' header to include in the response. - */ - content_type?: string; - - /** - * The http 'Location' header to include in the response. - */ - location?: string; - - /** - * Text to include as the http body. - */ - message_body?: string; - - /** - * The http status code to respond with. - */ - status_code?: number; - } + region_pools?: unknown; /** - * A collection of overrides to apply to the load balancer when this rule's - * condition is true. All fields are optional. + * 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. */ - export interface Overrides { - /** - * 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. - */ - adaptive_routing?: Overrides.AdaptiveRouting; - - /** - * 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. - */ - country_pools?: unknown; - - /** - * 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. - */ - default_pools?: Array; - - /** - * The pool ID to use when all other pools are detected as unhealthy. - */ - fallback_pool?: unknown; - - /** - * Controls location-based steering for non-proxied requests. See `steering_policy` - * to learn how steering is affected. - */ - location_strategy?: Overrides.LocationStrategy; + session_affinity?: 'none' | 'cookie' | 'ip_cookie' | 'header' | '""'; - /** - * (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. - */ - pop_pools?: unknown; + /** + * Configures attributes for session affinity. + */ + session_affinity_attributes?: Overrides.SessionAffinityAttributes; - /** - * 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. - */ - random_steering?: Overrides.RandomSteering; + /** + * 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. + */ + session_affinity_ttl?: number; - /** - * 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. - */ - region_pools?: unknown; + /** + * 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"`. + */ + steering_policy?: + | 'off' + | 'geo' + | 'random' + | 'dynamic_latency' + | 'proximity' + | 'least_outstanding_requests' + | 'least_connections' + | '""'; - /** - * 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?: 'none' | 'cookie' | 'ip_cookie' | 'header' | '""'; + /** + * 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. + */ + ttl?: number; + } + export namespace Overrides { + /** + * 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. + */ + export interface AdaptiveRouting { /** - * Configures attributes for session affinity. + * Extends zero-downtime failover of requests to healthy origins from alternate + * pools, when no healthy alternate exists in the same pool, according to the + * failover order defined by traffic and origin steering. When set false (the + * default) zero-downtime failover will only occur between origins within the same + * pool. See `session_affinity_attributes` for control over when sessions are + * broken or reassigned. */ - session_affinity_attributes?: Overrides.SessionAffinityAttributes; + failover_across_pools?: boolean; + } + /** + * Controls location-based steering for non-proxied requests. See `steering_policy` + * to learn how steering is affected. + */ + export interface LocationStrategy { /** - * 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: + * Determines the authoritative location when ECS is not preferred, does not exist + * in the request, or its GeoIP lookup is unsuccessful. * - * - `"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. + * - `"pop"`: Use the Cloudflare PoP location. + * - `"resolver_ip"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is + * unsuccessful, use the Cloudflare PoP location. */ - session_affinity_ttl?: number; + mode?: 'pop' | 'resolver_ip'; /** - * Steering Policy for this load balancer. + * Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the + * authoritative location. * - * - `"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"`. - */ - steering_policy?: - | 'off' - | 'geo' - | 'random' - | 'dynamic_latency' - | 'proximity' - | 'least_outstanding_requests' - | 'least_connections' - | '""'; - - /** - * 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. + * - `"always"`: Always prefer ECS. + * - `"never"`: Never prefer ECS. + * - `"proximity"`: Prefer ECS only when `steering_policy="proximity"`. + * - `"geo"`: Prefer ECS only when `steering_policy="geo"`. */ - ttl?: number; + prefer_ecs?: 'always' | 'never' | 'proximity' | 'geo'; } - export namespace Overrides { - /** - * 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. - */ - export interface AdaptiveRouting { - /** - * Extends zero-downtime failover of requests to healthy origins from alternate - * pools, when no healthy alternate exists in the same pool, according to the - * failover order defined by traffic and origin steering. When set false (the - * default) zero-downtime failover will only occur between origins within the same - * pool. See `session_affinity_attributes` for control over when sessions are - * broken or reassigned. - */ - failover_across_pools?: boolean; - } - - /** - * Controls location-based steering for non-proxied requests. See `steering_policy` - * to learn how steering is affected. - */ - export interface LocationStrategy { - /** - * Determines the authoritative location when ECS is not preferred, does not exist - * in the request, or its GeoIP lookup is unsuccessful. - * - * - `"pop"`: Use the Cloudflare PoP location. - * - `"resolver_ip"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is - * unsuccessful, use the Cloudflare PoP location. - */ - mode?: 'pop' | 'resolver_ip'; - - /** - * Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the - * authoritative location. - * - * - `"always"`: Always prefer ECS. - * - `"never"`: Never prefer ECS. - * - `"proximity"`: Prefer ECS only when `steering_policy="proximity"`. - * - `"geo"`: Prefer ECS only when `steering_policy="geo"`. - */ - prefer_ecs?: 'always' | 'never' | 'proximity' | 'geo'; - } - - /** - * 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. - */ - export interface RandomSteering { - /** - * The default weight for pools in the load balancer that are not specified in the - * pool_weights map. - */ - default_weight?: number; + /** + * 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. + */ + export interface RandomSteering { + /** + * The default weight for pools in the load balancer that are not specified in the + * pool_weights map. + */ + default_weight?: number; - /** - * A mapping of pool IDs to custom weights. The weight is relative to other pools - * in the load balancer. - */ - pool_weights?: unknown; - } + /** + * A mapping of pool IDs to custom weights. The weight is relative to other pools + * in the load balancer. + */ + pool_weights?: unknown; + } + /** + * Configures attributes for session affinity. + */ + export interface SessionAffinityAttributes { /** - * Configures attributes for session affinity. + * Configures the drain duration in seconds. This field is only used when session + * affinity is enabled on the load balancer. */ - export interface SessionAffinityAttributes { - /** - * Configures the drain duration in seconds. This field is only used when session - * affinity is enabled on the load balancer. - */ - drain_duration?: number; + drain_duration?: number; - /** - * Configures the names of HTTP headers to base session affinity on when header - * `session_affinity` is enabled. At least one HTTP header name must be provided. - * To specify the exact cookies to be used, include an item in the following - * format: `"cookie:,"` (example) where everything - * after the colon is a comma-separated list of cookie names. Providing only - * `"cookie"` will result in all cookies being used. The default max number of HTTP - * header names that can be provided depends on your plan: 5 for Enterprise, 1 for - * all other plans. - */ - headers?: Array; + /** + * Configures the names of HTTP headers to base session affinity on when header + * `session_affinity` is enabled. At least one HTTP header name must be provided. + * To specify the exact cookies to be used, include an item in the following + * format: `"cookie:,"` (example) where everything + * after the colon is a comma-separated list of cookie names. Providing only + * `"cookie"` will result in all cookies being used. The default max number of HTTP + * header names that can be provided depends on your plan: 5 for Enterprise, 1 for + * all other plans. + */ + headers?: Array; - /** - * When header `session_affinity` is enabled, this option can be used to specify - * how HTTP headers on load balancing requests will be used. The supported values - * are: - * - * - `"true"`: Load balancing requests must contain _all_ of the HTTP headers - * specified by the `headers` session affinity attribute, otherwise sessions - * aren't created. - * - `"false"`: Load balancing requests must contain _at least one_ of the HTTP - * headers specified by the `headers` session affinity attribute, otherwise - * sessions aren't created. - */ - require_all_headers?: boolean; + /** + * When header `session_affinity` is enabled, this option can be used to specify + * how HTTP headers on load balancing requests will be used. The supported values + * are: + * + * - `"true"`: Load balancing requests must contain _all_ of the HTTP headers + * specified by the `headers` session affinity attribute, otherwise sessions + * aren't created. + * - `"false"`: Load balancing requests must contain _at least one_ of the HTTP + * headers specified by the `headers` session affinity attribute, otherwise + * sessions aren't created. + */ + require_all_headers?: boolean; - /** - * Configures the SameSite attribute on session affinity cookie. Value "Auto" will - * be translated to "Lax" or "None" depending if Always Use HTTPS is enabled. Note: - * when using value "None", the secure attribute can not be set to "Never". - */ - samesite?: 'Auto' | 'Lax' | 'None' | 'Strict'; + /** + * Configures the SameSite attribute on session affinity cookie. Value "Auto" will + * be translated to "Lax" or "None" depending if Always Use HTTPS is enabled. Note: + * when using value "None", the secure attribute can not be set to "Never". + */ + samesite?: 'Auto' | 'Lax' | 'None' | 'Strict'; - /** - * Configures the Secure attribute on session affinity cookie. Value "Always" - * indicates the Secure attribute will be set in the Set-Cookie header, "Never" - * indicates the Secure attribute will not be set, and "Auto" will set the Secure - * attribute depending if Always Use HTTPS is enabled. - */ - secure?: 'Auto' | 'Always' | 'Never'; + /** + * Configures the Secure attribute on session affinity cookie. Value "Always" + * indicates the Secure attribute will be set in the Set-Cookie header, "Never" + * indicates the Secure attribute will not be set, and "Auto" will set the Secure + * attribute depending if Always Use HTTPS is enabled. + */ + secure?: 'Auto' | 'Always' | 'Never'; - /** - * Configures the zero-downtime failover between origins within a pool when session - * affinity is enabled. This feature is currently incompatible with Argo, Tiered - * Cache, and Bandwidth Alliance. The supported values are: - * - * - `"none"`: No failover takes place for sessions pinned to the origin (default). - * - `"temporary"`: Traffic will be sent to another other healthy origin until the - * originally pinned origin is available; note that this can potentially result - * in heavy origin flapping. - * - `"sticky"`: The session affinity cookie is updated and subsequent requests are - * sent to the new origin. Note: Zero-downtime failover with sticky sessions is - * currently not supported for session affinity by header. - */ - zero_downtime_failover?: 'none' | 'temporary' | 'sticky'; - } + /** + * Configures the zero-downtime failover between origins within a pool when session + * affinity is enabled. This feature is currently incompatible with Argo, Tiered + * Cache, and Bandwidth Alliance. The supported values are: + * + * - `"none"`: No failover takes place for sessions pinned to the origin (default). + * - `"temporary"`: Traffic will be sent to another other healthy origin until the + * originally pinned origin is available; note that this can potentially result + * in heavy origin flapping. + * - `"sticky"`: The session affinity cookie is updated and subsequent requests are + * sent to the new origin. Note: Zero-downtime failover with sticky sessions is + * currently not supported for session affinity by header. + */ + zero_downtime_failover?: 'none' | 'temporary' | 'sticky'; } } + } + /** + * Configures attributes for session affinity. + */ + export interface SessionAffinityAttributes { /** - * Configures attributes for session affinity. + * Configures the drain duration in seconds. This field is only used when session + * affinity is enabled on the load balancer. */ - export interface SessionAffinityAttributes { - /** - * Configures the drain duration in seconds. This field is only used when session - * affinity is enabled on the load balancer. - */ - drain_duration?: number; + drain_duration?: number; - /** - * Configures the names of HTTP headers to base session affinity on when header - * `session_affinity` is enabled. At least one HTTP header name must be provided. - * To specify the exact cookies to be used, include an item in the following - * format: `"cookie:,"` (example) where everything - * after the colon is a comma-separated list of cookie names. Providing only - * `"cookie"` will result in all cookies being used. The default max number of HTTP - * header names that can be provided depends on your plan: 5 for Enterprise, 1 for - * all other plans. - */ - headers?: Array; + /** + * Configures the names of HTTP headers to base session affinity on when header + * `session_affinity` is enabled. At least one HTTP header name must be provided. + * To specify the exact cookies to be used, include an item in the following + * format: `"cookie:,"` (example) where everything + * after the colon is a comma-separated list of cookie names. Providing only + * `"cookie"` will result in all cookies being used. The default max number of HTTP + * header names that can be provided depends on your plan: 5 for Enterprise, 1 for + * all other plans. + */ + headers?: Array; - /** - * When header `session_affinity` is enabled, this option can be used to specify - * how HTTP headers on load balancing requests will be used. The supported values - * are: - * - * - `"true"`: Load balancing requests must contain _all_ of the HTTP headers - * specified by the `headers` session affinity attribute, otherwise sessions - * aren't created. - * - `"false"`: Load balancing requests must contain _at least one_ of the HTTP - * headers specified by the `headers` session affinity attribute, otherwise - * sessions aren't created. - */ - require_all_headers?: boolean; + /** + * When header `session_affinity` is enabled, this option can be used to specify + * how HTTP headers on load balancing requests will be used. The supported values + * are: + * + * - `"true"`: Load balancing requests must contain _all_ of the HTTP headers + * specified by the `headers` session affinity attribute, otherwise sessions + * aren't created. + * - `"false"`: Load balancing requests must contain _at least one_ of the HTTP + * headers specified by the `headers` session affinity attribute, otherwise + * sessions aren't created. + */ + require_all_headers?: boolean; - /** - * Configures the SameSite attribute on session affinity cookie. Value "Auto" will - * be translated to "Lax" or "None" depending if Always Use HTTPS is enabled. Note: - * when using value "None", the secure attribute can not be set to "Never". - */ - samesite?: 'Auto' | 'Lax' | 'None' | 'Strict'; + /** + * Configures the SameSite attribute on session affinity cookie. Value "Auto" will + * be translated to "Lax" or "None" depending if Always Use HTTPS is enabled. Note: + * when using value "None", the secure attribute can not be set to "Never". + */ + samesite?: 'Auto' | 'Lax' | 'None' | 'Strict'; - /** - * Configures the Secure attribute on session affinity cookie. Value "Always" - * indicates the Secure attribute will be set in the Set-Cookie header, "Never" - * indicates the Secure attribute will not be set, and "Auto" will set the Secure - * attribute depending if Always Use HTTPS is enabled. - */ - secure?: 'Auto' | 'Always' | 'Never'; + /** + * Configures the Secure attribute on session affinity cookie. Value "Always" + * indicates the Secure attribute will be set in the Set-Cookie header, "Never" + * indicates the Secure attribute will not be set, and "Auto" will set the Secure + * attribute depending if Always Use HTTPS is enabled. + */ + secure?: 'Auto' | 'Always' | 'Never'; - /** - * Configures the zero-downtime failover between origins within a pool when session - * affinity is enabled. This feature is currently incompatible with Argo, Tiered - * Cache, and Bandwidth Alliance. The supported values are: - * - * - `"none"`: No failover takes place for sessions pinned to the origin (default). - * - `"temporary"`: Traffic will be sent to another other healthy origin until the - * originally pinned origin is available; note that this can potentially result - * in heavy origin flapping. - * - `"sticky"`: The session affinity cookie is updated and subsequent requests are - * sent to the new origin. Note: Zero-downtime failover with sticky sessions is - * currently not supported for session affinity by header. - */ - zero_downtime_failover?: 'none' | 'temporary' | 'sticky'; - } + /** + * Configures the zero-downtime failover between origins within a pool when session + * affinity is enabled. This feature is currently incompatible with Argo, Tiered + * Cache, and Bandwidth Alliance. The supported values are: + * + * - `"none"`: No failover takes place for sessions pinned to the origin (default). + * - `"temporary"`: Traffic will be sent to another other healthy origin until the + * originally pinned origin is available; note that this can potentially result + * in heavy origin flapping. + * - `"sticky"`: The session affinity cookie is updated and subsequent requests are + * sent to the new origin. Note: Zero-downtime failover with sticky sessions is + * currently not supported for session affinity by header. + */ + zero_downtime_failover?: 'none' | 'temporary' | 'sticky'; } } -export interface LoadBalancerDeleteResponse { - id?: string; -} - export interface LoadBalancerGetResponse { id?: string; @@ -3582,7 +3582,7 @@ export namespace LoadBalancerCreateParams { } } -export interface LoadBalancerUpdateParams { +export interface LoadBalancerEditParams { /** * Controls features that modify the routing of requests to pools and origins in * response to dynamic conditions, such as during the interval between active @@ -3591,7 +3591,7 @@ export interface LoadBalancerUpdateParams { * response codes. If there is another healthy origin in the same pool, the request * is retried once against this alternate origin. */ - adaptive_routing?: LoadBalancerUpdateParams.AdaptiveRouting; + adaptive_routing?: LoadBalancerEditParams.AdaptiveRouting; /** * A mapping of country codes to a list of pool IDs (ordered by their failover @@ -3626,7 +3626,7 @@ export interface LoadBalancerUpdateParams { * Controls location-based steering for non-proxied requests. See `steering_policy` * to learn how steering is affected. */ - location_strategy?: LoadBalancerUpdateParams.LocationStrategy; + location_strategy?: LoadBalancerEditParams.LocationStrategy; /** * The DNS hostname to associate with your Load Balancer. If this hostname already @@ -3658,7 +3658,7 @@ export interface LoadBalancerUpdateParams { * - `steering_policy="least_connections"`: Use pool weights to scale each pool's * open connections. */ - random_steering?: LoadBalancerUpdateParams.RandomSteering; + random_steering?: LoadBalancerEditParams.RandomSteering; /** * A mapping of region codes to a list of pool IDs (ordered by their failover @@ -3671,7 +3671,7 @@ export interface LoadBalancerUpdateParams { * BETA Field Not General Access: A list of rules for this load balancer to * execute. */ - rules?: Array; + rules?: Array; /** * Specifies the type of session affinity the load balancer should use unless @@ -3703,7 +3703,7 @@ export interface LoadBalancerUpdateParams { /** * Configures attributes for session affinity. */ - session_affinity_attributes?: LoadBalancerUpdateParams.SessionAffinityAttributes; + session_affinity_attributes?: LoadBalancerEditParams.SessionAffinityAttributes; /** * Time, in seconds, until a client's session expires after being created. Once the @@ -3760,7 +3760,7 @@ export interface LoadBalancerUpdateParams { ttl?: number; } -export namespace LoadBalancerUpdateParams { +export namespace LoadBalancerEditParams { /** * Controls features that modify the routing of requests to pools and origins in * response to dynamic conditions, such as during the interval between active @@ -4277,29 +4277,29 @@ export namespace LoadBalancerUpdateParams { export namespace LoadBalancers { export import LoadBalancerCreateResponse = LoadBalancersAPI.LoadBalancerCreateResponse; - export import LoadBalancerUpdateResponse = LoadBalancersAPI.LoadBalancerUpdateResponse; export import LoadBalancerListResponse = LoadBalancersAPI.LoadBalancerListResponse; export import LoadBalancerDeleteResponse = LoadBalancersAPI.LoadBalancerDeleteResponse; + export import LoadBalancerEditResponse = LoadBalancersAPI.LoadBalancerEditResponse; export import LoadBalancerGetResponse = LoadBalancersAPI.LoadBalancerGetResponse; export import LoadBalancerCreateParams = LoadBalancersAPI.LoadBalancerCreateParams; - export import LoadBalancerUpdateParams = LoadBalancersAPI.LoadBalancerUpdateParams; + export import LoadBalancerEditParams = LoadBalancersAPI.LoadBalancerEditParams; export import Monitors = MonitorsAPI.Monitors; export import MonitorCreateResponse = MonitorsAPI.MonitorCreateResponse; - export import MonitorUpdateResponse = MonitorsAPI.MonitorUpdateResponse; export import MonitorListResponse = MonitorsAPI.MonitorListResponse; export import MonitorDeleteResponse = MonitorsAPI.MonitorDeleteResponse; + export import MonitorEditResponse = MonitorsAPI.MonitorEditResponse; export import MonitorGetResponse = MonitorsAPI.MonitorGetResponse; export import MonitorCreateParams = MonitorsAPI.MonitorCreateParams; - export import MonitorUpdateParams = MonitorsAPI.MonitorUpdateParams; + export import MonitorEditParams = MonitorsAPI.MonitorEditParams; export import Pools = PoolsAPI.Pools; export import PoolCreateResponse = PoolsAPI.PoolCreateResponse; - export import PoolUpdateResponse = PoolsAPI.PoolUpdateResponse; export import PoolListResponse = PoolsAPI.PoolListResponse; export import PoolDeleteResponse = PoolsAPI.PoolDeleteResponse; + export import PoolEditResponse = PoolsAPI.PoolEditResponse; export import PoolGetResponse = PoolsAPI.PoolGetResponse; export import PoolCreateParams = PoolsAPI.PoolCreateParams; - export import PoolUpdateParams = PoolsAPI.PoolUpdateParams; export import PoolListParams = PoolsAPI.PoolListParams; + export import PoolEditParams = PoolsAPI.PoolEditParams; export import Previews = PreviewsAPI.Previews; export import PreviewGetResponse = PreviewsAPI.PreviewGetResponse; export import Regions = RegionsAPI.Regions; diff --git a/src/resources/load-balancers/monitors/index.ts b/src/resources/load-balancers/monitors/index.ts index 9b3281a3c7..20713f696c 100644 --- a/src/resources/load-balancers/monitors/index.ts +++ b/src/resources/load-balancers/monitors/index.ts @@ -2,12 +2,12 @@ export { MonitorCreateResponse, - MonitorUpdateResponse, MonitorListResponse, MonitorDeleteResponse, + MonitorEditResponse, MonitorGetResponse, MonitorCreateParams, - MonitorUpdateParams, + MonitorEditParams, Monitors, } from './monitors'; export { PreviewCreateResponse, PreviewCreateParams, Previews } from './previews'; diff --git a/src/resources/load-balancers/monitors/monitors.ts b/src/resources/load-balancers/monitors/monitors.ts index 2410afba78..acd92b41d2 100644 --- a/src/resources/load-balancers/monitors/monitors.ts +++ b/src/resources/load-balancers/monitors/monitors.ts @@ -26,23 +26,6 @@ export class Monitors extends APIResource { )._thenUnwrap((obj) => obj.result); } - /** - * Apply changes to an existing monitor, overwriting the supplied properties. - */ - update( - accountId: string, - monitorId: string, - body: MonitorUpdateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.patch(`/accounts/${accountId}/load_balancers/monitors/${monitorId}`, { - body, - ...options, - }) as Core.APIPromise<{ result: MonitorUpdateResponse }> - )._thenUnwrap((obj) => obj.result); - } - /** * List configured monitors for an account. */ @@ -70,6 +53,23 @@ export class Monitors extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Apply changes to an existing monitor, overwriting the supplied properties. + */ + edit( + accountId: string, + monitorId: string, + body: MonitorEditParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.patch(`/accounts/${accountId}/load_balancers/monitors/${monitorId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: MonitorEditResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * List a single configured monitor for an account. */ @@ -192,111 +192,6 @@ export interface MonitorCreateResponse { type?: 'http' | 'https' | 'tcp' | 'udp_icmp' | 'icmp_ping' | 'smtp'; } -export interface MonitorUpdateResponse { - id?: string; - - /** - * Do not validate the certificate when monitor use HTTPS. This parameter is - * currently only valid for HTTP and HTTPS monitors. - */ - allow_insecure?: boolean; - - /** - * To be marked unhealthy the monitored origin must fail this healthcheck N - * consecutive times. - */ - consecutive_down?: number; - - /** - * To be marked healthy the monitored origin must pass this healthcheck N - * consecutive times. - */ - consecutive_up?: number; - - created_on?: string; - - /** - * Object description. - */ - description?: string; - - /** - * A case-insensitive sub-string to look for in the response body. If this string - * is not found, the origin will be marked as unhealthy. This parameter is only - * valid for HTTP and HTTPS monitors. - */ - expected_body?: string; - - /** - * The expected HTTP response code or code range of the health check. This - * parameter is only valid for HTTP and HTTPS monitors. - */ - expected_codes?: string; - - /** - * Follow redirects if returned by the origin. This parameter is only valid for - * HTTP and HTTPS monitors. - */ - follow_redirects?: boolean; - - /** - * The HTTP request headers to send in the health check. It is recommended you set - * a Host header by default. The User-Agent header cannot be overridden. This - * parameter is only valid for HTTP and HTTPS monitors. - */ - header?: unknown; - - /** - * The interval between each health check. Shorter intervals may improve failover - * time, but will increase load on the origins as we check from multiple locations. - */ - interval?: number; - - /** - * The method to use for the health check. This defaults to 'GET' for HTTP/HTTPS - * based checks and 'connection_established' for TCP based health checks. - */ - method?: string; - - modified_on?: string; - - /** - * The endpoint path you want to conduct a health check against. This parameter is - * only valid for HTTP and HTTPS monitors. - */ - path?: string; - - /** - * The port number to connect to for the health check. Required for TCP, UDP, and - * SMTP checks. HTTP and HTTPS checks should only define the port when using a - * non-standard port (HTTP: default 80, HTTPS: default 443). - */ - port?: number; - - /** - * Assign this monitor to emulate the specified zone while probing. This parameter - * is only valid for HTTP and HTTPS monitors. - */ - probe_zone?: string; - - /** - * The number of retries to attempt in case of a timeout before marking the origin - * as unhealthy. Retries are attempted immediately. - */ - retries?: number; - - /** - * The timeout (in seconds) before marking the health check as failed. - */ - timeout?: number; - - /** - * The protocol to use for the health check. Currently supported protocols are - * 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'. - */ - type?: 'http' | 'https' | 'tcp' | 'udp_icmp' | 'icmp_ping' | 'smtp'; -} - export type MonitorListResponse = Array; export namespace MonitorListResponse { @@ -410,6 +305,111 @@ export interface MonitorDeleteResponse { id?: string; } +export interface MonitorEditResponse { + id?: string; + + /** + * Do not validate the certificate when monitor use HTTPS. This parameter is + * currently only valid for HTTP and HTTPS monitors. + */ + allow_insecure?: boolean; + + /** + * To be marked unhealthy the monitored origin must fail this healthcheck N + * consecutive times. + */ + consecutive_down?: number; + + /** + * To be marked healthy the monitored origin must pass this healthcheck N + * consecutive times. + */ + consecutive_up?: number; + + created_on?: string; + + /** + * Object description. + */ + description?: string; + + /** + * A case-insensitive sub-string to look for in the response body. If this string + * is not found, the origin will be marked as unhealthy. This parameter is only + * valid for HTTP and HTTPS monitors. + */ + expected_body?: string; + + /** + * The expected HTTP response code or code range of the health check. This + * parameter is only valid for HTTP and HTTPS monitors. + */ + expected_codes?: string; + + /** + * Follow redirects if returned by the origin. This parameter is only valid for + * HTTP and HTTPS monitors. + */ + follow_redirects?: boolean; + + /** + * The HTTP request headers to send in the health check. It is recommended you set + * a Host header by default. The User-Agent header cannot be overridden. This + * parameter is only valid for HTTP and HTTPS monitors. + */ + header?: unknown; + + /** + * The interval between each health check. Shorter intervals may improve failover + * time, but will increase load on the origins as we check from multiple locations. + */ + interval?: number; + + /** + * The method to use for the health check. This defaults to 'GET' for HTTP/HTTPS + * based checks and 'connection_established' for TCP based health checks. + */ + method?: string; + + modified_on?: string; + + /** + * The endpoint path you want to conduct a health check against. This parameter is + * only valid for HTTP and HTTPS monitors. + */ + path?: string; + + /** + * The port number to connect to for the health check. Required for TCP, UDP, and + * SMTP checks. HTTP and HTTPS checks should only define the port when using a + * non-standard port (HTTP: default 80, HTTPS: default 443). + */ + port?: number; + + /** + * Assign this monitor to emulate the specified zone while probing. This parameter + * is only valid for HTTP and HTTPS monitors. + */ + probe_zone?: string; + + /** + * The number of retries to attempt in case of a timeout before marking the origin + * as unhealthy. Retries are attempted immediately. + */ + retries?: number; + + /** + * The timeout (in seconds) before marking the health check as failed. + */ + timeout?: number; + + /** + * The protocol to use for the health check. Currently supported protocols are + * 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'. + */ + type?: 'http' | 'https' | 'tcp' | 'udp_icmp' | 'icmp_ping' | 'smtp'; +} + export interface MonitorGetResponse { id?: string; @@ -614,7 +614,7 @@ export interface MonitorCreateParams { type?: 'http' | 'https' | 'tcp' | 'udp_icmp' | 'icmp_ping' | 'smtp'; } -export interface MonitorUpdateParams { +export interface MonitorEditParams { /** * The expected HTTP response code or code range of the health check. This * parameter is only valid for HTTP and HTTPS monitors. @@ -715,12 +715,12 @@ export interface MonitorUpdateParams { export namespace Monitors { export import MonitorCreateResponse = MonitorsAPI.MonitorCreateResponse; - export import MonitorUpdateResponse = MonitorsAPI.MonitorUpdateResponse; export import MonitorListResponse = MonitorsAPI.MonitorListResponse; export import MonitorDeleteResponse = MonitorsAPI.MonitorDeleteResponse; + export import MonitorEditResponse = MonitorsAPI.MonitorEditResponse; export import MonitorGetResponse = MonitorsAPI.MonitorGetResponse; export import MonitorCreateParams = MonitorsAPI.MonitorCreateParams; - export import MonitorUpdateParams = MonitorsAPI.MonitorUpdateParams; + export import MonitorEditParams = MonitorsAPI.MonitorEditParams; export import Previews = PreviewsAPI.Previews; export import PreviewCreateResponse = PreviewsAPI.PreviewCreateResponse; export import PreviewCreateParams = PreviewsAPI.PreviewCreateParams; diff --git a/src/resources/load-balancers/pools/index.ts b/src/resources/load-balancers/pools/index.ts index 6e0152d25f..408fa2772d 100644 --- a/src/resources/load-balancers/pools/index.ts +++ b/src/resources/load-balancers/pools/index.ts @@ -3,13 +3,13 @@ export { HealthCreateResponse, HealthGetResponse, HealthCreateParams, Health } from './health'; export { PoolCreateResponse, - PoolUpdateResponse, PoolListResponse, PoolDeleteResponse, + PoolEditResponse, PoolGetResponse, PoolCreateParams, - PoolUpdateParams, PoolListParams, + PoolEditParams, Pools, } from './pools'; export { ReferenceListResponse, References } from './references'; diff --git a/src/resources/load-balancers/pools/pools.ts b/src/resources/load-balancers/pools/pools.ts index 1faee1f568..88a2099dbc 100644 --- a/src/resources/load-balancers/pools/pools.ts +++ b/src/resources/load-balancers/pools/pools.ts @@ -27,23 +27,6 @@ export class Pools extends APIResource { )._thenUnwrap((obj) => obj.result); } - /** - * Apply changes to an existing pool, overwriting the supplied properties. - */ - update( - accountId: string, - poolId: string, - body: PoolUpdateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.patch(`/accounts/${accountId}/load_balancers/pools/${poolId}`, { - body, - ...options, - }) as Core.APIPromise<{ result: PoolUpdateResponse }> - )._thenUnwrap((obj) => obj.result); - } - /** * List configured pools. */ @@ -85,6 +68,23 @@ export class Pools extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Apply changes to an existing pool, overwriting the supplied properties. + */ + edit( + accountId: string, + poolId: string, + body: PoolEditParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.patch(`/accounts/${accountId}/load_balancers/pools/${poolId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: PoolEditResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * Fetch a single configured pool. */ @@ -383,586 +383,586 @@ export namespace PoolCreateResponse { } } -export interface PoolUpdateResponse { - id?: string; - - /** - * A list of regions from which to run health checks. Null means every Cloudflare - * data center. - */ - check_regions?: Array< - | 'WNAM' - | 'ENAM' - | 'WEU' - | 'EEU' - | 'NSAM' - | 'SSAM' - | 'OC' - | 'ME' - | 'NAF' - | 'SAF' - | 'SAS' - | 'SEAS' - | 'NEAS' - | 'ALL_REGIONS' - > | null; - - created_on?: string; - - /** - * A human-readable description of the pool. - */ - description?: string; - - /** - * This field shows up only if the pool is disabled. This field is set with the - * time the pool was disabled at. - */ - disabled_at?: string; - - /** - * Whether to enable (the default) or disable this pool. Disabled pools will not - * receive traffic and are excluded from health checks. Disabling a pool will cause - * any load balancers using it to failover to the next pool (if any). - */ - enabled?: boolean; +export type PoolListResponse = Array; - /** - * The latitude of the data center containing the origins used in this pool in - * decimal degrees. If this is set, longitude must also be set. - */ - latitude?: number; +export namespace PoolListResponse { + export interface PoolListResponseItem { + id?: string; - /** - * Configures load shedding policies and percentages for the pool. - */ - load_shedding?: PoolUpdateResponse.LoadShedding; + /** + * A list of regions from which to run health checks. Null means every Cloudflare + * data center. + */ + check_regions?: Array< + | 'WNAM' + | 'ENAM' + | 'WEU' + | 'EEU' + | 'NSAM' + | 'SSAM' + | 'OC' + | 'ME' + | 'NAF' + | 'SAF' + | 'SAS' + | 'SEAS' + | 'NEAS' + | 'ALL_REGIONS' + > | null; - /** - * The longitude of the data center containing the origins used in this pool in - * decimal degrees. If this is set, latitude must also be set. - */ - longitude?: number; + created_on?: string; - /** - * The minimum number of origins that must be healthy for this pool to serve - * traffic. If the number of healthy origins falls below this number, the pool will - * be marked unhealthy and will failover to the next available pool. - */ - minimum_origins?: number; + /** + * A human-readable description of the pool. + */ + description?: string; - modified_on?: string; + /** + * This field shows up only if the pool is disabled. This field is set with the + * time the pool was disabled at. + */ + disabled_at?: string; - /** - * The ID of the Monitor to use for checking the health of origins within this - * pool. - */ - monitor?: unknown; + /** + * Whether to enable (the default) or disable this pool. Disabled pools will not + * receive traffic and are excluded from health checks. Disabling a pool will cause + * any load balancers using it to failover to the next pool (if any). + */ + enabled?: boolean; - /** - * A short name (tag) for the pool. Only alphanumeric characters, hyphens, and - * underscores are allowed. - */ - name?: string; + /** + * The latitude of the data center containing the origins used in this pool in + * decimal degrees. If this is set, longitude must also be set. + */ + latitude?: number; - /** - * This field is now deprecated. It has been moved to Cloudflare's Centralized - * Notification service - * https://developers.cloudflare.com/fundamentals/notifications/. The email address - * to send health status notifications to. This can be an individual mailbox or a - * mailing list. Multiple emails can be supplied as a comma delimited list. - */ - notification_email?: string; + /** + * Configures load shedding policies and percentages for the pool. + */ + load_shedding?: PoolListResponseItem.LoadShedding; - /** - * Filter pool and origin health notifications by resource type or health status. - * Use null to reset. - */ - notification_filter?: PoolUpdateResponse.NotificationFilter | null; + /** + * The longitude of the data center containing the origins used in this pool in + * decimal degrees. If this is set, latitude must also be set. + */ + longitude?: number; - /** - * Configures origin steering for the pool. Controls how origins are selected for - * new sessions and traffic without session affinity. - */ - origin_steering?: PoolUpdateResponse.OriginSteering; + /** + * The minimum number of origins that must be healthy for this pool to serve + * traffic. If the number of healthy origins falls below this number, the pool will + * be marked unhealthy and will failover to the next available pool. + */ + minimum_origins?: number; - /** - * The list of origins within this pool. Traffic directed at this pool is balanced - * across all currently healthy origins, provided the pool itself is healthy. - */ - origins?: Array; -} + modified_on?: string; -export namespace PoolUpdateResponse { - /** - * Configures load shedding policies and percentages for the pool. - */ - export interface LoadShedding { /** - * The percent of traffic to shed from the pool, according to the default policy. - * Applies to new sessions and traffic without session affinity. + * The ID of the Monitor to use for checking the health of origins within this + * pool. */ - default_percent?: number; + monitor?: unknown; /** - * The default policy to use when load shedding. A random policy randomly sheds a - * given percent of requests. A hash policy computes a hash over the - * CF-Connecting-IP address and sheds all requests originating from a percent of - * IPs. + * A short name (tag) for the pool. Only alphanumeric characters, hyphens, and + * underscores are allowed. */ - default_policy?: 'random' | 'hash'; + name?: string; /** - * The percent of existing sessions to shed from the pool, according to the session - * policy. + * This field is now deprecated. It has been moved to Cloudflare's Centralized + * Notification service + * https://developers.cloudflare.com/fundamentals/notifications/. The email address + * to send health status notifications to. This can be an individual mailbox or a + * mailing list. Multiple emails can be supplied as a comma delimited list. */ - session_percent?: number; + notification_email?: string; /** - * Only the hash policy is supported for existing sessions (to avoid exponential - * decay). + * Filter pool and origin health notifications by resource type or health status. + * Use null to reset. */ - session_policy?: 'hash'; - } + notification_filter?: PoolListResponseItem.NotificationFilter | null; - /** - * Filter pool and origin health notifications by resource type or health status. - * Use null to reset. - */ - export interface NotificationFilter { /** - * Filter options for a particular resource type (pool or origin). Use null to - * reset. + * Configures origin steering for the pool. Controls how origins are selected for + * new sessions and traffic without session affinity. */ - origin?: NotificationFilter.Origin | null; + origin_steering?: PoolListResponseItem.OriginSteering; /** - * Filter options for a particular resource type (pool or origin). Use null to - * reset. + * The list of origins within this pool. Traffic directed at this pool is balanced + * across all currently healthy origins, provided the pool itself is healthy. */ - pool?: NotificationFilter.Pool | null; + origins?: Array; } - export namespace NotificationFilter { + export namespace PoolListResponseItem { /** - * Filter options for a particular resource type (pool or origin). Use null to - * reset. + * Configures load shedding policies and percentages for the pool. */ - export interface Origin { + export interface LoadShedding { /** - * If set true, disable notifications for this type of resource (pool or origin). + * The percent of traffic to shed from the pool, according to the default policy. + * Applies to new sessions and traffic without session affinity. */ - disable?: boolean; + default_percent?: number; /** - * If present, send notifications only for this health status (e.g. false for only - * DOWN events). Use null to reset (all events). + * The default policy to use when load shedding. A random policy randomly sheds a + * given percent of requests. A hash policy computes a hash over the + * CF-Connecting-IP address and sheds all requests originating from a percent of + * IPs. */ - healthy?: boolean | null; - } + default_policy?: 'random' | 'hash'; - /** - * Filter options for a particular resource type (pool or origin). Use null to - * reset. - */ - export interface Pool { /** - * If set true, disable notifications for this type of resource (pool or origin). + * The percent of existing sessions to shed from the pool, according to the session + * policy. */ - disable?: boolean; + session_percent?: number; /** - * If present, send notifications only for this health status (e.g. false for only - * DOWN events). Use null to reset (all events). + * Only the hash policy is supported for existing sessions (to avoid exponential + * decay). */ - healthy?: boolean | null; + session_policy?: 'hash'; } - } - /** - * Configures origin steering for the pool. Controls how origins are selected for - * new sessions and traffic without session affinity. - */ - export interface OriginSteering { /** - * The type of origin steering policy to use. - * - * - `"random"`: Select an origin randomly. - * - `"hash"`: Select an origin by computing a hash over the CF-Connecting-IP - * address. - * - `"least_outstanding_requests"`: Select an origin by taking into consideration - * origin weights, as well as each origin's number of outstanding requests. - * Origins with more pending requests are weighted proportionately less relative - * to others. - * - `"least_connections"`: Select an origin by taking into consideration origin - * weights, as well as each origin's number of open connections. Origins with - * more open connections are weighted proportionately less relative to others. - * Supported for HTTP/1 and HTTP/2 connections. + * Filter pool and origin health notifications by resource type or health status. + * Use null to reset. */ - policy?: 'random' | 'hash' | 'least_outstanding_requests' | 'least_connections'; - } + export interface NotificationFilter { + /** + * Filter options for a particular resource type (pool or origin). Use null to + * reset. + */ + origin?: NotificationFilter.Origin | null; - export interface Origin { - /** - * 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. - */ - address?: string; + /** + * Filter options for a particular resource type (pool or origin). Use null to + * reset. + */ + pool?: NotificationFilter.Pool | null; + } - /** - * This field shows up only if the origin is disabled. This field is set with the - * time the origin was disabled. - */ - disabled_at?: string; + export namespace NotificationFilter { + /** + * Filter options for a particular resource type (pool or origin). Use null to + * reset. + */ + export interface Origin { + /** + * If set true, disable notifications for this type of resource (pool or origin). + */ + disable?: boolean; - /** - * 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. - */ - enabled?: boolean; + /** + * If present, send notifications only for this health status (e.g. false for only + * DOWN events). Use null to reset (all events). + */ + healthy?: boolean | null; + } - /** - * The request header is used to pass additional information with an HTTP request. - * Currently supported header is 'Host'. - */ - header?: Origin.Header; + /** + * Filter options for a particular resource type (pool or origin). Use null to + * reset. + */ + export interface Pool { + /** + * If set true, disable notifications for this type of resource (pool or origin). + */ + disable?: boolean; - /** - * A human-identifiable name for the origin. - */ - name?: string; + /** + * If present, send notifications only for this health status (e.g. false for only + * DOWN events). Use null to reset (all events). + */ + healthy?: boolean | null; + } + } /** - * The virtual network subnet ID the origin belongs in. Virtual network must also - * belong to the account. + * Configures origin steering for the pool. Controls how origins are selected for + * new sessions and traffic without session affinity. */ - virtual_network_id?: string; + export interface OriginSteering { + /** + * The type of origin steering policy to use. + * + * - `"random"`: Select an origin randomly. + * - `"hash"`: Select an origin by computing a hash over the CF-Connecting-IP + * address. + * - `"least_outstanding_requests"`: Select an origin by taking into consideration + * origin weights, as well as each origin's number of outstanding requests. + * Origins with more pending requests are weighted proportionately less relative + * to others. + * - `"least_connections"`: Select an origin by taking into consideration origin + * weights, as well as each origin's number of open connections. Origins with + * more open connections are weighted proportionately less relative to others. + * Supported for HTTP/1 and HTTP/2 connections. + */ + policy?: 'random' | 'hash' | 'least_outstanding_requests' | 'least_connections'; + } - /** - * 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. - */ - weight?: number; - } + export interface Origin { + /** + * 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. + */ + address?: string; - export namespace Origin { - /** - * The request header is used to pass additional information with an HTTP request. - * Currently supported header is 'Host'. - */ - export interface Header { /** - * The 'Host' header allows to override the hostname set in the HTTP request. - * Current support is 1 'Host' header override per origin. + * This field shows up only if the origin is disabled. This field is set with the + * time the origin was disabled. */ - Host?: Array; + disabled_at?: string; + + /** + * 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. + */ + enabled?: boolean; + + /** + * The request header is used to pass additional information with an HTTP request. + * Currently supported header is 'Host'. + */ + header?: Origin.Header; + + /** + * A human-identifiable name for the origin. + */ + name?: string; + + /** + * The virtual network subnet ID the origin belongs in. Virtual network must also + * belong to the account. + */ + virtual_network_id?: string; + + /** + * 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. + */ + weight?: number; + } + + export namespace Origin { + /** + * The request header is used to pass additional information with an HTTP request. + * Currently supported header is 'Host'. + */ + export interface Header { + /** + * The 'Host' header allows to override the hostname set in the HTTP request. + * Current support is 1 'Host' header override per origin. + */ + Host?: Array; + } } } } -export type PoolListResponse = Array; +export interface PoolDeleteResponse { + id?: string; +} -export namespace PoolListResponse { - export interface PoolListResponseItem { - id?: string; +export interface PoolEditResponse { + id?: string; - /** - * A list of regions from which to run health checks. Null means every Cloudflare - * data center. - */ - check_regions?: Array< - | 'WNAM' - | 'ENAM' - | 'WEU' - | 'EEU' - | 'NSAM' - | 'SSAM' - | 'OC' - | 'ME' - | 'NAF' - | 'SAF' - | 'SAS' - | 'SEAS' - | 'NEAS' - | 'ALL_REGIONS' - > | null; + /** + * A list of regions from which to run health checks. Null means every Cloudflare + * data center. + */ + check_regions?: Array< + | 'WNAM' + | 'ENAM' + | 'WEU' + | 'EEU' + | 'NSAM' + | 'SSAM' + | 'OC' + | 'ME' + | 'NAF' + | 'SAF' + | 'SAS' + | 'SEAS' + | 'NEAS' + | 'ALL_REGIONS' + > | null; - created_on?: string; + created_on?: string; - /** - * A human-readable description of the pool. - */ - description?: string; + /** + * A human-readable description of the pool. + */ + description?: string; - /** - * This field shows up only if the pool is disabled. This field is set with the - * time the pool was disabled at. - */ - disabled_at?: string; + /** + * This field shows up only if the pool is disabled. This field is set with the + * time the pool was disabled at. + */ + disabled_at?: string; - /** - * Whether to enable (the default) or disable this pool. Disabled pools will not - * receive traffic and are excluded from health checks. Disabling a pool will cause - * any load balancers using it to failover to the next pool (if any). - */ - enabled?: boolean; + /** + * Whether to enable (the default) or disable this pool. Disabled pools will not + * receive traffic and are excluded from health checks. Disabling a pool will cause + * any load balancers using it to failover to the next pool (if any). + */ + enabled?: boolean; - /** - * The latitude of the data center containing the origins used in this pool in - * decimal degrees. If this is set, longitude must also be set. - */ - latitude?: number; + /** + * The latitude of the data center containing the origins used in this pool in + * decimal degrees. If this is set, longitude must also be set. + */ + latitude?: number; - /** - * Configures load shedding policies and percentages for the pool. - */ - load_shedding?: PoolListResponseItem.LoadShedding; + /** + * Configures load shedding policies and percentages for the pool. + */ + load_shedding?: PoolEditResponse.LoadShedding; - /** - * The longitude of the data center containing the origins used in this pool in - * decimal degrees. If this is set, latitude must also be set. - */ - longitude?: number; + /** + * The longitude of the data center containing the origins used in this pool in + * decimal degrees. If this is set, latitude must also be set. + */ + longitude?: number; - /** - * The minimum number of origins that must be healthy for this pool to serve - * traffic. If the number of healthy origins falls below this number, the pool will - * be marked unhealthy and will failover to the next available pool. - */ - minimum_origins?: number; + /** + * The minimum number of origins that must be healthy for this pool to serve + * traffic. If the number of healthy origins falls below this number, the pool will + * be marked unhealthy and will failover to the next available pool. + */ + minimum_origins?: number; - modified_on?: string; + modified_on?: string; + /** + * The ID of the Monitor to use for checking the health of origins within this + * pool. + */ + monitor?: unknown; + + /** + * A short name (tag) for the pool. Only alphanumeric characters, hyphens, and + * underscores are allowed. + */ + name?: string; + + /** + * This field is now deprecated. It has been moved to Cloudflare's Centralized + * Notification service + * https://developers.cloudflare.com/fundamentals/notifications/. The email address + * to send health status notifications to. This can be an individual mailbox or a + * mailing list. Multiple emails can be supplied as a comma delimited list. + */ + notification_email?: string; + + /** + * Filter pool and origin health notifications by resource type or health status. + * Use null to reset. + */ + notification_filter?: PoolEditResponse.NotificationFilter | null; + + /** + * Configures origin steering for the pool. Controls how origins are selected for + * new sessions and traffic without session affinity. + */ + origin_steering?: PoolEditResponse.OriginSteering; + + /** + * The list of origins within this pool. Traffic directed at this pool is balanced + * across all currently healthy origins, provided the pool itself is healthy. + */ + origins?: Array; +} + +export namespace PoolEditResponse { + /** + * Configures load shedding policies and percentages for the pool. + */ + export interface LoadShedding { /** - * The ID of the Monitor to use for checking the health of origins within this - * pool. + * The percent of traffic to shed from the pool, according to the default policy. + * Applies to new sessions and traffic without session affinity. */ - monitor?: unknown; + default_percent?: number; /** - * A short name (tag) for the pool. Only alphanumeric characters, hyphens, and - * underscores are allowed. + * The default policy to use when load shedding. A random policy randomly sheds a + * given percent of requests. A hash policy computes a hash over the + * CF-Connecting-IP address and sheds all requests originating from a percent of + * IPs. */ - name?: string; + default_policy?: 'random' | 'hash'; /** - * This field is now deprecated. It has been moved to Cloudflare's Centralized - * Notification service - * https://developers.cloudflare.com/fundamentals/notifications/. The email address - * to send health status notifications to. This can be an individual mailbox or a - * mailing list. Multiple emails can be supplied as a comma delimited list. + * The percent of existing sessions to shed from the pool, according to the session + * policy. */ - notification_email?: string; + session_percent?: number; /** - * Filter pool and origin health notifications by resource type or health status. - * Use null to reset. + * Only the hash policy is supported for existing sessions (to avoid exponential + * decay). */ - notification_filter?: PoolListResponseItem.NotificationFilter | null; + session_policy?: 'hash'; + } + /** + * Filter pool and origin health notifications by resource type or health status. + * Use null to reset. + */ + export interface NotificationFilter { /** - * Configures origin steering for the pool. Controls how origins are selected for - * new sessions and traffic without session affinity. + * Filter options for a particular resource type (pool or origin). Use null to + * reset. */ - origin_steering?: PoolListResponseItem.OriginSteering; + origin?: NotificationFilter.Origin | null; /** - * The list of origins within this pool. Traffic directed at this pool is balanced - * across all currently healthy origins, provided the pool itself is healthy. + * Filter options for a particular resource type (pool or origin). Use null to + * reset. */ - origins?: Array; + pool?: NotificationFilter.Pool | null; } - export namespace PoolListResponseItem { + export namespace NotificationFilter { /** - * Configures load shedding policies and percentages for the pool. + * Filter options for a particular resource type (pool or origin). Use null to + * reset. */ - export interface LoadShedding { - /** - * The percent of traffic to shed from the pool, according to the default policy. - * Applies to new sessions and traffic without session affinity. - */ - default_percent?: number; - - /** - * The default policy to use when load shedding. A random policy randomly sheds a - * given percent of requests. A hash policy computes a hash over the - * CF-Connecting-IP address and sheds all requests originating from a percent of - * IPs. - */ - default_policy?: 'random' | 'hash'; - + export interface Origin { /** - * The percent of existing sessions to shed from the pool, according to the session - * policy. + * If set true, disable notifications for this type of resource (pool or origin). */ - session_percent?: number; + disable?: boolean; /** - * Only the hash policy is supported for existing sessions (to avoid exponential - * decay). + * If present, send notifications only for this health status (e.g. false for only + * DOWN events). Use null to reset (all events). */ - session_policy?: 'hash'; + healthy?: boolean | null; } /** - * Filter pool and origin health notifications by resource type or health status. - * Use null to reset. + * Filter options for a particular resource type (pool or origin). Use null to + * reset. */ - export interface NotificationFilter { - /** - * Filter options for a particular resource type (pool or origin). Use null to - * reset. - */ - origin?: NotificationFilter.Origin | null; - - /** - * Filter options for a particular resource type (pool or origin). Use null to - * reset. - */ - pool?: NotificationFilter.Pool | null; - } - - export namespace NotificationFilter { + export interface Pool { /** - * Filter options for a particular resource type (pool or origin). Use null to - * reset. + * If set true, disable notifications for this type of resource (pool or origin). */ - export interface Origin { - /** - * If set true, disable notifications for this type of resource (pool or origin). - */ - disable?: boolean; - - /** - * If present, send notifications only for this health status (e.g. false for only - * DOWN events). Use null to reset (all events). - */ - healthy?: boolean | null; - } + disable?: boolean; /** - * Filter options for a particular resource type (pool or origin). Use null to - * reset. + * If present, send notifications only for this health status (e.g. false for only + * DOWN events). Use null to reset (all events). */ - export interface Pool { - /** - * If set true, disable notifications for this type of resource (pool or origin). - */ - disable?: boolean; - - /** - * If present, send notifications only for this health status (e.g. false for only - * DOWN events). Use null to reset (all events). - */ - healthy?: boolean | null; - } + healthy?: boolean | null; } + } + /** + * Configures origin steering for the pool. Controls how origins are selected for + * new sessions and traffic without session affinity. + */ + export interface OriginSteering { /** - * Configures origin steering for the pool. Controls how origins are selected for - * new sessions and traffic without session affinity. + * The type of origin steering policy to use. + * + * - `"random"`: Select an origin randomly. + * - `"hash"`: Select an origin by computing a hash over the CF-Connecting-IP + * address. + * - `"least_outstanding_requests"`: Select an origin by taking into consideration + * origin weights, as well as each origin's number of outstanding requests. + * Origins with more pending requests are weighted proportionately less relative + * to others. + * - `"least_connections"`: Select an origin by taking into consideration origin + * weights, as well as each origin's number of open connections. Origins with + * more open connections are weighted proportionately less relative to others. + * Supported for HTTP/1 and HTTP/2 connections. */ - export interface OriginSteering { - /** - * The type of origin steering policy to use. - * - * - `"random"`: Select an origin randomly. - * - `"hash"`: Select an origin by computing a hash over the CF-Connecting-IP - * address. - * - `"least_outstanding_requests"`: Select an origin by taking into consideration - * origin weights, as well as each origin's number of outstanding requests. - * Origins with more pending requests are weighted proportionately less relative - * to others. - * - `"least_connections"`: Select an origin by taking into consideration origin - * weights, as well as each origin's number of open connections. Origins with - * more open connections are weighted proportionately less relative to others. - * Supported for HTTP/1 and HTTP/2 connections. - */ - policy?: 'random' | 'hash' | 'least_outstanding_requests' | 'least_connections'; - } + policy?: 'random' | 'hash' | 'least_outstanding_requests' | 'least_connections'; + } - export interface Origin { - /** - * 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. - */ - address?: string; + export interface Origin { + /** + * 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. + */ + address?: string; - /** - * This field shows up only if the origin is disabled. This field is set with the - * time the origin was disabled. - */ - disabled_at?: string; + /** + * This field shows up only if the origin is disabled. This field is set with the + * time the origin was disabled. + */ + disabled_at?: string; - /** - * 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. - */ - enabled?: boolean; + /** + * 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. + */ + enabled?: boolean; - /** - * The request header is used to pass additional information with an HTTP request. - * Currently supported header is 'Host'. - */ - header?: Origin.Header; + /** + * The request header is used to pass additional information with an HTTP request. + * Currently supported header is 'Host'. + */ + header?: Origin.Header; - /** - * A human-identifiable name for the origin. - */ - name?: string; + /** + * A human-identifiable name for the origin. + */ + name?: string; - /** - * The virtual network subnet ID the origin belongs in. Virtual network must also - * belong to the account. - */ - virtual_network_id?: string; + /** + * The virtual network subnet ID the origin belongs in. Virtual network must also + * belong to the account. + */ + virtual_network_id?: string; - /** - * 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. - */ - weight?: number; - } + /** + * 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. + */ + weight?: number; + } - export namespace Origin { + export namespace Origin { + /** + * The request header is used to pass additional information with an HTTP request. + * Currently supported header is 'Host'. + */ + export interface Header { /** - * The request header is used to pass additional information with an HTTP request. - * Currently supported header is 'Host'. + * The 'Host' header allows to override the hostname set in the HTTP request. + * Current support is 1 'Host' header override per origin. */ - export interface Header { - /** - * The 'Host' header allows to override the hostname set in the HTTP request. - * Current support is 1 'Host' header override per origin. - */ - Host?: Array; - } + Host?: Array; } } } -export interface PoolDeleteResponse { - id?: string; -} - export interface PoolGetResponse { id?: string; @@ -1496,7 +1496,15 @@ export namespace PoolCreateParams { } } -export interface PoolUpdateParams { +export interface PoolListParams { + /** + * The ID of the Monitor to use for checking the health of origins within this + * pool. + */ + monitor?: unknown; +} + +export interface PoolEditParams { /** * A list of regions from which to run health checks. Null means every Cloudflare * data center. @@ -1539,7 +1547,7 @@ export interface PoolUpdateParams { /** * Configures load shedding policies and percentages for the pool. */ - load_shedding?: PoolUpdateParams.LoadShedding; + load_shedding?: PoolEditParams.LoadShedding; /** * The longitude of the data center containing the origins used in this pool in @@ -1579,22 +1587,22 @@ export interface PoolUpdateParams { * Filter pool and origin health notifications by resource type or health status. * Use null to reset. */ - notification_filter?: PoolUpdateParams.NotificationFilter | null; + notification_filter?: PoolEditParams.NotificationFilter | null; /** * Configures origin steering for the pool. Controls how origins are selected for * new sessions and traffic without session affinity. */ - origin_steering?: PoolUpdateParams.OriginSteering; + origin_steering?: PoolEditParams.OriginSteering; /** * The list of origins within this pool. Traffic directed at this pool is balanced * across all currently healthy origins, provided the pool itself is healthy. */ - origins?: Array; + origins?: Array; } -export namespace PoolUpdateParams { +export namespace PoolEditParams { /** * Configures load shedding policies and percentages for the pool. */ @@ -1764,23 +1772,15 @@ export namespace PoolUpdateParams { } } -export interface PoolListParams { - /** - * The ID of the Monitor to use for checking the health of origins within this - * pool. - */ - monitor?: unknown; -} - export namespace Pools { export import PoolCreateResponse = PoolsAPI.PoolCreateResponse; - export import PoolUpdateResponse = PoolsAPI.PoolUpdateResponse; export import PoolListResponse = PoolsAPI.PoolListResponse; export import PoolDeleteResponse = PoolsAPI.PoolDeleteResponse; + export import PoolEditResponse = PoolsAPI.PoolEditResponse; export import PoolGetResponse = PoolsAPI.PoolGetResponse; export import PoolCreateParams = PoolsAPI.PoolCreateParams; - export import PoolUpdateParams = PoolsAPI.PoolUpdateParams; export import PoolListParams = PoolsAPI.PoolListParams; + export import PoolEditParams = PoolsAPI.PoolEditParams; export import Health = HealthAPI.Health; export import HealthCreateResponse = HealthAPI.HealthCreateResponse; export import HealthGetResponse = HealthAPI.HealthGetResponse; diff --git a/src/resources/logpush/index.ts b/src/resources/logpush/index.ts index 0e7c79b79f..4ff05b403a 100644 --- a/src/resources/logpush/index.ts +++ b/src/resources/logpush/index.ts @@ -4,12 +4,12 @@ export { Datasets } from './datasets/index'; export { EdgeCreateResponse, EdgeGetResponse, EdgeCreateParams, Edge } from './edge'; export { JobCreateResponse, + JobUpdateResponse, JobListResponse, JobDeleteResponse, JobGetResponse, - JobReplaceResponse, JobCreateParams, - JobReplaceParams, + JobUpdateParams, Jobs, } from './jobs'; export { Logpush } from './logpush'; diff --git a/src/resources/logpush/jobs.ts b/src/resources/logpush/jobs.ts index 008670fa55..ac028205b1 100644 --- a/src/resources/logpush/jobs.ts +++ b/src/resources/logpush/jobs.ts @@ -22,6 +22,24 @@ export class Jobs extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Updates a Logpush job. + */ + update( + accountOrZone: string, + accountOrZoneId: string, + jobId: number, + body: JobUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/${accountOrZone}/${accountOrZoneId}/logpush/jobs/${jobId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: JobUpdateResponse | null }> + )._thenUnwrap((obj) => obj.result); + } + /** * Lists Logpush jobs for an account or zone. */ @@ -70,27 +88,163 @@ export class Jobs extends APIResource { ) as Core.APIPromise<{ result: JobGetResponse | null }> )._thenUnwrap((obj) => obj.result); } +} +export interface JobCreateResponse { /** - * Updates a Logpush job. + * Unique id of the job. */ - replace( - accountOrZone: string, - accountOrZoneId: string, - jobId: number, - body: JobReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put(`/${accountOrZone}/${accountOrZoneId}/logpush/jobs/${jobId}`, { - body, - ...options, - }) as Core.APIPromise<{ result: JobReplaceResponse | null }> - )._thenUnwrap((obj) => obj.result); + id?: number; + + /** + * Name of the dataset. + */ + dataset?: string | null; + + /** + * Uniquely identifies a resource (such as an s3 bucket) where data will be pushed. + * Additional configuration parameters supported by the destination may be + * included. + */ + destination_conf?: string; + + /** + * Flag that indicates if the job is enabled. + */ + enabled?: boolean; + + /** + * If not null, the job is currently failing. Failures are usually repetitive + * (example: no permissions to write to destination bucket). Only the last failure + * is recorded. On successful execution of a job the error_message and last_error + * are set to null. + */ + error_message?: string | null; + + /** + * The frequency at which Cloudflare sends batches of logs to your destination. + * Setting frequency to high sends your logs in larger quantities of smaller files. + * Setting frequency to low sends logs in smaller quantities of larger files. + */ + frequency?: 'high' | 'low' | null; + + /** + * Records the last time for which logs have been successfully pushed. If the last + * successful push was for logs range 2018-07-23T10:00:00Z to 2018-07-23T10:01:00Z + * then the value of this field will be 2018-07-23T10:01:00Z. If the job has never + * run or has just been enabled and hasn't run yet then the field will be empty. + */ + last_complete?: string | null; + + /** + * Records the last time the job failed. If not null, the job is currently failing. + * If null, the job has either never failed or has run successfully at least once + * since last failure. See also the error_message field. + */ + last_error?: string | null; + + /** + * This field is deprecated. Use `output_options` instead. Configuration string. It + * specifies things like requested fields and timestamp formats. If migrating from + * the logpull api, copy the url (full url or just the query string) of your call + * here, and logpush will keep on making this call for you, setting start and end + * times appropriately. + */ + logpull_options?: string | null; + + /** + * Optional human readable job name. Not unique. Cloudflare suggests that you set + * this to a meaningful string, like the domain name, to make it easier to identify + * your job. + */ + name?: string | null; + + /** + * The structured replacement for `logpull_options`. When including this field, the + * `logpull_option` field will be ignored. + */ + output_options?: JobCreateResponse.OutputOptions | null; +} + +export namespace JobCreateResponse { + /** + * The structured replacement for `logpull_options`. When including this field, the + * `logpull_option` field will be ignored. + */ + export interface OutputOptions { + /** + * String to be prepended before each batch. + */ + batch_prefix?: string | null; + + /** + * String to be appended after each batch. + */ + batch_suffix?: string | null; + + /** + * If set to true, will cause all occurrences of `${` in the generated files to be + * replaced with `x{`. + */ + 'CVE-2021-4428'?: boolean | null; + + /** + * String to join fields. This field be ignored when `record_template` is set. + */ + field_delimiter?: string | null; + + /** + * List of field names to be included in the Logpush output. For the moment, there + * is no option to add all fields at once, so you must specify all the fields names + * you are interested in. + */ + field_names?: Array; + + /** + * Specifies the output type, such as `ndjson` or `csv`. This sets default values + * for the rest of the settings, depending on the chosen output type. Some + * formatting rules, like string quoting, are different between output types. + */ + output_type?: 'ndjson' | 'csv'; + + /** + * String to be inserted in-between the records as separator. + */ + record_delimiter?: string | null; + + /** + * String to be prepended before each record. + */ + record_prefix?: string | null; + + /** + * String to be appended after each record. + */ + record_suffix?: string | null; + + /** + * String to use as template for each record instead of the default comma-separated + * list. All fields used in the template must be present in `field_names` as well, + * otherwise they will end up as null. Format as a Go `text/template` without any + * standard functions, like conditionals, loops, sub-templates, etc. + */ + record_template?: string | null; + + /** + * Floating number to specify sampling rate. Sampling is applied on top of + * filtering, and regardless of the current `sample_interval` of the data. + */ + sample_rate?: number | null; + + /** + * String to specify the format for timestamps, such as `unixnano`, `unix`, or + * `rfc3339`. + */ + timestamp_format?: 'unixnano' | 'unix' | 'rfc3339'; } } -export interface JobCreateResponse { +export interface JobUpdateResponse { /** * Unique id of the job. */ @@ -163,10 +317,10 @@ export interface JobCreateResponse { * The structured replacement for `logpull_options`. When including this field, the * `logpull_option` field will be ignored. */ - output_options?: JobCreateResponse.OutputOptions | null; + output_options?: JobUpdateResponse.OutputOptions | null; } -export namespace JobCreateResponse { +export namespace JobUpdateResponse { /** * The structured replacement for `logpull_options`. When including this field, the * `logpull_option` field will be ignored. @@ -558,160 +712,6 @@ export namespace JobGetResponse { } } -export interface JobReplaceResponse { - /** - * Unique id of the job. - */ - id?: number; - - /** - * Name of the dataset. - */ - dataset?: string | null; - - /** - * Uniquely identifies a resource (such as an s3 bucket) where data will be pushed. - * Additional configuration parameters supported by the destination may be - * included. - */ - destination_conf?: string; - - /** - * Flag that indicates if the job is enabled. - */ - enabled?: boolean; - - /** - * If not null, the job is currently failing. Failures are usually repetitive - * (example: no permissions to write to destination bucket). Only the last failure - * is recorded. On successful execution of a job the error_message and last_error - * are set to null. - */ - error_message?: string | null; - - /** - * The frequency at which Cloudflare sends batches of logs to your destination. - * Setting frequency to high sends your logs in larger quantities of smaller files. - * Setting frequency to low sends logs in smaller quantities of larger files. - */ - frequency?: 'high' | 'low' | null; - - /** - * Records the last time for which logs have been successfully pushed. If the last - * successful push was for logs range 2018-07-23T10:00:00Z to 2018-07-23T10:01:00Z - * then the value of this field will be 2018-07-23T10:01:00Z. If the job has never - * run or has just been enabled and hasn't run yet then the field will be empty. - */ - last_complete?: string | null; - - /** - * Records the last time the job failed. If not null, the job is currently failing. - * If null, the job has either never failed or has run successfully at least once - * since last failure. See also the error_message field. - */ - last_error?: string | null; - - /** - * This field is deprecated. Use `output_options` instead. Configuration string. It - * specifies things like requested fields and timestamp formats. If migrating from - * the logpull api, copy the url (full url or just the query string) of your call - * here, and logpush will keep on making this call for you, setting start and end - * times appropriately. - */ - logpull_options?: string | null; - - /** - * Optional human readable job name. Not unique. Cloudflare suggests that you set - * this to a meaningful string, like the domain name, to make it easier to identify - * your job. - */ - name?: string | null; - - /** - * The structured replacement for `logpull_options`. When including this field, the - * `logpull_option` field will be ignored. - */ - output_options?: JobReplaceResponse.OutputOptions | null; -} - -export namespace JobReplaceResponse { - /** - * The structured replacement for `logpull_options`. When including this field, the - * `logpull_option` field will be ignored. - */ - export interface OutputOptions { - /** - * String to be prepended before each batch. - */ - batch_prefix?: string | null; - - /** - * String to be appended after each batch. - */ - batch_suffix?: string | null; - - /** - * If set to true, will cause all occurrences of `${` in the generated files to be - * replaced with `x{`. - */ - 'CVE-2021-4428'?: boolean | null; - - /** - * String to join fields. This field be ignored when `record_template` is set. - */ - field_delimiter?: string | null; - - /** - * List of field names to be included in the Logpush output. For the moment, there - * is no option to add all fields at once, so you must specify all the fields names - * you are interested in. - */ - field_names?: Array; - - /** - * Specifies the output type, such as `ndjson` or `csv`. This sets default values - * for the rest of the settings, depending on the chosen output type. Some - * formatting rules, like string quoting, are different between output types. - */ - output_type?: 'ndjson' | 'csv'; - - /** - * String to be inserted in-between the records as separator. - */ - record_delimiter?: string | null; - - /** - * String to be prepended before each record. - */ - record_prefix?: string | null; - - /** - * String to be appended after each record. - */ - record_suffix?: string | null; - - /** - * String to use as template for each record instead of the default comma-separated - * list. All fields used in the template must be present in `field_names` as well, - * otherwise they will end up as null. Format as a Go `text/template` without any - * standard functions, like conditionals, loops, sub-templates, etc. - */ - record_template?: string | null; - - /** - * Floating number to specify sampling rate. Sampling is applied on top of - * filtering, and regardless of the current `sample_interval` of the data. - */ - sample_rate?: number | null; - - /** - * String to specify the format for timestamps, such as `unixnano`, `unix`, or - * `rfc3339`. - */ - timestamp_format?: 'unixnano' | 'unix' | 'rfc3339'; - } -} - export interface JobCreateParams { /** * Uniquely identifies a resource (such as an s3 bucket) where data will be pushed. @@ -843,7 +843,7 @@ export namespace JobCreateParams { } } -export interface JobReplaceParams { +export interface JobUpdateParams { /** * Uniquely identifies a resource (such as an s3 bucket) where data will be pushed. * Additional configuration parameters supported by the destination may be @@ -876,7 +876,7 @@ export interface JobReplaceParams { * The structured replacement for `logpull_options`. When including this field, the * `logpull_option` field will be ignored. */ - output_options?: JobReplaceParams.OutputOptions | null; + output_options?: JobUpdateParams.OutputOptions | null; /** * Ownership challenge token to prove destination ownership. @@ -884,7 +884,7 @@ export interface JobReplaceParams { ownership_challenge?: string; } -export namespace JobReplaceParams { +export namespace JobUpdateParams { /** * The structured replacement for `logpull_options`. When including this field, the * `logpull_option` field will be ignored. @@ -964,10 +964,10 @@ export namespace JobReplaceParams { export namespace Jobs { export import JobCreateResponse = JobsAPI.JobCreateResponse; + export import JobUpdateResponse = JobsAPI.JobUpdateResponse; export import JobListResponse = JobsAPI.JobListResponse; export import JobDeleteResponse = JobsAPI.JobDeleteResponse; export import JobGetResponse = JobsAPI.JobGetResponse; - export import JobReplaceResponse = JobsAPI.JobReplaceResponse; export import JobCreateParams = JobsAPI.JobCreateParams; - export import JobReplaceParams = JobsAPI.JobReplaceParams; + export import JobUpdateParams = JobsAPI.JobUpdateParams; } diff --git a/src/resources/logpush/logpush.ts b/src/resources/logpush/logpush.ts index dcff098515..780ca0f685 100644 --- a/src/resources/logpush/logpush.ts +++ b/src/resources/logpush/logpush.ts @@ -23,12 +23,12 @@ export namespace Logpush { export import EdgeCreateParams = EdgeAPI.EdgeCreateParams; export import Jobs = JobsAPI.Jobs; export import JobCreateResponse = JobsAPI.JobCreateResponse; + export import JobUpdateResponse = JobsAPI.JobUpdateResponse; export import JobListResponse = JobsAPI.JobListResponse; export import JobDeleteResponse = JobsAPI.JobDeleteResponse; export import JobGetResponse = JobsAPI.JobGetResponse; - export import JobReplaceResponse = JobsAPI.JobReplaceResponse; export import JobCreateParams = JobsAPI.JobCreateParams; - export import JobReplaceParams = JobsAPI.JobReplaceParams; + export import JobUpdateParams = JobsAPI.JobUpdateParams; export import Ownership = OwnershipAPI.Ownership; export import OwnershipCreateResponse = OwnershipAPI.OwnershipCreateResponse; export import OwnershipValidateResponse = OwnershipAPI.OwnershipValidateResponse; diff --git a/src/resources/magics/cf-interconnects.ts b/src/resources/magics/cf-interconnects.ts index 5af27ecf4d..df9cda11a9 100644 --- a/src/resources/magics/cf-interconnects.ts +++ b/src/resources/magics/cf-interconnects.ts @@ -5,6 +5,25 @@ import { APIResource } from 'cloudflare/resource'; import * as CfInterconnectsAPI from 'cloudflare/resources/magics/cf-interconnects'; export class CfInterconnects extends APIResource { + /** + * Updates a specific interconnect associated with an account. Use + * `?validate_only=true` as an optional query parameter to only run validation + * without persisting changes. + */ + update( + accountIdentifier: string, + tunnelIdentifier: string, + body: CfInterconnectUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/accounts/${accountIdentifier}/magic/cf_interconnects/${tunnelIdentifier}`, { + body, + ...options, + }) as Core.APIPromise<{ result: CfInterconnectUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * Lists interconnects associated with an account. */ @@ -34,25 +53,12 @@ export class CfInterconnects extends APIResource { ) as Core.APIPromise<{ result: CfInterconnectGetResponse }> )._thenUnwrap((obj) => obj.result); } +} - /** - * Updates a specific interconnect associated with an account. Use - * `?validate_only=true` as an optional query parameter to only run validation - * without persisting changes. - */ - replace( - accountIdentifier: string, - tunnelIdentifier: string, - body: CfInterconnectReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put(`/accounts/${accountIdentifier}/magic/cf_interconnects/${tunnelIdentifier}`, { - body, - ...options, - }) as Core.APIPromise<{ result: CfInterconnectReplaceResponse }> - )._thenUnwrap((obj) => obj.result); - } +export interface CfInterconnectUpdateResponse { + modified?: boolean; + + modified_interconnect?: unknown; } export interface CfInterconnectListResponse { @@ -154,13 +160,7 @@ export interface CfInterconnectGetResponse { interconnect?: unknown; } -export interface CfInterconnectReplaceResponse { - modified?: boolean; - - modified_interconnect?: unknown; -} - -export interface CfInterconnectReplaceParams { +export interface CfInterconnectUpdateParams { /** * An optional description of the interconnect. */ @@ -169,9 +169,9 @@ export interface CfInterconnectReplaceParams { /** * The configuration specific to GRE interconnects. */ - gre?: CfInterconnectReplaceParams.Gre; + gre?: CfInterconnectUpdateParams.Gre; - health_check?: CfInterconnectReplaceParams.HealthCheck; + health_check?: CfInterconnectUpdateParams.HealthCheck; /** * A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side @@ -187,7 +187,7 @@ export interface CfInterconnectReplaceParams { mtu?: number; } -export namespace CfInterconnectReplaceParams { +export namespace CfInterconnectUpdateParams { /** * The configuration specific to GRE interconnects. */ @@ -225,8 +225,8 @@ export namespace CfInterconnectReplaceParams { } export namespace CfInterconnects { + export import CfInterconnectUpdateResponse = CfInterconnectsAPI.CfInterconnectUpdateResponse; export import CfInterconnectListResponse = CfInterconnectsAPI.CfInterconnectListResponse; export import CfInterconnectGetResponse = CfInterconnectsAPI.CfInterconnectGetResponse; - export import CfInterconnectReplaceResponse = CfInterconnectsAPI.CfInterconnectReplaceResponse; - export import CfInterconnectReplaceParams = CfInterconnectsAPI.CfInterconnectReplaceParams; + export import CfInterconnectUpdateParams = CfInterconnectsAPI.CfInterconnectUpdateParams; } diff --git a/src/resources/magics/gre-tunnels.ts b/src/resources/magics/gre-tunnels.ts index 3692b28aab..de3f162c45 100644 --- a/src/resources/magics/gre-tunnels.ts +++ b/src/resources/magics/gre-tunnels.ts @@ -22,6 +22,24 @@ export class GreTunnels extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Updates a specific GRE tunnel. Use `?validate_only=true` as an optional query + * parameter to only run validation without persisting changes. + */ + update( + accountIdentifier: string, + tunnelIdentifier: string, + body: GreTunnelUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/accounts/${accountIdentifier}/magic/gre_tunnels/${tunnelIdentifier}`, { + body, + ...options, + }) as Core.APIPromise<{ result: GreTunnelUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * Lists GRE tunnels associated with an account. */ @@ -65,24 +83,6 @@ export class GreTunnels extends APIResource { ) as Core.APIPromise<{ result: GreTunnelGetResponse }> )._thenUnwrap((obj) => obj.result); } - - /** - * Updates a specific GRE tunnel. Use `?validate_only=true` as an optional query - * parameter to only run validation without persisting changes. - */ - replace( - accountIdentifier: string, - tunnelIdentifier: string, - body: GreTunnelReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put(`/accounts/${accountIdentifier}/magic/gre_tunnels/${tunnelIdentifier}`, { - body, - ...options, - }) as Core.APIPromise<{ result: GreTunnelReplaceResponse }> - )._thenUnwrap((obj) => obj.result); - } } export interface GreTunnelCreateResponse { @@ -183,6 +183,12 @@ export namespace GreTunnelCreateResponse { } } +export interface GreTunnelUpdateResponse { + modified?: boolean; + + modified_gre_tunnel?: unknown; +} + export interface GreTunnelListResponse { gre_tunnels?: Array; } @@ -291,15 +297,9 @@ export interface GreTunnelGetResponse { gre_tunnel?: unknown; } -export interface GreTunnelReplaceResponse { - modified?: boolean; - - modified_gre_tunnel?: unknown; -} - export type GreTunnelCreateParams = unknown; -export interface GreTunnelReplaceParams { +export interface GreTunnelUpdateParams { /** * The IP address assigned to the Cloudflare side of the GRE tunnel. */ @@ -328,7 +328,7 @@ export interface GreTunnelReplaceParams { */ description?: string; - health_check?: GreTunnelReplaceParams.HealthCheck; + health_check?: GreTunnelUpdateParams.HealthCheck; /** * Maximum Transmission Unit (MTU) in bytes for the GRE tunnel. The minimum value @@ -342,7 +342,7 @@ export interface GreTunnelReplaceParams { ttl?: number; } -export namespace GreTunnelReplaceParams { +export namespace GreTunnelUpdateParams { export interface HealthCheck { /** * The direction of the flow of the healthcheck. Either unidirectional, where the @@ -378,10 +378,10 @@ export namespace GreTunnelReplaceParams { export namespace GreTunnels { export import GreTunnelCreateResponse = GreTunnelsAPI.GreTunnelCreateResponse; + export import GreTunnelUpdateResponse = GreTunnelsAPI.GreTunnelUpdateResponse; export import GreTunnelListResponse = GreTunnelsAPI.GreTunnelListResponse; export import GreTunnelDeleteResponse = GreTunnelsAPI.GreTunnelDeleteResponse; export import GreTunnelGetResponse = GreTunnelsAPI.GreTunnelGetResponse; - export import GreTunnelReplaceResponse = GreTunnelsAPI.GreTunnelReplaceResponse; export import GreTunnelCreateParams = GreTunnelsAPI.GreTunnelCreateParams; - export import GreTunnelReplaceParams = GreTunnelsAPI.GreTunnelReplaceParams; + export import GreTunnelUpdateParams = GreTunnelsAPI.GreTunnelUpdateParams; } diff --git a/src/resources/magics/index.ts b/src/resources/magics/index.ts index 32f55bd8b0..2d1d3223eb 100644 --- a/src/resources/magics/index.ts +++ b/src/resources/magics/index.ts @@ -1,40 +1,40 @@ // File generated from our OpenAPI spec by Stainless. export { + CfInterconnectUpdateResponse, CfInterconnectListResponse, CfInterconnectGetResponse, - CfInterconnectReplaceResponse, - CfInterconnectReplaceParams, + CfInterconnectUpdateParams, CfInterconnects, } from './cf-interconnects'; export { GreTunnelCreateResponse, + GreTunnelUpdateResponse, GreTunnelListResponse, GreTunnelDeleteResponse, GreTunnelGetResponse, - GreTunnelReplaceResponse, GreTunnelCreateParams, - GreTunnelReplaceParams, + GreTunnelUpdateParams, GreTunnels, } from './gre-tunnels'; export { IpsecTunnelCreateResponse, + IpsecTunnelUpdateResponse, IpsecTunnelListResponse, IpsecTunnelDeleteResponse, IpsecTunnelGetResponse, - IpsecTunnelReplaceResponse, IpsecTunnelCreateParams, - IpsecTunnelReplaceParams, + IpsecTunnelUpdateParams, IpsecTunnels, } from './ipsec-tunnels/index'; export { Magics } from './magics'; export { RouteCreateResponse, + RouteUpdateResponse, RouteDeleteResponse, RouteGetResponse, RouteMagicStaticRoutesListRoutesResponse, - RouteReplaceResponse, RouteCreateParams, - RouteReplaceParams, + RouteUpdateParams, Routes, } from './routes'; diff --git a/src/resources/magics/ipsec-tunnels/index.ts b/src/resources/magics/ipsec-tunnels/index.ts index b7c4efa100..9a51583a6e 100644 --- a/src/resources/magics/ipsec-tunnels/index.ts +++ b/src/resources/magics/ipsec-tunnels/index.ts @@ -2,12 +2,12 @@ export { IpsecTunnelCreateResponse, + IpsecTunnelUpdateResponse, IpsecTunnelListResponse, IpsecTunnelDeleteResponse, IpsecTunnelGetResponse, - IpsecTunnelReplaceResponse, IpsecTunnelCreateParams, - IpsecTunnelReplaceParams, + IpsecTunnelUpdateParams, IpsecTunnels, } from './ipsec-tunnels'; export { PskGenerateCreateResponse, PskGenerates } from './psk-generates'; diff --git a/src/resources/magics/ipsec-tunnels/ipsec-tunnels.ts b/src/resources/magics/ipsec-tunnels/ipsec-tunnels.ts index 533c4982d8..f497c52903 100644 --- a/src/resources/magics/ipsec-tunnels/ipsec-tunnels.ts +++ b/src/resources/magics/ipsec-tunnels/ipsec-tunnels.ts @@ -26,6 +26,25 @@ export class IpsecTunnels extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Updates a specific IPsec tunnel associated with an account. Use + * `?validate_only=true` as an optional query parameter to only run validation + * without persisting changes. + */ + update( + accountIdentifier: string, + tunnelIdentifier: string, + body: IpsecTunnelUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/accounts/${accountIdentifier}/magic/ipsec_tunnels/${tunnelIdentifier}`, { + body, + ...options, + }) as Core.APIPromise<{ result: IpsecTunnelUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * Lists IPsec tunnels associated with an account. */ @@ -70,25 +89,6 @@ export class IpsecTunnels extends APIResource { ) as Core.APIPromise<{ result: IpsecTunnelGetResponse }> )._thenUnwrap((obj) => obj.result); } - - /** - * Updates a specific IPsec tunnel associated with an account. Use - * `?validate_only=true` as an optional query parameter to only run validation - * without persisting changes. - */ - replace( - accountIdentifier: string, - tunnelIdentifier: string, - body: IpsecTunnelReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put(`/accounts/${accountIdentifier}/magic/ipsec_tunnels/${tunnelIdentifier}`, { - body, - ...options, - }) as Core.APIPromise<{ result: IpsecTunnelReplaceResponse }> - )._thenUnwrap((obj) => obj.result); - } } export interface IpsecTunnelCreateResponse { @@ -196,6 +196,12 @@ export namespace IpsecTunnelCreateResponse { } } +export interface IpsecTunnelUpdateResponse { + modified?: boolean; + + modified_ipsec_tunnel?: unknown; +} + export interface IpsecTunnelListResponse { ipsec_tunnels?: Array; } @@ -311,12 +317,6 @@ export interface IpsecTunnelGetResponse { ipsec_tunnel?: unknown; } -export interface IpsecTunnelReplaceResponse { - modified?: boolean; - - modified_ipsec_tunnel?: unknown; -} - export interface IpsecTunnelCreateParams { /** * The IP address assigned to the Cloudflare side of the IPsec tunnel. @@ -357,7 +357,7 @@ export interface IpsecTunnelCreateParams { replay_protection?: boolean; } -export interface IpsecTunnelReplaceParams { +export interface IpsecTunnelUpdateParams { /** * The IP address assigned to the Cloudflare side of the IPsec tunnel. */ @@ -399,12 +399,12 @@ export interface IpsecTunnelReplaceParams { export namespace IpsecTunnels { export import IpsecTunnelCreateResponse = IpsecTunnelsAPI.IpsecTunnelCreateResponse; + export import IpsecTunnelUpdateResponse = IpsecTunnelsAPI.IpsecTunnelUpdateResponse; export import IpsecTunnelListResponse = IpsecTunnelsAPI.IpsecTunnelListResponse; export import IpsecTunnelDeleteResponse = IpsecTunnelsAPI.IpsecTunnelDeleteResponse; export import IpsecTunnelGetResponse = IpsecTunnelsAPI.IpsecTunnelGetResponse; - export import IpsecTunnelReplaceResponse = IpsecTunnelsAPI.IpsecTunnelReplaceResponse; export import IpsecTunnelCreateParams = IpsecTunnelsAPI.IpsecTunnelCreateParams; - export import IpsecTunnelReplaceParams = IpsecTunnelsAPI.IpsecTunnelReplaceParams; + export import IpsecTunnelUpdateParams = IpsecTunnelsAPI.IpsecTunnelUpdateParams; export import PskGenerates = PskGeneratesAPI.PskGenerates; export import PskGenerateCreateResponse = PskGeneratesAPI.PskGenerateCreateResponse; } diff --git a/src/resources/magics/magics.ts b/src/resources/magics/magics.ts index 76634648c9..2dac904523 100644 --- a/src/resources/magics/magics.ts +++ b/src/resources/magics/magics.ts @@ -15,32 +15,32 @@ export class Magics extends APIResource { export namespace Magics { export import CfInterconnects = CfInterconnectsAPI.CfInterconnects; + export import CfInterconnectUpdateResponse = CfInterconnectsAPI.CfInterconnectUpdateResponse; export import CfInterconnectListResponse = CfInterconnectsAPI.CfInterconnectListResponse; export import CfInterconnectGetResponse = CfInterconnectsAPI.CfInterconnectGetResponse; - export import CfInterconnectReplaceResponse = CfInterconnectsAPI.CfInterconnectReplaceResponse; - export import CfInterconnectReplaceParams = CfInterconnectsAPI.CfInterconnectReplaceParams; + export import CfInterconnectUpdateParams = CfInterconnectsAPI.CfInterconnectUpdateParams; export import GreTunnels = GreTunnelsAPI.GreTunnels; export import GreTunnelCreateResponse = GreTunnelsAPI.GreTunnelCreateResponse; + export import GreTunnelUpdateResponse = GreTunnelsAPI.GreTunnelUpdateResponse; export import GreTunnelListResponse = GreTunnelsAPI.GreTunnelListResponse; export import GreTunnelDeleteResponse = GreTunnelsAPI.GreTunnelDeleteResponse; export import GreTunnelGetResponse = GreTunnelsAPI.GreTunnelGetResponse; - export import GreTunnelReplaceResponse = GreTunnelsAPI.GreTunnelReplaceResponse; export import GreTunnelCreateParams = GreTunnelsAPI.GreTunnelCreateParams; - export import GreTunnelReplaceParams = GreTunnelsAPI.GreTunnelReplaceParams; + export import GreTunnelUpdateParams = GreTunnelsAPI.GreTunnelUpdateParams; export import IpsecTunnels = IpsecTunnelsAPI.IpsecTunnels; export import IpsecTunnelCreateResponse = IpsecTunnelsAPI.IpsecTunnelCreateResponse; + export import IpsecTunnelUpdateResponse = IpsecTunnelsAPI.IpsecTunnelUpdateResponse; export import IpsecTunnelListResponse = IpsecTunnelsAPI.IpsecTunnelListResponse; export import IpsecTunnelDeleteResponse = IpsecTunnelsAPI.IpsecTunnelDeleteResponse; export import IpsecTunnelGetResponse = IpsecTunnelsAPI.IpsecTunnelGetResponse; - export import IpsecTunnelReplaceResponse = IpsecTunnelsAPI.IpsecTunnelReplaceResponse; export import IpsecTunnelCreateParams = IpsecTunnelsAPI.IpsecTunnelCreateParams; - export import IpsecTunnelReplaceParams = IpsecTunnelsAPI.IpsecTunnelReplaceParams; + export import IpsecTunnelUpdateParams = IpsecTunnelsAPI.IpsecTunnelUpdateParams; export import Routes = RoutesAPI.Routes; export import RouteCreateResponse = RoutesAPI.RouteCreateResponse; + export import RouteUpdateResponse = RoutesAPI.RouteUpdateResponse; export import RouteDeleteResponse = RoutesAPI.RouteDeleteResponse; export import RouteGetResponse = RoutesAPI.RouteGetResponse; export import RouteMagicStaticRoutesListRoutesResponse = RoutesAPI.RouteMagicStaticRoutesListRoutesResponse; - export import RouteReplaceResponse = RoutesAPI.RouteReplaceResponse; export import RouteCreateParams = RoutesAPI.RouteCreateParams; - export import RouteReplaceParams = RoutesAPI.RouteReplaceParams; + export import RouteUpdateParams = RoutesAPI.RouteUpdateParams; } diff --git a/src/resources/magics/routes.ts b/src/resources/magics/routes.ts index 55a5fbfda5..0bf3254e35 100644 --- a/src/resources/magics/routes.ts +++ b/src/resources/magics/routes.ts @@ -22,6 +22,24 @@ export class Routes extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Update a specific Magic static route. Use `?validate_only=true` as an optional + * query parameter to run validation only without persisting changes. + */ + update( + accountIdentifier: string, + routeIdentifier: string, + body: RouteUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/accounts/${accountIdentifier}/magic/routes/${routeIdentifier}`, { + body, + ...options, + }) as Core.APIPromise<{ result: RouteUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * Disable and remove a specific Magic static route. */ @@ -67,24 +85,6 @@ export class Routes extends APIResource { }> )._thenUnwrap((obj) => obj.result); } - - /** - * Update a specific Magic static route. Use `?validate_only=true` as an optional - * query parameter to run validation only without persisting changes. - */ - replace( - accountIdentifier: string, - routeIdentifier: string, - body: RouteReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put(`/accounts/${accountIdentifier}/magic/routes/${routeIdentifier}`, { - body, - ...options, - }) as Core.APIPromise<{ result: RouteReplaceResponse }> - )._thenUnwrap((obj) => obj.result); - } } export interface RouteCreateResponse { @@ -157,6 +157,12 @@ export namespace RouteCreateResponse { } } +export interface RouteUpdateResponse { + modified?: boolean; + + modified_route?: unknown; +} + export interface RouteDeleteResponse { deleted?: boolean; @@ -237,15 +243,9 @@ export namespace RouteMagicStaticRoutesListRoutesResponse { } } -export interface RouteReplaceResponse { - modified?: boolean; - - modified_route?: unknown; -} - export type RouteCreateParams = unknown; -export interface RouteReplaceParams { +export interface RouteUpdateParams { /** * The next-hop IP Address for the static route. */ @@ -269,7 +269,7 @@ export interface RouteReplaceParams { /** * Used only for ECMP routes. */ - scope?: RouteReplaceParams.Scope; + scope?: RouteUpdateParams.Scope; /** * Optional weight of the ECMP scope - if provided. @@ -277,7 +277,7 @@ export interface RouteReplaceParams { weight?: number; } -export namespace RouteReplaceParams { +export namespace RouteUpdateParams { /** * Used only for ECMP routes. */ @@ -296,10 +296,10 @@ export namespace RouteReplaceParams { export namespace Routes { export import RouteCreateResponse = RoutesAPI.RouteCreateResponse; + export import RouteUpdateResponse = RoutesAPI.RouteUpdateResponse; export import RouteDeleteResponse = RoutesAPI.RouteDeleteResponse; export import RouteGetResponse = RoutesAPI.RouteGetResponse; export import RouteMagicStaticRoutesListRoutesResponse = RoutesAPI.RouteMagicStaticRoutesListRoutesResponse; - export import RouteReplaceResponse = RoutesAPI.RouteReplaceResponse; export import RouteCreateParams = RoutesAPI.RouteCreateParams; - export import RouteReplaceParams = RoutesAPI.RouteReplaceParams; + export import RouteUpdateParams = RoutesAPI.RouteUpdateParams; } diff --git a/src/resources/managed-headers.ts b/src/resources/managed-headers.ts index ed85097d0e..45a0aa2241 100644 --- a/src/resources/managed-headers.ts +++ b/src/resources/managed-headers.ts @@ -6,42 +6,37 @@ import * as ManagedHeadersAPI from 'cloudflare/resources/managed-headers'; export class ManagedHeaders extends APIResource { /** - * Updates the status of one or more Managed Transforms. + * Fetches a list of all Managed Transforms. */ - update( - zoneId: string, - body: ManagedHeaderUpdateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return this._client.patch(`/zones/${zoneId}/managed_headers`, { body, ...options }); + list(zoneId: string, options?: Core.RequestOptions): Core.APIPromise { + return this._client.get(`/zones/${zoneId}/managed_headers`, options); } /** - * Fetches a list of all Managed Transforms. + * Updates the status of one or more Managed Transforms. */ - list(zoneId: string, options?: Core.RequestOptions): Core.APIPromise { - return this._client.get(`/zones/${zoneId}/managed_headers`, options); + edit( + zoneId: string, + body: ManagedHeaderEditParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return this._client.patch(`/zones/${zoneId}/managed_headers`, { body, ...options }); } } -export interface ManagedHeaderUpdateResponse { - managed_request_headers?: Array; +export interface ManagedHeaderListResponse { + managed_request_headers?: Array; - managed_response_headers?: Array; + managed_response_headers?: Array; } -export namespace ManagedHeaderUpdateResponse { +export namespace ManagedHeaderListResponse { export interface ManagedRequestHeader { /** * Human-readable identifier of the Managed Transform. */ id?: string; - /** - * When true, the Managed Transform is available in the current Cloudflare plan. - */ - available?: boolean; - /** * When true, the Managed Transform is enabled. */ @@ -54,11 +49,6 @@ export namespace ManagedHeaderUpdateResponse { */ id?: string; - /** - * When true, the Managed Transform is available in the current Cloudflare plan. - */ - available?: boolean; - /** * When true, the Managed Transform is enabled. */ @@ -66,19 +56,24 @@ export namespace ManagedHeaderUpdateResponse { } } -export interface ManagedHeaderListResponse { - managed_request_headers?: Array; +export interface ManagedHeaderEditResponse { + managed_request_headers?: Array; - managed_response_headers?: Array; + managed_response_headers?: Array; } -export namespace ManagedHeaderListResponse { +export namespace ManagedHeaderEditResponse { export interface ManagedRequestHeader { /** * Human-readable identifier of the Managed Transform. */ id?: string; + /** + * When true, the Managed Transform is available in the current Cloudflare plan. + */ + available?: boolean; + /** * When true, the Managed Transform is enabled. */ @@ -91,6 +86,11 @@ export namespace ManagedHeaderListResponse { */ id?: string; + /** + * When true, the Managed Transform is available in the current Cloudflare plan. + */ + available?: boolean; + /** * When true, the Managed Transform is enabled. */ @@ -98,13 +98,13 @@ export namespace ManagedHeaderListResponse { } } -export interface ManagedHeaderUpdateParams { - managed_request_headers: Array; +export interface ManagedHeaderEditParams { + managed_request_headers: Array; - managed_response_headers: Array; + managed_response_headers: Array; } -export namespace ManagedHeaderUpdateParams { +export namespace ManagedHeaderEditParams { export interface ManagedRequestHeader { /** * Human-readable identifier of the Managed Transform. @@ -131,7 +131,7 @@ export namespace ManagedHeaderUpdateParams { } export namespace ManagedHeaders { - export import ManagedHeaderUpdateResponse = ManagedHeadersAPI.ManagedHeaderUpdateResponse; export import ManagedHeaderListResponse = ManagedHeadersAPI.ManagedHeaderListResponse; - export import ManagedHeaderUpdateParams = ManagedHeadersAPI.ManagedHeaderUpdateParams; + export import ManagedHeaderEditResponse = ManagedHeadersAPI.ManagedHeaderEditResponse; + export import ManagedHeaderEditParams = ManagedHeadersAPI.ManagedHeaderEditParams; } diff --git a/src/resources/memberships.ts b/src/resources/memberships.ts index d517495861..e3de68c614 100644 --- a/src/resources/memberships.ts +++ b/src/resources/memberships.ts @@ -7,6 +7,21 @@ import * as MembershipsAPI from 'cloudflare/resources/memberships'; import { V4PagePaginationArray, type V4PagePaginationArrayParams } from 'cloudflare/pagination'; export class Memberships extends APIResource { + /** + * Accept or reject this account invitation. + */ + update( + membershipId: string, + body: MembershipUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/memberships/${membershipId}`, { body, ...options }) as Core.APIPromise<{ + result: MembershipUpdateResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + /** * List memberships of accounts the user can access. */ @@ -51,25 +66,12 @@ export class Memberships extends APIResource { }> )._thenUnwrap((obj) => obj.result); } - - /** - * Accept or reject this account invitation. - */ - replace( - membershipId: string, - body: MembershipReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put(`/memberships/${membershipId}`, { body, ...options }) as Core.APIPromise<{ - result: MembershipReplaceResponse; - }> - )._thenUnwrap((obj) => obj.result); - } } export class MembershipListResponsesV4PagePaginationArray extends V4PagePaginationArray {} +export type MembershipUpdateResponse = unknown | string | null; + export interface MembershipListResponse { /** * Membership identifier tag. @@ -276,7 +278,12 @@ export interface MembershipDeleteResponse { export type MembershipGetResponse = unknown | string | null; -export type MembershipReplaceResponse = unknown | string | null; +export interface MembershipUpdateParams { + /** + * Whether to accept or reject this account invitation. + */ + status: 'accepted' | 'rejected'; +} export interface MembershipListParams extends V4PagePaginationArrayParams { account?: MembershipListParams.Account; @@ -311,19 +318,12 @@ export namespace MembershipListParams { } } -export interface MembershipReplaceParams { - /** - * Whether to accept or reject this account invitation. - */ - status: 'accepted' | 'rejected'; -} - export namespace Memberships { + export import MembershipUpdateResponse = MembershipsAPI.MembershipUpdateResponse; export import MembershipListResponse = MembershipsAPI.MembershipListResponse; export import MembershipDeleteResponse = MembershipsAPI.MembershipDeleteResponse; export import MembershipGetResponse = MembershipsAPI.MembershipGetResponse; - export import MembershipReplaceResponse = MembershipsAPI.MembershipReplaceResponse; export import MembershipListResponsesV4PagePaginationArray = MembershipsAPI.MembershipListResponsesV4PagePaginationArray; + export import MembershipUpdateParams = MembershipsAPI.MembershipUpdateParams; export import MembershipListParams = MembershipsAPI.MembershipListParams; - export import MembershipReplaceParams = MembershipsAPI.MembershipReplaceParams; } diff --git a/src/resources/mnms/configs/configs.ts b/src/resources/mnms/configs/configs.ts index 2222d174bb..9d9f2e8fb5 100644 --- a/src/resources/mnms/configs/configs.ts +++ b/src/resources/mnms/configs/configs.ts @@ -20,11 +20,12 @@ export class Configs extends APIResource { } /** - * Update fields in an existing network monitoring configuration. + * Update an existing network monitoring configuration, requires the entire + * configuration to be updated at once. */ update(accountIdentifier: unknown, options?: Core.RequestOptions): Core.APIPromise { return ( - this._client.patch(`/accounts/${accountIdentifier}/mnm/config`, options) as Core.APIPromise<{ + this._client.put(`/accounts/${accountIdentifier}/mnm/config`, options) as Core.APIPromise<{ result: ConfigUpdateResponse; }> )._thenUnwrap((obj) => obj.result); @@ -53,13 +54,12 @@ export class Configs extends APIResource { } /** - * Update an existing network monitoring configuration, requires the entire - * configuration to be updated at once. + * Update fields in an existing network monitoring configuration. */ - replace(accountIdentifier: unknown, options?: Core.RequestOptions): Core.APIPromise { + edit(accountIdentifier: unknown, options?: Core.RequestOptions): Core.APIPromise { return ( - this._client.put(`/accounts/${accountIdentifier}/mnm/config`, options) as Core.APIPromise<{ - result: ConfigReplaceResponse; + this._client.patch(`/accounts/${accountIdentifier}/mnm/config`, options) as Core.APIPromise<{ + result: ConfigEditResponse; }> )._thenUnwrap((obj) => obj.result); } @@ -125,7 +125,7 @@ export interface ConfigDeleteResponse { router_ips: Array; } -export interface ConfigReplaceResponse { +export interface ConfigEditResponse { /** * Fallback sampling rate of flow messages being sent in packets per second. This * should match the packet sampling rate configured on the router. @@ -145,7 +145,7 @@ export namespace Configs { export import ConfigUpdateResponse = ConfigsAPI.ConfigUpdateResponse; export import ConfigListResponse = ConfigsAPI.ConfigListResponse; export import ConfigDeleteResponse = ConfigsAPI.ConfigDeleteResponse; - export import ConfigReplaceResponse = ConfigsAPI.ConfigReplaceResponse; + export import ConfigEditResponse = ConfigsAPI.ConfigEditResponse; export import Fulls = FullsAPI.Fulls; export import FullListResponse = FullsAPI.FullListResponse; } diff --git a/src/resources/mnms/configs/index.ts b/src/resources/mnms/configs/index.ts index d5b1ac9388..335d61434d 100644 --- a/src/resources/mnms/configs/index.ts +++ b/src/resources/mnms/configs/index.ts @@ -5,7 +5,7 @@ export { ConfigUpdateResponse, ConfigListResponse, ConfigDeleteResponse, - ConfigReplaceResponse, + ConfigEditResponse, Configs, } from './configs'; export { FullListResponse, Fulls } from './fulls'; diff --git a/src/resources/mnms/index.ts b/src/resources/mnms/index.ts index 0c9813c486..ca973b83d6 100644 --- a/src/resources/mnms/index.ts +++ b/src/resources/mnms/index.ts @@ -5,7 +5,7 @@ export { ConfigUpdateResponse, ConfigListResponse, ConfigDeleteResponse, - ConfigReplaceResponse, + ConfigEditResponse, Configs, } from './configs/index'; export { Mnms } from './mnms'; @@ -14,7 +14,7 @@ export { RuleUpdateResponse, RuleListResponse, RuleDeleteResponse, + RuleEditResponse, RuleGetResponse, - RuleReplaceResponse, Rules, } from './rules/index'; diff --git a/src/resources/mnms/mnms.ts b/src/resources/mnms/mnms.ts index be124035dd..18c7e8e55b 100644 --- a/src/resources/mnms/mnms.ts +++ b/src/resources/mnms/mnms.ts @@ -15,12 +15,12 @@ export namespace Mnms { export import ConfigUpdateResponse = ConfigsAPI.ConfigUpdateResponse; export import ConfigListResponse = ConfigsAPI.ConfigListResponse; export import ConfigDeleteResponse = ConfigsAPI.ConfigDeleteResponse; - export import ConfigReplaceResponse = ConfigsAPI.ConfigReplaceResponse; + export import ConfigEditResponse = ConfigsAPI.ConfigEditResponse; export import Rules = RulesAPI.Rules; export import RuleCreateResponse = RulesAPI.RuleCreateResponse; export import RuleUpdateResponse = RulesAPI.RuleUpdateResponse; export import RuleListResponse = RulesAPI.RuleListResponse; export import RuleDeleteResponse = RulesAPI.RuleDeleteResponse; + export import RuleEditResponse = RulesAPI.RuleEditResponse; export import RuleGetResponse = RulesAPI.RuleGetResponse; - export import RuleReplaceResponse = RulesAPI.RuleReplaceResponse; } diff --git a/src/resources/mnms/rules/advertisements.ts b/src/resources/mnms/rules/advertisements.ts index 8132838d14..ea0c6940bf 100644 --- a/src/resources/mnms/rules/advertisements.ts +++ b/src/resources/mnms/rules/advertisements.ts @@ -8,21 +8,21 @@ export class Advertisements extends APIResource { /** * Update advertisement for rule. */ - update( + edit( accountIdentifier: unknown, ruleIdentifier: unknown, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.patch( `/accounts/${accountIdentifier}/mnm/rules/${ruleIdentifier}/advertisement`, options, - ) as Core.APIPromise<{ result: AdvertisementUpdateResponse | null }> + ) as Core.APIPromise<{ result: AdvertisementEditResponse | null }> )._thenUnwrap((obj) => obj.result); } } -export interface AdvertisementUpdateResponse { +export interface AdvertisementEditResponse { /** * Toggle on if you would like Cloudflare to automatically advertise the IP * Prefixes within the rule via Magic Transit when the rule is triggered. Only @@ -32,5 +32,5 @@ export interface AdvertisementUpdateResponse { } export namespace Advertisements { - export import AdvertisementUpdateResponse = AdvertisementsAPI.AdvertisementUpdateResponse; + export import AdvertisementEditResponse = AdvertisementsAPI.AdvertisementEditResponse; } diff --git a/src/resources/mnms/rules/index.ts b/src/resources/mnms/rules/index.ts index 085005803e..4c8326e281 100644 --- a/src/resources/mnms/rules/index.ts +++ b/src/resources/mnms/rules/index.ts @@ -1,12 +1,12 @@ // File generated from our OpenAPI spec by Stainless. -export { AdvertisementUpdateResponse, Advertisements } from './advertisements'; +export { AdvertisementEditResponse, Advertisements } from './advertisements'; export { RuleCreateResponse, RuleUpdateResponse, RuleListResponse, RuleDeleteResponse, + RuleEditResponse, RuleGetResponse, - RuleReplaceResponse, Rules, } from './rules'; diff --git a/src/resources/mnms/rules/rules.ts b/src/resources/mnms/rules/rules.ts index e299989705..b727d24326 100644 --- a/src/resources/mnms/rules/rules.ts +++ b/src/resources/mnms/rules/rules.ts @@ -24,18 +24,16 @@ export class Rules extends APIResource { } /** - * Update a network monitoring rule for account. + * Update network monitoring rules for account. */ update( accountIdentifier: unknown, - ruleIdentifier: unknown, options?: Core.RequestOptions, ): Core.APIPromise { return ( - this._client.patch( - `/accounts/${accountIdentifier}/mnm/rules/${ruleIdentifier}`, - options, - ) as Core.APIPromise<{ result: RuleUpdateResponse | null }> + this._client.put(`/accounts/${accountIdentifier}/mnm/rules`, options) as Core.APIPromise<{ + result: RuleUpdateResponse | null; + }> )._thenUnwrap((obj) => obj.result); } @@ -67,32 +65,34 @@ export class Rules extends APIResource { } /** - * List a single network monitoring rule for account. + * Update a network monitoring rule for account. */ - get( + edit( accountIdentifier: unknown, ruleIdentifier: unknown, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( - this._client.get( + this._client.patch( `/accounts/${accountIdentifier}/mnm/rules/${ruleIdentifier}`, options, - ) as Core.APIPromise<{ result: RuleGetResponse | null }> + ) as Core.APIPromise<{ result: RuleEditResponse | null }> )._thenUnwrap((obj) => obj.result); } /** - * Update network monitoring rules for account. + * List a single network monitoring rule for account. */ - replace( + get( accountIdentifier: unknown, + ruleIdentifier: unknown, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( - this._client.put(`/accounts/${accountIdentifier}/mnm/rules`, options) as Core.APIPromise<{ - result: RuleReplaceResponse | null; - }> + this._client.get( + `/accounts/${accountIdentifier}/mnm/rules/${ruleIdentifier}`, + options, + ) as Core.APIPromise<{ result: RuleGetResponse | null }> )._thenUnwrap((obj) => obj.result); } } @@ -265,7 +265,7 @@ export interface RuleDeleteResponse { packet_threshold?: number; } -export interface RuleGetResponse { +export interface RuleEditResponse { /** * Toggle on if you would like Cloudflare to automatically advertise the IP * Prefixes within the rule via Magic Transit when the rule is triggered. Only @@ -306,7 +306,7 @@ export interface RuleGetResponse { packet_threshold?: number; } -export interface RuleReplaceResponse { +export interface RuleGetResponse { /** * Toggle on if you would like Cloudflare to automatically advertise the IP * Prefixes within the rule via Magic Transit when the rule is triggered. Only @@ -352,8 +352,8 @@ export namespace Rules { export import RuleUpdateResponse = RulesAPI.RuleUpdateResponse; export import RuleListResponse = RulesAPI.RuleListResponse; export import RuleDeleteResponse = RulesAPI.RuleDeleteResponse; + export import RuleEditResponse = RulesAPI.RuleEditResponse; export import RuleGetResponse = RulesAPI.RuleGetResponse; - export import RuleReplaceResponse = RulesAPI.RuleReplaceResponse; export import Advertisements = AdvertisementsAPI.Advertisements; - export import AdvertisementUpdateResponse = AdvertisementsAPI.AdvertisementUpdateResponse; + export import AdvertisementEditResponse = AdvertisementsAPI.AdvertisementEditResponse; } diff --git a/src/resources/origin-post-quantum-encryption.ts b/src/resources/origin-post-quantum-encryption.ts index 2edebd167d..04b3423985 100644 --- a/src/resources/origin-post-quantum-encryption.ts +++ b/src/resources/origin-post-quantum-encryption.ts @@ -13,14 +13,16 @@ export class OriginPostQuantumEncryption extends APIResource { * algorithms are advertised but only used when requested by the origin, and off * means that PQ algorithms are not advertised */ - get( + update( zoneId: string, + body: OriginPostQuantumEncryptionUpdateParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( - this._client.get(`/zones/${zoneId}/cache/origin_post_quantum_encryption`, options) as Core.APIPromise<{ - result: OriginPostQuantumEncryptionGetResponse; - }> + this._client.put(`/zones/${zoneId}/cache/origin_post_quantum_encryption`, { + body, + ...options, + }) as Core.APIPromise<{ result: OriginPostQuantumEncryptionUpdateResponse }> )._thenUnwrap((obj) => obj.result); } @@ -32,25 +34,23 @@ export class OriginPostQuantumEncryption extends APIResource { * algorithms are advertised but only used when requested by the origin, and off * means that PQ algorithms are not advertised */ - replace( + get( zoneId: string, - body: OriginPostQuantumEncryptionReplaceParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( - this._client.put(`/zones/${zoneId}/cache/origin_post_quantum_encryption`, { - body, - ...options, - }) as Core.APIPromise<{ result: OriginPostQuantumEncryptionReplaceResponse }> + this._client.get(`/zones/${zoneId}/cache/origin_post_quantum_encryption`, options) as Core.APIPromise<{ + result: OriginPostQuantumEncryptionGetResponse; + }> )._thenUnwrap((obj) => obj.result); } } -export type OriginPostQuantumEncryptionGetResponse = unknown | string | null; +export type OriginPostQuantumEncryptionUpdateResponse = unknown | string | null; -export type OriginPostQuantumEncryptionReplaceResponse = unknown | string | null; +export type OriginPostQuantumEncryptionGetResponse = unknown | string | null; -export interface OriginPostQuantumEncryptionReplaceParams { +export interface OriginPostQuantumEncryptionUpdateParams { /** * Value of the Origin Post Quantum Encryption Setting. */ @@ -58,7 +58,7 @@ export interface OriginPostQuantumEncryptionReplaceParams { } export namespace OriginPostQuantumEncryption { + export import OriginPostQuantumEncryptionUpdateResponse = OriginPostQuantumEncryptionAPI.OriginPostQuantumEncryptionUpdateResponse; export import OriginPostQuantumEncryptionGetResponse = OriginPostQuantumEncryptionAPI.OriginPostQuantumEncryptionGetResponse; - export import OriginPostQuantumEncryptionReplaceResponse = OriginPostQuantumEncryptionAPI.OriginPostQuantumEncryptionReplaceResponse; - export import OriginPostQuantumEncryptionReplaceParams = OriginPostQuantumEncryptionAPI.OriginPostQuantumEncryptionReplaceParams; + export import OriginPostQuantumEncryptionUpdateParams = OriginPostQuantumEncryptionAPI.OriginPostQuantumEncryptionUpdateParams; } diff --git a/src/resources/origin-tls-client-auth/hostnames/hostnames.ts b/src/resources/origin-tls-client-auth/hostnames/hostnames.ts index 841994caf2..e531b6c0d6 100644 --- a/src/resources/origin-tls-client-auth/hostnames/hostnames.ts +++ b/src/resources/origin-tls-client-auth/hostnames/hostnames.ts @@ -8,18 +8,6 @@ import * as CertificatesAPI from 'cloudflare/resources/origin-tls-client-auth/ho export class Hostnames extends APIResource { certificates: CertificatesAPI.Certificates = new CertificatesAPI.Certificates(this._client); - /** - * Get the Hostname Status for Client Authentication - */ - get(zoneId: string, hostname: string, options?: Core.RequestOptions): Core.APIPromise { - return ( - this._client.get( - `/zones/${zoneId}/origin_tls_client_auth/hostnames/${hostname}`, - options, - ) as Core.APIPromise<{ result: HostnameGetResponse }> - )._thenUnwrap((obj) => obj.result); - } - /** * Associate a hostname to a certificate and enable, disable or invalidate the * association. If disabled, client certificate will not be sent to the hostname @@ -27,20 +15,70 @@ export class Hostnames extends APIResource { * certificate are allowed. Note: Use a null value for parameter _enabled_ to * invalidate the association. */ - replace( + update( zoneId: string, - body: HostnameReplaceParams, + body: HostnameUpdateParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.put(`/zones/${zoneId}/origin_tls_client_auth/hostnames`, { body, ...options, - }) as Core.APIPromise<{ result: HostnameReplaceResponse | null }> + }) as Core.APIPromise<{ result: HostnameUpdateResponse | null }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Get the Hostname Status for Client Authentication + */ + get(zoneId: string, hostname: string, options?: Core.RequestOptions): Core.APIPromise { + return ( + this._client.get( + `/zones/${zoneId}/origin_tls_client_auth/hostnames/${hostname}`, + options, + ) as Core.APIPromise<{ result: HostnameGetResponse }> )._thenUnwrap((obj) => obj.result); } } +export type HostnameUpdateResponse = Array; + +export namespace HostnameUpdateResponse { + export interface HostnameUpdateResponseItem { + /** + * Identifier + */ + id?: string; + + /** + * Identifier + */ + cert_id?: string; + + /** + * The hostname certificate. + */ + certificate?: string; + + /** + * Indicates whether hostname-level authenticated origin pulls is enabled. A null + * value voids the association. + */ + enabled?: boolean | null; + + /** + * The hostname on the origin for which the client certificate uploaded will be + * used. + */ + hostname?: string; + + /** + * The hostname certificate's private key. + */ + private_key?: string; + } +} + export interface HostnameGetResponse { /** * Identifier @@ -129,49 +167,11 @@ export interface HostnameGetResponse { updated_at?: string; } -export type HostnameReplaceResponse = Array; - -export namespace HostnameReplaceResponse { - export interface HostnameReplaceResponseItem { - /** - * Identifier - */ - id?: string; - - /** - * Identifier - */ - cert_id?: string; - - /** - * The hostname certificate. - */ - certificate?: string; - - /** - * Indicates whether hostname-level authenticated origin pulls is enabled. A null - * value voids the association. - */ - enabled?: boolean | null; - - /** - * The hostname on the origin for which the client certificate uploaded will be - * used. - */ - hostname?: string; - - /** - * The hostname certificate's private key. - */ - private_key?: string; - } -} - -export interface HostnameReplaceParams { - config: Array; +export interface HostnameUpdateParams { + config: Array; } -export namespace HostnameReplaceParams { +export namespace HostnameUpdateParams { export interface Config { /** * Certificate identifier tag. @@ -193,9 +193,9 @@ export namespace HostnameReplaceParams { } export namespace Hostnames { + export import HostnameUpdateResponse = HostnamesAPI.HostnameUpdateResponse; export import HostnameGetResponse = HostnamesAPI.HostnameGetResponse; - export import HostnameReplaceResponse = HostnamesAPI.HostnameReplaceResponse; - export import HostnameReplaceParams = HostnamesAPI.HostnameReplaceParams; + export import HostnameUpdateParams = HostnamesAPI.HostnameUpdateParams; export import Certificates = CertificatesAPI.Certificates; export import CertificateCreateResponse = CertificatesAPI.CertificateCreateResponse; export import CertificateListResponse = CertificatesAPI.CertificateListResponse; diff --git a/src/resources/origin-tls-client-auth/hostnames/index.ts b/src/resources/origin-tls-client-auth/hostnames/index.ts index 5acfac2098..08a0dd0f5b 100644 --- a/src/resources/origin-tls-client-auth/hostnames/index.ts +++ b/src/resources/origin-tls-client-auth/hostnames/index.ts @@ -8,4 +8,4 @@ export { CertificateCreateParams, Certificates, } from './certificates'; -export { HostnameGetResponse, HostnameReplaceResponse, HostnameReplaceParams, Hostnames } from './hostnames'; +export { HostnameUpdateResponse, HostnameGetResponse, HostnameUpdateParams, Hostnames } from './hostnames'; diff --git a/src/resources/origin-tls-client-auth/index.ts b/src/resources/origin-tls-client-auth/index.ts index 3fa73adf1e..686f1fa3e7 100644 --- a/src/resources/origin-tls-client-auth/index.ts +++ b/src/resources/origin-tls-client-auth/index.ts @@ -1,9 +1,9 @@ // File generated from our OpenAPI spec by Stainless. export { + HostnameUpdateResponse, HostnameGetResponse, - HostnameReplaceResponse, - HostnameReplaceParams, + HostnameUpdateParams, Hostnames, } from './hostnames/index'; export { @@ -14,4 +14,4 @@ export { OriginTLSClientAuthCreateParams, OriginTLSClientAuth, } from './origin-tls-client-auth'; -export { SettingGetResponse, SettingReplaceResponse, SettingReplaceParams, Settings } from './settings'; +export { SettingUpdateResponse, SettingGetResponse, SettingUpdateParams, Settings } from './settings'; diff --git a/src/resources/origin-tls-client-auth/origin-tls-client-auth.ts b/src/resources/origin-tls-client-auth/origin-tls-client-auth.ts index b9fc56e19c..e57c18c148 100644 --- a/src/resources/origin-tls-client-auth/origin-tls-client-auth.ts +++ b/src/resources/origin-tls-client-auth/origin-tls-client-auth.ts @@ -128,11 +128,11 @@ export namespace OriginTLSClientAuth { export import OriginTLSClientAuthGetResponse = OriginTLSClientAuthAPI.OriginTLSClientAuthGetResponse; export import OriginTLSClientAuthCreateParams = OriginTLSClientAuthAPI.OriginTLSClientAuthCreateParams; export import Hostnames = HostnamesAPI.Hostnames; + export import HostnameUpdateResponse = HostnamesAPI.HostnameUpdateResponse; export import HostnameGetResponse = HostnamesAPI.HostnameGetResponse; - export import HostnameReplaceResponse = HostnamesAPI.HostnameReplaceResponse; - export import HostnameReplaceParams = HostnamesAPI.HostnameReplaceParams; + export import HostnameUpdateParams = HostnamesAPI.HostnameUpdateParams; export import Settings = SettingsAPI.Settings; + export import SettingUpdateResponse = SettingsAPI.SettingUpdateResponse; export import SettingGetResponse = SettingsAPI.SettingGetResponse; - export import SettingReplaceResponse = SettingsAPI.SettingReplaceResponse; - export import SettingReplaceParams = SettingsAPI.SettingReplaceParams; + export import SettingUpdateParams = SettingsAPI.SettingUpdateParams; } diff --git a/src/resources/origin-tls-client-auth/settings.ts b/src/resources/origin-tls-client-auth/settings.ts index e180d1ef96..1145fcafdd 100644 --- a/src/resources/origin-tls-client-auth/settings.ts +++ b/src/resources/origin-tls-client-auth/settings.ts @@ -5,52 +5,52 @@ import { APIResource } from 'cloudflare/resource'; import * as SettingsAPI from 'cloudflare/resources/origin-tls-client-auth/settings'; export class Settings extends APIResource { - /** - * Get whether zone-level authenticated origin pulls is enabled or not. It is false - * by default. - */ - get(zoneId: string, options?: Core.RequestOptions): Core.APIPromise { - return ( - this._client.get(`/zones/${zoneId}/origin_tls_client_auth/settings`, options) as Core.APIPromise<{ - result: SettingGetResponse; - }> - )._thenUnwrap((obj) => obj.result); - } - /** * Enable or disable zone-level authenticated origin pulls. 'enabled' should be set * true either before/after the certificate is uploaded to see the certificate in * use. */ - replace( + update( zoneId: string, - body: SettingReplaceParams, + body: SettingUpdateParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.put(`/zones/${zoneId}/origin_tls_client_auth/settings`, { body, ...options, - }) as Core.APIPromise<{ result: SettingReplaceResponse }> + }) as Core.APIPromise<{ result: SettingUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Get whether zone-level authenticated origin pulls is enabled or not. It is false + * by default. + */ + get(zoneId: string, options?: Core.RequestOptions): Core.APIPromise { + return ( + this._client.get(`/zones/${zoneId}/origin_tls_client_auth/settings`, options) as Core.APIPromise<{ + result: SettingGetResponse; + }> )._thenUnwrap((obj) => obj.result); } } -export interface SettingGetResponse { +export interface SettingUpdateResponse { /** * Indicates whether zone-level authenticated origin pulls is enabled. */ enabled?: boolean; } -export interface SettingReplaceResponse { +export interface SettingGetResponse { /** * Indicates whether zone-level authenticated origin pulls is enabled. */ enabled?: boolean; } -export interface SettingReplaceParams { +export interface SettingUpdateParams { /** * Indicates whether zone-level authenticated origin pulls is enabled. */ @@ -58,7 +58,7 @@ export interface SettingReplaceParams { } export namespace Settings { + export import SettingUpdateResponse = SettingsAPI.SettingUpdateResponse; export import SettingGetResponse = SettingsAPI.SettingGetResponse; - export import SettingReplaceResponse = SettingsAPI.SettingReplaceResponse; - export import SettingReplaceParams = SettingsAPI.SettingReplaceParams; + export import SettingUpdateParams = SettingsAPI.SettingUpdateParams; } diff --git a/src/resources/page-shield/index.ts b/src/resources/page-shield/index.ts index b2360e6921..a234060408 100644 --- a/src/resources/page-shield/index.ts +++ b/src/resources/page-shield/index.ts @@ -7,18 +7,18 @@ export { Connections, } from './connections'; export { + PageShieldUpdateResponse, PageShieldListResponse, - PageShieldReplaceResponse, - PageShieldReplaceParams, + PageShieldUpdateParams, PageShield, } from './page-shield'; export { PolicyCreateResponse, + PolicyUpdateResponse, PolicyListResponse, PolicyGetResponse, - PolicyReplaceResponse, PolicyCreateParams, - PolicyReplaceParams, + PolicyUpdateParams, Policies, } from './policies'; export { ScriptListResponse, ScriptGetResponse, ScriptListParams, Scripts } from './scripts'; diff --git a/src/resources/page-shield/page-shield.ts b/src/resources/page-shield/page-shield.ts index 6388a2ddb0..ca6ccda914 100644 --- a/src/resources/page-shield/page-shield.ts +++ b/src/resources/page-shield/page-shield.ts @@ -13,33 +13,33 @@ export class PageShield extends APIResource { scripts: ScriptsAPI.Scripts = new ScriptsAPI.Scripts(this._client); /** - * Fetches the Page Shield settings. + * Updates Page Shield settings. */ - list(zoneId: string, options?: Core.RequestOptions): Core.APIPromise { + update( + zoneId: string, + body: PageShieldUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { return ( - this._client.get(`/zones/${zoneId}/page_shield`, options) as Core.APIPromise<{ - result: PageShieldListResponse; + this._client.put(`/zones/${zoneId}/page_shield`, { body, ...options }) as Core.APIPromise<{ + result: PageShieldUpdateResponse; }> )._thenUnwrap((obj) => obj.result); } /** - * Updates Page Shield settings. + * Fetches the Page Shield settings. */ - replace( - zoneId: string, - body: PageShieldReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { + list(zoneId: string, options?: Core.RequestOptions): Core.APIPromise { return ( - this._client.put(`/zones/${zoneId}/page_shield`, { body, ...options }) as Core.APIPromise<{ - result: PageShieldReplaceResponse; + this._client.get(`/zones/${zoneId}/page_shield`, options) as Core.APIPromise<{ + result: PageShieldListResponse; }> )._thenUnwrap((obj) => obj.result); } } -export interface PageShieldListResponse { +export interface PageShieldUpdateResponse { /** * When true, indicates that Page Shield is enabled. */ @@ -62,7 +62,7 @@ export interface PageShieldListResponse { use_connection_url_path?: boolean; } -export interface PageShieldReplaceResponse { +export interface PageShieldListResponse { /** * When true, indicates that Page Shield is enabled. */ @@ -85,7 +85,7 @@ export interface PageShieldReplaceResponse { use_connection_url_path?: boolean; } -export interface PageShieldReplaceParams { +export interface PageShieldUpdateParams { /** * When true, indicates that Page Shield is enabled. */ @@ -104,16 +104,16 @@ export interface PageShieldReplaceParams { } export namespace PageShield { + export import PageShieldUpdateResponse = PageShieldAPI.PageShieldUpdateResponse; export import PageShieldListResponse = PageShieldAPI.PageShieldListResponse; - export import PageShieldReplaceResponse = PageShieldAPI.PageShieldReplaceResponse; - export import PageShieldReplaceParams = PageShieldAPI.PageShieldReplaceParams; + export import PageShieldUpdateParams = PageShieldAPI.PageShieldUpdateParams; export import Policies = PoliciesAPI.Policies; export import PolicyCreateResponse = PoliciesAPI.PolicyCreateResponse; + export import PolicyUpdateResponse = PoliciesAPI.PolicyUpdateResponse; export import PolicyListResponse = PoliciesAPI.PolicyListResponse; export import PolicyGetResponse = PoliciesAPI.PolicyGetResponse; - export import PolicyReplaceResponse = PoliciesAPI.PolicyReplaceResponse; export import PolicyCreateParams = PoliciesAPI.PolicyCreateParams; - export import PolicyReplaceParams = PoliciesAPI.PolicyReplaceParams; + export import PolicyUpdateParams = PoliciesAPI.PolicyUpdateParams; export import Connections = ConnectionsAPI.Connections; export import ConnectionListResponse = ConnectionsAPI.ConnectionListResponse; export import ConnectionGetResponse = ConnectionsAPI.ConnectionGetResponse; diff --git a/src/resources/page-shield/policies.ts b/src/resources/page-shield/policies.ts index b108c4f80a..d9b01f08dc 100644 --- a/src/resources/page-shield/policies.ts +++ b/src/resources/page-shield/policies.ts @@ -16,6 +16,18 @@ export class Policies extends APIResource { return this._client.post(`/zones/${zoneId}/page_shield/policies`, { body, ...options }); } + /** + * Update a Page Shield policy by ID. + */ + update( + zoneId: string, + policyId: string, + body: PolicyUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return this._client.put(`/zones/${zoneId}/page_shield/policies/${policyId}`, { body, ...options }); + } + /** * Lists all Page Shield policies. */ @@ -43,21 +55,42 @@ export class Policies extends APIResource { get(zoneId: string, policyId: string, options?: Core.RequestOptions): Core.APIPromise { return this._client.get(`/zones/${zoneId}/page_shield/policies/${policyId}`, options); } +} +export interface PolicyCreateResponse { /** - * Update a Page Shield policy by ID. + * The ID of the policy */ - replace( - zoneId: string, - policyId: string, - body: PolicyReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return this._client.put(`/zones/${zoneId}/page_shield/policies/${policyId}`, { body, ...options }); - } + id?: string; + + /** + * The action to take if the expression matches + */ + action?: 'allow' | 'log'; + + /** + * A description for the policy + */ + description?: string; + + /** + * Whether the policy is enabled + */ + enabled?: boolean; + + /** + * The expression which must match for the policy to be applied, using the + * Cloudflare Firewall rule expression syntax + */ + expression?: string; + + /** + * The policy which will be applied + */ + value?: string; } -export interface PolicyCreateResponse { +export interface PolicyUpdateResponse { /** * The ID of the policy */ @@ -160,39 +193,6 @@ export interface PolicyGetResponse { value?: string; } -export interface PolicyReplaceResponse { - /** - * The ID of the policy - */ - id?: string; - - /** - * The action to take if the expression matches - */ - action?: 'allow' | 'log'; - - /** - * A description for the policy - */ - description?: string; - - /** - * Whether the policy is enabled - */ - enabled?: boolean; - - /** - * The expression which must match for the policy to be applied, using the - * Cloudflare Firewall rule expression syntax - */ - expression?: string; - - /** - * The policy which will be applied - */ - value?: string; -} - export interface PolicyCreateParams { /** * The action to take if the expression matches @@ -221,7 +221,7 @@ export interface PolicyCreateParams { value?: string; } -export interface PolicyReplaceParams { +export interface PolicyUpdateParams { /** * The action to take if the expression matches */ @@ -251,9 +251,9 @@ export interface PolicyReplaceParams { export namespace Policies { export import PolicyCreateResponse = PoliciesAPI.PolicyCreateResponse; + export import PolicyUpdateResponse = PoliciesAPI.PolicyUpdateResponse; export import PolicyListResponse = PoliciesAPI.PolicyListResponse; export import PolicyGetResponse = PoliciesAPI.PolicyGetResponse; - export import PolicyReplaceResponse = PoliciesAPI.PolicyReplaceResponse; export import PolicyCreateParams = PoliciesAPI.PolicyCreateParams; - export import PolicyReplaceParams = PoliciesAPI.PolicyReplaceParams; + export import PolicyUpdateParams = PoliciesAPI.PolicyUpdateParams; } diff --git a/src/resources/pagerules/index.ts b/src/resources/pagerules/index.ts index 5f81f5f049..7d20fdb20d 100644 --- a/src/resources/pagerules/index.ts +++ b/src/resources/pagerules/index.ts @@ -2,13 +2,13 @@ export { PageruleCreateResponse, + PageruleUpdateResponse, PageruleListResponse, PageruleDeleteResponse, PageruleGetResponse, - PageruleReplaceResponse, PageruleCreateParams, + PageruleUpdateParams, PageruleListParams, - PageruleReplaceParams, Pagerules, } from './pagerules'; export { SettingListResponse, Settings } from './settings'; diff --git a/src/resources/pagerules/pagerules.ts b/src/resources/pagerules/pagerules.ts index da4ed95807..6dc80cdc96 100644 --- a/src/resources/pagerules/pagerules.ts +++ b/src/resources/pagerules/pagerules.ts @@ -24,6 +24,23 @@ export class Pagerules extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Replaces the configuration of an existing Page Rule. The configuration of the + * updated Page Rule will exactly match the data passed in the API request. + */ + update( + zoneId: string, + pageruleId: string, + body: PageruleUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/zones/${zoneId}/pagerules/${pageruleId}`, { body, ...options }) as Core.APIPromise<{ + result: PageruleUpdateResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + /** * Fetches Page Rules in a zone. */ @@ -77,27 +94,12 @@ export class Pagerules extends APIResource { }> )._thenUnwrap((obj) => obj.result); } - - /** - * Replaces the configuration of an existing Page Rule. The configuration of the - * updated Page Rule will exactly match the data passed in the API request. - */ - replace( - zoneId: string, - pageruleId: string, - body: PageruleReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put(`/zones/${zoneId}/pagerules/${pageruleId}`, { body, ...options }) as Core.APIPromise<{ - result: PageruleReplaceResponse; - }> - )._thenUnwrap((obj) => obj.result); - } } export type PageruleCreateResponse = unknown | string; +export type PageruleUpdateResponse = unknown | string; + export type PageruleListResponse = Array; export namespace PageruleListResponse { @@ -217,8 +219,6 @@ export interface PageruleDeleteResponse { export type PageruleGetResponse = unknown | string; -export type PageruleReplaceResponse = unknown | string; - export interface PageruleCreateParams { /** * The set of actions to perform if the targets of this rule match the request. @@ -305,40 +305,17 @@ export namespace PageruleCreateParams { } } -export interface PageruleListParams { - /** - * The direction used to sort returned Page Rules. - */ - direction?: 'asc' | 'desc'; - - /** - * When set to `all`, all the search requirements must match. When set to `any`, - * only one of the search requirements has to match. - */ - match?: 'any' | 'all'; - - /** - * The field used to sort returned Page Rules. - */ - order?: 'status' | 'priority'; - - /** - * The status of the Page Rule. - */ - status?: 'active' | 'disabled'; -} - -export interface PageruleReplaceParams { +export interface PageruleUpdateParams { /** * 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. */ - actions: Array; + actions: Array; /** * The rule targets to evaluate on each request. */ - targets: Array; + targets: Array; /** * The priority of the rule, used to define which Page Rule is processed over @@ -355,7 +332,7 @@ export interface PageruleReplaceParams { status?: 'active' | 'disabled'; } -export namespace PageruleReplaceParams { +export namespace PageruleUpdateParams { export interface Action { /** * The type of route. @@ -414,15 +391,38 @@ export namespace PageruleReplaceParams { } } +export interface PageruleListParams { + /** + * The direction used to sort returned Page Rules. + */ + direction?: 'asc' | 'desc'; + + /** + * When set to `all`, all the search requirements must match. When set to `any`, + * only one of the search requirements has to match. + */ + match?: 'any' | 'all'; + + /** + * The field used to sort returned Page Rules. + */ + order?: 'status' | 'priority'; + + /** + * The status of the Page Rule. + */ + status?: 'active' | 'disabled'; +} + export namespace Pagerules { export import PageruleCreateResponse = PagerulesAPI.PageruleCreateResponse; + export import PageruleUpdateResponse = PagerulesAPI.PageruleUpdateResponse; export import PageruleListResponse = PagerulesAPI.PageruleListResponse; export import PageruleDeleteResponse = PagerulesAPI.PageruleDeleteResponse; export import PageruleGetResponse = PagerulesAPI.PageruleGetResponse; - export import PageruleReplaceResponse = PagerulesAPI.PageruleReplaceResponse; export import PageruleCreateParams = PagerulesAPI.PageruleCreateParams; + export import PageruleUpdateParams = PagerulesAPI.PageruleUpdateParams; export import PageruleListParams = PagerulesAPI.PageruleListParams; - export import PageruleReplaceParams = PagerulesAPI.PageruleReplaceParams; export import Settings = SettingsAPI.Settings; export import SettingListResponse = SettingsAPI.SettingListResponse; } diff --git a/src/resources/pages/index.ts b/src/resources/pages/index.ts index 2fee6b6750..61bae32745 100644 --- a/src/resources/pages/index.ts +++ b/src/resources/pages/index.ts @@ -3,12 +3,12 @@ export { Pages } from './pages'; export { ProjectCreateResponse, - ProjectUpdateResponse, ProjectListResponse, ProjectDeleteResponse, + ProjectEditResponse, ProjectGetResponse, ProjectPurgeBuildCacheResponse, ProjectCreateParams, - ProjectUpdateParams, + ProjectEditParams, Projects, } from './projects/index'; diff --git a/src/resources/pages/pages.ts b/src/resources/pages/pages.ts index b48ea8ee3a..61e76909bd 100644 --- a/src/resources/pages/pages.ts +++ b/src/resources/pages/pages.ts @@ -10,11 +10,11 @@ export class Pages extends APIResource { export namespace Pages { export import Projects = ProjectsAPI.Projects; export import ProjectCreateResponse = ProjectsAPI.ProjectCreateResponse; - export import ProjectUpdateResponse = ProjectsAPI.ProjectUpdateResponse; export import ProjectListResponse = ProjectsAPI.ProjectListResponse; export import ProjectDeleteResponse = ProjectsAPI.ProjectDeleteResponse; + export import ProjectEditResponse = ProjectsAPI.ProjectEditResponse; export import ProjectGetResponse = ProjectsAPI.ProjectGetResponse; export import ProjectPurgeBuildCacheResponse = ProjectsAPI.ProjectPurgeBuildCacheResponse; export import ProjectCreateParams = ProjectsAPI.ProjectCreateParams; - export import ProjectUpdateParams = ProjectsAPI.ProjectUpdateParams; + export import ProjectEditParams = ProjectsAPI.ProjectEditParams; } diff --git a/src/resources/pages/projects/domains.ts b/src/resources/pages/projects/domains.ts index 8f5918fc71..09894ea30c 100644 --- a/src/resources/pages/projects/domains.ts +++ b/src/resources/pages/projects/domains.ts @@ -22,23 +22,6 @@ export class Domains extends APIResource { )._thenUnwrap((obj) => obj.result); } - /** - * Retry the validation status of a single domain. - */ - update( - accountId: string, - projectName: string, - domainName: string, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.patch( - `/accounts/${accountId}/pages/projects/${projectName}/domains/${domainName}`, - options, - ) as Core.APIPromise<{ result: DomainUpdateResponse | null }> - )._thenUnwrap((obj) => obj.result); - } - /** * Fetch a list of all domains associated with a Pages project. */ @@ -70,6 +53,23 @@ export class Domains extends APIResource { ); } + /** + * Retry the validation status of a single domain. + */ + edit( + accountId: string, + projectName: string, + domainName: string, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.patch( + `/accounts/${accountId}/pages/projects/${projectName}/domains/${domainName}`, + options, + ) as Core.APIPromise<{ result: DomainEditResponse | null }> + )._thenUnwrap((obj) => obj.result); + } + /** * Fetch a single domain. */ @@ -90,21 +90,21 @@ export class Domains extends APIResource { export type DomainCreateResponse = unknown | Array | string; -export type DomainUpdateResponse = unknown | Array | string; - export type DomainListResponse = Array; export type DomainDeleteResponse = unknown; +export type DomainEditResponse = unknown | Array | string; + export type DomainGetResponse = unknown | Array | string; export type DomainCreateParams = unknown; export namespace Domains { export import DomainCreateResponse = DomainsAPI.DomainCreateResponse; - export import DomainUpdateResponse = DomainsAPI.DomainUpdateResponse; export import DomainListResponse = DomainsAPI.DomainListResponse; export import DomainDeleteResponse = DomainsAPI.DomainDeleteResponse; + export import DomainEditResponse = DomainsAPI.DomainEditResponse; export import DomainGetResponse = DomainsAPI.DomainGetResponse; export import DomainCreateParams = DomainsAPI.DomainCreateParams; } diff --git a/src/resources/pages/projects/index.ts b/src/resources/pages/projects/index.ts index 6d1a039fb0..d76cc00adc 100644 --- a/src/resources/pages/projects/index.ts +++ b/src/resources/pages/projects/index.ts @@ -12,21 +12,21 @@ export { } from './deployments/index'; export { DomainCreateResponse, - DomainUpdateResponse, DomainListResponse, DomainDeleteResponse, + DomainEditResponse, DomainGetResponse, DomainCreateParams, Domains, } from './domains'; export { ProjectCreateResponse, - ProjectUpdateResponse, ProjectListResponse, ProjectDeleteResponse, + ProjectEditResponse, ProjectGetResponse, ProjectPurgeBuildCacheResponse, ProjectCreateParams, - ProjectUpdateParams, + ProjectEditParams, Projects, } from './projects'; diff --git a/src/resources/pages/projects/projects.ts b/src/resources/pages/projects/projects.ts index ba40fdd5a1..ae9e444672 100644 --- a/src/resources/pages/projects/projects.ts +++ b/src/resources/pages/projects/projects.ts @@ -25,24 +25,6 @@ export class Projects extends APIResource { )._thenUnwrap((obj) => obj.result); } - /** - * Set new attributes for an existing project. Modify environment variables. To - * delete an environment variable, set the key to null. - */ - update( - accountId: string, - projectName: string, - body: ProjectUpdateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.patch(`/accounts/${accountId}/pages/projects/${projectName}`, { - body, - ...options, - }) as Core.APIPromise<{ result: ProjectUpdateResponse }> - )._thenUnwrap((obj) => obj.result); - } - /** * Fetch a list of all user projects. */ @@ -61,6 +43,24 @@ export class Projects extends APIResource { return this._client.delete(`/accounts/${accountId}/pages/projects/${projectName}`, options); } + /** + * Set new attributes for an existing project. Modify environment variables. To + * delete an environment variable, set the key to null. + */ + edit( + accountId: string, + projectName: string, + body: ProjectEditParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.patch(`/accounts/${accountId}/pages/projects/${projectName}`, { + body, + ...options, + }) as Core.APIPromise<{ result: ProjectEditResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * Fetch a project by name. */ @@ -93,8 +93,6 @@ export class Projects extends APIResource { export type ProjectCreateResponse = unknown | Array | string; -export type ProjectUpdateResponse = unknown | Array | string; - export type ProjectListResponse = Array; export namespace ProjectListResponse { @@ -238,6 +236,8 @@ export namespace ProjectListResponse { export type ProjectDeleteResponse = unknown; +export type ProjectEditResponse = unknown | Array | string; + export interface ProjectGetResponse { /** * Id of the project. @@ -1828,17 +1828,17 @@ export namespace ProjectCreateParams { export interface LatestDeployment {} } -export type ProjectUpdateParams = unknown; +export type ProjectEditParams = unknown; export namespace Projects { export import ProjectCreateResponse = ProjectsAPI.ProjectCreateResponse; - export import ProjectUpdateResponse = ProjectsAPI.ProjectUpdateResponse; export import ProjectListResponse = ProjectsAPI.ProjectListResponse; export import ProjectDeleteResponse = ProjectsAPI.ProjectDeleteResponse; + export import ProjectEditResponse = ProjectsAPI.ProjectEditResponse; export import ProjectGetResponse = ProjectsAPI.ProjectGetResponse; export import ProjectPurgeBuildCacheResponse = ProjectsAPI.ProjectPurgeBuildCacheResponse; export import ProjectCreateParams = ProjectsAPI.ProjectCreateParams; - export import ProjectUpdateParams = ProjectsAPI.ProjectUpdateParams; + export import ProjectEditParams = ProjectsAPI.ProjectEditParams; export import Deployments = DeploymentsAPI.Deployments; export import DeploymentCreateResponse = DeploymentsAPI.DeploymentCreateResponse; export import DeploymentListResponse = DeploymentsAPI.DeploymentListResponse; @@ -1849,9 +1849,9 @@ export namespace Projects { export import DeploymentCreateParams = DeploymentsAPI.DeploymentCreateParams; export import Domains = DomainsAPI.Domains; export import DomainCreateResponse = DomainsAPI.DomainCreateResponse; - export import DomainUpdateResponse = DomainsAPI.DomainUpdateResponse; export import DomainListResponse = DomainsAPI.DomainListResponse; export import DomainDeleteResponse = DomainsAPI.DomainDeleteResponse; + export import DomainEditResponse = DomainsAPI.DomainEditResponse; export import DomainGetResponse = DomainsAPI.DomainGetResponse; export import DomainCreateParams = DomainsAPI.DomainCreateParams; } diff --git a/src/resources/rate-limits.ts b/src/resources/rate-limits.ts index 7ebb697271..b4c1162e7f 100644 --- a/src/resources/rate-limits.ts +++ b/src/resources/rate-limits.ts @@ -23,23 +23,6 @@ export class RateLimits extends APIResource { )._thenUnwrap((obj) => obj.result); } - /** - * Updates an existing rate limit. - */ - update( - zoneIdentifier: string, - id: string, - body: RateLimitUpdateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put(`/zones/${zoneIdentifier}/rate_limits/${id}`, { - body, - ...options, - }) as Core.APIPromise<{ result: RateLimitUpdateResponse | null }> - )._thenUnwrap((obj) => obj.result); - } - /** * Fetches the rate limits for a zone. */ @@ -82,6 +65,23 @@ export class RateLimits extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Updates an existing rate limit. + */ + edit( + zoneIdentifier: string, + id: string, + body: RateLimitEditParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/zones/${zoneIdentifier}/rate_limits/${id}`, { + body, + ...options, + }) as Core.APIPromise<{ result: RateLimitEditResponse | null }> + )._thenUnwrap((obj) => obj.result); + } + /** * Fetches the details of a rate limit. */ @@ -102,8 +102,6 @@ export class RateLimitListResponsesV4PagePaginationArray extends V4PagePaginatio export type RateLimitCreateResponse = unknown | string; -export type RateLimitUpdateResponse = unknown | string; - export interface RateLimitListResponse { /** * The unique identifier of the rate limit. @@ -288,22 +286,24 @@ export interface RateLimitDeleteResponse { id?: string; } +export type RateLimitEditResponse = unknown | string; + export type RateLimitGetResponse = unknown | string; export type RateLimitCreateParams = unknown; -export type RateLimitUpdateParams = unknown; - export interface RateLimitListParams extends V4PagePaginationArrayParams {} +export type RateLimitEditParams = unknown; + export namespace RateLimits { export import RateLimitCreateResponse = RateLimitsAPI.RateLimitCreateResponse; - export import RateLimitUpdateResponse = RateLimitsAPI.RateLimitUpdateResponse; export import RateLimitListResponse = RateLimitsAPI.RateLimitListResponse; export import RateLimitDeleteResponse = RateLimitsAPI.RateLimitDeleteResponse; + export import RateLimitEditResponse = RateLimitsAPI.RateLimitEditResponse; export import RateLimitGetResponse = RateLimitsAPI.RateLimitGetResponse; export import RateLimitListResponsesV4PagePaginationArray = RateLimitsAPI.RateLimitListResponsesV4PagePaginationArray; export import RateLimitCreateParams = RateLimitsAPI.RateLimitCreateParams; - export import RateLimitUpdateParams = RateLimitsAPI.RateLimitUpdateParams; export import RateLimitListParams = RateLimitsAPI.RateLimitListParams; + export import RateLimitEditParams = RateLimitsAPI.RateLimitEditParams; } diff --git a/src/resources/registrar/domains.ts b/src/resources/registrar/domains.ts index 904cba5bca..90954a93fe 100644 --- a/src/resources/registrar/domains.ts +++ b/src/resources/registrar/domains.ts @@ -5,6 +5,23 @@ import { APIResource } from 'cloudflare/resource'; import * as DomainsAPI from 'cloudflare/resources/registrar/domains'; export class Domains extends APIResource { + /** + * Update individual domain. + */ + update( + accountId: string, + domainName: string, + body: DomainUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/accounts/${accountId}/registrar/domains/${domainName}`, { + body, + ...options, + }) as Core.APIPromise<{ result: DomainUpdateResponse | null }> + )._thenUnwrap((obj) => obj.result); + } + /** * List domains handled by Registrar. */ @@ -30,25 +47,10 @@ export class Domains extends APIResource { }> )._thenUnwrap((obj) => obj.result); } - - /** - * Update individual domain. - */ - replace( - accountId: string, - domainName: string, - body: DomainReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put(`/accounts/${accountId}/registrar/domains/${domainName}`, { - body, - ...options, - }) as Core.APIPromise<{ result: DomainReplaceResponse | null }> - )._thenUnwrap((obj) => obj.result); - } } +export type DomainUpdateResponse = unknown | Array | string; + export type DomainListResponse = Array; export namespace DomainListResponse { @@ -228,9 +230,7 @@ export namespace DomainListResponse { export type DomainGetResponse = unknown | Array | string; -export type DomainReplaceResponse = unknown | Array | string; - -export interface DomainReplaceParams { +export interface DomainUpdateParams { /** * Auto-renew controls whether subscription is automatically renewed upon domain * expiration. @@ -249,8 +249,8 @@ export interface DomainReplaceParams { } export namespace Domains { + export import DomainUpdateResponse = DomainsAPI.DomainUpdateResponse; export import DomainListResponse = DomainsAPI.DomainListResponse; export import DomainGetResponse = DomainsAPI.DomainGetResponse; - export import DomainReplaceResponse = DomainsAPI.DomainReplaceResponse; - export import DomainReplaceParams = DomainsAPI.DomainReplaceParams; + export import DomainUpdateParams = DomainsAPI.DomainUpdateParams; } diff --git a/src/resources/registrar/index.ts b/src/resources/registrar/index.ts index 59e45def3b..6969bc92e7 100644 --- a/src/resources/registrar/index.ts +++ b/src/resources/registrar/index.ts @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. export { + DomainUpdateResponse, DomainListResponse, DomainGetResponse, - DomainReplaceResponse, - DomainReplaceParams, + DomainUpdateParams, Domains, } from './domains'; export { Registrar } from './registrar'; diff --git a/src/resources/registrar/registrar.ts b/src/resources/registrar/registrar.ts index ae6a737a04..79dd3762ab 100644 --- a/src/resources/registrar/registrar.ts +++ b/src/resources/registrar/registrar.ts @@ -9,8 +9,8 @@ export class Registrar extends APIResource { export namespace Registrar { export import Domains = DomainsAPI.Domains; + export import DomainUpdateResponse = DomainsAPI.DomainUpdateResponse; export import DomainListResponse = DomainsAPI.DomainListResponse; export import DomainGetResponse = DomainsAPI.DomainGetResponse; - export import DomainReplaceResponse = DomainsAPI.DomainReplaceResponse; - export import DomainReplaceParams = DomainsAPI.DomainReplaceParams; + export import DomainUpdateParams = DomainsAPI.DomainUpdateParams; } diff --git a/src/resources/request-tracers/index.ts b/src/resources/request-tracers/index.ts index abc216df83..98dab25c2e 100644 --- a/src/resources/request-tracers/index.ts +++ b/src/resources/request-tracers/index.ts @@ -1,4 +1,4 @@ // File generated from our OpenAPI spec by Stainless. +export { Bz6um997Trace, TraceCreateResponse, TraceCreateParams, Traces } from './traces'; export { RequestTracers } from './request-tracers'; -export { TraceCreateResponse, TraceCreateParams, Traces } from './traces'; diff --git a/src/resources/request-tracers/request-tracers.ts b/src/resources/request-tracers/request-tracers.ts index 2c2204a2c1..70a41f97a8 100644 --- a/src/resources/request-tracers/request-tracers.ts +++ b/src/resources/request-tracers/request-tracers.ts @@ -9,6 +9,7 @@ export class RequestTracers extends APIResource { export namespace RequestTracers { export import Traces = TracesAPI.Traces; + export import Bz6um997Trace = TracesAPI.Bz6um997Trace; export import TraceCreateResponse = TracesAPI.TraceCreateResponse; export import TraceCreateParams = TracesAPI.TraceCreateParams; } diff --git a/src/resources/request-tracers/traces.ts b/src/resources/request-tracers/traces.ts index 06e250fd31..3a7e41c480 100644 --- a/src/resources/request-tracers/traces.ts +++ b/src/resources/request-tracers/traces.ts @@ -22,23 +22,13 @@ export class Traces extends APIResource { } } -/** - * Trace result with an origin status code - */ -export interface TraceCreateResponse { - /** - * HTTP Status code of zone response - */ - status_code?: number; - - trace?: Array; -} +export type Bz6um997Trace = Array; -export namespace TraceCreateResponse { +export namespace Bz6um997Trace { /** * List of steps acting on request/response */ - export interface Trace { + export interface Bz6um997TraceItem { /** * If step type is rule, then action performed by this rule */ @@ -79,67 +69,25 @@ export namespace TraceCreateResponse { */ step_name?: string; - trace?: Array; + trace?: TracesAPI.Bz6um997Trace; /** * Tracing step type */ type?: string; } +} - export namespace Trace { - /** - * List of steps acting on request/response - */ - export interface Trace { - /** - * If step type is rule, then action performed by this rule - */ - action?: string; - - /** - * If step type is rule, then action parameters of this rule as JSON - */ - action_parameters?: unknown; - - /** - * If step type is rule or ruleset, the description of this entity - */ - description?: string; - - /** - * If step type is rule, then expression used to match for this rule - */ - expression?: string; - - /** - * If step type is ruleset, then kind of this ruleset - */ - kind?: string; - - /** - * Whether tracing step affected tracing request/response - */ - matched?: boolean; - - /** - * If step type is ruleset, then name of this ruleset - */ - name?: string; - - /** - * Tracing step identifying name - */ - step_name?: string; - - trace?: unknown; - - /** - * Tracing step type - */ - type?: string; - } - } +/** + * Trace result with an origin status code + */ +export interface TraceCreateResponse { + /** + * HTTP Status code of zone response + */ + status_code?: number; + + trace?: Bz6um997Trace; } export interface TraceCreateParams { @@ -253,6 +201,7 @@ export namespace TraceCreateParams { } export namespace Traces { + export import Bz6um997Trace = TracesAPI.Bz6um997Trace; export import TraceCreateResponse = TracesAPI.TraceCreateResponse; export import TraceCreateParams = TracesAPI.TraceCreateParams; } diff --git a/src/resources/rules/index.ts b/src/resources/rules/index.ts index 98bbe41fa6..b9fd9b5a52 100644 --- a/src/resources/rules/index.ts +++ b/src/resources/rules/index.ts @@ -2,12 +2,12 @@ export { ListCreateResponse, + ListUpdateResponse, ListListResponse, ListDeleteResponse, ListGetResponse, - ListReplaceResponse, ListCreateParams, - ListReplaceParams, + ListUpdateParams, Lists, } from './lists/index'; export { Rules } from './rules'; diff --git a/src/resources/rules/lists/index.ts b/src/resources/rules/lists/index.ts index d780d95a18..dc28c4cc11 100644 --- a/src/resources/rules/lists/index.ts +++ b/src/resources/rules/lists/index.ts @@ -3,23 +3,23 @@ export { BulkOperationGetResponse, BulkOperations } from './bulk-operations'; export { ItemCreateResponse, + ItemUpdateResponse, ItemListResponse, ItemDeleteResponse, ItemGetResponse, - ItemReplaceResponse, ItemCreateParams, + ItemUpdateParams, ItemListParams, ItemDeleteParams, - ItemReplaceParams, Items, } from './items'; export { ListCreateResponse, + ListUpdateResponse, ListListResponse, ListDeleteResponse, ListGetResponse, - ListReplaceResponse, ListCreateParams, - ListReplaceParams, + ListUpdateParams, Lists, } from './lists'; diff --git a/src/resources/rules/lists/items.ts b/src/resources/rules/lists/items.ts index 3c9a3fe9c1..fb04997b64 100644 --- a/src/resources/rules/lists/items.ts +++ b/src/resources/rules/lists/items.ts @@ -27,6 +27,28 @@ export class Items extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Removes all existing items from the list and adds the provided items to the + * list. + * + * This operation is asynchronous. To get current the operation status, invoke the + * [Get bulk operation status](/operations/lists-get-bulk-operation-status) + * endpoint with the returned `operation_id`. + */ + update( + accountId: string, + listId: string, + body: ItemUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/accounts/${accountId}/rules/lists/${listId}/items`, { + body, + ...options, + }) as Core.APIPromise<{ result: ItemUpdateResponse | null }> + )._thenUnwrap((obj) => obj.result); + } + /** * Fetches all the items in the list. */ @@ -95,31 +117,16 @@ export class Items extends APIResource { ) as Core.APIPromise<{ result: ItemGetResponse | null }> )._thenUnwrap((obj) => obj.result); } +} +export interface ItemCreateResponse { /** - * Removes all existing items from the list and adds the provided items to the - * list. - * - * This operation is asynchronous. To get current the operation status, invoke the - * [Get bulk operation status](/operations/lists-get-bulk-operation-status) - * endpoint with the returned `operation_id`. + * The unique operation ID of the asynchronous action. */ - replace( - accountId: string, - listId: string, - body: ItemReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put(`/accounts/${accountId}/rules/lists/${listId}/items`, { - body, - ...options, - }) as Core.APIPromise<{ result: ItemReplaceResponse | null }> - )._thenUnwrap((obj) => obj.result); - } + operation_id?: string; } -export interface ItemCreateResponse { +export interface ItemUpdateResponse { /** * The unique operation ID of the asynchronous action. */ @@ -174,13 +181,6 @@ export namespace ItemGetResponse { } } -export interface ItemReplaceResponse { - /** - * The unique operation ID of the asynchronous action. - */ - operation_id?: string; -} - export type ItemCreateParams = Array; export namespace ItemCreateParams { @@ -243,45 +243,9 @@ export namespace ItemCreateParams { } } -export interface ItemListParams { - /** - * The pagination cursor. An opaque string token indicating the position from which - * to continue when requesting the next/previous set of records. Cursor values are - * provided under `result_info.cursors` in the response. You should make no - * assumptions about a cursor's content or length. - */ - cursor?: string; - - /** - * Amount of results to include in each paginated response. A non-negative 32 bit - * integer. - */ - per_page?: number; - - /** - * A search query to filter returned items. Its meaning depends on the list type: - * IP addresses must start with the provided string, hostnames and bulk redirects - * must contain the string, and ASNs must match the string exactly. - */ - search?: string; -} - -export interface ItemDeleteParams { - items?: Array; -} - -export namespace ItemDeleteParams { - export interface Item { - /** - * The unique ID of the item in the List. - */ - id?: string; - } -} - -export type ItemReplaceParams = Array; +export type ItemUpdateParams = Array; -export namespace ItemReplaceParams { +export namespace ItemUpdateParams { export interface Body { /** * A non-negative 32 bit integer @@ -341,14 +305,50 @@ export namespace ItemReplaceParams { } } +export interface ItemListParams { + /** + * The pagination cursor. An opaque string token indicating the position from which + * to continue when requesting the next/previous set of records. Cursor values are + * provided under `result_info.cursors` in the response. You should make no + * assumptions about a cursor's content or length. + */ + cursor?: string; + + /** + * Amount of results to include in each paginated response. A non-negative 32 bit + * integer. + */ + per_page?: number; + + /** + * A search query to filter returned items. Its meaning depends on the list type: + * IP addresses must start with the provided string, hostnames and bulk redirects + * must contain the string, and ASNs must match the string exactly. + */ + search?: string; +} + +export interface ItemDeleteParams { + items?: Array; +} + +export namespace ItemDeleteParams { + export interface Item { + /** + * The unique ID of the item in the List. + */ + id?: string; + } +} + export namespace Items { export import ItemCreateResponse = ItemsAPI.ItemCreateResponse; + export import ItemUpdateResponse = ItemsAPI.ItemUpdateResponse; export import ItemListResponse = ItemsAPI.ItemListResponse; export import ItemDeleteResponse = ItemsAPI.ItemDeleteResponse; export import ItemGetResponse = ItemsAPI.ItemGetResponse; - export import ItemReplaceResponse = ItemsAPI.ItemReplaceResponse; export import ItemCreateParams = ItemsAPI.ItemCreateParams; + export import ItemUpdateParams = ItemsAPI.ItemUpdateParams; export import ItemListParams = ItemsAPI.ItemListParams; export import ItemDeleteParams = ItemsAPI.ItemDeleteParams; - export import ItemReplaceParams = ItemsAPI.ItemReplaceParams; } diff --git a/src/resources/rules/lists/lists.ts b/src/resources/rules/lists/lists.ts index 9a95104c1e..8391150a79 100644 --- a/src/resources/rules/lists/lists.ts +++ b/src/resources/rules/lists/lists.ts @@ -25,6 +25,23 @@ export class Lists extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Updates the description of a list. + */ + update( + accountId: string, + listId: string, + body: ListUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/accounts/${accountId}/rules/lists/${listId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: ListUpdateResponse | null }> + )._thenUnwrap((obj) => obj.result); + } + /** * Fetches all lists in the account. */ @@ -65,27 +82,12 @@ export class Lists extends APIResource { }> )._thenUnwrap((obj) => obj.result); } - - /** - * Updates the description of a list. - */ - replace( - accountId: string, - listId: string, - body: ListReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put(`/accounts/${accountId}/rules/lists/${listId}`, { - body, - ...options, - }) as Core.APIPromise<{ result: ListReplaceResponse | null }> - )._thenUnwrap((obj) => obj.result); - } } export type ListCreateResponse = Array; +export type ListUpdateResponse = Array; + export type ListListResponse = Array; export namespace ListListResponse { @@ -142,8 +144,6 @@ export interface ListDeleteResponse { export type ListGetResponse = Array; -export type ListReplaceResponse = Array; - export interface ListCreateParams { /** * The type of the list. Each type supports specific list items (IP addresses, @@ -162,7 +162,7 @@ export interface ListCreateParams { description?: string; } -export interface ListReplaceParams { +export interface ListUpdateParams { /** * An informative summary of the list. */ @@ -171,22 +171,22 @@ export interface ListReplaceParams { export namespace Lists { export import ListCreateResponse = ListsAPI.ListCreateResponse; + export import ListUpdateResponse = ListsAPI.ListUpdateResponse; export import ListListResponse = ListsAPI.ListListResponse; export import ListDeleteResponse = ListsAPI.ListDeleteResponse; export import ListGetResponse = ListsAPI.ListGetResponse; - export import ListReplaceResponse = ListsAPI.ListReplaceResponse; export import ListCreateParams = ListsAPI.ListCreateParams; - export import ListReplaceParams = ListsAPI.ListReplaceParams; + export import ListUpdateParams = ListsAPI.ListUpdateParams; export import BulkOperations = BulkOperationsAPI.BulkOperations; export import BulkOperationGetResponse = BulkOperationsAPI.BulkOperationGetResponse; export import Items = ItemsAPI.Items; export import ItemCreateResponse = ItemsAPI.ItemCreateResponse; + export import ItemUpdateResponse = ItemsAPI.ItemUpdateResponse; export import ItemListResponse = ItemsAPI.ItemListResponse; export import ItemDeleteResponse = ItemsAPI.ItemDeleteResponse; export import ItemGetResponse = ItemsAPI.ItemGetResponse; - export import ItemReplaceResponse = ItemsAPI.ItemReplaceResponse; export import ItemCreateParams = ItemsAPI.ItemCreateParams; + export import ItemUpdateParams = ItemsAPI.ItemUpdateParams; export import ItemListParams = ItemsAPI.ItemListParams; export import ItemDeleteParams = ItemsAPI.ItemDeleteParams; - export import ItemReplaceParams = ItemsAPI.ItemReplaceParams; } diff --git a/src/resources/rules/rules.ts b/src/resources/rules/rules.ts index 1dbfcd60c8..fad470ffe4 100644 --- a/src/resources/rules/rules.ts +++ b/src/resources/rules/rules.ts @@ -10,10 +10,10 @@ export class Rules extends APIResource { export namespace Rules { export import Lists = ListsAPI.Lists; export import ListCreateResponse = ListsAPI.ListCreateResponse; + export import ListUpdateResponse = ListsAPI.ListUpdateResponse; export import ListListResponse = ListsAPI.ListListResponse; export import ListDeleteResponse = ListsAPI.ListDeleteResponse; export import ListGetResponse = ListsAPI.ListGetResponse; - export import ListReplaceResponse = ListsAPI.ListReplaceResponse; export import ListCreateParams = ListsAPI.ListCreateParams; - export import ListReplaceParams = ListsAPI.ListReplaceParams; + export import ListUpdateParams = ListsAPI.ListUpdateParams; } diff --git a/src/resources/rulesets/index.ts b/src/resources/rulesets/index.ts index 755ce9a315..cab525c3b1 100644 --- a/src/resources/rulesets/index.ts +++ b/src/resources/rulesets/index.ts @@ -3,19 +3,19 @@ export { PhaseGetResponse, Phases } from './phases'; export { RuleCreateResponse, - RuleUpdateResponse, RuleDeleteResponse, + RuleEditResponse, RuleCreateParams, - RuleUpdateParams, + RuleEditParams, Rules, } from './rules'; export { RulesetCreateResponse, + RulesetUpdateResponse, RulesetListResponse, RulesetGetResponse, - RulesetReplaceResponse, RulesetCreateParams, - RulesetReplaceParams, + RulesetUpdateParams, Rulesets, } from './rulesets'; export { VersionListResponse, VersionGetResponse, Versions } from './versions/index'; diff --git a/src/resources/rulesets/rules.ts b/src/resources/rulesets/rules.ts index 464f01f2b9..1812b410be 100644 --- a/src/resources/rulesets/rules.ts +++ b/src/resources/rulesets/rules.ts @@ -24,24 +24,6 @@ export class Rules extends APIResource { )._thenUnwrap((obj) => obj.result); } - /** - * Updates an existing rule in an account ruleset. - */ - update( - rulesetId: string, - ruleId: string, - params: RuleUpdateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id, ...body } = params; - return ( - this._client.patch(`/${account_id}/${rulesetId}/rulesets/${ruleId}/rules/:rule_id`, { - body, - ...options, - }) as Core.APIPromise<{ result: RuleUpdateResponse }> - )._thenUnwrap((obj) => obj.result); - } - /** * Deletes an existing rule from an account or zone ruleset. */ @@ -59,6 +41,24 @@ export class Rules extends APIResource { ) as Core.APIPromise<{ result: RuleDeleteResponse }> )._thenUnwrap((obj) => obj.result); } + + /** + * Updates an existing rule in an account ruleset. + */ + edit( + rulesetId: string, + ruleId: string, + params: RuleEditParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.patch(`/${account_id}/${rulesetId}/rulesets/${ruleId}/rules/:rule_id`, { + body, + ...options, + }) as Core.APIPromise<{ result: RuleEditResponse }> + )._thenUnwrap((obj) => obj.result); + } } /** @@ -628,7 +628,7 @@ export namespace RuleCreateResponse { /** * A result. */ -export interface RuleUpdateResponse { +export interface RuleDeleteResponse { /** * The unique ID of the ruleset. */ @@ -681,10 +681,10 @@ export interface RuleUpdateResponse { * The list of rules in the ruleset. */ rules: Array< - | RuleUpdateResponse.RulesetsBlockRule - | RuleUpdateResponse.RulesetsExecuteRule - | RuleUpdateResponse.RulesetsLogRule - | RuleUpdateResponse.RulesetsSkipRule + | RuleDeleteResponse.RulesetsBlockRule + | RuleDeleteResponse.RulesetsExecuteRule + | RuleDeleteResponse.RulesetsLogRule + | RuleDeleteResponse.RulesetsSkipRule >; /** @@ -698,7 +698,7 @@ export interface RuleUpdateResponse { description?: string; } -export namespace RuleUpdateResponse { +export namespace RuleDeleteResponse { export interface RulesetsBlockRule { /** * The timestamp of when the rule was last modified. @@ -1192,7 +1192,7 @@ export namespace RuleUpdateResponse { /** * A result. */ -export interface RuleDeleteResponse { +export interface RuleEditResponse { /** * The unique ID of the ruleset. */ @@ -1245,10 +1245,10 @@ export interface RuleDeleteResponse { * The list of rules in the ruleset. */ rules: Array< - | RuleDeleteResponse.RulesetsBlockRule - | RuleDeleteResponse.RulesetsExecuteRule - | RuleDeleteResponse.RulesetsLogRule - | RuleDeleteResponse.RulesetsSkipRule + | RuleEditResponse.RulesetsBlockRule + | RuleEditResponse.RulesetsExecuteRule + | RuleEditResponse.RulesetsLogRule + | RuleEditResponse.RulesetsSkipRule >; /** @@ -1262,7 +1262,7 @@ export interface RuleDeleteResponse { description?: string; } -export namespace RuleDeleteResponse { +export namespace RuleEditResponse { export interface RulesetsBlockRule { /** * The timestamp of when the rule was last modified. @@ -2190,13 +2190,13 @@ export namespace RuleCreateParams { } } -export type RuleUpdateParams = - | RuleUpdateParams.RulesetsBlockRule - | RuleUpdateParams.RulesetsExecuteRule - | RuleUpdateParams.RulesetsLogRule - | RuleUpdateParams.RulesetsSkipRule; +export type RuleEditParams = + | RuleEditParams.RulesetsBlockRule + | RuleEditParams.RulesetsExecuteRule + | RuleEditParams.RulesetsLogRule + | RuleEditParams.RulesetsSkipRule; -export namespace RuleUpdateParams { +export namespace RuleEditParams { export interface RulesetsBlockRule { /** * Path param: The unique ID of the account. @@ -2216,7 +2216,7 @@ export namespace RuleUpdateParams { /** * Body param: The parameters configuring the rule's action. */ - action_parameters?: RuleUpdateParams.RulesetsBlockRule.ActionParameters; + action_parameters?: RuleEditParams.RulesetsBlockRule.ActionParameters; /** * Body param: An informative description of the rule. @@ -2236,7 +2236,7 @@ export namespace RuleUpdateParams { /** * Body param: An object configuring the rule's logging behavior. */ - logging?: RuleUpdateParams.RulesetsBlockRule.Logging; + logging?: RuleEditParams.RulesetsBlockRule.Logging; /** * Body param: The reference of the rule (the rule ID by default). @@ -2307,7 +2307,7 @@ export namespace RuleUpdateParams { /** * Body param: The parameters configuring the rule's action. */ - action_parameters?: RuleUpdateParams.RulesetsExecuteRule.ActionParameters; + action_parameters?: RuleEditParams.RulesetsExecuteRule.ActionParameters; /** * Body param: An informative description of the rule. @@ -2327,7 +2327,7 @@ export namespace RuleUpdateParams { /** * Body param: An object configuring the rule's logging behavior. */ - logging?: RuleUpdateParams.RulesetsExecuteRule.Logging; + logging?: RuleEditParams.RulesetsExecuteRule.Logging; /** * Body param: The reference of the rule (the rule ID by default). @@ -2509,7 +2509,7 @@ export namespace RuleUpdateParams { /** * Body param: An object configuring the rule's logging behavior. */ - logging?: RuleUpdateParams.RulesetsLogRule.Logging; + logging?: RuleEditParams.RulesetsLogRule.Logging; /** * Body param: The reference of the rule (the rule ID by default). @@ -2548,7 +2548,7 @@ export namespace RuleUpdateParams { /** * Body param: The parameters configuring the rule's action. */ - action_parameters?: RuleUpdateParams.RulesetsSkipRule.ActionParameters; + action_parameters?: RuleEditParams.RulesetsSkipRule.ActionParameters; /** * Body param: An informative description of the rule. @@ -2568,7 +2568,7 @@ export namespace RuleUpdateParams { /** * Body param: An object configuring the rule's logging behavior. */ - logging?: RuleUpdateParams.RulesetsSkipRule.Logging; + logging?: RuleEditParams.RulesetsSkipRule.Logging; /** * Body param: The reference of the rule (the rule ID by default). @@ -2649,8 +2649,8 @@ export namespace RuleUpdateParams { export namespace Rules { export import RuleCreateResponse = RulesAPI.RuleCreateResponse; - export import RuleUpdateResponse = RulesAPI.RuleUpdateResponse; export import RuleDeleteResponse = RulesAPI.RuleDeleteResponse; + export import RuleEditResponse = RulesAPI.RuleEditResponse; export import RuleCreateParams = RulesAPI.RuleCreateParams; - export import RuleUpdateParams = RulesAPI.RuleUpdateParams; + export import RuleEditParams = RulesAPI.RuleEditParams; } diff --git a/src/resources/rulesets/rulesets.ts b/src/resources/rulesets/rulesets.ts index 7061d0d7dd..88b98eddd7 100644 --- a/src/resources/rulesets/rulesets.ts +++ b/src/resources/rulesets/rulesets.ts @@ -29,6 +29,24 @@ export class Rulesets extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Updates an account or zone ruleset, creating a new version. + */ + update( + accountOrZone: string, + accountOrZoneId: string, + rulesetId: string, + body: RulesetUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/${accountOrZone}/${accountOrZoneId}/rulesets/${rulesetId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: RulesetUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * Fetches all rulesets. */ @@ -75,24 +93,6 @@ export class Rulesets extends APIResource { ) as Core.APIPromise<{ result: RulesetGetResponse }> )._thenUnwrap((obj) => obj.result); } - - /** - * Updates an account or zone ruleset, creating a new version. - */ - replace( - accountOrZone: string, - accountOrZoneId: string, - rulesetId: string, - body: RulesetReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put(`/${accountOrZone}/${accountOrZoneId}/rulesets/${rulesetId}`, { - body, - ...options, - }) as Core.APIPromise<{ result: RulesetReplaceResponse }> - )._thenUnwrap((obj) => obj.result); - } } /** @@ -662,77 +662,7 @@ export namespace RulesetCreateResponse { /** * A result. */ -export type RulesetListResponse = Array; - -export namespace RulesetListResponse { - /** - * A ruleset object. - */ - export interface RulesetListResponseItem { - /** - * The kind of the ruleset. - */ - kind: 'managed' | 'custom' | 'root' | 'zone'; - - /** - * The human-readable name of the ruleset. - */ - name: string; - - /** - * The phase of the ruleset. - */ - phase: - | 'ddos_l4' - | 'ddos_l7' - | 'http_config_settings' - | 'http_custom_errors' - | 'http_log_custom_fields' - | 'http_ratelimit' - | 'http_request_cache_settings' - | 'http_request_dynamic_redirect' - | 'http_request_firewall_custom' - | 'http_request_firewall_managed' - | 'http_request_late_transform' - | 'http_request_origin' - | 'http_request_redirect' - | 'http_request_sanitize' - | 'http_request_sbfm' - | 'http_request_select_configuration' - | 'http_request_transform' - | 'http_response_compression' - | 'http_response_firewall_managed' - | 'http_response_headers_transform' - | 'magic_transit' - | 'magic_transit_ids_managed' - | 'magic_transit_managed'; - - /** - * The unique ID of the ruleset. - */ - id?: string; - - /** - * An informative description of the ruleset. - */ - description?: string; - - /** - * The timestamp of when the ruleset was last modified. - */ - last_updated?: string; - - /** - * The version of the ruleset. - */ - version?: string; - } -} - -/** - * A result. - */ -export interface RulesetGetResponse { +export interface RulesetUpdateResponse { /** * The unique ID of the ruleset. */ @@ -785,10 +715,10 @@ export interface RulesetGetResponse { * The list of rules in the ruleset. */ rules: Array< - | RulesetGetResponse.RulesetsBlockRule - | RulesetGetResponse.RulesetsExecuteRule - | RulesetGetResponse.RulesetsLogRule - | RulesetGetResponse.RulesetsSkipRule + | RulesetUpdateResponse.RulesetsBlockRule + | RulesetUpdateResponse.RulesetsExecuteRule + | RulesetUpdateResponse.RulesetsLogRule + | RulesetUpdateResponse.RulesetsSkipRule >; /** @@ -802,7 +732,7 @@ export interface RulesetGetResponse { description?: string; } -export namespace RulesetGetResponse { +export namespace RulesetUpdateResponse { export interface RulesetsBlockRule { /** * The timestamp of when the rule was last modified. @@ -1296,7 +1226,77 @@ export namespace RulesetGetResponse { /** * A result. */ -export interface RulesetReplaceResponse { +export type RulesetListResponse = Array; + +export namespace RulesetListResponse { + /** + * A ruleset object. + */ + export interface RulesetListResponseItem { + /** + * The kind of the ruleset. + */ + kind: 'managed' | 'custom' | 'root' | 'zone'; + + /** + * The human-readable name of the ruleset. + */ + name: string; + + /** + * The phase of the ruleset. + */ + phase: + | 'ddos_l4' + | 'ddos_l7' + | 'http_config_settings' + | 'http_custom_errors' + | 'http_log_custom_fields' + | 'http_ratelimit' + | 'http_request_cache_settings' + | 'http_request_dynamic_redirect' + | 'http_request_firewall_custom' + | 'http_request_firewall_managed' + | 'http_request_late_transform' + | 'http_request_origin' + | 'http_request_redirect' + | 'http_request_sanitize' + | 'http_request_sbfm' + | 'http_request_select_configuration' + | 'http_request_transform' + | 'http_response_compression' + | 'http_response_firewall_managed' + | 'http_response_headers_transform' + | 'magic_transit' + | 'magic_transit_ids_managed' + | 'magic_transit_managed'; + + /** + * The unique ID of the ruleset. + */ + id?: string; + + /** + * An informative description of the ruleset. + */ + description?: string; + + /** + * The timestamp of when the ruleset was last modified. + */ + last_updated?: string; + + /** + * The version of the ruleset. + */ + version?: string; + } +} + +/** + * A result. + */ +export interface RulesetGetResponse { /** * The unique ID of the ruleset. */ @@ -1349,10 +1349,10 @@ export interface RulesetReplaceResponse { * The list of rules in the ruleset. */ rules: Array< - | RulesetReplaceResponse.RulesetsBlockRule - | RulesetReplaceResponse.RulesetsExecuteRule - | RulesetReplaceResponse.RulesetsLogRule - | RulesetReplaceResponse.RulesetsSkipRule + | RulesetGetResponse.RulesetsBlockRule + | RulesetGetResponse.RulesetsExecuteRule + | RulesetGetResponse.RulesetsLogRule + | RulesetGetResponse.RulesetsSkipRule >; /** @@ -1366,7 +1366,7 @@ export interface RulesetReplaceResponse { description?: string; } -export namespace RulesetReplaceResponse { +export namespace RulesetGetResponse { export interface RulesetsBlockRule { /** * The timestamp of when the rule was last modified. @@ -2343,7 +2343,7 @@ export namespace RulesetCreateParams { } } -export interface RulesetReplaceParams { +export interface RulesetUpdateParams { /** * The unique ID of the ruleset. */ @@ -2353,10 +2353,10 @@ export interface RulesetReplaceParams { * The list of rules in the ruleset. */ rules: Array< - | RulesetReplaceParams.RulesetsBlockRule - | RulesetReplaceParams.RulesetsExecuteRule - | RulesetReplaceParams.RulesetsLogRule - | RulesetReplaceParams.RulesetsSkipRule + | RulesetUpdateParams.RulesetsBlockRule + | RulesetUpdateParams.RulesetsExecuteRule + | RulesetUpdateParams.RulesetsLogRule + | RulesetUpdateParams.RulesetsSkipRule >; /** @@ -2403,7 +2403,7 @@ export interface RulesetReplaceParams { | 'magic_transit_managed'; } -export namespace RulesetReplaceParams { +export namespace RulesetUpdateParams { export interface RulesetsBlockRule { /** * The unique ID of the rule. @@ -2836,19 +2836,19 @@ export namespace RulesetReplaceParams { export namespace Rulesets { export import RulesetCreateResponse = RulesetsAPI.RulesetCreateResponse; + export import RulesetUpdateResponse = RulesetsAPI.RulesetUpdateResponse; export import RulesetListResponse = RulesetsAPI.RulesetListResponse; export import RulesetGetResponse = RulesetsAPI.RulesetGetResponse; - export import RulesetReplaceResponse = RulesetsAPI.RulesetReplaceResponse; export import RulesetCreateParams = RulesetsAPI.RulesetCreateParams; - export import RulesetReplaceParams = RulesetsAPI.RulesetReplaceParams; + export import RulesetUpdateParams = RulesetsAPI.RulesetUpdateParams; export import Phases = PhasesAPI.Phases; export import PhaseGetResponse = PhasesAPI.PhaseGetResponse; export import Rules = RulesAPI.Rules; export import RuleCreateResponse = RulesAPI.RuleCreateResponse; - export import RuleUpdateResponse = RulesAPI.RuleUpdateResponse; export import RuleDeleteResponse = RulesAPI.RuleDeleteResponse; + export import RuleEditResponse = RulesAPI.RuleEditResponse; export import RuleCreateParams = RulesAPI.RuleCreateParams; - export import RuleUpdateParams = RulesAPI.RuleUpdateParams; + export import RuleEditParams = RulesAPI.RuleEditParams; export import Versions = VersionsAPI.Versions; export import VersionListResponse = VersionsAPI.VersionListResponse; export import VersionGetResponse = VersionsAPI.VersionGetResponse; diff --git a/src/resources/rum/index.ts b/src/resources/rum/index.ts index 1feeff9407..fb60132b28 100644 --- a/src/resources/rum/index.ts +++ b/src/resources/rum/index.ts @@ -2,23 +2,23 @@ export { RuleCreateResponse, + RuleUpdateResponse, RuleListResponse, RuleDeleteResponse, - RuleReplaceResponse, RuleCreateParams, - RuleReplaceParams, + RuleUpdateParams, Rules, } from './rules'; export { Rum } from './rum'; export { SiteInfoCreateResponse, + SiteInfoUpdateResponse, SiteInfoListResponse, SiteInfoDeleteResponse, SiteInfoGetResponse, - SiteInfoReplaceResponse, SiteInfoCreateParams, + SiteInfoUpdateParams, SiteInfoListParams, - SiteInfoReplaceParams, SiteInfoListResponsesV4PagePaginationArray, SiteInfos, } from './site-infos'; diff --git a/src/resources/rum/rules.ts b/src/resources/rum/rules.ts index 4b7cea0af8..90c0a74640 100644 --- a/src/resources/rum/rules.ts +++ b/src/resources/rum/rules.ts @@ -22,6 +22,24 @@ export class Rules extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Updates a rule in a Web Analytics ruleset. + */ + update( + accountId: string, + rulesetId: string, + ruleId: string, + body: RuleUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/accounts/${accountId}/rum/v2/${rulesetId}/rule/${ruleId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: RuleUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * Lists all the rules in a Web Analytics ruleset. */ @@ -53,27 +71,40 @@ export class Rules extends APIResource { ) as Core.APIPromise<{ result: RuleDeleteResponse }> )._thenUnwrap((obj) => obj.result); } +} +export interface RuleCreateResponse { /** - * Updates a rule in a Web Analytics ruleset. + * The Web Analytics rule identifier. */ - replace( - accountId: string, - rulesetId: string, - ruleId: string, - body: RuleReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put(`/accounts/${accountId}/rum/v2/${rulesetId}/rule/${ruleId}`, { - body, - ...options, - }) as Core.APIPromise<{ result: RuleReplaceResponse }> - )._thenUnwrap((obj) => obj.result); - } + id?: string; + + created?: string; + + /** + * The hostname the rule will be applied to. + */ + host?: string; + + /** + * Whether the rule includes or excludes traffic from being measured. + */ + inclusive?: boolean; + + /** + * Whether the rule is paused or not. + */ + is_paused?: boolean; + + /** + * The paths the rule will be applied to. + */ + paths?: Array; + + priority?: number; } -export interface RuleCreateResponse { +export interface RuleUpdateResponse { /** * The Web Analytics rule identifier. */ @@ -172,37 +203,6 @@ export interface RuleDeleteResponse { id?: string; } -export interface RuleReplaceResponse { - /** - * The Web Analytics rule identifier. - */ - id?: string; - - created?: string; - - /** - * The hostname the rule will be applied to. - */ - host?: string; - - /** - * Whether the rule includes or excludes traffic from being measured. - */ - inclusive?: boolean; - - /** - * Whether the rule is paused or not. - */ - is_paused?: boolean; - - /** - * The paths the rule will be applied to. - */ - paths?: Array; - - priority?: number; -} - export interface RuleCreateParams { host?: string; @@ -219,7 +219,7 @@ export interface RuleCreateParams { paths?: Array; } -export interface RuleReplaceParams { +export interface RuleUpdateParams { host?: string; /** @@ -237,9 +237,9 @@ export interface RuleReplaceParams { export namespace Rules { export import RuleCreateResponse = RulesAPI.RuleCreateResponse; + export import RuleUpdateResponse = RulesAPI.RuleUpdateResponse; export import RuleListResponse = RulesAPI.RuleListResponse; export import RuleDeleteResponse = RulesAPI.RuleDeleteResponse; - export import RuleReplaceResponse = RulesAPI.RuleReplaceResponse; export import RuleCreateParams = RulesAPI.RuleCreateParams; - export import RuleReplaceParams = RulesAPI.RuleReplaceParams; + export import RuleUpdateParams = RulesAPI.RuleUpdateParams; } diff --git a/src/resources/rum/rum.ts b/src/resources/rum/rum.ts index 74e764e84f..8abba58e6f 100644 --- a/src/resources/rum/rum.ts +++ b/src/resources/rum/rum.ts @@ -12,19 +12,19 @@ export class Rum extends APIResource { export namespace Rum { export import SiteInfos = SiteInfosAPI.SiteInfos; export import SiteInfoCreateResponse = SiteInfosAPI.SiteInfoCreateResponse; + export import SiteInfoUpdateResponse = SiteInfosAPI.SiteInfoUpdateResponse; export import SiteInfoListResponse = SiteInfosAPI.SiteInfoListResponse; export import SiteInfoDeleteResponse = SiteInfosAPI.SiteInfoDeleteResponse; export import SiteInfoGetResponse = SiteInfosAPI.SiteInfoGetResponse; - export import SiteInfoReplaceResponse = SiteInfosAPI.SiteInfoReplaceResponse; export import SiteInfoListResponsesV4PagePaginationArray = SiteInfosAPI.SiteInfoListResponsesV4PagePaginationArray; export import SiteInfoCreateParams = SiteInfosAPI.SiteInfoCreateParams; + export import SiteInfoUpdateParams = SiteInfosAPI.SiteInfoUpdateParams; export import SiteInfoListParams = SiteInfosAPI.SiteInfoListParams; - export import SiteInfoReplaceParams = SiteInfosAPI.SiteInfoReplaceParams; export import Rules = RulesAPI.Rules; export import RuleCreateResponse = RulesAPI.RuleCreateResponse; + export import RuleUpdateResponse = RulesAPI.RuleUpdateResponse; export import RuleListResponse = RulesAPI.RuleListResponse; export import RuleDeleteResponse = RulesAPI.RuleDeleteResponse; - export import RuleReplaceResponse = RulesAPI.RuleReplaceResponse; export import RuleCreateParams = RulesAPI.RuleCreateParams; - export import RuleReplaceParams = RulesAPI.RuleReplaceParams; + export import RuleUpdateParams = RulesAPI.RuleUpdateParams; } diff --git a/src/resources/rum/site-infos.ts b/src/resources/rum/site-infos.ts index a6af742253..46159a781e 100644 --- a/src/resources/rum/site-infos.ts +++ b/src/resources/rum/site-infos.ts @@ -22,6 +22,23 @@ export class SiteInfos extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Updates an existing Web Analytics site. + */ + update( + accountId: string, + siteId: string, + body: SiteInfoUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/accounts/${accountId}/rum/site_info/${siteId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: SiteInfoUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * Lists all Web Analytics sites of an account. */ @@ -78,23 +95,6 @@ export class SiteInfos extends APIResource { }> )._thenUnwrap((obj) => obj.result); } - - /** - * Updates an existing Web Analytics site. - */ - replace( - accountId: string, - siteId: string, - body: SiteInfoReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put(`/accounts/${accountId}/rum/site_info/${siteId}`, { - body, - ...options, - }) as Core.APIPromise<{ result: SiteInfoReplaceResponse }> - )._thenUnwrap((obj) => obj.result); - } } export class SiteInfoListResponsesV4PagePaginationArray extends V4PagePaginationArray {} @@ -183,7 +183,7 @@ export namespace SiteInfoCreateResponse { } } -export interface SiteInfoListResponse { +export interface SiteInfoUpdateResponse { /** * If enabled, the JavaScript snippet is automatically injected for orange-clouded * sites. @@ -195,9 +195,9 @@ export interface SiteInfoListResponse { /** * A list of rules. */ - rules?: Array; + rules?: Array; - ruleset?: SiteInfoListResponse.Ruleset; + ruleset?: SiteInfoUpdateResponse.Ruleset; /** * The Web Analytics site identifier. @@ -215,7 +215,7 @@ export interface SiteInfoListResponse { snippet?: string; } -export namespace SiteInfoListResponse { +export namespace SiteInfoUpdateResponse { export interface Rule { /** * The Web Analytics rule identifier. @@ -267,14 +267,7 @@ export namespace SiteInfoListResponse { } } -export interface SiteInfoDeleteResponse { - /** - * The Web Analytics site identifier. - */ - site_tag?: string; -} - -export interface SiteInfoGetResponse { +export interface SiteInfoListResponse { /** * If enabled, the JavaScript snippet is automatically injected for orange-clouded * sites. @@ -286,9 +279,9 @@ export interface SiteInfoGetResponse { /** * A list of rules. */ - rules?: Array; + rules?: Array; - ruleset?: SiteInfoGetResponse.Ruleset; + ruleset?: SiteInfoListResponse.Ruleset; /** * The Web Analytics site identifier. @@ -306,7 +299,7 @@ export interface SiteInfoGetResponse { snippet?: string; } -export namespace SiteInfoGetResponse { +export namespace SiteInfoListResponse { export interface Rule { /** * The Web Analytics rule identifier. @@ -358,7 +351,14 @@ export namespace SiteInfoGetResponse { } } -export interface SiteInfoReplaceResponse { +export interface SiteInfoDeleteResponse { + /** + * The Web Analytics site identifier. + */ + site_tag?: string; +} + +export interface SiteInfoGetResponse { /** * If enabled, the JavaScript snippet is automatically injected for orange-clouded * sites. @@ -370,9 +370,9 @@ export interface SiteInfoReplaceResponse { /** * A list of rules. */ - rules?: Array; + rules?: Array; - ruleset?: SiteInfoReplaceResponse.Ruleset; + ruleset?: SiteInfoGetResponse.Ruleset; /** * The Web Analytics site identifier. @@ -390,7 +390,7 @@ export interface SiteInfoReplaceResponse { snippet?: string; } -export namespace SiteInfoReplaceResponse { +export namespace SiteInfoGetResponse { export interface Rule { /** * The Web Analytics rule identifier. @@ -460,14 +460,7 @@ export interface SiteInfoCreateParams { zone_tag?: string; } -export interface SiteInfoListParams extends V4PagePaginationArrayParams { - /** - * The property used to sort the list of results. - */ - order_by?: 'host' | 'created'; -} - -export interface SiteInfoReplaceParams { +export interface SiteInfoUpdateParams { /** * If enabled, the JavaScript snippet is automatically injected for orange-clouded * sites. @@ -485,14 +478,21 @@ export interface SiteInfoReplaceParams { zone_tag?: string; } +export interface SiteInfoListParams extends V4PagePaginationArrayParams { + /** + * The property used to sort the list of results. + */ + order_by?: 'host' | 'created'; +} + export namespace SiteInfos { export import SiteInfoCreateResponse = SiteInfosAPI.SiteInfoCreateResponse; + export import SiteInfoUpdateResponse = SiteInfosAPI.SiteInfoUpdateResponse; export import SiteInfoListResponse = SiteInfosAPI.SiteInfoListResponse; export import SiteInfoDeleteResponse = SiteInfosAPI.SiteInfoDeleteResponse; export import SiteInfoGetResponse = SiteInfosAPI.SiteInfoGetResponse; - export import SiteInfoReplaceResponse = SiteInfosAPI.SiteInfoReplaceResponse; export import SiteInfoListResponsesV4PagePaginationArray = SiteInfosAPI.SiteInfoListResponsesV4PagePaginationArray; export import SiteInfoCreateParams = SiteInfosAPI.SiteInfoCreateParams; + export import SiteInfoUpdateParams = SiteInfosAPI.SiteInfoUpdateParams; export import SiteInfoListParams = SiteInfosAPI.SiteInfoListParams; - export import SiteInfoReplaceParams = SiteInfosAPI.SiteInfoReplaceParams; } diff --git a/src/resources/secondary-dns/acls.ts b/src/resources/secondary-dns/acls.ts index 57e5019f78..ccd43348a7 100644 --- a/src/resources/secondary-dns/acls.ts +++ b/src/resources/secondary-dns/acls.ts @@ -21,6 +21,23 @@ export class ACLs extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Modify ACL. + */ + update( + accountId: unknown, + aclId: unknown, + body: ACLUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/accounts/${accountId}/secondary_dns/acls/${aclId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: ACLUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * List ACLs. */ @@ -57,26 +74,27 @@ export class ACLs extends APIResource { }> )._thenUnwrap((obj) => obj.result); } +} + +export interface ACLCreateResponse { + id: unknown; /** - * Modify ACL. + * Allowed IPv4/IPv6 address range of primary or secondary nameservers. This will + * be applied for the entire account. The IP range is used to allow additional + * NOTIFY IPs for secondary zones and IPs Cloudflare allows AXFR/IXFR requests from + * for primary zones. CIDRs are limited to a maximum of /24 for IPv4 and /64 for + * IPv6 respectively. */ - replace( - accountId: unknown, - aclId: unknown, - body: ACLReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put(`/accounts/${accountId}/secondary_dns/acls/${aclId}`, { - body, - ...options, - }) as Core.APIPromise<{ result: ACLReplaceResponse }> - )._thenUnwrap((obj) => obj.result); - } + ip_range: string; + + /** + * The name of the acl. + */ + name: string; } -export interface ACLCreateResponse { +export interface ACLUpdateResponse { id: unknown; /** @@ -138,27 +156,9 @@ export interface ACLGetResponse { name: string; } -export interface ACLReplaceResponse { - id: unknown; - - /** - * Allowed IPv4/IPv6 address range of primary or secondary nameservers. This will - * be applied for the entire account. The IP range is used to allow additional - * NOTIFY IPs for secondary zones and IPs Cloudflare allows AXFR/IXFR requests from - * for primary zones. CIDRs are limited to a maximum of /24 for IPv4 and /64 for - * IPv6 respectively. - */ - ip_range: string; - - /** - * The name of the acl. - */ - name: string; -} - export type ACLCreateParams = unknown; -export interface ACLReplaceParams { +export interface ACLUpdateParams { /** * Allowed IPv4/IPv6 address range of primary or secondary nameservers. This will * be applied for the entire account. The IP range is used to allow additional @@ -176,10 +176,10 @@ export interface ACLReplaceParams { export namespace ACLs { export import ACLCreateResponse = ACLsAPI.ACLCreateResponse; + export import ACLUpdateResponse = ACLsAPI.ACLUpdateResponse; export import ACLListResponse = ACLsAPI.ACLListResponse; export import ACLDeleteResponse = ACLsAPI.ACLDeleteResponse; export import ACLGetResponse = ACLsAPI.ACLGetResponse; - export import ACLReplaceResponse = ACLsAPI.ACLReplaceResponse; export import ACLCreateParams = ACLsAPI.ACLCreateParams; - export import ACLReplaceParams = ACLsAPI.ACLReplaceParams; + export import ACLUpdateParams = ACLsAPI.ACLUpdateParams; } diff --git a/src/resources/secondary-dns/incoming.ts b/src/resources/secondary-dns/incoming.ts index a64902c2bd..7c42b5c680 100644 --- a/src/resources/secondary-dns/incoming.ts +++ b/src/resources/secondary-dns/incoming.ts @@ -20,6 +20,21 @@ export class Incoming extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Update secondary zone configuration for incoming zone transfers. + */ + update( + zoneId: unknown, + body: IncomingUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/zones/${zoneId}/secondary_dns/incoming`, { body, ...options }) as Core.APIPromise<{ + result: IncomingUpdateResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + /** * Delete secondary zone configuration for incoming zone transfers. */ @@ -41,21 +56,6 @@ export class Incoming extends APIResource { }> )._thenUnwrap((obj) => obj.result); } - - /** - * Update secondary zone configuration for incoming zone transfers. - */ - replace( - zoneId: unknown, - body: IncomingReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put(`/zones/${zoneId}/secondary_dns/incoming`, { body, ...options }) as Core.APIPromise<{ - result: IncomingReplaceResponse; - }> - )._thenUnwrap((obj) => obj.result); - } } export interface IncomingCreateResponse { @@ -98,11 +98,7 @@ export interface IncomingCreateResponse { soa_serial?: number; } -export interface IncomingDeleteResponse { - id?: unknown; -} - -export interface IncomingGetResponse { +export interface IncomingUpdateResponse { id?: unknown; /** @@ -142,7 +138,11 @@ export interface IncomingGetResponse { soa_serial?: number; } -export interface IncomingReplaceResponse { +export interface IncomingDeleteResponse { + id?: unknown; +} + +export interface IncomingGetResponse { id?: unknown; /** @@ -200,7 +200,7 @@ export interface IncomingCreateParams { peers: Array; } -export interface IncomingReplaceParams { +export interface IncomingUpdateParams { /** * How often should a secondary zone auto refresh regardless of DNS NOTIFY. Not * applicable for primary zones. @@ -220,9 +220,9 @@ export interface IncomingReplaceParams { export namespace Incoming { export import IncomingCreateResponse = IncomingAPI.IncomingCreateResponse; + export import IncomingUpdateResponse = IncomingAPI.IncomingUpdateResponse; export import IncomingDeleteResponse = IncomingAPI.IncomingDeleteResponse; export import IncomingGetResponse = IncomingAPI.IncomingGetResponse; - export import IncomingReplaceResponse = IncomingAPI.IncomingReplaceResponse; export import IncomingCreateParams = IncomingAPI.IncomingCreateParams; - export import IncomingReplaceParams = IncomingAPI.IncomingReplaceParams; + export import IncomingUpdateParams = IncomingAPI.IncomingUpdateParams; } diff --git a/src/resources/secondary-dns/index.ts b/src/resources/secondary-dns/index.ts index aaa78825a6..7eaad683ce 100644 --- a/src/resources/secondary-dns/index.ts +++ b/src/resources/secondary-dns/index.ts @@ -2,54 +2,54 @@ export { ACLCreateResponse, + ACLUpdateResponse, ACLListResponse, ACLDeleteResponse, ACLGetResponse, - ACLReplaceResponse, ACLCreateParams, - ACLReplaceParams, + ACLUpdateParams, ACLs, } from './acls'; export { ForceAxfrCreateResponse, ForceAxfrs } from './force-axfrs'; export { IncomingCreateResponse, + IncomingUpdateResponse, IncomingDeleteResponse, IncomingGetResponse, - IncomingReplaceResponse, IncomingCreateParams, - IncomingReplaceParams, + IncomingUpdateParams, Incoming, } from './incoming'; export { OutgoingCreateResponse, + OutgoingUpdateResponse, OutgoingDeleteResponse, OutgoingDisableResponse, OutgoingEnableResponse, OutgoingForceNotifyResponse, OutgoingGetResponse, - OutgoingReplaceResponse, OutgoingCreateParams, - OutgoingReplaceParams, + OutgoingUpdateParams, Outgoing, } from './outgoing/index'; export { PeerCreateResponse, + PeerUpdateResponse, PeerListResponse, PeerDeleteResponse, PeerGetResponse, - PeerReplaceResponse, PeerCreateParams, - PeerReplaceParams, + PeerUpdateParams, Peers, } from './peers'; export { SecondaryDNS } from './secondary-dns'; export { TsigCreateResponse, + TsigUpdateResponse, TsigListResponse, TsigDeleteResponse, TsigGetResponse, - TsigReplaceResponse, TsigCreateParams, - TsigReplaceParams, + TsigUpdateParams, Tsigs, } from './tsigs'; diff --git a/src/resources/secondary-dns/outgoing/index.ts b/src/resources/secondary-dns/outgoing/index.ts index cdc160a8fa..a8bdf288e8 100644 --- a/src/resources/secondary-dns/outgoing/index.ts +++ b/src/resources/secondary-dns/outgoing/index.ts @@ -2,14 +2,14 @@ export { OutgoingCreateResponse, + OutgoingUpdateResponse, OutgoingDeleteResponse, OutgoingDisableResponse, OutgoingEnableResponse, OutgoingForceNotifyResponse, OutgoingGetResponse, - OutgoingReplaceResponse, OutgoingCreateParams, - OutgoingReplaceParams, + OutgoingUpdateParams, Outgoing, } from './outgoing'; export { StatusGetResponse, Status } from './status'; diff --git a/src/resources/secondary-dns/outgoing/outgoing.ts b/src/resources/secondary-dns/outgoing/outgoing.ts index a08c381cbe..5589312777 100644 --- a/src/resources/secondary-dns/outgoing/outgoing.ts +++ b/src/resources/secondary-dns/outgoing/outgoing.ts @@ -23,6 +23,21 @@ export class Outgoing extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Update primary zone configuration for outgoing zone transfers. + */ + update( + zoneId: unknown, + body: OutgoingUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/zones/${zoneId}/secondary_dns/outgoing`, { body, ...options }) as Core.APIPromise<{ + result: OutgoingUpdateResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + /** * Delete primary zone configuration for outgoing zone transfers. */ @@ -78,21 +93,6 @@ export class Outgoing extends APIResource { }> )._thenUnwrap((obj) => obj.result); } - - /** - * Update primary zone configuration for outgoing zone transfers. - */ - replace( - zoneId: unknown, - body: OutgoingReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put(`/zones/${zoneId}/secondary_dns/outgoing`, { body, ...options }) as Core.APIPromise<{ - result: OutgoingReplaceResponse; - }> - )._thenUnwrap((obj) => obj.result); - } } export interface OutgoingCreateResponse { @@ -129,27 +129,7 @@ export interface OutgoingCreateResponse { soa_serial?: number; } -export interface OutgoingDeleteResponse { - id?: unknown; -} - -/** - * The zone transfer status of a primary zone - */ -export type OutgoingDisableResponse = string; - -/** - * The zone transfer status of a primary zone - */ -export type OutgoingEnableResponse = string; - -/** - * When force_notify query parameter is set to true, the response is a simple - * string - */ -export type OutgoingForceNotifyResponse = string; - -export interface OutgoingGetResponse { +export interface OutgoingUpdateResponse { id?: unknown; /** @@ -183,7 +163,27 @@ export interface OutgoingGetResponse { soa_serial?: number; } -export interface OutgoingReplaceResponse { +export interface OutgoingDeleteResponse { + id?: unknown; +} + +/** + * The zone transfer status of a primary zone + */ +export type OutgoingDisableResponse = string; + +/** + * The zone transfer status of a primary zone + */ +export type OutgoingEnableResponse = string; + +/** + * When force_notify query parameter is set to true, the response is a simple + * string + */ +export type OutgoingForceNotifyResponse = string; + +export interface OutgoingGetResponse { id?: unknown; /** @@ -229,7 +229,7 @@ export interface OutgoingCreateParams { peers: Array; } -export interface OutgoingReplaceParams { +export interface OutgoingUpdateParams { /** * Zone name. */ @@ -243,14 +243,14 @@ export interface OutgoingReplaceParams { export namespace Outgoing { export import OutgoingCreateResponse = OutgoingAPI.OutgoingCreateResponse; + export import OutgoingUpdateResponse = OutgoingAPI.OutgoingUpdateResponse; export import OutgoingDeleteResponse = OutgoingAPI.OutgoingDeleteResponse; export import OutgoingDisableResponse = OutgoingAPI.OutgoingDisableResponse; export import OutgoingEnableResponse = OutgoingAPI.OutgoingEnableResponse; export import OutgoingForceNotifyResponse = OutgoingAPI.OutgoingForceNotifyResponse; export import OutgoingGetResponse = OutgoingAPI.OutgoingGetResponse; - export import OutgoingReplaceResponse = OutgoingAPI.OutgoingReplaceResponse; export import OutgoingCreateParams = OutgoingAPI.OutgoingCreateParams; - export import OutgoingReplaceParams = OutgoingAPI.OutgoingReplaceParams; + export import OutgoingUpdateParams = OutgoingAPI.OutgoingUpdateParams; export import Status = StatusAPI.Status; export import StatusGetResponse = StatusAPI.StatusGetResponse; } diff --git a/src/resources/secondary-dns/peers.ts b/src/resources/secondary-dns/peers.ts index 45ee8ec560..7e1d57c2ff 100644 --- a/src/resources/secondary-dns/peers.ts +++ b/src/resources/secondary-dns/peers.ts @@ -21,6 +21,23 @@ export class Peers extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Modify Peer. + */ + update( + accountId: unknown, + peerId: unknown, + body: PeerUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/accounts/${accountId}/secondary_dns/peers/${peerId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: PeerUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * List Peers. */ @@ -58,26 +75,44 @@ export class Peers extends APIResource { }> )._thenUnwrap((obj) => obj.result); } +} + +export interface PeerCreateResponse { + id: unknown; /** - * Modify Peer. + * The name of the peer. */ - replace( - accountId: unknown, - peerId: unknown, - body: PeerReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put(`/accounts/${accountId}/secondary_dns/peers/${peerId}`, { - body, - ...options, - }) as Core.APIPromise<{ result: PeerReplaceResponse }> - )._thenUnwrap((obj) => obj.result); - } + name: string; + + /** + * IPv4/IPv6 address of primary or secondary nameserver, depending on what zone + * this peer is linked to. For primary zones this IP defines the IP of the + * secondary nameserver Cloudflare will NOTIFY upon zone changes. For secondary + * zones this IP defines the IP of the primary nameserver Cloudflare will send + * AXFR/IXFR requests to. + */ + ip?: string; + + /** + * Enable IXFR transfer protocol, default is AXFR. Only applicable to secondary + * zones. + */ + ixfr_enable?: boolean; + + /** + * DNS port of primary or secondary nameserver, depending on what zone this peer is + * linked to. + */ + port?: number; + + /** + * TSIG authentication will be used for zone transfer if configured. + */ + tsig_id?: string; } -export interface PeerCreateResponse { +export interface PeerUpdateResponse { id: unknown; /** @@ -190,44 +225,9 @@ export interface PeerGetResponse { tsig_id?: string; } -export interface PeerReplaceResponse { - id: unknown; - - /** - * The name of the peer. - */ - name: string; - - /** - * IPv4/IPv6 address of primary or secondary nameserver, depending on what zone - * this peer is linked to. For primary zones this IP defines the IP of the - * secondary nameserver Cloudflare will NOTIFY upon zone changes. For secondary - * zones this IP defines the IP of the primary nameserver Cloudflare will send - * AXFR/IXFR requests to. - */ - ip?: string; - - /** - * Enable IXFR transfer protocol, default is AXFR. Only applicable to secondary - * zones. - */ - ixfr_enable?: boolean; - - /** - * DNS port of primary or secondary nameserver, depending on what zone this peer is - * linked to. - */ - port?: number; - - /** - * TSIG authentication will be used for zone transfer if configured. - */ - tsig_id?: string; -} - export type PeerCreateParams = unknown; -export interface PeerReplaceParams { +export interface PeerUpdateParams { /** * The name of the peer. */ @@ -262,10 +262,10 @@ export interface PeerReplaceParams { export namespace Peers { export import PeerCreateResponse = PeersAPI.PeerCreateResponse; + export import PeerUpdateResponse = PeersAPI.PeerUpdateResponse; export import PeerListResponse = PeersAPI.PeerListResponse; export import PeerDeleteResponse = PeersAPI.PeerDeleteResponse; export import PeerGetResponse = PeersAPI.PeerGetResponse; - export import PeerReplaceResponse = PeersAPI.PeerReplaceResponse; export import PeerCreateParams = PeersAPI.PeerCreateParams; - export import PeerReplaceParams = PeersAPI.PeerReplaceParams; + export import PeerUpdateParams = PeersAPI.PeerUpdateParams; } diff --git a/src/resources/secondary-dns/secondary-dns.ts b/src/resources/secondary-dns/secondary-dns.ts index 5c2c18669b..eb4a2ff9a0 100644 --- a/src/resources/secondary-dns/secondary-dns.ts +++ b/src/resources/secondary-dns/secondary-dns.ts @@ -22,43 +22,43 @@ export namespace SecondaryDNS { export import ForceAxfrCreateResponse = ForceAxfrsAPI.ForceAxfrCreateResponse; export import Incoming = IncomingAPI.Incoming; export import IncomingCreateResponse = IncomingAPI.IncomingCreateResponse; + export import IncomingUpdateResponse = IncomingAPI.IncomingUpdateResponse; export import IncomingDeleteResponse = IncomingAPI.IncomingDeleteResponse; export import IncomingGetResponse = IncomingAPI.IncomingGetResponse; - export import IncomingReplaceResponse = IncomingAPI.IncomingReplaceResponse; export import IncomingCreateParams = IncomingAPI.IncomingCreateParams; - export import IncomingReplaceParams = IncomingAPI.IncomingReplaceParams; + export import IncomingUpdateParams = IncomingAPI.IncomingUpdateParams; export import Outgoing = OutgoingAPI.Outgoing; export import OutgoingCreateResponse = OutgoingAPI.OutgoingCreateResponse; + export import OutgoingUpdateResponse = OutgoingAPI.OutgoingUpdateResponse; export import OutgoingDeleteResponse = OutgoingAPI.OutgoingDeleteResponse; export import OutgoingDisableResponse = OutgoingAPI.OutgoingDisableResponse; export import OutgoingEnableResponse = OutgoingAPI.OutgoingEnableResponse; export import OutgoingForceNotifyResponse = OutgoingAPI.OutgoingForceNotifyResponse; export import OutgoingGetResponse = OutgoingAPI.OutgoingGetResponse; - export import OutgoingReplaceResponse = OutgoingAPI.OutgoingReplaceResponse; export import OutgoingCreateParams = OutgoingAPI.OutgoingCreateParams; - export import OutgoingReplaceParams = OutgoingAPI.OutgoingReplaceParams; + export import OutgoingUpdateParams = OutgoingAPI.OutgoingUpdateParams; export import ACLs = ACLsAPI.ACLs; export import ACLCreateResponse = ACLsAPI.ACLCreateResponse; + export import ACLUpdateResponse = ACLsAPI.ACLUpdateResponse; export import ACLListResponse = ACLsAPI.ACLListResponse; export import ACLDeleteResponse = ACLsAPI.ACLDeleteResponse; export import ACLGetResponse = ACLsAPI.ACLGetResponse; - export import ACLReplaceResponse = ACLsAPI.ACLReplaceResponse; export import ACLCreateParams = ACLsAPI.ACLCreateParams; - export import ACLReplaceParams = ACLsAPI.ACLReplaceParams; + export import ACLUpdateParams = ACLsAPI.ACLUpdateParams; export import Peers = PeersAPI.Peers; export import PeerCreateResponse = PeersAPI.PeerCreateResponse; + export import PeerUpdateResponse = PeersAPI.PeerUpdateResponse; export import PeerListResponse = PeersAPI.PeerListResponse; export import PeerDeleteResponse = PeersAPI.PeerDeleteResponse; export import PeerGetResponse = PeersAPI.PeerGetResponse; - export import PeerReplaceResponse = PeersAPI.PeerReplaceResponse; export import PeerCreateParams = PeersAPI.PeerCreateParams; - export import PeerReplaceParams = PeersAPI.PeerReplaceParams; + export import PeerUpdateParams = PeersAPI.PeerUpdateParams; export import Tsigs = TsigsAPI.Tsigs; export import TsigCreateResponse = TsigsAPI.TsigCreateResponse; + export import TsigUpdateResponse = TsigsAPI.TsigUpdateResponse; export import TsigListResponse = TsigsAPI.TsigListResponse; export import TsigDeleteResponse = TsigsAPI.TsigDeleteResponse; export import TsigGetResponse = TsigsAPI.TsigGetResponse; - export import TsigReplaceResponse = TsigsAPI.TsigReplaceResponse; export import TsigCreateParams = TsigsAPI.TsigCreateParams; - export import TsigReplaceParams = TsigsAPI.TsigReplaceParams; + export import TsigUpdateParams = TsigsAPI.TsigUpdateParams; } diff --git a/src/resources/secondary-dns/tsigs.ts b/src/resources/secondary-dns/tsigs.ts index 13a02da954..3d59a69913 100644 --- a/src/resources/secondary-dns/tsigs.ts +++ b/src/resources/secondary-dns/tsigs.ts @@ -21,6 +21,23 @@ export class Tsigs extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Modify TSIG. + */ + update( + accountId: unknown, + tsigId: unknown, + body: TsigUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/accounts/${accountId}/secondary_dns/tsigs/${tsigId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: TsigUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * List TSIGs. */ @@ -58,26 +75,28 @@ export class Tsigs extends APIResource { }> )._thenUnwrap((obj) => obj.result); } +} + +export interface TsigCreateResponse { + id: unknown; /** - * Modify TSIG. + * TSIG algorithm. */ - replace( - accountId: unknown, - tsigId: unknown, - body: TsigReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put(`/accounts/${accountId}/secondary_dns/tsigs/${tsigId}`, { - body, - ...options, - }) as Core.APIPromise<{ result: TsigReplaceResponse }> - )._thenUnwrap((obj) => obj.result); - } + algo: string; + + /** + * TSIG key name. + */ + name: string; + + /** + * TSIG secret. + */ + secret: string; } -export interface TsigCreateResponse { +export interface TsigUpdateResponse { id: unknown; /** @@ -142,25 +161,6 @@ export interface TsigGetResponse { secret: string; } -export interface TsigReplaceResponse { - id: unknown; - - /** - * TSIG algorithm. - */ - algo: string; - - /** - * TSIG key name. - */ - name: string; - - /** - * TSIG secret. - */ - secret: string; -} - export interface TsigCreateParams { /** * TSIG algorithm. @@ -178,7 +178,7 @@ export interface TsigCreateParams { secret: string; } -export interface TsigReplaceParams { +export interface TsigUpdateParams { /** * TSIG algorithm. */ @@ -197,10 +197,10 @@ export interface TsigReplaceParams { export namespace Tsigs { export import TsigCreateResponse = TsigsAPI.TsigCreateResponse; + export import TsigUpdateResponse = TsigsAPI.TsigUpdateResponse; export import TsigListResponse = TsigsAPI.TsigListResponse; export import TsigDeleteResponse = TsigsAPI.TsigDeleteResponse; export import TsigGetResponse = TsigsAPI.TsigGetResponse; - export import TsigReplaceResponse = TsigsAPI.TsigReplaceResponse; export import TsigCreateParams = TsigsAPI.TsigCreateParams; - export import TsigReplaceParams = TsigsAPI.TsigReplaceParams; + export import TsigUpdateParams = TsigsAPI.TsigUpdateParams; } diff --git a/src/resources/settings/always-online.ts b/src/resources/settings/always-online.ts index 252c2ef76a..7b005dce91 100644 --- a/src/resources/settings/always-online.ts +++ b/src/resources/settings/always-online.ts @@ -12,14 +12,14 @@ export class AlwaysOnline extends APIResource { * [Always Online](https://developers.cloudflare.com/cache/about/always-online) for * more information. */ - update( + edit( zoneId: string, - body: AlwaysOnlineUpdateParams, + body: AlwaysOnlineEditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.patch(`/zones/${zoneId}/settings/always_online`, { body, ...options }) as Core.APIPromise<{ - result: AlwaysOnlineUpdateResponse; + result: AlwaysOnlineEditResponse; }> )._thenUnwrap((obj) => obj.result); } @@ -47,7 +47,7 @@ export class AlwaysOnline extends APIResource { * [Always Online](https://developers.cloudflare.com/cache/about/always-online) for * more information. */ -export interface AlwaysOnlineUpdateResponse { +export interface AlwaysOnlineEditResponse { /** * ID of the zone setting. */ @@ -100,7 +100,7 @@ export interface AlwaysOnlineGetResponse { modified_on?: string | null; } -export interface AlwaysOnlineUpdateParams { +export interface AlwaysOnlineEditParams { /** * Value of the zone setting. */ @@ -108,7 +108,7 @@ export interface AlwaysOnlineUpdateParams { } export namespace AlwaysOnline { - export import AlwaysOnlineUpdateResponse = AlwaysOnlineAPI.AlwaysOnlineUpdateResponse; + export import AlwaysOnlineEditResponse = AlwaysOnlineAPI.AlwaysOnlineEditResponse; export import AlwaysOnlineGetResponse = AlwaysOnlineAPI.AlwaysOnlineGetResponse; - export import AlwaysOnlineUpdateParams = AlwaysOnlineAPI.AlwaysOnlineUpdateParams; + export import AlwaysOnlineEditParams = AlwaysOnlineAPI.AlwaysOnlineEditParams; } diff --git a/src/resources/settings/always-use-https.ts b/src/resources/settings/always-use-https.ts index 2528fc4a0e..154deeb099 100644 --- a/src/resources/settings/always-use-https.ts +++ b/src/resources/settings/always-use-https.ts @@ -10,16 +10,16 @@ export class AlwaysUseHTTPS extends APIResource { * equivalent "https" URL. If you only want to redirect for a subset of requests, * consider creating an "Always use HTTPS" page rule. */ - update( + edit( zoneId: string, - body: AlwaysUseHTTPSUpdateParams, + body: AlwaysUseHTTPSEditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.patch(`/zones/${zoneId}/settings/always_use_https`, { body, ...options, - }) as Core.APIPromise<{ result: AlwaysUseHTTPSUpdateResponse }> + }) as Core.APIPromise<{ result: AlwaysUseHTTPSEditResponse }> )._thenUnwrap((obj) => obj.result); } @@ -42,7 +42,7 @@ export class AlwaysUseHTTPS extends APIResource { * equivalent "https" URL. If you only want to redirect for a subset of requests, * consider creating an "Always use HTTPS" page rule. */ -export interface AlwaysUseHTTPSUpdateResponse { +export interface AlwaysUseHTTPSEditResponse { /** * ID of the zone setting. */ @@ -93,7 +93,7 @@ export interface AlwaysUseHTTPSGetResponse { modified_on?: string | null; } -export interface AlwaysUseHTTPSUpdateParams { +export interface AlwaysUseHTTPSEditParams { /** * Value of the zone setting. */ @@ -101,7 +101,7 @@ export interface AlwaysUseHTTPSUpdateParams { } export namespace AlwaysUseHTTPS { - export import AlwaysUseHTTPSUpdateResponse = AlwaysUseHTTPSAPI.AlwaysUseHTTPSUpdateResponse; + export import AlwaysUseHTTPSEditResponse = AlwaysUseHTTPSAPI.AlwaysUseHTTPSEditResponse; export import AlwaysUseHTTPSGetResponse = AlwaysUseHTTPSAPI.AlwaysUseHTTPSGetResponse; - export import AlwaysUseHTTPSUpdateParams = AlwaysUseHTTPSAPI.AlwaysUseHTTPSUpdateParams; + export import AlwaysUseHTTPSEditParams = AlwaysUseHTTPSAPI.AlwaysUseHTTPSEditParams; } diff --git a/src/resources/settings/automatic-https-rewrites.ts b/src/resources/settings/automatic-https-rewrites.ts index fccdb8bfef..35bfc14e05 100644 --- a/src/resources/settings/automatic-https-rewrites.ts +++ b/src/resources/settings/automatic-https-rewrites.ts @@ -8,16 +8,16 @@ export class AutomaticHTTPSRewrites extends APIResource { /** * Enable the Automatic HTTPS Rewrites feature for this zone. */ - update( + edit( zoneId: string, - body: AutomaticHTTPSRewriteUpdateParams, + body: AutomaticHTTPSRewriteEditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.patch(`/zones/${zoneId}/settings/automatic_https_rewrites`, { body, ...options, - }) as Core.APIPromise<{ result: AutomaticHTTPSRewriteUpdateResponse }> + }) as Core.APIPromise<{ result: AutomaticHTTPSRewriteEditResponse }> )._thenUnwrap((obj) => obj.result); } @@ -36,7 +36,7 @@ export class AutomaticHTTPSRewrites extends APIResource { /** * Enable the Automatic HTTPS Rewrites feature for this zone. */ -export interface AutomaticHTTPSRewriteUpdateResponse { +export interface AutomaticHTTPSRewriteEditResponse { /** * ID of the zone setting. */ @@ -85,7 +85,7 @@ export interface AutomaticHTTPSRewriteGetResponse { modified_on?: string | null; } -export interface AutomaticHTTPSRewriteUpdateParams { +export interface AutomaticHTTPSRewriteEditParams { /** * Value of the zone setting. Notes: Default value depends on the zone's plan * level. @@ -94,7 +94,7 @@ export interface AutomaticHTTPSRewriteUpdateParams { } export namespace AutomaticHTTPSRewrites { - export import AutomaticHTTPSRewriteUpdateResponse = AutomaticHTTPSRewritesAPI.AutomaticHTTPSRewriteUpdateResponse; + export import AutomaticHTTPSRewriteEditResponse = AutomaticHTTPSRewritesAPI.AutomaticHTTPSRewriteEditResponse; export import AutomaticHTTPSRewriteGetResponse = AutomaticHTTPSRewritesAPI.AutomaticHTTPSRewriteGetResponse; - export import AutomaticHTTPSRewriteUpdateParams = AutomaticHTTPSRewritesAPI.AutomaticHTTPSRewriteUpdateParams; + export import AutomaticHTTPSRewriteEditParams = AutomaticHTTPSRewritesAPI.AutomaticHTTPSRewriteEditParams; } diff --git a/src/resources/settings/automatic-platform-optimization.ts b/src/resources/settings/automatic-platform-optimization.ts index bc11b2393e..9698b8a8e2 100644 --- a/src/resources/settings/automatic-platform-optimization.ts +++ b/src/resources/settings/automatic-platform-optimization.ts @@ -10,16 +10,16 @@ export class AutomaticPlatformOptimization extends APIResource { * serves your WordPress site from Cloudflare's edge network and caches third-party * fonts. */ - update( + edit( zoneId: string, - body: AutomaticPlatformOptimizationUpdateParams, + body: AutomaticPlatformOptimizationEditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.patch(`/zones/${zoneId}/settings/automatic_platform_optimization`, { body, ...options, - }) as Core.APIPromise<{ result: AutomaticPlatformOptimizationUpdateResponse }> + }) as Core.APIPromise<{ result: AutomaticPlatformOptimizationEditResponse }> )._thenUnwrap((obj) => obj.result); } @@ -41,7 +41,7 @@ export class AutomaticPlatformOptimization extends APIResource { } } -export interface AutomaticPlatformOptimizationUpdateResponse { +export interface AutomaticPlatformOptimizationEditResponse { /** * Indicates whether or not * [cache by device type](https://developers.cloudflare.com/automatic-platform-optimization/reference/cache-device-type/) @@ -115,11 +115,11 @@ export interface AutomaticPlatformOptimizationGetResponse { wp_plugin: boolean; } -export interface AutomaticPlatformOptimizationUpdateParams { - value: AutomaticPlatformOptimizationUpdateParams.Value; +export interface AutomaticPlatformOptimizationEditParams { + value: AutomaticPlatformOptimizationEditParams.Value; } -export namespace AutomaticPlatformOptimizationUpdateParams { +export namespace AutomaticPlatformOptimizationEditParams { export interface Value { /** * Indicates whether or not @@ -159,7 +159,7 @@ export namespace AutomaticPlatformOptimizationUpdateParams { } export namespace AutomaticPlatformOptimization { - export import AutomaticPlatformOptimizationUpdateResponse = AutomaticPlatformOptimizationAPI.AutomaticPlatformOptimizationUpdateResponse; + export import AutomaticPlatformOptimizationEditResponse = AutomaticPlatformOptimizationAPI.AutomaticPlatformOptimizationEditResponse; export import AutomaticPlatformOptimizationGetResponse = AutomaticPlatformOptimizationAPI.AutomaticPlatformOptimizationGetResponse; - export import AutomaticPlatformOptimizationUpdateParams = AutomaticPlatformOptimizationAPI.AutomaticPlatformOptimizationUpdateParams; + export import AutomaticPlatformOptimizationEditParams = AutomaticPlatformOptimizationAPI.AutomaticPlatformOptimizationEditParams; } diff --git a/src/resources/settings/brotli.ts b/src/resources/settings/brotli.ts index 7c714c0c2c..20038197ed 100644 --- a/src/resources/settings/brotli.ts +++ b/src/resources/settings/brotli.ts @@ -9,14 +9,14 @@ export class Brotli extends APIResource { * When the client requesting an asset supports the Brotli compression algorithm, * Cloudflare will serve a Brotli compressed version of the asset. */ - update( + edit( zoneId: string, - body: BrotliUpdateParams, + body: BrotliEditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.patch(`/zones/${zoneId}/settings/brotli`, { body, ...options }) as Core.APIPromise<{ - result: BrotliUpdateResponse; + result: BrotliEditResponse; }> )._thenUnwrap((obj) => obj.result); } @@ -38,7 +38,7 @@ export class Brotli extends APIResource { * When the client requesting an asset supports the Brotli compression algorithm, * Cloudflare will serve a Brotli compressed version of the asset. */ -export interface BrotliUpdateResponse { +export interface BrotliEditResponse { /** * ID of the zone setting. */ @@ -88,7 +88,7 @@ export interface BrotliGetResponse { modified_on?: string | null; } -export interface BrotliUpdateParams { +export interface BrotliEditParams { /** * Value of the zone setting. */ @@ -96,7 +96,7 @@ export interface BrotliUpdateParams { } export namespace Brotli { - export import BrotliUpdateResponse = BrotliAPI.BrotliUpdateResponse; + export import BrotliEditResponse = BrotliAPI.BrotliEditResponse; export import BrotliGetResponse = BrotliAPI.BrotliGetResponse; - export import BrotliUpdateParams = BrotliAPI.BrotliUpdateParams; + export import BrotliEditParams = BrotliAPI.BrotliEditParams; } diff --git a/src/resources/settings/browser-cache-ttl.ts b/src/resources/settings/browser-cache-ttl.ts index 2971140b35..4896d70d9e 100644 --- a/src/resources/settings/browser-cache-ttl.ts +++ b/src/resources/settings/browser-cache-ttl.ts @@ -11,16 +11,16 @@ export class BrowserCacheTTL extends APIResource { * specified by your server. * (https://support.cloudflare.com/hc/en-us/articles/200168276). */ - update( + edit( zoneId: string, - body: BrowserCacheTTLUpdateParams, + body: BrowserCacheTTLEditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.patch(`/zones/${zoneId}/settings/browser_cache_ttl`, { body, ...options, - }) as Core.APIPromise<{ result: BrowserCacheTTLUpdateResponse }> + }) as Core.APIPromise<{ result: BrowserCacheTTLEditResponse }> )._thenUnwrap((obj) => obj.result); } @@ -45,7 +45,7 @@ export class BrowserCacheTTL extends APIResource { * specified by your server. * (https://support.cloudflare.com/hc/en-us/articles/200168276). */ -export interface BrowserCacheTTLUpdateResponse { +export interface BrowserCacheTTLEditResponse { /** * ID of the zone setting. */ @@ -153,7 +153,7 @@ export interface BrowserCacheTTLGetResponse { modified_on?: string | null; } -export interface BrowserCacheTTLUpdateParams { +export interface BrowserCacheTTLEditParams { /** * Value of the zone setting. Notes: Setting a TTL of 0 is equivalent to selecting * `Respect Existing Headers` @@ -190,7 +190,7 @@ export interface BrowserCacheTTLUpdateParams { } export namespace BrowserCacheTTL { - export import BrowserCacheTTLUpdateResponse = BrowserCacheTTLAPI.BrowserCacheTTLUpdateResponse; + export import BrowserCacheTTLEditResponse = BrowserCacheTTLAPI.BrowserCacheTTLEditResponse; export import BrowserCacheTTLGetResponse = BrowserCacheTTLAPI.BrowserCacheTTLGetResponse; - export import BrowserCacheTTLUpdateParams = BrowserCacheTTLAPI.BrowserCacheTTLUpdateParams; + export import BrowserCacheTTLEditParams = BrowserCacheTTLAPI.BrowserCacheTTLEditParams; } diff --git a/src/resources/settings/browser-check.ts b/src/resources/settings/browser-check.ts index 14e984e1d2..7edebb44f0 100644 --- a/src/resources/settings/browser-check.ts +++ b/src/resources/settings/browser-check.ts @@ -12,14 +12,14 @@ export class BrowserCheck extends APIResource { * agent (also commonly used by abuse bots, crawlers or visitors). * (https://support.cloudflare.com/hc/en-us/articles/200170086). */ - update( + edit( zoneId: string, - body: BrowserCheckUpdateParams, + body: BrowserCheckEditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.patch(`/zones/${zoneId}/settings/browser_check`, { body, ...options }) as Core.APIPromise<{ - result: BrowserCheckUpdateResponse; + result: BrowserCheckEditResponse; }> )._thenUnwrap((obj) => obj.result); } @@ -47,7 +47,7 @@ export class BrowserCheck extends APIResource { * agent (also commonly used by abuse bots, crawlers or visitors). * (https://support.cloudflare.com/hc/en-us/articles/200170086). */ -export interface BrowserCheckUpdateResponse { +export interface BrowserCheckEditResponse { /** * ID of the zone setting. */ @@ -100,7 +100,7 @@ export interface BrowserCheckGetResponse { modified_on?: string | null; } -export interface BrowserCheckUpdateParams { +export interface BrowserCheckEditParams { /** * Value of the zone setting. */ @@ -108,7 +108,7 @@ export interface BrowserCheckUpdateParams { } export namespace BrowserCheck { - export import BrowserCheckUpdateResponse = BrowserCheckAPI.BrowserCheckUpdateResponse; + export import BrowserCheckEditResponse = BrowserCheckAPI.BrowserCheckEditResponse; export import BrowserCheckGetResponse = BrowserCheckAPI.BrowserCheckGetResponse; - export import BrowserCheckUpdateParams = BrowserCheckAPI.BrowserCheckUpdateParams; + export import BrowserCheckEditParams = BrowserCheckAPI.BrowserCheckEditParams; } diff --git a/src/resources/settings/cache-level.ts b/src/resources/settings/cache-level.ts index b9d4c57ef6..7c31334321 100644 --- a/src/resources/settings/cache-level.ts +++ b/src/resources/settings/cache-level.ts @@ -12,14 +12,14 @@ export class CacheLevel extends APIResource { * aggressive setting will cache all static resources, including ones with a query * string. (https://support.cloudflare.com/hc/en-us/articles/200168256). */ - update( + edit( zoneId: string, - body: CacheLevelUpdateParams, + body: CacheLevelEditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.patch(`/zones/${zoneId}/settings/cache_level`, { body, ...options }) as Core.APIPromise<{ - result: CacheLevelUpdateResponse; + result: CacheLevelEditResponse; }> )._thenUnwrap((obj) => obj.result); } @@ -47,7 +47,7 @@ export class CacheLevel extends APIResource { * aggressive setting will cache all static resources, including ones with a query * string. (https://support.cloudflare.com/hc/en-us/articles/200168256). */ -export interface CacheLevelUpdateResponse { +export interface CacheLevelEditResponse { /** * ID of the zone setting. */ @@ -100,7 +100,7 @@ export interface CacheLevelGetResponse { modified_on?: string | null; } -export interface CacheLevelUpdateParams { +export interface CacheLevelEditParams { /** * Value of the zone setting. */ @@ -108,7 +108,7 @@ export interface CacheLevelUpdateParams { } export namespace CacheLevel { - export import CacheLevelUpdateResponse = CacheLevelAPI.CacheLevelUpdateResponse; + export import CacheLevelEditResponse = CacheLevelAPI.CacheLevelEditResponse; export import CacheLevelGetResponse = CacheLevelAPI.CacheLevelGetResponse; - export import CacheLevelUpdateParams = CacheLevelAPI.CacheLevelUpdateParams; + export import CacheLevelEditParams = CacheLevelAPI.CacheLevelEditParams; } diff --git a/src/resources/settings/challenge-ttl.ts b/src/resources/settings/challenge-ttl.ts index 70d12df0d6..856533de47 100644 --- a/src/resources/settings/challenge-ttl.ts +++ b/src/resources/settings/challenge-ttl.ts @@ -12,14 +12,14 @@ export class ChallengeTTL extends APIResource { * setting and will attempt to honor any setting above 45 minutes. * (https://support.cloudflare.com/hc/en-us/articles/200170136). */ - update( + edit( zoneId: string, - body: ChallengeTTLUpdateParams, + body: ChallengeTTLEditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.patch(`/zones/${zoneId}/settings/challenge_ttl`, { body, ...options }) as Core.APIPromise<{ - result: ChallengeTTLUpdateResponse; + result: ChallengeTTLEditResponse; }> )._thenUnwrap((obj) => obj.result); } @@ -47,7 +47,7 @@ export class ChallengeTTL extends APIResource { * setting and will attempt to honor any setting above 45 minutes. * (https://support.cloudflare.com/hc/en-us/articles/200170136). */ -export interface ChallengeTTLUpdateResponse { +export interface ChallengeTTLEditResponse { /** * ID of the zone setting. */ @@ -128,7 +128,7 @@ export interface ChallengeTTLGetResponse { modified_on?: string | null; } -export interface ChallengeTTLUpdateParams { +export interface ChallengeTTLEditParams { /** * Value of the zone setting. */ @@ -150,7 +150,7 @@ export interface ChallengeTTLUpdateParams { } export namespace ChallengeTTL { - export import ChallengeTTLUpdateResponse = ChallengeTTLAPI.ChallengeTTLUpdateResponse; + export import ChallengeTTLEditResponse = ChallengeTTLAPI.ChallengeTTLEditResponse; export import ChallengeTTLGetResponse = ChallengeTTLAPI.ChallengeTTLGetResponse; - export import ChallengeTTLUpdateParams = ChallengeTTLAPI.ChallengeTTLUpdateParams; + export import ChallengeTTLEditParams = ChallengeTTLAPI.ChallengeTTLEditParams; } diff --git a/src/resources/settings/ciphers.ts b/src/resources/settings/ciphers.ts index 11d881aa9c..a91e6ab709 100644 --- a/src/resources/settings/ciphers.ts +++ b/src/resources/settings/ciphers.ts @@ -8,14 +8,14 @@ export class Ciphers extends APIResource { /** * Changes ciphers setting. */ - update( + edit( zoneId: string, - body: CipherUpdateParams, + body: CipherEditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.patch(`/zones/${zoneId}/settings/ciphers`, { body, ...options }) as Core.APIPromise<{ - result: CipherUpdateResponse; + result: CipherEditResponse; }> )._thenUnwrap((obj) => obj.result); } @@ -36,7 +36,7 @@ export class Ciphers extends APIResource { * An allowlist of ciphers for TLS termination. These ciphers must be in the * BoringSSL format. */ -export interface CipherUpdateResponse { +export interface CipherEditResponse { /** * ID of the zone setting. */ @@ -86,7 +86,7 @@ export interface CipherGetResponse { modified_on?: string | null; } -export interface CipherUpdateParams { +export interface CipherEditParams { /** * Value of the zone setting. */ @@ -94,7 +94,7 @@ export interface CipherUpdateParams { } export namespace Ciphers { - export import CipherUpdateResponse = CiphersAPI.CipherUpdateResponse; + export import CipherEditResponse = CiphersAPI.CipherEditResponse; export import CipherGetResponse = CiphersAPI.CipherGetResponse; - export import CipherUpdateParams = CiphersAPI.CipherUpdateParams; + export import CipherEditParams = CiphersAPI.CipherEditParams; } diff --git a/src/resources/settings/development-mode.ts b/src/resources/settings/development-mode.ts index 1e0bf0ab81..1e9d826633 100644 --- a/src/resources/settings/development-mode.ts +++ b/src/resources/settings/development-mode.ts @@ -13,16 +13,16 @@ export class DevelopmentMode extends APIResource { * see those changes right away. Once entered, development mode will last for 3 * hours and then automatically toggle off. */ - update( + edit( zoneId: string, - body: DevelopmentModeUpdateParams, + body: DevelopmentModeEditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.patch(`/zones/${zoneId}/settings/development_mode`, { body, ...options, - }) as Core.APIPromise<{ result: DevelopmentModeUpdateResponse }> + }) as Core.APIPromise<{ result: DevelopmentModeEditResponse }> )._thenUnwrap((obj) => obj.result); } @@ -51,7 +51,7 @@ export class DevelopmentMode extends APIResource { * see those changes right away. Once entered, development mode will last for 3 * hours and then automatically toggle off. */ -export interface DevelopmentModeUpdateResponse { +export interface DevelopmentModeEditResponse { /** * ID of the zone setting. */ @@ -119,7 +119,7 @@ export interface DevelopmentModeGetResponse { time_remaining?: number; } -export interface DevelopmentModeUpdateParams { +export interface DevelopmentModeEditParams { /** * Value of the zone setting. */ @@ -127,7 +127,7 @@ export interface DevelopmentModeUpdateParams { } export namespace DevelopmentMode { - export import DevelopmentModeUpdateResponse = DevelopmentModeAPI.DevelopmentModeUpdateResponse; + export import DevelopmentModeEditResponse = DevelopmentModeAPI.DevelopmentModeEditResponse; export import DevelopmentModeGetResponse = DevelopmentModeAPI.DevelopmentModeGetResponse; - export import DevelopmentModeUpdateParams = DevelopmentModeAPI.DevelopmentModeUpdateParams; + export import DevelopmentModeEditParams = DevelopmentModeAPI.DevelopmentModeEditParams; } diff --git a/src/resources/settings/early-hints.ts b/src/resources/settings/early-hints.ts index 9400d5f65e..4d70347f5d 100644 --- a/src/resources/settings/early-hints.ts +++ b/src/resources/settings/early-hints.ts @@ -11,14 +11,14 @@ export class EarlyHints extends APIResource { * [Early Hints](https://developers.cloudflare.com/cache/about/early-hints) for * more information. */ - update( + edit( zoneId: string, - body: EarlyHintUpdateParams, + body: EarlyHintEditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.patch(`/zones/${zoneId}/settings/early_hints`, { body, ...options }) as Core.APIPromise<{ - result: EarlyHintUpdateResponse; + result: EarlyHintEditResponse; }> )._thenUnwrap((obj) => obj.result); } @@ -44,7 +44,7 @@ export class EarlyHints extends APIResource { * [Early Hints](https://developers.cloudflare.com/cache/about/early-hints) for * more information. */ -export interface EarlyHintUpdateResponse { +export interface EarlyHintEditResponse { /** * ID of the zone setting. */ @@ -96,7 +96,7 @@ export interface EarlyHintGetResponse { modified_on?: string | null; } -export interface EarlyHintUpdateParams { +export interface EarlyHintEditParams { /** * Value of the zone setting. */ @@ -104,7 +104,7 @@ export interface EarlyHintUpdateParams { } export namespace EarlyHints { - export import EarlyHintUpdateResponse = EarlyHintsAPI.EarlyHintUpdateResponse; + export import EarlyHintEditResponse = EarlyHintsAPI.EarlyHintEditResponse; export import EarlyHintGetResponse = EarlyHintsAPI.EarlyHintGetResponse; - export import EarlyHintUpdateParams = EarlyHintsAPI.EarlyHintUpdateParams; + export import EarlyHintEditParams = EarlyHintsAPI.EarlyHintEditParams; } diff --git a/src/resources/settings/email-obfuscation.ts b/src/resources/settings/email-obfuscation.ts index 7c4d1e596a..89f48a47b8 100644 --- a/src/resources/settings/email-obfuscation.ts +++ b/src/resources/settings/email-obfuscation.ts @@ -9,16 +9,16 @@ export class EmailObfuscation extends APIResource { * Encrypt email adresses on your web page from bots, while keeping them visible to * humans. (https://support.cloudflare.com/hc/en-us/articles/200170016). */ - update( + edit( zoneId: string, - body: EmailObfuscationUpdateParams, + body: EmailObfuscationEditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.patch(`/zones/${zoneId}/settings/email_obfuscation`, { body, ...options, - }) as Core.APIPromise<{ result: EmailObfuscationUpdateResponse }> + }) as Core.APIPromise<{ result: EmailObfuscationEditResponse }> )._thenUnwrap((obj) => obj.result); } @@ -39,7 +39,7 @@ export class EmailObfuscation extends APIResource { * Encrypt email adresses on your web page from bots, while keeping them visible to * humans. (https://support.cloudflare.com/hc/en-us/articles/200170016). */ -export interface EmailObfuscationUpdateResponse { +export interface EmailObfuscationEditResponse { /** * ID of the zone setting. */ @@ -89,7 +89,7 @@ export interface EmailObfuscationGetResponse { modified_on?: string | null; } -export interface EmailObfuscationUpdateParams { +export interface EmailObfuscationEditParams { /** * Value of the zone setting. */ @@ -97,7 +97,7 @@ export interface EmailObfuscationUpdateParams { } export namespace EmailObfuscation { - export import EmailObfuscationUpdateResponse = EmailObfuscationAPI.EmailObfuscationUpdateResponse; + export import EmailObfuscationEditResponse = EmailObfuscationAPI.EmailObfuscationEditResponse; export import EmailObfuscationGetResponse = EmailObfuscationAPI.EmailObfuscationGetResponse; - export import EmailObfuscationUpdateParams = EmailObfuscationAPI.EmailObfuscationUpdateParams; + export import EmailObfuscationEditParams = EmailObfuscationAPI.EmailObfuscationEditParams; } diff --git a/src/resources/settings/font-settings.ts b/src/resources/settings/font-settings.ts index 230dea52a9..6331f4d6d1 100644 --- a/src/resources/settings/font-settings.ts +++ b/src/resources/settings/font-settings.ts @@ -10,14 +10,14 @@ export class FontSettings extends APIResource { * Hosted fonts from your own domain, boost performance, and enhance user privacy. * Refer to the Cloudflare Fonts documentation for more information. */ - update( + edit( zoneId: string, - body: FontSettingUpdateParams, + body: FontSettingEditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.patch(`/zones/${zoneId}/settings/fonts`, { body, ...options }) as Core.APIPromise<{ - result: FontSettingUpdateResponse; + result: FontSettingEditResponse; }> )._thenUnwrap((obj) => obj.result); } @@ -41,7 +41,7 @@ export class FontSettings extends APIResource { * Hosted fonts from your own domain, boost performance, and enhance user privacy. * Refer to the Cloudflare Fonts documentation for more information. */ -export interface FontSettingUpdateResponse { +export interface FontSettingEditResponse { /** * ID of the zone setting. */ @@ -92,7 +92,7 @@ export interface FontSettingGetResponse { modified_on?: string | null; } -export interface FontSettingUpdateParams { +export interface FontSettingEditParams { /** * Whether the feature is enabled or disabled. */ @@ -100,7 +100,7 @@ export interface FontSettingUpdateParams { } export namespace FontSettings { - export import FontSettingUpdateResponse = FontSettingsAPI.FontSettingUpdateResponse; + export import FontSettingEditResponse = FontSettingsAPI.FontSettingEditResponse; export import FontSettingGetResponse = FontSettingsAPI.FontSettingGetResponse; - export import FontSettingUpdateParams = FontSettingsAPI.FontSettingUpdateParams; + export import FontSettingEditParams = FontSettingsAPI.FontSettingEditParams; } diff --git a/src/resources/settings/h2-prioritization.ts b/src/resources/settings/h2-prioritization.ts index c23693d9bd..55f729deb8 100644 --- a/src/resources/settings/h2-prioritization.ts +++ b/src/resources/settings/h2-prioritization.ts @@ -8,16 +8,16 @@ export class H2Prioritization extends APIResource { /** * Gets HTTP/2 Edge Prioritization setting. */ - update( + edit( zoneId: string, - body: H2PrioritizationUpdateParams, + body: H2PrioritizationEditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.patch(`/zones/${zoneId}/settings/h2_prioritization`, { body, ...options, - }) as Core.APIPromise<{ result: H2PrioritizationUpdateResponse }> + }) as Core.APIPromise<{ result: H2PrioritizationEditResponse }> )._thenUnwrap((obj) => obj.result); } @@ -38,7 +38,7 @@ export class H2Prioritization extends APIResource { * HTTP/2 to improve page load performance. It also supports fine control of * content delivery when used in conjunction with Workers. */ -export interface H2PrioritizationUpdateResponse { +export interface H2PrioritizationEditResponse { /** * ID of the zone setting. */ @@ -89,16 +89,16 @@ export interface H2PrioritizationGetResponse { modified_on?: string | null; } -export interface H2PrioritizationUpdateParams { +export interface H2PrioritizationEditParams { /** * HTTP/2 Edge Prioritization optimises the delivery of resources served through * HTTP/2 to improve page load performance. It also supports fine control of * content delivery when used in conjunction with Workers. */ - value: H2PrioritizationUpdateParams.Value; + value: H2PrioritizationEditParams.Value; } -export namespace H2PrioritizationUpdateParams { +export namespace H2PrioritizationEditParams { /** * HTTP/2 Edge Prioritization optimises the delivery of resources served through * HTTP/2 to improve page load performance. It also supports fine control of @@ -118,7 +118,7 @@ export namespace H2PrioritizationUpdateParams { } export namespace H2Prioritization { - export import H2PrioritizationUpdateResponse = H2PrioritizationAPI.H2PrioritizationUpdateResponse; + export import H2PrioritizationEditResponse = H2PrioritizationAPI.H2PrioritizationEditResponse; export import H2PrioritizationGetResponse = H2PrioritizationAPI.H2PrioritizationGetResponse; - export import H2PrioritizationUpdateParams = H2PrioritizationAPI.H2PrioritizationUpdateParams; + export import H2PrioritizationEditParams = H2PrioritizationAPI.H2PrioritizationEditParams; } diff --git a/src/resources/settings/hotlink-protection.ts b/src/resources/settings/hotlink-protection.ts index 4e60b4d9ff..e3cd08329a 100644 --- a/src/resources/settings/hotlink-protection.ts +++ b/src/resources/settings/hotlink-protection.ts @@ -14,16 +14,16 @@ export class HotlinkProtection extends APIResource { * on their own pages. * (https://support.cloudflare.com/hc/en-us/articles/200170026). */ - update( + edit( zoneId: string, - body: HotlinkProtectionUpdateParams, + body: HotlinkProtectionEditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.patch(`/zones/${zoneId}/settings/hotlink_protection`, { body, ...options, - }) as Core.APIPromise<{ result: HotlinkProtectionUpdateResponse }> + }) as Core.APIPromise<{ result: HotlinkProtectionEditResponse }> )._thenUnwrap((obj) => obj.result); } @@ -54,7 +54,7 @@ export class HotlinkProtection extends APIResource { * on their own pages. * (https://support.cloudflare.com/hc/en-us/articles/200170026). */ -export interface HotlinkProtectionUpdateResponse { +export interface HotlinkProtectionEditResponse { /** * ID of the zone setting. */ @@ -109,7 +109,7 @@ export interface HotlinkProtectionGetResponse { modified_on?: string | null; } -export interface HotlinkProtectionUpdateParams { +export interface HotlinkProtectionEditParams { /** * Value of the zone setting. */ @@ -117,7 +117,7 @@ export interface HotlinkProtectionUpdateParams { } export namespace HotlinkProtection { - export import HotlinkProtectionUpdateResponse = HotlinkProtectionAPI.HotlinkProtectionUpdateResponse; + export import HotlinkProtectionEditResponse = HotlinkProtectionAPI.HotlinkProtectionEditResponse; export import HotlinkProtectionGetResponse = HotlinkProtectionAPI.HotlinkProtectionGetResponse; - export import HotlinkProtectionUpdateParams = HotlinkProtectionAPI.HotlinkProtectionUpdateParams; + export import HotlinkProtectionEditParams = HotlinkProtectionAPI.HotlinkProtectionEditParams; } diff --git a/src/resources/settings/http2.ts b/src/resources/settings/http2.ts index 1061a25dad..76d2c6c776 100644 --- a/src/resources/settings/http2.ts +++ b/src/resources/settings/http2.ts @@ -8,14 +8,14 @@ export class HTTP2 extends APIResource { /** * Value of the HTTP2 setting. */ - update( + edit( zoneId: string, - body: HTTP2UpdateParams, + body: HTTP2EditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.patch(`/zones/${zoneId}/settings/http2`, { body, ...options }) as Core.APIPromise<{ - result: HTTP2UpdateResponse; + result: HTTP2EditResponse; }> )._thenUnwrap((obj) => obj.result); } @@ -35,7 +35,7 @@ export class HTTP2 extends APIResource { /** * HTTP2 enabled for this zone. */ -export interface HTTP2UpdateResponse { +export interface HTTP2EditResponse { /** * ID of the zone setting. */ @@ -84,7 +84,7 @@ export interface HTTP2GetResponse { modified_on?: string | null; } -export interface HTTP2UpdateParams { +export interface HTTP2EditParams { /** * Value of the HTTP2 setting. */ @@ -92,7 +92,7 @@ export interface HTTP2UpdateParams { } export namespace HTTP2 { - export import HTTP2UpdateResponse = HTTP2API.HTTP2UpdateResponse; + export import HTTP2EditResponse = HTTP2API.HTTP2EditResponse; export import HTTP2GetResponse = HTTP2API.HTTP2GetResponse; - export import HTTP2UpdateParams = HTTP2API.HTTP2UpdateParams; + export import HTTP2EditParams = HTTP2API.HTTP2EditParams; } diff --git a/src/resources/settings/http3.ts b/src/resources/settings/http3.ts index 23dde1ffa5..5f9571d14e 100644 --- a/src/resources/settings/http3.ts +++ b/src/resources/settings/http3.ts @@ -8,14 +8,14 @@ export class HTTP3 extends APIResource { /** * Value of the HTTP3 setting. */ - update( + edit( zoneId: string, - body: HTTP3UpdateParams, + body: HTTP3EditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.patch(`/zones/${zoneId}/settings/http3`, { body, ...options }) as Core.APIPromise<{ - result: HTTP3UpdateResponse; + result: HTTP3EditResponse; }> )._thenUnwrap((obj) => obj.result); } @@ -35,7 +35,7 @@ export class HTTP3 extends APIResource { /** * HTTP3 enabled for this zone. */ -export interface HTTP3UpdateResponse { +export interface HTTP3EditResponse { /** * ID of the zone setting. */ @@ -84,7 +84,7 @@ export interface HTTP3GetResponse { modified_on?: string | null; } -export interface HTTP3UpdateParams { +export interface HTTP3EditParams { /** * Value of the HTTP3 setting. */ @@ -92,7 +92,7 @@ export interface HTTP3UpdateParams { } export namespace HTTP3 { - export import HTTP3UpdateResponse = HTTP3API.HTTP3UpdateResponse; + export import HTTP3EditResponse = HTTP3API.HTTP3EditResponse; export import HTTP3GetResponse = HTTP3API.HTTP3GetResponse; - export import HTTP3UpdateParams = HTTP3API.HTTP3UpdateParams; + export import HTTP3EditParams = HTTP3API.HTTP3EditParams; } diff --git a/src/resources/settings/image-resizing.ts b/src/resources/settings/image-resizing.ts index 0f6d5070d6..85c04171e7 100644 --- a/src/resources/settings/image-resizing.ts +++ b/src/resources/settings/image-resizing.ts @@ -11,16 +11,16 @@ export class ImageResizing extends APIResource { * [Image Resizing documentation](https://developers.cloudflare.com/images/) for * more information. */ - update( + edit( zoneId: string, - body: ImageResizingUpdateParams, + body: ImageResizingEditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.patch(`/zones/${zoneId}/settings/image_resizing`, { body, ...options, - }) as Core.APIPromise<{ result: ImageResizingUpdateResponse }> + }) as Core.APIPromise<{ result: ImageResizingEditResponse }> )._thenUnwrap((obj) => obj.result); } @@ -45,7 +45,7 @@ export class ImageResizing extends APIResource { * [Image Resizing documentation](https://developers.cloudflare.com/images/) for * more information. */ -export interface ImageResizingUpdateResponse { +export interface ImageResizingEditResponse { /** * ID of the zone setting. */ @@ -97,17 +97,17 @@ export interface ImageResizingGetResponse { modified_on?: string | null; } -export interface ImageResizingUpdateParams { +export interface ImageResizingEditParams { /** * Image Resizing provides on-demand resizing, conversion and optimisation for * images served through Cloudflare's network. Refer to the * [Image Resizing documentation](https://developers.cloudflare.com/images/) for * more information. */ - value: ImageResizingUpdateParams.Value; + value: ImageResizingEditParams.Value; } -export namespace ImageResizingUpdateParams { +export namespace ImageResizingEditParams { /** * Image Resizing provides on-demand resizing, conversion and optimisation for * images served through Cloudflare's network. Refer to the @@ -128,7 +128,7 @@ export namespace ImageResizingUpdateParams { } export namespace ImageResizing { - export import ImageResizingUpdateResponse = ImageResizingAPI.ImageResizingUpdateResponse; + export import ImageResizingEditResponse = ImageResizingAPI.ImageResizingEditResponse; export import ImageResizingGetResponse = ImageResizingAPI.ImageResizingGetResponse; - export import ImageResizingUpdateParams = ImageResizingAPI.ImageResizingUpdateParams; + export import ImageResizingEditParams = ImageResizingAPI.ImageResizingEditParams; } diff --git a/src/resources/settings/index.ts b/src/resources/settings/index.ts index 6ba899758a..05bb2d9c34 100644 --- a/src/resources/settings/index.ts +++ b/src/resources/settings/index.ts @@ -2,228 +2,223 @@ export { AdvancedDDOSGetResponse, AdvancedDDOS } from './advanced-ddos'; export { - AlwaysOnlineUpdateResponse, + AlwaysOnlineEditResponse, AlwaysOnlineGetResponse, - AlwaysOnlineUpdateParams, + AlwaysOnlineEditParams, AlwaysOnline, } from './always-online'; export { - AlwaysUseHTTPSUpdateResponse, + AlwaysUseHTTPSEditResponse, AlwaysUseHTTPSGetResponse, - AlwaysUseHTTPSUpdateParams, + AlwaysUseHTTPSEditParams, AlwaysUseHTTPS, } from './always-use-https'; export { - AutomaticHTTPSRewriteUpdateResponse, + AutomaticHTTPSRewriteEditResponse, AutomaticHTTPSRewriteGetResponse, - AutomaticHTTPSRewriteUpdateParams, + AutomaticHTTPSRewriteEditParams, AutomaticHTTPSRewrites, } from './automatic-https-rewrites'; export { - AutomaticPlatformOptimizationUpdateResponse, + AutomaticPlatformOptimizationEditResponse, AutomaticPlatformOptimizationGetResponse, - AutomaticPlatformOptimizationUpdateParams, + AutomaticPlatformOptimizationEditParams, AutomaticPlatformOptimization, } from './automatic-platform-optimization'; -export { BrotliUpdateResponse, BrotliGetResponse, BrotliUpdateParams, Brotli } from './brotli'; +export { BrotliEditResponse, BrotliGetResponse, BrotliEditParams, Brotli } from './brotli'; export { - BrowserCacheTTLUpdateResponse, + BrowserCacheTTLEditResponse, BrowserCacheTTLGetResponse, - BrowserCacheTTLUpdateParams, + BrowserCacheTTLEditParams, BrowserCacheTTL, } from './browser-cache-ttl'; export { - BrowserCheckUpdateResponse, + BrowserCheckEditResponse, BrowserCheckGetResponse, - BrowserCheckUpdateParams, + BrowserCheckEditParams, BrowserCheck, } from './browser-check'; export { - CacheLevelUpdateResponse, + CacheLevelEditResponse, CacheLevelGetResponse, - CacheLevelUpdateParams, + CacheLevelEditParams, CacheLevel, } from './cache-level'; export { - ChallengeTTLUpdateResponse, + ChallengeTTLEditResponse, ChallengeTTLGetResponse, - ChallengeTTLUpdateParams, + ChallengeTTLEditParams, ChallengeTTL, } from './challenge-ttl'; -export { CipherUpdateResponse, CipherGetResponse, CipherUpdateParams, Ciphers } from './ciphers'; +export { CipherEditResponse, CipherGetResponse, CipherEditParams, Ciphers } from './ciphers'; export { - DevelopmentModeUpdateResponse, + DevelopmentModeEditResponse, DevelopmentModeGetResponse, - DevelopmentModeUpdateParams, + DevelopmentModeEditParams, DevelopmentMode, } from './development-mode'; +export { EarlyHintEditResponse, EarlyHintGetResponse, EarlyHintEditParams, EarlyHints } from './early-hints'; export { - EarlyHintUpdateResponse, - EarlyHintGetResponse, - EarlyHintUpdateParams, - EarlyHints, -} from './early-hints'; -export { - EmailObfuscationUpdateResponse, + EmailObfuscationEditResponse, EmailObfuscationGetResponse, - EmailObfuscationUpdateParams, + EmailObfuscationEditParams, EmailObfuscation, } from './email-obfuscation'; export { - FontSettingUpdateResponse, + FontSettingEditResponse, FontSettingGetResponse, - FontSettingUpdateParams, + FontSettingEditParams, FontSettings, } from './font-settings'; export { - H2PrioritizationUpdateResponse, + H2PrioritizationEditResponse, H2PrioritizationGetResponse, - H2PrioritizationUpdateParams, + H2PrioritizationEditParams, H2Prioritization, } from './h2-prioritization'; -export { HTTP2UpdateResponse, HTTP2GetResponse, HTTP2UpdateParams, HTTP2 } from './http2'; -export { HTTP3UpdateResponse, HTTP3GetResponse, HTTP3UpdateParams, HTTP3 } from './http3'; +export { HTTP2EditResponse, HTTP2GetResponse, HTTP2EditParams, HTTP2 } from './http2'; +export { HTTP3EditResponse, HTTP3GetResponse, HTTP3EditParams, HTTP3 } from './http3'; export { - HotlinkProtectionUpdateResponse, + HotlinkProtectionEditResponse, HotlinkProtectionGetResponse, - HotlinkProtectionUpdateParams, + HotlinkProtectionEditParams, HotlinkProtection, } from './hotlink-protection'; export { - IPGeolocationUpdateResponse, + IPGeolocationEditResponse, IPGeolocationGetResponse, - IPGeolocationUpdateParams, + IPGeolocationEditParams, IPGeolocation, } from './ip-geolocation'; -export { IPV6UpdateResponse, IPV6GetResponse, IPV6UpdateParams, IPV6 } from './ipv6'; +export { IPV6EditResponse, IPV6GetResponse, IPV6EditParams, IPV6 } from './ipv6'; export { - ImageResizingUpdateResponse, + ImageResizingEditResponse, ImageResizingGetResponse, - ImageResizingUpdateParams, + ImageResizingEditParams, ImageResizing, } from './image-resizing'; export { - MinTLSVersionUpdateResponse, + MinTLSVersionEditResponse, MinTLSVersionGetResponse, - MinTLSVersionUpdateParams, + MinTLSVersionEditParams, MinTLSVersion, } from './min-tls-version'; -export { MinifyUpdateResponse, MinifyGetResponse, MinifyUpdateParams, Minify } from './minify'; -export { MirageUpdateResponse, MirageGetResponse, MirageUpdateParams, Mirage } from './mirage'; +export { MinifyEditResponse, MinifyGetResponse, MinifyEditParams, Minify } from './minify'; +export { MirageEditResponse, MirageGetResponse, MirageEditParams, Mirage } from './mirage'; export { - MobileRedirectUpdateResponse, + MobileRedirectEditResponse, MobileRedirectGetResponse, - MobileRedirectUpdateParams, + MobileRedirectEditParams, MobileRedirect, } from './mobile-redirect'; -export { NELUpdateResponse, NELGetResponse, NELUpdateParams, NEL } from './nel'; +export { NELEditResponse, NELGetResponse, NELEditParams, NEL } from './nel'; export { - OpportunisticEncryptionUpdateResponse, + OpportunisticEncryptionEditResponse, OpportunisticEncryptionGetResponse, - OpportunisticEncryptionUpdateParams, + OpportunisticEncryptionEditParams, OpportunisticEncryption, } from './opportunistic-encryption'; export { - OpportunisticOnionUpdateResponse, + OpportunisticOnionEditResponse, OpportunisticOnionGetResponse, - OpportunisticOnionUpdateParams, + OpportunisticOnionEditParams, OpportunisticOnion, } from './opportunistic-onion'; export { - OrangeToOrangeUpdateResponse, + OrangeToOrangeEditResponse, OrangeToOrangeGetResponse, - OrangeToOrangeUpdateParams, + OrangeToOrangeEditParams, OrangeToOrange, } from './orange-to-orange'; export { - OriginErrorPagePassThruUpdateResponse, + OriginErrorPagePassThruEditResponse, OriginErrorPagePassThruGetResponse, - OriginErrorPagePassThruUpdateParams, + OriginErrorPagePassThruEditParams, OriginErrorPagePassThru, } from './origin-error-page-pass-thru'; export { - OriginMaxHTTPVersionUpdateResponse, + OriginMaxHTTPVersionEditResponse, OriginMaxHTTPVersionGetResponse, - OriginMaxHTTPVersionUpdateParams, + OriginMaxHTTPVersionEditParams, OriginMaxHTTPVersion, } from './origin-max-http-version'; -export { PolishUpdateResponse, PolishGetResponse, PolishUpdateParams, Polish } from './polish'; +export { PolishEditResponse, PolishGetResponse, PolishEditParams, Polish } from './polish'; export { - PrefetchPreloadUpdateResponse, + PrefetchPreloadEditResponse, PrefetchPreloadGetResponse, - PrefetchPreloadUpdateParams, + PrefetchPreloadEditParams, PrefetchPreload, } from './prefetch-preload'; export { - ProxyReadTimeoutUpdateResponse, + ProxyReadTimeoutEditResponse, ProxyReadTimeoutGetResponse, - ProxyReadTimeoutUpdateParams, + ProxyReadTimeoutEditParams, ProxyReadTimeout, } from './proxy-read-timeout'; export { - PseudoIPV4UpdateResponse, + PseudoIPV4EditResponse, PseudoIPV4GetResponse, - PseudoIPV4UpdateParams, + PseudoIPV4EditParams, PseudoIPV4, } from './pseudo-ipv4'; export { - ResponseBufferingUpdateResponse, + ResponseBufferingEditResponse, ResponseBufferingGetResponse, - ResponseBufferingUpdateParams, + ResponseBufferingEditParams, ResponseBuffering, } from './response-buffering'; export { - RocketLoaderUpdateResponse, + RocketLoaderEditResponse, RocketLoaderGetResponse, - RocketLoaderUpdateParams, + RocketLoaderEditParams, RocketLoader, } from './rocket-loader'; +export { SSLEditResponse, SSLGetResponse, SSLEditParams, SSL } from './ssl'; export { - SSLRecommenderUpdateResponse, + SSLRecommenderEditResponse, SSLRecommenderGetResponse, - SSLRecommenderUpdateParams, + SSLRecommenderEditParams, SSLRecommender, } from './ssl-recommender'; -export { SSLUpdateResponse, SSLGetResponse, SSLUpdateParams, SSL } from './ssl'; export { - SecurityHeaderUpdateResponse, + SecurityHeaderEditResponse, SecurityHeaderGetResponse, - SecurityHeaderUpdateParams, + SecurityHeaderEditParams, SecurityHeaders, } from './security-headers'; export { - SecurityLevelUpdateResponse, + SecurityLevelEditResponse, SecurityLevelGetResponse, - SecurityLevelUpdateParams, + SecurityLevelEditParams, SecurityLevel, } from './security-level'; export { - ServerSideExcludeUpdateResponse, + ServerSideExcludeEditResponse, ServerSideExcludeGetResponse, - ServerSideExcludeUpdateParams, + ServerSideExcludeEditParams, ServerSideExcludes, } from './server-side-excludes'; export { SettingListResponse, SettingEditResponse, SettingEditParams, Settings } from './settings'; export { - SortQueryStringForCacheUpdateResponse, + SortQueryStringForCacheEditResponse, SortQueryStringForCacheGetResponse, - SortQueryStringForCacheUpdateParams, + SortQueryStringForCacheEditParams, SortQueryStringForCache, } from './sort-query-string-for-cache'; -export { TLS1_3UpdateResponse, TLS1_3GetResponse, TLS1_3UpdateParams, TLS1_3 } from './tls-1-3'; +export { TLS1_3EditResponse, TLS1_3GetResponse, TLS1_3EditParams, TLS1_3 } from './tls-1-3'; export { - TLSClientAuthUpdateResponse, + TLSClientAuthEditResponse, TLSClientAuthGetResponse, - TLSClientAuthUpdateParams, + TLSClientAuthEditParams, TLSClientAuth, } from './tls-client-auth'; export { - TrueClientIPHeaderUpdateResponse, + TrueClientIPHeaderEditResponse, TrueClientIPHeaderGetResponse, - TrueClientIPHeaderUpdateParams, + TrueClientIPHeaderEditParams, TrueClientIPHeader, } from './true-client-ip-header'; -export { WAFUpdateResponse, WAFGetResponse, WAFUpdateParams, WAF } from './waf'; -export { WebpUpdateResponse, WebpGetResponse, WebpUpdateParams, Webp } from './webp'; -export { WebsocketUpdateResponse, WebsocketGetResponse, WebsocketUpdateParams, Websocket } from './websocket'; -export { ZeroRttUpdateResponse, ZeroRttGetResponse, ZeroRttUpdateParams, ZeroRtt } from './zero-rtt'; +export { WAFEditResponse, WAFGetResponse, WAFEditParams, WAF } from './waf'; +export { WebpEditResponse, WebpGetResponse, WebpEditParams, Webp } from './webp'; +export { WebsocketEditResponse, WebsocketGetResponse, WebsocketEditParams, Websocket } from './websocket'; +export { ZeroRttEditResponse, ZeroRttGetResponse, ZeroRttEditParams, ZeroRtt } from './zero-rtt'; diff --git a/src/resources/settings/ip-geolocation.ts b/src/resources/settings/ip-geolocation.ts index 736f6879bf..b46c6dc327 100644 --- a/src/resources/settings/ip-geolocation.ts +++ b/src/resources/settings/ip-geolocation.ts @@ -10,16 +10,16 @@ export class IPGeolocation extends APIResource { * pass the country code to you. * (https://support.cloudflare.com/hc/en-us/articles/200168236). */ - update( + edit( zoneId: string, - body: IPGeolocationUpdateParams, + body: IPGeolocationEditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.patch(`/zones/${zoneId}/settings/ip_geolocation`, { body, ...options, - }) as Core.APIPromise<{ result: IPGeolocationUpdateResponse }> + }) as Core.APIPromise<{ result: IPGeolocationEditResponse }> )._thenUnwrap((obj) => obj.result); } @@ -42,7 +42,7 @@ export class IPGeolocation extends APIResource { * pass the country code to you. * (https://support.cloudflare.com/hc/en-us/articles/200168236). */ -export interface IPGeolocationUpdateResponse { +export interface IPGeolocationEditResponse { /** * ID of the zone setting. */ @@ -93,7 +93,7 @@ export interface IPGeolocationGetResponse { modified_on?: string | null; } -export interface IPGeolocationUpdateParams { +export interface IPGeolocationEditParams { /** * Value of the zone setting. */ @@ -101,7 +101,7 @@ export interface IPGeolocationUpdateParams { } export namespace IPGeolocation { - export import IPGeolocationUpdateResponse = IPGeolocationAPI.IPGeolocationUpdateResponse; + export import IPGeolocationEditResponse = IPGeolocationAPI.IPGeolocationEditResponse; export import IPGeolocationGetResponse = IPGeolocationAPI.IPGeolocationGetResponse; - export import IPGeolocationUpdateParams = IPGeolocationAPI.IPGeolocationUpdateParams; + export import IPGeolocationEditParams = IPGeolocationAPI.IPGeolocationEditParams; } diff --git a/src/resources/settings/ipv6.ts b/src/resources/settings/ipv6.ts index 65d4d1ed8f..a407311553 100644 --- a/src/resources/settings/ipv6.ts +++ b/src/resources/settings/ipv6.ts @@ -9,14 +9,14 @@ export class IPV6 extends APIResource { * Enable IPv6 on all subdomains that are Cloudflare enabled. * (https://support.cloudflare.com/hc/en-us/articles/200168586). */ - update( + edit( zoneId: string, - body: IPV6UpdateParams, + body: IPV6EditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.patch(`/zones/${zoneId}/settings/ipv6`, { body, ...options }) as Core.APIPromise<{ - result: IPV6UpdateResponse; + result: IPV6EditResponse; }> )._thenUnwrap((obj) => obj.result); } @@ -38,7 +38,7 @@ export class IPV6 extends APIResource { * Enable IPv6 on all subdomains that are Cloudflare enabled. * (https://support.cloudflare.com/hc/en-us/articles/200168586). */ -export interface IPV6UpdateResponse { +export interface IPV6EditResponse { /** * ID of the zone setting. */ @@ -88,7 +88,7 @@ export interface IPV6GetResponse { modified_on?: string | null; } -export interface IPV6UpdateParams { +export interface IPV6EditParams { /** * Value of the zone setting. */ @@ -96,7 +96,7 @@ export interface IPV6UpdateParams { } export namespace IPV6 { - export import IPV6UpdateResponse = IPV6API.IPV6UpdateResponse; + export import IPV6EditResponse = IPV6API.IPV6EditResponse; export import IPV6GetResponse = IPV6API.IPV6GetResponse; - export import IPV6UpdateParams = IPV6API.IPV6UpdateParams; + export import IPV6EditParams = IPV6API.IPV6EditParams; } diff --git a/src/resources/settings/min-tls-version.ts b/src/resources/settings/min-tls-version.ts index 2ef55cdd81..ba1c657ea9 100644 --- a/src/resources/settings/min-tls-version.ts +++ b/src/resources/settings/min-tls-version.ts @@ -8,16 +8,16 @@ export class MinTLSVersion extends APIResource { /** * Changes Minimum TLS Version setting. */ - update( + edit( zoneId: string, - body: MinTLSVersionUpdateParams, + body: MinTLSVersionEditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.patch(`/zones/${zoneId}/settings/min_tls_version`, { body, ...options, - }) as Core.APIPromise<{ result: MinTLSVersionUpdateResponse }> + }) as Core.APIPromise<{ result: MinTLSVersionEditResponse }> )._thenUnwrap((obj) => obj.result); } @@ -38,7 +38,7 @@ export class MinTLSVersion extends APIResource { * specified. For example, if TLS 1.1 is selected, TLS 1.0 connections will be * rejected, while 1.1, 1.2, and 1.3 (if enabled) will be permitted. */ -export interface MinTLSVersionUpdateResponse { +export interface MinTLSVersionEditResponse { /** * ID of the zone setting. */ @@ -89,7 +89,7 @@ export interface MinTLSVersionGetResponse { modified_on?: string | null; } -export interface MinTLSVersionUpdateParams { +export interface MinTLSVersionEditParams { /** * Value of the zone setting. */ @@ -97,7 +97,7 @@ export interface MinTLSVersionUpdateParams { } export namespace MinTLSVersion { - export import MinTLSVersionUpdateResponse = MinTLSVersionAPI.MinTLSVersionUpdateResponse; + export import MinTLSVersionEditResponse = MinTLSVersionAPI.MinTLSVersionEditResponse; export import MinTLSVersionGetResponse = MinTLSVersionAPI.MinTLSVersionGetResponse; - export import MinTLSVersionUpdateParams = MinTLSVersionAPI.MinTLSVersionUpdateParams; + export import MinTLSVersionEditParams = MinTLSVersionAPI.MinTLSVersionEditParams; } diff --git a/src/resources/settings/minify.ts b/src/resources/settings/minify.ts index af5267809e..d8bef7d780 100644 --- a/src/resources/settings/minify.ts +++ b/src/resources/settings/minify.ts @@ -10,14 +10,14 @@ export class Minify extends APIResource { * [Using Cloudflare Auto Minify](https://support.cloudflare.com/hc/en-us/articles/200168196) * for more information. */ - update( + edit( zoneId: string, - body: MinifyUpdateParams, + body: MinifyEditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.patch(`/zones/${zoneId}/settings/minify`, { body, ...options }) as Core.APIPromise<{ - result: MinifyUpdateResponse; + result: MinifyEditResponse; }> )._thenUnwrap((obj) => obj.result); } @@ -41,7 +41,7 @@ export class Minify extends APIResource { * [Using Cloudflare Auto Minify](https://support.cloudflare.com/hc/en-us/articles/200168196) * for more information. */ -export interface MinifyUpdateResponse { +export interface MinifyEditResponse { /** * Zone setting identifier. */ @@ -50,7 +50,7 @@ export interface MinifyUpdateResponse { /** * Current value of the zone setting. */ - value: MinifyUpdateResponse.Value; + value: MinifyEditResponse.Value; /** * Whether or not this setting can be modified for this zone (based on your @@ -64,7 +64,7 @@ export interface MinifyUpdateResponse { modified_on?: string | null; } -export namespace MinifyUpdateResponse { +export namespace MinifyEditResponse { /** * Current value of the zone setting. */ @@ -136,14 +136,14 @@ export namespace MinifyGetResponse { } } -export interface MinifyUpdateParams { +export interface MinifyEditParams { /** * Value of the zone setting. */ - value: MinifyUpdateParams.Value; + value: MinifyEditParams.Value; } -export namespace MinifyUpdateParams { +export namespace MinifyEditParams { /** * Value of the zone setting. */ @@ -166,7 +166,7 @@ export namespace MinifyUpdateParams { } export namespace Minify { - export import MinifyUpdateResponse = MinifyAPI.MinifyUpdateResponse; + export import MinifyEditResponse = MinifyAPI.MinifyEditResponse; export import MinifyGetResponse = MinifyAPI.MinifyGetResponse; - export import MinifyUpdateParams = MinifyAPI.MinifyUpdateParams; + export import MinifyEditParams = MinifyAPI.MinifyEditParams; } diff --git a/src/resources/settings/mirage.ts b/src/resources/settings/mirage.ts index 395adfc44c..592ccf8d8c 100644 --- a/src/resources/settings/mirage.ts +++ b/src/resources/settings/mirage.ts @@ -11,14 +11,14 @@ export class Mirage extends APIResource { * [blog post](http://blog.cloudflare.com/mirage2-solving-mobile-speed) for more * information. */ - update( + edit( zoneId: string, - body: MirageUpdateParams, + body: MirageEditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.patch(`/zones/${zoneId}/settings/mirage`, { body, ...options }) as Core.APIPromise<{ - result: MirageUpdateResponse; + result: MirageEditResponse; }> )._thenUnwrap((obj) => obj.result); } @@ -44,7 +44,7 @@ export class Mirage extends APIResource { * [our blog post](http://blog.cloudflare.com/mirage2-solving-mobile-speed) for * more information. */ -export interface MirageUpdateResponse { +export interface MirageEditResponse { /** * ID of the zone setting. */ @@ -96,7 +96,7 @@ export interface MirageGetResponse { modified_on?: string | null; } -export interface MirageUpdateParams { +export interface MirageEditParams { /** * Value of the zone setting. */ @@ -104,7 +104,7 @@ export interface MirageUpdateParams { } export namespace Mirage { - export import MirageUpdateResponse = MirageAPI.MirageUpdateResponse; + export import MirageEditResponse = MirageAPI.MirageEditResponse; export import MirageGetResponse = MirageAPI.MirageGetResponse; - export import MirageUpdateParams = MirageAPI.MirageUpdateParams; + export import MirageEditParams = MirageAPI.MirageEditParams; } diff --git a/src/resources/settings/mobile-redirect.ts b/src/resources/settings/mobile-redirect.ts index cf310b9eaa..55c8e829df 100644 --- a/src/resources/settings/mobile-redirect.ts +++ b/src/resources/settings/mobile-redirect.ts @@ -11,16 +11,16 @@ export class MobileRedirect extends APIResource { * [Understanding Cloudflare Mobile Redirect](https://support.cloudflare.com/hc/articles/200168336) * for more information. */ - update( + edit( zoneId: string, - body: MobileRedirectUpdateParams, + body: MobileRedirectEditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.patch(`/zones/${zoneId}/settings/mobile_redirect`, { body, ...options, - }) as Core.APIPromise<{ result: MobileRedirectUpdateResponse }> + }) as Core.APIPromise<{ result: MobileRedirectEditResponse }> )._thenUnwrap((obj) => obj.result); } @@ -45,7 +45,7 @@ export class MobileRedirect extends APIResource { * [Understanding Cloudflare Mobile Redirect](https://support.cloudflare.com/hc/articles/200168336) * for more information. */ -export interface MobileRedirectUpdateResponse { +export interface MobileRedirectEditResponse { /** * Identifier of the zone setting. */ @@ -54,7 +54,7 @@ export interface MobileRedirectUpdateResponse { /** * Current value of the zone setting. */ - value: MobileRedirectUpdateResponse.Value; + value: MobileRedirectEditResponse.Value; /** * Whether or not this setting can be modified for this zone (based on your @@ -68,7 +68,7 @@ export interface MobileRedirectUpdateResponse { modified_on?: string | null; } -export namespace MobileRedirectUpdateResponse { +export namespace MobileRedirectEditResponse { /** * Current value of the zone setting. */ @@ -145,14 +145,14 @@ export namespace MobileRedirectGetResponse { } } -export interface MobileRedirectUpdateParams { +export interface MobileRedirectEditParams { /** * Value of the zone setting. */ - value: MobileRedirectUpdateParams.Value; + value: MobileRedirectEditParams.Value; } -export namespace MobileRedirectUpdateParams { +export namespace MobileRedirectEditParams { /** * Value of the zone setting. */ @@ -177,7 +177,7 @@ export namespace MobileRedirectUpdateParams { } export namespace MobileRedirect { - export import MobileRedirectUpdateResponse = MobileRedirectAPI.MobileRedirectUpdateResponse; + export import MobileRedirectEditResponse = MobileRedirectAPI.MobileRedirectEditResponse; export import MobileRedirectGetResponse = MobileRedirectAPI.MobileRedirectGetResponse; - export import MobileRedirectUpdateParams = MobileRedirectAPI.MobileRedirectUpdateParams; + export import MobileRedirectEditParams = MobileRedirectAPI.MobileRedirectEditParams; } diff --git a/src/resources/settings/nel.ts b/src/resources/settings/nel.ts index 9bc8b6cc0d..ad3dab0404 100644 --- a/src/resources/settings/nel.ts +++ b/src/resources/settings/nel.ts @@ -10,14 +10,10 @@ export class NEL extends APIResource { * Refer to our [blog post](http://blog.cloudflare.com/nel-solving-mobile-speed) * for more information. */ - update( - zoneId: string, - body: NELUpdateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { + edit(zoneId: string, body: NELEditParams, options?: Core.RequestOptions): Core.APIPromise { return ( this._client.patch(`/zones/${zoneId}/settings/nel`, { body, ...options }) as Core.APIPromise<{ - result: NELUpdateResponse; + result: NELEditResponse; }> )._thenUnwrap((obj) => obj.result); } @@ -37,7 +33,7 @@ export class NEL extends APIResource { /** * Enable Network Error Logging reporting on your zone. (Beta) */ -export interface NELUpdateResponse { +export interface NELEditResponse { /** * Zone setting identifier. */ @@ -46,7 +42,7 @@ export interface NELUpdateResponse { /** * Current value of the zone setting. */ - value: NELUpdateResponse.Value; + value: NELEditResponse.Value; /** * Whether or not this setting can be modified for this zone (based on your @@ -60,7 +56,7 @@ export interface NELUpdateResponse { modified_on?: string | null; } -export namespace NELUpdateResponse { +export namespace NELEditResponse { /** * Current value of the zone setting. */ @@ -104,14 +100,14 @@ export namespace NELGetResponse { } } -export interface NELUpdateParams { +export interface NELEditParams { /** * Enable Network Error Logging reporting on your zone. (Beta) */ - value: NELUpdateParams.Value; + value: NELEditParams.Value; } -export namespace NELUpdateParams { +export namespace NELEditParams { /** * Enable Network Error Logging reporting on your zone. (Beta) */ @@ -138,7 +134,7 @@ export namespace NELUpdateParams { } export namespace NEL { - export import NELUpdateResponse = NELAPI.NELUpdateResponse; + export import NELEditResponse = NELAPI.NELEditResponse; export import NELGetResponse = NELAPI.NELGetResponse; - export import NELUpdateParams = NELAPI.NELUpdateParams; + export import NELEditParams = NELAPI.NELEditParams; } diff --git a/src/resources/settings/opportunistic-encryption.ts b/src/resources/settings/opportunistic-encryption.ts index 0737592d72..57a3f63436 100644 --- a/src/resources/settings/opportunistic-encryption.ts +++ b/src/resources/settings/opportunistic-encryption.ts @@ -8,16 +8,16 @@ export class OpportunisticEncryption extends APIResource { /** * Changes Opportunistic Encryption setting. */ - update( + edit( zoneId: string, - body: OpportunisticEncryptionUpdateParams, + body: OpportunisticEncryptionEditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.patch(`/zones/${zoneId}/settings/opportunistic_encryption`, { body, ...options, - }) as Core.APIPromise<{ result: OpportunisticEncryptionUpdateResponse }> + }) as Core.APIPromise<{ result: OpportunisticEncryptionEditResponse }> )._thenUnwrap((obj) => obj.result); } @@ -36,7 +36,7 @@ export class OpportunisticEncryption extends APIResource { /** * Enables the Opportunistic Encryption feature for a zone. */ -export interface OpportunisticEncryptionUpdateResponse { +export interface OpportunisticEncryptionEditResponse { /** * ID of the zone setting. */ @@ -85,7 +85,7 @@ export interface OpportunisticEncryptionGetResponse { modified_on?: string | null; } -export interface OpportunisticEncryptionUpdateParams { +export interface OpportunisticEncryptionEditParams { /** * Value of the zone setting. Notes: Default value depends on the zone's plan * level. @@ -94,7 +94,7 @@ export interface OpportunisticEncryptionUpdateParams { } export namespace OpportunisticEncryption { - export import OpportunisticEncryptionUpdateResponse = OpportunisticEncryptionAPI.OpportunisticEncryptionUpdateResponse; + export import OpportunisticEncryptionEditResponse = OpportunisticEncryptionAPI.OpportunisticEncryptionEditResponse; export import OpportunisticEncryptionGetResponse = OpportunisticEncryptionAPI.OpportunisticEncryptionGetResponse; - export import OpportunisticEncryptionUpdateParams = OpportunisticEncryptionAPI.OpportunisticEncryptionUpdateParams; + export import OpportunisticEncryptionEditParams = OpportunisticEncryptionAPI.OpportunisticEncryptionEditParams; } diff --git a/src/resources/settings/opportunistic-onion.ts b/src/resources/settings/opportunistic-onion.ts index 694ef12df6..564abb45b0 100644 --- a/src/resources/settings/opportunistic-onion.ts +++ b/src/resources/settings/opportunistic-onion.ts @@ -9,16 +9,16 @@ export class OpportunisticOnion extends APIResource { * Add an Alt-Svc header to all legitimate requests from Tor, allowing the * connection to use our onion services instead of exit nodes. */ - update( + edit( zoneId: string, - body: OpportunisticOnionUpdateParams, + body: OpportunisticOnionEditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.patch(`/zones/${zoneId}/settings/opportunistic_onion`, { body, ...options, - }) as Core.APIPromise<{ result: OpportunisticOnionUpdateResponse }> + }) as Core.APIPromise<{ result: OpportunisticOnionEditResponse }> )._thenUnwrap((obj) => obj.result); } @@ -39,7 +39,7 @@ export class OpportunisticOnion extends APIResource { * Add an Alt-Svc header to all legitimate requests from Tor, allowing the * connection to use our onion services instead of exit nodes. */ -export interface OpportunisticOnionUpdateResponse { +export interface OpportunisticOnionEditResponse { /** * ID of the zone setting. */ @@ -89,7 +89,7 @@ export interface OpportunisticOnionGetResponse { modified_on?: string | null; } -export interface OpportunisticOnionUpdateParams { +export interface OpportunisticOnionEditParams { /** * Value of the zone setting. Notes: Default value depends on the zone's plan * level. @@ -98,7 +98,7 @@ export interface OpportunisticOnionUpdateParams { } export namespace OpportunisticOnion { - export import OpportunisticOnionUpdateResponse = OpportunisticOnionAPI.OpportunisticOnionUpdateResponse; + export import OpportunisticOnionEditResponse = OpportunisticOnionAPI.OpportunisticOnionEditResponse; export import OpportunisticOnionGetResponse = OpportunisticOnionAPI.OpportunisticOnionGetResponse; - export import OpportunisticOnionUpdateParams = OpportunisticOnionAPI.OpportunisticOnionUpdateParams; + export import OpportunisticOnionEditParams = OpportunisticOnionAPI.OpportunisticOnionEditParams; } diff --git a/src/resources/settings/orange-to-orange.ts b/src/resources/settings/orange-to-orange.ts index 1cef3657b0..d209246f3f 100644 --- a/src/resources/settings/orange-to-orange.ts +++ b/src/resources/settings/orange-to-orange.ts @@ -9,16 +9,16 @@ export class OrangeToOrange extends APIResource { * Orange to Orange (O2O) allows zones on Cloudflare to CNAME to other zones also * on Cloudflare. */ - update( + edit( zoneId: string, - body: OrangeToOrangeUpdateParams, + body: OrangeToOrangeEditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.patch(`/zones/${zoneId}/settings/orange_to_orange`, { body, ...options, - }) as Core.APIPromise<{ result: OrangeToOrangeUpdateResponse }> + }) as Core.APIPromise<{ result: OrangeToOrangeEditResponse }> )._thenUnwrap((obj) => obj.result); } @@ -39,7 +39,7 @@ export class OrangeToOrange extends APIResource { * Orange to Orange (O2O) allows zones on Cloudflare to CNAME to other zones also * on Cloudflare. */ -export interface OrangeToOrangeUpdateResponse { +export interface OrangeToOrangeEditResponse { /** * ID of the zone setting. */ @@ -89,15 +89,15 @@ export interface OrangeToOrangeGetResponse { modified_on?: string | null; } -export interface OrangeToOrangeUpdateParams { +export interface OrangeToOrangeEditParams { /** * Orange to Orange (O2O) allows zones on Cloudflare to CNAME to other zones also * on Cloudflare. */ - value: OrangeToOrangeUpdateParams.Value; + value: OrangeToOrangeEditParams.Value; } -export namespace OrangeToOrangeUpdateParams { +export namespace OrangeToOrangeEditParams { /** * Orange to Orange (O2O) allows zones on Cloudflare to CNAME to other zones also * on Cloudflare. @@ -116,7 +116,7 @@ export namespace OrangeToOrangeUpdateParams { } export namespace OrangeToOrange { - export import OrangeToOrangeUpdateResponse = OrangeToOrangeAPI.OrangeToOrangeUpdateResponse; + export import OrangeToOrangeEditResponse = OrangeToOrangeAPI.OrangeToOrangeEditResponse; export import OrangeToOrangeGetResponse = OrangeToOrangeAPI.OrangeToOrangeGetResponse; - export import OrangeToOrangeUpdateParams = OrangeToOrangeAPI.OrangeToOrangeUpdateParams; + export import OrangeToOrangeEditParams = OrangeToOrangeAPI.OrangeToOrangeEditParams; } diff --git a/src/resources/settings/origin-error-page-pass-thru.ts b/src/resources/settings/origin-error-page-pass-thru.ts index f8201f9336..2fc84391cd 100644 --- a/src/resources/settings/origin-error-page-pass-thru.ts +++ b/src/resources/settings/origin-error-page-pass-thru.ts @@ -10,16 +10,16 @@ export class OriginErrorPagePassThru extends APIResource { * server instead of showing a default Cloudflare error page. This does not apply * to 522 errors and is limited to Enterprise Zones. */ - update( + edit( zoneId: string, - body: OriginErrorPagePassThruUpdateParams, + body: OriginErrorPagePassThruEditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.patch(`/zones/${zoneId}/settings/origin_error_page_pass_thru`, { body, ...options, - }) as Core.APIPromise<{ result: OriginErrorPagePassThruUpdateResponse }> + }) as Core.APIPromise<{ result: OriginErrorPagePassThruEditResponse }> )._thenUnwrap((obj) => obj.result); } @@ -42,7 +42,7 @@ export class OriginErrorPagePassThru extends APIResource { * server instead of showing a default Cloudflare error page. This does not apply * to 522 errors and is limited to Enterprise Zones. */ -export interface OriginErrorPagePassThruUpdateResponse { +export interface OriginErrorPagePassThruEditResponse { /** * ID of the zone setting. */ @@ -93,7 +93,7 @@ export interface OriginErrorPagePassThruGetResponse { modified_on?: string | null; } -export interface OriginErrorPagePassThruUpdateParams { +export interface OriginErrorPagePassThruEditParams { /** * Value of the zone setting. */ @@ -101,7 +101,7 @@ export interface OriginErrorPagePassThruUpdateParams { } export namespace OriginErrorPagePassThru { - export import OriginErrorPagePassThruUpdateResponse = OriginErrorPagePassThruAPI.OriginErrorPagePassThruUpdateResponse; + export import OriginErrorPagePassThruEditResponse = OriginErrorPagePassThruAPI.OriginErrorPagePassThruEditResponse; export import OriginErrorPagePassThruGetResponse = OriginErrorPagePassThruAPI.OriginErrorPagePassThruGetResponse; - export import OriginErrorPagePassThruUpdateParams = OriginErrorPagePassThruAPI.OriginErrorPagePassThruUpdateParams; + export import OriginErrorPagePassThruEditParams = OriginErrorPagePassThruAPI.OriginErrorPagePassThruEditParams; } diff --git a/src/resources/settings/origin-max-http-version.ts b/src/resources/settings/origin-max-http-version.ts index a9e1bc00b6..81cdbfbcc9 100644 --- a/src/resources/settings/origin-max-http-version.ts +++ b/src/resources/settings/origin-max-http-version.ts @@ -13,16 +13,16 @@ export class OriginMaxHTTPVersion extends APIResource { * for more information.). The default value is "2" for all plan types except ENT * where it is "1" */ - update( + edit( zoneId: string, - body: OriginMaxHTTPVersionUpdateParams, + body: OriginMaxHTTPVersionEditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.patch(`/zones/${zoneId}/settings/origin_max_http_version`, { body, ...options, - }) as Core.APIPromise<{ result: OriginMaxHTTPVersionUpdateResponse }> + }) as Core.APIPromise<{ result: OriginMaxHTTPVersionEditResponse }> )._thenUnwrap((obj) => obj.result); } @@ -51,7 +51,7 @@ export class OriginMaxHTTPVersion extends APIResource { * for more information.). The default value is "2" for all plan types except ENT * where it is "1" */ -export interface OriginMaxHTTPVersionUpdateResponse { +export interface OriginMaxHTTPVersionEditResponse { /** * Value of the zone setting. */ @@ -93,7 +93,7 @@ export interface OriginMaxHTTPVersionGetResponse { value: '2' | '1'; } -export interface OriginMaxHTTPVersionUpdateParams { +export interface OriginMaxHTTPVersionEditParams { /** * Value of the Origin Max HTTP Version Setting. */ @@ -101,7 +101,7 @@ export interface OriginMaxHTTPVersionUpdateParams { } export namespace OriginMaxHTTPVersion { - export import OriginMaxHTTPVersionUpdateResponse = OriginMaxHTTPVersionAPI.OriginMaxHTTPVersionUpdateResponse; + export import OriginMaxHTTPVersionEditResponse = OriginMaxHTTPVersionAPI.OriginMaxHTTPVersionEditResponse; export import OriginMaxHTTPVersionGetResponse = OriginMaxHTTPVersionAPI.OriginMaxHTTPVersionGetResponse; - export import OriginMaxHTTPVersionUpdateParams = OriginMaxHTTPVersionAPI.OriginMaxHTTPVersionUpdateParams; + export import OriginMaxHTTPVersionEditParams = OriginMaxHTTPVersionAPI.OriginMaxHTTPVersionEditParams; } diff --git a/src/resources/settings/polish.ts b/src/resources/settings/polish.ts index c340255c40..261a259d03 100644 --- a/src/resources/settings/polish.ts +++ b/src/resources/settings/polish.ts @@ -10,14 +10,14 @@ export class Polish extends APIResource { * Refer to our [blog post](http://blog.cloudflare.com/polish-solving-mobile-speed) * for more information. */ - update( + edit( zoneId: string, - body: PolishUpdateParams, + body: PolishEditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.patch(`/zones/${zoneId}/settings/polish`, { body, ...options }) as Core.APIPromise<{ - result: PolishUpdateResponse; + result: PolishEditResponse; }> )._thenUnwrap((obj) => obj.result); } @@ -44,7 +44,7 @@ export class Polish extends APIResource { * lower-resolution image first and ending in a higher-resolution version. Not * recommended for hi-res photography sites. */ -export interface PolishUpdateResponse { +export interface PolishEditResponse { /** * ID of the zone setting. */ @@ -98,7 +98,7 @@ export interface PolishGetResponse { modified_on?: string | null; } -export interface PolishUpdateParams { +export interface PolishEditParams { /** * Removes metadata and compresses your images for faster page load times. Basic * (Lossless): Reduce the size of PNG, JPEG, and GIF files - no impact on visual @@ -107,10 +107,10 @@ export interface PolishUpdateParams { * lower-resolution image first and ending in a higher-resolution version. Not * recommended for hi-res photography sites. */ - value: PolishUpdateParams.Value; + value: PolishEditParams.Value; } -export namespace PolishUpdateParams { +export namespace PolishEditParams { /** * Removes metadata and compresses your images for faster page load times. Basic * (Lossless): Reduce the size of PNG, JPEG, and GIF files - no impact on visual @@ -133,7 +133,7 @@ export namespace PolishUpdateParams { } export namespace Polish { - export import PolishUpdateResponse = PolishAPI.PolishUpdateResponse; + export import PolishEditResponse = PolishAPI.PolishEditResponse; export import PolishGetResponse = PolishAPI.PolishGetResponse; - export import PolishUpdateParams = PolishAPI.PolishUpdateParams; + export import PolishEditParams = PolishAPI.PolishEditParams; } diff --git a/src/resources/settings/prefetch-preload.ts b/src/resources/settings/prefetch-preload.ts index bba8eb24c8..5124c59c17 100644 --- a/src/resources/settings/prefetch-preload.ts +++ b/src/resources/settings/prefetch-preload.ts @@ -9,16 +9,16 @@ export class PrefetchPreload extends APIResource { * Cloudflare will prefetch any URLs that are included in the response headers. * This is limited to Enterprise Zones. */ - update( + edit( zoneId: string, - body: PrefetchPreloadUpdateParams, + body: PrefetchPreloadEditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.patch(`/zones/${zoneId}/settings/prefetch_preload`, { body, ...options, - }) as Core.APIPromise<{ result: PrefetchPreloadUpdateResponse }> + }) as Core.APIPromise<{ result: PrefetchPreloadEditResponse }> )._thenUnwrap((obj) => obj.result); } @@ -39,7 +39,7 @@ export class PrefetchPreload extends APIResource { * Cloudflare will prefetch any URLs that are included in the response headers. * This is limited to Enterprise Zones. */ -export interface PrefetchPreloadUpdateResponse { +export interface PrefetchPreloadEditResponse { /** * ID of the zone setting. */ @@ -89,7 +89,7 @@ export interface PrefetchPreloadGetResponse { modified_on?: string | null; } -export interface PrefetchPreloadUpdateParams { +export interface PrefetchPreloadEditParams { /** * Value of the zone setting. */ @@ -97,7 +97,7 @@ export interface PrefetchPreloadUpdateParams { } export namespace PrefetchPreload { - export import PrefetchPreloadUpdateResponse = PrefetchPreloadAPI.PrefetchPreloadUpdateResponse; + export import PrefetchPreloadEditResponse = PrefetchPreloadAPI.PrefetchPreloadEditResponse; export import PrefetchPreloadGetResponse = PrefetchPreloadAPI.PrefetchPreloadGetResponse; - export import PrefetchPreloadUpdateParams = PrefetchPreloadAPI.PrefetchPreloadUpdateParams; + export import PrefetchPreloadEditParams = PrefetchPreloadAPI.PrefetchPreloadEditParams; } diff --git a/src/resources/settings/proxy-read-timeout.ts b/src/resources/settings/proxy-read-timeout.ts index 6f4cd8ac29..bc1e87e5f0 100644 --- a/src/resources/settings/proxy-read-timeout.ts +++ b/src/resources/settings/proxy-read-timeout.ts @@ -8,16 +8,16 @@ export class ProxyReadTimeout extends APIResource { /** * Maximum time between two read operations from origin. */ - update( + edit( zoneId: string, - body: ProxyReadTimeoutUpdateParams, + body: ProxyReadTimeoutEditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.patch(`/zones/${zoneId}/settings/proxy_read_timeout`, { body, ...options, - }) as Core.APIPromise<{ result: ProxyReadTimeoutUpdateResponse }> + }) as Core.APIPromise<{ result: ProxyReadTimeoutEditResponse }> )._thenUnwrap((obj) => obj.result); } @@ -36,7 +36,7 @@ export class ProxyReadTimeout extends APIResource { /** * Maximum time between two read operations from origin. */ -export interface ProxyReadTimeoutUpdateResponse { +export interface ProxyReadTimeoutEditResponse { /** * ID of the zone setting. */ @@ -85,14 +85,14 @@ export interface ProxyReadTimeoutGetResponse { modified_on?: string | null; } -export interface ProxyReadTimeoutUpdateParams { +export interface ProxyReadTimeoutEditParams { /** * Maximum time between two read operations from origin. */ - value: ProxyReadTimeoutUpdateParams.Value; + value: ProxyReadTimeoutEditParams.Value; } -export namespace ProxyReadTimeoutUpdateParams { +export namespace ProxyReadTimeoutEditParams { /** * Maximum time between two read operations from origin. */ @@ -110,7 +110,7 @@ export namespace ProxyReadTimeoutUpdateParams { } export namespace ProxyReadTimeout { - export import ProxyReadTimeoutUpdateResponse = ProxyReadTimeoutAPI.ProxyReadTimeoutUpdateResponse; + export import ProxyReadTimeoutEditResponse = ProxyReadTimeoutAPI.ProxyReadTimeoutEditResponse; export import ProxyReadTimeoutGetResponse = ProxyReadTimeoutAPI.ProxyReadTimeoutGetResponse; - export import ProxyReadTimeoutUpdateParams = ProxyReadTimeoutAPI.ProxyReadTimeoutUpdateParams; + export import ProxyReadTimeoutEditParams = ProxyReadTimeoutAPI.ProxyReadTimeoutEditParams; } diff --git a/src/resources/settings/pseudo-ipv4.ts b/src/resources/settings/pseudo-ipv4.ts index b966cab6af..b3142861e3 100644 --- a/src/resources/settings/pseudo-ipv4.ts +++ b/src/resources/settings/pseudo-ipv4.ts @@ -8,14 +8,14 @@ export class PseudoIPV4 extends APIResource { /** * Value of the Pseudo IPv4 setting. */ - update( + edit( zoneId: string, - body: PseudoIPV4UpdateParams, + body: PseudoIPV4EditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.patch(`/zones/${zoneId}/settings/pseudo_ipv4`, { body, ...options }) as Core.APIPromise<{ - result: PseudoIPV4UpdateResponse; + result: PseudoIPV4EditResponse; }> )._thenUnwrap((obj) => obj.result); } @@ -35,7 +35,7 @@ export class PseudoIPV4 extends APIResource { /** * The value set for the Pseudo IPv4 setting. */ -export interface PseudoIPV4UpdateResponse { +export interface PseudoIPV4EditResponse { /** * Value of the Pseudo IPv4 setting. */ @@ -84,7 +84,7 @@ export interface PseudoIPV4GetResponse { modified_on?: string | null; } -export interface PseudoIPV4UpdateParams { +export interface PseudoIPV4EditParams { /** * Value of the Pseudo IPv4 setting. */ @@ -92,7 +92,7 @@ export interface PseudoIPV4UpdateParams { } export namespace PseudoIPV4 { - export import PseudoIPV4UpdateResponse = PseudoIPV4API.PseudoIPV4UpdateResponse; + export import PseudoIPV4EditResponse = PseudoIPV4API.PseudoIPV4EditResponse; export import PseudoIPV4GetResponse = PseudoIPV4API.PseudoIPV4GetResponse; - export import PseudoIPV4UpdateParams = PseudoIPV4API.PseudoIPV4UpdateParams; + export import PseudoIPV4EditParams = PseudoIPV4API.PseudoIPV4EditParams; } diff --git a/src/resources/settings/response-buffering.ts b/src/resources/settings/response-buffering.ts index ab6698a04f..c6c1fc7872 100644 --- a/src/resources/settings/response-buffering.ts +++ b/src/resources/settings/response-buffering.ts @@ -11,16 +11,16 @@ export class ResponseBuffering extends APIResource { * it to be delivered in chunks. By default, the proxied server streams directly * and is not buffered by Cloudflare. This is limited to Enterprise Zones. */ - update( + edit( zoneId: string, - body: ResponseBufferingUpdateParams, + body: ResponseBufferingEditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.patch(`/zones/${zoneId}/settings/response_buffering`, { body, ...options, - }) as Core.APIPromise<{ result: ResponseBufferingUpdateResponse }> + }) as Core.APIPromise<{ result: ResponseBufferingEditResponse }> )._thenUnwrap((obj) => obj.result); } @@ -45,7 +45,7 @@ export class ResponseBuffering extends APIResource { * it to be delivered in chunks. By default, the proxied server streams directly * and is not buffered by Cloudflare. This is limited to Enterprise Zones. */ -export interface ResponseBufferingUpdateResponse { +export interface ResponseBufferingEditResponse { /** * ID of the zone setting. */ @@ -97,7 +97,7 @@ export interface ResponseBufferingGetResponse { modified_on?: string | null; } -export interface ResponseBufferingUpdateParams { +export interface ResponseBufferingEditParams { /** * Value of the zone setting. */ @@ -105,7 +105,7 @@ export interface ResponseBufferingUpdateParams { } export namespace ResponseBuffering { - export import ResponseBufferingUpdateResponse = ResponseBufferingAPI.ResponseBufferingUpdateResponse; + export import ResponseBufferingEditResponse = ResponseBufferingAPI.ResponseBufferingEditResponse; export import ResponseBufferingGetResponse = ResponseBufferingAPI.ResponseBufferingGetResponse; - export import ResponseBufferingUpdateParams = ResponseBufferingAPI.ResponseBufferingUpdateParams; + export import ResponseBufferingEditParams = ResponseBufferingAPI.ResponseBufferingEditParams; } diff --git a/src/resources/settings/rocket-loader.ts b/src/resources/settings/rocket-loader.ts index deea35f241..a2dd5a6969 100644 --- a/src/resources/settings/rocket-loader.ts +++ b/src/resources/settings/rocket-loader.ts @@ -17,14 +17,14 @@ export class RocketLoader extends APIResource { * [Understanding Rocket Loader](https://support.cloudflare.com/hc/articles/200168056) * for more information. */ - update( + edit( zoneId: string, - body: RocketLoaderUpdateParams, + body: RocketLoaderEditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.patch(`/zones/${zoneId}/settings/rocket_loader`, { body, ...options }) as Core.APIPromise<{ - result: RocketLoaderUpdateResponse; + result: RocketLoaderEditResponse; }> )._thenUnwrap((obj) => obj.result); } @@ -62,7 +62,7 @@ export class RocketLoader extends APIResource { * [Understanding Rocket Loader](https://support.cloudflare.com/hc/articles/200168056) * for more information. */ -export interface RocketLoaderUpdateResponse { +export interface RocketLoaderEditResponse { /** * ID of the zone setting. */ @@ -120,7 +120,7 @@ export interface RocketLoaderGetResponse { modified_on?: string | null; } -export interface RocketLoaderUpdateParams { +export interface RocketLoaderEditParams { /** * Rocket Loader is a general-purpose asynchronous JavaScript optimisation that * prioritises rendering your content while loading your site's Javascript @@ -133,10 +133,10 @@ export interface RocketLoaderUpdateParams { * [Understanding Rocket Loader](https://support.cloudflare.com/hc/articles/200168056) * for more information. */ - value: RocketLoaderUpdateParams.Value; + value: RocketLoaderEditParams.Value; } -export namespace RocketLoaderUpdateParams { +export namespace RocketLoaderEditParams { /** * Rocket Loader is a general-purpose asynchronous JavaScript optimisation that * prioritises rendering your content while loading your site's Javascript @@ -163,7 +163,7 @@ export namespace RocketLoaderUpdateParams { } export namespace RocketLoader { - export import RocketLoaderUpdateResponse = RocketLoaderAPI.RocketLoaderUpdateResponse; + export import RocketLoaderEditResponse = RocketLoaderAPI.RocketLoaderEditResponse; export import RocketLoaderGetResponse = RocketLoaderAPI.RocketLoaderGetResponse; - export import RocketLoaderUpdateParams = RocketLoaderAPI.RocketLoaderUpdateParams; + export import RocketLoaderEditParams = RocketLoaderAPI.RocketLoaderEditParams; } diff --git a/src/resources/settings/security-headers.ts b/src/resources/settings/security-headers.ts index 676979e314..a272d5dc72 100644 --- a/src/resources/settings/security-headers.ts +++ b/src/resources/settings/security-headers.ts @@ -8,16 +8,16 @@ export class SecurityHeaders extends APIResource { /** * Cloudflare security header for a zone. */ - update( + edit( zoneId: string, - body: SecurityHeaderUpdateParams, + body: SecurityHeaderEditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.patch(`/zones/${zoneId}/settings/security_header`, { body, ...options, - }) as Core.APIPromise<{ result: SecurityHeaderUpdateResponse }> + }) as Core.APIPromise<{ result: SecurityHeaderEditResponse }> )._thenUnwrap((obj) => obj.result); } @@ -36,7 +36,7 @@ export class SecurityHeaders extends APIResource { /** * Cloudflare security header for a zone. */ -export interface SecurityHeaderUpdateResponse { +export interface SecurityHeaderEditResponse { /** * ID of the zone's security header. */ @@ -45,7 +45,7 @@ export interface SecurityHeaderUpdateResponse { /** * Current value of the zone setting. */ - value: SecurityHeaderUpdateResponse.Value; + value: SecurityHeaderEditResponse.Value; /** * Whether or not this setting can be modified for this zone (based on your @@ -59,7 +59,7 @@ export interface SecurityHeaderUpdateResponse { modified_on?: string | null; } -export namespace SecurityHeaderUpdateResponse { +export namespace SecurityHeaderEditResponse { /** * Current value of the zone setting. */ @@ -163,11 +163,11 @@ export namespace SecurityHeaderGetResponse { } } -export interface SecurityHeaderUpdateParams { - value: SecurityHeaderUpdateParams.Value; +export interface SecurityHeaderEditParams { + value: SecurityHeaderEditParams.Value; } -export namespace SecurityHeaderUpdateParams { +export namespace SecurityHeaderEditParams { export interface Value { /** * Strict Transport Security. @@ -204,7 +204,7 @@ export namespace SecurityHeaderUpdateParams { } export namespace SecurityHeaders { - export import SecurityHeaderUpdateResponse = SecurityHeadersAPI.SecurityHeaderUpdateResponse; + export import SecurityHeaderEditResponse = SecurityHeadersAPI.SecurityHeaderEditResponse; export import SecurityHeaderGetResponse = SecurityHeadersAPI.SecurityHeaderGetResponse; - export import SecurityHeaderUpdateParams = SecurityHeadersAPI.SecurityHeaderUpdateParams; + export import SecurityHeaderEditParams = SecurityHeadersAPI.SecurityHeaderEditParams; } diff --git a/src/resources/settings/security-level.ts b/src/resources/settings/security-level.ts index b16231cbe9..a7eae82f65 100644 --- a/src/resources/settings/security-level.ts +++ b/src/resources/settings/security-level.ts @@ -11,16 +11,16 @@ export class SecurityLevel extends APIResource { * an individual security setting, the profile will become Custom. * (https://support.cloudflare.com/hc/en-us/articles/200170056). */ - update( + edit( zoneId: string, - body: SecurityLevelUpdateParams, + body: SecurityLevelEditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.patch(`/zones/${zoneId}/settings/security_level`, { body, ...options, - }) as Core.APIPromise<{ result: SecurityLevelUpdateResponse }> + }) as Core.APIPromise<{ result: SecurityLevelEditResponse }> )._thenUnwrap((obj) => obj.result); } @@ -45,7 +45,7 @@ export class SecurityLevel extends APIResource { * an individual security setting, the profile will become Custom. * (https://support.cloudflare.com/hc/en-us/articles/200170056). */ -export interface SecurityLevelUpdateResponse { +export interface SecurityLevelEditResponse { /** * ID of the zone setting. */ @@ -97,7 +97,7 @@ export interface SecurityLevelGetResponse { modified_on?: string | null; } -export interface SecurityLevelUpdateParams { +export interface SecurityLevelEditParams { /** * Value of the zone setting. */ @@ -105,7 +105,7 @@ export interface SecurityLevelUpdateParams { } export namespace SecurityLevel { - export import SecurityLevelUpdateResponse = SecurityLevelAPI.SecurityLevelUpdateResponse; + export import SecurityLevelEditResponse = SecurityLevelAPI.SecurityLevelEditResponse; export import SecurityLevelGetResponse = SecurityLevelAPI.SecurityLevelGetResponse; - export import SecurityLevelUpdateParams = SecurityLevelAPI.SecurityLevelUpdateParams; + export import SecurityLevelEditParams = SecurityLevelAPI.SecurityLevelEditParams; } diff --git a/src/resources/settings/server-side-excludes.ts b/src/resources/settings/server-side-excludes.ts index 4ee8768d5b..72e6d39098 100644 --- a/src/resources/settings/server-side-excludes.ts +++ b/src/resources/settings/server-side-excludes.ts @@ -18,16 +18,16 @@ export class ServerSideExcludes extends APIResource { * resource moves through our network to the visitor's computer. * (https://support.cloudflare.com/hc/en-us/articles/200170036). */ - update( + edit( zoneId: string, - body: ServerSideExcludeUpdateParams, + body: ServerSideExcludeEditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.patch(`/zones/${zoneId}/settings/server_side_exclude`, { body, ...options, - }) as Core.APIPromise<{ result: ServerSideExcludeUpdateResponse }> + }) as Core.APIPromise<{ result: ServerSideExcludeEditResponse }> )._thenUnwrap((obj) => obj.result); } @@ -66,7 +66,7 @@ export class ServerSideExcludes extends APIResource { * resource moves through our network to the visitor's computer. * (https://support.cloudflare.com/hc/en-us/articles/200170036). */ -export interface ServerSideExcludeUpdateResponse { +export interface ServerSideExcludeEditResponse { /** * ID of the zone setting. */ @@ -125,7 +125,7 @@ export interface ServerSideExcludeGetResponse { modified_on?: string | null; } -export interface ServerSideExcludeUpdateParams { +export interface ServerSideExcludeEditParams { /** * Value of the zone setting. */ @@ -133,7 +133,7 @@ export interface ServerSideExcludeUpdateParams { } export namespace ServerSideExcludes { - export import ServerSideExcludeUpdateResponse = ServerSideExcludesAPI.ServerSideExcludeUpdateResponse; + export import ServerSideExcludeEditResponse = ServerSideExcludesAPI.ServerSideExcludeEditResponse; export import ServerSideExcludeGetResponse = ServerSideExcludesAPI.ServerSideExcludeGetResponse; - export import ServerSideExcludeUpdateParams = ServerSideExcludesAPI.ServerSideExcludeUpdateParams; + export import ServerSideExcludeEditParams = ServerSideExcludesAPI.ServerSideExcludeEditParams; } diff --git a/src/resources/settings/settings.ts b/src/resources/settings/settings.ts index 84fe1d3d07..4efebcfe67 100644 --- a/src/resources/settings/settings.ts +++ b/src/resources/settings/settings.ts @@ -4953,205 +4953,205 @@ export namespace Settings { export import SettingEditResponse = SettingsAPI.SettingEditResponse; export import SettingEditParams = SettingsAPI.SettingEditParams; export import ZeroRtt = ZeroRttAPI.ZeroRtt; - export import ZeroRttUpdateResponse = ZeroRttAPI.ZeroRttUpdateResponse; + export import ZeroRttEditResponse = ZeroRttAPI.ZeroRttEditResponse; export import ZeroRttGetResponse = ZeroRttAPI.ZeroRttGetResponse; - export import ZeroRttUpdateParams = ZeroRttAPI.ZeroRttUpdateParams; + export import ZeroRttEditParams = ZeroRttAPI.ZeroRttEditParams; export import AdvancedDDOS = AdvancedDDOSAPI.AdvancedDDOS; export import AdvancedDDOSGetResponse = AdvancedDDOSAPI.AdvancedDDOSGetResponse; export import AlwaysOnline = AlwaysOnlineAPI.AlwaysOnline; - export import AlwaysOnlineUpdateResponse = AlwaysOnlineAPI.AlwaysOnlineUpdateResponse; + export import AlwaysOnlineEditResponse = AlwaysOnlineAPI.AlwaysOnlineEditResponse; export import AlwaysOnlineGetResponse = AlwaysOnlineAPI.AlwaysOnlineGetResponse; - export import AlwaysOnlineUpdateParams = AlwaysOnlineAPI.AlwaysOnlineUpdateParams; + export import AlwaysOnlineEditParams = AlwaysOnlineAPI.AlwaysOnlineEditParams; export import AlwaysUseHTTPS = AlwaysUseHTTPSAPI.AlwaysUseHTTPS; - export import AlwaysUseHTTPSUpdateResponse = AlwaysUseHTTPSAPI.AlwaysUseHTTPSUpdateResponse; + export import AlwaysUseHTTPSEditResponse = AlwaysUseHTTPSAPI.AlwaysUseHTTPSEditResponse; export import AlwaysUseHTTPSGetResponse = AlwaysUseHTTPSAPI.AlwaysUseHTTPSGetResponse; - export import AlwaysUseHTTPSUpdateParams = AlwaysUseHTTPSAPI.AlwaysUseHTTPSUpdateParams; + export import AlwaysUseHTTPSEditParams = AlwaysUseHTTPSAPI.AlwaysUseHTTPSEditParams; export import AutomaticHTTPSRewrites = AutomaticHTTPSRewritesAPI.AutomaticHTTPSRewrites; - export import AutomaticHTTPSRewriteUpdateResponse = AutomaticHTTPSRewritesAPI.AutomaticHTTPSRewriteUpdateResponse; + export import AutomaticHTTPSRewriteEditResponse = AutomaticHTTPSRewritesAPI.AutomaticHTTPSRewriteEditResponse; export import AutomaticHTTPSRewriteGetResponse = AutomaticHTTPSRewritesAPI.AutomaticHTTPSRewriteGetResponse; - export import AutomaticHTTPSRewriteUpdateParams = AutomaticHTTPSRewritesAPI.AutomaticHTTPSRewriteUpdateParams; + export import AutomaticHTTPSRewriteEditParams = AutomaticHTTPSRewritesAPI.AutomaticHTTPSRewriteEditParams; export import AutomaticPlatformOptimization = AutomaticPlatformOptimizationAPI.AutomaticPlatformOptimization; - export import AutomaticPlatformOptimizationUpdateResponse = AutomaticPlatformOptimizationAPI.AutomaticPlatformOptimizationUpdateResponse; + export import AutomaticPlatformOptimizationEditResponse = AutomaticPlatformOptimizationAPI.AutomaticPlatformOptimizationEditResponse; export import AutomaticPlatformOptimizationGetResponse = AutomaticPlatformOptimizationAPI.AutomaticPlatformOptimizationGetResponse; - export import AutomaticPlatformOptimizationUpdateParams = AutomaticPlatformOptimizationAPI.AutomaticPlatformOptimizationUpdateParams; + export import AutomaticPlatformOptimizationEditParams = AutomaticPlatformOptimizationAPI.AutomaticPlatformOptimizationEditParams; export import Brotli = BrotliAPI.Brotli; - export import BrotliUpdateResponse = BrotliAPI.BrotliUpdateResponse; + export import BrotliEditResponse = BrotliAPI.BrotliEditResponse; export import BrotliGetResponse = BrotliAPI.BrotliGetResponse; - export import BrotliUpdateParams = BrotliAPI.BrotliUpdateParams; + export import BrotliEditParams = BrotliAPI.BrotliEditParams; export import BrowserCacheTTL = BrowserCacheTTLAPI.BrowserCacheTTL; - export import BrowserCacheTTLUpdateResponse = BrowserCacheTTLAPI.BrowserCacheTTLUpdateResponse; + export import BrowserCacheTTLEditResponse = BrowserCacheTTLAPI.BrowserCacheTTLEditResponse; export import BrowserCacheTTLGetResponse = BrowserCacheTTLAPI.BrowserCacheTTLGetResponse; - export import BrowserCacheTTLUpdateParams = BrowserCacheTTLAPI.BrowserCacheTTLUpdateParams; + export import BrowserCacheTTLEditParams = BrowserCacheTTLAPI.BrowserCacheTTLEditParams; export import BrowserCheck = BrowserCheckAPI.BrowserCheck; - export import BrowserCheckUpdateResponse = BrowserCheckAPI.BrowserCheckUpdateResponse; + export import BrowserCheckEditResponse = BrowserCheckAPI.BrowserCheckEditResponse; export import BrowserCheckGetResponse = BrowserCheckAPI.BrowserCheckGetResponse; - export import BrowserCheckUpdateParams = BrowserCheckAPI.BrowserCheckUpdateParams; + export import BrowserCheckEditParams = BrowserCheckAPI.BrowserCheckEditParams; export import CacheLevel = CacheLevelAPI.CacheLevel; - export import CacheLevelUpdateResponse = CacheLevelAPI.CacheLevelUpdateResponse; + export import CacheLevelEditResponse = CacheLevelAPI.CacheLevelEditResponse; export import CacheLevelGetResponse = CacheLevelAPI.CacheLevelGetResponse; - export import CacheLevelUpdateParams = CacheLevelAPI.CacheLevelUpdateParams; + export import CacheLevelEditParams = CacheLevelAPI.CacheLevelEditParams; export import ChallengeTTL = ChallengeTTLAPI.ChallengeTTL; - export import ChallengeTTLUpdateResponse = ChallengeTTLAPI.ChallengeTTLUpdateResponse; + export import ChallengeTTLEditResponse = ChallengeTTLAPI.ChallengeTTLEditResponse; export import ChallengeTTLGetResponse = ChallengeTTLAPI.ChallengeTTLGetResponse; - export import ChallengeTTLUpdateParams = ChallengeTTLAPI.ChallengeTTLUpdateParams; + export import ChallengeTTLEditParams = ChallengeTTLAPI.ChallengeTTLEditParams; export import Ciphers = CiphersAPI.Ciphers; - export import CipherUpdateResponse = CiphersAPI.CipherUpdateResponse; + export import CipherEditResponse = CiphersAPI.CipherEditResponse; export import CipherGetResponse = CiphersAPI.CipherGetResponse; - export import CipherUpdateParams = CiphersAPI.CipherUpdateParams; + export import CipherEditParams = CiphersAPI.CipherEditParams; export import DevelopmentMode = DevelopmentModeAPI.DevelopmentMode; - export import DevelopmentModeUpdateResponse = DevelopmentModeAPI.DevelopmentModeUpdateResponse; + export import DevelopmentModeEditResponse = DevelopmentModeAPI.DevelopmentModeEditResponse; export import DevelopmentModeGetResponse = DevelopmentModeAPI.DevelopmentModeGetResponse; - export import DevelopmentModeUpdateParams = DevelopmentModeAPI.DevelopmentModeUpdateParams; + export import DevelopmentModeEditParams = DevelopmentModeAPI.DevelopmentModeEditParams; export import EarlyHints = EarlyHintsAPI.EarlyHints; - export import EarlyHintUpdateResponse = EarlyHintsAPI.EarlyHintUpdateResponse; + export import EarlyHintEditResponse = EarlyHintsAPI.EarlyHintEditResponse; export import EarlyHintGetResponse = EarlyHintsAPI.EarlyHintGetResponse; - export import EarlyHintUpdateParams = EarlyHintsAPI.EarlyHintUpdateParams; + export import EarlyHintEditParams = EarlyHintsAPI.EarlyHintEditParams; export import EmailObfuscation = EmailObfuscationAPI.EmailObfuscation; - export import EmailObfuscationUpdateResponse = EmailObfuscationAPI.EmailObfuscationUpdateResponse; + export import EmailObfuscationEditResponse = EmailObfuscationAPI.EmailObfuscationEditResponse; export import EmailObfuscationGetResponse = EmailObfuscationAPI.EmailObfuscationGetResponse; - export import EmailObfuscationUpdateParams = EmailObfuscationAPI.EmailObfuscationUpdateParams; + export import EmailObfuscationEditParams = EmailObfuscationAPI.EmailObfuscationEditParams; export import H2Prioritization = H2PrioritizationAPI.H2Prioritization; - export import H2PrioritizationUpdateResponse = H2PrioritizationAPI.H2PrioritizationUpdateResponse; + export import H2PrioritizationEditResponse = H2PrioritizationAPI.H2PrioritizationEditResponse; export import H2PrioritizationGetResponse = H2PrioritizationAPI.H2PrioritizationGetResponse; - export import H2PrioritizationUpdateParams = H2PrioritizationAPI.H2PrioritizationUpdateParams; + export import H2PrioritizationEditParams = H2PrioritizationAPI.H2PrioritizationEditParams; export import HotlinkProtection = HotlinkProtectionAPI.HotlinkProtection; - export import HotlinkProtectionUpdateResponse = HotlinkProtectionAPI.HotlinkProtectionUpdateResponse; + export import HotlinkProtectionEditResponse = HotlinkProtectionAPI.HotlinkProtectionEditResponse; export import HotlinkProtectionGetResponse = HotlinkProtectionAPI.HotlinkProtectionGetResponse; - export import HotlinkProtectionUpdateParams = HotlinkProtectionAPI.HotlinkProtectionUpdateParams; + export import HotlinkProtectionEditParams = HotlinkProtectionAPI.HotlinkProtectionEditParams; export import HTTP2 = HTTP2API.HTTP2; - export import HTTP2UpdateResponse = HTTP2API.HTTP2UpdateResponse; + export import HTTP2EditResponse = HTTP2API.HTTP2EditResponse; export import HTTP2GetResponse = HTTP2API.HTTP2GetResponse; - export import HTTP2UpdateParams = HTTP2API.HTTP2UpdateParams; + export import HTTP2EditParams = HTTP2API.HTTP2EditParams; export import HTTP3 = HTTP3API.HTTP3; - export import HTTP3UpdateResponse = HTTP3API.HTTP3UpdateResponse; + export import HTTP3EditResponse = HTTP3API.HTTP3EditResponse; export import HTTP3GetResponse = HTTP3API.HTTP3GetResponse; - export import HTTP3UpdateParams = HTTP3API.HTTP3UpdateParams; + export import HTTP3EditParams = HTTP3API.HTTP3EditParams; export import ImageResizing = ImageResizingAPI.ImageResizing; - export import ImageResizingUpdateResponse = ImageResizingAPI.ImageResizingUpdateResponse; + export import ImageResizingEditResponse = ImageResizingAPI.ImageResizingEditResponse; export import ImageResizingGetResponse = ImageResizingAPI.ImageResizingGetResponse; - export import ImageResizingUpdateParams = ImageResizingAPI.ImageResizingUpdateParams; + export import ImageResizingEditParams = ImageResizingAPI.ImageResizingEditParams; export import IPGeolocation = IPGeolocationAPI.IPGeolocation; - export import IPGeolocationUpdateResponse = IPGeolocationAPI.IPGeolocationUpdateResponse; + export import IPGeolocationEditResponse = IPGeolocationAPI.IPGeolocationEditResponse; export import IPGeolocationGetResponse = IPGeolocationAPI.IPGeolocationGetResponse; - export import IPGeolocationUpdateParams = IPGeolocationAPI.IPGeolocationUpdateParams; + export import IPGeolocationEditParams = IPGeolocationAPI.IPGeolocationEditParams; export import IPV6 = IPV6API.IPV6; - export import IPV6UpdateResponse = IPV6API.IPV6UpdateResponse; + export import IPV6EditResponse = IPV6API.IPV6EditResponse; export import IPV6GetResponse = IPV6API.IPV6GetResponse; - export import IPV6UpdateParams = IPV6API.IPV6UpdateParams; + export import IPV6EditParams = IPV6API.IPV6EditParams; export import MinTLSVersion = MinTLSVersionAPI.MinTLSVersion; - export import MinTLSVersionUpdateResponse = MinTLSVersionAPI.MinTLSVersionUpdateResponse; + export import MinTLSVersionEditResponse = MinTLSVersionAPI.MinTLSVersionEditResponse; export import MinTLSVersionGetResponse = MinTLSVersionAPI.MinTLSVersionGetResponse; - export import MinTLSVersionUpdateParams = MinTLSVersionAPI.MinTLSVersionUpdateParams; + export import MinTLSVersionEditParams = MinTLSVersionAPI.MinTLSVersionEditParams; export import Minify = MinifyAPI.Minify; - export import MinifyUpdateResponse = MinifyAPI.MinifyUpdateResponse; + export import MinifyEditResponse = MinifyAPI.MinifyEditResponse; export import MinifyGetResponse = MinifyAPI.MinifyGetResponse; - export import MinifyUpdateParams = MinifyAPI.MinifyUpdateParams; + export import MinifyEditParams = MinifyAPI.MinifyEditParams; export import Mirage = MirageAPI.Mirage; - export import MirageUpdateResponse = MirageAPI.MirageUpdateResponse; + export import MirageEditResponse = MirageAPI.MirageEditResponse; export import MirageGetResponse = MirageAPI.MirageGetResponse; - export import MirageUpdateParams = MirageAPI.MirageUpdateParams; + export import MirageEditParams = MirageAPI.MirageEditParams; export import MobileRedirect = MobileRedirectAPI.MobileRedirect; - export import MobileRedirectUpdateResponse = MobileRedirectAPI.MobileRedirectUpdateResponse; + export import MobileRedirectEditResponse = MobileRedirectAPI.MobileRedirectEditResponse; export import MobileRedirectGetResponse = MobileRedirectAPI.MobileRedirectGetResponse; - export import MobileRedirectUpdateParams = MobileRedirectAPI.MobileRedirectUpdateParams; + export import MobileRedirectEditParams = MobileRedirectAPI.MobileRedirectEditParams; export import NEL = NELAPI.NEL; - export import NELUpdateResponse = NELAPI.NELUpdateResponse; + export import NELEditResponse = NELAPI.NELEditResponse; export import NELGetResponse = NELAPI.NELGetResponse; - export import NELUpdateParams = NELAPI.NELUpdateParams; + export import NELEditParams = NELAPI.NELEditParams; export import OpportunisticEncryption = OpportunisticEncryptionAPI.OpportunisticEncryption; - export import OpportunisticEncryptionUpdateResponse = OpportunisticEncryptionAPI.OpportunisticEncryptionUpdateResponse; + export import OpportunisticEncryptionEditResponse = OpportunisticEncryptionAPI.OpportunisticEncryptionEditResponse; export import OpportunisticEncryptionGetResponse = OpportunisticEncryptionAPI.OpportunisticEncryptionGetResponse; - export import OpportunisticEncryptionUpdateParams = OpportunisticEncryptionAPI.OpportunisticEncryptionUpdateParams; + export import OpportunisticEncryptionEditParams = OpportunisticEncryptionAPI.OpportunisticEncryptionEditParams; export import OpportunisticOnion = OpportunisticOnionAPI.OpportunisticOnion; - export import OpportunisticOnionUpdateResponse = OpportunisticOnionAPI.OpportunisticOnionUpdateResponse; + export import OpportunisticOnionEditResponse = OpportunisticOnionAPI.OpportunisticOnionEditResponse; export import OpportunisticOnionGetResponse = OpportunisticOnionAPI.OpportunisticOnionGetResponse; - export import OpportunisticOnionUpdateParams = OpportunisticOnionAPI.OpportunisticOnionUpdateParams; + export import OpportunisticOnionEditParams = OpportunisticOnionAPI.OpportunisticOnionEditParams; export import OrangeToOrange = OrangeToOrangeAPI.OrangeToOrange; - export import OrangeToOrangeUpdateResponse = OrangeToOrangeAPI.OrangeToOrangeUpdateResponse; + export import OrangeToOrangeEditResponse = OrangeToOrangeAPI.OrangeToOrangeEditResponse; export import OrangeToOrangeGetResponse = OrangeToOrangeAPI.OrangeToOrangeGetResponse; - export import OrangeToOrangeUpdateParams = OrangeToOrangeAPI.OrangeToOrangeUpdateParams; + export import OrangeToOrangeEditParams = OrangeToOrangeAPI.OrangeToOrangeEditParams; export import OriginErrorPagePassThru = OriginErrorPagePassThruAPI.OriginErrorPagePassThru; - export import OriginErrorPagePassThruUpdateResponse = OriginErrorPagePassThruAPI.OriginErrorPagePassThruUpdateResponse; + export import OriginErrorPagePassThruEditResponse = OriginErrorPagePassThruAPI.OriginErrorPagePassThruEditResponse; export import OriginErrorPagePassThruGetResponse = OriginErrorPagePassThruAPI.OriginErrorPagePassThruGetResponse; - export import OriginErrorPagePassThruUpdateParams = OriginErrorPagePassThruAPI.OriginErrorPagePassThruUpdateParams; + export import OriginErrorPagePassThruEditParams = OriginErrorPagePassThruAPI.OriginErrorPagePassThruEditParams; export import OriginMaxHTTPVersion = OriginMaxHTTPVersionAPI.OriginMaxHTTPVersion; - export import OriginMaxHTTPVersionUpdateResponse = OriginMaxHTTPVersionAPI.OriginMaxHTTPVersionUpdateResponse; + export import OriginMaxHTTPVersionEditResponse = OriginMaxHTTPVersionAPI.OriginMaxHTTPVersionEditResponse; export import OriginMaxHTTPVersionGetResponse = OriginMaxHTTPVersionAPI.OriginMaxHTTPVersionGetResponse; - export import OriginMaxHTTPVersionUpdateParams = OriginMaxHTTPVersionAPI.OriginMaxHTTPVersionUpdateParams; + export import OriginMaxHTTPVersionEditParams = OriginMaxHTTPVersionAPI.OriginMaxHTTPVersionEditParams; export import Polish = PolishAPI.Polish; - export import PolishUpdateResponse = PolishAPI.PolishUpdateResponse; + export import PolishEditResponse = PolishAPI.PolishEditResponse; export import PolishGetResponse = PolishAPI.PolishGetResponse; - export import PolishUpdateParams = PolishAPI.PolishUpdateParams; + export import PolishEditParams = PolishAPI.PolishEditParams; export import PrefetchPreload = PrefetchPreloadAPI.PrefetchPreload; - export import PrefetchPreloadUpdateResponse = PrefetchPreloadAPI.PrefetchPreloadUpdateResponse; + export import PrefetchPreloadEditResponse = PrefetchPreloadAPI.PrefetchPreloadEditResponse; export import PrefetchPreloadGetResponse = PrefetchPreloadAPI.PrefetchPreloadGetResponse; - export import PrefetchPreloadUpdateParams = PrefetchPreloadAPI.PrefetchPreloadUpdateParams; + export import PrefetchPreloadEditParams = PrefetchPreloadAPI.PrefetchPreloadEditParams; export import ProxyReadTimeout = ProxyReadTimeoutAPI.ProxyReadTimeout; - export import ProxyReadTimeoutUpdateResponse = ProxyReadTimeoutAPI.ProxyReadTimeoutUpdateResponse; + export import ProxyReadTimeoutEditResponse = ProxyReadTimeoutAPI.ProxyReadTimeoutEditResponse; export import ProxyReadTimeoutGetResponse = ProxyReadTimeoutAPI.ProxyReadTimeoutGetResponse; - export import ProxyReadTimeoutUpdateParams = ProxyReadTimeoutAPI.ProxyReadTimeoutUpdateParams; + export import ProxyReadTimeoutEditParams = ProxyReadTimeoutAPI.ProxyReadTimeoutEditParams; export import PseudoIPV4 = PseudoIPV4API.PseudoIPV4; - export import PseudoIPV4UpdateResponse = PseudoIPV4API.PseudoIPV4UpdateResponse; + export import PseudoIPV4EditResponse = PseudoIPV4API.PseudoIPV4EditResponse; export import PseudoIPV4GetResponse = PseudoIPV4API.PseudoIPV4GetResponse; - export import PseudoIPV4UpdateParams = PseudoIPV4API.PseudoIPV4UpdateParams; + export import PseudoIPV4EditParams = PseudoIPV4API.PseudoIPV4EditParams; export import ResponseBuffering = ResponseBufferingAPI.ResponseBuffering; - export import ResponseBufferingUpdateResponse = ResponseBufferingAPI.ResponseBufferingUpdateResponse; + export import ResponseBufferingEditResponse = ResponseBufferingAPI.ResponseBufferingEditResponse; export import ResponseBufferingGetResponse = ResponseBufferingAPI.ResponseBufferingGetResponse; - export import ResponseBufferingUpdateParams = ResponseBufferingAPI.ResponseBufferingUpdateParams; + export import ResponseBufferingEditParams = ResponseBufferingAPI.ResponseBufferingEditParams; export import RocketLoader = RocketLoaderAPI.RocketLoader; - export import RocketLoaderUpdateResponse = RocketLoaderAPI.RocketLoaderUpdateResponse; + export import RocketLoaderEditResponse = RocketLoaderAPI.RocketLoaderEditResponse; export import RocketLoaderGetResponse = RocketLoaderAPI.RocketLoaderGetResponse; - export import RocketLoaderUpdateParams = RocketLoaderAPI.RocketLoaderUpdateParams; + export import RocketLoaderEditParams = RocketLoaderAPI.RocketLoaderEditParams; export import SecurityHeaders = SecurityHeadersAPI.SecurityHeaders; - export import SecurityHeaderUpdateResponse = SecurityHeadersAPI.SecurityHeaderUpdateResponse; + export import SecurityHeaderEditResponse = SecurityHeadersAPI.SecurityHeaderEditResponse; export import SecurityHeaderGetResponse = SecurityHeadersAPI.SecurityHeaderGetResponse; - export import SecurityHeaderUpdateParams = SecurityHeadersAPI.SecurityHeaderUpdateParams; + export import SecurityHeaderEditParams = SecurityHeadersAPI.SecurityHeaderEditParams; export import SecurityLevel = SecurityLevelAPI.SecurityLevel; - export import SecurityLevelUpdateResponse = SecurityLevelAPI.SecurityLevelUpdateResponse; + export import SecurityLevelEditResponse = SecurityLevelAPI.SecurityLevelEditResponse; export import SecurityLevelGetResponse = SecurityLevelAPI.SecurityLevelGetResponse; - export import SecurityLevelUpdateParams = SecurityLevelAPI.SecurityLevelUpdateParams; + export import SecurityLevelEditParams = SecurityLevelAPI.SecurityLevelEditParams; export import ServerSideExcludes = ServerSideExcludesAPI.ServerSideExcludes; - export import ServerSideExcludeUpdateResponse = ServerSideExcludesAPI.ServerSideExcludeUpdateResponse; + export import ServerSideExcludeEditResponse = ServerSideExcludesAPI.ServerSideExcludeEditResponse; export import ServerSideExcludeGetResponse = ServerSideExcludesAPI.ServerSideExcludeGetResponse; - export import ServerSideExcludeUpdateParams = ServerSideExcludesAPI.ServerSideExcludeUpdateParams; + export import ServerSideExcludeEditParams = ServerSideExcludesAPI.ServerSideExcludeEditParams; export import SortQueryStringForCache = SortQueryStringForCacheAPI.SortQueryStringForCache; - export import SortQueryStringForCacheUpdateResponse = SortQueryStringForCacheAPI.SortQueryStringForCacheUpdateResponse; + export import SortQueryStringForCacheEditResponse = SortQueryStringForCacheAPI.SortQueryStringForCacheEditResponse; export import SortQueryStringForCacheGetResponse = SortQueryStringForCacheAPI.SortQueryStringForCacheGetResponse; - export import SortQueryStringForCacheUpdateParams = SortQueryStringForCacheAPI.SortQueryStringForCacheUpdateParams; + export import SortQueryStringForCacheEditParams = SortQueryStringForCacheAPI.SortQueryStringForCacheEditParams; export import SSL = SSLAPI.SSL; - export import SSLUpdateResponse = SSLAPI.SSLUpdateResponse; + export import SSLEditResponse = SSLAPI.SSLEditResponse; export import SSLGetResponse = SSLAPI.SSLGetResponse; - export import SSLUpdateParams = SSLAPI.SSLUpdateParams; + export import SSLEditParams = SSLAPI.SSLEditParams; export import SSLRecommender = SSLRecommenderAPI.SSLRecommender; - export import SSLRecommenderUpdateResponse = SSLRecommenderAPI.SSLRecommenderUpdateResponse; + export import SSLRecommenderEditResponse = SSLRecommenderAPI.SSLRecommenderEditResponse; export import SSLRecommenderGetResponse = SSLRecommenderAPI.SSLRecommenderGetResponse; - export import SSLRecommenderUpdateParams = SSLRecommenderAPI.SSLRecommenderUpdateParams; + export import SSLRecommenderEditParams = SSLRecommenderAPI.SSLRecommenderEditParams; export import TLS1_3 = TLS1_3API.TLS1_3; - export import TLS1_3UpdateResponse = TLS1_3API.TLS1_3UpdateResponse; + export import TLS1_3EditResponse = TLS1_3API.TLS1_3EditResponse; export import TLS1_3GetResponse = TLS1_3API.TLS1_3GetResponse; - export import TLS1_3UpdateParams = TLS1_3API.TLS1_3UpdateParams; + export import TLS1_3EditParams = TLS1_3API.TLS1_3EditParams; export import TLSClientAuth = TLSClientAuthAPI.TLSClientAuth; - export import TLSClientAuthUpdateResponse = TLSClientAuthAPI.TLSClientAuthUpdateResponse; + export import TLSClientAuthEditResponse = TLSClientAuthAPI.TLSClientAuthEditResponse; export import TLSClientAuthGetResponse = TLSClientAuthAPI.TLSClientAuthGetResponse; - export import TLSClientAuthUpdateParams = TLSClientAuthAPI.TLSClientAuthUpdateParams; + export import TLSClientAuthEditParams = TLSClientAuthAPI.TLSClientAuthEditParams; export import TrueClientIPHeader = TrueClientIPHeaderAPI.TrueClientIPHeader; - export import TrueClientIPHeaderUpdateResponse = TrueClientIPHeaderAPI.TrueClientIPHeaderUpdateResponse; + export import TrueClientIPHeaderEditResponse = TrueClientIPHeaderAPI.TrueClientIPHeaderEditResponse; export import TrueClientIPHeaderGetResponse = TrueClientIPHeaderAPI.TrueClientIPHeaderGetResponse; - export import TrueClientIPHeaderUpdateParams = TrueClientIPHeaderAPI.TrueClientIPHeaderUpdateParams; + export import TrueClientIPHeaderEditParams = TrueClientIPHeaderAPI.TrueClientIPHeaderEditParams; export import WAF = WAFAPI.WAF; - export import WAFUpdateResponse = WAFAPI.WAFUpdateResponse; + export import WAFEditResponse = WAFAPI.WAFEditResponse; export import WAFGetResponse = WAFAPI.WAFGetResponse; - export import WAFUpdateParams = WAFAPI.WAFUpdateParams; + export import WAFEditParams = WAFAPI.WAFEditParams; export import Webp = WebpAPI.Webp; - export import WebpUpdateResponse = WebpAPI.WebpUpdateResponse; + export import WebpEditResponse = WebpAPI.WebpEditResponse; export import WebpGetResponse = WebpAPI.WebpGetResponse; - export import WebpUpdateParams = WebpAPI.WebpUpdateParams; + export import WebpEditParams = WebpAPI.WebpEditParams; export import Websocket = WebsocketAPI.Websocket; - export import WebsocketUpdateResponse = WebsocketAPI.WebsocketUpdateResponse; + export import WebsocketEditResponse = WebsocketAPI.WebsocketEditResponse; export import WebsocketGetResponse = WebsocketAPI.WebsocketGetResponse; - export import WebsocketUpdateParams = WebsocketAPI.WebsocketUpdateParams; + export import WebsocketEditParams = WebsocketAPI.WebsocketEditParams; export import FontSettings = FontSettingsAPI.FontSettings; - export import FontSettingUpdateResponse = FontSettingsAPI.FontSettingUpdateResponse; + export import FontSettingEditResponse = FontSettingsAPI.FontSettingEditResponse; export import FontSettingGetResponse = FontSettingsAPI.FontSettingGetResponse; - export import FontSettingUpdateParams = FontSettingsAPI.FontSettingUpdateParams; + export import FontSettingEditParams = FontSettingsAPI.FontSettingEditParams; } diff --git a/src/resources/settings/sort-query-string-for-cache.ts b/src/resources/settings/sort-query-string-for-cache.ts index 87a4be4277..f8ec15e4b1 100644 --- a/src/resources/settings/sort-query-string-for-cache.ts +++ b/src/resources/settings/sort-query-string-for-cache.ts @@ -10,16 +10,16 @@ export class SortQueryStringForCache extends APIResource { * cache, regardless of the order of the query strings. This is limited to * Enterprise Zones. */ - update( + edit( zoneId: string, - body: SortQueryStringForCacheUpdateParams, + body: SortQueryStringForCacheEditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.patch(`/zones/${zoneId}/settings/sort_query_string_for_cache`, { body, ...options, - }) as Core.APIPromise<{ result: SortQueryStringForCacheUpdateResponse }> + }) as Core.APIPromise<{ result: SortQueryStringForCacheEditResponse }> )._thenUnwrap((obj) => obj.result); } @@ -42,7 +42,7 @@ export class SortQueryStringForCache extends APIResource { * cache, regardless of the order of the query strings. This is limited to * Enterprise Zones. */ -export interface SortQueryStringForCacheUpdateResponse { +export interface SortQueryStringForCacheEditResponse { /** * ID of the zone setting. */ @@ -93,7 +93,7 @@ export interface SortQueryStringForCacheGetResponse { modified_on?: string | null; } -export interface SortQueryStringForCacheUpdateParams { +export interface SortQueryStringForCacheEditParams { /** * Value of the zone setting. */ @@ -101,7 +101,7 @@ export interface SortQueryStringForCacheUpdateParams { } export namespace SortQueryStringForCache { - export import SortQueryStringForCacheUpdateResponse = SortQueryStringForCacheAPI.SortQueryStringForCacheUpdateResponse; + export import SortQueryStringForCacheEditResponse = SortQueryStringForCacheAPI.SortQueryStringForCacheEditResponse; export import SortQueryStringForCacheGetResponse = SortQueryStringForCacheAPI.SortQueryStringForCacheGetResponse; - export import SortQueryStringForCacheUpdateParams = SortQueryStringForCacheAPI.SortQueryStringForCacheUpdateParams; + export import SortQueryStringForCacheEditParams = SortQueryStringForCacheAPI.SortQueryStringForCacheEditParams; } diff --git a/src/resources/settings/ssl-recommender.ts b/src/resources/settings/ssl-recommender.ts index 318ce5be00..b66d6711b7 100644 --- a/src/resources/settings/ssl-recommender.ts +++ b/src/resources/settings/ssl-recommender.ts @@ -10,16 +10,16 @@ export class SSLRecommender extends APIResource { * recommend (by sending periodic emails) the most secure SSL/TLS setting your * origin servers support. */ - update( + edit( zoneId: string, - body: SSLRecommenderUpdateParams, + body: SSLRecommenderEditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.patch(`/zones/${zoneId}/settings/ssl_recommender`, { body, ...options, - }) as Core.APIPromise<{ result: SSLRecommenderUpdateResponse }> + }) as Core.APIPromise<{ result: SSLRecommenderEditResponse }> )._thenUnwrap((obj) => obj.result); } @@ -42,7 +42,7 @@ export class SSLRecommender extends APIResource { * recommend (by sending periodic emails) the most secure SSL/TLS setting your * origin servers support. */ -export interface SSLRecommenderUpdateResponse { +export interface SSLRecommenderEditResponse { /** * Enrollment value for SSL/TLS Recommender. */ @@ -71,16 +71,16 @@ export interface SSLRecommenderGetResponse { enabled?: boolean; } -export interface SSLRecommenderUpdateParams { +export interface SSLRecommenderEditParams { /** * Enrollment in the SSL/TLS Recommender service which tries to detect and * recommend (by sending periodic emails) the most secure SSL/TLS setting your * origin servers support. */ - value: SSLRecommenderUpdateParams.Value; + value: SSLRecommenderEditParams.Value; } -export namespace SSLRecommenderUpdateParams { +export namespace SSLRecommenderEditParams { /** * Enrollment in the SSL/TLS Recommender service which tries to detect and * recommend (by sending periodic emails) the most secure SSL/TLS setting your @@ -100,7 +100,7 @@ export namespace SSLRecommenderUpdateParams { } export namespace SSLRecommender { - export import SSLRecommenderUpdateResponse = SSLRecommenderAPI.SSLRecommenderUpdateResponse; + export import SSLRecommenderEditResponse = SSLRecommenderAPI.SSLRecommenderEditResponse; export import SSLRecommenderGetResponse = SSLRecommenderAPI.SSLRecommenderGetResponse; - export import SSLRecommenderUpdateParams = SSLRecommenderAPI.SSLRecommenderUpdateParams; + export import SSLRecommenderEditParams = SSLRecommenderAPI.SSLRecommenderEditParams; } diff --git a/src/resources/settings/ssl.ts b/src/resources/settings/ssl.ts index d4989adc59..b273ad29a0 100644 --- a/src/resources/settings/ssl.ts +++ b/src/resources/settings/ssl.ts @@ -23,14 +23,10 @@ export class SSL extends APIResource { * expiration date in the future, and respond for the request domain name * (hostname). (https://support.cloudflare.com/hc/en-us/articles/200170416). */ - update( - zoneId: string, - body: SSLUpdateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { + edit(zoneId: string, body: SSLEditParams, options?: Core.RequestOptions): Core.APIPromise { return ( this._client.patch(`/zones/${zoneId}/settings/ssl`, { body, ...options }) as Core.APIPromise<{ - result: SSLUpdateResponse; + result: SSLEditResponse; }> )._thenUnwrap((obj) => obj.result); } @@ -80,7 +76,7 @@ export class SSL extends APIResource { * expiration date in the future, and respond for the request domain name * (hostname). (https://support.cloudflare.com/hc/en-us/articles/200170416). */ -export interface SSLUpdateResponse { +export interface SSLEditResponse { /** * ID of the zone setting. */ @@ -144,7 +140,7 @@ export interface SSLGetResponse { modified_on?: string | null; } -export interface SSLUpdateParams { +export interface SSLEditParams { /** * Value of the zone setting. Notes: Depends on the zone's plan level */ @@ -152,7 +148,7 @@ export interface SSLUpdateParams { } export namespace SSL { - export import SSLUpdateResponse = SSLAPI.SSLUpdateResponse; + export import SSLEditResponse = SSLAPI.SSLEditResponse; export import SSLGetResponse = SSLAPI.SSLGetResponse; - export import SSLUpdateParams = SSLAPI.SSLUpdateParams; + export import SSLEditParams = SSLAPI.SSLEditParams; } diff --git a/src/resources/settings/tls-1-3.ts b/src/resources/settings/tls-1-3.ts index 175f21c018..51f0da879f 100644 --- a/src/resources/settings/tls-1-3.ts +++ b/src/resources/settings/tls-1-3.ts @@ -8,14 +8,14 @@ export class TLS1_3 extends APIResource { /** * Changes TLS 1.3 setting. */ - update( + edit( zoneId: string, - body: TLS1_3UpdateParams, + body: TLS1_3EditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.patch(`/zones/${zoneId}/settings/tls_1_3`, { body, ...options }) as Core.APIPromise<{ - result: TLS1_3UpdateResponse; + result: TLS1_3EditResponse; }> )._thenUnwrap((obj) => obj.result); } @@ -35,7 +35,7 @@ export class TLS1_3 extends APIResource { /** * Enables Crypto TLS 1.3 feature for a zone. */ -export interface TLS1_3UpdateResponse { +export interface TLS1_3EditResponse { /** * ID of the zone setting. */ @@ -84,7 +84,7 @@ export interface TLS1_3GetResponse { modified_on?: string | null; } -export interface TLS1_3UpdateParams { +export interface TLS1_3EditParams { /** * Value of the zone setting. Notes: Default value depends on the zone's plan * level. @@ -93,7 +93,7 @@ export interface TLS1_3UpdateParams { } export namespace TLS1_3 { - export import TLS1_3UpdateResponse = TLS1_3API.TLS1_3UpdateResponse; + export import TLS1_3EditResponse = TLS1_3API.TLS1_3EditResponse; export import TLS1_3GetResponse = TLS1_3API.TLS1_3GetResponse; - export import TLS1_3UpdateParams = TLS1_3API.TLS1_3UpdateParams; + export import TLS1_3EditParams = TLS1_3API.TLS1_3EditParams; } diff --git a/src/resources/settings/tls-client-auth.ts b/src/resources/settings/tls-client-auth.ts index 2e37c9b92a..f5736d270d 100644 --- a/src/resources/settings/tls-client-auth.ts +++ b/src/resources/settings/tls-client-auth.ts @@ -9,16 +9,16 @@ export class TLSClientAuth extends APIResource { * TLS Client Auth requires Cloudflare to connect to your origin server using a * client certificate (Enterprise Only). */ - update( + edit( zoneId: string, - body: TLSClientAuthUpdateParams, + body: TLSClientAuthEditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.patch(`/zones/${zoneId}/settings/tls_client_auth`, { body, ...options, - }) as Core.APIPromise<{ result: TLSClientAuthUpdateResponse }> + }) as Core.APIPromise<{ result: TLSClientAuthEditResponse }> )._thenUnwrap((obj) => obj.result); } @@ -39,7 +39,7 @@ export class TLSClientAuth extends APIResource { * TLS Client Auth requires Cloudflare to connect to your origin server using a * client certificate (Enterprise Only). */ -export interface TLSClientAuthUpdateResponse { +export interface TLSClientAuthEditResponse { /** * ID of the zone setting. */ @@ -89,7 +89,7 @@ export interface TLSClientAuthGetResponse { modified_on?: string | null; } -export interface TLSClientAuthUpdateParams { +export interface TLSClientAuthEditParams { /** * value of the zone setting. */ @@ -97,7 +97,7 @@ export interface TLSClientAuthUpdateParams { } export namespace TLSClientAuth { - export import TLSClientAuthUpdateResponse = TLSClientAuthAPI.TLSClientAuthUpdateResponse; + export import TLSClientAuthEditResponse = TLSClientAuthAPI.TLSClientAuthEditResponse; export import TLSClientAuthGetResponse = TLSClientAuthAPI.TLSClientAuthGetResponse; - export import TLSClientAuthUpdateParams = TLSClientAuthAPI.TLSClientAuthUpdateParams; + export import TLSClientAuthEditParams = TLSClientAuthAPI.TLSClientAuthEditParams; } diff --git a/src/resources/settings/true-client-ip-header.ts b/src/resources/settings/true-client-ip-header.ts index 74861273db..7b7ed618e6 100644 --- a/src/resources/settings/true-client-ip-header.ts +++ b/src/resources/settings/true-client-ip-header.ts @@ -9,16 +9,16 @@ export class TrueClientIPHeader extends APIResource { * Allows customer to continue to use True Client IP (Akamai feature) in the * headers we send to the origin. This is limited to Enterprise Zones. */ - update( + edit( zoneId: string, - body: TrueClientIPHeaderUpdateParams, + body: TrueClientIPHeaderEditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.patch(`/zones/${zoneId}/settings/true_client_ip_header`, { body, ...options, - }) as Core.APIPromise<{ result: TrueClientIPHeaderUpdateResponse }> + }) as Core.APIPromise<{ result: TrueClientIPHeaderEditResponse }> )._thenUnwrap((obj) => obj.result); } @@ -39,7 +39,7 @@ export class TrueClientIPHeader extends APIResource { * Allows customer to continue to use True Client IP (Akamai feature) in the * headers we send to the origin. This is limited to Enterprise Zones. */ -export interface TrueClientIPHeaderUpdateResponse { +export interface TrueClientIPHeaderEditResponse { /** * ID of the zone setting. */ @@ -89,7 +89,7 @@ export interface TrueClientIPHeaderGetResponse { modified_on?: string | null; } -export interface TrueClientIPHeaderUpdateParams { +export interface TrueClientIPHeaderEditParams { /** * Value of the zone setting. */ @@ -97,7 +97,7 @@ export interface TrueClientIPHeaderUpdateParams { } export namespace TrueClientIPHeader { - export import TrueClientIPHeaderUpdateResponse = TrueClientIPHeaderAPI.TrueClientIPHeaderUpdateResponse; + export import TrueClientIPHeaderEditResponse = TrueClientIPHeaderAPI.TrueClientIPHeaderEditResponse; export import TrueClientIPHeaderGetResponse = TrueClientIPHeaderAPI.TrueClientIPHeaderGetResponse; - export import TrueClientIPHeaderUpdateParams = TrueClientIPHeaderAPI.TrueClientIPHeaderUpdateParams; + export import TrueClientIPHeaderEditParams = TrueClientIPHeaderAPI.TrueClientIPHeaderEditParams; } diff --git a/src/resources/settings/waf.ts b/src/resources/settings/waf.ts index b1a36e7019..49bcea98e1 100644 --- a/src/resources/settings/waf.ts +++ b/src/resources/settings/waf.ts @@ -17,14 +17,10 @@ export class WAF extends APIResource { * reaches your origin web server. * (https://support.cloudflare.com/hc/en-us/articles/200172016). */ - update( - zoneId: string, - body: WAFUpdateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { + edit(zoneId: string, body: WAFEditParams, options?: Core.RequestOptions): Core.APIPromise { return ( this._client.patch(`/zones/${zoneId}/settings/waf`, { body, ...options }) as Core.APIPromise<{ - result: WAFUpdateResponse; + result: WAFEditResponse; }> )._thenUnwrap((obj) => obj.result); } @@ -62,7 +58,7 @@ export class WAF extends APIResource { * reaches your origin web server. * (https://support.cloudflare.com/hc/en-us/articles/200172016). */ -export interface WAFUpdateResponse { +export interface WAFEditResponse { /** * ID of the zone setting. */ @@ -120,7 +116,7 @@ export interface WAFGetResponse { modified_on?: string | null; } -export interface WAFUpdateParams { +export interface WAFEditParams { /** * Value of the zone setting. */ @@ -128,7 +124,7 @@ export interface WAFUpdateParams { } export namespace WAF { - export import WAFUpdateResponse = WAFAPI.WAFUpdateResponse; + export import WAFEditResponse = WAFAPI.WAFEditResponse; export import WAFGetResponse = WAFAPI.WAFGetResponse; - export import WAFUpdateParams = WAFAPI.WAFUpdateParams; + export import WAFEditParams = WAFAPI.WAFEditParams; } diff --git a/src/resources/settings/webp.ts b/src/resources/settings/webp.ts index 82b0003d4b..884bd95ccb 100644 --- a/src/resources/settings/webp.ts +++ b/src/resources/settings/webp.ts @@ -10,14 +10,14 @@ export class Webp extends APIResource { * offers a performance advantage over the original image format, Cloudflare will * serve a WebP version of the original image. */ - update( + edit( zoneId: string, - body: WebpUpdateParams, + body: WebpEditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.patch(`/zones/${zoneId}/settings/webp`, { body, ...options }) as Core.APIPromise<{ - result: WebpUpdateResponse; + result: WebpEditResponse; }> )._thenUnwrap((obj) => obj.result); } @@ -41,7 +41,7 @@ export class Webp extends APIResource { * offers a performance advantage over the original image format, Cloudflare will * serve a WebP version of the original image. */ -export interface WebpUpdateResponse { +export interface WebpEditResponse { /** * ID of the zone setting. */ @@ -92,7 +92,7 @@ export interface WebpGetResponse { modified_on?: string | null; } -export interface WebpUpdateParams { +export interface WebpEditParams { /** * Value of the zone setting. */ @@ -100,7 +100,7 @@ export interface WebpUpdateParams { } export namespace Webp { - export import WebpUpdateResponse = WebpAPI.WebpUpdateResponse; + export import WebpEditResponse = WebpAPI.WebpEditResponse; export import WebpGetResponse = WebpAPI.WebpGetResponse; - export import WebpUpdateParams = WebpAPI.WebpUpdateParams; + export import WebpEditParams = WebpAPI.WebpEditParams; } diff --git a/src/resources/settings/websocket.ts b/src/resources/settings/websocket.ts index f97db7c04f..54d064447a 100644 --- a/src/resources/settings/websocket.ts +++ b/src/resources/settings/websocket.ts @@ -10,14 +10,14 @@ export class Websocket extends APIResource { * to * [Using Cloudflare with WebSockets](https://support.cloudflare.com/hc/en-us/articles/200169466-Using-Cloudflare-with-WebSockets). */ - update( + edit( zoneId: string, - body: WebsocketUpdateParams, + body: WebsocketEditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.patch(`/zones/${zoneId}/settings/websockets`, { body, ...options }) as Core.APIPromise<{ - result: WebsocketUpdateResponse; + result: WebsocketEditResponse; }> )._thenUnwrap((obj) => obj.result); } @@ -44,7 +44,7 @@ export class Websocket extends APIResource { * to * [Can I use Cloudflare with Websockets](https://support.cloudflare.com/hc/en-us/articles/200169466-Can-I-use-Cloudflare-with-WebSockets-). */ -export interface WebsocketUpdateResponse { +export interface WebsocketEditResponse { /** * ID of the zone setting. */ @@ -99,7 +99,7 @@ export interface WebsocketGetResponse { modified_on?: string | null; } -export interface WebsocketUpdateParams { +export interface WebsocketEditParams { /** * Value of the zone setting. */ @@ -107,7 +107,7 @@ export interface WebsocketUpdateParams { } export namespace Websocket { - export import WebsocketUpdateResponse = WebsocketAPI.WebsocketUpdateResponse; + export import WebsocketEditResponse = WebsocketAPI.WebsocketEditResponse; export import WebsocketGetResponse = WebsocketAPI.WebsocketGetResponse; - export import WebsocketUpdateParams = WebsocketAPI.WebsocketUpdateParams; + export import WebsocketEditParams = WebsocketAPI.WebsocketEditParams; } diff --git a/src/resources/settings/zero-rtt.ts b/src/resources/settings/zero-rtt.ts index 58f12edb2d..aa914a922e 100644 --- a/src/resources/settings/zero-rtt.ts +++ b/src/resources/settings/zero-rtt.ts @@ -8,14 +8,14 @@ export class ZeroRtt extends APIResource { /** * Changes the 0-RTT session resumption setting. */ - update( + edit( zoneId: string, - body: ZeroRttUpdateParams, + body: ZeroRttEditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.patch(`/zones/${zoneId}/settings/0rtt`, { body, ...options }) as Core.APIPromise<{ - result: ZeroRttUpdateResponse; + result: ZeroRttEditResponse; }> )._thenUnwrap((obj) => obj.result); } @@ -35,7 +35,7 @@ export class ZeroRtt extends APIResource { /** * 0-RTT session resumption enabled for this zone. */ -export interface ZeroRttUpdateResponse { +export interface ZeroRttEditResponse { /** * ID of the zone setting. */ @@ -84,7 +84,7 @@ export interface ZeroRttGetResponse { modified_on?: string | null; } -export interface ZeroRttUpdateParams { +export interface ZeroRttEditParams { /** * Value of the 0-RTT setting. */ @@ -92,7 +92,7 @@ export interface ZeroRttUpdateParams { } export namespace ZeroRtt { - export import ZeroRttUpdateResponse = ZeroRttAPI.ZeroRttUpdateResponse; + export import ZeroRttEditResponse = ZeroRttAPI.ZeroRttEditResponse; export import ZeroRttGetResponse = ZeroRttAPI.ZeroRttGetResponse; - export import ZeroRttUpdateParams = ZeroRttAPI.ZeroRttUpdateParams; + export import ZeroRttEditParams = ZeroRttAPI.ZeroRttEditParams; } diff --git a/src/resources/snippets/index.ts b/src/resources/snippets/index.ts index 1ea3396517..9029f58f59 100644 --- a/src/resources/snippets/index.ts +++ b/src/resources/snippets/index.ts @@ -2,16 +2,16 @@ export { Content } from './content'; export { + SnippetRuleUpdateResponse, + SnippetRuleListResponse, + SnippetRuleUpdateParams, + SnippetRules, +} from './snippet-rules'; +export { + SnippetUpdateResponse, SnippetListResponse, SnippetDeleteResponse, SnippetGetResponse, - SnippetReplaceResponse, - SnippetReplaceParams, + SnippetUpdateParams, Snippets, } from './snippets'; -export { - SnippetRuleListResponse, - SnippetRuleReplaceResponse, - SnippetRuleReplaceParams, - SnippetRules, -} from './snippet-rules'; diff --git a/src/resources/snippets/snippet-rules.ts b/src/resources/snippets/snippet-rules.ts index 6fa360d7e6..c86dd435b9 100644 --- a/src/resources/snippets/snippet-rules.ts +++ b/src/resources/snippets/snippet-rules.ts @@ -6,39 +6,39 @@ import { isRequestOptions } from 'cloudflare/core'; import * as SnippetRulesAPI from 'cloudflare/resources/snippets/snippet-rules'; export class SnippetRules extends APIResource { - /** - * Rules - */ - list(zoneIdentifier: string, options?: Core.RequestOptions): Core.APIPromise { - return ( - this._client.get(`/zones/${zoneIdentifier}/snippets/snippet_rules`, options) as Core.APIPromise<{ - result: SnippetRuleListResponse; - }> - )._thenUnwrap((obj) => obj.result); - } - /** * Put Rules */ - replace( + update( zoneIdentifier: string, - body?: SnippetRuleReplaceParams, + body?: SnippetRuleUpdateParams, options?: Core.RequestOptions, - ): Core.APIPromise; - replace(zoneIdentifier: string, options?: Core.RequestOptions): Core.APIPromise; - replace( + ): Core.APIPromise; + update(zoneIdentifier: string, options?: Core.RequestOptions): Core.APIPromise; + update( zoneIdentifier: string, - body: SnippetRuleReplaceParams | Core.RequestOptions = {}, + body: SnippetRuleUpdateParams | Core.RequestOptions = {}, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { if (isRequestOptions(body)) { - return this.replace(zoneIdentifier, {}, body); + return this.update(zoneIdentifier, {}, body); } return ( this._client.put(`/zones/${zoneIdentifier}/snippets/snippet_rules`, { body, ...options, - }) as Core.APIPromise<{ result: SnippetRuleReplaceResponse }> + }) as Core.APIPromise<{ result: SnippetRuleUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Rules + */ + list(zoneIdentifier: string, options?: Core.RequestOptions): Core.APIPromise { + return ( + this._client.get(`/zones/${zoneIdentifier}/snippets/snippet_rules`, options) as Core.APIPromise<{ + result: SnippetRuleListResponse; + }> )._thenUnwrap((obj) => obj.result); } } @@ -46,10 +46,10 @@ export class SnippetRules extends APIResource { /** * List of snippet rules */ -export type SnippetRuleListResponse = Array; +export type SnippetRuleUpdateResponse = Array; -export namespace SnippetRuleListResponse { - export interface SnippetRuleListResponseItem { +export namespace SnippetRuleUpdateResponse { + export interface SnippetRuleUpdateResponseItem { description?: string; enabled?: boolean; @@ -66,10 +66,10 @@ export namespace SnippetRuleListResponse { /** * List of snippet rules */ -export type SnippetRuleReplaceResponse = Array; +export type SnippetRuleListResponse = Array; -export namespace SnippetRuleReplaceResponse { - export interface SnippetRuleReplaceResponseItem { +export namespace SnippetRuleListResponse { + export interface SnippetRuleListResponseItem { description?: string; enabled?: boolean; @@ -83,14 +83,14 @@ export namespace SnippetRuleReplaceResponse { } } -export interface SnippetRuleReplaceParams { +export interface SnippetRuleUpdateParams { /** * List of snippet rules */ - rules?: Array; + rules?: Array; } -export namespace SnippetRuleReplaceParams { +export namespace SnippetRuleUpdateParams { export interface Rule { description?: string; @@ -106,7 +106,7 @@ export namespace SnippetRuleReplaceParams { } export namespace SnippetRules { + export import SnippetRuleUpdateResponse = SnippetRulesAPI.SnippetRuleUpdateResponse; export import SnippetRuleListResponse = SnippetRulesAPI.SnippetRuleListResponse; - export import SnippetRuleReplaceResponse = SnippetRulesAPI.SnippetRuleReplaceResponse; - export import SnippetRuleReplaceParams = SnippetRulesAPI.SnippetRuleReplaceParams; + export import SnippetRuleUpdateParams = SnippetRulesAPI.SnippetRuleUpdateParams; } diff --git a/src/resources/snippets/snippets.ts b/src/resources/snippets/snippets.ts index d63f510c80..5f9abbd333 100644 --- a/src/resources/snippets/snippets.ts +++ b/src/resources/snippets/snippets.ts @@ -12,6 +12,37 @@ export class Snippets extends APIResource { content: ContentAPI.Content = new ContentAPI.Content(this._client); snippetRules: SnippetRulesAPI.SnippetRules = new SnippetRulesAPI.SnippetRules(this._client); + /** + * Put Snippet + */ + update( + zoneIdentifier: string, + snippetName: string, + body?: SnippetUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + update( + zoneIdentifier: string, + snippetName: string, + options?: Core.RequestOptions, + ): Core.APIPromise; + update( + zoneIdentifier: string, + snippetName: string, + body: SnippetUpdateParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(body)) { + return this.update(zoneIdentifier, snippetName, {}, body); + } + return ( + this._client.put( + `/zones/${zoneIdentifier}/snippets/${snippetName}`, + multipartFormRequestOptions({ body, ...options }), + ) as Core.APIPromise<{ result: SnippetUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * All Snippets */ @@ -52,37 +83,26 @@ export class Snippets extends APIResource { }> )._thenUnwrap((obj) => obj.result); } +} +/** + * Snippet Information + */ +export interface SnippetUpdateResponse { /** - * Put Snippet + * Creation time of the snippet */ - replace( - zoneIdentifier: string, - snippetName: string, - body?: SnippetReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise; - replace( - zoneIdentifier: string, - snippetName: string, - options?: Core.RequestOptions, - ): Core.APIPromise; - replace( - zoneIdentifier: string, - snippetName: string, - body: SnippetReplaceParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(body)) { - return this.replace(zoneIdentifier, snippetName, {}, body); - } - return ( - this._client.put( - `/zones/${zoneIdentifier}/snippets/${snippetName}`, - multipartFormRequestOptions({ body, ...options }), - ) as Core.APIPromise<{ result: SnippetReplaceResponse }> - )._thenUnwrap((obj) => obj.result); - } + created_on?: string; + + /** + * Modification time of the snippet + */ + modified_on?: string; + + /** + * Snippet identifying name + */ + snippet_name?: string; } /** @@ -134,36 +154,16 @@ export interface SnippetGetResponse { snippet_name?: string; } -/** - * Snippet Information - */ -export interface SnippetReplaceResponse { - /** - * Creation time of the snippet - */ - created_on?: string; - - /** - * Modification time of the snippet - */ - modified_on?: string; - - /** - * Snippet identifying name - */ - snippet_name?: string; -} - -export interface SnippetReplaceParams { +export interface SnippetUpdateParams { /** * Content files of uploaded snippet */ files?: string; - metadata?: SnippetReplaceParams.Metadata; + metadata?: SnippetUpdateParams.Metadata; } -export namespace SnippetReplaceParams { +export namespace SnippetUpdateParams { export interface Metadata { /** * Main module name of uploaded snippet @@ -173,14 +173,14 @@ export namespace SnippetReplaceParams { } export namespace Snippets { + export import SnippetUpdateResponse = SnippetsAPI.SnippetUpdateResponse; export import SnippetListResponse = SnippetsAPI.SnippetListResponse; export import SnippetDeleteResponse = SnippetsAPI.SnippetDeleteResponse; export import SnippetGetResponse = SnippetsAPI.SnippetGetResponse; - export import SnippetReplaceResponse = SnippetsAPI.SnippetReplaceResponse; - export import SnippetReplaceParams = SnippetsAPI.SnippetReplaceParams; + export import SnippetUpdateParams = SnippetsAPI.SnippetUpdateParams; export import Content = ContentAPI.Content; export import SnippetRules = SnippetRulesAPI.SnippetRules; + export import SnippetRuleUpdateResponse = SnippetRulesAPI.SnippetRuleUpdateResponse; export import SnippetRuleListResponse = SnippetRulesAPI.SnippetRuleListResponse; - export import SnippetRuleReplaceResponse = SnippetRulesAPI.SnippetRuleReplaceResponse; - export import SnippetRuleReplaceParams = SnippetRulesAPI.SnippetRuleReplaceParams; + export import SnippetRuleUpdateParams = SnippetRulesAPI.SnippetRuleUpdateParams; } diff --git a/src/resources/spectrum/apps.ts b/src/resources/spectrum/apps.ts index 8836fd1370..190e8bff40 100644 --- a/src/resources/spectrum/apps.ts +++ b/src/resources/spectrum/apps.ts @@ -23,6 +23,23 @@ export class Apps extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Updates a previously existing application's configuration that uses a name for + * the origin. + */ + update( + zone: string, + appId: string, + body: AppUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/zones/${zone}/spectrum/apps/${appId}`, { body, ...options }) as Core.APIPromise<{ + result: AppUpdateResponse | null; + }> + )._thenUnwrap((obj) => obj.result); + } + /** * Retrieves a list of currently existing Spectrum applications inside a zone. */ @@ -74,23 +91,6 @@ export class Apps extends APIResource { }> )._thenUnwrap((obj) => obj.result); } - - /** - * Updates a previously existing application's configuration that uses a name for - * the origin. - */ - replace( - zone: string, - appId: string, - body: AppReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put(`/zones/${zone}/spectrum/apps/${appId}`, { body, ...options }) as Core.APIPromise<{ - result: AppReplaceResponse | null; - }> - )._thenUnwrap((obj) => obj.result); - } } export class AppListResponsesV4PagePaginationArray extends V4PagePaginationArray {} @@ -243,18 +243,7 @@ export namespace AppCreateResponse { } } -export type AppListResponse = unknown; - -export interface AppDeleteResponse { - /** - * Application identifier. - */ - id?: string; -} - -export type AppGetResponse = unknown | string; - -export interface AppReplaceResponse { +export interface AppUpdateResponse { /** * Application identifier. */ @@ -274,12 +263,12 @@ export interface AppReplaceResponse { /** * The name and type of DNS record for the Spectrum application. */ - dns?: AppReplaceResponse.DNS; + dns?: AppUpdateResponse.DNS; /** * The anycast edge IP configuration for the hostname of this application. */ - edge_ips?: AppReplaceResponse.UnionMember0 | AppReplaceResponse.UnionMember1; + edge_ips?: AppUpdateResponse.UnionMember0 | AppUpdateResponse.UnionMember1; /** * Enables IP Access Rules for this application. Notes: Only available for TCP @@ -295,7 +284,7 @@ export interface AppReplaceResponse { /** * The name and type of DNS record for the Spectrum application. */ - origin_dns?: AppReplaceResponse.OriginDNS; + origin_dns?: AppUpdateResponse.OriginDNS; /** * The destination port at the origin. Only specified in conjunction with @@ -335,7 +324,7 @@ export interface AppReplaceResponse { traffic_type?: 'direct' | 'http' | 'https'; } -export namespace AppReplaceResponse { +export namespace AppUpdateResponse { /** * The name and type of DNS record for the Spectrum application. */ @@ -402,6 +391,17 @@ export namespace AppReplaceResponse { } } +export type AppListResponse = unknown; + +export interface AppDeleteResponse { + /** + * Application identifier. + */ + id?: string; +} + +export type AppGetResponse = unknown | string; + export interface AppCreateParams { /** * The name and type of DNS record for the Spectrum application. @@ -535,28 +535,16 @@ export namespace AppCreateParams { } } -export interface AppListParams extends V4PagePaginationArrayParams { - /** - * Sets the direction by which results are ordered. - */ - direction?: 'asc' | 'desc'; - - /** - * Application field by which results are ordered. - */ - order?: 'protocol' | 'app_id' | 'created_on' | 'modified_on' | 'dns'; -} - -export interface AppReplaceParams { +export interface AppUpdateParams { /** * The name and type of DNS record for the Spectrum application. */ - dns: AppReplaceParams.DNS; + dns: AppUpdateParams.DNS; /** * The name and type of DNS record for the Spectrum application. */ - origin_dns: AppReplaceParams.OriginDNS; + origin_dns: AppUpdateParams.OriginDNS; /** * The destination port at the origin. Only specified in conjunction with @@ -582,7 +570,7 @@ export interface AppReplaceParams { /** * The anycast edge IP configuration for the hostname of this application. */ - edge_ips?: AppReplaceParams.UnionMember0 | AppReplaceParams.UnionMember1; + edge_ips?: AppUpdateParams.UnionMember0 | AppUpdateParams.UnionMember1; /** * Enables IP Access Rules for this application. Notes: Only available for TCP @@ -613,7 +601,7 @@ export interface AppReplaceParams { traffic_type?: 'direct' | 'http' | 'https'; } -export namespace AppReplaceParams { +export namespace AppUpdateParams { /** * The name and type of DNS record for the Spectrum application. */ @@ -680,14 +668,26 @@ export namespace AppReplaceParams { } } +export interface AppListParams extends V4PagePaginationArrayParams { + /** + * Sets the direction by which results are ordered. + */ + direction?: 'asc' | 'desc'; + + /** + * Application field by which results are ordered. + */ + order?: 'protocol' | 'app_id' | 'created_on' | 'modified_on' | 'dns'; +} + export namespace Apps { export import AppCreateResponse = AppsAPI.AppCreateResponse; + export import AppUpdateResponse = AppsAPI.AppUpdateResponse; export import AppListResponse = AppsAPI.AppListResponse; export import AppDeleteResponse = AppsAPI.AppDeleteResponse; export import AppGetResponse = AppsAPI.AppGetResponse; - export import AppReplaceResponse = AppsAPI.AppReplaceResponse; export import AppListResponsesV4PagePaginationArray = AppsAPI.AppListResponsesV4PagePaginationArray; export import AppCreateParams = AppsAPI.AppCreateParams; + export import AppUpdateParams = AppsAPI.AppUpdateParams; export import AppListParams = AppsAPI.AppListParams; - export import AppReplaceParams = AppsAPI.AppReplaceParams; } diff --git a/src/resources/spectrum/index.ts b/src/resources/spectrum/index.ts index 99336bb598..4bc286a387 100644 --- a/src/resources/spectrum/index.ts +++ b/src/resources/spectrum/index.ts @@ -3,13 +3,13 @@ export { Analytics } from './analytics/index'; export { AppCreateResponse, + AppUpdateResponse, AppListResponse, AppDeleteResponse, AppGetResponse, - AppReplaceResponse, AppCreateParams, + AppUpdateParams, AppListParams, - AppReplaceParams, AppListResponsesV4PagePaginationArray, Apps, } from './apps'; diff --git a/src/resources/spectrum/spectrum.ts b/src/resources/spectrum/spectrum.ts index 52ba7699cf..72066433ad 100644 --- a/src/resources/spectrum/spectrum.ts +++ b/src/resources/spectrum/spectrum.ts @@ -13,12 +13,12 @@ export namespace Spectrum { export import Analytics = AnalyticsAPI.Analytics; export import Apps = AppsAPI.Apps; export import AppCreateResponse = AppsAPI.AppCreateResponse; + export import AppUpdateResponse = AppsAPI.AppUpdateResponse; export import AppListResponse = AppsAPI.AppListResponse; export import AppDeleteResponse = AppsAPI.AppDeleteResponse; export import AppGetResponse = AppsAPI.AppGetResponse; - export import AppReplaceResponse = AppsAPI.AppReplaceResponse; export import AppListResponsesV4PagePaginationArray = AppsAPI.AppListResponsesV4PagePaginationArray; export import AppCreateParams = AppsAPI.AppCreateParams; + export import AppUpdateParams = AppsAPI.AppUpdateParams; export import AppListParams = AppsAPI.AppListParams; - export import AppReplaceParams = AppsAPI.AppReplaceParams; } diff --git a/src/resources/ssl/certificate-packs/certificate-packs.ts b/src/resources/ssl/certificate-packs/certificate-packs.ts index 87628c059c..0f4c7de595 100644 --- a/src/resources/ssl/certificate-packs/certificate-packs.ts +++ b/src/resources/ssl/certificate-packs/certificate-packs.ts @@ -11,24 +11,6 @@ export class CertificatePacks extends APIResource { order: OrderAPI.Order = new OrderAPI.Order(this._client); quota: QuotaAPI.Quota = new QuotaAPI.Quota(this._client); - /** - * For a given zone, restart validation for an advanced certificate pack. This is - * only a validation operation for a Certificate Pack in a validation_timed_out - * status. - */ - update( - zoneId: string, - certificatePackId: string, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.patch( - `/zones/${zoneId}/ssl/certificate_packs/${certificatePackId}`, - options, - ) as Core.APIPromise<{ result: CertificatePackUpdateResponse }> - )._thenUnwrap((obj) => obj.result); - } - /** * For a given zone, list all active certificate packs. */ @@ -69,6 +51,24 @@ export class CertificatePacks extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * For a given zone, restart validation for an advanced certificate pack. This is + * only a validation operation for a Certificate Pack in a validation_timed_out + * status. + */ + edit( + zoneId: string, + certificatePackId: string, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.patch( + `/zones/${zoneId}/ssl/certificate_packs/${certificatePackId}`, + options, + ) as Core.APIPromise<{ result: CertificatePackEditResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * For a given zone, get a certificate pack. */ @@ -86,7 +86,16 @@ export class CertificatePacks extends APIResource { } } -export interface CertificatePackUpdateResponse { +export type CertificatePackListResponse = Array; + +export interface CertificatePackDeleteResponse { + /** + * Identifier + */ + id?: string; +} + +export interface CertificatePackEditResponse { /** * Identifier */ @@ -153,15 +162,6 @@ export interface CertificatePackUpdateResponse { validity_days?: 14 | 30 | 90 | 365; } -export type CertificatePackListResponse = Array; - -export interface CertificatePackDeleteResponse { - /** - * Identifier - */ - id?: string; -} - export type CertificatePackGetResponse = unknown | string; export interface CertificatePackListParams { @@ -172,9 +172,9 @@ export interface CertificatePackListParams { } export namespace CertificatePacks { - export import CertificatePackUpdateResponse = CertificatePacksAPI.CertificatePackUpdateResponse; export import CertificatePackListResponse = CertificatePacksAPI.CertificatePackListResponse; export import CertificatePackDeleteResponse = CertificatePacksAPI.CertificatePackDeleteResponse; + export import CertificatePackEditResponse = CertificatePacksAPI.CertificatePackEditResponse; export import CertificatePackGetResponse = CertificatePacksAPI.CertificatePackGetResponse; export import CertificatePackListParams = CertificatePacksAPI.CertificatePackListParams; export import Order = OrderAPI.Order; diff --git a/src/resources/ssl/certificate-packs/index.ts b/src/resources/ssl/certificate-packs/index.ts index a039d8c0e6..afc7e182e4 100644 --- a/src/resources/ssl/certificate-packs/index.ts +++ b/src/resources/ssl/certificate-packs/index.ts @@ -1,9 +1,9 @@ // File generated from our OpenAPI spec by Stainless. export { - CertificatePackUpdateResponse, CertificatePackListResponse, CertificatePackDeleteResponse, + CertificatePackEditResponse, CertificatePackGetResponse, CertificatePackListParams, CertificatePacks, diff --git a/src/resources/ssl/index.ts b/src/resources/ssl/index.ts index ee402f1d7c..56dba27cf9 100644 --- a/src/resources/ssl/index.ts +++ b/src/resources/ssl/index.ts @@ -2,9 +2,9 @@ export { AnalyzeCreateResponse, AnalyzeCreateParams, Analyze } from './analyze'; export { - CertificatePackUpdateResponse, CertificatePackListResponse, CertificatePackDeleteResponse, + CertificatePackEditResponse, CertificatePackGetResponse, CertificatePackListParams, CertificatePacks, @@ -13,9 +13,9 @@ export { RecommendationListResponse, Recommendations } from './recommendations'; export { SSL } from './ssl'; export { Universal } from './universal/index'; export { - VerificationUpdateResponse, VerificationListResponse, - VerificationUpdateParams, + VerificationEditResponse, VerificationListParams, + VerificationEditParams, Verification, } from './verification'; diff --git a/src/resources/ssl/ssl.ts b/src/resources/ssl/ssl.ts index d663b7a5d0..733279e1d0 100644 --- a/src/resources/ssl/ssl.ts +++ b/src/resources/ssl/ssl.ts @@ -22,17 +22,17 @@ export namespace SSL { export import AnalyzeCreateResponse = AnalyzeAPI.AnalyzeCreateResponse; export import AnalyzeCreateParams = AnalyzeAPI.AnalyzeCreateParams; export import CertificatePacks = CertificatePacksAPI.CertificatePacks; - export import CertificatePackUpdateResponse = CertificatePacksAPI.CertificatePackUpdateResponse; export import CertificatePackListResponse = CertificatePacksAPI.CertificatePackListResponse; export import CertificatePackDeleteResponse = CertificatePacksAPI.CertificatePackDeleteResponse; + export import CertificatePackEditResponse = CertificatePacksAPI.CertificatePackEditResponse; export import CertificatePackGetResponse = CertificatePacksAPI.CertificatePackGetResponse; export import CertificatePackListParams = CertificatePacksAPI.CertificatePackListParams; export import Recommendations = RecommendationsAPI.Recommendations; export import RecommendationListResponse = RecommendationsAPI.RecommendationListResponse; export import Universal = UniversalAPI.Universal; export import Verification = VerificationAPI.Verification; - export import VerificationUpdateResponse = VerificationAPI.VerificationUpdateResponse; export import VerificationListResponse = VerificationAPI.VerificationListResponse; - export import VerificationUpdateParams = VerificationAPI.VerificationUpdateParams; + export import VerificationEditResponse = VerificationAPI.VerificationEditResponse; export import VerificationListParams = VerificationAPI.VerificationListParams; + export import VerificationEditParams = VerificationAPI.VerificationEditParams; } diff --git a/src/resources/ssl/universal/index.ts b/src/resources/ssl/universal/index.ts index 6e0b50341b..6f9951d43b 100644 --- a/src/resources/ssl/universal/index.ts +++ b/src/resources/ssl/universal/index.ts @@ -1,4 +1,4 @@ // File generated from our OpenAPI spec by Stainless. -export { SettingUpdateResponse, SettingGetResponse, SettingUpdateParams, Settings } from './settings'; +export { SettingEditResponse, SettingGetResponse, SettingEditParams, Settings } from './settings'; export { Universal } from './universal'; diff --git a/src/resources/ssl/universal/settings.ts b/src/resources/ssl/universal/settings.ts index d8e7d0393c..d8b7c04d98 100644 --- a/src/resources/ssl/universal/settings.ts +++ b/src/resources/ssl/universal/settings.ts @@ -8,14 +8,14 @@ export class Settings extends APIResource { /** * Patch Universal SSL Settings for a Zone. */ - update( + edit( zoneId: string, - body: SettingUpdateParams, + body: SettingEditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.patch(`/zones/${zoneId}/ssl/universal/settings`, { body, ...options }) as Core.APIPromise<{ - result: SettingUpdateResponse; + result: SettingEditResponse; }> )._thenUnwrap((obj) => obj.result); } @@ -32,7 +32,7 @@ export class Settings extends APIResource { } } -export interface SettingUpdateResponse { +export interface SettingEditResponse { /** * Disabling Universal SSL removes any currently active Universal SSL certificates * for your zone from the edge and prevents any future Universal SSL certificates @@ -94,7 +94,7 @@ export interface SettingGetResponse { enabled?: boolean; } -export interface SettingUpdateParams { +export interface SettingEditParams { /** * Disabling Universal SSL removes any currently active Universal SSL certificates * for your zone from the edge and prevents any future Universal SSL certificates @@ -126,7 +126,7 @@ export interface SettingUpdateParams { } export namespace Settings { - export import SettingUpdateResponse = SettingsAPI.SettingUpdateResponse; + export import SettingEditResponse = SettingsAPI.SettingEditResponse; export import SettingGetResponse = SettingsAPI.SettingGetResponse; - export import SettingUpdateParams = SettingsAPI.SettingUpdateParams; + export import SettingEditParams = SettingsAPI.SettingEditParams; } diff --git a/src/resources/ssl/universal/universal.ts b/src/resources/ssl/universal/universal.ts index d4564ae70e..48f214a4ac 100644 --- a/src/resources/ssl/universal/universal.ts +++ b/src/resources/ssl/universal/universal.ts @@ -9,7 +9,7 @@ export class Universal extends APIResource { export namespace Universal { export import Settings = SettingsAPI.Settings; - export import SettingUpdateResponse = SettingsAPI.SettingUpdateResponse; + export import SettingEditResponse = SettingsAPI.SettingEditResponse; export import SettingGetResponse = SettingsAPI.SettingGetResponse; - export import SettingUpdateParams = SettingsAPI.SettingUpdateParams; + export import SettingEditParams = SettingsAPI.SettingEditParams; } diff --git a/src/resources/ssl/verification.ts b/src/resources/ssl/verification.ts index 29385a9c5a..e5482479e1 100644 --- a/src/resources/ssl/verification.ts +++ b/src/resources/ssl/verification.ts @@ -6,26 +6,6 @@ import { isRequestOptions } from 'cloudflare/core'; import * as VerificationAPI from 'cloudflare/resources/ssl/verification'; export class Verification extends APIResource { - /** - * Edit SSL validation method for a certificate pack. A PATCH request will request - * an immediate validation check on any certificate, and return the updated status. - * If a validation method is provided, the validation will be immediately attempted - * using that method. - */ - update( - zoneId: string, - certificatePackId: string, - body: VerificationUpdateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.patch(`/zones/${zoneId}/ssl/verification/${certificatePackId}`, { - body, - ...options, - }) as Core.APIPromise<{ result: VerificationUpdateResponse }> - )._thenUnwrap((obj) => obj.result); - } - /** * Get SSL Verification Info for a Zone. */ @@ -49,18 +29,26 @@ export class Verification extends APIResource { }> )._thenUnwrap((obj) => obj.result); } -} - -export interface VerificationUpdateResponse { - /** - * Result status. - */ - status?: string; /** - * Desired validation method. + * Edit SSL validation method for a certificate pack. A PATCH request will request + * an immediate validation check on any certificate, and return the updated status. + * If a validation method is provided, the validation will be immediately attempted + * using that method. */ - validation_method?: 'http' | 'cname' | 'txt' | 'email'; + edit( + zoneId: string, + certificatePackId: string, + body: VerificationEditParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.patch(`/zones/${zoneId}/ssl/verification/${certificatePackId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: VerificationEditResponse }> + )._thenUnwrap((obj) => obj.result); + } } export type VerificationListResponse = Array; @@ -134,11 +122,16 @@ export namespace VerificationListResponse { } } -export interface VerificationUpdateParams { +export interface VerificationEditResponse { + /** + * Result status. + */ + status?: string; + /** * Desired validation method. */ - validation_method: 'http' | 'cname' | 'txt' | 'email'; + validation_method?: 'http' | 'cname' | 'txt' | 'email'; } export interface VerificationListParams { @@ -148,9 +141,16 @@ export interface VerificationListParams { retry?: true; } +export interface VerificationEditParams { + /** + * Desired validation method. + */ + validation_method: 'http' | 'cname' | 'txt' | 'email'; +} + export namespace Verification { - export import VerificationUpdateResponse = VerificationAPI.VerificationUpdateResponse; export import VerificationListResponse = VerificationAPI.VerificationListResponse; - export import VerificationUpdateParams = VerificationAPI.VerificationUpdateParams; + export import VerificationEditResponse = VerificationAPI.VerificationEditResponse; export import VerificationListParams = VerificationAPI.VerificationListParams; + export import VerificationEditParams = VerificationAPI.VerificationEditParams; } diff --git a/src/resources/storage/kv/index.ts b/src/resources/storage/kv/index.ts index 0bfe2ce301..0d3717ee72 100644 --- a/src/resources/storage/kv/index.ts +++ b/src/resources/storage/kv/index.ts @@ -3,12 +3,12 @@ export { Kv } from './kv'; export { NamespaceCreateResponse, + NamespaceUpdateResponse, NamespaceListResponse, NamespaceDeleteResponse, - NamespaceReplaceResponse, NamespaceCreateParams, + NamespaceUpdateParams, NamespaceListParams, - NamespaceReplaceParams, NamespaceListResponsesV4PagePaginationArray, Namespaces, } from './namespaces/index'; diff --git a/src/resources/storage/kv/kv.ts b/src/resources/storage/kv/kv.ts index 2b3a11dd92..8ef0255dab 100644 --- a/src/resources/storage/kv/kv.ts +++ b/src/resources/storage/kv/kv.ts @@ -10,11 +10,11 @@ export class Kv extends APIResource { export namespace Kv { export import Namespaces = NamespacesAPI.Namespaces; export import NamespaceCreateResponse = NamespacesAPI.NamespaceCreateResponse; + export import NamespaceUpdateResponse = NamespacesAPI.NamespaceUpdateResponse; export import NamespaceListResponse = NamespacesAPI.NamespaceListResponse; export import NamespaceDeleteResponse = NamespacesAPI.NamespaceDeleteResponse; - export import NamespaceReplaceResponse = NamespacesAPI.NamespaceReplaceResponse; export import NamespaceListResponsesV4PagePaginationArray = NamespacesAPI.NamespaceListResponsesV4PagePaginationArray; export import NamespaceCreateParams = NamespacesAPI.NamespaceCreateParams; + export import NamespaceUpdateParams = NamespacesAPI.NamespaceUpdateParams; export import NamespaceListParams = NamespacesAPI.NamespaceListParams; - export import NamespaceReplaceParams = NamespacesAPI.NamespaceReplaceParams; } diff --git a/src/resources/storage/kv/namespaces/bulk.ts b/src/resources/storage/kv/namespaces/bulk.ts index 6727279c11..29ae2060e2 100644 --- a/src/resources/storage/kv/namespaces/bulk.ts +++ b/src/resources/storage/kv/namespaces/bulk.ts @@ -6,55 +6,53 @@ import * as BulkAPI from 'cloudflare/resources/storage/kv/namespaces/bulk'; export class Bulk extends APIResource { /** - * Remove multiple KV pairs from the namespace. Body should be an array of up to - * 10,000 keys to be removed. + * Write multiple keys and values at once. Body should be an array of up to 10,000 + * key-value pairs to be stored, along with optional expiration information. + * Existing values and expirations will be overwritten. If neither `expiration` nor + * `expiration_ttl` is specified, the key-value pair will never expire. If both are + * set, `expiration_ttl` is used and `expiration` is ignored. The entire request + * size must be 100 megabytes or less. */ - delete( + update( accountId: string, namespaceId: string, - body: BulkDeleteParams, + body: BulkUpdateParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( - this._client.delete(`/accounts/${accountId}/storage/kv/namespaces/${namespaceId}/bulk`, { + this._client.put(`/accounts/${accountId}/storage/kv/namespaces/${namespaceId}/bulk`, { body, ...options, - }) as Core.APIPromise<{ result: BulkDeleteResponse }> + }) as Core.APIPromise<{ result: BulkUpdateResponse }> )._thenUnwrap((obj) => obj.result); } /** - * Write multiple keys and values at once. Body should be an array of up to 10,000 - * key-value pairs to be stored, along with optional expiration information. - * Existing values and expirations will be overwritten. If neither `expiration` nor - * `expiration_ttl` is specified, the key-value pair will never expire. If both are - * set, `expiration_ttl` is used and `expiration` is ignored. The entire request - * size must be 100 megabytes or less. + * Remove multiple KV pairs from the namespace. Body should be an array of up to + * 10,000 keys to be removed. */ - replace( + delete( accountId: string, namespaceId: string, - body: BulkReplaceParams, + body: BulkDeleteParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( - this._client.put(`/accounts/${accountId}/storage/kv/namespaces/${namespaceId}/bulk`, { + this._client.delete(`/accounts/${accountId}/storage/kv/namespaces/${namespaceId}/bulk`, { body, ...options, - }) as Core.APIPromise<{ result: BulkReplaceResponse }> + }) as Core.APIPromise<{ result: BulkDeleteResponse }> )._thenUnwrap((obj) => obj.result); } } -export type BulkDeleteResponse = unknown | string; - -export type BulkReplaceResponse = unknown | string; +export type BulkUpdateResponse = unknown | string; -export type BulkDeleteParams = Array; +export type BulkDeleteResponse = unknown | string; -export type BulkReplaceParams = Array; +export type BulkUpdateParams = Array; -export namespace BulkReplaceParams { +export namespace BulkUpdateParams { export interface Body { /** * Whether or not the server should base64 decode the value before storing it. @@ -93,9 +91,11 @@ export namespace BulkReplaceParams { } } +export type BulkDeleteParams = Array; + export namespace Bulk { + export import BulkUpdateResponse = BulkAPI.BulkUpdateResponse; export import BulkDeleteResponse = BulkAPI.BulkDeleteResponse; - export import BulkReplaceResponse = BulkAPI.BulkReplaceResponse; + export import BulkUpdateParams = BulkAPI.BulkUpdateParams; export import BulkDeleteParams = BulkAPI.BulkDeleteParams; - export import BulkReplaceParams = BulkAPI.BulkReplaceParams; } diff --git a/src/resources/storage/kv/namespaces/index.ts b/src/resources/storage/kv/namespaces/index.ts index 7340a3d576..7a89177455 100644 --- a/src/resources/storage/kv/namespaces/index.ts +++ b/src/resources/storage/kv/namespaces/index.ts @@ -1,23 +1,23 @@ // File generated from our OpenAPI spec by Stainless. -export { BulkDeleteResponse, BulkReplaceResponse, BulkDeleteParams, BulkReplaceParams, Bulk } from './bulk'; +export { BulkUpdateResponse, BulkDeleteResponse, BulkUpdateParams, BulkDeleteParams, Bulk } from './bulk'; export { KeyListResponse, KeyListParams, Keys } from './keys'; export { MetadataGetResponse, Metadata } from './metadata'; export { NamespaceCreateResponse, + NamespaceUpdateResponse, NamespaceListResponse, NamespaceDeleteResponse, - NamespaceReplaceResponse, NamespaceCreateParams, + NamespaceUpdateParams, NamespaceListParams, - NamespaceReplaceParams, NamespaceListResponsesV4PagePaginationArray, Namespaces, } from './namespaces'; export { + ValueUpdateResponse, ValueDeleteResponse, ValueGetResponse, - ValueReplaceResponse, - ValueReplaceParams, + ValueUpdateParams, Values, } from './values'; diff --git a/src/resources/storage/kv/namespaces/namespaces.ts b/src/resources/storage/kv/namespaces/namespaces.ts index 5eb8ec0b4d..172ddb44e8 100644 --- a/src/resources/storage/kv/namespaces/namespaces.ts +++ b/src/resources/storage/kv/namespaces/namespaces.ts @@ -34,6 +34,23 @@ export class Namespaces extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Modifies a namespace's title. + */ + update( + accountId: string, + namespaceId: string, + body: NamespaceUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/accounts/${accountId}/storage/kv/namespaces/${namespaceId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: NamespaceUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * Returns the namespaces owned by an account. */ @@ -76,23 +93,6 @@ export class Namespaces extends APIResource { ) as Core.APIPromise<{ result: NamespaceDeleteResponse }> )._thenUnwrap((obj) => obj.result); } - - /** - * Modifies a namespace's title. - */ - replace( - accountId: string, - namespaceId: string, - body: NamespaceReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put(`/accounts/${accountId}/storage/kv/namespaces/${namespaceId}`, { - body, - ...options, - }) as Core.APIPromise<{ result: NamespaceReplaceResponse }> - )._thenUnwrap((obj) => obj.result); - } } export class NamespaceListResponsesV4PagePaginationArray extends V4PagePaginationArray {} @@ -115,6 +115,8 @@ export interface NamespaceCreateResponse { supports_url_encoding?: boolean; } +export type NamespaceUpdateResponse = unknown | string; + export interface NamespaceListResponse { /** * Namespace identifier tag. @@ -135,8 +137,6 @@ export interface NamespaceListResponse { export type NamespaceDeleteResponse = unknown | string; -export type NamespaceReplaceResponse = unknown | string; - export interface NamespaceCreateParams { /** * A human-readable string name for a Namespace. @@ -144,6 +144,13 @@ export interface NamespaceCreateParams { title: string; } +export interface NamespaceUpdateParams { + /** + * A human-readable string name for a Namespace. + */ + title: string; +} + export interface NamespaceListParams extends V4PagePaginationArrayParams { /** * Direction to order namespaces. @@ -156,35 +163,28 @@ export interface NamespaceListParams extends V4PagePaginationArrayParams { order?: 'id' | 'title'; } -export interface NamespaceReplaceParams { - /** - * A human-readable string name for a Namespace. - */ - title: string; -} - export namespace Namespaces { export import NamespaceCreateResponse = NamespacesAPI.NamespaceCreateResponse; + export import NamespaceUpdateResponse = NamespacesAPI.NamespaceUpdateResponse; export import NamespaceListResponse = NamespacesAPI.NamespaceListResponse; export import NamespaceDeleteResponse = NamespacesAPI.NamespaceDeleteResponse; - export import NamespaceReplaceResponse = NamespacesAPI.NamespaceReplaceResponse; export import NamespaceListResponsesV4PagePaginationArray = NamespacesAPI.NamespaceListResponsesV4PagePaginationArray; export import NamespaceCreateParams = NamespacesAPI.NamespaceCreateParams; + export import NamespaceUpdateParams = NamespacesAPI.NamespaceUpdateParams; export import NamespaceListParams = NamespacesAPI.NamespaceListParams; - export import NamespaceReplaceParams = NamespacesAPI.NamespaceReplaceParams; export import Bulk = BulkAPI.Bulk; + export import BulkUpdateResponse = BulkAPI.BulkUpdateResponse; export import BulkDeleteResponse = BulkAPI.BulkDeleteResponse; - export import BulkReplaceResponse = BulkAPI.BulkReplaceResponse; + export import BulkUpdateParams = BulkAPI.BulkUpdateParams; export import BulkDeleteParams = BulkAPI.BulkDeleteParams; - export import BulkReplaceParams = BulkAPI.BulkReplaceParams; export import Keys = KeysAPI.Keys; export import KeyListResponse = KeysAPI.KeyListResponse; export import KeyListParams = KeysAPI.KeyListParams; export import Metadata = MetadataAPI.Metadata; export import MetadataGetResponse = MetadataAPI.MetadataGetResponse; export import Values = ValuesAPI.Values; + export import ValueUpdateResponse = ValuesAPI.ValueUpdateResponse; export import ValueDeleteResponse = ValuesAPI.ValueDeleteResponse; export import ValueGetResponse = ValuesAPI.ValueGetResponse; - export import ValueReplaceResponse = ValuesAPI.ValueReplaceResponse; - export import ValueReplaceParams = ValuesAPI.ValueReplaceParams; + export import ValueUpdateParams = ValuesAPI.ValueUpdateParams; } diff --git a/src/resources/storage/kv/namespaces/values.ts b/src/resources/storage/kv/namespaces/values.ts index 4c67d95004..279ff506cd 100644 --- a/src/resources/storage/kv/namespaces/values.ts +++ b/src/resources/storage/kv/namespaces/values.ts @@ -6,6 +6,29 @@ import * as ValuesAPI from 'cloudflare/resources/storage/kv/namespaces/values'; import { multipartFormRequestOptions } from 'cloudflare/core'; export class Values extends APIResource { + /** + * Write a value identified by a key. Use URL-encoding to use special characters + * (for example, `:`, `!`, `%`) in the key name. Body should be the value to be + * stored along with JSON metadata to be associated with the key/value pair. + * Existing values, expirations, and metadata will be overwritten. If neither + * `expiration` nor `expiration_ttl` is specified, the key-value pair will never + * expire. If both are set, `expiration_ttl` is used and `expiration` is ignored. + */ + update( + accountId: string, + namespaceId: string, + keyName: string, + body: ValueUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put( + `/accounts/${accountId}/storage/kv/namespaces/${namespaceId}/values/${keyName}`, + multipartFormRequestOptions({ body, ...options }), + ) as Core.APIPromise<{ result: ValueUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * Remove a KV pair from the namespace. Use URL-encoding to use special characters * (for example, `:`, `!`, `%`) in the key name. @@ -42,31 +65,10 @@ export class Values extends APIResource { headers: { Accept: 'application/json', ...options?.headers }, }); } - - /** - * Write a value identified by a key. Use URL-encoding to use special characters - * (for example, `:`, `!`, `%`) in the key name. Body should be the value to be - * stored along with JSON metadata to be associated with the key/value pair. - * Existing values, expirations, and metadata will be overwritten. If neither - * `expiration` nor `expiration_ttl` is specified, the key-value pair will never - * expire. If both are set, `expiration_ttl` is used and `expiration` is ignored. - */ - replace( - accountId: string, - namespaceId: string, - keyName: string, - body: ValueReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put( - `/accounts/${accountId}/storage/kv/namespaces/${namespaceId}/values/${keyName}`, - multipartFormRequestOptions({ body, ...options }), - ) as Core.APIPromise<{ result: ValueReplaceResponse }> - )._thenUnwrap((obj) => obj.result); - } } +export type ValueUpdateResponse = unknown | string; + export type ValueDeleteResponse = unknown | string; /** @@ -74,9 +76,7 @@ export type ValueDeleteResponse = unknown | string; */ export type ValueGetResponse = string; -export type ValueReplaceResponse = unknown | string; - -export interface ValueReplaceParams { +export interface ValueUpdateParams { /** * Arbitrary JSON to be associated with a key/value pair. */ @@ -89,8 +89,8 @@ export interface ValueReplaceParams { } export namespace Values { + export import ValueUpdateResponse = ValuesAPI.ValueUpdateResponse; export import ValueDeleteResponse = ValuesAPI.ValueDeleteResponse; export import ValueGetResponse = ValuesAPI.ValueGetResponse; - export import ValueReplaceResponse = ValuesAPI.ValueReplaceResponse; - export import ValueReplaceParams = ValuesAPI.ValueReplaceParams; + export import ValueUpdateParams = ValuesAPI.ValueUpdateParams; } diff --git a/src/resources/stream/audio-tracks.ts b/src/resources/stream/audio-tracks.ts index 825687af09..5902c47570 100644 --- a/src/resources/stream/audio-tracks.ts +++ b/src/resources/stream/audio-tracks.ts @@ -22,26 +22,6 @@ export class AudioTracks extends APIResource { )._thenUnwrap((obj) => obj.result); } - /** - * Edits additional audio tracks on a video. Editing the default status of an audio - * track to `true` will mark all other audio tracks on the video default status to - * `false`. - */ - update( - accountId: string, - identifier: string, - audioIdentifier: string, - body: AudioTrackUpdateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.patch(`/accounts/${accountId}/stream/${identifier}/audio/${audioIdentifier}`, { - body, - ...options, - }) as Core.APIPromise<{ result: AudioTrackUpdateResponse }> - )._thenUnwrap((obj) => obj.result); - } - /** * Lists additional audio tracks on a video. Note this API will not return * information for audio attached to the video upload. @@ -75,32 +55,29 @@ export class AudioTracks extends APIResource { ) as Core.APIPromise<{ result: AudioTrackDeleteResponse }> )._thenUnwrap((obj) => obj.result); } -} - -export interface AudioTrackCreateResponse { - /** - * Denotes whether the audio track will be played by default in a player. - */ - default?: boolean; - - /** - * A string to uniquely identify the track amongst other audio track labels for the - * specified video. - */ - label?: string; /** - * Specifies the processing status of the video. - */ - status?: 'queued' | 'ready' | 'error'; - - /** - * A Cloudflare-generated unique identifier for a media item. + * Edits additional audio tracks on a video. Editing the default status of an audio + * track to `true` will mark all other audio tracks on the video default status to + * `false`. */ - uid?: string; + edit( + accountId: string, + identifier: string, + audioIdentifier: string, + body: AudioTrackEditParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.patch(`/accounts/${accountId}/stream/${identifier}/audio/${audioIdentifier}`, { + body, + ...options, + }) as Core.APIPromise<{ result: AudioTrackEditResponse }> + )._thenUnwrap((obj) => obj.result); + } } -export interface AudioTrackUpdateResponse { +export interface AudioTrackCreateResponse { /** * Denotes whether the audio track will be played by default in a player. */ @@ -152,6 +129,29 @@ export namespace AudioTrackListResponse { export type AudioTrackDeleteResponse = unknown | string; +export interface AudioTrackEditResponse { + /** + * Denotes whether the audio track will be played by default in a player. + */ + default?: boolean; + + /** + * A string to uniquely identify the track amongst other audio track labels for the + * specified video. + */ + label?: string; + + /** + * Specifies the processing status of the video. + */ + status?: 'queued' | 'ready' | 'error'; + + /** + * A Cloudflare-generated unique identifier for a media item. + */ + uid?: string; +} + export interface AudioTrackCreateParams { /** * A string to uniquely identify the track amongst other audio track labels for the @@ -167,7 +167,7 @@ export interface AudioTrackCreateParams { url?: string; } -export interface AudioTrackUpdateParams { +export interface AudioTrackEditParams { /** * Denotes whether the audio track will be played by default in a player. */ @@ -182,9 +182,9 @@ export interface AudioTrackUpdateParams { export namespace AudioTracks { export import AudioTrackCreateResponse = AudioTracksAPI.AudioTrackCreateResponse; - export import AudioTrackUpdateResponse = AudioTracksAPI.AudioTrackUpdateResponse; export import AudioTrackListResponse = AudioTracksAPI.AudioTrackListResponse; export import AudioTrackDeleteResponse = AudioTracksAPI.AudioTrackDeleteResponse; + export import AudioTrackEditResponse = AudioTracksAPI.AudioTrackEditResponse; export import AudioTrackCreateParams = AudioTracksAPI.AudioTrackCreateParams; - export import AudioTrackUpdateParams = AudioTracksAPI.AudioTrackUpdateParams; + export import AudioTrackEditParams = AudioTracksAPI.AudioTrackEditParams; } diff --git a/src/resources/stream/captions.ts b/src/resources/stream/captions.ts index 19e5fd9c17..c8b6ccb459 100644 --- a/src/resources/stream/captions.ts +++ b/src/resources/stream/captions.ts @@ -6,6 +6,25 @@ import * as CaptionsAPI from 'cloudflare/resources/stream/captions'; import { multipartFormRequestOptions } from 'cloudflare/core'; export class Captions extends APIResource { + /** + * Uploads the caption or subtitle file to the endpoint for a specific BCP47 + * language. One caption or subtitle file per language is allowed. + */ + update( + accountId: string, + identifier: string, + language: string, + body: CaptionUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put( + `/accounts/${accountId}/stream/${identifier}/captions/${language}`, + multipartFormRequestOptions({ body, ...options }), + ) as Core.APIPromise<{ result: CaptionUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * Lists the available captions or subtitles for a specific video. */ @@ -37,27 +56,10 @@ export class Captions extends APIResource { ) as Core.APIPromise<{ result: CaptionDeleteResponse }> )._thenUnwrap((obj) => obj.result); } - - /** - * Uploads the caption or subtitle file to the endpoint for a specific BCP47 - * language. One caption or subtitle file per language is allowed. - */ - replace( - accountId: string, - identifier: string, - language: string, - body: CaptionReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put( - `/accounts/${accountId}/stream/${identifier}/captions/${language}`, - multipartFormRequestOptions({ body, ...options }), - ) as Core.APIPromise<{ result: CaptionReplaceResponse }> - )._thenUnwrap((obj) => obj.result); - } } +export type CaptionUpdateResponse = unknown | string; + export type CaptionListResponse = Array; export namespace CaptionListResponse { @@ -76,9 +78,7 @@ export namespace CaptionListResponse { export type CaptionDeleteResponse = unknown | Array | string; -export type CaptionReplaceResponse = unknown | string; - -export interface CaptionReplaceParams { +export interface CaptionUpdateParams { /** * The WebVTT file containing the caption or subtitle content. */ @@ -86,8 +86,8 @@ export interface CaptionReplaceParams { } export namespace Captions { + export import CaptionUpdateResponse = CaptionsAPI.CaptionUpdateResponse; export import CaptionListResponse = CaptionsAPI.CaptionListResponse; export import CaptionDeleteResponse = CaptionsAPI.CaptionDeleteResponse; - export import CaptionReplaceResponse = CaptionsAPI.CaptionReplaceResponse; - export import CaptionReplaceParams = CaptionsAPI.CaptionReplaceParams; + export import CaptionUpdateParams = CaptionsAPI.CaptionUpdateParams; } diff --git a/src/resources/stream/index.ts b/src/resources/stream/index.ts index 9595bf1570..eecada3a4e 100644 --- a/src/resources/stream/index.ts +++ b/src/resources/stream/index.ts @@ -2,18 +2,18 @@ export { AudioTrackCreateResponse, - AudioTrackUpdateResponse, AudioTrackListResponse, AudioTrackDeleteResponse, + AudioTrackEditResponse, AudioTrackCreateParams, - AudioTrackUpdateParams, + AudioTrackEditParams, AudioTracks, } from './audio-tracks'; export { + CaptionUpdateResponse, CaptionListResponse, CaptionDeleteResponse, - CaptionReplaceResponse, - CaptionReplaceParams, + CaptionUpdateParams, Captions, } from './captions'; export { ClipCreateResponse, ClipCreateParams, Clips } from './clips'; @@ -24,12 +24,12 @@ export { EmbedListResponse, Embeds } from './embeds'; export { KeyCreateResponse, KeyListResponse, KeyDeleteResponse, Keys } from './keys'; export { LiveInputCreateResponse, + LiveInputUpdateResponse, LiveInputListResponse, LiveInputGetResponse, - LiveInputReplaceResponse, LiveInputCreateParams, + LiveInputUpdateParams, LiveInputListParams, - LiveInputReplaceParams, LiveInputs, } from './live-inputs/index'; export { @@ -50,9 +50,9 @@ export { Watermarks, } from './watermarks'; export { + WebhookUpdateResponse, WebhookDeleteResponse, WebhookGetResponse, - WebhookReplaceResponse, - WebhookReplaceParams, + WebhookUpdateParams, Webhooks, } from './webhooks'; diff --git a/src/resources/stream/live-inputs/index.ts b/src/resources/stream/live-inputs/index.ts index 48f46a2ae3..3011bf38cc 100644 --- a/src/resources/stream/live-inputs/index.ts +++ b/src/resources/stream/live-inputs/index.ts @@ -2,19 +2,19 @@ export { LiveInputCreateResponse, + LiveInputUpdateResponse, LiveInputListResponse, LiveInputGetResponse, - LiveInputReplaceResponse, LiveInputCreateParams, + LiveInputUpdateParams, LiveInputListParams, - LiveInputReplaceParams, LiveInputs, } from './live-inputs'; export { OutputCreateResponse, + OutputUpdateResponse, OutputListResponse, - OutputReplaceResponse, OutputCreateParams, - OutputReplaceParams, + OutputUpdateParams, Outputs, } from './outputs'; diff --git a/src/resources/stream/live-inputs/live-inputs.ts b/src/resources/stream/live-inputs/live-inputs.ts index a5c6b72169..d40dfcb718 100644 --- a/src/resources/stream/live-inputs/live-inputs.ts +++ b/src/resources/stream/live-inputs/live-inputs.ts @@ -26,6 +26,23 @@ export class LiveInputs extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Updates a specified live input. + */ + update( + accountId: string, + liveInputIdentifier: string, + body: LiveInputUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/accounts/${accountId}/stream/live_inputs/${liveInputIdentifier}`, { + body, + ...options, + }) as Core.APIPromise<{ result: LiveInputUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * Lists the live inputs created for an account. To get the credentials needed to * stream to a specific live input, request a single live input. @@ -82,23 +99,6 @@ export class LiveInputs extends APIResource { ) as Core.APIPromise<{ result: LiveInputGetResponse }> )._thenUnwrap((obj) => obj.result); } - - /** - * Updates a specified live input. - */ - replace( - accountId: string, - liveInputIdentifier: string, - body: LiveInputReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put(`/accounts/${accountId}/stream/live_inputs/${liveInputIdentifier}`, { - body, - ...options, - }) as Core.APIPromise<{ result: LiveInputReplaceResponse }> - )._thenUnwrap((obj) => obj.result); - } } /** @@ -314,58 +314,10 @@ export namespace LiveInputCreateResponse { } } -export interface LiveInputListResponse { - liveInputs?: Array; - - /** - * The total number of remaining live inputs based on cursor position. - */ - range?: number; - - /** - * The total number of live inputs that match the provided filters. - */ - total?: number; -} - -export namespace LiveInputListResponse { - export interface LiveInput { - /** - * The date and time the live input was created. - */ - created?: string; - - /** - * Indicates the number of days after which the live inputs recordings will be - * deleted. When a stream completes and the recording is ready, the value is used - * to calculate a scheduled deletion date for that recording. Omit the field to - * indicate no change, or include with a `null` value to remove an existing - * scheduled deletion. - */ - deleteRecordingAfterDays?: number; - - /** - * A user modifiable key-value store used to reference other systems of record for - * managing live inputs. - */ - meta?: unknown; - - /** - * The date and time the live input was last modified. - */ - modified?: string; - - /** - * A unique identifier for a live input. - */ - uid?: string; - } -} - /** * Details about a live input. */ -export interface LiveInputGetResponse { +export interface LiveInputUpdateResponse { /** * The date and time the live input was created. */ @@ -396,27 +348,27 @@ export interface LiveInputGetResponse { * most cases, the video will initially be viewable as a live video and transition * to on-demand after a condition is satisfied. */ - recording?: LiveInputGetResponse.Recording; + recording?: LiveInputUpdateResponse.Recording; /** * Details for streaming to an live input using RTMPS. */ - rtmps?: LiveInputGetResponse.Rtmps; + rtmps?: LiveInputUpdateResponse.Rtmps; /** * Details for playback from an live input using RTMPS. */ - rtmpsPlayback?: LiveInputGetResponse.RtmpsPlayback; + rtmpsPlayback?: LiveInputUpdateResponse.RtmpsPlayback; /** * Details for streaming to a live input using SRT. */ - srt?: LiveInputGetResponse.Srt; + srt?: LiveInputUpdateResponse.Srt; /** * Details for playback from an live input using SRT. */ - srtPlayback?: LiveInputGetResponse.SrtPlayback; + srtPlayback?: LiveInputUpdateResponse.SrtPlayback; /** * The connection status of a live input. @@ -440,15 +392,15 @@ export interface LiveInputGetResponse { /** * Details for streaming to a live input using WebRTC. */ - webRTC?: LiveInputGetResponse.WebRtc; + webRTC?: LiveInputUpdateResponse.WebRtc; /** * Details for playback from a live input using WebRTC. */ - webRTCPlayback?: LiveInputGetResponse.WebRtcPlayback; + webRTCPlayback?: LiveInputUpdateResponse.WebRtcPlayback; } -export namespace LiveInputGetResponse { +export namespace LiveInputUpdateResponse { /** * Records the input to a Cloudflare Stream video. Behavior depends on the mode. In * most cases, the video will initially be viewable as a live video and transition @@ -575,10 +527,58 @@ export namespace LiveInputGetResponse { } } +export interface LiveInputListResponse { + liveInputs?: Array; + + /** + * The total number of remaining live inputs based on cursor position. + */ + range?: number; + + /** + * The total number of live inputs that match the provided filters. + */ + total?: number; +} + +export namespace LiveInputListResponse { + export interface LiveInput { + /** + * The date and time the live input was created. + */ + created?: string; + + /** + * Indicates the number of days after which the live inputs recordings will be + * deleted. When a stream completes and the recording is ready, the value is used + * to calculate a scheduled deletion date for that recording. Omit the field to + * indicate no change, or include with a `null` value to remove an existing + * scheduled deletion. + */ + deleteRecordingAfterDays?: number; + + /** + * A user modifiable key-value store used to reference other systems of record for + * managing live inputs. + */ + meta?: unknown; + + /** + * The date and time the live input was last modified. + */ + modified?: string; + + /** + * A unique identifier for a live input. + */ + uid?: string; + } +} + /** * Details about a live input. */ -export interface LiveInputReplaceResponse { +export interface LiveInputGetResponse { /** * The date and time the live input was created. */ @@ -609,27 +609,27 @@ export interface LiveInputReplaceResponse { * most cases, the video will initially be viewable as a live video and transition * to on-demand after a condition is satisfied. */ - recording?: LiveInputReplaceResponse.Recording; + recording?: LiveInputGetResponse.Recording; /** * Details for streaming to an live input using RTMPS. */ - rtmps?: LiveInputReplaceResponse.Rtmps; + rtmps?: LiveInputGetResponse.Rtmps; /** * Details for playback from an live input using RTMPS. */ - rtmpsPlayback?: LiveInputReplaceResponse.RtmpsPlayback; + rtmpsPlayback?: LiveInputGetResponse.RtmpsPlayback; /** * Details for streaming to a live input using SRT. */ - srt?: LiveInputReplaceResponse.Srt; + srt?: LiveInputGetResponse.Srt; /** * Details for playback from an live input using SRT. */ - srtPlayback?: LiveInputReplaceResponse.SrtPlayback; + srtPlayback?: LiveInputGetResponse.SrtPlayback; /** * The connection status of a live input. @@ -653,15 +653,15 @@ export interface LiveInputReplaceResponse { /** * Details for streaming to a live input using WebRTC. */ - webRTC?: LiveInputReplaceResponse.WebRtc; + webRTC?: LiveInputGetResponse.WebRtc; /** * Details for playback from a live input using WebRTC. */ - webRTCPlayback?: LiveInputReplaceResponse.WebRtcPlayback; + webRTCPlayback?: LiveInputGetResponse.WebRtcPlayback; } -export namespace LiveInputReplaceResponse { +export namespace LiveInputGetResponse { /** * Records the input to a Cloudflare Stream video. Behavior depends on the mode. In * most cases, the video will initially be viewable as a live video and transition @@ -854,15 +854,7 @@ export namespace LiveInputCreateParams { } } -export interface LiveInputListParams { - /** - * Includes the total number of videos associated with the submitted query - * parameters. - */ - include_counts?: boolean; -} - -export interface LiveInputReplaceParams { +export interface LiveInputUpdateParams { /** * Sets the creator ID asssociated with this live input. */ @@ -888,10 +880,10 @@ export interface LiveInputReplaceParams { * most cases, the video will initially be viewable as a live video and transition * to on-demand after a condition is satisfied. */ - recording?: LiveInputReplaceParams.Recording; + recording?: LiveInputUpdateParams.Recording; } -export namespace LiveInputReplaceParams { +export namespace LiveInputUpdateParams { /** * Records the input to a Cloudflare Stream video. Behavior depends on the mode. In * most cases, the video will initially be viewable as a live video and transition @@ -928,18 +920,26 @@ export namespace LiveInputReplaceParams { } } +export interface LiveInputListParams { + /** + * Includes the total number of videos associated with the submitted query + * parameters. + */ + include_counts?: boolean; +} + export namespace LiveInputs { export import LiveInputCreateResponse = LiveInputsAPI.LiveInputCreateResponse; + export import LiveInputUpdateResponse = LiveInputsAPI.LiveInputUpdateResponse; export import LiveInputListResponse = LiveInputsAPI.LiveInputListResponse; export import LiveInputGetResponse = LiveInputsAPI.LiveInputGetResponse; - export import LiveInputReplaceResponse = LiveInputsAPI.LiveInputReplaceResponse; export import LiveInputCreateParams = LiveInputsAPI.LiveInputCreateParams; + export import LiveInputUpdateParams = LiveInputsAPI.LiveInputUpdateParams; export import LiveInputListParams = LiveInputsAPI.LiveInputListParams; - export import LiveInputReplaceParams = LiveInputsAPI.LiveInputReplaceParams; export import Outputs = OutputsAPI.Outputs; export import OutputCreateResponse = OutputsAPI.OutputCreateResponse; + export import OutputUpdateResponse = OutputsAPI.OutputUpdateResponse; export import OutputListResponse = OutputsAPI.OutputListResponse; - export import OutputReplaceResponse = OutputsAPI.OutputReplaceResponse; export import OutputCreateParams = OutputsAPI.OutputCreateParams; - export import OutputReplaceParams = OutputsAPI.OutputReplaceParams; + export import OutputUpdateParams = OutputsAPI.OutputUpdateParams; } diff --git a/src/resources/stream/live-inputs/outputs.ts b/src/resources/stream/live-inputs/outputs.ts index a23a7d5e83..1ced787b9e 100644 --- a/src/resources/stream/live-inputs/outputs.ts +++ b/src/resources/stream/live-inputs/outputs.ts @@ -24,6 +24,24 @@ export class Outputs extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Updates the state of an output. + */ + update( + accountId: string, + liveInputIdentifier: string, + outputIdentifier: string, + body: OutputUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put( + `/accounts/${accountId}/stream/live_inputs/${liveInputIdentifier}/outputs/${outputIdentifier}`, + { body, ...options }, + ) as Core.APIPromise<{ result: OutputUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * Retrieves all outputs associated with a specified live input. */ @@ -54,27 +72,35 @@ export class Outputs extends APIResource { { ...options, headers: { Accept: '*/*', ...options?.headers } }, ); } +} +export interface OutputCreateResponse { /** - * Updates the state of an output. + * When enabled, live video streamed to the associated live input will be sent to + * the output URL. When disabled, live video will not be sent to the output URL, + * even when streaming to the associated live input. Use this to control precisely + * when you start and stop simulcasting to specific destinations like YouTube and + * Twitch. */ - replace( - accountId: string, - liveInputIdentifier: string, - outputIdentifier: string, - body: OutputReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put( - `/accounts/${accountId}/stream/live_inputs/${liveInputIdentifier}/outputs/${outputIdentifier}`, - { body, ...options }, - ) as Core.APIPromise<{ result: OutputReplaceResponse }> - )._thenUnwrap((obj) => obj.result); - } + enabled?: boolean; + + /** + * The streamKey used to authenticate against an output's target. + */ + streamKey?: string; + + /** + * A unique identifier for the output. + */ + uid?: string; + + /** + * The URL an output uses to restream. + */ + url?: string; } -export interface OutputCreateResponse { +export interface OutputUpdateResponse { /** * When enabled, live video streamed to the associated live input will be sent to * the output URL. When disabled, live video will not be sent to the output URL, @@ -130,32 +156,6 @@ export namespace OutputListResponse { } } -export interface OutputReplaceResponse { - /** - * When enabled, live video streamed to the associated live input will be sent to - * the output URL. When disabled, live video will not be sent to the output URL, - * even when streaming to the associated live input. Use this to control precisely - * when you start and stop simulcasting to specific destinations like YouTube and - * Twitch. - */ - enabled?: boolean; - - /** - * The streamKey used to authenticate against an output's target. - */ - streamKey?: string; - - /** - * A unique identifier for the output. - */ - uid?: string; - - /** - * The URL an output uses to restream. - */ - url?: string; -} - export interface OutputCreateParams { /** * The streamKey used to authenticate against an output's target. @@ -177,7 +177,7 @@ export interface OutputCreateParams { enabled?: boolean; } -export interface OutputReplaceParams { +export interface OutputUpdateParams { /** * When enabled, live video streamed to the associated live input will be sent to * the output URL. When disabled, live video will not be sent to the output URL, @@ -190,8 +190,8 @@ export interface OutputReplaceParams { export namespace Outputs { export import OutputCreateResponse = OutputsAPI.OutputCreateResponse; + export import OutputUpdateResponse = OutputsAPI.OutputUpdateResponse; export import OutputListResponse = OutputsAPI.OutputListResponse; - export import OutputReplaceResponse = OutputsAPI.OutputReplaceResponse; export import OutputCreateParams = OutputsAPI.OutputCreateParams; - export import OutputReplaceParams = OutputsAPI.OutputReplaceParams; + export import OutputUpdateParams = OutputsAPI.OutputUpdateParams; } diff --git a/src/resources/stream/stream.ts b/src/resources/stream/stream.ts index 6b37fe81a5..557b984fc1 100644 --- a/src/resources/stream/stream.ts +++ b/src/resources/stream/stream.ts @@ -709,11 +709,11 @@ export namespace Stream { export import StreamListParams = StreamAPI.StreamListParams; export import AudioTracks = AudioTracksAPI.AudioTracks; export import AudioTrackCreateResponse = AudioTracksAPI.AudioTrackCreateResponse; - export import AudioTrackUpdateResponse = AudioTracksAPI.AudioTrackUpdateResponse; export import AudioTrackListResponse = AudioTracksAPI.AudioTrackListResponse; export import AudioTrackDeleteResponse = AudioTracksAPI.AudioTrackDeleteResponse; + export import AudioTrackEditResponse = AudioTracksAPI.AudioTrackEditResponse; export import AudioTrackCreateParams = AudioTracksAPI.AudioTrackCreateParams; - export import AudioTrackUpdateParams = AudioTracksAPI.AudioTrackUpdateParams; + export import AudioTrackEditParams = AudioTracksAPI.AudioTrackEditParams; export import Videos = VideosAPI.Videos; export import VideoStorageUsageResponse = VideosAPI.VideoStorageUsageResponse; export import VideoStorageUsageParams = VideosAPI.VideoStorageUsageParams; @@ -732,12 +732,12 @@ export namespace Stream { export import KeyDeleteResponse = KeysAPI.KeyDeleteResponse; export import LiveInputs = LiveInputsAPI.LiveInputs; export import LiveInputCreateResponse = LiveInputsAPI.LiveInputCreateResponse; + export import LiveInputUpdateResponse = LiveInputsAPI.LiveInputUpdateResponse; export import LiveInputListResponse = LiveInputsAPI.LiveInputListResponse; export import LiveInputGetResponse = LiveInputsAPI.LiveInputGetResponse; - export import LiveInputReplaceResponse = LiveInputsAPI.LiveInputReplaceResponse; export import LiveInputCreateParams = LiveInputsAPI.LiveInputCreateParams; + export import LiveInputUpdateParams = LiveInputsAPI.LiveInputUpdateParams; export import LiveInputListParams = LiveInputsAPI.LiveInputListParams; - export import LiveInputReplaceParams = LiveInputsAPI.LiveInputReplaceParams; export import Watermarks = WatermarksAPI.Watermarks; export import WatermarkCreateResponse = WatermarksAPI.WatermarkCreateResponse; export import WatermarkListResponse = WatermarksAPI.WatermarkListResponse; @@ -745,15 +745,15 @@ export namespace Stream { export import WatermarkGetResponse = WatermarksAPI.WatermarkGetResponse; export import WatermarkCreateParams = WatermarksAPI.WatermarkCreateParams; export import Webhooks = WebhooksAPI.Webhooks; + export import WebhookUpdateResponse = WebhooksAPI.WebhookUpdateResponse; export import WebhookDeleteResponse = WebhooksAPI.WebhookDeleteResponse; export import WebhookGetResponse = WebhooksAPI.WebhookGetResponse; - export import WebhookReplaceResponse = WebhooksAPI.WebhookReplaceResponse; - export import WebhookReplaceParams = WebhooksAPI.WebhookReplaceParams; + export import WebhookUpdateParams = WebhooksAPI.WebhookUpdateParams; export import Captions = CaptionsAPI.Captions; + export import CaptionUpdateResponse = CaptionsAPI.CaptionUpdateResponse; export import CaptionListResponse = CaptionsAPI.CaptionListResponse; export import CaptionDeleteResponse = CaptionsAPI.CaptionDeleteResponse; - export import CaptionReplaceResponse = CaptionsAPI.CaptionReplaceResponse; - export import CaptionReplaceParams = CaptionsAPI.CaptionReplaceParams; + export import CaptionUpdateParams = CaptionsAPI.CaptionUpdateParams; export import Downloads = DownloadsAPI.Downloads; export import DownloadCreateResponse = DownloadsAPI.DownloadCreateResponse; export import DownloadListResponse = DownloadsAPI.DownloadListResponse; diff --git a/src/resources/stream/webhooks.ts b/src/resources/stream/webhooks.ts index 03bef3a76d..b799cbae4c 100644 --- a/src/resources/stream/webhooks.ts +++ b/src/resources/stream/webhooks.ts @@ -5,6 +5,21 @@ import { APIResource } from 'cloudflare/resource'; import * as WebhooksAPI from 'cloudflare/resources/stream/webhooks'; export class Webhooks extends APIResource { + /** + * Creates a webhook notification. + */ + update( + accountId: string, + body: WebhookUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/accounts/${accountId}/stream/webhook`, { body, ...options }) as Core.APIPromise<{ + result: WebhookUpdateResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + /** * Deletes a webhook. */ @@ -26,30 +41,15 @@ export class Webhooks extends APIResource { }> )._thenUnwrap((obj) => obj.result); } - - /** - * Creates a webhook notification. - */ - replace( - accountId: string, - body: WebhookReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put(`/accounts/${accountId}/stream/webhook`, { body, ...options }) as Core.APIPromise<{ - result: WebhookReplaceResponse; - }> - )._thenUnwrap((obj) => obj.result); - } } +export type WebhookUpdateResponse = unknown | string; + export type WebhookDeleteResponse = unknown | string; export type WebhookGetResponse = unknown | string; -export type WebhookReplaceResponse = unknown | string; - -export interface WebhookReplaceParams { +export interface WebhookUpdateParams { /** * The URL where webhooks will be sent. */ @@ -57,8 +57,8 @@ export interface WebhookReplaceParams { } export namespace Webhooks { + export import WebhookUpdateResponse = WebhooksAPI.WebhookUpdateResponse; export import WebhookDeleteResponse = WebhooksAPI.WebhookDeleteResponse; export import WebhookGetResponse = WebhooksAPI.WebhookGetResponse; - export import WebhookReplaceResponse = WebhooksAPI.WebhookReplaceResponse; - export import WebhookReplaceParams = WebhooksAPI.WebhookReplaceParams; + export import WebhookUpdateParams = WebhooksAPI.WebhookUpdateParams; } diff --git a/src/resources/subscriptions.ts b/src/resources/subscriptions.ts index a7f0fedf09..01190e5221 100644 --- a/src/resources/subscriptions.ts +++ b/src/resources/subscriptions.ts @@ -20,6 +20,23 @@ export class Subscriptions extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Updates an account subscription. + */ + update( + accountIdentifier: string, + subscriptionIdentifier: string, + body: SubscriptionUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/accounts/${accountIdentifier}/subscriptions/${subscriptionIdentifier}`, { + body, + ...options, + }) as Core.APIPromise<{ result: SubscriptionUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * Lists all of an account's subscriptions. */ @@ -60,27 +77,12 @@ export class Subscriptions extends APIResource { }> )._thenUnwrap((obj) => obj.result); } - - /** - * Updates an account subscription. - */ - replace( - accountIdentifier: string, - subscriptionIdentifier: string, - body: SubscriptionReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put(`/accounts/${accountIdentifier}/subscriptions/${subscriptionIdentifier}`, { - body, - ...options, - }) as Core.APIPromise<{ result: SubscriptionReplaceResponse }> - )._thenUnwrap((obj) => obj.result); - } } export type SubscriptionCreateResponse = unknown | string | null; +export type SubscriptionUpdateResponse = unknown | string | null; + export type SubscriptionListResponse = Array; export namespace SubscriptionListResponse { @@ -238,8 +240,6 @@ export interface SubscriptionDeleteResponse { export type SubscriptionGetResponse = unknown | string | null; -export type SubscriptionReplaceResponse = unknown | string | null; - export interface SubscriptionCreateParams { app?: SubscriptionCreateParams.App; @@ -343,13 +343,13 @@ export namespace SubscriptionCreateParams { export interface Zone {} } -export interface SubscriptionReplaceParams { - app?: SubscriptionReplaceParams.App; +export interface SubscriptionUpdateParams { + app?: SubscriptionUpdateParams.App; /** * The list of add-ons subscribed to. */ - component_values?: Array; + component_values?: Array; /** * How often the subscription is renewed automatically. @@ -359,15 +359,15 @@ export interface SubscriptionReplaceParams { /** * The rate plan applied to the subscription. */ - rate_plan?: SubscriptionReplaceParams.RatePlan; + rate_plan?: SubscriptionUpdateParams.RatePlan; /** * A simple zone object. May have null properties if not a zone subscription. */ - zone?: SubscriptionReplaceParams.Zone; + zone?: SubscriptionUpdateParams.Zone; } -export namespace SubscriptionReplaceParams { +export namespace SubscriptionUpdateParams { export interface App { /** * app install id. @@ -448,10 +448,10 @@ export namespace SubscriptionReplaceParams { export namespace Subscriptions { export import SubscriptionCreateResponse = SubscriptionsAPI.SubscriptionCreateResponse; + export import SubscriptionUpdateResponse = SubscriptionsAPI.SubscriptionUpdateResponse; export import SubscriptionListResponse = SubscriptionsAPI.SubscriptionListResponse; export import SubscriptionDeleteResponse = SubscriptionsAPI.SubscriptionDeleteResponse; export import SubscriptionGetResponse = SubscriptionsAPI.SubscriptionGetResponse; - export import SubscriptionReplaceResponse = SubscriptionsAPI.SubscriptionReplaceResponse; export import SubscriptionCreateParams = SubscriptionsAPI.SubscriptionCreateParams; - export import SubscriptionReplaceParams = SubscriptionsAPI.SubscriptionReplaceParams; + export import SubscriptionUpdateParams = SubscriptionsAPI.SubscriptionUpdateParams; } diff --git a/src/resources/teamnet/index.ts b/src/resources/teamnet/index.ts index 909a8bdc58..1b12a11d94 100644 --- a/src/resources/teamnet/index.ts +++ b/src/resources/teamnet/index.ts @@ -2,10 +2,10 @@ export { RouteCreateResponse, - RouteUpdateResponse, RouteDeleteResponse, + RouteEditResponse, RouteCreateParams, - RouteUpdateParams, + RouteEditParams, Routes, } from './routes'; export { Teamnet } from './teamnet'; diff --git a/src/resources/teamnet/routes.ts b/src/resources/teamnet/routes.ts index 2c4022d515..728f2381f2 100644 --- a/src/resources/teamnet/routes.ts +++ b/src/resources/teamnet/routes.ts @@ -21,35 +21,35 @@ export class Routes extends APIResource { } /** - * Updates an existing private network route in an account. The fields that are - * meant to be updated should be provided in the body of the request. + * Deletes a private network route from an account. */ - update( + delete( accountId: string, routeId: string, - body: RouteUpdateParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( - this._client.patch(`/accounts/${accountId}/teamnet/routes/${routeId}`, { - body, - ...options, - }) as Core.APIPromise<{ result: RouteUpdateResponse }> + this._client.delete(`/accounts/${accountId}/teamnet/routes/${routeId}`, options) as Core.APIPromise<{ + result: RouteDeleteResponse; + }> )._thenUnwrap((obj) => obj.result); } /** - * Deletes a private network route from an account. + * Updates an existing private network route in an account. The fields that are + * meant to be updated should be provided in the body of the request. */ - delete( + edit( accountId: string, routeId: string, + body: RouteEditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( - this._client.delete(`/accounts/${accountId}/teamnet/routes/${routeId}`, options) as Core.APIPromise<{ - result: RouteDeleteResponse; - }> + this._client.patch(`/accounts/${accountId}/teamnet/routes/${routeId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: RouteEditResponse }> )._thenUnwrap((obj) => obj.result); } } @@ -94,7 +94,7 @@ export interface RouteCreateResponse { virtual_network_id?: unknown; } -export interface RouteUpdateResponse { +export interface RouteDeleteResponse { /** * UUID of the route. */ @@ -134,7 +134,7 @@ export interface RouteUpdateResponse { virtual_network_id?: unknown; } -export interface RouteDeleteResponse { +export interface RouteEditResponse { /** * UUID of the route. */ @@ -193,7 +193,7 @@ export interface RouteCreateParams { virtual_network_id?: unknown; } -export interface RouteUpdateParams { +export interface RouteEditParams { /** * Optional remark describing the route. */ @@ -224,8 +224,8 @@ export interface RouteUpdateParams { export namespace Routes { export import RouteCreateResponse = RoutesAPI.RouteCreateResponse; - export import RouteUpdateResponse = RoutesAPI.RouteUpdateResponse; export import RouteDeleteResponse = RoutesAPI.RouteDeleteResponse; + export import RouteEditResponse = RoutesAPI.RouteEditResponse; export import RouteCreateParams = RoutesAPI.RouteCreateParams; - export import RouteUpdateParams = RoutesAPI.RouteUpdateParams; + export import RouteEditParams = RoutesAPI.RouteEditParams; } diff --git a/src/resources/teamnet/teamnet.ts b/src/resources/teamnet/teamnet.ts index 96a44f3843..d456ddf1dc 100644 --- a/src/resources/teamnet/teamnet.ts +++ b/src/resources/teamnet/teamnet.ts @@ -10,8 +10,8 @@ export class Teamnet extends APIResource { export namespace Teamnet { export import Routes = RoutesAPI.Routes; export import RouteCreateResponse = RoutesAPI.RouteCreateResponse; - export import RouteUpdateResponse = RoutesAPI.RouteUpdateResponse; export import RouteDeleteResponse = RoutesAPI.RouteDeleteResponse; + export import RouteEditResponse = RoutesAPI.RouteEditResponse; export import RouteCreateParams = RoutesAPI.RouteCreateParams; - export import RouteUpdateParams = RoutesAPI.RouteUpdateParams; + export import RouteEditParams = RoutesAPI.RouteEditParams; } diff --git a/src/resources/teamnets/index.ts b/src/resources/teamnets/index.ts index afcc0bd681..a8b6587fd1 100644 --- a/src/resources/teamnets/index.ts +++ b/src/resources/teamnets/index.ts @@ -9,11 +9,11 @@ export { export { Teamnets } from './teamnets'; export { VirtualNetworkCreateResponse, - VirtualNetworkUpdateResponse, VirtualNetworkListResponse, VirtualNetworkDeleteResponse, + VirtualNetworkEditResponse, VirtualNetworkCreateParams, - VirtualNetworkUpdateParams, VirtualNetworkListParams, + VirtualNetworkEditParams, VirtualNetworks, } from './virtual-networks'; diff --git a/src/resources/teamnets/teamnets.ts b/src/resources/teamnets/teamnets.ts index 3ea13c9575..ecd43d696e 100644 --- a/src/resources/teamnets/teamnets.ts +++ b/src/resources/teamnets/teamnets.ts @@ -16,10 +16,10 @@ export namespace Teamnets { export import RouteListParams = RoutesAPI.RouteListParams; export import VirtualNetworks = VirtualNetworksAPI.VirtualNetworks; export import VirtualNetworkCreateResponse = VirtualNetworksAPI.VirtualNetworkCreateResponse; - export import VirtualNetworkUpdateResponse = VirtualNetworksAPI.VirtualNetworkUpdateResponse; export import VirtualNetworkListResponse = VirtualNetworksAPI.VirtualNetworkListResponse; export import VirtualNetworkDeleteResponse = VirtualNetworksAPI.VirtualNetworkDeleteResponse; + export import VirtualNetworkEditResponse = VirtualNetworksAPI.VirtualNetworkEditResponse; export import VirtualNetworkCreateParams = VirtualNetworksAPI.VirtualNetworkCreateParams; - export import VirtualNetworkUpdateParams = VirtualNetworksAPI.VirtualNetworkUpdateParams; export import VirtualNetworkListParams = VirtualNetworksAPI.VirtualNetworkListParams; + export import VirtualNetworkEditParams = VirtualNetworksAPI.VirtualNetworkEditParams; } diff --git a/src/resources/teamnets/virtual-networks.ts b/src/resources/teamnets/virtual-networks.ts index 6f222deedb..bc5ada843f 100644 --- a/src/resources/teamnets/virtual-networks.ts +++ b/src/resources/teamnets/virtual-networks.ts @@ -22,23 +22,6 @@ export class VirtualNetworks extends APIResource { )._thenUnwrap((obj) => obj.result); } - /** - * Updates an existing virtual network. - */ - update( - accountId: string, - virtualNetworkId: string, - body: VirtualNetworkUpdateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.patch(`/accounts/${accountId}/teamnet/virtual_networks/${virtualNetworkId}`, { - body, - ...options, - }) as Core.APIPromise<{ result: VirtualNetworkUpdateResponse }> - )._thenUnwrap((obj) => obj.result); - } - /** * Lists and filters virtual networks in an account. */ @@ -79,12 +62,27 @@ export class VirtualNetworks extends APIResource { ) as Core.APIPromise<{ result: VirtualNetworkDeleteResponse }> )._thenUnwrap((obj) => obj.result); } + + /** + * Updates an existing virtual network. + */ + edit( + accountId: string, + virtualNetworkId: string, + body: VirtualNetworkEditParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.patch(`/accounts/${accountId}/teamnet/virtual_networks/${virtualNetworkId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: VirtualNetworkEditResponse }> + )._thenUnwrap((obj) => obj.result); + } } export type VirtualNetworkCreateResponse = unknown | Array | string; -export type VirtualNetworkUpdateResponse = unknown | Array | string; - export type VirtualNetworkListResponse = Array; export namespace VirtualNetworkListResponse { @@ -124,6 +122,8 @@ export namespace VirtualNetworkListResponse { export type VirtualNetworkDeleteResponse = unknown | Array | string; +export type VirtualNetworkEditResponse = unknown | Array | string; + export interface VirtualNetworkCreateParams { /** * A user-friendly name for the virtual network. @@ -141,53 +141,53 @@ export interface VirtualNetworkCreateParams { is_default?: boolean; } -export interface VirtualNetworkUpdateParams { +export interface VirtualNetworkListParams { /** - * Optional remark describing the virtual network. + * If `true`, only include the default virtual network. If `false`, exclude the + * default virtual network. If empty, all virtual networks will be included. */ - comment?: string; + is_default?: unknown; /** - * If `true`, this virtual network is the default for the account. + * If `true`, only include deleted virtual networks. If `false`, exclude deleted + * virtual networks. If empty, all virtual networks will be included. */ - is_default_network?: boolean; + is_deleted?: unknown; /** * A user-friendly name for the virtual network. */ name?: string; -} -export interface VirtualNetworkListParams { /** - * If `true`, only include the default virtual network. If `false`, exclude the - * default virtual network. If empty, all virtual networks will be included. + * A user-friendly name for the virtual network. */ - is_default?: unknown; + vnet_name?: string; +} +export interface VirtualNetworkEditParams { /** - * If `true`, only include deleted virtual networks. If `false`, exclude deleted - * virtual networks. If empty, all virtual networks will be included. + * Optional remark describing the virtual network. */ - is_deleted?: unknown; + comment?: string; /** - * A user-friendly name for the virtual network. + * If `true`, this virtual network is the default for the account. */ - name?: string; + is_default_network?: boolean; /** * A user-friendly name for the virtual network. */ - vnet_name?: string; + name?: string; } export namespace VirtualNetworks { export import VirtualNetworkCreateResponse = VirtualNetworksAPI.VirtualNetworkCreateResponse; - export import VirtualNetworkUpdateResponse = VirtualNetworksAPI.VirtualNetworkUpdateResponse; export import VirtualNetworkListResponse = VirtualNetworksAPI.VirtualNetworkListResponse; export import VirtualNetworkDeleteResponse = VirtualNetworksAPI.VirtualNetworkDeleteResponse; + export import VirtualNetworkEditResponse = VirtualNetworksAPI.VirtualNetworkEditResponse; export import VirtualNetworkCreateParams = VirtualNetworksAPI.VirtualNetworkCreateParams; - export import VirtualNetworkUpdateParams = VirtualNetworksAPI.VirtualNetworkUpdateParams; export import VirtualNetworkListParams = VirtualNetworksAPI.VirtualNetworkListParams; + export import VirtualNetworkEditParams = VirtualNetworksAPI.VirtualNetworkEditParams; } diff --git a/src/resources/tunnels/configurations.ts b/src/resources/tunnels/configurations.ts index 8788587261..aac8c8c876 100644 --- a/src/resources/tunnels/configurations.ts +++ b/src/resources/tunnels/configurations.ts @@ -6,51 +6,51 @@ import * as ConfigurationsAPI from 'cloudflare/resources/tunnels/configurations' export class Configurations extends APIResource { /** - * Gets the configuration for a remotely-managed tunnel + * Adds or updates the configuration for a remotely-managed tunnel. */ - list( + update( accountId: string, tunnelId: string, + body: ConfigurationUpdateParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( - this._client.get( - `/accounts/${accountId}/cfd_tunnel/${tunnelId}/configurations`, - options, - ) as Core.APIPromise<{ result: ConfigurationListResponse }> + this._client.put(`/accounts/${accountId}/cfd_tunnel/${tunnelId}/configurations`, { + body, + ...options, + }) as Core.APIPromise<{ result: ConfigurationUpdateResponse }> )._thenUnwrap((obj) => obj.result); } /** - * Adds or updates the configuration for a remotely-managed tunnel. + * Gets the configuration for a remotely-managed tunnel */ - replace( + list( accountId: string, tunnelId: string, - body: ConfigurationReplaceParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( - this._client.put(`/accounts/${accountId}/cfd_tunnel/${tunnelId}/configurations`, { - body, - ...options, - }) as Core.APIPromise<{ result: ConfigurationReplaceResponse }> + this._client.get( + `/accounts/${accountId}/cfd_tunnel/${tunnelId}/configurations`, + options, + ) as Core.APIPromise<{ result: ConfigurationListResponse }> )._thenUnwrap((obj) => obj.result); } } -export type ConfigurationListResponse = unknown | Array | string; +export type ConfigurationUpdateResponse = unknown | Array | string; -export type ConfigurationReplaceResponse = unknown | Array | string; +export type ConfigurationListResponse = unknown | Array | string; -export interface ConfigurationReplaceParams { +export interface ConfigurationUpdateParams { /** * The tunnel configuration and ingress rules. */ - config?: ConfigurationReplaceParams.Config; + config?: ConfigurationUpdateParams.Config; } -export namespace ConfigurationReplaceParams { +export namespace ConfigurationUpdateParams { /** * The tunnel configuration and ingress rules. */ @@ -327,7 +327,7 @@ export namespace ConfigurationReplaceParams { } export namespace Configurations { + export import ConfigurationUpdateResponse = ConfigurationsAPI.ConfigurationUpdateResponse; export import ConfigurationListResponse = ConfigurationsAPI.ConfigurationListResponse; - export import ConfigurationReplaceResponse = ConfigurationsAPI.ConfigurationReplaceResponse; - export import ConfigurationReplaceParams = ConfigurationsAPI.ConfigurationReplaceParams; + export import ConfigurationUpdateParams = ConfigurationsAPI.ConfigurationUpdateParams; } diff --git a/src/resources/tunnels/index.ts b/src/resources/tunnels/index.ts index a0e2539a2b..3d2aedc46c 100644 --- a/src/resources/tunnels/index.ts +++ b/src/resources/tunnels/index.ts @@ -1,9 +1,9 @@ // File generated from our OpenAPI spec by Stainless. export { + ConfigurationUpdateResponse, ConfigurationListResponse, - ConfigurationReplaceResponse, - ConfigurationReplaceParams, + ConfigurationUpdateParams, Configurations, } from './configurations'; export { @@ -17,14 +17,14 @@ export { ManagementCreateResponse, ManagementCreateParams, Management } from './ export { TokenGetResponse, Tokens } from './tokens'; export { TunnelCreateResponse, - TunnelUpdateResponse, TunnelListResponse, TunnelDeleteResponse, + TunnelEditResponse, TunnelGetResponse, TunnelCreateParams, - TunnelUpdateParams, TunnelListParams, TunnelDeleteParams, + TunnelEditParams, TunnelListResponsesV4PagePaginationArray, Tunnels, } from './tunnels'; diff --git a/src/resources/tunnels/tunnels.ts b/src/resources/tunnels/tunnels.ts index 7ab2b0cae7..2944140d11 100644 --- a/src/resources/tunnels/tunnels.ts +++ b/src/resources/tunnels/tunnels.ts @@ -33,23 +33,6 @@ export class Tunnels extends APIResource { )._thenUnwrap((obj) => obj.result); } - /** - * Updates an existing Cloudflare Tunnel. - */ - update( - accountId: string, - tunnelId: string, - body: TunnelUpdateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.patch(`/accounts/${accountId}/cfd_tunnel/${tunnelId}`, { - body, - ...options, - }) as Core.APIPromise<{ result: TunnelUpdateResponse }> - )._thenUnwrap((obj) => obj.result); - } - /** * Lists and filters all types of Tunnels in an account. */ @@ -94,6 +77,23 @@ export class Tunnels extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Updates an existing Cloudflare Tunnel. + */ + edit( + accountId: string, + tunnelId: string, + body: TunnelEditParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.patch(`/accounts/${accountId}/cfd_tunnel/${tunnelId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: TunnelEditResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * Fetches a single Argo Tunnel. */ @@ -165,11 +165,11 @@ export namespace TunnelCreateResponse { /** * A Cloudflare Tunnel that connects your origin to Cloudflare's edge. */ -export type TunnelUpdateResponse = - | TunnelUpdateResponse.TunnelCfdTunnel - | TunnelUpdateResponse.TunnelWarpConnectorTunnel; +export type TunnelListResponse = + | TunnelListResponse.TunnelCfdTunnel + | TunnelListResponse.TunnelWarpConnectorTunnel; -export namespace TunnelUpdateResponse { +export namespace TunnelListResponse { /** * A Cloudflare Tunnel that connects your origin to Cloudflare's edge. */ @@ -403,14 +403,64 @@ export namespace TunnelUpdateResponse { } } +export interface TunnelDeleteResponse { + /** + * UUID of the tunnel. + */ + id: string; + + /** + * The tunnel connections between your origin and Cloudflare's edge. + */ + connections: Array; + + /** + * Timestamp of when the tunnel was created. + */ + created_at: string; + + /** + * A user-friendly name for the tunnel. + */ + name: string; + + /** + * Timestamp of when the tunnel was deleted. If `null`, the tunnel has not been + * deleted. + */ + deleted_at?: string | null; +} + +export namespace TunnelDeleteResponse { + export interface Connection { + /** + * The Cloudflare data center used for this connection. + */ + colo_name?: string; + + /** + * Cloudflare continues to track connections for several minutes after they + * disconnect. This is an optimization to improve latency and reliability of + * reconnecting. If `true`, the connection has disconnected but is still being + * tracked. If `false`, the connection is actively serving traffic. + */ + is_pending_reconnect?: boolean; + + /** + * UUID of the Cloudflare Tunnel connection. + */ + uuid?: string; + } +} + /** * A Cloudflare Tunnel that connects your origin to Cloudflare's edge. */ -export type TunnelListResponse = - | TunnelListResponse.TunnelCfdTunnel - | TunnelListResponse.TunnelWarpConnectorTunnel; +export type TunnelEditResponse = + | TunnelEditResponse.TunnelCfdTunnel + | TunnelEditResponse.TunnelWarpConnectorTunnel; -export namespace TunnelListResponse { +export namespace TunnelEditResponse { /** * A Cloudflare Tunnel that connects your origin to Cloudflare's edge. */ @@ -644,56 +694,6 @@ export namespace TunnelListResponse { } } -export interface TunnelDeleteResponse { - /** - * UUID of the tunnel. - */ - id: string; - - /** - * The tunnel connections between your origin and Cloudflare's edge. - */ - connections: Array; - - /** - * Timestamp of when the tunnel was created. - */ - created_at: string; - - /** - * A user-friendly name for the tunnel. - */ - name: string; - - /** - * Timestamp of when the tunnel was deleted. If `null`, the tunnel has not been - * deleted. - */ - deleted_at?: string | null; -} - -export namespace TunnelDeleteResponse { - export interface Connection { - /** - * The Cloudflare data center used for this connection. - */ - colo_name?: string; - - /** - * Cloudflare continues to track connections for several minutes after they - * disconnect. This is an optimization to improve latency and reliability of - * reconnecting. If `true`, the connection has disconnected but is still being - * tracked. If `false`, the connection is actively serving traffic. - */ - is_pending_reconnect?: boolean; - - /** - * UUID of the Cloudflare Tunnel connection. - */ - uuid?: string; - } -} - export interface TunnelGetResponse { /** * UUID of the tunnel. @@ -757,19 +757,6 @@ export interface TunnelCreateParams { tunnel_secret: unknown; } -export interface TunnelUpdateParams { - /** - * A user-friendly name for the tunnel. - */ - name?: string; - - /** - * Sets the password required to run a locally-managed tunnel. Must be at least 32 - * bytes and encoded as a base64 string. - */ - tunnel_secret?: string; -} - export interface TunnelListParams extends V4PagePaginationArrayParams { exclude_prefix?: string; @@ -804,21 +791,34 @@ export interface TunnelListParams extends V4PagePaginationArrayParams { export type TunnelDeleteParams = unknown; +export interface TunnelEditParams { + /** + * A user-friendly name for the tunnel. + */ + name?: string; + + /** + * Sets the password required to run a locally-managed tunnel. Must be at least 32 + * bytes and encoded as a base64 string. + */ + tunnel_secret?: string; +} + export namespace Tunnels { export import TunnelCreateResponse = TunnelsAPI.TunnelCreateResponse; - export import TunnelUpdateResponse = TunnelsAPI.TunnelUpdateResponse; export import TunnelListResponse = TunnelsAPI.TunnelListResponse; export import TunnelDeleteResponse = TunnelsAPI.TunnelDeleteResponse; + export import TunnelEditResponse = TunnelsAPI.TunnelEditResponse; export import TunnelGetResponse = TunnelsAPI.TunnelGetResponse; export import TunnelListResponsesV4PagePaginationArray = TunnelsAPI.TunnelListResponsesV4PagePaginationArray; export import TunnelCreateParams = TunnelsAPI.TunnelCreateParams; - export import TunnelUpdateParams = TunnelsAPI.TunnelUpdateParams; export import TunnelListParams = TunnelsAPI.TunnelListParams; export import TunnelDeleteParams = TunnelsAPI.TunnelDeleteParams; + export import TunnelEditParams = TunnelsAPI.TunnelEditParams; export import Configurations = ConfigurationsAPI.Configurations; + export import ConfigurationUpdateResponse = ConfigurationsAPI.ConfigurationUpdateResponse; export import ConfigurationListResponse = ConfigurationsAPI.ConfigurationListResponse; - export import ConfigurationReplaceResponse = ConfigurationsAPI.ConfigurationReplaceResponse; - export import ConfigurationReplaceParams = ConfigurationsAPI.ConfigurationReplaceParams; + export import ConfigurationUpdateParams = ConfigurationsAPI.ConfigurationUpdateParams; export import Connections = ConnectionsAPI.Connections; export import ConnectionListResponse = ConnectionsAPI.ConnectionListResponse; export import ConnectionDeleteResponse = ConnectionsAPI.ConnectionDeleteResponse; diff --git a/src/resources/url-normalizations.ts b/src/resources/url-normalizations.ts index da7a508e04..b6ccca129a 100644 --- a/src/resources/url-normalizations.ts +++ b/src/resources/url-normalizations.ts @@ -5,26 +5,26 @@ import { APIResource } from 'cloudflare/resource'; import * as URLNormalizationsAPI from 'cloudflare/resources/url-normalizations'; export class URLNormalizations extends APIResource { - /** - * Fetches the current URL normalization settings. - */ - get(zoneId: string, options?: Core.RequestOptions): Core.APIPromise { - return this._client.get(`/zones/${zoneId}/url_normalization`, options); - } - /** * Updates the URL normalization settings. */ - replace( + update( zoneId: string, - body: URLNormalizationReplaceParams, + body: URLNormalizationUpdateParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return this._client.put(`/zones/${zoneId}/url_normalization`, { body, ...options }); } + + /** + * Fetches the current URL normalization settings. + */ + get(zoneId: string, options?: Core.RequestOptions): Core.APIPromise { + return this._client.get(`/zones/${zoneId}/url_normalization`, options); + } } -export interface URLNormalizationGetResponse { +export interface URLNormalizationUpdateResponse { /** * The scope of the URL normalization. */ @@ -36,7 +36,7 @@ export interface URLNormalizationGetResponse { type?: string; } -export interface URLNormalizationReplaceResponse { +export interface URLNormalizationGetResponse { /** * The scope of the URL normalization. */ @@ -48,7 +48,7 @@ export interface URLNormalizationReplaceResponse { type?: string; } -export interface URLNormalizationReplaceParams { +export interface URLNormalizationUpdateParams { /** * The scope of the URL normalization. */ @@ -61,7 +61,7 @@ export interface URLNormalizationReplaceParams { } export namespace URLNormalizations { + export import URLNormalizationUpdateResponse = URLNormalizationsAPI.URLNormalizationUpdateResponse; export import URLNormalizationGetResponse = URLNormalizationsAPI.URLNormalizationGetResponse; - export import URLNormalizationReplaceResponse = URLNormalizationsAPI.URLNormalizationReplaceResponse; - export import URLNormalizationReplaceParams = URLNormalizationsAPI.URLNormalizationReplaceParams; + export import URLNormalizationUpdateParams = URLNormalizationsAPI.URLNormalizationUpdateParams; } diff --git a/src/resources/users/firewall/access-rules/access-rules.ts b/src/resources/users/firewall/access-rules/access-rules.ts index 6cf476498f..1a608bf7e1 100644 --- a/src/resources/users/firewall/access-rules/access-rules.ts +++ b/src/resources/users/firewall/access-rules/access-rules.ts @@ -10,11 +10,11 @@ export class AccessRules extends APIResource { export namespace AccessRules { export import Rules = RulesAPI.Rules; export import RuleCreateResponse = RulesAPI.RuleCreateResponse; - export import RuleUpdateResponse = RulesAPI.RuleUpdateResponse; export import RuleListResponse = RulesAPI.RuleListResponse; export import RuleDeleteResponse = RulesAPI.RuleDeleteResponse; + export import RuleEditResponse = RulesAPI.RuleEditResponse; export import RuleListResponsesV4PagePaginationArray = RulesAPI.RuleListResponsesV4PagePaginationArray; export import RuleCreateParams = RulesAPI.RuleCreateParams; - export import RuleUpdateParams = RulesAPI.RuleUpdateParams; export import RuleListParams = RulesAPI.RuleListParams; + export import RuleEditParams = RulesAPI.RuleEditParams; } diff --git a/src/resources/users/firewall/access-rules/index.ts b/src/resources/users/firewall/access-rules/index.ts index bd6d2983a3..d3097c914c 100644 --- a/src/resources/users/firewall/access-rules/index.ts +++ b/src/resources/users/firewall/access-rules/index.ts @@ -3,12 +3,12 @@ export { AccessRules } from './access-rules'; export { RuleCreateResponse, - RuleUpdateResponse, RuleListResponse, RuleDeleteResponse, + RuleEditResponse, RuleCreateParams, - RuleUpdateParams, RuleListParams, + RuleEditParams, RuleListResponsesV4PagePaginationArray, Rules, } from './rules'; diff --git a/src/resources/users/firewall/access-rules/rules.ts b/src/resources/users/firewall/access-rules/rules.ts index 16e3318105..abc3b1faca 100644 --- a/src/resources/users/firewall/access-rules/rules.ts +++ b/src/resources/users/firewall/access-rules/rules.ts @@ -21,23 +21,6 @@ export class Rules extends APIResource { )._thenUnwrap((obj) => obj.result); } - /** - * Updates an IP Access rule defined at the user level. You can only update the - * rule action (`mode` parameter) and notes. - */ - update( - identifier: string, - body: RuleUpdateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.patch(`/user/firewall/access_rules/rules/${identifier}`, { - body, - ...options, - }) as Core.APIPromise<{ result: RuleUpdateResponse | null }> - )._thenUnwrap((obj) => obj.result); - } - /** * Fetches IP Access rules of the user. You can filter the results using several * optional parameters. @@ -75,6 +58,23 @@ export class Rules extends APIResource { }> )._thenUnwrap((obj) => obj.result); } + + /** + * Updates an IP Access rule defined at the user level. You can only update the + * rule action (`mode` parameter) and notes. + */ + edit( + identifier: string, + body: RuleEditParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.patch(`/user/firewall/access_rules/rules/${identifier}`, { + body, + ...options, + }) as Core.APIPromise<{ result: RuleEditResponse | null }> + )._thenUnwrap((obj) => obj.result); + } } export class RuleListResponsesV4PagePaginationArray extends V4PagePaginationArray {} @@ -191,7 +191,7 @@ export namespace RuleCreateResponse { } } -export interface RuleUpdateResponse { +export interface RuleListResponse { /** * The unique identifier of the IP Access rule. */ @@ -206,11 +206,11 @@ export interface RuleUpdateResponse { * The rule configuration. */ configuration: - | RuleUpdateResponse.LegacyJhsIPConfiguration - | RuleUpdateResponse.LegacyJhsIPV6Configuration - | RuleUpdateResponse.LegacyJhsCidrConfiguration - | RuleUpdateResponse.LegacyJhsAsnConfiguration - | RuleUpdateResponse.LegacyJhsCountryConfiguration; + | RuleListResponse.LegacyJhsIPConfiguration + | RuleListResponse.LegacyJhsIPV6Configuration + | RuleListResponse.LegacyJhsCidrConfiguration + | RuleListResponse.LegacyJhsAsnConfiguration + | RuleListResponse.LegacyJhsCountryConfiguration; /** * The action to apply to a matched request. @@ -233,7 +233,7 @@ export interface RuleUpdateResponse { notes?: string; } -export namespace RuleUpdateResponse { +export namespace RuleListResponse { export interface LegacyJhsIPConfiguration { /** * The configuration target. You must set the target to `ip` when specifying an IP @@ -303,7 +303,14 @@ export namespace RuleUpdateResponse { } } -export interface RuleListResponse { +export interface RuleDeleteResponse { + /** + * The unique identifier of the IP Access rule. + */ + id?: string; +} + +export interface RuleEditResponse { /** * The unique identifier of the IP Access rule. */ @@ -318,11 +325,11 @@ export interface RuleListResponse { * The rule configuration. */ configuration: - | RuleListResponse.LegacyJhsIPConfiguration - | RuleListResponse.LegacyJhsIPV6Configuration - | RuleListResponse.LegacyJhsCidrConfiguration - | RuleListResponse.LegacyJhsAsnConfiguration - | RuleListResponse.LegacyJhsCountryConfiguration; + | RuleEditResponse.LegacyJhsIPConfiguration + | RuleEditResponse.LegacyJhsIPV6Configuration + | RuleEditResponse.LegacyJhsCidrConfiguration + | RuleEditResponse.LegacyJhsAsnConfiguration + | RuleEditResponse.LegacyJhsCountryConfiguration; /** * The action to apply to a matched request. @@ -345,7 +352,7 @@ export interface RuleListResponse { notes?: string; } -export namespace RuleListResponse { +export namespace RuleEditResponse { export interface LegacyJhsIPConfiguration { /** * The configuration target. You must set the target to `ip` when specifying an IP @@ -415,13 +422,6 @@ export namespace RuleListResponse { } } -export interface RuleDeleteResponse { - /** - * The unique identifier of the IP Access rule. - */ - id?: string; -} - export interface RuleCreateParams { /** * The rule configuration. @@ -514,18 +514,6 @@ export namespace RuleCreateParams { } } -export interface RuleUpdateParams { - /** - * The action to apply to a matched request. - */ - mode?: 'block' | 'challenge' | 'whitelist' | 'js_challenge' | 'managed_challenge'; - - /** - * An informative summary of the rule, typically used as a reminder or explanation. - */ - notes?: string; -} - export interface RuleListParams extends V4PagePaginationArrayParams { /** * The direction used to sort returned rules. @@ -596,13 +584,25 @@ export namespace RuleListParams { } } +export interface RuleEditParams { + /** + * The action to apply to a matched request. + */ + mode?: 'block' | 'challenge' | 'whitelist' | 'js_challenge' | 'managed_challenge'; + + /** + * An informative summary of the rule, typically used as a reminder or explanation. + */ + notes?: string; +} + export namespace Rules { export import RuleCreateResponse = RulesAPI.RuleCreateResponse; - export import RuleUpdateResponse = RulesAPI.RuleUpdateResponse; export import RuleListResponse = RulesAPI.RuleListResponse; export import RuleDeleteResponse = RulesAPI.RuleDeleteResponse; + export import RuleEditResponse = RulesAPI.RuleEditResponse; export import RuleListResponsesV4PagePaginationArray = RulesAPI.RuleListResponsesV4PagePaginationArray; export import RuleCreateParams = RulesAPI.RuleCreateParams; - export import RuleUpdateParams = RulesAPI.RuleUpdateParams; export import RuleListParams = RulesAPI.RuleListParams; + export import RuleEditParams = RulesAPI.RuleEditParams; } diff --git a/src/resources/users/index.ts b/src/resources/users/index.ts index 75b8cdb81d..081b3e66b2 100644 --- a/src/resources/users/index.ts +++ b/src/resources/users/index.ts @@ -9,10 +9,10 @@ export { export { Billings } from './billings/index'; export { Firewall } from './firewall/index'; export { - InviteUpdateResponse, InviteListResponse, + InviteEditResponse, InviteGetResponse, - InviteUpdateParams, + InviteEditParams, Invites, } from './invites'; export { LoadBalancers } from './load-balancers/index'; @@ -26,23 +26,23 @@ export { Organizations, } from './organizations'; export { + SubscriptionUpdateResponse, SubscriptionListResponse, SubscriptionDeleteResponse, - SubscriptionReplaceResponse, - SubscriptionReplaceParams, + SubscriptionUpdateParams, Subscriptions, } from './subscriptions'; export { TokenCreateResponse, + TokenUpdateResponse, TokenListResponse, TokenDeleteResponse, TokenGetResponse, - TokenReplaceResponse, TokenVerifyResponse, TokenCreateParams, + TokenUpdateParams, TokenListParams, - TokenReplaceParams, TokenListResponsesV4PagePaginationArray, Tokens, } from './tokens/index'; -export { UserUpdateResponse, UserListResponse, UserUpdateParams, Users } from './users'; +export { UserListResponse, UserEditResponse, UserEditParams, Users } from './users'; diff --git a/src/resources/users/invites.ts b/src/resources/users/invites.ts index d09c4ef0f8..0dff794fe3 100644 --- a/src/resources/users/invites.ts +++ b/src/resources/users/invites.ts @@ -6,26 +6,26 @@ import * as InvitesAPI from 'cloudflare/resources/users/invites'; export class Invites extends APIResource { /** - * Responds to an invitation. + * Lists all invitations associated with my user. */ - update( - inviteId: string, - body: InviteUpdateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { + list(options?: Core.RequestOptions): Core.APIPromise { return ( - this._client.patch(`/user/invites/${inviteId}`, { body, ...options }) as Core.APIPromise<{ - result: InviteUpdateResponse; - }> + this._client.get('/user/invites', options) as Core.APIPromise<{ result: InviteListResponse | null }> )._thenUnwrap((obj) => obj.result); } /** - * Lists all invitations associated with my user. + * Responds to an invitation. */ - list(options?: Core.RequestOptions): Core.APIPromise { + edit( + inviteId: string, + body: InviteEditParams, + options?: Core.RequestOptions, + ): Core.APIPromise { return ( - this._client.get('/user/invites', options) as Core.APIPromise<{ result: InviteListResponse | null }> + this._client.patch(`/user/invites/${inviteId}`, { body, ...options }) as Core.APIPromise<{ + result: InviteEditResponse; + }> )._thenUnwrap((obj) => obj.result); } @@ -39,8 +39,6 @@ export class Invites extends APIResource { } } -export type InviteUpdateResponse = unknown | string | null; - export type InviteListResponse = Array; export namespace InviteListResponse { @@ -121,9 +119,11 @@ export namespace InviteListResponse { } } +export type InviteEditResponse = unknown | string | null; + export type InviteGetResponse = unknown | string | null; -export interface InviteUpdateParams { +export interface InviteEditParams { /** * Status of your response to the invitation (rejected or accepted). */ @@ -131,8 +131,8 @@ export interface InviteUpdateParams { } export namespace Invites { - export import InviteUpdateResponse = InvitesAPI.InviteUpdateResponse; export import InviteListResponse = InvitesAPI.InviteListResponse; + export import InviteEditResponse = InvitesAPI.InviteEditResponse; export import InviteGetResponse = InvitesAPI.InviteGetResponse; - export import InviteUpdateParams = InvitesAPI.InviteUpdateParams; + export import InviteEditParams = InvitesAPI.InviteEditParams; } diff --git a/src/resources/users/load-balancers/index.ts b/src/resources/users/load-balancers/index.ts index 87a00ad6d0..bf390770c3 100644 --- a/src/resources/users/load-balancers/index.ts +++ b/src/resources/users/load-balancers/index.ts @@ -3,23 +3,23 @@ export { LoadBalancers } from './load-balancers'; export { MonitorCreateResponse, - MonitorUpdateResponse, MonitorListResponse, MonitorDeleteResponse, + MonitorEditResponse, MonitorGetResponse, MonitorCreateParams, - MonitorUpdateParams, + MonitorEditParams, Monitors, } from './monitors/index'; export { PoolCreateResponse, - PoolUpdateResponse, PoolListResponse, PoolDeleteResponse, + PoolEditResponse, PoolGetResponse, PoolCreateParams, - PoolUpdateParams, PoolListParams, + PoolEditParams, Pools, } from './pools/index'; export { PreviewGetResponse, Previews } from './previews'; diff --git a/src/resources/users/load-balancers/load-balancers.ts b/src/resources/users/load-balancers/load-balancers.ts index 9ae460cc6a..5de856e07c 100644 --- a/src/resources/users/load-balancers/load-balancers.ts +++ b/src/resources/users/load-balancers/load-balancers.ts @@ -14,21 +14,21 @@ export class LoadBalancers extends APIResource { export namespace LoadBalancers { export import Monitors = MonitorsAPI.Monitors; export import MonitorCreateResponse = MonitorsAPI.MonitorCreateResponse; - export import MonitorUpdateResponse = MonitorsAPI.MonitorUpdateResponse; export import MonitorListResponse = MonitorsAPI.MonitorListResponse; export import MonitorDeleteResponse = MonitorsAPI.MonitorDeleteResponse; + export import MonitorEditResponse = MonitorsAPI.MonitorEditResponse; export import MonitorGetResponse = MonitorsAPI.MonitorGetResponse; export import MonitorCreateParams = MonitorsAPI.MonitorCreateParams; - export import MonitorUpdateParams = MonitorsAPI.MonitorUpdateParams; + export import MonitorEditParams = MonitorsAPI.MonitorEditParams; export import Pools = PoolsAPI.Pools; export import PoolCreateResponse = PoolsAPI.PoolCreateResponse; - export import PoolUpdateResponse = PoolsAPI.PoolUpdateResponse; export import PoolListResponse = PoolsAPI.PoolListResponse; export import PoolDeleteResponse = PoolsAPI.PoolDeleteResponse; + export import PoolEditResponse = PoolsAPI.PoolEditResponse; export import PoolGetResponse = PoolsAPI.PoolGetResponse; export import PoolCreateParams = PoolsAPI.PoolCreateParams; - export import PoolUpdateParams = PoolsAPI.PoolUpdateParams; export import PoolListParams = PoolsAPI.PoolListParams; + export import PoolEditParams = PoolsAPI.PoolEditParams; export import Previews = PreviewsAPI.Previews; export import PreviewGetResponse = PreviewsAPI.PreviewGetResponse; } diff --git a/src/resources/users/load-balancers/monitors/index.ts b/src/resources/users/load-balancers/monitors/index.ts index a4440447c2..24e3aea065 100644 --- a/src/resources/users/load-balancers/monitors/index.ts +++ b/src/resources/users/load-balancers/monitors/index.ts @@ -2,12 +2,12 @@ export { MonitorCreateResponse, - MonitorUpdateResponse, MonitorListResponse, MonitorDeleteResponse, + MonitorEditResponse, MonitorGetResponse, MonitorCreateParams, - MonitorUpdateParams, + MonitorEditParams, Monitors, } from './monitors'; export { PreviewCreateResponse, PreviewCreateParams, Previews } from './previews'; diff --git a/src/resources/users/load-balancers/monitors/monitors.ts b/src/resources/users/load-balancers/monitors/monitors.ts index 0ebf845f7c..f40acb1bdd 100644 --- a/src/resources/users/load-balancers/monitors/monitors.ts +++ b/src/resources/users/load-balancers/monitors/monitors.ts @@ -21,22 +21,6 @@ export class Monitors extends APIResource { )._thenUnwrap((obj) => obj.result); } - /** - * Apply changes to an existing monitor, overwriting the supplied properties. - */ - update( - monitorId: string, - body: MonitorUpdateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.patch(`/user/load_balancers/monitors/${monitorId}`, { - body, - ...options, - }) as Core.APIPromise<{ result: MonitorUpdateResponse }> - )._thenUnwrap((obj) => obj.result); - } - /** * List configured monitors for a user. */ @@ -59,6 +43,22 @@ export class Monitors extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Apply changes to an existing monitor, overwriting the supplied properties. + */ + edit( + monitorId: string, + body: MonitorEditParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.patch(`/user/load_balancers/monitors/${monitorId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: MonitorEditResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * List a single configured monitor for a user. */ @@ -176,111 +176,6 @@ export interface MonitorCreateResponse { type?: 'http' | 'https' | 'tcp' | 'udp_icmp' | 'icmp_ping' | 'smtp'; } -export interface MonitorUpdateResponse { - id?: string; - - /** - * Do not validate the certificate when monitor use HTTPS. This parameter is - * currently only valid for HTTP and HTTPS monitors. - */ - allow_insecure?: boolean; - - /** - * To be marked unhealthy the monitored origin must fail this healthcheck N - * consecutive times. - */ - consecutive_down?: number; - - /** - * To be marked healthy the monitored origin must pass this healthcheck N - * consecutive times. - */ - consecutive_up?: number; - - created_on?: string; - - /** - * Object description. - */ - description?: string; - - /** - * A case-insensitive sub-string to look for in the response body. If this string - * is not found, the origin will be marked as unhealthy. This parameter is only - * valid for HTTP and HTTPS monitors. - */ - expected_body?: string; - - /** - * The expected HTTP response code or code range of the health check. This - * parameter is only valid for HTTP and HTTPS monitors. - */ - expected_codes?: string; - - /** - * Follow redirects if returned by the origin. This parameter is only valid for - * HTTP and HTTPS monitors. - */ - follow_redirects?: boolean; - - /** - * The HTTP request headers to send in the health check. It is recommended you set - * a Host header by default. The User-Agent header cannot be overridden. This - * parameter is only valid for HTTP and HTTPS monitors. - */ - header?: unknown; - - /** - * The interval between each health check. Shorter intervals may improve failover - * time, but will increase load on the origins as we check from multiple locations. - */ - interval?: number; - - /** - * The method to use for the health check. This defaults to 'GET' for HTTP/HTTPS - * based checks and 'connection_established' for TCP based health checks. - */ - method?: string; - - modified_on?: string; - - /** - * The endpoint path you want to conduct a health check against. This parameter is - * only valid for HTTP and HTTPS monitors. - */ - path?: string; - - /** - * The port number to connect to for the health check. Required for TCP, UDP, and - * SMTP checks. HTTP and HTTPS checks should only define the port when using a - * non-standard port (HTTP: default 80, HTTPS: default 443). - */ - port?: number; - - /** - * Assign this monitor to emulate the specified zone while probing. This parameter - * is only valid for HTTP and HTTPS monitors. - */ - probe_zone?: string; - - /** - * The number of retries to attempt in case of a timeout before marking the origin - * as unhealthy. Retries are attempted immediately. - */ - retries?: number; - - /** - * The timeout (in seconds) before marking the health check as failed. - */ - timeout?: number; - - /** - * The protocol to use for the health check. Currently supported protocols are - * 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'. - */ - type?: 'http' | 'https' | 'tcp' | 'udp_icmp' | 'icmp_ping' | 'smtp'; -} - export type MonitorListResponse = Array; export namespace MonitorListResponse { @@ -394,6 +289,111 @@ export interface MonitorDeleteResponse { id?: string; } +export interface MonitorEditResponse { + id?: string; + + /** + * Do not validate the certificate when monitor use HTTPS. This parameter is + * currently only valid for HTTP and HTTPS monitors. + */ + allow_insecure?: boolean; + + /** + * To be marked unhealthy the monitored origin must fail this healthcheck N + * consecutive times. + */ + consecutive_down?: number; + + /** + * To be marked healthy the monitored origin must pass this healthcheck N + * consecutive times. + */ + consecutive_up?: number; + + created_on?: string; + + /** + * Object description. + */ + description?: string; + + /** + * A case-insensitive sub-string to look for in the response body. If this string + * is not found, the origin will be marked as unhealthy. This parameter is only + * valid for HTTP and HTTPS monitors. + */ + expected_body?: string; + + /** + * The expected HTTP response code or code range of the health check. This + * parameter is only valid for HTTP and HTTPS monitors. + */ + expected_codes?: string; + + /** + * Follow redirects if returned by the origin. This parameter is only valid for + * HTTP and HTTPS monitors. + */ + follow_redirects?: boolean; + + /** + * The HTTP request headers to send in the health check. It is recommended you set + * a Host header by default. The User-Agent header cannot be overridden. This + * parameter is only valid for HTTP and HTTPS monitors. + */ + header?: unknown; + + /** + * The interval between each health check. Shorter intervals may improve failover + * time, but will increase load on the origins as we check from multiple locations. + */ + interval?: number; + + /** + * The method to use for the health check. This defaults to 'GET' for HTTP/HTTPS + * based checks and 'connection_established' for TCP based health checks. + */ + method?: string; + + modified_on?: string; + + /** + * The endpoint path you want to conduct a health check against. This parameter is + * only valid for HTTP and HTTPS monitors. + */ + path?: string; + + /** + * The port number to connect to for the health check. Required for TCP, UDP, and + * SMTP checks. HTTP and HTTPS checks should only define the port when using a + * non-standard port (HTTP: default 80, HTTPS: default 443). + */ + port?: number; + + /** + * Assign this monitor to emulate the specified zone while probing. This parameter + * is only valid for HTTP and HTTPS monitors. + */ + probe_zone?: string; + + /** + * The number of retries to attempt in case of a timeout before marking the origin + * as unhealthy. Retries are attempted immediately. + */ + retries?: number; + + /** + * The timeout (in seconds) before marking the health check as failed. + */ + timeout?: number; + + /** + * The protocol to use for the health check. Currently supported protocols are + * 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'. + */ + type?: 'http' | 'https' | 'tcp' | 'udp_icmp' | 'icmp_ping' | 'smtp'; +} + export interface MonitorGetResponse { id?: string; @@ -598,7 +598,7 @@ export interface MonitorCreateParams { type?: 'http' | 'https' | 'tcp' | 'udp_icmp' | 'icmp_ping' | 'smtp'; } -export interface MonitorUpdateParams { +export interface MonitorEditParams { /** * The expected HTTP response code or code range of the health check. This * parameter is only valid for HTTP and HTTPS monitors. @@ -699,12 +699,12 @@ export interface MonitorUpdateParams { export namespace Monitors { export import MonitorCreateResponse = MonitorsAPI.MonitorCreateResponse; - export import MonitorUpdateResponse = MonitorsAPI.MonitorUpdateResponse; export import MonitorListResponse = MonitorsAPI.MonitorListResponse; export import MonitorDeleteResponse = MonitorsAPI.MonitorDeleteResponse; + export import MonitorEditResponse = MonitorsAPI.MonitorEditResponse; export import MonitorGetResponse = MonitorsAPI.MonitorGetResponse; export import MonitorCreateParams = MonitorsAPI.MonitorCreateParams; - export import MonitorUpdateParams = MonitorsAPI.MonitorUpdateParams; + export import MonitorEditParams = MonitorsAPI.MonitorEditParams; export import Previews = PreviewsAPI.Previews; export import PreviewCreateResponse = PreviewsAPI.PreviewCreateResponse; export import PreviewCreateParams = PreviewsAPI.PreviewCreateParams; diff --git a/src/resources/users/load-balancers/pools/index.ts b/src/resources/users/load-balancers/pools/index.ts index 1abfecb900..4e75a0fed9 100644 --- a/src/resources/users/load-balancers/pools/index.ts +++ b/src/resources/users/load-balancers/pools/index.ts @@ -3,13 +3,13 @@ export { HealthListResponse, Health } from './health'; export { PoolCreateResponse, - PoolUpdateResponse, PoolListResponse, PoolDeleteResponse, + PoolEditResponse, PoolGetResponse, PoolCreateParams, - PoolUpdateParams, PoolListParams, + PoolEditParams, Pools, } from './pools'; export { PreviewCreateResponse, PreviewCreateParams, Previews } from './previews'; diff --git a/src/resources/users/load-balancers/pools/pools.ts b/src/resources/users/load-balancers/pools/pools.ts index d1e21f02f1..708c55fd6a 100644 --- a/src/resources/users/load-balancers/pools/pools.ts +++ b/src/resources/users/load-balancers/pools/pools.ts @@ -24,21 +24,6 @@ export class Pools extends APIResource { )._thenUnwrap((obj) => obj.result); } - /** - * Apply changes to an existing pool, overwriting the supplied properties. - */ - update( - poolId: string, - body: PoolUpdateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.patch(`/user/load_balancers/pools/${poolId}`, { body, ...options }) as Core.APIPromise<{ - result: PoolUpdateResponse; - }> - )._thenUnwrap((obj) => obj.result); - } - /** * List configured pools. */ @@ -69,6 +54,21 @@ export class Pools extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Apply changes to an existing pool, overwriting the supplied properties. + */ + edit( + poolId: string, + body: PoolEditParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.patch(`/user/load_balancers/pools/${poolId}`, { body, ...options }) as Core.APIPromise<{ + result: PoolEditResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + /** * Fetch a single configured pool. */ @@ -367,586 +367,586 @@ export namespace PoolCreateResponse { } } -export interface PoolUpdateResponse { - id?: string; - - /** - * A list of regions from which to run health checks. Null means every Cloudflare - * data center. - */ - check_regions?: Array< - | 'WNAM' - | 'ENAM' - | 'WEU' - | 'EEU' - | 'NSAM' - | 'SSAM' - | 'OC' - | 'ME' - | 'NAF' - | 'SAF' - | 'SAS' - | 'SEAS' - | 'NEAS' - | 'ALL_REGIONS' - > | null; - - created_on?: string; - - /** - * A human-readable description of the pool. - */ - description?: string; - - /** - * This field shows up only if the pool is disabled. This field is set with the - * time the pool was disabled at. - */ - disabled_at?: string; - - /** - * Whether to enable (the default) or disable this pool. Disabled pools will not - * receive traffic and are excluded from health checks. Disabling a pool will cause - * any load balancers using it to failover to the next pool (if any). - */ - enabled?: boolean; +export type PoolListResponse = Array; - /** - * The latitude of the data center containing the origins used in this pool in - * decimal degrees. If this is set, longitude must also be set. - */ - latitude?: number; +export namespace PoolListResponse { + export interface PoolListResponseItem { + id?: string; - /** - * Configures load shedding policies and percentages for the pool. - */ - load_shedding?: PoolUpdateResponse.LoadShedding; + /** + * A list of regions from which to run health checks. Null means every Cloudflare + * data center. + */ + check_regions?: Array< + | 'WNAM' + | 'ENAM' + | 'WEU' + | 'EEU' + | 'NSAM' + | 'SSAM' + | 'OC' + | 'ME' + | 'NAF' + | 'SAF' + | 'SAS' + | 'SEAS' + | 'NEAS' + | 'ALL_REGIONS' + > | null; - /** - * The longitude of the data center containing the origins used in this pool in - * decimal degrees. If this is set, latitude must also be set. - */ - longitude?: number; + created_on?: string; - /** - * The minimum number of origins that must be healthy for this pool to serve - * traffic. If the number of healthy origins falls below this number, the pool will - * be marked unhealthy and will failover to the next available pool. - */ - minimum_origins?: number; + /** + * A human-readable description of the pool. + */ + description?: string; - modified_on?: string; + /** + * This field shows up only if the pool is disabled. This field is set with the + * time the pool was disabled at. + */ + disabled_at?: string; - /** - * The ID of the Monitor to use for checking the health of origins within this - * pool. - */ - monitor?: unknown; + /** + * Whether to enable (the default) or disable this pool. Disabled pools will not + * receive traffic and are excluded from health checks. Disabling a pool will cause + * any load balancers using it to failover to the next pool (if any). + */ + enabled?: boolean; - /** - * A short name (tag) for the pool. Only alphanumeric characters, hyphens, and - * underscores are allowed. - */ - name?: string; + /** + * The latitude of the data center containing the origins used in this pool in + * decimal degrees. If this is set, longitude must also be set. + */ + latitude?: number; - /** - * This field is now deprecated. It has been moved to Cloudflare's Centralized - * Notification service - * https://developers.cloudflare.com/fundamentals/notifications/. The email address - * to send health status notifications to. This can be an individual mailbox or a - * mailing list. Multiple emails can be supplied as a comma delimited list. - */ - notification_email?: string; + /** + * Configures load shedding policies and percentages for the pool. + */ + load_shedding?: PoolListResponseItem.LoadShedding; - /** - * Filter pool and origin health notifications by resource type or health status. - * Use null to reset. - */ - notification_filter?: PoolUpdateResponse.NotificationFilter | null; + /** + * The longitude of the data center containing the origins used in this pool in + * decimal degrees. If this is set, latitude must also be set. + */ + longitude?: number; - /** - * Configures origin steering for the pool. Controls how origins are selected for - * new sessions and traffic without session affinity. - */ - origin_steering?: PoolUpdateResponse.OriginSteering; + /** + * The minimum number of origins that must be healthy for this pool to serve + * traffic. If the number of healthy origins falls below this number, the pool will + * be marked unhealthy and will failover to the next available pool. + */ + minimum_origins?: number; - /** - * The list of origins within this pool. Traffic directed at this pool is balanced - * across all currently healthy origins, provided the pool itself is healthy. - */ - origins?: Array; -} + modified_on?: string; -export namespace PoolUpdateResponse { - /** - * Configures load shedding policies and percentages for the pool. - */ - export interface LoadShedding { /** - * The percent of traffic to shed from the pool, according to the default policy. - * Applies to new sessions and traffic without session affinity. + * The ID of the Monitor to use for checking the health of origins within this + * pool. */ - default_percent?: number; + monitor?: unknown; /** - * The default policy to use when load shedding. A random policy randomly sheds a - * given percent of requests. A hash policy computes a hash over the - * CF-Connecting-IP address and sheds all requests originating from a percent of - * IPs. + * A short name (tag) for the pool. Only alphanumeric characters, hyphens, and + * underscores are allowed. */ - default_policy?: 'random' | 'hash'; + name?: string; /** - * The percent of existing sessions to shed from the pool, according to the session - * policy. + * This field is now deprecated. It has been moved to Cloudflare's Centralized + * Notification service + * https://developers.cloudflare.com/fundamentals/notifications/. The email address + * to send health status notifications to. This can be an individual mailbox or a + * mailing list. Multiple emails can be supplied as a comma delimited list. */ - session_percent?: number; + notification_email?: string; /** - * Only the hash policy is supported for existing sessions (to avoid exponential - * decay). + * Filter pool and origin health notifications by resource type or health status. + * Use null to reset. */ - session_policy?: 'hash'; - } + notification_filter?: PoolListResponseItem.NotificationFilter | null; - /** - * Filter pool and origin health notifications by resource type or health status. - * Use null to reset. - */ - export interface NotificationFilter { /** - * Filter options for a particular resource type (pool or origin). Use null to - * reset. + * Configures origin steering for the pool. Controls how origins are selected for + * new sessions and traffic without session affinity. */ - origin?: NotificationFilter.Origin | null; + origin_steering?: PoolListResponseItem.OriginSteering; /** - * Filter options for a particular resource type (pool or origin). Use null to - * reset. + * The list of origins within this pool. Traffic directed at this pool is balanced + * across all currently healthy origins, provided the pool itself is healthy. */ - pool?: NotificationFilter.Pool | null; + origins?: Array; } - export namespace NotificationFilter { + export namespace PoolListResponseItem { /** - * Filter options for a particular resource type (pool or origin). Use null to - * reset. + * Configures load shedding policies and percentages for the pool. */ - export interface Origin { + export interface LoadShedding { /** - * If set true, disable notifications for this type of resource (pool or origin). + * The percent of traffic to shed from the pool, according to the default policy. + * Applies to new sessions and traffic without session affinity. */ - disable?: boolean; + default_percent?: number; /** - * If present, send notifications only for this health status (e.g. false for only - * DOWN events). Use null to reset (all events). + * The default policy to use when load shedding. A random policy randomly sheds a + * given percent of requests. A hash policy computes a hash over the + * CF-Connecting-IP address and sheds all requests originating from a percent of + * IPs. */ - healthy?: boolean | null; - } + default_policy?: 'random' | 'hash'; - /** - * Filter options for a particular resource type (pool or origin). Use null to - * reset. - */ - export interface Pool { /** - * If set true, disable notifications for this type of resource (pool or origin). + * The percent of existing sessions to shed from the pool, according to the session + * policy. */ - disable?: boolean; + session_percent?: number; /** - * If present, send notifications only for this health status (e.g. false for only - * DOWN events). Use null to reset (all events). + * Only the hash policy is supported for existing sessions (to avoid exponential + * decay). */ - healthy?: boolean | null; + session_policy?: 'hash'; } - } - /** - * Configures origin steering for the pool. Controls how origins are selected for - * new sessions and traffic without session affinity. - */ - export interface OriginSteering { /** - * The type of origin steering policy to use. - * - * - `"random"`: Select an origin randomly. - * - `"hash"`: Select an origin by computing a hash over the CF-Connecting-IP - * address. - * - `"least_outstanding_requests"`: Select an origin by taking into consideration - * origin weights, as well as each origin's number of outstanding requests. - * Origins with more pending requests are weighted proportionately less relative - * to others. - * - `"least_connections"`: Select an origin by taking into consideration origin - * weights, as well as each origin's number of open connections. Origins with - * more open connections are weighted proportionately less relative to others. - * Supported for HTTP/1 and HTTP/2 connections. + * Filter pool and origin health notifications by resource type or health status. + * Use null to reset. */ - policy?: 'random' | 'hash' | 'least_outstanding_requests' | 'least_connections'; - } + export interface NotificationFilter { + /** + * Filter options for a particular resource type (pool or origin). Use null to + * reset. + */ + origin?: NotificationFilter.Origin | null; - export interface Origin { - /** - * 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. - */ - address?: string; + /** + * Filter options for a particular resource type (pool or origin). Use null to + * reset. + */ + pool?: NotificationFilter.Pool | null; + } - /** - * This field shows up only if the origin is disabled. This field is set with the - * time the origin was disabled. - */ - disabled_at?: string; + export namespace NotificationFilter { + /** + * Filter options for a particular resource type (pool or origin). Use null to + * reset. + */ + export interface Origin { + /** + * If set true, disable notifications for this type of resource (pool or origin). + */ + disable?: boolean; - /** - * 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. - */ - enabled?: boolean; + /** + * If present, send notifications only for this health status (e.g. false for only + * DOWN events). Use null to reset (all events). + */ + healthy?: boolean | null; + } - /** - * The request header is used to pass additional information with an HTTP request. - * Currently supported header is 'Host'. - */ - header?: Origin.Header; + /** + * Filter options for a particular resource type (pool or origin). Use null to + * reset. + */ + export interface Pool { + /** + * If set true, disable notifications for this type of resource (pool or origin). + */ + disable?: boolean; - /** - * A human-identifiable name for the origin. - */ - name?: string; + /** + * If present, send notifications only for this health status (e.g. false for only + * DOWN events). Use null to reset (all events). + */ + healthy?: boolean | null; + } + } /** - * The virtual network subnet ID the origin belongs in. Virtual network must also - * belong to the account. + * Configures origin steering for the pool. Controls how origins are selected for + * new sessions and traffic without session affinity. */ - virtual_network_id?: string; + export interface OriginSteering { + /** + * The type of origin steering policy to use. + * + * - `"random"`: Select an origin randomly. + * - `"hash"`: Select an origin by computing a hash over the CF-Connecting-IP + * address. + * - `"least_outstanding_requests"`: Select an origin by taking into consideration + * origin weights, as well as each origin's number of outstanding requests. + * Origins with more pending requests are weighted proportionately less relative + * to others. + * - `"least_connections"`: Select an origin by taking into consideration origin + * weights, as well as each origin's number of open connections. Origins with + * more open connections are weighted proportionately less relative to others. + * Supported for HTTP/1 and HTTP/2 connections. + */ + policy?: 'random' | 'hash' | 'least_outstanding_requests' | 'least_connections'; + } - /** - * 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. - */ - weight?: number; - } + export interface Origin { + /** + * 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. + */ + address?: string; - export namespace Origin { - /** - * The request header is used to pass additional information with an HTTP request. - * Currently supported header is 'Host'. - */ - export interface Header { /** - * The 'Host' header allows to override the hostname set in the HTTP request. - * Current support is 1 'Host' header override per origin. + * This field shows up only if the origin is disabled. This field is set with the + * time the origin was disabled. */ - Host?: Array; + disabled_at?: string; + + /** + * 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. + */ + enabled?: boolean; + + /** + * The request header is used to pass additional information with an HTTP request. + * Currently supported header is 'Host'. + */ + header?: Origin.Header; + + /** + * A human-identifiable name for the origin. + */ + name?: string; + + /** + * The virtual network subnet ID the origin belongs in. Virtual network must also + * belong to the account. + */ + virtual_network_id?: string; + + /** + * 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. + */ + weight?: number; + } + + export namespace Origin { + /** + * The request header is used to pass additional information with an HTTP request. + * Currently supported header is 'Host'. + */ + export interface Header { + /** + * The 'Host' header allows to override the hostname set in the HTTP request. + * Current support is 1 'Host' header override per origin. + */ + Host?: Array; + } } } } -export type PoolListResponse = Array; +export interface PoolDeleteResponse { + id?: string; +} -export namespace PoolListResponse { - export interface PoolListResponseItem { - id?: string; +export interface PoolEditResponse { + id?: string; - /** - * A list of regions from which to run health checks. Null means every Cloudflare - * data center. - */ - check_regions?: Array< - | 'WNAM' - | 'ENAM' - | 'WEU' - | 'EEU' - | 'NSAM' - | 'SSAM' - | 'OC' - | 'ME' - | 'NAF' - | 'SAF' - | 'SAS' - | 'SEAS' - | 'NEAS' - | 'ALL_REGIONS' - > | null; + /** + * A list of regions from which to run health checks. Null means every Cloudflare + * data center. + */ + check_regions?: Array< + | 'WNAM' + | 'ENAM' + | 'WEU' + | 'EEU' + | 'NSAM' + | 'SSAM' + | 'OC' + | 'ME' + | 'NAF' + | 'SAF' + | 'SAS' + | 'SEAS' + | 'NEAS' + | 'ALL_REGIONS' + > | null; - created_on?: string; + created_on?: string; - /** - * A human-readable description of the pool. - */ - description?: string; + /** + * A human-readable description of the pool. + */ + description?: string; - /** - * This field shows up only if the pool is disabled. This field is set with the - * time the pool was disabled at. - */ - disabled_at?: string; + /** + * This field shows up only if the pool is disabled. This field is set with the + * time the pool was disabled at. + */ + disabled_at?: string; - /** - * Whether to enable (the default) or disable this pool. Disabled pools will not - * receive traffic and are excluded from health checks. Disabling a pool will cause - * any load balancers using it to failover to the next pool (if any). - */ - enabled?: boolean; + /** + * Whether to enable (the default) or disable this pool. Disabled pools will not + * receive traffic and are excluded from health checks. Disabling a pool will cause + * any load balancers using it to failover to the next pool (if any). + */ + enabled?: boolean; - /** - * The latitude of the data center containing the origins used in this pool in - * decimal degrees. If this is set, longitude must also be set. - */ - latitude?: number; + /** + * The latitude of the data center containing the origins used in this pool in + * decimal degrees. If this is set, longitude must also be set. + */ + latitude?: number; - /** - * Configures load shedding policies and percentages for the pool. - */ - load_shedding?: PoolListResponseItem.LoadShedding; + /** + * Configures load shedding policies and percentages for the pool. + */ + load_shedding?: PoolEditResponse.LoadShedding; - /** - * The longitude of the data center containing the origins used in this pool in - * decimal degrees. If this is set, latitude must also be set. - */ - longitude?: number; + /** + * The longitude of the data center containing the origins used in this pool in + * decimal degrees. If this is set, latitude must also be set. + */ + longitude?: number; - /** - * The minimum number of origins that must be healthy for this pool to serve - * traffic. If the number of healthy origins falls below this number, the pool will - * be marked unhealthy and will failover to the next available pool. - */ - minimum_origins?: number; + /** + * The minimum number of origins that must be healthy for this pool to serve + * traffic. If the number of healthy origins falls below this number, the pool will + * be marked unhealthy and will failover to the next available pool. + */ + minimum_origins?: number; - modified_on?: string; + modified_on?: string; + + /** + * The ID of the Monitor to use for checking the health of origins within this + * pool. + */ + monitor?: unknown; + + /** + * A short name (tag) for the pool. Only alphanumeric characters, hyphens, and + * underscores are allowed. + */ + name?: string; + + /** + * This field is now deprecated. It has been moved to Cloudflare's Centralized + * Notification service + * https://developers.cloudflare.com/fundamentals/notifications/. The email address + * to send health status notifications to. This can be an individual mailbox or a + * mailing list. Multiple emails can be supplied as a comma delimited list. + */ + notification_email?: string; + + /** + * Filter pool and origin health notifications by resource type or health status. + * Use null to reset. + */ + notification_filter?: PoolEditResponse.NotificationFilter | null; + + /** + * Configures origin steering for the pool. Controls how origins are selected for + * new sessions and traffic without session affinity. + */ + origin_steering?: PoolEditResponse.OriginSteering; + + /** + * The list of origins within this pool. Traffic directed at this pool is balanced + * across all currently healthy origins, provided the pool itself is healthy. + */ + origins?: Array; +} +export namespace PoolEditResponse { + /** + * Configures load shedding policies and percentages for the pool. + */ + export interface LoadShedding { /** - * The ID of the Monitor to use for checking the health of origins within this - * pool. + * The percent of traffic to shed from the pool, according to the default policy. + * Applies to new sessions and traffic without session affinity. */ - monitor?: unknown; + default_percent?: number; /** - * A short name (tag) for the pool. Only alphanumeric characters, hyphens, and - * underscores are allowed. + * The default policy to use when load shedding. A random policy randomly sheds a + * given percent of requests. A hash policy computes a hash over the + * CF-Connecting-IP address and sheds all requests originating from a percent of + * IPs. */ - name?: string; + default_policy?: 'random' | 'hash'; /** - * This field is now deprecated. It has been moved to Cloudflare's Centralized - * Notification service - * https://developers.cloudflare.com/fundamentals/notifications/. The email address - * to send health status notifications to. This can be an individual mailbox or a - * mailing list. Multiple emails can be supplied as a comma delimited list. + * The percent of existing sessions to shed from the pool, according to the session + * policy. */ - notification_email?: string; + session_percent?: number; /** - * Filter pool and origin health notifications by resource type or health status. - * Use null to reset. + * Only the hash policy is supported for existing sessions (to avoid exponential + * decay). */ - notification_filter?: PoolListResponseItem.NotificationFilter | null; + session_policy?: 'hash'; + } + /** + * Filter pool and origin health notifications by resource type or health status. + * Use null to reset. + */ + export interface NotificationFilter { /** - * Configures origin steering for the pool. Controls how origins are selected for - * new sessions and traffic without session affinity. + * Filter options for a particular resource type (pool or origin). Use null to + * reset. */ - origin_steering?: PoolListResponseItem.OriginSteering; + origin?: NotificationFilter.Origin | null; /** - * The list of origins within this pool. Traffic directed at this pool is balanced - * across all currently healthy origins, provided the pool itself is healthy. + * Filter options for a particular resource type (pool or origin). Use null to + * reset. */ - origins?: Array; + pool?: NotificationFilter.Pool | null; } - export namespace PoolListResponseItem { + export namespace NotificationFilter { /** - * Configures load shedding policies and percentages for the pool. + * Filter options for a particular resource type (pool or origin). Use null to + * reset. */ - export interface LoadShedding { - /** - * The percent of traffic to shed from the pool, according to the default policy. - * Applies to new sessions and traffic without session affinity. - */ - default_percent?: number; - - /** - * The default policy to use when load shedding. A random policy randomly sheds a - * given percent of requests. A hash policy computes a hash over the - * CF-Connecting-IP address and sheds all requests originating from a percent of - * IPs. - */ - default_policy?: 'random' | 'hash'; - + export interface Origin { /** - * The percent of existing sessions to shed from the pool, according to the session - * policy. + * If set true, disable notifications for this type of resource (pool or origin). */ - session_percent?: number; + disable?: boolean; /** - * Only the hash policy is supported for existing sessions (to avoid exponential - * decay). + * If present, send notifications only for this health status (e.g. false for only + * DOWN events). Use null to reset (all events). */ - session_policy?: 'hash'; + healthy?: boolean | null; } /** - * Filter pool and origin health notifications by resource type or health status. - * Use null to reset. + * Filter options for a particular resource type (pool or origin). Use null to + * reset. */ - export interface NotificationFilter { - /** - * Filter options for a particular resource type (pool or origin). Use null to - * reset. - */ - origin?: NotificationFilter.Origin | null; - - /** - * Filter options for a particular resource type (pool or origin). Use null to - * reset. - */ - pool?: NotificationFilter.Pool | null; - } - - export namespace NotificationFilter { + export interface Pool { /** - * Filter options for a particular resource type (pool or origin). Use null to - * reset. + * If set true, disable notifications for this type of resource (pool or origin). */ - export interface Origin { - /** - * If set true, disable notifications for this type of resource (pool or origin). - */ - disable?: boolean; - - /** - * If present, send notifications only for this health status (e.g. false for only - * DOWN events). Use null to reset (all events). - */ - healthy?: boolean | null; - } + disable?: boolean; /** - * Filter options for a particular resource type (pool or origin). Use null to - * reset. + * If present, send notifications only for this health status (e.g. false for only + * DOWN events). Use null to reset (all events). */ - export interface Pool { - /** - * If set true, disable notifications for this type of resource (pool or origin). - */ - disable?: boolean; - - /** - * If present, send notifications only for this health status (e.g. false for only - * DOWN events). Use null to reset (all events). - */ - healthy?: boolean | null; - } + healthy?: boolean | null; } + } + /** + * Configures origin steering for the pool. Controls how origins are selected for + * new sessions and traffic without session affinity. + */ + export interface OriginSteering { /** - * Configures origin steering for the pool. Controls how origins are selected for - * new sessions and traffic without session affinity. + * The type of origin steering policy to use. + * + * - `"random"`: Select an origin randomly. + * - `"hash"`: Select an origin by computing a hash over the CF-Connecting-IP + * address. + * - `"least_outstanding_requests"`: Select an origin by taking into consideration + * origin weights, as well as each origin's number of outstanding requests. + * Origins with more pending requests are weighted proportionately less relative + * to others. + * - `"least_connections"`: Select an origin by taking into consideration origin + * weights, as well as each origin's number of open connections. Origins with + * more open connections are weighted proportionately less relative to others. + * Supported for HTTP/1 and HTTP/2 connections. */ - export interface OriginSteering { - /** - * The type of origin steering policy to use. - * - * - `"random"`: Select an origin randomly. - * - `"hash"`: Select an origin by computing a hash over the CF-Connecting-IP - * address. - * - `"least_outstanding_requests"`: Select an origin by taking into consideration - * origin weights, as well as each origin's number of outstanding requests. - * Origins with more pending requests are weighted proportionately less relative - * to others. - * - `"least_connections"`: Select an origin by taking into consideration origin - * weights, as well as each origin's number of open connections. Origins with - * more open connections are weighted proportionately less relative to others. - * Supported for HTTP/1 and HTTP/2 connections. - */ - policy?: 'random' | 'hash' | 'least_outstanding_requests' | 'least_connections'; - } + policy?: 'random' | 'hash' | 'least_outstanding_requests' | 'least_connections'; + } - export interface Origin { - /** - * 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. - */ - address?: string; + export interface Origin { + /** + * 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. + */ + address?: string; - /** - * This field shows up only if the origin is disabled. This field is set with the - * time the origin was disabled. - */ - disabled_at?: string; + /** + * This field shows up only if the origin is disabled. This field is set with the + * time the origin was disabled. + */ + disabled_at?: string; - /** - * 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. - */ - enabled?: boolean; + /** + * 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. + */ + enabled?: boolean; - /** - * The request header is used to pass additional information with an HTTP request. - * Currently supported header is 'Host'. - */ - header?: Origin.Header; + /** + * The request header is used to pass additional information with an HTTP request. + * Currently supported header is 'Host'. + */ + header?: Origin.Header; - /** - * A human-identifiable name for the origin. - */ - name?: string; + /** + * A human-identifiable name for the origin. + */ + name?: string; - /** - * The virtual network subnet ID the origin belongs in. Virtual network must also - * belong to the account. - */ - virtual_network_id?: string; + /** + * The virtual network subnet ID the origin belongs in. Virtual network must also + * belong to the account. + */ + virtual_network_id?: string; - /** - * 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. - */ - weight?: number; - } + /** + * 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. + */ + weight?: number; + } - export namespace Origin { + export namespace Origin { + /** + * The request header is used to pass additional information with an HTTP request. + * Currently supported header is 'Host'. + */ + export interface Header { /** - * The request header is used to pass additional information with an HTTP request. - * Currently supported header is 'Host'. + * The 'Host' header allows to override the hostname set in the HTTP request. + * Current support is 1 'Host' header override per origin. */ - export interface Header { - /** - * The 'Host' header allows to override the hostname set in the HTTP request. - * Current support is 1 'Host' header override per origin. - */ - Host?: Array; - } + Host?: Array; } } } -export interface PoolDeleteResponse { - id?: string; -} - export interface PoolGetResponse { id?: string; @@ -1501,7 +1501,15 @@ export namespace PoolCreateParams { } } -export interface PoolUpdateParams { +export interface PoolListParams { + /** + * The ID of the Monitor to use for checking the health of origins within this + * pool. + */ + monitor?: unknown; +} + +export interface PoolEditParams { /** * A list of regions from which to run health checks. Null means every Cloudflare * data center. @@ -1544,7 +1552,7 @@ export interface PoolUpdateParams { /** * Configures load shedding policies and percentages for the pool. */ - load_shedding?: PoolUpdateParams.LoadShedding; + load_shedding?: PoolEditParams.LoadShedding; /** * The longitude of the data center containing the origins used in this pool in @@ -1584,22 +1592,22 @@ export interface PoolUpdateParams { * Filter pool and origin health notifications by resource type or health status. * Use null to reset. */ - notification_filter?: PoolUpdateParams.NotificationFilter | null; + notification_filter?: PoolEditParams.NotificationFilter | null; /** * Configures origin steering for the pool. Controls how origins are selected for * new sessions and traffic without session affinity. */ - origin_steering?: PoolUpdateParams.OriginSteering; + origin_steering?: PoolEditParams.OriginSteering; /** * The list of origins within this pool. Traffic directed at this pool is balanced * across all currently healthy origins, provided the pool itself is healthy. */ - origins?: Array; + origins?: Array; } -export namespace PoolUpdateParams { +export namespace PoolEditParams { /** * Configures load shedding policies and percentages for the pool. */ @@ -1769,23 +1777,15 @@ export namespace PoolUpdateParams { } } -export interface PoolListParams { - /** - * The ID of the Monitor to use for checking the health of origins within this - * pool. - */ - monitor?: unknown; -} - export namespace Pools { export import PoolCreateResponse = PoolsAPI.PoolCreateResponse; - export import PoolUpdateResponse = PoolsAPI.PoolUpdateResponse; export import PoolListResponse = PoolsAPI.PoolListResponse; export import PoolDeleteResponse = PoolsAPI.PoolDeleteResponse; + export import PoolEditResponse = PoolsAPI.PoolEditResponse; export import PoolGetResponse = PoolsAPI.PoolGetResponse; export import PoolCreateParams = PoolsAPI.PoolCreateParams; - export import PoolUpdateParams = PoolsAPI.PoolUpdateParams; export import PoolListParams = PoolsAPI.PoolListParams; + export import PoolEditParams = PoolsAPI.PoolEditParams; export import Health = HealthAPI.Health; export import HealthListResponse = HealthAPI.HealthListResponse; export import Previews = PreviewsAPI.Previews; diff --git a/src/resources/users/subscriptions.ts b/src/resources/users/subscriptions.ts index 9278851cd8..22eec0d5fc 100644 --- a/src/resources/users/subscriptions.ts +++ b/src/resources/users/subscriptions.ts @@ -5,6 +5,21 @@ import { APIResource } from 'cloudflare/resource'; import * as SubscriptionsAPI from 'cloudflare/resources/users/subscriptions'; export class Subscriptions extends APIResource { + /** + * Updates a user's subscriptions. + */ + update( + identifier: string, + body: SubscriptionUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/user/subscriptions/${identifier}`, { body, ...options }) as Core.APIPromise<{ + result: SubscriptionUpdateResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + /** * Lists all of a user's subscriptions. */ @@ -22,23 +37,10 @@ export class Subscriptions extends APIResource { delete(identifier: string, options?: Core.RequestOptions): Core.APIPromise { return this._client.delete(`/user/subscriptions/${identifier}`, options); } - - /** - * Updates a user's subscriptions. - */ - replace( - identifier: string, - body: SubscriptionReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put(`/user/subscriptions/${identifier}`, { body, ...options }) as Core.APIPromise<{ - result: SubscriptionReplaceResponse; - }> - )._thenUnwrap((obj) => obj.result); - } } +export type SubscriptionUpdateResponse = unknown | string | null; + export type SubscriptionListResponse = Array; export namespace SubscriptionListResponse { @@ -194,15 +196,13 @@ export interface SubscriptionDeleteResponse { subscription_id?: string; } -export type SubscriptionReplaceResponse = unknown | string | null; - -export interface SubscriptionReplaceParams { - app?: SubscriptionReplaceParams.App; +export interface SubscriptionUpdateParams { + app?: SubscriptionUpdateParams.App; /** * The list of add-ons subscribed to. */ - component_values?: Array; + component_values?: Array; /** * How often the subscription is renewed automatically. @@ -212,15 +212,15 @@ export interface SubscriptionReplaceParams { /** * The rate plan applied to the subscription. */ - rate_plan?: SubscriptionReplaceParams.RatePlan; + rate_plan?: SubscriptionUpdateParams.RatePlan; /** * A simple zone object. May have null properties if not a zone subscription. */ - zone?: SubscriptionReplaceParams.Zone; + zone?: SubscriptionUpdateParams.Zone; } -export namespace SubscriptionReplaceParams { +export namespace SubscriptionUpdateParams { export interface App { /** * app install id. @@ -300,8 +300,8 @@ export namespace SubscriptionReplaceParams { } export namespace Subscriptions { + export import SubscriptionUpdateResponse = SubscriptionsAPI.SubscriptionUpdateResponse; export import SubscriptionListResponse = SubscriptionsAPI.SubscriptionListResponse; export import SubscriptionDeleteResponse = SubscriptionsAPI.SubscriptionDeleteResponse; - export import SubscriptionReplaceResponse = SubscriptionsAPI.SubscriptionReplaceResponse; - export import SubscriptionReplaceParams = SubscriptionsAPI.SubscriptionReplaceParams; + export import SubscriptionUpdateParams = SubscriptionsAPI.SubscriptionUpdateParams; } diff --git a/src/resources/users/tokens/index.ts b/src/resources/users/tokens/index.ts index 76d4445a35..ca7ff44105 100644 --- a/src/resources/users/tokens/index.ts +++ b/src/resources/users/tokens/index.ts @@ -3,15 +3,15 @@ export { PermissionGroupListResponse, PermissionGroups } from './permission-groups'; export { TokenCreateResponse, + TokenUpdateResponse, TokenListResponse, TokenDeleteResponse, TokenGetResponse, - TokenReplaceResponse, TokenVerifyResponse, TokenCreateParams, + TokenUpdateParams, TokenListParams, - TokenReplaceParams, TokenListResponsesV4PagePaginationArray, Tokens, } from './tokens'; -export { ValueReplaceResponse, ValueReplaceParams, Values } from './values'; +export { ValueUpdateResponse, ValueUpdateParams, Values } from './values'; diff --git a/src/resources/users/tokens/tokens.ts b/src/resources/users/tokens/tokens.ts index df9fa33313..b7f76d4fda 100644 --- a/src/resources/users/tokens/tokens.ts +++ b/src/resources/users/tokens/tokens.ts @@ -25,6 +25,21 @@ export class Tokens extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Update an existing token. + */ + update( + tokenId: unknown, + body: TokenUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/user/tokens/${tokenId}`, { body, ...options }) as Core.APIPromise<{ + result: TokenUpdateResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + /** * List all access tokens you created. */ @@ -68,21 +83,6 @@ export class Tokens extends APIResource { )._thenUnwrap((obj) => obj.result); } - /** - * Update an existing token. - */ - replace( - tokenId: unknown, - body: TokenReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put(`/user/tokens/${tokenId}`, { body, ...options }) as Core.APIPromise<{ - result: TokenReplaceResponse; - }> - )._thenUnwrap((obj) => obj.result); - } - /** * Test whether a token works. */ @@ -102,6 +102,8 @@ export interface TokenCreateResponse { value?: string; } +export type TokenUpdateResponse = unknown | string | null; + export type TokenListResponse = unknown; export interface TokenDeleteResponse { @@ -113,8 +115,6 @@ export interface TokenDeleteResponse { export type TokenGetResponse = unknown | string | null; -export type TokenReplaceResponse = unknown | string | null; - export interface TokenVerifyResponse { /** * Token identifier tag. @@ -214,14 +214,7 @@ export namespace TokenCreateParams { } } -export interface TokenListParams extends V4PagePaginationArrayParams { - /** - * Direction to order results. - */ - direction?: 'asc' | 'desc'; -} - -export interface TokenReplaceParams { +export interface TokenUpdateParams { /** * Token name. */ @@ -230,14 +223,14 @@ export interface TokenReplaceParams { /** * List of access policies assigned to the token. */ - policies: Array; + policies: Array; /** * Status of the token. */ status: 'active' | 'disabled' | 'expired'; - condition?: TokenReplaceParams.Condition; + condition?: TokenUpdateParams.Condition; /** * The expiration time on or after which the JWT MUST NOT be accepted for @@ -251,7 +244,7 @@ export interface TokenReplaceParams { not_before?: string; } -export namespace TokenReplaceParams { +export namespace TokenUpdateParams { export interface Policy { /** * Allow or deny operations against the resources. @@ -302,20 +295,27 @@ export namespace TokenReplaceParams { } } +export interface TokenListParams extends V4PagePaginationArrayParams { + /** + * Direction to order results. + */ + direction?: 'asc' | 'desc'; +} + export namespace Tokens { export import TokenCreateResponse = TokensAPI.TokenCreateResponse; + export import TokenUpdateResponse = TokensAPI.TokenUpdateResponse; export import TokenListResponse = TokensAPI.TokenListResponse; export import TokenDeleteResponse = TokensAPI.TokenDeleteResponse; export import TokenGetResponse = TokensAPI.TokenGetResponse; - export import TokenReplaceResponse = TokensAPI.TokenReplaceResponse; export import TokenVerifyResponse = TokensAPI.TokenVerifyResponse; export import TokenListResponsesV4PagePaginationArray = TokensAPI.TokenListResponsesV4PagePaginationArray; export import TokenCreateParams = TokensAPI.TokenCreateParams; + export import TokenUpdateParams = TokensAPI.TokenUpdateParams; export import TokenListParams = TokensAPI.TokenListParams; - export import TokenReplaceParams = TokensAPI.TokenReplaceParams; export import PermissionGroups = PermissionGroupsAPI.PermissionGroups; export import PermissionGroupListResponse = PermissionGroupsAPI.PermissionGroupListResponse; export import Values = ValuesAPI.Values; - export import ValueReplaceResponse = ValuesAPI.ValueReplaceResponse; - export import ValueReplaceParams = ValuesAPI.ValueReplaceParams; + export import ValueUpdateResponse = ValuesAPI.ValueUpdateResponse; + export import ValueUpdateParams = ValuesAPI.ValueUpdateParams; } diff --git a/src/resources/users/tokens/values.ts b/src/resources/users/tokens/values.ts index 8c1fc3230d..225b24d0b4 100644 --- a/src/resources/users/tokens/values.ts +++ b/src/resources/users/tokens/values.ts @@ -8,14 +8,14 @@ export class Values extends APIResource { /** * Roll the token secret. */ - replace( + update( tokenId: unknown, - body: ValueReplaceParams, + body: ValueUpdateParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.put(`/user/tokens/${tokenId}/value`, { body, ...options }) as Core.APIPromise<{ - result: ValueReplaceResponse; + result: ValueUpdateResponse; }> )._thenUnwrap((obj) => obj.result); } @@ -24,11 +24,11 @@ export class Values extends APIResource { /** * The token value. */ -export type ValueReplaceResponse = string; +export type ValueUpdateResponse = string; -export type ValueReplaceParams = unknown; +export type ValueUpdateParams = unknown; export namespace Values { - export import ValueReplaceResponse = ValuesAPI.ValueReplaceResponse; - export import ValueReplaceParams = ValuesAPI.ValueReplaceParams; + export import ValueUpdateResponse = ValuesAPI.ValueUpdateResponse; + export import ValueUpdateParams = ValuesAPI.ValueUpdateParams; } diff --git a/src/resources/users/users.ts b/src/resources/users/users.ts index 7c8fd14348..bf543bbf98 100644 --- a/src/resources/users/users.ts +++ b/src/resources/users/users.ts @@ -25,15 +25,6 @@ export class Users extends APIResource { subscriptions: SubscriptionsAPI.Subscriptions = new SubscriptionsAPI.Subscriptions(this._client); tokens: TokensAPI.Tokens = new TokensAPI.Tokens(this._client); - /** - * Edit part of your user details. - */ - update(body: UserUpdateParams, options?: Core.RequestOptions): Core.APIPromise { - return ( - this._client.patch('/user', { body, ...options }) as Core.APIPromise<{ result: UserUpdateResponse }> - )._thenUnwrap((obj) => obj.result); - } - /** * User Details */ @@ -42,13 +33,22 @@ export class Users extends APIResource { (obj) => obj.result, ); } -} -export type UserUpdateResponse = unknown | string | null; + /** + * Edit part of your user details. + */ + edit(body: UserEditParams, options?: Core.RequestOptions): Core.APIPromise { + return ( + this._client.patch('/user', { body, ...options }) as Core.APIPromise<{ result: UserEditResponse }> + )._thenUnwrap((obj) => obj.result); + } +} export type UserListResponse = unknown | string | null; -export interface UserUpdateParams { +export type UserEditResponse = unknown | string | null; + +export interface UserEditParams { /** * The country in which the user lives. */ @@ -76,9 +76,9 @@ export interface UserUpdateParams { } export namespace Users { - export import UserUpdateResponse = UsersAPI.UserUpdateResponse; export import UserListResponse = UsersAPI.UserListResponse; - export import UserUpdateParams = UsersAPI.UserUpdateParams; + export import UserEditResponse = UsersAPI.UserEditResponse; + export import UserEditParams = UsersAPI.UserEditParams; export import AuditLogs = AuditLogsAPI.AuditLogs; export import AuditLogListResponse = AuditLogsAPI.AuditLogListResponse; export import AuditLogListResponsesV4PagePaginationArray = AuditLogsAPI.AuditLogListResponsesV4PagePaginationArray; @@ -86,10 +86,10 @@ export namespace Users { export import Billings = BillingsAPI.Billings; export import Firewall = FirewallAPI.Firewall; export import Invites = InvitesAPI.Invites; - export import InviteUpdateResponse = InvitesAPI.InviteUpdateResponse; export import InviteListResponse = InvitesAPI.InviteListResponse; + export import InviteEditResponse = InvitesAPI.InviteEditResponse; export import InviteGetResponse = InvitesAPI.InviteGetResponse; - export import InviteUpdateParams = InvitesAPI.InviteUpdateParams; + export import InviteEditParams = InvitesAPI.InviteEditParams; export import LoadBalancers = LoadBalancersAPI.LoadBalancers; export import LoadBalancingAnalytics = LoadBalancingAnalyticsAPI.LoadBalancingAnalytics; export import Organizations = OrganizationsAPI.Organizations; @@ -99,19 +99,19 @@ export namespace Users { export import OrganizationListResponsesV4PagePaginationArray = OrganizationsAPI.OrganizationListResponsesV4PagePaginationArray; export import OrganizationListParams = OrganizationsAPI.OrganizationListParams; export import Subscriptions = SubscriptionsAPI.Subscriptions; + export import SubscriptionUpdateResponse = SubscriptionsAPI.SubscriptionUpdateResponse; export import SubscriptionListResponse = SubscriptionsAPI.SubscriptionListResponse; export import SubscriptionDeleteResponse = SubscriptionsAPI.SubscriptionDeleteResponse; - export import SubscriptionReplaceResponse = SubscriptionsAPI.SubscriptionReplaceResponse; - export import SubscriptionReplaceParams = SubscriptionsAPI.SubscriptionReplaceParams; + export import SubscriptionUpdateParams = SubscriptionsAPI.SubscriptionUpdateParams; export import Tokens = TokensAPI.Tokens; export import TokenCreateResponse = TokensAPI.TokenCreateResponse; + export import TokenUpdateResponse = TokensAPI.TokenUpdateResponse; export import TokenListResponse = TokensAPI.TokenListResponse; export import TokenDeleteResponse = TokensAPI.TokenDeleteResponse; export import TokenGetResponse = TokensAPI.TokenGetResponse; - export import TokenReplaceResponse = TokensAPI.TokenReplaceResponse; export import TokenVerifyResponse = TokensAPI.TokenVerifyResponse; export import TokenListResponsesV4PagePaginationArray = TokensAPI.TokenListResponsesV4PagePaginationArray; export import TokenCreateParams = TokensAPI.TokenCreateParams; + export import TokenUpdateParams = TokensAPI.TokenUpdateParams; export import TokenListParams = TokensAPI.TokenListParams; - export import TokenReplaceParams = TokensAPI.TokenReplaceParams; } diff --git a/src/resources/vectorize/index.ts b/src/resources/vectorize/index.ts index 3cb8a6584e..1f95ac8c15 100644 --- a/src/resources/vectorize/index.ts +++ b/src/resources/vectorize/index.ts @@ -2,17 +2,17 @@ export { IndexCreateResponse, + IndexUpdateResponse, IndexListResponse, IndexDeleteResponse, IndexGetResponse, IndexInsertResponse, IndexQueryResponse, - IndexReplaceResponse, IndexUpsertResponse, IndexCreateParams, + IndexUpdateParams, IndexInsertParams, IndexQueryParams, - IndexReplaceParams, IndexUpsertParams, Indexes, } from './indexes'; diff --git a/src/resources/vectorize/indexes.ts b/src/resources/vectorize/indexes.ts index 1d5a52eeb4..caff615ad8 100644 --- a/src/resources/vectorize/indexes.ts +++ b/src/resources/vectorize/indexes.ts @@ -21,6 +21,23 @@ export class Indexes extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Updates and returns the specified Vectorize Index. + */ + update( + accountIdentifier: string, + indexName: string, + body: IndexUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/accounts/${accountIdentifier}/vectorize/indexes/${indexName}`, { + body, + ...options, + }) as Core.APIPromise<{ result: IndexUpdateResponse | null }> + )._thenUnwrap((obj) => obj.result); + } + /** * Returns a list of Vectorize Indexes */ @@ -99,23 +116,6 @@ export class Indexes extends APIResource { )._thenUnwrap((obj) => obj.result); } - /** - * Updates and returns the specified Vectorize Index. - */ - replace( - accountIdentifier: string, - indexName: string, - body: IndexReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put(`/accounts/${accountIdentifier}/vectorize/indexes/${indexName}`, { - body, - ...options, - }) as Core.APIPromise<{ result: IndexReplaceResponse | null }> - )._thenUnwrap((obj) => obj.result); - } - /** * Upserts vectors into the specified index, creating them if they do not exist and * returns the count of values and ids successfully inserted. @@ -170,6 +170,41 @@ export namespace IndexCreateResponse { } } +export interface IndexUpdateResponse { + config?: IndexUpdateResponse.Config; + + /** + * Specifies the timestamp the resource was created as an ISO8601 string. + */ + created_on?: unknown; + + /** + * Specifies the description of the index. + */ + description?: string; + + /** + * Specifies the timestamp the resource was modified as an ISO8601 string. + */ + modified_on?: unknown; + + name?: string; +} + +export namespace IndexUpdateResponse { + export interface Config { + /** + * Specifies the number of dimensions for the index + */ + dimensions: number; + + /** + * Specifies the type of metric to use calculating distance. + */ + metric: 'cosine' | 'euclidean' | 'dot-product'; + } +} + export type IndexListResponse = Array; export namespace IndexListResponse { @@ -288,41 +323,6 @@ export namespace IndexQueryResponse { } } -export interface IndexReplaceResponse { - config?: IndexReplaceResponse.Config; - - /** - * Specifies the timestamp the resource was created as an ISO8601 string. - */ - created_on?: unknown; - - /** - * Specifies the description of the index. - */ - description?: string; - - /** - * Specifies the timestamp the resource was modified as an ISO8601 string. - */ - modified_on?: unknown; - - name?: string; -} - -export namespace IndexReplaceResponse { - export interface Config { - /** - * Specifies the number of dimensions for the index - */ - dimensions: number; - - /** - * Specifies the type of metric to use calculating distance. - */ - metric: 'cosine' | 'euclidean' | 'dot-product'; - } -} - export interface IndexUpsertResponse { /** * Specifies the count of the vectors successfully inserted. @@ -377,6 +377,13 @@ export namespace IndexCreateParams { } } +export interface IndexUpdateParams { + /** + * Specifies the description of the index. + */ + description: string; +} + export interface IndexInsertParams {} export interface IndexQueryParams { @@ -401,27 +408,20 @@ export interface IndexQueryParams { vector?: Array; } -export interface IndexReplaceParams { - /** - * Specifies the description of the index. - */ - description: string; -} - export interface IndexUpsertParams {} export namespace Indexes { export import IndexCreateResponse = IndexesAPI.IndexCreateResponse; + export import IndexUpdateResponse = IndexesAPI.IndexUpdateResponse; export import IndexListResponse = IndexesAPI.IndexListResponse; export import IndexDeleteResponse = IndexesAPI.IndexDeleteResponse; export import IndexGetResponse = IndexesAPI.IndexGetResponse; export import IndexInsertResponse = IndexesAPI.IndexInsertResponse; export import IndexQueryResponse = IndexesAPI.IndexQueryResponse; - export import IndexReplaceResponse = IndexesAPI.IndexReplaceResponse; export import IndexUpsertResponse = IndexesAPI.IndexUpsertResponse; export import IndexCreateParams = IndexesAPI.IndexCreateParams; + export import IndexUpdateParams = IndexesAPI.IndexUpdateParams; export import IndexInsertParams = IndexesAPI.IndexInsertParams; export import IndexQueryParams = IndexesAPI.IndexQueryParams; - export import IndexReplaceParams = IndexesAPI.IndexReplaceParams; export import IndexUpsertParams = IndexesAPI.IndexUpsertParams; } diff --git a/src/resources/vectorize/vectorize.ts b/src/resources/vectorize/vectorize.ts index 6ad3cbf13e..b250e8b823 100644 --- a/src/resources/vectorize/vectorize.ts +++ b/src/resources/vectorize/vectorize.ts @@ -10,16 +10,16 @@ export class Vectorize extends APIResource { export namespace Vectorize { export import Indexes = IndexesAPI.Indexes; export import IndexCreateResponse = IndexesAPI.IndexCreateResponse; + export import IndexUpdateResponse = IndexesAPI.IndexUpdateResponse; export import IndexListResponse = IndexesAPI.IndexListResponse; export import IndexDeleteResponse = IndexesAPI.IndexDeleteResponse; export import IndexGetResponse = IndexesAPI.IndexGetResponse; export import IndexInsertResponse = IndexesAPI.IndexInsertResponse; export import IndexQueryResponse = IndexesAPI.IndexQueryResponse; - export import IndexReplaceResponse = IndexesAPI.IndexReplaceResponse; export import IndexUpsertResponse = IndexesAPI.IndexUpsertResponse; export import IndexCreateParams = IndexesAPI.IndexCreateParams; + export import IndexUpdateParams = IndexesAPI.IndexUpdateParams; export import IndexInsertParams = IndexesAPI.IndexInsertParams; export import IndexQueryParams = IndexesAPI.IndexQueryParams; - export import IndexReplaceParams = IndexesAPI.IndexReplaceParams; export import IndexUpsertParams = IndexesAPI.IndexUpsertParams; } diff --git a/src/resources/waiting-rooms/events/events.ts b/src/resources/waiting-rooms/events/events.ts index 4566a21ebc..aa0d87e716 100644 --- a/src/resources/waiting-rooms/events/events.ts +++ b/src/resources/waiting-rooms/events/events.ts @@ -30,6 +30,24 @@ export class Events extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Updates a configured event for a waiting room. + */ + update( + zoneIdentifier: string, + waitingRoomId: unknown, + eventId: unknown, + body: EventUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/zones/${zoneIdentifier}/waiting_rooms/${waitingRoomId}/events/${eventId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: EventUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * Lists events for a waiting room. */ @@ -79,27 +97,101 @@ export class Events extends APIResource { ) as Core.APIPromise<{ result: EventGetResponse }> )._thenUnwrap((obj) => obj.result); } +} + +export interface EventCreateResponse { + id?: unknown; + + created_on?: string; /** - * Updates a configured event for a waiting room. + * 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. */ - replace( - zoneIdentifier: string, - waitingRoomId: unknown, - eventId: unknown, - body: EventReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put(`/zones/${zoneIdentifier}/waiting_rooms/${waitingRoomId}/events/${eventId}`, { - body, - ...options, - }) as Core.APIPromise<{ result: EventReplaceResponse }> - )._thenUnwrap((obj) => obj.result); - } + custom_page_html?: string | null; + + /** + * A note that you can use to add more details about the event. + */ + description?: string; + + /** + * 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. + */ + disable_session_renewal?: boolean | null; + + /** + * An ISO 8601 timestamp that marks the end of the event. + */ + event_end_time?: string; + + /** + * 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`. + */ + event_start_time?: string; + + modified_on?: string; + + /** + * A unique name to identify the event. Only alphanumeric characters, hyphens and + * underscores are allowed. + */ + name?: string; + + /** + * 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. + */ + new_users_per_minute?: number | null; + + /** + * 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`. + */ + prequeue_start_time?: string | null; + + /** + * If set, the event will override the waiting room's `queueing_method` property + * while it is active. If null, the event will inherit it. + */ + queueing_method?: string | null; + + /** + * If set, the event will override the waiting room's `session_duration` property + * while it is active. If null, the event will inherit it. + */ + session_duration?: number | null; + + /** + * 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. + */ + shuffle_at_event_start?: boolean; + + /** + * Suspends or allows an event. If set to `true`, the event is ignored and traffic + * will be handled based on the waiting room configuration. + */ + suspended?: boolean; + + /** + * 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. + */ + total_active_users?: number | null; } -export interface EventCreateResponse { +export interface EventUpdateResponse { id?: unknown; created_on?: string; @@ -383,98 +475,6 @@ export interface EventGetResponse { total_active_users?: number | null; } -export interface EventReplaceResponse { - id?: unknown; - - created_on?: string; - - /** - * 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. - */ - custom_page_html?: string | null; - - /** - * A note that you can use to add more details about the event. - */ - description?: string; - - /** - * 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. - */ - disable_session_renewal?: boolean | null; - - /** - * An ISO 8601 timestamp that marks the end of the event. - */ - event_end_time?: string; - - /** - * 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`. - */ - event_start_time?: string; - - modified_on?: string; - - /** - * A unique name to identify the event. Only alphanumeric characters, hyphens and - * underscores are allowed. - */ - name?: string; - - /** - * 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. - */ - new_users_per_minute?: number | null; - - /** - * 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`. - */ - prequeue_start_time?: string | null; - - /** - * If set, the event will override the waiting room's `queueing_method` property - * while it is active. If null, the event will inherit it. - */ - queueing_method?: string | null; - - /** - * If set, the event will override the waiting room's `session_duration` property - * while it is active. If null, the event will inherit it. - */ - session_duration?: number | null; - - /** - * 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. - */ - shuffle_at_event_start?: boolean; - - /** - * Suspends or allows an event. If set to `true`, the event is ignored and traffic - * will be handled based on the waiting room configuration. - */ - suspended?: boolean; - - /** - * 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. - */ - total_active_users?: number | null; -} - export interface EventCreateParams { /** * An ISO 8601 timestamp that marks the end of the event. @@ -561,7 +561,7 @@ export interface EventCreateParams { total_active_users?: number | null; } -export interface EventReplaceParams { +export interface EventUpdateParams { /** * An ISO 8601 timestamp that marks the end of the event. */ @@ -649,12 +649,12 @@ export interface EventReplaceParams { export namespace Events { export import EventCreateResponse = EventsAPI.EventCreateResponse; + export import EventUpdateResponse = EventsAPI.EventUpdateResponse; export import EventListResponse = EventsAPI.EventListResponse; export import EventDeleteResponse = EventsAPI.EventDeleteResponse; export import EventGetResponse = EventsAPI.EventGetResponse; - export import EventReplaceResponse = EventsAPI.EventReplaceResponse; export import EventCreateParams = EventsAPI.EventCreateParams; - export import EventReplaceParams = EventsAPI.EventReplaceParams; + export import EventUpdateParams = EventsAPI.EventUpdateParams; export import Details = DetailsAPI.Details; export import DetailGetResponse = DetailsAPI.DetailGetResponse; } diff --git a/src/resources/waiting-rooms/events/index.ts b/src/resources/waiting-rooms/events/index.ts index a56d0507d5..62c141ae86 100644 --- a/src/resources/waiting-rooms/events/index.ts +++ b/src/resources/waiting-rooms/events/index.ts @@ -3,11 +3,11 @@ export { DetailGetResponse, Details } from './details'; export { EventCreateResponse, + EventUpdateResponse, EventListResponse, EventDeleteResponse, EventGetResponse, - EventReplaceResponse, EventCreateParams, - EventReplaceParams, + EventUpdateParams, Events, } from './events'; diff --git a/src/resources/waiting-rooms/index.ts b/src/resources/waiting-rooms/index.ts index 5763100119..54391be814 100644 --- a/src/resources/waiting-rooms/index.ts +++ b/src/resources/waiting-rooms/index.ts @@ -2,12 +2,12 @@ export { EventCreateResponse, + EventUpdateResponse, EventListResponse, EventDeleteResponse, EventGetResponse, - EventReplaceResponse, EventCreateParams, - EventReplaceParams, + EventUpdateParams, Events, } from './events/index'; export { @@ -15,29 +15,29 @@ export { RuleUpdateResponse, RuleListResponse, RuleDeleteResponse, - RuleReplaceResponse, + RuleEditResponse, RuleCreateParams, RuleUpdateParams, - RuleReplaceParams, + RuleEditParams, Rules, } from './rules'; export { StatusGetResponse, Statuses } from './statuses'; export { WaitingRoomCreateResponse, + WaitingRoomUpdateResponse, WaitingRoomListResponse, WaitingRoomDeleteResponse, WaitingRoomGetResponse, WaitingRoomPreviewResponse, - WaitingRoomReplaceResponse, WaitingRoomCreateParams, + WaitingRoomUpdateParams, WaitingRoomPreviewParams, - WaitingRoomReplaceParams, WaitingRooms, } from './waiting-rooms'; export { WaitingroomZoneSettingsResponse, - SettingUpdateResponse, + SettingEditResponse, SettingGetResponse, - SettingUpdateParams, + SettingEditParams, Settings, } from './settings'; diff --git a/src/resources/waiting-rooms/rules.ts b/src/resources/waiting-rooms/rules.ts index 9b1ccc80d8..995a1fc8c4 100644 --- a/src/resources/waiting-rooms/rules.ts +++ b/src/resources/waiting-rooms/rules.ts @@ -24,17 +24,17 @@ export class Rules extends APIResource { } /** - * Patches a rule for a waiting room. + * Only available for the Waiting Room Advanced subscription. Replaces all rules + * for a waiting room. */ update( zoneIdentifier: string, waitingRoomId: unknown, - ruleId: string, body: RuleUpdateParams, options?: Core.RequestOptions, ): Core.APIPromise { return ( - this._client.patch(`/zones/${zoneIdentifier}/waiting_rooms/${waitingRoomId}/rules/${ruleId}`, { + this._client.put(`/zones/${zoneIdentifier}/waiting_rooms/${waitingRoomId}/rules`, { body, ...options, }) as Core.APIPromise<{ result: RuleUpdateResponse | null }> @@ -75,20 +75,20 @@ export class Rules extends APIResource { } /** - * Only available for the Waiting Room Advanced subscription. Replaces all rules - * for a waiting room. + * Patches a rule for a waiting room. */ - replace( + edit( zoneIdentifier: string, waitingRoomId: unknown, - body: RuleReplaceParams, + ruleId: string, + body: RuleEditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( - this._client.put(`/zones/${zoneIdentifier}/waiting_rooms/${waitingRoomId}/rules`, { + this._client.patch(`/zones/${zoneIdentifier}/waiting_rooms/${waitingRoomId}/rules/${ruleId}`, { body, ...options, - }) as Core.APIPromise<{ result: RuleReplaceResponse | null }> + }) as Core.APIPromise<{ result: RuleEditResponse | null }> )._thenUnwrap((obj) => obj.result); } } @@ -245,10 +245,10 @@ export namespace RuleDeleteResponse { } } -export type RuleReplaceResponse = Array; +export type RuleEditResponse = Array; -export namespace RuleReplaceResponse { - export interface RuleReplaceResponseItem { +export namespace RuleEditResponse { + export interface RuleEditResponseItem { /** * The ID of the rule. */ @@ -305,7 +305,33 @@ export interface RuleCreateParams { enabled?: boolean; } -export interface RuleUpdateParams { +export type RuleUpdateParams = Array; + +export namespace RuleUpdateParams { + export interface Body { + /** + * The action to take when the expression matches. + */ + action: 'bypass_waiting_room'; + + /** + * Criteria defining when there is a match for the current rule. + */ + expression: string; + + /** + * The description of the rule. + */ + description?: string; + + /** + * When set to true, the rule is enabled. + */ + enabled?: boolean; + } +} + +export interface RuleEditParams { /** * The action to take when the expression matches. */ @@ -329,10 +355,10 @@ export interface RuleUpdateParams { /** * Reorder the position of a rule */ - position?: RuleUpdateParams.Index | RuleUpdateParams.Before | RuleUpdateParams.After; + position?: RuleEditParams.Index | RuleEditParams.Before | RuleEditParams.After; } -export namespace RuleUpdateParams { +export namespace RuleEditParams { export interface Index { /** * Places the rule in the exact position specified by the integer number @@ -360,39 +386,13 @@ export namespace RuleUpdateParams { } } -export type RuleReplaceParams = Array; - -export namespace RuleReplaceParams { - export interface Body { - /** - * The action to take when the expression matches. - */ - action: 'bypass_waiting_room'; - - /** - * Criteria defining when there is a match for the current rule. - */ - expression: string; - - /** - * The description of the rule. - */ - description?: string; - - /** - * When set to true, the rule is enabled. - */ - enabled?: boolean; - } -} - export namespace Rules { export import RuleCreateResponse = RulesAPI.RuleCreateResponse; export import RuleUpdateResponse = RulesAPI.RuleUpdateResponse; export import RuleListResponse = RulesAPI.RuleListResponse; export import RuleDeleteResponse = RulesAPI.RuleDeleteResponse; - export import RuleReplaceResponse = RulesAPI.RuleReplaceResponse; + export import RuleEditResponse = RulesAPI.RuleEditResponse; export import RuleCreateParams = RulesAPI.RuleCreateParams; export import RuleUpdateParams = RulesAPI.RuleUpdateParams; - export import RuleReplaceParams = RulesAPI.RuleReplaceParams; + export import RuleEditParams = RulesAPI.RuleEditParams; } diff --git a/src/resources/waiting-rooms/settings.ts b/src/resources/waiting-rooms/settings.ts index 8c8985a430..7b82ca9c29 100644 --- a/src/resources/waiting-rooms/settings.ts +++ b/src/resources/waiting-rooms/settings.ts @@ -8,16 +8,16 @@ export class Settings extends APIResource { /** * Patch zone-level Waiting Room settings */ - update( + edit( zoneIdentifier: string, - body: SettingUpdateParams, + body: SettingEditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.patch(`/zones/${zoneIdentifier}/waiting_rooms/settings`, { body, ...options, - }) as Core.APIPromise<{ result: SettingUpdateResponse }> + }) as Core.APIPromise<{ result: SettingEditResponse }> )._thenUnwrap((obj) => obj.result); } @@ -48,7 +48,7 @@ export namespace WaitingroomZoneSettingsResponse { } } -export interface SettingUpdateResponse { +export interface SettingEditResponse { /** * Whether to allow verified search engine crawlers to bypass all waiting rooms on * this zone. Verified search engine crawlers will not be tracked or counted by the @@ -66,7 +66,7 @@ export interface SettingGetResponse { search_engine_crawler_bypass: boolean; } -export interface SettingUpdateParams { +export interface SettingEditParams { /** * Whether to allow verified search engine crawlers to bypass all waiting rooms on * this zone. Verified search engine crawlers will not be tracked or counted by the @@ -77,7 +77,7 @@ export interface SettingUpdateParams { export namespace Settings { export import WaitingroomZoneSettingsResponse = SettingsAPI.WaitingroomZoneSettingsResponse; - export import SettingUpdateResponse = SettingsAPI.SettingUpdateResponse; + export import SettingEditResponse = SettingsAPI.SettingEditResponse; export import SettingGetResponse = SettingsAPI.SettingGetResponse; - export import SettingUpdateParams = SettingsAPI.SettingUpdateParams; + export import SettingEditParams = SettingsAPI.SettingEditParams; } diff --git a/src/resources/waiting-rooms/waiting-rooms.ts b/src/resources/waiting-rooms/waiting-rooms.ts index 9046c04f2c..cab0639c26 100644 --- a/src/resources/waiting-rooms/waiting-rooms.ts +++ b/src/resources/waiting-rooms/waiting-rooms.ts @@ -29,6 +29,23 @@ export class WaitingRooms extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Updates a configured waiting room. + */ + update( + zoneIdentifier: string, + waitingRoomId: unknown, + body: WaitingRoomUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/zones/${zoneIdentifier}/waiting_rooms/${waitingRoomId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: WaitingRoomUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * Lists waiting rooms. */ @@ -125,23 +142,6 @@ export class WaitingRooms extends APIResource { }) as Core.APIPromise<{ result: WaitingRoomPreviewResponse }> )._thenUnwrap((obj) => obj.result); } - - /** - * Updates a configured waiting room. - */ - replace( - zoneIdentifier: string, - waitingRoomId: unknown, - body: WaitingRoomReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put(`/zones/${zoneIdentifier}/waiting_rooms/${waitingRoomId}`, { - body, - ...options, - }) as Core.APIPromise<{ result: WaitingRoomReplaceResponse }> - )._thenUnwrap((obj) => obj.result); - } } export interface WaitingRoomCreateResponse { @@ -530,494 +530,100 @@ export namespace WaitingRoomCreateResponse { } } -export type WaitingRoomListResponse = Array; - -export namespace WaitingRoomListResponse { - export interface WaitingRoomListResponseItem { - id?: unknown; +export interface WaitingRoomUpdateResponse { + id?: unknown; - /** - * Only available for the Waiting Room Advanced subscription. Additional hostname - * and path combinations to which this waiting room will be applied. There is an - * implied wildcard at the end of the path. The hostname and path combination must - * be unique to this and all other waiting rooms. - */ - additional_routes?: Array; + /** + * Only available for the Waiting Room Advanced subscription. Additional hostname + * and path combinations to which this waiting room will be applied. There is an + * implied wildcard at the end of the path. The hostname and path combination must + * be unique to this and all other waiting rooms. + */ + additional_routes?: Array; - /** - * Configures cookie attributes for the waiting room cookie. This encrypted cookie - * stores a user's status in the waiting room, such as queue position. - */ - cookie_attributes?: WaitingRoomListResponseItem.CookieAttributes; + /** + * Configures cookie attributes for the waiting room cookie. This encrypted cookie + * stores a user's status in the waiting room, such as queue position. + */ + cookie_attributes?: WaitingRoomUpdateResponse.CookieAttributes; - /** - * Appends a '\_' + a custom suffix to the end of Cloudflare Waiting Room's cookie - * name(**cf_waitingroom). If `cookie_suffix` is "abcd", the cookie name will be - * `**cf_waitingroom_abcd`. This field is required if using `additional_routes`. - */ - cookie_suffix?: string; + /** + * Appends a '\_' + a custom suffix to the end of Cloudflare Waiting Room's cookie + * name(**cf_waitingroom). If `cookie_suffix` is "abcd", the cookie name will be + * `**cf_waitingroom_abcd`. This field is required if using `additional_routes`. + */ + cookie_suffix?: string; - created_on?: string; + created_on?: string; - /** - * Only available for the Waiting Room Advanced subscription. This is a template - * html file that will be rendered at the edge. If no custom_page_html is provided, - * the default waiting room will be used. The template is based on mustache ( - * https://mustache.github.io/ ). There are several variables that are evaluated by - * the Cloudflare edge: - * - * 1. {{`waitTimeKnown`}} Acts like a boolean value that indicates the behavior to - * take when wait time is not available, for instance when queue_all is - * **true**. - * 2. {{`waitTimeFormatted`}} Estimated wait time for the user. For example, five - * minutes. Alternatively, you can use: - * 3. {{`waitTime`}} Number of minutes of estimated wait for a user. - * 4. {{`waitTimeHours`}} Number of hours of estimated wait for a user - * (`Math.floor(waitTime/60)`). - * 5. {{`waitTimeHourMinutes`}} Number of minutes above the `waitTimeHours` value - * (`waitTime%60`). - * 6. {{`queueIsFull`}} Changes to **true** when no more people can be added to the - * queue. - * - * To view the full list of variables, look at the `cfWaitingRoom` object described - * under the `json_response_enabled` property in other Waiting Room API calls. - */ - custom_page_html?: string; + /** + * Only available for the Waiting Room Advanced subscription. This is a template + * html file that will be rendered at the edge. If no custom_page_html is provided, + * the default waiting room will be used. The template is based on mustache ( + * https://mustache.github.io/ ). There are several variables that are evaluated by + * the Cloudflare edge: + * + * 1. {{`waitTimeKnown`}} Acts like a boolean value that indicates the behavior to + * take when wait time is not available, for instance when queue_all is + * **true**. + * 2. {{`waitTimeFormatted`}} Estimated wait time for the user. For example, five + * minutes. Alternatively, you can use: + * 3. {{`waitTime`}} Number of minutes of estimated wait for a user. + * 4. {{`waitTimeHours`}} Number of hours of estimated wait for a user + * (`Math.floor(waitTime/60)`). + * 5. {{`waitTimeHourMinutes`}} Number of minutes above the `waitTimeHours` value + * (`waitTime%60`). + * 6. {{`queueIsFull`}} Changes to **true** when no more people can be added to the + * queue. + * + * To view the full list of variables, look at the `cfWaitingRoom` object described + * under the `json_response_enabled` property in other Waiting Room API calls. + */ + custom_page_html?: string; - /** - * The language of the default page template. If no default_template_language is - * provided, then `en-US` (English) will be used. - */ - default_template_language?: - | 'en-US' - | 'es-ES' - | 'de-DE' - | 'fr-FR' - | 'it-IT' - | 'ja-JP' - | 'ko-KR' - | 'pt-BR' - | 'zh-CN' - | 'zh-TW' - | 'nl-NL' - | 'pl-PL' - | 'id-ID' - | 'tr-TR' - | 'ar-EG' - | 'ru-RU' - | 'fa-IR'; + /** + * The language of the default page template. If no default_template_language is + * provided, then `en-US` (English) will be used. + */ + default_template_language?: + | 'en-US' + | 'es-ES' + | 'de-DE' + | 'fr-FR' + | 'it-IT' + | 'ja-JP' + | 'ko-KR' + | 'pt-BR' + | 'zh-CN' + | 'zh-TW' + | 'nl-NL' + | 'pl-PL' + | 'id-ID' + | 'tr-TR' + | 'ar-EG' + | 'ru-RU' + | 'fa-IR'; - /** - * A note that you can use to add more details about the waiting room. - */ - description?: string; + /** + * A note that you can use to add more details about the waiting room. + */ + description?: string; - /** - * Only available for the Waiting Room Advanced subscription. Disables automatic - * renewal of session cookies. If `true`, an accepted user will have - * session_duration minutes to browse the site. After that, they will have to go - * through the waiting room again. If `false`, a user's session cookie will be - * automatically renewed on every request. - */ - disable_session_renewal?: boolean; + /** + * Only available for the Waiting Room Advanced subscription. Disables automatic + * renewal of session cookies. If `true`, an accepted user will have + * session_duration minutes to browse the site. After that, they will have to go + * through the waiting room again. If `false`, a user's session cookie will be + * automatically renewed on every request. + */ + disable_session_renewal?: boolean; - /** - * The host name to which the waiting room will be applied (no wildcards). Please - * do not include the scheme (http:// or https://). The host and path combination - * must be unique. - */ - host?: string; - - /** - * Only available for the Waiting Room Advanced subscription. If `true`, requests - * to the waiting room with the header `Accept: application/json` will receive a - * JSON response object with information on the user's status in the waiting room - * as opposed to the configured static HTML page. This JSON response object has one - * property `cfWaitingRoom` which is an object containing the following fields: - * - * 1. `inWaitingRoom`: Boolean indicating if the user is in the waiting room - * (always **true**). - * 2. `waitTimeKnown`: Boolean indicating if the current estimated wait times are - * accurate. If **false**, they are not available. - * 3. `waitTime`: Valid only when `waitTimeKnown` is **true**. Integer indicating - * the current estimated time in minutes the user will wait in the waiting room. - * When `queueingMethod` is **random**, this is set to `waitTime50Percentile`. - * 4. `waitTime25Percentile`: Valid only when `queueingMethod` is **random** and - * `waitTimeKnown` is **true**. Integer indicating the current estimated maximum - * wait time for the 25% of users that gain entry the fastest (25th percentile). - * 5. `waitTime50Percentile`: Valid only when `queueingMethod` is **random** and - * `waitTimeKnown` is **true**. Integer indicating the current estimated maximum - * wait time for the 50% of users that gain entry the fastest (50th percentile). - * In other words, half of the queued users are expected to let into the origin - * website before `waitTime50Percentile` and half are expected to be let in - * after it. - * 6. `waitTime75Percentile`: Valid only when `queueingMethod` is **random** and - * `waitTimeKnown` is **true**. Integer indicating the current estimated maximum - * wait time for the 75% of users that gain entry the fastest (75th percentile). - * 7. `waitTimeFormatted`: String displaying the `waitTime` formatted in English - * for users. If `waitTimeKnown` is **false**, `waitTimeFormatted` will display - * **unavailable**. - * 8. `queueIsFull`: Boolean indicating if the waiting room's queue is currently - * full and not accepting new users at the moment. - * 9. `queueAll`: Boolean indicating if all users will be queued in the waiting - * room and no one will be let into the origin website. - * 10. `lastUpdated`: String displaying the timestamp as an ISO 8601 string of the - * user's last attempt to leave the waiting room and be let into the origin - * website. The user is able to make another attempt after - * `refreshIntervalSeconds` past this time. If the user makes a request too - * soon, it will be ignored and `lastUpdated` will not change. - * 11. `refreshIntervalSeconds`: Integer indicating the number of seconds after - * `lastUpdated` until the user is able to make another attempt to leave the - * waiting room and be let into the origin website. When the `queueingMethod` - * is `reject`, there is no specified refresh time — it will always be - * **zero**. - * 12. `queueingMethod`: The queueing method currently used by the waiting room. It - * is either **fifo**, **random**, **passthrough**, or **reject**. - * 13. `isFIFOQueue`: Boolean indicating if the waiting room uses a FIFO - * (First-In-First-Out) queue. - * 14. `isRandomQueue`: Boolean indicating if the waiting room uses a Random queue - * where users gain access randomly. - * 15. `isPassthroughQueue`: Boolean indicating if the waiting room uses a - * passthrough queue. Keep in mind that when passthrough is enabled, this JSON - * response will only exist when `queueAll` is **true** or `isEventPrequeueing` - * is **true** because in all other cases requests will go directly to the - * origin. - * 16. `isRejectQueue`: Boolean indicating if the waiting room uses a reject queue. - * 17. `isEventActive`: Boolean indicating if an event is currently occurring. - * Events are able to change a waiting room's behavior during a specified - * period of time. For additional information, look at the event properties - * `prequeue_start_time`, `event_start_time`, and `event_end_time` in the - * documentation for creating waiting room events. Events are considered active - * between these start and end times, as well as during the prequeueing period - * if it exists. - * 18. `isEventPrequeueing`: Valid only when `isEventActive` is **true**. Boolean - * indicating if an event is currently prequeueing users before it starts. - * 19. `timeUntilEventStart`: Valid only when `isEventPrequeueing` is **true**. - * Integer indicating the number of minutes until the event starts. - * 20. `timeUntilEventStartFormatted`: String displaying the `timeUntilEventStart` - * formatted in English for users. If `isEventPrequeueing` is **false**, - * `timeUntilEventStartFormatted` will display **unavailable**. - * 21. `timeUntilEventEnd`: Valid only when `isEventActive` is **true**. Integer - * indicating the number of minutes until the event ends. - * 22. `timeUntilEventEndFormatted`: String displaying the `timeUntilEventEnd` - * formatted in English for users. If `isEventActive` is **false**, - * `timeUntilEventEndFormatted` will display **unavailable**. - * 23. `shuffleAtEventStart`: Valid only when `isEventActive` is **true**. Boolean - * indicating if the users in the prequeue are shuffled randomly when the event - * starts. - * - * An example cURL to a waiting room could be: - * - * curl -X GET "https://example.com/waitingroom" \ - * -H "Accept: application/json" - * - * If `json_response_enabled` is **true** and the request hits the waiting room, an - * example JSON response when `queueingMethod` is **fifo** and no event is active - * could be: - * - * { - * "cfWaitingRoom": { - * "inWaitingRoom": true, - * "waitTimeKnown": true, - * "waitTime": 10, - * "waitTime25Percentile": 0, - * "waitTime50Percentile": 0, - * "waitTime75Percentile": 0, - * "waitTimeFormatted": "10 minutes", - * "queueIsFull": false, - * "queueAll": false, - * "lastUpdated": "2020-08-03T23:46:00.000Z", - * "refreshIntervalSeconds": 20, - * "queueingMethod": "fifo", - * "isFIFOQueue": true, - * "isRandomQueue": false, - * "isPassthroughQueue": false, - * "isRejectQueue": false, - * "isEventActive": false, - * "isEventPrequeueing": false, - * "timeUntilEventStart": 0, - * "timeUntilEventStartFormatted": "unavailable", - * "timeUntilEventEnd": 0, - * "timeUntilEventEndFormatted": "unavailable", - * "shuffleAtEventStart": false - * } - * } - * - * If `json_response_enabled` is **true** and the request hits the waiting room, an - * example JSON response when `queueingMethod` is **random** and an event is active - * could be: - * - * { - * "cfWaitingRoom": { - * "inWaitingRoom": true, - * "waitTimeKnown": true, - * "waitTime": 10, - * "waitTime25Percentile": 5, - * "waitTime50Percentile": 10, - * "waitTime75Percentile": 15, - * "waitTimeFormatted": "5 minutes to 15 minutes", - * "queueIsFull": false, - * "queueAll": false, - * "lastUpdated": "2020-08-03T23:46:00.000Z", - * "refreshIntervalSeconds": 20, - * "queueingMethod": "random", - * "isFIFOQueue": false, - * "isRandomQueue": true, - * "isPassthroughQueue": false, - * "isRejectQueue": false, - * "isEventActive": true, - * "isEventPrequeueing": false, - * "timeUntilEventStart": 0, - * "timeUntilEventStartFormatted": "unavailable", - * "timeUntilEventEnd": 15, - * "timeUntilEventEndFormatted": "15 minutes", - * "shuffleAtEventStart": true - * } - * }. - */ - json_response_enabled?: boolean; - - modified_on?: string; - - /** - * A unique name to identify the waiting room. Only alphanumeric characters, - * hyphens and underscores are allowed. - */ - name?: string; - - /** - * Sets the number of new users that will be let into the route every minute. This - * value is used as baseline for the number of users that are let in per minute. So - * it is possible that there is a little more or little less traffic coming to the - * route based on the traffic patterns at that time around the world. - */ - new_users_per_minute?: number; - - /** - * An ISO 8601 timestamp that marks when the next event will begin queueing. - */ - next_event_prequeue_start_time?: string | null; - - /** - * An ISO 8601 timestamp that marks when the next event will start. - */ - next_event_start_time?: string | null; - - /** - * 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. - */ - path?: string; - - /** - * If queue_all is `true`, all the traffic that is coming to a route will be sent - * to the waiting room. No new traffic can get to the route once this field is set - * and estimated time will become unavailable. - */ - queue_all?: boolean; - - /** - * Sets the queueing method used by the waiting room. Changing this parameter from - * the **default** queueing method is only available for the Waiting Room Advanced - * subscription. Regardless of the queueing method, if `queue_all` is enabled or an - * event is prequeueing, users in the waiting room will not be accepted to the - * origin. These users will always see a waiting room page that refreshes - * automatically. The valid queueing methods are: - * - * 1. `fifo` **(default)**: First-In-First-Out queue where customers gain access in - * the order they arrived. - * 2. `random`: Random queue where customers gain access randomly, regardless of - * arrival time. - * 3. `passthrough`: Users will pass directly through the waiting room and into the - * origin website. As a result, any configured limits will not be respected - * while this is enabled. This method can be used as an alternative to disabling - * a waiting room (with `suspended`) so that analytics are still reported. This - * can be used if you wish to allow all traffic normally, but want to restrict - * traffic during a waiting room event, or vice versa. - * 4. `reject`: Users will be immediately rejected from the waiting room. As a - * result, no users will reach the origin website while this is enabled. This - * can be used if you wish to reject all traffic while performing maintenance, - * block traffic during a specified period of time (an event), or block traffic - * while events are not occurring. Consider a waiting room used for vaccine - * distribution that only allows traffic during sign-up events, and otherwise - * blocks all traffic. For this case, the waiting room uses `reject`, and its - * events override this with `fifo`, `random`, or `passthrough`. When this - * queueing method is enabled and neither `queueAll` is enabled nor an event is - * prequeueing, the waiting room page **will not refresh automatically**. - */ - queueing_method?: 'fifo' | 'random' | 'passthrough' | 'reject'; - - /** - * HTTP status code returned to a user while in the queue. - */ - queueing_status_code?: 200 | 202 | 429; - - /** - * Lifetime of a cookie (in minutes) set by Cloudflare for users who get access to - * the route. If a user is not seen by Cloudflare again in that time period, they - * will be treated as a new user that visits the route. - */ - session_duration?: number; - - /** - * Suspends or allows traffic going to the waiting room. If set to `true`, the - * traffic will not go to the waiting room. - */ - suspended?: boolean; - - /** - * Sets the total number of active user sessions on the route at a point in time. A - * route is a combination of host and path on which a waiting room is available. - * This value is used as a baseline for the total number of active user sessions on - * the route. It is possible to have a situation where there are more or less - * active users sessions on the route based on the traffic patterns at that time - * around the world. - */ - total_active_users?: number; - } - - export namespace WaitingRoomListResponseItem { - export interface AdditionalRoute { - /** - * 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://). - */ - host?: string; - - /** - * 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. - */ - path?: string; - } - - /** - * Configures cookie attributes for the waiting room cookie. This encrypted cookie - * stores a user's status in the waiting room, such as queue position. - */ - export interface CookieAttributes { - /** - * Configures the SameSite attribute on the waiting room cookie. Value `auto` will - * be translated to `lax` or `none` depending if **Always Use HTTPS** is enabled. - * Note that when using value `none`, the secure attribute cannot be set to - * `never`. - */ - samesite?: 'auto' | 'lax' | 'none' | 'strict'; - - /** - * Configures the Secure attribute on the waiting room cookie. Value `always` - * indicates that the Secure attribute will be set in the Set-Cookie header, - * `never` indicates that the Secure attribute will not be set, and `auto` will set - * the Secure attribute depending if **Always Use HTTPS** is enabled. - */ - secure?: 'auto' | 'always' | 'never'; - } - } -} - -export interface WaitingRoomDeleteResponse { - id?: unknown; -} - -export interface WaitingRoomGetResponse { - id?: unknown; - - /** - * Only available for the Waiting Room Advanced subscription. Additional hostname - * and path combinations to which this waiting room will be applied. There is an - * implied wildcard at the end of the path. The hostname and path combination must - * be unique to this and all other waiting rooms. - */ - additional_routes?: Array; - - /** - * Configures cookie attributes for the waiting room cookie. This encrypted cookie - * stores a user's status in the waiting room, such as queue position. - */ - cookie_attributes?: WaitingRoomGetResponse.CookieAttributes; - - /** - * Appends a '\_' + a custom suffix to the end of Cloudflare Waiting Room's cookie - * name(**cf_waitingroom). If `cookie_suffix` is "abcd", the cookie name will be - * `**cf_waitingroom_abcd`. This field is required if using `additional_routes`. - */ - cookie_suffix?: string; - - created_on?: string; - - /** - * Only available for the Waiting Room Advanced subscription. This is a template - * html file that will be rendered at the edge. If no custom_page_html is provided, - * the default waiting room will be used. The template is based on mustache ( - * https://mustache.github.io/ ). There are several variables that are evaluated by - * the Cloudflare edge: - * - * 1. {{`waitTimeKnown`}} Acts like a boolean value that indicates the behavior to - * take when wait time is not available, for instance when queue_all is - * **true**. - * 2. {{`waitTimeFormatted`}} Estimated wait time for the user. For example, five - * minutes. Alternatively, you can use: - * 3. {{`waitTime`}} Number of minutes of estimated wait for a user. - * 4. {{`waitTimeHours`}} Number of hours of estimated wait for a user - * (`Math.floor(waitTime/60)`). - * 5. {{`waitTimeHourMinutes`}} Number of minutes above the `waitTimeHours` value - * (`waitTime%60`). - * 6. {{`queueIsFull`}} Changes to **true** when no more people can be added to the - * queue. - * - * To view the full list of variables, look at the `cfWaitingRoom` object described - * under the `json_response_enabled` property in other Waiting Room API calls. - */ - custom_page_html?: string; - - /** - * The language of the default page template. If no default_template_language is - * provided, then `en-US` (English) will be used. - */ - default_template_language?: - | 'en-US' - | 'es-ES' - | 'de-DE' - | 'fr-FR' - | 'it-IT' - | 'ja-JP' - | 'ko-KR' - | 'pt-BR' - | 'zh-CN' - | 'zh-TW' - | 'nl-NL' - | 'pl-PL' - | 'id-ID' - | 'tr-TR' - | 'ar-EG' - | 'ru-RU' - | 'fa-IR'; - - /** - * A note that you can use to add more details about the waiting room. - */ - description?: string; - - /** - * Only available for the Waiting Room Advanced subscription. Disables automatic - * renewal of session cookies. If `true`, an accepted user will have - * session_duration minutes to browse the site. After that, they will have to go - * through the waiting room again. If `false`, a user's session cookie will be - * automatically renewed on every request. - */ - disable_session_renewal?: boolean; - - /** - * The host name to which the waiting room will be applied (no wildcards). Please - * do not include the scheme (http:// or https://). The host and path combination - * must be unique. - */ - host?: string; + /** + * The host name to which the waiting room will be applied (no wildcards). Please + * do not include the scheme (http:// or https://). The host and path combination + * must be unique. + */ + host?: string; /** * Only available for the Waiting Room Advanced subscription. If `true`, requests @@ -1176,107 +782,412 @@ export interface WaitingRoomGetResponse { */ name?: string; - /** - * Sets the number of new users that will be let into the route every minute. This - * value is used as baseline for the number of users that are let in per minute. So - * it is possible that there is a little more or little less traffic coming to the - * route based on the traffic patterns at that time around the world. - */ - new_users_per_minute?: number; + /** + * Sets the number of new users that will be let into the route every minute. This + * value is used as baseline for the number of users that are let in per minute. So + * it is possible that there is a little more or little less traffic coming to the + * route based on the traffic patterns at that time around the world. + */ + new_users_per_minute?: number; + + /** + * An ISO 8601 timestamp that marks when the next event will begin queueing. + */ + next_event_prequeue_start_time?: string | null; + + /** + * An ISO 8601 timestamp that marks when the next event will start. + */ + next_event_start_time?: string | null; + + /** + * 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. + */ + path?: string; + + /** + * If queue_all is `true`, all the traffic that is coming to a route will be sent + * to the waiting room. No new traffic can get to the route once this field is set + * and estimated time will become unavailable. + */ + queue_all?: boolean; + + /** + * Sets the queueing method used by the waiting room. Changing this parameter from + * the **default** queueing method is only available for the Waiting Room Advanced + * subscription. Regardless of the queueing method, if `queue_all` is enabled or an + * event is prequeueing, users in the waiting room will not be accepted to the + * origin. These users will always see a waiting room page that refreshes + * automatically. The valid queueing methods are: + * + * 1. `fifo` **(default)**: First-In-First-Out queue where customers gain access in + * the order they arrived. + * 2. `random`: Random queue where customers gain access randomly, regardless of + * arrival time. + * 3. `passthrough`: Users will pass directly through the waiting room and into the + * origin website. As a result, any configured limits will not be respected + * while this is enabled. This method can be used as an alternative to disabling + * a waiting room (with `suspended`) so that analytics are still reported. This + * can be used if you wish to allow all traffic normally, but want to restrict + * traffic during a waiting room event, or vice versa. + * 4. `reject`: Users will be immediately rejected from the waiting room. As a + * result, no users will reach the origin website while this is enabled. This + * can be used if you wish to reject all traffic while performing maintenance, + * block traffic during a specified period of time (an event), or block traffic + * while events are not occurring. Consider a waiting room used for vaccine + * distribution that only allows traffic during sign-up events, and otherwise + * blocks all traffic. For this case, the waiting room uses `reject`, and its + * events override this with `fifo`, `random`, or `passthrough`. When this + * queueing method is enabled and neither `queueAll` is enabled nor an event is + * prequeueing, the waiting room page **will not refresh automatically**. + */ + queueing_method?: 'fifo' | 'random' | 'passthrough' | 'reject'; + + /** + * HTTP status code returned to a user while in the queue. + */ + queueing_status_code?: 200 | 202 | 429; + + /** + * Lifetime of a cookie (in minutes) set by Cloudflare for users who get access to + * the route. If a user is not seen by Cloudflare again in that time period, they + * will be treated as a new user that visits the route. + */ + session_duration?: number; + + /** + * Suspends or allows traffic going to the waiting room. If set to `true`, the + * traffic will not go to the waiting room. + */ + suspended?: boolean; + + /** + * Sets the total number of active user sessions on the route at a point in time. A + * route is a combination of host and path on which a waiting room is available. + * This value is used as a baseline for the total number of active user sessions on + * the route. It is possible to have a situation where there are more or less + * active users sessions on the route based on the traffic patterns at that time + * around the world. + */ + total_active_users?: number; +} + +export namespace WaitingRoomUpdateResponse { + export interface AdditionalRoute { + /** + * 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://). + */ + host?: string; + + /** + * 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. + */ + path?: string; + } + + /** + * Configures cookie attributes for the waiting room cookie. This encrypted cookie + * stores a user's status in the waiting room, such as queue position. + */ + export interface CookieAttributes { + /** + * Configures the SameSite attribute on the waiting room cookie. Value `auto` will + * be translated to `lax` or `none` depending if **Always Use HTTPS** is enabled. + * Note that when using value `none`, the secure attribute cannot be set to + * `never`. + */ + samesite?: 'auto' | 'lax' | 'none' | 'strict'; + + /** + * Configures the Secure attribute on the waiting room cookie. Value `always` + * indicates that the Secure attribute will be set in the Set-Cookie header, + * `never` indicates that the Secure attribute will not be set, and `auto` will set + * the Secure attribute depending if **Always Use HTTPS** is enabled. + */ + secure?: 'auto' | 'always' | 'never'; + } +} + +export type WaitingRoomListResponse = Array; + +export namespace WaitingRoomListResponse { + export interface WaitingRoomListResponseItem { + id?: unknown; + + /** + * Only available for the Waiting Room Advanced subscription. Additional hostname + * and path combinations to which this waiting room will be applied. There is an + * implied wildcard at the end of the path. The hostname and path combination must + * be unique to this and all other waiting rooms. + */ + additional_routes?: Array; + + /** + * Configures cookie attributes for the waiting room cookie. This encrypted cookie + * stores a user's status in the waiting room, such as queue position. + */ + cookie_attributes?: WaitingRoomListResponseItem.CookieAttributes; + + /** + * Appends a '\_' + a custom suffix to the end of Cloudflare Waiting Room's cookie + * name(**cf_waitingroom). If `cookie_suffix` is "abcd", the cookie name will be + * `**cf_waitingroom_abcd`. This field is required if using `additional_routes`. + */ + cookie_suffix?: string; + + created_on?: string; - /** - * An ISO 8601 timestamp that marks when the next event will begin queueing. - */ - next_event_prequeue_start_time?: string | null; + /** + * Only available for the Waiting Room Advanced subscription. This is a template + * html file that will be rendered at the edge. If no custom_page_html is provided, + * the default waiting room will be used. The template is based on mustache ( + * https://mustache.github.io/ ). There are several variables that are evaluated by + * the Cloudflare edge: + * + * 1. {{`waitTimeKnown`}} Acts like a boolean value that indicates the behavior to + * take when wait time is not available, for instance when queue_all is + * **true**. + * 2. {{`waitTimeFormatted`}} Estimated wait time for the user. For example, five + * minutes. Alternatively, you can use: + * 3. {{`waitTime`}} Number of minutes of estimated wait for a user. + * 4. {{`waitTimeHours`}} Number of hours of estimated wait for a user + * (`Math.floor(waitTime/60)`). + * 5. {{`waitTimeHourMinutes`}} Number of minutes above the `waitTimeHours` value + * (`waitTime%60`). + * 6. {{`queueIsFull`}} Changes to **true** when no more people can be added to the + * queue. + * + * To view the full list of variables, look at the `cfWaitingRoom` object described + * under the `json_response_enabled` property in other Waiting Room API calls. + */ + custom_page_html?: string; - /** - * An ISO 8601 timestamp that marks when the next event will start. - */ - next_event_start_time?: string | null; + /** + * The language of the default page template. If no default_template_language is + * provided, then `en-US` (English) will be used. + */ + default_template_language?: + | 'en-US' + | 'es-ES' + | 'de-DE' + | 'fr-FR' + | 'it-IT' + | 'ja-JP' + | 'ko-KR' + | 'pt-BR' + | 'zh-CN' + | 'zh-TW' + | 'nl-NL' + | 'pl-PL' + | 'id-ID' + | 'tr-TR' + | 'ar-EG' + | 'ru-RU' + | 'fa-IR'; - /** - * 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. - */ - path?: string; + /** + * A note that you can use to add more details about the waiting room. + */ + description?: string; - /** - * If queue_all is `true`, all the traffic that is coming to a route will be sent - * to the waiting room. No new traffic can get to the route once this field is set - * and estimated time will become unavailable. - */ - queue_all?: boolean; + /** + * Only available for the Waiting Room Advanced subscription. Disables automatic + * renewal of session cookies. If `true`, an accepted user will have + * session_duration minutes to browse the site. After that, they will have to go + * through the waiting room again. If `false`, a user's session cookie will be + * automatically renewed on every request. + */ + disable_session_renewal?: boolean; - /** - * Sets the queueing method used by the waiting room. Changing this parameter from - * the **default** queueing method is only available for the Waiting Room Advanced - * subscription. Regardless of the queueing method, if `queue_all` is enabled or an - * event is prequeueing, users in the waiting room will not be accepted to the - * origin. These users will always see a waiting room page that refreshes - * automatically. The valid queueing methods are: - * - * 1. `fifo` **(default)**: First-In-First-Out queue where customers gain access in - * the order they arrived. - * 2. `random`: Random queue where customers gain access randomly, regardless of - * arrival time. - * 3. `passthrough`: Users will pass directly through the waiting room and into the - * origin website. As a result, any configured limits will not be respected - * while this is enabled. This method can be used as an alternative to disabling - * a waiting room (with `suspended`) so that analytics are still reported. This - * can be used if you wish to allow all traffic normally, but want to restrict - * traffic during a waiting room event, or vice versa. - * 4. `reject`: Users will be immediately rejected from the waiting room. As a - * result, no users will reach the origin website while this is enabled. This - * can be used if you wish to reject all traffic while performing maintenance, - * block traffic during a specified period of time (an event), or block traffic - * while events are not occurring. Consider a waiting room used for vaccine - * distribution that only allows traffic during sign-up events, and otherwise - * blocks all traffic. For this case, the waiting room uses `reject`, and its - * events override this with `fifo`, `random`, or `passthrough`. When this - * queueing method is enabled and neither `queueAll` is enabled nor an event is - * prequeueing, the waiting room page **will not refresh automatically**. - */ - queueing_method?: 'fifo' | 'random' | 'passthrough' | 'reject'; + /** + * The host name to which the waiting room will be applied (no wildcards). Please + * do not include the scheme (http:// or https://). The host and path combination + * must be unique. + */ + host?: string; + + /** + * Only available for the Waiting Room Advanced subscription. If `true`, requests + * to the waiting room with the header `Accept: application/json` will receive a + * JSON response object with information on the user's status in the waiting room + * as opposed to the configured static HTML page. This JSON response object has one + * property `cfWaitingRoom` which is an object containing the following fields: + * + * 1. `inWaitingRoom`: Boolean indicating if the user is in the waiting room + * (always **true**). + * 2. `waitTimeKnown`: Boolean indicating if the current estimated wait times are + * accurate. If **false**, they are not available. + * 3. `waitTime`: Valid only when `waitTimeKnown` is **true**. Integer indicating + * the current estimated time in minutes the user will wait in the waiting room. + * When `queueingMethod` is **random**, this is set to `waitTime50Percentile`. + * 4. `waitTime25Percentile`: Valid only when `queueingMethod` is **random** and + * `waitTimeKnown` is **true**. Integer indicating the current estimated maximum + * wait time for the 25% of users that gain entry the fastest (25th percentile). + * 5. `waitTime50Percentile`: Valid only when `queueingMethod` is **random** and + * `waitTimeKnown` is **true**. Integer indicating the current estimated maximum + * wait time for the 50% of users that gain entry the fastest (50th percentile). + * In other words, half of the queued users are expected to let into the origin + * website before `waitTime50Percentile` and half are expected to be let in + * after it. + * 6. `waitTime75Percentile`: Valid only when `queueingMethod` is **random** and + * `waitTimeKnown` is **true**. Integer indicating the current estimated maximum + * wait time for the 75% of users that gain entry the fastest (75th percentile). + * 7. `waitTimeFormatted`: String displaying the `waitTime` formatted in English + * for users. If `waitTimeKnown` is **false**, `waitTimeFormatted` will display + * **unavailable**. + * 8. `queueIsFull`: Boolean indicating if the waiting room's queue is currently + * full and not accepting new users at the moment. + * 9. `queueAll`: Boolean indicating if all users will be queued in the waiting + * room and no one will be let into the origin website. + * 10. `lastUpdated`: String displaying the timestamp as an ISO 8601 string of the + * user's last attempt to leave the waiting room and be let into the origin + * website. The user is able to make another attempt after + * `refreshIntervalSeconds` past this time. If the user makes a request too + * soon, it will be ignored and `lastUpdated` will not change. + * 11. `refreshIntervalSeconds`: Integer indicating the number of seconds after + * `lastUpdated` until the user is able to make another attempt to leave the + * waiting room and be let into the origin website. When the `queueingMethod` + * is `reject`, there is no specified refresh time — it will always be + * **zero**. + * 12. `queueingMethod`: The queueing method currently used by the waiting room. It + * is either **fifo**, **random**, **passthrough**, or **reject**. + * 13. `isFIFOQueue`: Boolean indicating if the waiting room uses a FIFO + * (First-In-First-Out) queue. + * 14. `isRandomQueue`: Boolean indicating if the waiting room uses a Random queue + * where users gain access randomly. + * 15. `isPassthroughQueue`: Boolean indicating if the waiting room uses a + * passthrough queue. Keep in mind that when passthrough is enabled, this JSON + * response will only exist when `queueAll` is **true** or `isEventPrequeueing` + * is **true** because in all other cases requests will go directly to the + * origin. + * 16. `isRejectQueue`: Boolean indicating if the waiting room uses a reject queue. + * 17. `isEventActive`: Boolean indicating if an event is currently occurring. + * Events are able to change a waiting room's behavior during a specified + * period of time. For additional information, look at the event properties + * `prequeue_start_time`, `event_start_time`, and `event_end_time` in the + * documentation for creating waiting room events. Events are considered active + * between these start and end times, as well as during the prequeueing period + * if it exists. + * 18. `isEventPrequeueing`: Valid only when `isEventActive` is **true**. Boolean + * indicating if an event is currently prequeueing users before it starts. + * 19. `timeUntilEventStart`: Valid only when `isEventPrequeueing` is **true**. + * Integer indicating the number of minutes until the event starts. + * 20. `timeUntilEventStartFormatted`: String displaying the `timeUntilEventStart` + * formatted in English for users. If `isEventPrequeueing` is **false**, + * `timeUntilEventStartFormatted` will display **unavailable**. + * 21. `timeUntilEventEnd`: Valid only when `isEventActive` is **true**. Integer + * indicating the number of minutes until the event ends. + * 22. `timeUntilEventEndFormatted`: String displaying the `timeUntilEventEnd` + * formatted in English for users. If `isEventActive` is **false**, + * `timeUntilEventEndFormatted` will display **unavailable**. + * 23. `shuffleAtEventStart`: Valid only when `isEventActive` is **true**. Boolean + * indicating if the users in the prequeue are shuffled randomly when the event + * starts. + * + * An example cURL to a waiting room could be: + * + * curl -X GET "https://example.com/waitingroom" \ + * -H "Accept: application/json" + * + * If `json_response_enabled` is **true** and the request hits the waiting room, an + * example JSON response when `queueingMethod` is **fifo** and no event is active + * could be: + * + * { + * "cfWaitingRoom": { + * "inWaitingRoom": true, + * "waitTimeKnown": true, + * "waitTime": 10, + * "waitTime25Percentile": 0, + * "waitTime50Percentile": 0, + * "waitTime75Percentile": 0, + * "waitTimeFormatted": "10 minutes", + * "queueIsFull": false, + * "queueAll": false, + * "lastUpdated": "2020-08-03T23:46:00.000Z", + * "refreshIntervalSeconds": 20, + * "queueingMethod": "fifo", + * "isFIFOQueue": true, + * "isRandomQueue": false, + * "isPassthroughQueue": false, + * "isRejectQueue": false, + * "isEventActive": false, + * "isEventPrequeueing": false, + * "timeUntilEventStart": 0, + * "timeUntilEventStartFormatted": "unavailable", + * "timeUntilEventEnd": 0, + * "timeUntilEventEndFormatted": "unavailable", + * "shuffleAtEventStart": false + * } + * } + * + * If `json_response_enabled` is **true** and the request hits the waiting room, an + * example JSON response when `queueingMethod` is **random** and an event is active + * could be: + * + * { + * "cfWaitingRoom": { + * "inWaitingRoom": true, + * "waitTimeKnown": true, + * "waitTime": 10, + * "waitTime25Percentile": 5, + * "waitTime50Percentile": 10, + * "waitTime75Percentile": 15, + * "waitTimeFormatted": "5 minutes to 15 minutes", + * "queueIsFull": false, + * "queueAll": false, + * "lastUpdated": "2020-08-03T23:46:00.000Z", + * "refreshIntervalSeconds": 20, + * "queueingMethod": "random", + * "isFIFOQueue": false, + * "isRandomQueue": true, + * "isPassthroughQueue": false, + * "isRejectQueue": false, + * "isEventActive": true, + * "isEventPrequeueing": false, + * "timeUntilEventStart": 0, + * "timeUntilEventStartFormatted": "unavailable", + * "timeUntilEventEnd": 15, + * "timeUntilEventEndFormatted": "15 minutes", + * "shuffleAtEventStart": true + * } + * }. + */ + json_response_enabled?: boolean; - /** - * HTTP status code returned to a user while in the queue. - */ - queueing_status_code?: 200 | 202 | 429; + modified_on?: string; - /** - * Lifetime of a cookie (in minutes) set by Cloudflare for users who get access to - * the route. If a user is not seen by Cloudflare again in that time period, they - * will be treated as a new user that visits the route. - */ - session_duration?: number; + /** + * A unique name to identify the waiting room. Only alphanumeric characters, + * hyphens and underscores are allowed. + */ + name?: string; - /** - * Suspends or allows traffic going to the waiting room. If set to `true`, the - * traffic will not go to the waiting room. - */ - suspended?: boolean; + /** + * Sets the number of new users that will be let into the route every minute. This + * value is used as baseline for the number of users that are let in per minute. So + * it is possible that there is a little more or little less traffic coming to the + * route based on the traffic patterns at that time around the world. + */ + new_users_per_minute?: number; - /** - * Sets the total number of active user sessions on the route at a point in time. A - * route is a combination of host and path on which a waiting room is available. - * This value is used as a baseline for the total number of active user sessions on - * the route. It is possible to have a situation where there are more or less - * active users sessions on the route based on the traffic patterns at that time - * around the world. - */ - total_active_users?: number; -} + /** + * An ISO 8601 timestamp that marks when the next event will begin queueing. + */ + next_event_prequeue_start_time?: string | null; -export namespace WaitingRoomGetResponse { - export interface AdditionalRoute { /** - * 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://). + * An ISO 8601 timestamp that marks when the next event will start. */ - host?: string; + next_event_start_time?: string | null; /** * Sets the path within the host to enable the waiting room on. The waiting room @@ -1285,39 +1196,121 @@ export namespace WaitingRoomGetResponse { * Wildcards and query parameters are not supported. */ path?: string; - } - /** - * Configures cookie attributes for the waiting room cookie. This encrypted cookie - * stores a user's status in the waiting room, such as queue position. - */ - export interface CookieAttributes { /** - * Configures the SameSite attribute on the waiting room cookie. Value `auto` will - * be translated to `lax` or `none` depending if **Always Use HTTPS** is enabled. - * Note that when using value `none`, the secure attribute cannot be set to - * `never`. + * If queue_all is `true`, all the traffic that is coming to a route will be sent + * to the waiting room. No new traffic can get to the route once this field is set + * and estimated time will become unavailable. */ - samesite?: 'auto' | 'lax' | 'none' | 'strict'; + queue_all?: boolean; /** - * Configures the Secure attribute on the waiting room cookie. Value `always` - * indicates that the Secure attribute will be set in the Set-Cookie header, - * `never` indicates that the Secure attribute will not be set, and `auto` will set - * the Secure attribute depending if **Always Use HTTPS** is enabled. + * Sets the queueing method used by the waiting room. Changing this parameter from + * the **default** queueing method is only available for the Waiting Room Advanced + * subscription. Regardless of the queueing method, if `queue_all` is enabled or an + * event is prequeueing, users in the waiting room will not be accepted to the + * origin. These users will always see a waiting room page that refreshes + * automatically. The valid queueing methods are: + * + * 1. `fifo` **(default)**: First-In-First-Out queue where customers gain access in + * the order they arrived. + * 2. `random`: Random queue where customers gain access randomly, regardless of + * arrival time. + * 3. `passthrough`: Users will pass directly through the waiting room and into the + * origin website. As a result, any configured limits will not be respected + * while this is enabled. This method can be used as an alternative to disabling + * a waiting room (with `suspended`) so that analytics are still reported. This + * can be used if you wish to allow all traffic normally, but want to restrict + * traffic during a waiting room event, or vice versa. + * 4. `reject`: Users will be immediately rejected from the waiting room. As a + * result, no users will reach the origin website while this is enabled. This + * can be used if you wish to reject all traffic while performing maintenance, + * block traffic during a specified period of time (an event), or block traffic + * while events are not occurring. Consider a waiting room used for vaccine + * distribution that only allows traffic during sign-up events, and otherwise + * blocks all traffic. For this case, the waiting room uses `reject`, and its + * events override this with `fifo`, `random`, or `passthrough`. When this + * queueing method is enabled and neither `queueAll` is enabled nor an event is + * prequeueing, the waiting room page **will not refresh automatically**. */ - secure?: 'auto' | 'always' | 'never'; + queueing_method?: 'fifo' | 'random' | 'passthrough' | 'reject'; + + /** + * HTTP status code returned to a user while in the queue. + */ + queueing_status_code?: 200 | 202 | 429; + + /** + * Lifetime of a cookie (in minutes) set by Cloudflare for users who get access to + * the route. If a user is not seen by Cloudflare again in that time period, they + * will be treated as a new user that visits the route. + */ + session_duration?: number; + + /** + * Suspends or allows traffic going to the waiting room. If set to `true`, the + * traffic will not go to the waiting room. + */ + suspended?: boolean; + + /** + * Sets the total number of active user sessions on the route at a point in time. A + * route is a combination of host and path on which a waiting room is available. + * This value is used as a baseline for the total number of active user sessions on + * the route. It is possible to have a situation where there are more or less + * active users sessions on the route based on the traffic patterns at that time + * around the world. + */ + total_active_users?: number; + } + + export namespace WaitingRoomListResponseItem { + export interface AdditionalRoute { + /** + * 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://). + */ + host?: string; + + /** + * 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. + */ + path?: string; + } + + /** + * Configures cookie attributes for the waiting room cookie. This encrypted cookie + * stores a user's status in the waiting room, such as queue position. + */ + export interface CookieAttributes { + /** + * Configures the SameSite attribute on the waiting room cookie. Value `auto` will + * be translated to `lax` or `none` depending if **Always Use HTTPS** is enabled. + * Note that when using value `none`, the secure attribute cannot be set to + * `never`. + */ + samesite?: 'auto' | 'lax' | 'none' | 'strict'; + + /** + * Configures the Secure attribute on the waiting room cookie. Value `always` + * indicates that the Secure attribute will be set in the Set-Cookie header, + * `never` indicates that the Secure attribute will not be set, and `auto` will set + * the Secure attribute depending if **Always Use HTTPS** is enabled. + */ + secure?: 'auto' | 'always' | 'never'; + } } } -export interface WaitingRoomPreviewResponse { - /** - * URL where the custom waiting room page can temporarily be previewed. - */ - preview_url?: string; +export interface WaitingRoomDeleteResponse { + id?: unknown; } -export interface WaitingRoomReplaceResponse { +export interface WaitingRoomGetResponse { id?: unknown; /** @@ -1326,13 +1319,13 @@ export interface WaitingRoomReplaceResponse { * implied wildcard at the end of the path. The hostname and path combination must * be unique to this and all other waiting rooms. */ - additional_routes?: Array; + additional_routes?: Array; /** * Configures cookie attributes for the waiting room cookie. This encrypted cookie * stores a user's status in the waiting room, such as queue position. */ - cookie_attributes?: WaitingRoomReplaceResponse.CookieAttributes; + cookie_attributes?: WaitingRoomGetResponse.CookieAttributes; /** * Appends a '\_' + a custom suffix to the end of Cloudflare Waiting Room's cookie @@ -1662,7 +1655,7 @@ export interface WaitingRoomReplaceResponse { total_active_users?: number; } -export namespace WaitingRoomReplaceResponse { +export namespace WaitingRoomGetResponse { export interface AdditionalRoute { /** * The hostname to which this waiting room will be applied (no wildcards). The @@ -1703,6 +1696,13 @@ export namespace WaitingRoomReplaceResponse { } } +export interface WaitingRoomPreviewResponse { + /** + * URL where the custom waiting room page can temporarily be previewed. + */ + preview_url?: string; +} + export interface WaitingRoomCreateParams { /** * The host name to which the waiting room will be applied (no wildcards). Please @@ -2073,34 +2073,7 @@ export namespace WaitingRoomCreateParams { } } -export interface WaitingRoomPreviewParams { - /** - * Only available for the Waiting Room Advanced subscription. This is a template - * html file that will be rendered at the edge. If no custom_page_html is provided, - * the default waiting room will be used. The template is based on mustache ( - * https://mustache.github.io/ ). There are several variables that are evaluated by - * the Cloudflare edge: - * - * 1. {{`waitTimeKnown`}} Acts like a boolean value that indicates the behavior to - * take when wait time is not available, for instance when queue_all is - * **true**. - * 2. {{`waitTimeFormatted`}} Estimated wait time for the user. For example, five - * minutes. Alternatively, you can use: - * 3. {{`waitTime`}} Number of minutes of estimated wait for a user. - * 4. {{`waitTimeHours`}} Number of hours of estimated wait for a user - * (`Math.floor(waitTime/60)`). - * 5. {{`waitTimeHourMinutes`}} Number of minutes above the `waitTimeHours` value - * (`waitTime%60`). - * 6. {{`queueIsFull`}} Changes to **true** when no more people can be added to the - * queue. - * - * To view the full list of variables, look at the `cfWaitingRoom` object described - * under the `json_response_enabled` property in other Waiting Room API calls. - */ - custom_html: string; -} - -export interface WaitingRoomReplaceParams { +export interface WaitingRoomUpdateParams { /** * The host name to which the waiting room will be applied (no wildcards). Please * do not include the scheme (http:// or https://). The host and path combination @@ -2138,13 +2111,13 @@ export interface WaitingRoomReplaceParams { * implied wildcard at the end of the path. The hostname and path combination must * be unique to this and all other waiting rooms. */ - additional_routes?: Array; + additional_routes?: Array; /** * Configures cookie attributes for the waiting room cookie. This encrypted cookie * stores a user's status in the waiting room, such as queue position. */ - cookie_attributes?: WaitingRoomReplaceParams.CookieAttributes; + cookie_attributes?: WaitingRoomUpdateParams.CookieAttributes; /** * Appends a '\_' + a custom suffix to the end of Cloudflare Waiting Room's cookie @@ -2429,7 +2402,7 @@ export interface WaitingRoomReplaceParams { suspended?: boolean; } -export namespace WaitingRoomReplaceParams { +export namespace WaitingRoomUpdateParams { export interface AdditionalRoute { /** * The hostname to which this waiting room will be applied (no wildcards). The @@ -2470,38 +2443,65 @@ export namespace WaitingRoomReplaceParams { } } +export interface WaitingRoomPreviewParams { + /** + * Only available for the Waiting Room Advanced subscription. This is a template + * html file that will be rendered at the edge. If no custom_page_html is provided, + * the default waiting room will be used. The template is based on mustache ( + * https://mustache.github.io/ ). There are several variables that are evaluated by + * the Cloudflare edge: + * + * 1. {{`waitTimeKnown`}} Acts like a boolean value that indicates the behavior to + * take when wait time is not available, for instance when queue_all is + * **true**. + * 2. {{`waitTimeFormatted`}} Estimated wait time for the user. For example, five + * minutes. Alternatively, you can use: + * 3. {{`waitTime`}} Number of minutes of estimated wait for a user. + * 4. {{`waitTimeHours`}} Number of hours of estimated wait for a user + * (`Math.floor(waitTime/60)`). + * 5. {{`waitTimeHourMinutes`}} Number of minutes above the `waitTimeHours` value + * (`waitTime%60`). + * 6. {{`queueIsFull`}} Changes to **true** when no more people can be added to the + * queue. + * + * To view the full list of variables, look at the `cfWaitingRoom` object described + * under the `json_response_enabled` property in other Waiting Room API calls. + */ + custom_html: string; +} + export namespace WaitingRooms { export import WaitingRoomCreateResponse = WaitingRoomsAPI.WaitingRoomCreateResponse; + export import WaitingRoomUpdateResponse = WaitingRoomsAPI.WaitingRoomUpdateResponse; export import WaitingRoomListResponse = WaitingRoomsAPI.WaitingRoomListResponse; export import WaitingRoomDeleteResponse = WaitingRoomsAPI.WaitingRoomDeleteResponse; export import WaitingRoomGetResponse = WaitingRoomsAPI.WaitingRoomGetResponse; export import WaitingRoomPreviewResponse = WaitingRoomsAPI.WaitingRoomPreviewResponse; - export import WaitingRoomReplaceResponse = WaitingRoomsAPI.WaitingRoomReplaceResponse; export import WaitingRoomCreateParams = WaitingRoomsAPI.WaitingRoomCreateParams; + export import WaitingRoomUpdateParams = WaitingRoomsAPI.WaitingRoomUpdateParams; export import WaitingRoomPreviewParams = WaitingRoomsAPI.WaitingRoomPreviewParams; - export import WaitingRoomReplaceParams = WaitingRoomsAPI.WaitingRoomReplaceParams; export import Events = EventsAPI.Events; export import EventCreateResponse = EventsAPI.EventCreateResponse; + export import EventUpdateResponse = EventsAPI.EventUpdateResponse; export import EventListResponse = EventsAPI.EventListResponse; export import EventDeleteResponse = EventsAPI.EventDeleteResponse; export import EventGetResponse = EventsAPI.EventGetResponse; - export import EventReplaceResponse = EventsAPI.EventReplaceResponse; export import EventCreateParams = EventsAPI.EventCreateParams; - export import EventReplaceParams = EventsAPI.EventReplaceParams; + export import EventUpdateParams = EventsAPI.EventUpdateParams; export import Rules = RulesAPI.Rules; export import RuleCreateResponse = RulesAPI.RuleCreateResponse; export import RuleUpdateResponse = RulesAPI.RuleUpdateResponse; export import RuleListResponse = RulesAPI.RuleListResponse; export import RuleDeleteResponse = RulesAPI.RuleDeleteResponse; - export import RuleReplaceResponse = RulesAPI.RuleReplaceResponse; + export import RuleEditResponse = RulesAPI.RuleEditResponse; export import RuleCreateParams = RulesAPI.RuleCreateParams; export import RuleUpdateParams = RulesAPI.RuleUpdateParams; - export import RuleReplaceParams = RulesAPI.RuleReplaceParams; + export import RuleEditParams = RulesAPI.RuleEditParams; export import Statuses = StatusesAPI.Statuses; export import StatusGetResponse = StatusesAPI.StatusGetResponse; export import Settings = SettingsAPI.Settings; export import WaitingroomZoneSettingsResponse = SettingsAPI.WaitingroomZoneSettingsResponse; - export import SettingUpdateResponse = SettingsAPI.SettingUpdateResponse; + export import SettingEditResponse = SettingsAPI.SettingEditResponse; export import SettingGetResponse = SettingsAPI.SettingGetResponse; - export import SettingUpdateParams = SettingsAPI.SettingUpdateParams; + export import SettingEditParams = SettingsAPI.SettingEditParams; } diff --git a/src/resources/warp-connector.ts b/src/resources/warp-connector.ts index dd87b1aaef..d0d25ddf3e 100644 --- a/src/resources/warp-connector.ts +++ b/src/resources/warp-connector.ts @@ -22,23 +22,6 @@ export class WarpConnector extends APIResource { )._thenUnwrap((obj) => obj.result); } - /** - * Updates an existing Warp Connector Tunnel. - */ - update( - accountId: string, - tunnelId: string, - body: WarpConnectorUpdateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.patch(`/accounts/${accountId}/warp_connector/${tunnelId}`, { - body, - ...options, - }) as Core.APIPromise<{ result: WarpConnectorUpdateResponse }> - )._thenUnwrap((obj) => obj.result); - } - /** * Lists and filters Warp Connector Tunnels in an account. */ @@ -83,6 +66,23 @@ export class WarpConnector extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Updates an existing Warp Connector Tunnel. + */ + edit( + accountId: string, + tunnelId: string, + body: WarpConnectorEditParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.patch(`/accounts/${accountId}/warp_connector/${tunnelId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: WarpConnectorEditResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * Fetches a single Warp Connector Tunnel. */ @@ -345,11 +345,11 @@ export namespace WarpConnectorCreateResponse { /** * A Cloudflare Tunnel that connects your origin to Cloudflare's edge. */ -export type WarpConnectorUpdateResponse = - | WarpConnectorUpdateResponse.TunnelCfdTunnel - | WarpConnectorUpdateResponse.TunnelWarpConnectorTunnel; +export type WarpConnectorListResponse = + | WarpConnectorListResponse.TunnelCfdTunnel + | WarpConnectorListResponse.TunnelWarpConnectorTunnel; -export namespace WarpConnectorUpdateResponse { +export namespace WarpConnectorListResponse { /** * A Cloudflare Tunnel that connects your origin to Cloudflare's edge. */ @@ -586,11 +586,11 @@ export namespace WarpConnectorUpdateResponse { /** * A Cloudflare Tunnel that connects your origin to Cloudflare's edge. */ -export type WarpConnectorListResponse = - | WarpConnectorListResponse.TunnelCfdTunnel - | WarpConnectorListResponse.TunnelWarpConnectorTunnel; +export type WarpConnectorDeleteResponse = + | WarpConnectorDeleteResponse.TunnelCfdTunnel + | WarpConnectorDeleteResponse.TunnelWarpConnectorTunnel; -export namespace WarpConnectorListResponse { +export namespace WarpConnectorDeleteResponse { /** * A Cloudflare Tunnel that connects your origin to Cloudflare's edge. */ @@ -827,11 +827,11 @@ export namespace WarpConnectorListResponse { /** * A Cloudflare Tunnel that connects your origin to Cloudflare's edge. */ -export type WarpConnectorDeleteResponse = - | WarpConnectorDeleteResponse.TunnelCfdTunnel - | WarpConnectorDeleteResponse.TunnelWarpConnectorTunnel; +export type WarpConnectorEditResponse = + | WarpConnectorEditResponse.TunnelCfdTunnel + | WarpConnectorEditResponse.TunnelWarpConnectorTunnel; -export namespace WarpConnectorDeleteResponse { +export namespace WarpConnectorEditResponse { /** * A Cloudflare Tunnel that connects your origin to Cloudflare's edge. */ @@ -1313,19 +1313,6 @@ export interface WarpConnectorCreateParams { name: string; } -export interface WarpConnectorUpdateParams { - /** - * A user-friendly name for the tunnel. - */ - name?: string; - - /** - * Sets the password required to run a locally-managed tunnel. Must be at least 32 - * bytes and encoded as a base64 string. - */ - tunnel_secret?: string; -} - export interface WarpConnectorListParams extends V4PagePaginationArrayParams { exclude_prefix?: string; @@ -1355,15 +1342,28 @@ export interface WarpConnectorListParams extends V4PagePaginationArrayParams { export type WarpConnectorDeleteParams = unknown; +export interface WarpConnectorEditParams { + /** + * A user-friendly name for the tunnel. + */ + name?: string; + + /** + * Sets the password required to run a locally-managed tunnel. Must be at least 32 + * bytes and encoded as a base64 string. + */ + tunnel_secret?: string; +} + export namespace WarpConnector { export import WarpConnectorCreateResponse = WarpConnectorAPI.WarpConnectorCreateResponse; - export import WarpConnectorUpdateResponse = WarpConnectorAPI.WarpConnectorUpdateResponse; export import WarpConnectorListResponse = WarpConnectorAPI.WarpConnectorListResponse; export import WarpConnectorDeleteResponse = WarpConnectorAPI.WarpConnectorDeleteResponse; + export import WarpConnectorEditResponse = WarpConnectorAPI.WarpConnectorEditResponse; export import WarpConnectorGetResponse = WarpConnectorAPI.WarpConnectorGetResponse; export import WarpConnectorListResponsesV4PagePaginationArray = WarpConnectorAPI.WarpConnectorListResponsesV4PagePaginationArray; export import WarpConnectorCreateParams = WarpConnectorAPI.WarpConnectorCreateParams; - export import WarpConnectorUpdateParams = WarpConnectorAPI.WarpConnectorUpdateParams; export import WarpConnectorListParams = WarpConnectorAPI.WarpConnectorListParams; export import WarpConnectorDeleteParams = WarpConnectorAPI.WarpConnectorDeleteParams; + export import WarpConnectorEditParams = WarpConnectorAPI.WarpConnectorEditParams; } diff --git a/src/resources/web3/hostnames/hostnames.ts b/src/resources/web3/hostnames/hostnames.ts index ce0365bbe7..b361a19259 100644 --- a/src/resources/web3/hostnames/hostnames.ts +++ b/src/resources/web3/hostnames/hostnames.ts @@ -25,23 +25,6 @@ export class Hostnames extends APIResource { )._thenUnwrap((obj) => obj.result); } - /** - * Edit Web3 Hostname - */ - update( - zoneIdentifier: string, - identifier: string, - body: HostnameUpdateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.patch(`/zones/${zoneIdentifier}/web3/hostnames/${identifier}`, { - body, - ...options, - }) as Core.APIPromise<{ result: HostnameUpdateResponse }> - )._thenUnwrap((obj) => obj.result); - } - /** * List Web3 Hostnames */ @@ -69,6 +52,23 @@ export class Hostnames extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Edit Web3 Hostname + */ + edit( + zoneIdentifier: string, + identifier: string, + body: HostnameEditParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.patch(`/zones/${zoneIdentifier}/web3/hostnames/${identifier}`, { + body, + ...options, + }) as Core.APIPromise<{ result: HostnameEditResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * Web3 Hostname Details */ @@ -121,42 +121,6 @@ export interface HostnameCreateResponse { target?: 'ethereum' | 'ipfs' | 'ipfs_universal_path'; } -export interface HostnameUpdateResponse { - /** - * Identifier - */ - id?: string; - - created_on?: string; - - /** - * An optional description of the hostname. - */ - description?: string; - - /** - * DNSLink value used if the target is ipfs. - */ - dnslink?: string; - - modified_on?: string; - - /** - * The hostname that will point to the target gateway via CNAME. - */ - name?: string; - - /** - * Status of the hostname's activation. - */ - status?: 'active' | 'pending' | 'deleting' | 'error'; - - /** - * Target gateway of the hostname. - */ - target?: 'ethereum' | 'ipfs' | 'ipfs_universal_path'; -} - export type HostnameListResponse = Array; export namespace HostnameListResponse { @@ -204,6 +168,42 @@ export interface HostnameDeleteResponse { id: string; } +export interface HostnameEditResponse { + /** + * Identifier + */ + id?: string; + + created_on?: string; + + /** + * An optional description of the hostname. + */ + description?: string; + + /** + * DNSLink value used if the target is ipfs. + */ + dnslink?: string; + + modified_on?: string; + + /** + * The hostname that will point to the target gateway via CNAME. + */ + name?: string; + + /** + * Status of the hostname's activation. + */ + status?: 'active' | 'pending' | 'deleting' | 'error'; + + /** + * Target gateway of the hostname. + */ + target?: 'ethereum' | 'ipfs' | 'ipfs_universal_path'; +} + export interface HostnameGetResponse { /** * Identifier @@ -257,7 +257,7 @@ export interface HostnameCreateParams { dnslink?: string; } -export interface HostnameUpdateParams { +export interface HostnameEditParams { /** * An optional description of the hostname. */ @@ -271,11 +271,11 @@ export interface HostnameUpdateParams { export namespace Hostnames { export import HostnameCreateResponse = HostnamesAPI.HostnameCreateResponse; - export import HostnameUpdateResponse = HostnamesAPI.HostnameUpdateResponse; export import HostnameListResponse = HostnamesAPI.HostnameListResponse; export import HostnameDeleteResponse = HostnamesAPI.HostnameDeleteResponse; + export import HostnameEditResponse = HostnamesAPI.HostnameEditResponse; export import HostnameGetResponse = HostnamesAPI.HostnameGetResponse; export import HostnameCreateParams = HostnamesAPI.HostnameCreateParams; - export import HostnameUpdateParams = HostnamesAPI.HostnameUpdateParams; + export import HostnameEditParams = HostnamesAPI.HostnameEditParams; export import IpfsUniversalPaths = IpfsUniversalPathsAPI.IpfsUniversalPaths; } diff --git a/src/resources/web3/hostnames/index.ts b/src/resources/web3/hostnames/index.ts index f9677b9e8b..b6dbd2bbe5 100644 --- a/src/resources/web3/hostnames/index.ts +++ b/src/resources/web3/hostnames/index.ts @@ -2,12 +2,12 @@ export { HostnameCreateResponse, - HostnameUpdateResponse, HostnameListResponse, HostnameDeleteResponse, + HostnameEditResponse, HostnameGetResponse, HostnameCreateParams, - HostnameUpdateParams, + HostnameEditParams, Hostnames, } from './hostnames'; export { IpfsUniversalPaths } from './ipfs-universal-paths/index'; diff --git a/src/resources/web3/hostnames/ipfs-universal-paths/content-lists/content-lists.ts b/src/resources/web3/hostnames/ipfs-universal-paths/content-lists/content-lists.ts index 18bda0058a..6eed0df9d0 100644 --- a/src/resources/web3/hostnames/ipfs-universal-paths/content-lists/content-lists.ts +++ b/src/resources/web3/hostnames/ipfs-universal-paths/content-lists/content-lists.ts @@ -9,54 +9,54 @@ export class ContentLists extends APIResource { entries: EntriesAPI.Entries = new EntriesAPI.Entries(this._client); /** - * IPFS Universal Path Gateway Content List Details + * Update IPFS Universal Path Gateway Content List */ - list( + update( zoneIdentifier: string, identifier: string, + body: ContentListUpdateParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( - this._client.get( + this._client.put( `/zones/${zoneIdentifier}/web3/hostnames/${identifier}/ipfs_universal_path/content_list`, - options, - ) as Core.APIPromise<{ result: ContentListListResponse }> + { body, ...options }, + ) as Core.APIPromise<{ result: ContentListUpdateResponse }> )._thenUnwrap((obj) => obj.result); } /** - * Update IPFS Universal Path Gateway Content List + * IPFS Universal Path Gateway Content List Details */ - replace( + list( zoneIdentifier: string, identifier: string, - body: ContentListReplaceParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( - this._client.put( + this._client.get( `/zones/${zoneIdentifier}/web3/hostnames/${identifier}/ipfs_universal_path/content_list`, - { body, ...options }, - ) as Core.APIPromise<{ result: ContentListReplaceResponse }> + options, + ) as Core.APIPromise<{ result: ContentListListResponse }> )._thenUnwrap((obj) => obj.result); } } -export interface ContentListListResponse { +export interface ContentListUpdateResponse { /** * Behavior of the content list. */ action?: 'block'; } -export interface ContentListReplaceResponse { +export interface ContentListListResponse { /** * Behavior of the content list. */ action?: 'block'; } -export interface ContentListReplaceParams { +export interface ContentListUpdateParams { /** * Behavior of the content list. */ @@ -65,10 +65,10 @@ export interface ContentListReplaceParams { /** * Content list entries. */ - entries: Array; + entries: Array; } -export namespace ContentListReplaceParams { +export namespace ContentListUpdateParams { /** * Content list entry to be blocked. */ @@ -91,15 +91,15 @@ export namespace ContentListReplaceParams { } export namespace ContentLists { + export import ContentListUpdateResponse = ContentListsAPI.ContentListUpdateResponse; export import ContentListListResponse = ContentListsAPI.ContentListListResponse; - export import ContentListReplaceResponse = ContentListsAPI.ContentListReplaceResponse; - export import ContentListReplaceParams = ContentListsAPI.ContentListReplaceParams; + export import ContentListUpdateParams = ContentListsAPI.ContentListUpdateParams; export import Entries = EntriesAPI.Entries; export import EntryCreateResponse = EntriesAPI.EntryCreateResponse; + export import EntryUpdateResponse = EntriesAPI.EntryUpdateResponse; export import EntryListResponse = EntriesAPI.EntryListResponse; export import EntryDeleteResponse = EntriesAPI.EntryDeleteResponse; export import EntryGetResponse = EntriesAPI.EntryGetResponse; - export import EntryReplaceResponse = EntriesAPI.EntryReplaceResponse; export import EntryCreateParams = EntriesAPI.EntryCreateParams; - export import EntryReplaceParams = EntriesAPI.EntryReplaceParams; + export import EntryUpdateParams = EntriesAPI.EntryUpdateParams; } diff --git a/src/resources/web3/hostnames/ipfs-universal-paths/content-lists/entries.ts b/src/resources/web3/hostnames/ipfs-universal-paths/content-lists/entries.ts index de03c6896f..d76aef5334 100644 --- a/src/resources/web3/hostnames/ipfs-universal-paths/content-lists/entries.ts +++ b/src/resources/web3/hostnames/ipfs-universal-paths/content-lists/entries.ts @@ -22,6 +22,24 @@ export class Entries extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Edit IPFS Universal Path Gateway Content List Entry + */ + update( + zoneIdentifier: string, + identifier: string, + contentListEntryIdentifier: string, + body: EntryUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put( + `/zones/${zoneIdentifier}/web3/hostnames/${identifier}/ipfs_universal_path/content_list/entries/${contentListEntryIdentifier}`, + { body, ...options }, + ) as Core.APIPromise<{ result: EntryUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * List IPFS Universal Path Gateway Content List Entries */ @@ -71,30 +89,41 @@ export class Entries extends APIResource { ) as Core.APIPromise<{ result: EntryGetResponse }> )._thenUnwrap((obj) => obj.result); } +} +/** + * Content list entry to be blocked. + */ +export interface EntryCreateResponse { /** - * Edit IPFS Universal Path Gateway Content List Entry + * Identifier */ - replace( - zoneIdentifier: string, - identifier: string, - contentListEntryIdentifier: string, - body: EntryReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put( - `/zones/${zoneIdentifier}/web3/hostnames/${identifier}/ipfs_universal_path/content_list/entries/${contentListEntryIdentifier}`, - { body, ...options }, - ) as Core.APIPromise<{ result: EntryReplaceResponse }> - )._thenUnwrap((obj) => obj.result); - } + id?: string; + + /** + * CID or content path of content to block. + */ + content?: string; + + created_on?: string; + + /** + * An optional description of the content list entry. + */ + description?: string; + + modified_on?: string; + + /** + * Type of content list entry to block. + */ + type?: 'cid' | 'content_path'; } /** * Content list entry to be blocked. */ -export interface EntryCreateResponse { +export interface EntryUpdateResponse { /** * Identifier */ @@ -194,35 +223,6 @@ export interface EntryGetResponse { type?: 'cid' | 'content_path'; } -/** - * Content list entry to be blocked. - */ -export interface EntryReplaceResponse { - /** - * Identifier - */ - id?: string; - - /** - * CID or content path of content to block. - */ - content?: string; - - created_on?: string; - - /** - * An optional description of the content list entry. - */ - description?: string; - - modified_on?: string; - - /** - * Type of content list entry to block. - */ - type?: 'cid' | 'content_path'; -} - export interface EntryCreateParams { /** * CID or content path of content to block. @@ -240,7 +240,7 @@ export interface EntryCreateParams { description?: string; } -export interface EntryReplaceParams { +export interface EntryUpdateParams { /** * CID or content path of content to block. */ @@ -259,10 +259,10 @@ export interface EntryReplaceParams { export namespace Entries { export import EntryCreateResponse = EntriesAPI.EntryCreateResponse; + export import EntryUpdateResponse = EntriesAPI.EntryUpdateResponse; export import EntryListResponse = EntriesAPI.EntryListResponse; export import EntryDeleteResponse = EntriesAPI.EntryDeleteResponse; export import EntryGetResponse = EntriesAPI.EntryGetResponse; - export import EntryReplaceResponse = EntriesAPI.EntryReplaceResponse; export import EntryCreateParams = EntriesAPI.EntryCreateParams; - export import EntryReplaceParams = EntriesAPI.EntryReplaceParams; + export import EntryUpdateParams = EntriesAPI.EntryUpdateParams; } diff --git a/src/resources/web3/hostnames/ipfs-universal-paths/content-lists/index.ts b/src/resources/web3/hostnames/ipfs-universal-paths/content-lists/index.ts index 4cc1d4f2c3..faf9b4932f 100644 --- a/src/resources/web3/hostnames/ipfs-universal-paths/content-lists/index.ts +++ b/src/resources/web3/hostnames/ipfs-universal-paths/content-lists/index.ts @@ -1,18 +1,18 @@ // File generated from our OpenAPI spec by Stainless. export { + ContentListUpdateResponse, ContentListListResponse, - ContentListReplaceResponse, - ContentListReplaceParams, + ContentListUpdateParams, ContentLists, } from './content-lists'; export { EntryCreateResponse, + EntryUpdateResponse, EntryListResponse, EntryDeleteResponse, EntryGetResponse, - EntryReplaceResponse, EntryCreateParams, - EntryReplaceParams, + EntryUpdateParams, Entries, } from './entries'; diff --git a/src/resources/web3/hostnames/ipfs-universal-paths/index.ts b/src/resources/web3/hostnames/ipfs-universal-paths/index.ts index e491d155e6..b81f2d787c 100644 --- a/src/resources/web3/hostnames/ipfs-universal-paths/index.ts +++ b/src/resources/web3/hostnames/ipfs-universal-paths/index.ts @@ -1,9 +1,9 @@ // File generated from our OpenAPI spec by Stainless. export { + ContentListUpdateResponse, ContentListListResponse, - ContentListReplaceResponse, - ContentListReplaceParams, + ContentListUpdateParams, ContentLists, } from './content-lists/index'; export { IpfsUniversalPaths } from './ipfs-universal-paths'; diff --git a/src/resources/web3/hostnames/ipfs-universal-paths/ipfs-universal-paths.ts b/src/resources/web3/hostnames/ipfs-universal-paths/ipfs-universal-paths.ts index 4d09d825bf..f456bb59ab 100644 --- a/src/resources/web3/hostnames/ipfs-universal-paths/ipfs-universal-paths.ts +++ b/src/resources/web3/hostnames/ipfs-universal-paths/ipfs-universal-paths.ts @@ -9,7 +9,7 @@ export class IpfsUniversalPaths extends APIResource { export namespace IpfsUniversalPaths { export import ContentLists = ContentListsAPI.ContentLists; + export import ContentListUpdateResponse = ContentListsAPI.ContentListUpdateResponse; export import ContentListListResponse = ContentListsAPI.ContentListListResponse; - export import ContentListReplaceResponse = ContentListsAPI.ContentListReplaceResponse; - export import ContentListReplaceParams = ContentListsAPI.ContentListReplaceParams; + export import ContentListUpdateParams = ContentListsAPI.ContentListUpdateParams; } diff --git a/src/resources/web3/index.ts b/src/resources/web3/index.ts index 5703778657..ed837f6f52 100644 --- a/src/resources/web3/index.ts +++ b/src/resources/web3/index.ts @@ -2,12 +2,12 @@ export { HostnameCreateResponse, - HostnameUpdateResponse, HostnameListResponse, HostnameDeleteResponse, + HostnameEditResponse, HostnameGetResponse, HostnameCreateParams, - HostnameUpdateParams, + HostnameEditParams, Hostnames, } from './hostnames/index'; export { Web3 } from './web3'; diff --git a/src/resources/web3/web3.ts b/src/resources/web3/web3.ts index c79a060a16..cba9b71f81 100644 --- a/src/resources/web3/web3.ts +++ b/src/resources/web3/web3.ts @@ -10,10 +10,10 @@ export class Web3 extends APIResource { export namespace Web3 { export import Hostnames = HostnamesAPI.Hostnames; export import HostnameCreateResponse = HostnamesAPI.HostnameCreateResponse; - export import HostnameUpdateResponse = HostnamesAPI.HostnameUpdateResponse; export import HostnameListResponse = HostnamesAPI.HostnameListResponse; export import HostnameDeleteResponse = HostnamesAPI.HostnameDeleteResponse; + export import HostnameEditResponse = HostnamesAPI.HostnameEditResponse; export import HostnameGetResponse = HostnamesAPI.HostnameGetResponse; export import HostnameCreateParams = HostnamesAPI.HostnameCreateParams; - export import HostnameUpdateParams = HostnamesAPI.HostnameUpdateParams; + export import HostnameEditParams = HostnamesAPI.HostnameEditParams; } diff --git a/src/resources/worker-scripts/content.ts b/src/resources/worker-scripts/content.ts index 44cfe09c50..5102f8a40f 100644 --- a/src/resources/worker-scripts/content.ts +++ b/src/resources/worker-scripts/content.ts @@ -9,12 +9,12 @@ export class Content extends APIResource { /** * Put script content without touching config or metadata */ - replace( + update( accountId: string, scriptName: string, - params: ContentReplaceParams, + params: ContentUpdateParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { 'CF-WORKER-BODY-PART': cfWorkerBodyPart, 'CF-WORKER-MAIN-MODULE-PART': cfWorkerMainModulePart, @@ -32,12 +32,12 @@ export class Content extends APIResource { ...options?.headers, }, }), - ) as Core.APIPromise<{ result: ContentReplaceResponse }> + ) as Core.APIPromise<{ result: ContentUpdateResponse }> )._thenUnwrap((obj) => obj.result); } } -export interface ContentReplaceResponse { +export interface ContentUpdateResponse { /** * The id of the script in the Workers system. Usually the script name. */ @@ -76,7 +76,7 @@ export interface ContentReplaceResponse { /** * List of Workers that will consume logs from the attached Worker. */ - tail_consumers?: Array; + tail_consumers?: Array; /** * Specifies the usage model for the Worker (e.g. 'bundled' or 'unbound'). @@ -84,7 +84,7 @@ export interface ContentReplaceResponse { usage_model?: string; } -export namespace ContentReplaceResponse { +export namespace ContentUpdateResponse { /** * A reference to a script that will consume logs from the attached Worker. */ @@ -106,7 +106,7 @@ export namespace ContentReplaceResponse { } } -export interface ContentReplaceParams { +export interface ContentUpdateParams { /** * Body param: A module comprising a Worker script, often a javascript file. * Multiple modules may be provided as separate named parts, but at least one @@ -121,7 +121,7 @@ export interface ContentReplaceParams { * Body param: JSON encoded metadata about the uploaded parts and Worker * configuration. */ - metadata?: ContentReplaceParams.Metadata; + metadata?: ContentUpdateParams.Metadata; /** * Header param: The multipart name of a script upload part containing script @@ -136,7 +136,7 @@ export interface ContentReplaceParams { 'CF-WORKER-MAIN-MODULE-PART'?: string; } -export namespace ContentReplaceParams { +export namespace ContentUpdateParams { /** * JSON encoded metadata about the uploaded parts and Worker configuration. */ @@ -157,6 +157,6 @@ export namespace ContentReplaceParams { } export namespace Content { - export import ContentReplaceResponse = ContentAPI.ContentReplaceResponse; - export import ContentReplaceParams = ContentAPI.ContentReplaceParams; + export import ContentUpdateResponse = ContentAPI.ContentUpdateResponse; + export import ContentUpdateParams = ContentAPI.ContentUpdateParams; } diff --git a/src/resources/worker-scripts/index.ts b/src/resources/worker-scripts/index.ts index f6037723a6..8ebd0eabcf 100644 --- a/src/resources/worker-scripts/index.ts +++ b/src/resources/worker-scripts/index.ts @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -export { ContentReplaceResponse, ContentReplaceParams, Content } from './content'; +export { ContentUpdateResponse, ContentUpdateParams, Content } from './content'; export { ContentV2 } from './content-v2'; -export { SettingUpdateResponse, SettingGetResponse, SettingUpdateParams, Settings } from './settings'; +export { SettingEditResponse, SettingGetResponse, SettingEditParams, Settings } from './settings'; export { WorkerScripts } from './worker-scripts'; diff --git a/src/resources/worker-scripts/settings.ts b/src/resources/worker-scripts/settings.ts index 92a2c18743..cca744cef5 100644 --- a/src/resources/worker-scripts/settings.ts +++ b/src/resources/worker-scripts/settings.ts @@ -9,17 +9,17 @@ export class Settings extends APIResource { /** * Patch script metadata or config, such as bindings or usage model */ - update( + edit( accountId: string, scriptName: string, - body: SettingUpdateParams, + body: SettingEditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.patch( `/accounts/${accountId}/workers/scripts/${scriptName}/settings`, multipartFormRequestOptions({ body, ...options }), - ) as Core.APIPromise<{ result: SettingUpdateResponse }> + ) as Core.APIPromise<{ result: SettingEditResponse }> )._thenUnwrap((obj) => obj.result); } @@ -40,19 +40,19 @@ export class Settings extends APIResource { } } -export interface SettingUpdateResponse { +export interface SettingEditResponse { /** * List of bindings attached to this Worker */ bindings?: Array< - | SettingUpdateResponse.WorkersKvNamespaceBinding - | SettingUpdateResponse.WorkersServiceBinding - | SettingUpdateResponse.WorkersDoBinding - | SettingUpdateResponse.WorkersR2Binding - | SettingUpdateResponse.WorkersQueueBinding - | SettingUpdateResponse.WorkersD1Binding - | SettingUpdateResponse.WorkersDispatchNamespaceBinding - | SettingUpdateResponse.WorkersMtlsCertBinding + | SettingEditResponse.WorkersKvNamespaceBinding + | SettingEditResponse.WorkersServiceBinding + | SettingEditResponse.WorkersDoBinding + | SettingEditResponse.WorkersR2Binding + | SettingEditResponse.WorkersQueueBinding + | SettingEditResponse.WorkersD1Binding + | SettingEditResponse.WorkersDispatchNamespaceBinding + | SettingEditResponse.WorkersMtlsCertBinding >; /** @@ -73,11 +73,9 @@ export interface SettingUpdateResponse { /** * Migrations to apply for Durable Objects associated with this Worker. */ - migrations?: - | SettingUpdateResponse.WorkersSingleStepMigrations - | SettingUpdateResponse.WorkersSteppedMigrations; + migrations?: SettingEditResponse.WorkersSingleStepMigrations | SettingEditResponse.WorkersSteppedMigrations; - placement?: SettingUpdateResponse.Placement; + placement?: SettingEditResponse.Placement; /** * Tags to help you manage your Workers @@ -87,7 +85,7 @@ export interface SettingUpdateResponse { /** * List of Workers that will consume logs from the attached Worker. */ - tail_consumers?: Array; + tail_consumers?: Array; /** * Specifies the usage model for the Worker (e.g. 'bundled' or 'unbound'). @@ -95,7 +93,7 @@ export interface SettingUpdateResponse { usage_model?: string; } -export namespace SettingUpdateResponse { +export namespace SettingEditResponse { export interface WorkersKvNamespaceBinding { /** * A JavaScript variable name for the binding. @@ -836,11 +834,11 @@ export namespace SettingGetResponse { } } -export interface SettingUpdateParams { - settings?: SettingUpdateParams.Settings; +export interface SettingEditParams { + settings?: SettingEditParams.Settings; } -export namespace SettingUpdateParams { +export namespace SettingEditParams { export interface Settings { errors: Array; @@ -1217,7 +1215,7 @@ export namespace SettingUpdateParams { } export namespace Settings { - export import SettingUpdateResponse = SettingsAPI.SettingUpdateResponse; + export import SettingEditResponse = SettingsAPI.SettingEditResponse; export import SettingGetResponse = SettingsAPI.SettingGetResponse; - export import SettingUpdateParams = SettingsAPI.SettingUpdateParams; + export import SettingEditParams = SettingsAPI.SettingEditParams; } diff --git a/src/resources/worker-scripts/worker-scripts.ts b/src/resources/worker-scripts/worker-scripts.ts index 7a0d895364..00d5c89799 100644 --- a/src/resources/worker-scripts/worker-scripts.ts +++ b/src/resources/worker-scripts/worker-scripts.ts @@ -13,11 +13,11 @@ export class WorkerScripts extends APIResource { export namespace WorkerScripts { export import Content = ContentAPI.Content; - export import ContentReplaceResponse = ContentAPI.ContentReplaceResponse; - export import ContentReplaceParams = ContentAPI.ContentReplaceParams; + export import ContentUpdateResponse = ContentAPI.ContentUpdateResponse; + export import ContentUpdateParams = ContentAPI.ContentUpdateParams; export import ContentV2 = ContentV2API.ContentV2; export import Settings = SettingsAPI.Settings; - export import SettingUpdateResponse = SettingsAPI.SettingUpdateResponse; + export import SettingEditResponse = SettingsAPI.SettingEditResponse; export import SettingGetResponse = SettingsAPI.SettingGetResponse; - export import SettingUpdateParams = SettingsAPI.SettingUpdateParams; + export import SettingEditParams = SettingsAPI.SettingEditParams; } diff --git a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/content.ts b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/content.ts index 120e13215c..6037347940 100644 --- a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/content.ts +++ b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/content.ts @@ -7,32 +7,16 @@ import * as ContentAPI from 'cloudflare/resources/workers-for-platforms/dispatch import { type Uploadable, multipartFormRequestOptions } from 'cloudflare/core'; export class Content extends APIResource { - /** - * Fetch script content from a script uploaded to a Workers for Platforms - * namespace. - */ - get( - accountId: string, - dispatchNamespace: string, - scriptName: string, - options?: Core.RequestOptions, - ): Core.APIPromise { - return this._client.get( - `/accounts/${accountId}/workers/dispatch/namespaces/${dispatchNamespace}/scripts/${scriptName}/content`, - { ...options, __binaryResponse: true }, - ); - } - /** * Put script content for a script uploaded to a Workers for Platforms namespace. */ - replace( + update( accountId: string, dispatchNamespace: string, scriptName: string, - params: ContentReplaceParams, + params: ContentUpdateParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { 'CF-WORKER-BODY-PART': cfWorkerBodyPart, 'CF-WORKER-MAIN-MODULE-PART': cfWorkerMainModulePart, @@ -50,12 +34,28 @@ export class Content extends APIResource { ...options?.headers, }, }), - ) as Core.APIPromise<{ result: ContentReplaceResponse }> + ) as Core.APIPromise<{ result: ContentUpdateResponse }> )._thenUnwrap((obj) => obj.result); } + + /** + * Fetch script content from a script uploaded to a Workers for Platforms + * namespace. + */ + get( + accountId: string, + dispatchNamespace: string, + scriptName: string, + options?: Core.RequestOptions, + ): Core.APIPromise { + return this._client.get( + `/accounts/${accountId}/workers/dispatch/namespaces/${dispatchNamespace}/scripts/${scriptName}/content`, + { ...options, __binaryResponse: true }, + ); + } } -export interface ContentReplaceResponse { +export interface ContentUpdateResponse { /** * The id of the script in the Workers system. Usually the script name. */ @@ -94,7 +94,7 @@ export interface ContentReplaceResponse { /** * List of Workers that will consume logs from the attached Worker. */ - tail_consumers?: Array; + tail_consumers?: Array; /** * Specifies the usage model for the Worker (e.g. 'bundled' or 'unbound'). @@ -102,7 +102,7 @@ export interface ContentReplaceResponse { usage_model?: string; } -export namespace ContentReplaceResponse { +export namespace ContentUpdateResponse { /** * A reference to a script that will consume logs from the attached Worker. */ @@ -124,7 +124,7 @@ export namespace ContentReplaceResponse { } } -export interface ContentReplaceParams { +export interface ContentUpdateParams { /** * Body param: A module comprising a Worker script, often a javascript file. * Multiple modules may be provided as separate named parts, but at least one @@ -139,7 +139,7 @@ export interface ContentReplaceParams { * Body param: JSON encoded metadata about the uploaded parts and Worker * configuration. */ - metadata?: ContentReplaceParams.Metadata; + metadata?: ContentUpdateParams.Metadata; /** * Header param: The multipart name of a script upload part containing script @@ -154,7 +154,7 @@ export interface ContentReplaceParams { 'CF-WORKER-MAIN-MODULE-PART'?: string; } -export namespace ContentReplaceParams { +export namespace ContentUpdateParams { /** * JSON encoded metadata about the uploaded parts and Worker configuration. */ @@ -175,6 +175,6 @@ export namespace ContentReplaceParams { } export namespace Content { - export import ContentReplaceResponse = ContentAPI.ContentReplaceResponse; - export import ContentReplaceParams = ContentAPI.ContentReplaceParams; + export import ContentUpdateResponse = ContentAPI.ContentUpdateResponse; + export import ContentUpdateParams = ContentAPI.ContentUpdateParams; } diff --git a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/index.ts b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/index.ts index 749332551d..61d3f50cce 100644 --- a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/index.ts +++ b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/index.ts @@ -1,5 +1,5 @@ // File generated from our OpenAPI spec by Stainless. -export { ContentReplaceResponse, ContentReplaceParams, Content } from './content'; +export { ContentUpdateResponse, ContentUpdateParams, Content } from './content'; export { Scripts } from './scripts'; -export { SettingUpdateResponse, SettingGetResponse, SettingUpdateParams, Settings } from './settings'; +export { SettingEditResponse, SettingGetResponse, SettingEditParams, Settings } from './settings'; diff --git a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/scripts.ts b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/scripts.ts index 8d7f6d07ad..530fa8a0d6 100644 --- a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/scripts.ts +++ b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/scripts.ts @@ -11,10 +11,10 @@ export class Scripts extends APIResource { export namespace Scripts { export import Content = ContentAPI.Content; - export import ContentReplaceResponse = ContentAPI.ContentReplaceResponse; - export import ContentReplaceParams = ContentAPI.ContentReplaceParams; + export import ContentUpdateResponse = ContentAPI.ContentUpdateResponse; + export import ContentUpdateParams = ContentAPI.ContentUpdateParams; export import Settings = SettingsAPI.Settings; - export import SettingUpdateResponse = SettingsAPI.SettingUpdateResponse; + export import SettingEditResponse = SettingsAPI.SettingEditResponse; export import SettingGetResponse = SettingsAPI.SettingGetResponse; - export import SettingUpdateParams = SettingsAPI.SettingUpdateParams; + export import SettingEditParams = SettingsAPI.SettingEditParams; } diff --git a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/settings.ts b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/settings.ts index 421192a783..8bd65aeeee 100644 --- a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/settings.ts +++ b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/settings.ts @@ -8,18 +8,18 @@ export class Settings extends APIResource { /** * Patch script metadata, such as bindings */ - update( + edit( accountId: string, dispatchNamespace: string, scriptName: string, - body: SettingUpdateParams, + body: SettingEditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.patch( `/accounts/${accountId}/workers/dispatch/namespaces/${dispatchNamespace}/scripts/${scriptName}/settings`, { body, ...options }, - ) as Core.APIPromise<{ result: SettingUpdateResponse }> + ) as Core.APIPromise<{ result: SettingEditResponse }> )._thenUnwrap((obj) => obj.result); } @@ -41,19 +41,19 @@ export class Settings extends APIResource { } } -export interface SettingUpdateResponse { +export interface SettingEditResponse { /** * List of bindings attached to this Worker */ bindings?: Array< - | SettingUpdateResponse.WorkersKvNamespaceBinding - | SettingUpdateResponse.WorkersServiceBinding - | SettingUpdateResponse.WorkersDoBinding - | SettingUpdateResponse.WorkersR2Binding - | SettingUpdateResponse.WorkersQueueBinding - | SettingUpdateResponse.WorkersD1Binding - | SettingUpdateResponse.WorkersDispatchNamespaceBinding - | SettingUpdateResponse.WorkersMtlsCertBinding + | SettingEditResponse.WorkersKvNamespaceBinding + | SettingEditResponse.WorkersServiceBinding + | SettingEditResponse.WorkersDoBinding + | SettingEditResponse.WorkersR2Binding + | SettingEditResponse.WorkersQueueBinding + | SettingEditResponse.WorkersD1Binding + | SettingEditResponse.WorkersDispatchNamespaceBinding + | SettingEditResponse.WorkersMtlsCertBinding >; /** @@ -74,11 +74,9 @@ export interface SettingUpdateResponse { /** * Migrations to apply for Durable Objects associated with this Worker. */ - migrations?: - | SettingUpdateResponse.WorkersSingleStepMigrations - | SettingUpdateResponse.WorkersSteppedMigrations; + migrations?: SettingEditResponse.WorkersSingleStepMigrations | SettingEditResponse.WorkersSteppedMigrations; - placement?: SettingUpdateResponse.Placement; + placement?: SettingEditResponse.Placement; /** * Tags to help you manage your Workers @@ -88,7 +86,7 @@ export interface SettingUpdateResponse { /** * List of Workers that will consume logs from the attached Worker. */ - tail_consumers?: Array; + tail_consumers?: Array; /** * Specifies the usage model for the Worker (e.g. 'bundled' or 'unbound'). @@ -96,7 +94,7 @@ export interface SettingUpdateResponse { usage_model?: string; } -export namespace SettingUpdateResponse { +export namespace SettingEditResponse { export interface WorkersKvNamespaceBinding { /** * A JavaScript variable name for the binding. @@ -837,12 +835,12 @@ export namespace SettingGetResponse { } } -export interface SettingUpdateParams { - errors: Array; +export interface SettingEditParams { + errors: Array; - messages: Array; + messages: Array; - result: SettingUpdateParams.Result; + result: SettingEditParams.Result; /** * Whether the API call was successful @@ -850,7 +848,7 @@ export interface SettingUpdateParams { success: true; } -export namespace SettingUpdateParams { +export namespace SettingEditParams { export interface Error { code: number; @@ -1212,7 +1210,7 @@ export namespace SettingUpdateParams { } export namespace Settings { - export import SettingUpdateResponse = SettingsAPI.SettingUpdateResponse; + export import SettingEditResponse = SettingsAPI.SettingEditResponse; export import SettingGetResponse = SettingsAPI.SettingGetResponse; - export import SettingUpdateParams = SettingsAPI.SettingUpdateParams; + export import SettingEditParams = SettingsAPI.SettingEditParams; } diff --git a/src/resources/workers/account-settings.ts b/src/resources/workers/account-settings.ts index 050a4922a1..21794fb7cc 100644 --- a/src/resources/workers/account-settings.ts +++ b/src/resources/workers/account-settings.ts @@ -5,50 +5,50 @@ import { APIResource } from 'cloudflare/resource'; import * as AccountSettingsAPI from 'cloudflare/resources/workers/account-settings'; export class AccountSettings extends APIResource { - /** - * Fetches Worker account settings for an account. - */ - get(accountId: string, options?: Core.RequestOptions): Core.APIPromise { - return ( - this._client.get(`/accounts/${accountId}/workers/account-settings`, options) as Core.APIPromise<{ - result: AccountSettingGetResponse; - }> - )._thenUnwrap((obj) => obj.result); - } - /** * Creates Worker account settings for an account. */ - replace( + update( accountId: string, - body: AccountSettingReplaceParams, + body: AccountSettingUpdateParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.put(`/accounts/${accountId}/workers/account-settings`, { body, ...options, - }) as Core.APIPromise<{ result: AccountSettingReplaceResponse }> + }) as Core.APIPromise<{ result: AccountSettingUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Fetches Worker account settings for an account. + */ + get(accountId: string, options?: Core.RequestOptions): Core.APIPromise { + return ( + this._client.get(`/accounts/${accountId}/workers/account-settings`, options) as Core.APIPromise<{ + result: AccountSettingGetResponse; + }> )._thenUnwrap((obj) => obj.result); } } -export interface AccountSettingGetResponse { +export interface AccountSettingUpdateResponse { default_usage_model?: unknown; green_compute?: unknown; } -export interface AccountSettingReplaceResponse { +export interface AccountSettingGetResponse { default_usage_model?: unknown; green_compute?: unknown; } -export type AccountSettingReplaceParams = unknown; +export type AccountSettingUpdateParams = unknown; export namespace AccountSettings { + export import AccountSettingUpdateResponse = AccountSettingsAPI.AccountSettingUpdateResponse; export import AccountSettingGetResponse = AccountSettingsAPI.AccountSettingGetResponse; - export import AccountSettingReplaceResponse = AccountSettingsAPI.AccountSettingReplaceResponse; - export import AccountSettingReplaceParams = AccountSettingsAPI.AccountSettingReplaceParams; + export import AccountSettingUpdateParams = AccountSettingsAPI.AccountSettingUpdateParams; } diff --git a/src/resources/workers/domains.ts b/src/resources/workers/domains.ts index 1f4c3c4c47..293cccaddd 100644 --- a/src/resources/workers/domains.ts +++ b/src/resources/workers/domains.ts @@ -6,6 +6,21 @@ import { isRequestOptions } from 'cloudflare/core'; import * as DomainsAPI from 'cloudflare/resources/workers/domains'; export class Domains extends APIResource { + /** + * Attaches a Worker to a zone and hostname. + */ + update( + accountId: unknown, + body: DomainUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/accounts/${accountId}/workers/domains`, { body, ...options }) as Core.APIPromise<{ + result: DomainUpdateResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + /** * Lists all Worker Domains for an account. */ @@ -54,21 +69,38 @@ export class Domains extends APIResource { }> )._thenUnwrap((obj) => obj.result); } +} +export interface DomainUpdateResponse { /** - * Attaches a Worker to a zone and hostname. + * Identifer of the Worker Domain. */ - replace( - accountId: unknown, - body: DomainReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put(`/accounts/${accountId}/workers/domains`, { body, ...options }) as Core.APIPromise<{ - result: DomainReplaceResponse; - }> - )._thenUnwrap((obj) => obj.result); - } + id?: unknown; + + /** + * Worker environment associated with the zone and hostname. + */ + environment?: string; + + /** + * Hostname of the Worker Domain. + */ + hostname?: string; + + /** + * Worker service associated with the zone and hostname. + */ + service?: string; + + /** + * Identifier of the zone. + */ + zone_id?: unknown; + + /** + * Name of the zone. + */ + zone_name?: string; } export type DomainListResponse = Array; @@ -139,36 +171,26 @@ export interface DomainGetResponse { zone_name?: string; } -export interface DomainReplaceResponse { - /** - * Identifer of the Worker Domain. - */ - id?: unknown; - +export interface DomainUpdateParams { /** * Worker environment associated with the zone and hostname. */ - environment?: string; + environment: string; /** * Hostname of the Worker Domain. */ - hostname?: string; + hostname: string; /** * Worker service associated with the zone and hostname. */ - service?: string; + service: string; /** * Identifier of the zone. */ - zone_id?: unknown; - - /** - * Name of the zone. - */ - zone_name?: string; + zone_id: unknown; } export interface DomainListParams { @@ -198,32 +220,10 @@ export interface DomainListParams { zone_name?: string; } -export interface DomainReplaceParams { - /** - * Worker environment associated with the zone and hostname. - */ - environment: string; - - /** - * Hostname of the Worker Domain. - */ - hostname: string; - - /** - * Worker service associated with the zone and hostname. - */ - service: string; - - /** - * Identifier of the zone. - */ - zone_id: unknown; -} - export namespace Domains { + export import DomainUpdateResponse = DomainsAPI.DomainUpdateResponse; export import DomainListResponse = DomainsAPI.DomainListResponse; export import DomainGetResponse = DomainsAPI.DomainGetResponse; - export import DomainReplaceResponse = DomainsAPI.DomainReplaceResponse; + export import DomainUpdateParams = DomainsAPI.DomainUpdateParams; export import DomainListParams = DomainsAPI.DomainListParams; - export import DomainReplaceParams = DomainsAPI.DomainReplaceParams; } diff --git a/src/resources/workers/filters.ts b/src/resources/workers/filters.ts index 3ec6d50aa4..fd1a201764 100644 --- a/src/resources/workers/filters.ts +++ b/src/resources/workers/filters.ts @@ -20,6 +20,23 @@ export class Filters extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Update Filter + */ + update( + zoneId: string, + filterId: string, + body: FilterUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/zones/${zoneId}/workers/filters/${filterId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: FilterUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * List Filters */ @@ -45,30 +62,24 @@ export class Filters extends APIResource { }> )._thenUnwrap((obj) => obj.result); } +} +export interface FilterCreateResponse { /** - * Update Filter + * Identifier */ - replace( - zoneId: string, - filterId: string, - body: FilterReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put(`/zones/${zoneId}/workers/filters/${filterId}`, { - body, - ...options, - }) as Core.APIPromise<{ result: FilterReplaceResponse }> - )._thenUnwrap((obj) => obj.result); - } + id: string; } -export interface FilterCreateResponse { +export interface FilterUpdateResponse { /** * Identifier */ id: string; + + enabled: boolean; + + pattern: string; } export type FilterListResponse = Array; @@ -93,24 +104,13 @@ export interface FilterDeleteResponse { id: string; } -export interface FilterReplaceResponse { - /** - * Identifier - */ - id: string; - - enabled: boolean; - - pattern: string; -} - export interface FilterCreateParams { enabled: boolean; pattern: string; } -export interface FilterReplaceParams { +export interface FilterUpdateParams { enabled: boolean; pattern: string; @@ -118,9 +118,9 @@ export interface FilterReplaceParams { export namespace Filters { export import FilterCreateResponse = FiltersAPI.FilterCreateResponse; + export import FilterUpdateResponse = FiltersAPI.FilterUpdateResponse; export import FilterListResponse = FiltersAPI.FilterListResponse; export import FilterDeleteResponse = FiltersAPI.FilterDeleteResponse; - export import FilterReplaceResponse = FiltersAPI.FilterReplaceResponse; export import FilterCreateParams = FiltersAPI.FilterCreateParams; - export import FilterReplaceParams = FiltersAPI.FilterReplaceParams; + export import FilterUpdateParams = FiltersAPI.FilterUpdateParams; } diff --git a/src/resources/workers/index.ts b/src/resources/workers/index.ts index 076241f854..31902bc4de 100644 --- a/src/resources/workers/index.ts +++ b/src/resources/workers/index.ts @@ -1,9 +1,9 @@ // File generated from our OpenAPI spec by Stainless. export { + AccountSettingUpdateResponse, AccountSettingGetResponse, - AccountSettingReplaceResponse, - AccountSettingReplaceParams, + AccountSettingUpdateParams, AccountSettings, } from './account-settings'; export { Deployments } from './deployments/index'; @@ -13,56 +13,56 @@ export { DeploymentsByScript, } from './deployments-by-script'; export { + DomainUpdateResponse, DomainListResponse, DomainGetResponse, - DomainReplaceResponse, + DomainUpdateParams, DomainListParams, - DomainReplaceParams, Domains, } from './domains'; export { DurableObjects } from './durable-objects/index'; export { FilterCreateResponse, + FilterUpdateResponse, FilterListResponse, FilterDeleteResponse, - FilterReplaceResponse, FilterCreateParams, - FilterReplaceParams, + FilterUpdateParams, Filters, } from './filters'; export { QueueCreateResponse, + QueueUpdateResponse, QueueListResponse, QueueDeleteResponse, QueueGetResponse, - QueueReplaceResponse, QueueCreateParams, - QueueReplaceParams, + QueueUpdateParams, Queues, } from './queues/index'; export { RouteCreateResponse, + RouteUpdateResponse, RouteListResponse, RouteDeleteResponse, RouteGetResponse, - RouteReplaceResponse, RouteCreateParams, - RouteReplaceParams, + RouteUpdateParams, Routes, } from './routes'; export { Script } from './script'; export { + ScriptUpdateResponse, ScriptListResponse, - ScriptReplaceResponse, + ScriptUpdateParams, ScriptDeleteParams, - ScriptReplaceParams, Scripts, } from './scripts/index'; export { Services } from './services/index'; export { + SubdomainUpdateResponse, SubdomainGetResponse, - SubdomainReplaceResponse, - SubdomainReplaceParams, + SubdomainUpdateParams, Subdomains, } from './subdomains'; export { Workers } from './workers'; diff --git a/src/resources/workers/queues/consumers.ts b/src/resources/workers/queues/consumers.ts index e784333e54..cee3dd2b6d 100644 --- a/src/resources/workers/queues/consumers.ts +++ b/src/resources/workers/queues/consumers.ts @@ -22,6 +22,24 @@ export class Consumers extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Updates the consumer for a queue, or creates one if it does not exist. + */ + update( + accountId: string, + name: string, + consumerName: string, + body: ConsumerUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/accounts/${accountId}/workers/queues/${name}/consumers/${consumerName}`, { + body, + ...options, + }) as Core.APIPromise<{ result: ConsumerUpdateResponse | null }> + )._thenUnwrap((obj) => obj.result); + } + /** * Returns the consumers for a queue. */ @@ -54,24 +72,6 @@ export class Consumers extends APIResource { ) as Core.APIPromise<{ result: ConsumerDeleteResponse | null }> )._thenUnwrap((obj) => obj.result); } - - /** - * Updates the consumer for a queue, or creates one if it does not exist. - */ - replace( - accountId: string, - name: string, - consumerName: string, - body: ConsumerReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put(`/accounts/${accountId}/workers/queues/${name}/consumers/${consumerName}`, { - body, - ...options, - }) as Core.APIPromise<{ result: ConsumerReplaceResponse | null }> - )._thenUnwrap((obj) => obj.result); - } } export interface ConsumerCreateResponse { @@ -98,6 +98,30 @@ export namespace ConsumerCreateResponse { } } +export interface ConsumerUpdateResponse { + created_on?: unknown; + + dead_letter_queue?: unknown; + + environment?: unknown; + + queue_name?: unknown; + + script_name?: unknown; + + settings?: ConsumerUpdateResponse.Settings; +} + +export namespace ConsumerUpdateResponse { + export interface Settings { + batch_size?: number; + + max_retries?: number; + + max_wait_time_ms?: number; + } +} + export type ConsumerListResponse = Array; export namespace ConsumerListResponse { @@ -126,39 +150,15 @@ export namespace ConsumerListResponse { export type ConsumerDeleteResponse = unknown | Array | string; -export interface ConsumerReplaceResponse { - created_on?: unknown; - - dead_letter_queue?: unknown; - - environment?: unknown; - - queue_name?: unknown; - - script_name?: unknown; - - settings?: ConsumerReplaceResponse.Settings; -} - -export namespace ConsumerReplaceResponse { - export interface Settings { - batch_size?: number; - - max_retries?: number; - - max_wait_time_ms?: number; - } -} - export type ConsumerCreateParams = unknown; -export type ConsumerReplaceParams = unknown; +export type ConsumerUpdateParams = unknown; export namespace Consumers { export import ConsumerCreateResponse = ConsumersAPI.ConsumerCreateResponse; + export import ConsumerUpdateResponse = ConsumersAPI.ConsumerUpdateResponse; export import ConsumerListResponse = ConsumersAPI.ConsumerListResponse; export import ConsumerDeleteResponse = ConsumersAPI.ConsumerDeleteResponse; - export import ConsumerReplaceResponse = ConsumersAPI.ConsumerReplaceResponse; export import ConsumerCreateParams = ConsumersAPI.ConsumerCreateParams; - export import ConsumerReplaceParams = ConsumersAPI.ConsumerReplaceParams; + export import ConsumerUpdateParams = ConsumersAPI.ConsumerUpdateParams; } diff --git a/src/resources/workers/queues/index.ts b/src/resources/workers/queues/index.ts index b4ccdf635d..9dc2491b19 100644 --- a/src/resources/workers/queues/index.ts +++ b/src/resources/workers/queues/index.ts @@ -2,20 +2,20 @@ export { ConsumerCreateResponse, + ConsumerUpdateResponse, ConsumerListResponse, ConsumerDeleteResponse, - ConsumerReplaceResponse, ConsumerCreateParams, - ConsumerReplaceParams, + ConsumerUpdateParams, Consumers, } from './consumers'; export { QueueCreateResponse, + QueueUpdateResponse, QueueListResponse, QueueDeleteResponse, QueueGetResponse, - QueueReplaceResponse, QueueCreateParams, - QueueReplaceParams, + QueueUpdateParams, Queues, } from './queues'; diff --git a/src/resources/workers/queues/queues.ts b/src/resources/workers/queues/queues.ts index b150268331..47f7130d9c 100644 --- a/src/resources/workers/queues/queues.ts +++ b/src/resources/workers/queues/queues.ts @@ -23,6 +23,23 @@ export class Queues extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Updates a queue. + */ + update( + accountId: string, + name: string, + body: QueueUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/accounts/${accountId}/workers/queues/${name}`, { + body, + ...options, + }) as Core.APIPromise<{ result: QueueUpdateResponse | null }> + )._thenUnwrap((obj) => obj.result); + } + /** * Returns the queues owned by an account. */ @@ -63,23 +80,6 @@ export class Queues extends APIResource { }> )._thenUnwrap((obj) => obj.result); } - - /** - * Updates a queue. - */ - replace( - accountId: string, - name: string, - body: QueueReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put(`/accounts/${accountId}/workers/queues/${name}`, { - body, - ...options, - }) as Core.APIPromise<{ result: QueueReplaceResponse | null }> - )._thenUnwrap((obj) => obj.result); - } } export interface QueueCreateResponse { @@ -92,6 +92,16 @@ export interface QueueCreateResponse { queue_name?: string; } +export interface QueueUpdateResponse { + created_on?: unknown; + + modified_on?: unknown; + + queue_id?: unknown; + + queue_name?: string; +} + export type QueueListResponse = Array; export namespace QueueListResponse { @@ -134,33 +144,23 @@ export interface QueueGetResponse { queue_name?: string; } -export interface QueueReplaceResponse { - created_on?: unknown; - - modified_on?: unknown; - - queue_id?: unknown; - - queue_name?: string; -} - export type QueueCreateParams = unknown; -export type QueueReplaceParams = unknown; +export type QueueUpdateParams = unknown; export namespace Queues { export import QueueCreateResponse = QueuesAPI.QueueCreateResponse; + export import QueueUpdateResponse = QueuesAPI.QueueUpdateResponse; export import QueueListResponse = QueuesAPI.QueueListResponse; export import QueueDeleteResponse = QueuesAPI.QueueDeleteResponse; export import QueueGetResponse = QueuesAPI.QueueGetResponse; - export import QueueReplaceResponse = QueuesAPI.QueueReplaceResponse; export import QueueCreateParams = QueuesAPI.QueueCreateParams; - export import QueueReplaceParams = QueuesAPI.QueueReplaceParams; + export import QueueUpdateParams = QueuesAPI.QueueUpdateParams; export import Consumers = ConsumersAPI.Consumers; export import ConsumerCreateResponse = ConsumersAPI.ConsumerCreateResponse; + export import ConsumerUpdateResponse = ConsumersAPI.ConsumerUpdateResponse; export import ConsumerListResponse = ConsumersAPI.ConsumerListResponse; export import ConsumerDeleteResponse = ConsumersAPI.ConsumerDeleteResponse; - export import ConsumerReplaceResponse = ConsumersAPI.ConsumerReplaceResponse; export import ConsumerCreateParams = ConsumersAPI.ConsumerCreateParams; - export import ConsumerReplaceParams = ConsumersAPI.ConsumerReplaceParams; + export import ConsumerUpdateParams = ConsumersAPI.ConsumerUpdateParams; } diff --git a/src/resources/workers/routes.ts b/src/resources/workers/routes.ts index ab037acb21..b976d59cf4 100644 --- a/src/resources/workers/routes.ts +++ b/src/resources/workers/routes.ts @@ -20,6 +20,23 @@ export class Routes extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Updates the URL pattern or Worker associated with a route. + */ + update( + zoneId: string, + routeId: string, + body: RouteUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/zones/${zoneId}/workers/routes/${routeId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: RouteUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * Returns routes for a zone. */ @@ -56,26 +73,23 @@ export class Routes extends APIResource { }> )._thenUnwrap((obj) => obj.result); } +} + +export type RouteCreateResponse = unknown | string; +export interface RouteUpdateResponse { /** - * Updates the URL pattern or Worker associated with a route. + * Identifier */ - replace( - zoneId: string, - routeId: string, - body: RouteReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put(`/zones/${zoneId}/workers/routes/${routeId}`, { - body, - ...options, - }) as Core.APIPromise<{ result: RouteReplaceResponse }> - )._thenUnwrap((obj) => obj.result); - } -} + id: string; -export type RouteCreateResponse = unknown | string; + pattern: string; + + /** + * Name of the script, used in URLs and route configuration. + */ + script: string; +} export type RouteListResponse = Array; @@ -111,20 +125,6 @@ export interface RouteGetResponse { script: string; } -export interface RouteReplaceResponse { - /** - * Identifier - */ - id: string; - - pattern: string; - - /** - * Name of the script, used in URLs and route configuration. - */ - script: string; -} - export interface RouteCreateParams { pattern: string; @@ -134,7 +134,7 @@ export interface RouteCreateParams { script?: string; } -export interface RouteReplaceParams { +export interface RouteUpdateParams { pattern: string; /** @@ -145,10 +145,10 @@ export interface RouteReplaceParams { export namespace Routes { export import RouteCreateResponse = RoutesAPI.RouteCreateResponse; + export import RouteUpdateResponse = RoutesAPI.RouteUpdateResponse; export import RouteListResponse = RoutesAPI.RouteListResponse; export import RouteDeleteResponse = RoutesAPI.RouteDeleteResponse; export import RouteGetResponse = RoutesAPI.RouteGetResponse; - export import RouteReplaceResponse = RoutesAPI.RouteReplaceResponse; export import RouteCreateParams = RoutesAPI.RouteCreateParams; - export import RouteReplaceParams = RoutesAPI.RouteReplaceParams; + export import RouteUpdateParams = RoutesAPI.RouteUpdateParams; } diff --git a/src/resources/workers/scripts/index.ts b/src/resources/workers/scripts/index.ts index 8ead8299ad..96faae3ac9 100644 --- a/src/resources/workers/scripts/index.ts +++ b/src/resources/workers/scripts/index.ts @@ -1,18 +1,18 @@ // File generated from our OpenAPI spec by Stainless. export { BindingListResponse, Bindings } from './bindings'; -export { ScheduleListResponse, ScheduleReplaceResponse, ScheduleReplaceParams, Schedules } from './schedules'; +export { ScheduleUpdateResponse, ScheduleListResponse, ScheduleUpdateParams, Schedules } from './schedules'; export { + ScriptUpdateResponse, ScriptListResponse, - ScriptReplaceResponse, + ScriptUpdateParams, ScriptDeleteParams, - ScriptReplaceParams, Scripts, } from './scripts'; export { TailCreateResponse, TailListResponse, TailDeleteResponse, Tail } from './tail'; export { + UsageModelUpdateResponse, UsageModelGetResponse, - UsageModelReplaceResponse, - UsageModelReplaceParams, + UsageModelUpdateParams, UsageModel, } from './usage-model'; diff --git a/src/resources/workers/scripts/schedules.ts b/src/resources/workers/scripts/schedules.ts index 06c9afe921..3c09a29db8 100644 --- a/src/resources/workers/scripts/schedules.ts +++ b/src/resources/workers/scripts/schedules.ts @@ -6,44 +6,44 @@ import * as SchedulesAPI from 'cloudflare/resources/workers/scripts/schedules'; export class Schedules extends APIResource { /** - * Fetches Cron Triggers for a Worker. + * Updates Cron Triggers for a Worker. */ - list( + update( accountId: string, scriptName: string, + body: ScheduleUpdateParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( - this._client.get( - `/accounts/${accountId}/workers/scripts/${scriptName}/schedules`, - options, - ) as Core.APIPromise<{ result: ScheduleListResponse }> + this._client.put(`/accounts/${accountId}/workers/scripts/${scriptName}/schedules`, { + body, + ...options, + }) as Core.APIPromise<{ result: ScheduleUpdateResponse }> )._thenUnwrap((obj) => obj.result); } /** - * Updates Cron Triggers for a Worker. + * Fetches Cron Triggers for a Worker. */ - replace( + list( accountId: string, scriptName: string, - body: ScheduleReplaceParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( - this._client.put(`/accounts/${accountId}/workers/scripts/${scriptName}/schedules`, { - body, - ...options, - }) as Core.APIPromise<{ result: ScheduleReplaceResponse }> + this._client.get( + `/accounts/${accountId}/workers/scripts/${scriptName}/schedules`, + options, + ) as Core.APIPromise<{ result: ScheduleListResponse }> )._thenUnwrap((obj) => obj.result); } } -export interface ScheduleListResponse { - schedules?: Array; +export interface ScheduleUpdateResponse { + schedules?: Array; } -export namespace ScheduleListResponse { +export namespace ScheduleUpdateResponse { export interface Schedule { created_on?: unknown; @@ -53,11 +53,11 @@ export namespace ScheduleListResponse { } } -export interface ScheduleReplaceResponse { - schedules?: Array; +export interface ScheduleListResponse { + schedules?: Array; } -export namespace ScheduleReplaceResponse { +export namespace ScheduleListResponse { export interface Schedule { created_on?: unknown; @@ -67,10 +67,10 @@ export namespace ScheduleReplaceResponse { } } -export type ScheduleReplaceParams = unknown; +export type ScheduleUpdateParams = unknown; export namespace Schedules { + export import ScheduleUpdateResponse = SchedulesAPI.ScheduleUpdateResponse; export import ScheduleListResponse = SchedulesAPI.ScheduleListResponse; - export import ScheduleReplaceResponse = SchedulesAPI.ScheduleReplaceResponse; - export import ScheduleReplaceParams = SchedulesAPI.ScheduleReplaceParams; + export import ScheduleUpdateParams = SchedulesAPI.ScheduleUpdateParams; } diff --git a/src/resources/workers/scripts/scripts.ts b/src/resources/workers/scripts/scripts.ts index c1156026ed..35acc75f96 100644 --- a/src/resources/workers/scripts/scripts.ts +++ b/src/resources/workers/scripts/scripts.ts @@ -16,6 +16,24 @@ export class Scripts extends APIResource { tail: TailAPI.Tail = new TailAPI.Tail(this._client); usageModel: UsageModelAPI.UsageModel = new UsageModelAPI.UsageModel(this._client); + /** + * Upload a worker module. + */ + update( + accountId: string, + scriptName: string, + params: ScriptUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { rollback_to, ...body } = params; + return ( + this._client.put( + `/accounts/${accountId}/workers/scripts/${scriptName}`, + maybeMultipartFormRequestOptions({ query: { rollback_to }, body, ...options }), + ) as Core.APIPromise<{ result: ScriptUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * Fetch a list of uploaded workers. */ @@ -54,23 +72,74 @@ export class Scripts extends APIResource { __binaryResponse: true, }); } +} +export interface ScriptUpdateResponse { /** - * Upload a worker module. + * The id of the script in the Workers system. Usually the script name. */ - replace( - accountId: string, - scriptName: string, - params: ScriptReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { rollback_to, ...body } = params; - return ( - this._client.put( - `/accounts/${accountId}/workers/scripts/${scriptName}`, - maybeMultipartFormRequestOptions({ query: { rollback_to }, body, ...options }), - ) as Core.APIPromise<{ result: ScriptReplaceResponse }> - )._thenUnwrap((obj) => obj.result); + id?: string; + + /** + * When the script was created. + */ + created_on?: string; + + /** + * Hashed script content, can be used in a If-None-Match header when updating. + */ + etag?: string; + + /** + * Whether Logpush is turned on for the Worker. + */ + logpush?: boolean; + + /** + * When the script was last modified. + */ + modified_on?: string; + + /** + * Deprecated. Deployment metadata for internal usage. + */ + pipeline_hash?: string; + + /** + * Specifies the placement mode for the Worker (e.g. 'smart'). + */ + placement_mode?: string; + + /** + * List of Workers that will consume logs from the attached Worker. + */ + tail_consumers?: Array; + + /** + * Specifies the usage model for the Worker (e.g. 'bundled' or 'unbound'). + */ + usage_model?: string; +} + +export namespace ScriptUpdateResponse { + /** + * A reference to a script that will consume logs from the attached Worker. + */ + export interface TailConsumer { + /** + * Name of Worker that is to be the consumer. + */ + service: string; + + /** + * Optional environment if the Worker utilizes one. + */ + environment?: string; + + /** + * Optional dispatch namespace the script belongs to. + */ + namespace?: string; } } @@ -147,87 +216,9 @@ export namespace ScriptListResponse { } } -export interface ScriptReplaceResponse { - /** - * The id of the script in the Workers system. Usually the script name. - */ - id?: string; - - /** - * When the script was created. - */ - created_on?: string; - - /** - * Hashed script content, can be used in a If-None-Match header when updating. - */ - etag?: string; +export type ScriptUpdateParams = ScriptUpdateParams.Variant0 | ScriptUpdateParams.Variant1; - /** - * Whether Logpush is turned on for the Worker. - */ - logpush?: boolean; - - /** - * When the script was last modified. - */ - modified_on?: string; - - /** - * Deprecated. Deployment metadata for internal usage. - */ - pipeline_hash?: string; - - /** - * Specifies the placement mode for the Worker (e.g. 'smart'). - */ - placement_mode?: string; - - /** - * List of Workers that will consume logs from the attached Worker. - */ - tail_consumers?: Array; - - /** - * Specifies the usage model for the Worker (e.g. 'bundled' or 'unbound'). - */ - usage_model?: string; -} - -export namespace ScriptReplaceResponse { - /** - * A reference to a script that will consume logs from the attached Worker. - */ - export interface TailConsumer { - /** - * Name of Worker that is to be the consumer. - */ - service: string; - - /** - * Optional environment if the Worker utilizes one. - */ - environment?: string; - - /** - * Optional dispatch namespace the script belongs to. - */ - namespace?: string; - } -} - -export interface ScriptDeleteParams { - /** - * If set to true, delete will not be stopped by associated service binding, - * durable object, or other binding. Any of these associated bindings/durable - * objects will be deleted along with the script. - */ - force?: boolean; -} - -export type ScriptReplaceParams = ScriptReplaceParams.Variant0 | ScriptReplaceParams.Variant1; - -export namespace ScriptReplaceParams { +export namespace ScriptUpdateParams { export interface Variant0 { /** * Query param: Rollback to provided deployment based on deployment ID. Request @@ -248,7 +239,7 @@ export namespace ScriptReplaceParams { * Body param: JSON encoded metadata about the uploaded parts and Worker * configuration. */ - metadata?: ScriptReplaceParams.Variant0.Metadata; + metadata?: ScriptUpdateParams.Variant0.Metadata; } export namespace Variant0 { @@ -485,23 +476,32 @@ export namespace ScriptReplaceParams { } } +export interface ScriptDeleteParams { + /** + * If set to true, delete will not be stopped by associated service binding, + * durable object, or other binding. Any of these associated bindings/durable + * objects will be deleted along with the script. + */ + force?: boolean; +} + export namespace Scripts { + export import ScriptUpdateResponse = ScriptsAPI.ScriptUpdateResponse; export import ScriptListResponse = ScriptsAPI.ScriptListResponse; - export import ScriptReplaceResponse = ScriptsAPI.ScriptReplaceResponse; + export import ScriptUpdateParams = ScriptsAPI.ScriptUpdateParams; export import ScriptDeleteParams = ScriptsAPI.ScriptDeleteParams; - export import ScriptReplaceParams = ScriptsAPI.ScriptReplaceParams; export import Bindings = BindingsAPI.Bindings; export import BindingListResponse = BindingsAPI.BindingListResponse; export import Schedules = SchedulesAPI.Schedules; + export import ScheduleUpdateResponse = SchedulesAPI.ScheduleUpdateResponse; export import ScheduleListResponse = SchedulesAPI.ScheduleListResponse; - export import ScheduleReplaceResponse = SchedulesAPI.ScheduleReplaceResponse; - export import ScheduleReplaceParams = SchedulesAPI.ScheduleReplaceParams; + export import ScheduleUpdateParams = SchedulesAPI.ScheduleUpdateParams; export import Tail = TailAPI.Tail; export import TailCreateResponse = TailAPI.TailCreateResponse; export import TailListResponse = TailAPI.TailListResponse; export import TailDeleteResponse = TailAPI.TailDeleteResponse; export import UsageModel = UsageModelAPI.UsageModel; + export import UsageModelUpdateResponse = UsageModelAPI.UsageModelUpdateResponse; export import UsageModelGetResponse = UsageModelAPI.UsageModelGetResponse; - export import UsageModelReplaceResponse = UsageModelAPI.UsageModelReplaceResponse; - export import UsageModelReplaceParams = UsageModelAPI.UsageModelReplaceParams; + export import UsageModelUpdateParams = UsageModelAPI.UsageModelUpdateParams; } diff --git a/src/resources/workers/scripts/usage-model.ts b/src/resources/workers/scripts/usage-model.ts index 1688b736db..822893d7c7 100644 --- a/src/resources/workers/scripts/usage-model.ts +++ b/src/resources/workers/scripts/usage-model.ts @@ -6,52 +6,52 @@ import * as UsageModelAPI from 'cloudflare/resources/workers/scripts/usage-model export class UsageModel extends APIResource { /** - * Fetches the Usage Model for a given Worker. + * Updates the Usage Model for a given Worker. Requires a Workers Paid + * subscription. */ - get( + update( accountId: string, scriptName: string, + body: UsageModelUpdateParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( - this._client.get( - `/accounts/${accountId}/workers/scripts/${scriptName}/usage-model`, - options, - ) as Core.APIPromise<{ result: UsageModelGetResponse }> + this._client.put(`/accounts/${accountId}/workers/scripts/${scriptName}/usage-model`, { + body, + ...options, + }) as Core.APIPromise<{ result: UsageModelUpdateResponse }> )._thenUnwrap((obj) => obj.result); } /** - * Updates the Usage Model for a given Worker. Requires a Workers Paid - * subscription. + * Fetches the Usage Model for a given Worker. */ - replace( + get( accountId: string, scriptName: string, - body: UsageModelReplaceParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( - this._client.put(`/accounts/${accountId}/workers/scripts/${scriptName}/usage-model`, { - body, - ...options, - }) as Core.APIPromise<{ result: UsageModelReplaceResponse }> + this._client.get( + `/accounts/${accountId}/workers/scripts/${scriptName}/usage-model`, + options, + ) as Core.APIPromise<{ result: UsageModelGetResponse }> )._thenUnwrap((obj) => obj.result); } } -export interface UsageModelGetResponse { +export interface UsageModelUpdateResponse { usage_model?: unknown; } -export interface UsageModelReplaceResponse { +export interface UsageModelGetResponse { usage_model?: unknown; } -export type UsageModelReplaceParams = unknown; +export type UsageModelUpdateParams = unknown; export namespace UsageModel { + export import UsageModelUpdateResponse = UsageModelAPI.UsageModelUpdateResponse; export import UsageModelGetResponse = UsageModelAPI.UsageModelGetResponse; - export import UsageModelReplaceResponse = UsageModelAPI.UsageModelReplaceResponse; - export import UsageModelReplaceParams = UsageModelAPI.UsageModelReplaceParams; + export import UsageModelUpdateParams = UsageModelAPI.UsageModelUpdateParams; } diff --git a/src/resources/workers/services/environments/content.ts b/src/resources/workers/services/environments/content.ts index 58d6faae7c..8fe6c4b612 100644 --- a/src/resources/workers/services/environments/content.ts +++ b/src/resources/workers/services/environments/content.ts @@ -7,31 +7,16 @@ import * as ContentAPI from 'cloudflare/resources/workers/services/environments/ import { type Uploadable, multipartFormRequestOptions } from 'cloudflare/core'; export class Content extends APIResource { - /** - * Get script content from a worker with an environment - */ - get( - accountId: string, - serviceName: string, - environmentName: string, - options?: Core.RequestOptions, - ): Core.APIPromise { - return this._client.get( - `/accounts/${accountId}/workers/services/${serviceName}/environments/${environmentName}/content`, - { ...options, __binaryResponse: true }, - ); - } - /** * Put script content from a worker with an environment */ - replace( + update( accountId: string, serviceName: string, environmentName: string, - params: ContentReplaceParams, + params: ContentUpdateParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { 'CF-WORKER-BODY-PART': cfWorkerBodyPart, 'CF-WORKER-MAIN-MODULE-PART': cfWorkerMainModulePart, @@ -49,12 +34,27 @@ export class Content extends APIResource { ...options?.headers, }, }), - ) as Core.APIPromise<{ result: ContentReplaceResponse }> + ) as Core.APIPromise<{ result: ContentUpdateResponse }> )._thenUnwrap((obj) => obj.result); } + + /** + * Get script content from a worker with an environment + */ + get( + accountId: string, + serviceName: string, + environmentName: string, + options?: Core.RequestOptions, + ): Core.APIPromise { + return this._client.get( + `/accounts/${accountId}/workers/services/${serviceName}/environments/${environmentName}/content`, + { ...options, __binaryResponse: true }, + ); + } } -export interface ContentReplaceResponse { +export interface ContentUpdateResponse { /** * The id of the script in the Workers system. Usually the script name. */ @@ -93,7 +93,7 @@ export interface ContentReplaceResponse { /** * List of Workers that will consume logs from the attached Worker. */ - tail_consumers?: Array; + tail_consumers?: Array; /** * Specifies the usage model for the Worker (e.g. 'bundled' or 'unbound'). @@ -101,7 +101,7 @@ export interface ContentReplaceResponse { usage_model?: string; } -export namespace ContentReplaceResponse { +export namespace ContentUpdateResponse { /** * A reference to a script that will consume logs from the attached Worker. */ @@ -123,7 +123,7 @@ export namespace ContentReplaceResponse { } } -export interface ContentReplaceParams { +export interface ContentUpdateParams { /** * Body param: A module comprising a Worker script, often a javascript file. * Multiple modules may be provided as separate named parts, but at least one @@ -138,7 +138,7 @@ export interface ContentReplaceParams { * Body param: JSON encoded metadata about the uploaded parts and Worker * configuration. */ - metadata?: ContentReplaceParams.Metadata; + metadata?: ContentUpdateParams.Metadata; /** * Header param: The multipart name of a script upload part containing script @@ -153,7 +153,7 @@ export interface ContentReplaceParams { 'CF-WORKER-MAIN-MODULE-PART'?: string; } -export namespace ContentReplaceParams { +export namespace ContentUpdateParams { /** * JSON encoded metadata about the uploaded parts and Worker configuration. */ @@ -174,6 +174,6 @@ export namespace ContentReplaceParams { } export namespace Content { - export import ContentReplaceResponse = ContentAPI.ContentReplaceResponse; - export import ContentReplaceParams = ContentAPI.ContentReplaceParams; + export import ContentUpdateResponse = ContentAPI.ContentUpdateResponse; + export import ContentUpdateParams = ContentAPI.ContentUpdateParams; } diff --git a/src/resources/workers/services/environments/environments.ts b/src/resources/workers/services/environments/environments.ts index eb7b7ce7ea..6abd9ddf31 100644 --- a/src/resources/workers/services/environments/environments.ts +++ b/src/resources/workers/services/environments/environments.ts @@ -11,10 +11,10 @@ export class Environments extends APIResource { export namespace Environments { export import Content = ContentAPI.Content; - export import ContentReplaceResponse = ContentAPI.ContentReplaceResponse; - export import ContentReplaceParams = ContentAPI.ContentReplaceParams; + export import ContentUpdateResponse = ContentAPI.ContentUpdateResponse; + export import ContentUpdateParams = ContentAPI.ContentUpdateParams; export import Settings = SettingsAPI.Settings; - export import SettingUpdateResponse = SettingsAPI.SettingUpdateResponse; + export import SettingEditResponse = SettingsAPI.SettingEditResponse; export import SettingGetResponse = SettingsAPI.SettingGetResponse; - export import SettingUpdateParams = SettingsAPI.SettingUpdateParams; + export import SettingEditParams = SettingsAPI.SettingEditParams; } diff --git a/src/resources/workers/services/environments/index.ts b/src/resources/workers/services/environments/index.ts index 23c09645bd..a1fe93f940 100644 --- a/src/resources/workers/services/environments/index.ts +++ b/src/resources/workers/services/environments/index.ts @@ -1,5 +1,5 @@ // File generated from our OpenAPI spec by Stainless. -export { ContentReplaceResponse, ContentReplaceParams, Content } from './content'; +export { ContentUpdateResponse, ContentUpdateParams, Content } from './content'; export { Environments } from './environments'; -export { SettingUpdateResponse, SettingGetResponse, SettingUpdateParams, Settings } from './settings'; +export { SettingEditResponse, SettingGetResponse, SettingEditParams, Settings } from './settings'; diff --git a/src/resources/workers/services/environments/settings.ts b/src/resources/workers/services/environments/settings.ts index 7471bc1102..f200fe1a5e 100644 --- a/src/resources/workers/services/environments/settings.ts +++ b/src/resources/workers/services/environments/settings.ts @@ -8,18 +8,18 @@ export class Settings extends APIResource { /** * Patch script metadata, such as bindings */ - update( + edit( accountId: string, serviceName: string, environmentName: string, - body: SettingUpdateParams, + body: SettingEditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.patch( `/accounts/${accountId}/workers/services/${serviceName}/environments/${environmentName}/settings`, { body, ...options }, - ) as Core.APIPromise<{ result: SettingUpdateResponse }> + ) as Core.APIPromise<{ result: SettingEditResponse }> )._thenUnwrap((obj) => obj.result); } @@ -41,19 +41,19 @@ export class Settings extends APIResource { } } -export interface SettingUpdateResponse { +export interface SettingEditResponse { /** * List of bindings attached to this Worker */ bindings?: Array< - | SettingUpdateResponse.WorkersKvNamespaceBinding - | SettingUpdateResponse.WorkersServiceBinding - | SettingUpdateResponse.WorkersDoBinding - | SettingUpdateResponse.WorkersR2Binding - | SettingUpdateResponse.WorkersQueueBinding - | SettingUpdateResponse.WorkersD1Binding - | SettingUpdateResponse.WorkersDispatchNamespaceBinding - | SettingUpdateResponse.WorkersMtlsCertBinding + | SettingEditResponse.WorkersKvNamespaceBinding + | SettingEditResponse.WorkersServiceBinding + | SettingEditResponse.WorkersDoBinding + | SettingEditResponse.WorkersR2Binding + | SettingEditResponse.WorkersQueueBinding + | SettingEditResponse.WorkersD1Binding + | SettingEditResponse.WorkersDispatchNamespaceBinding + | SettingEditResponse.WorkersMtlsCertBinding >; /** @@ -74,11 +74,9 @@ export interface SettingUpdateResponse { /** * Migrations to apply for Durable Objects associated with this Worker. */ - migrations?: - | SettingUpdateResponse.WorkersSingleStepMigrations - | SettingUpdateResponse.WorkersSteppedMigrations; + migrations?: SettingEditResponse.WorkersSingleStepMigrations | SettingEditResponse.WorkersSteppedMigrations; - placement?: SettingUpdateResponse.Placement; + placement?: SettingEditResponse.Placement; /** * Tags to help you manage your Workers @@ -88,7 +86,7 @@ export interface SettingUpdateResponse { /** * List of Workers that will consume logs from the attached Worker. */ - tail_consumers?: Array; + tail_consumers?: Array; /** * Specifies the usage model for the Worker (e.g. 'bundled' or 'unbound'). @@ -96,7 +94,7 @@ export interface SettingUpdateResponse { usage_model?: string; } -export namespace SettingUpdateResponse { +export namespace SettingEditResponse { export interface WorkersKvNamespaceBinding { /** * A JavaScript variable name for the binding. @@ -837,12 +835,12 @@ export namespace SettingGetResponse { } } -export interface SettingUpdateParams { - errors: Array; +export interface SettingEditParams { + errors: Array; - messages: Array; + messages: Array; - result: SettingUpdateParams.Result; + result: SettingEditParams.Result; /** * Whether the API call was successful @@ -850,7 +848,7 @@ export interface SettingUpdateParams { success: true; } -export namespace SettingUpdateParams { +export namespace SettingEditParams { export interface Error { code: number; @@ -1212,7 +1210,7 @@ export namespace SettingUpdateParams { } export namespace Settings { - export import SettingUpdateResponse = SettingsAPI.SettingUpdateResponse; + export import SettingEditResponse = SettingsAPI.SettingEditResponse; export import SettingGetResponse = SettingsAPI.SettingGetResponse; - export import SettingUpdateParams = SettingsAPI.SettingUpdateParams; + export import SettingEditParams = SettingsAPI.SettingEditParams; } diff --git a/src/resources/workers/subdomains.ts b/src/resources/workers/subdomains.ts index e679951488..f1dfc47d07 100644 --- a/src/resources/workers/subdomains.ts +++ b/src/resources/workers/subdomains.ts @@ -6,44 +6,44 @@ import * as SubdomainsAPI from 'cloudflare/resources/workers/subdomains'; export class Subdomains extends APIResource { /** - * Returns a Workers subdomain for an account. + * Creates a Workers subdomain for an account. */ - get(accountId: string, options?: Core.RequestOptions): Core.APIPromise { + update( + accountId: string, + body: SubdomainUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { return ( - this._client.get(`/accounts/${accountId}/workers/subdomain`, options) as Core.APIPromise<{ - result: SubdomainGetResponse; + this._client.put(`/accounts/${accountId}/workers/subdomain`, { body, ...options }) as Core.APIPromise<{ + result: SubdomainUpdateResponse; }> )._thenUnwrap((obj) => obj.result); } /** - * Creates a Workers subdomain for an account. + * Returns a Workers subdomain for an account. */ - replace( - accountId: string, - body: SubdomainReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { + get(accountId: string, options?: Core.RequestOptions): Core.APIPromise { return ( - this._client.put(`/accounts/${accountId}/workers/subdomain`, { body, ...options }) as Core.APIPromise<{ - result: SubdomainReplaceResponse; + this._client.get(`/accounts/${accountId}/workers/subdomain`, options) as Core.APIPromise<{ + result: SubdomainGetResponse; }> )._thenUnwrap((obj) => obj.result); } } -export interface SubdomainGetResponse { +export interface SubdomainUpdateResponse { name?: unknown; } -export interface SubdomainReplaceResponse { +export interface SubdomainGetResponse { name?: unknown; } -export type SubdomainReplaceParams = unknown; +export type SubdomainUpdateParams = unknown; export namespace Subdomains { + export import SubdomainUpdateResponse = SubdomainsAPI.SubdomainUpdateResponse; export import SubdomainGetResponse = SubdomainsAPI.SubdomainGetResponse; - export import SubdomainReplaceResponse = SubdomainsAPI.SubdomainReplaceResponse; - export import SubdomainReplaceParams = SubdomainsAPI.SubdomainReplaceParams; + export import SubdomainUpdateParams = SubdomainsAPI.SubdomainUpdateParams; } diff --git a/src/resources/workers/workers.ts b/src/resources/workers/workers.ts index 86ab0ed144..bc12485760 100644 --- a/src/resources/workers/workers.ts +++ b/src/resources/workers/workers.ts @@ -32,49 +32,49 @@ export class Workers extends APIResource { export namespace Workers { export import Scripts = ScriptsAPI.Scripts; + export import ScriptUpdateResponse = ScriptsAPI.ScriptUpdateResponse; export import ScriptListResponse = ScriptsAPI.ScriptListResponse; - export import ScriptReplaceResponse = ScriptsAPI.ScriptReplaceResponse; + export import ScriptUpdateParams = ScriptsAPI.ScriptUpdateParams; export import ScriptDeleteParams = ScriptsAPI.ScriptDeleteParams; - export import ScriptReplaceParams = ScriptsAPI.ScriptReplaceParams; export import Filters = FiltersAPI.Filters; export import FilterCreateResponse = FiltersAPI.FilterCreateResponse; + export import FilterUpdateResponse = FiltersAPI.FilterUpdateResponse; export import FilterListResponse = FiltersAPI.FilterListResponse; export import FilterDeleteResponse = FiltersAPI.FilterDeleteResponse; - export import FilterReplaceResponse = FiltersAPI.FilterReplaceResponse; export import FilterCreateParams = FiltersAPI.FilterCreateParams; - export import FilterReplaceParams = FiltersAPI.FilterReplaceParams; + export import FilterUpdateParams = FiltersAPI.FilterUpdateParams; export import Routes = RoutesAPI.Routes; export import RouteCreateResponse = RoutesAPI.RouteCreateResponse; + export import RouteUpdateResponse = RoutesAPI.RouteUpdateResponse; export import RouteListResponse = RoutesAPI.RouteListResponse; export import RouteDeleteResponse = RoutesAPI.RouteDeleteResponse; export import RouteGetResponse = RoutesAPI.RouteGetResponse; - export import RouteReplaceResponse = RoutesAPI.RouteReplaceResponse; export import RouteCreateParams = RoutesAPI.RouteCreateParams; - export import RouteReplaceParams = RoutesAPI.RouteReplaceParams; + export import RouteUpdateParams = RoutesAPI.RouteUpdateParams; export import AccountSettings = AccountSettingsAPI.AccountSettings; + export import AccountSettingUpdateResponse = AccountSettingsAPI.AccountSettingUpdateResponse; export import AccountSettingGetResponse = AccountSettingsAPI.AccountSettingGetResponse; - export import AccountSettingReplaceResponse = AccountSettingsAPI.AccountSettingReplaceResponse; - export import AccountSettingReplaceParams = AccountSettingsAPI.AccountSettingReplaceParams; + export import AccountSettingUpdateParams = AccountSettingsAPI.AccountSettingUpdateParams; export import Deployments = DeploymentsAPI.Deployments; export import Domains = DomainsAPI.Domains; + export import DomainUpdateResponse = DomainsAPI.DomainUpdateResponse; export import DomainListResponse = DomainsAPI.DomainListResponse; export import DomainGetResponse = DomainsAPI.DomainGetResponse; - export import DomainReplaceResponse = DomainsAPI.DomainReplaceResponse; + export import DomainUpdateParams = DomainsAPI.DomainUpdateParams; export import DomainListParams = DomainsAPI.DomainListParams; - export import DomainReplaceParams = DomainsAPI.DomainReplaceParams; export import DurableObjects = DurableObjectsAPI.DurableObjects; export import Queues = QueuesAPI.Queues; export import QueueCreateResponse = QueuesAPI.QueueCreateResponse; + export import QueueUpdateResponse = QueuesAPI.QueueUpdateResponse; export import QueueListResponse = QueuesAPI.QueueListResponse; export import QueueDeleteResponse = QueuesAPI.QueueDeleteResponse; export import QueueGetResponse = QueuesAPI.QueueGetResponse; - export import QueueReplaceResponse = QueuesAPI.QueueReplaceResponse; export import QueueCreateParams = QueuesAPI.QueueCreateParams; - export import QueueReplaceParams = QueuesAPI.QueueReplaceParams; + export import QueueUpdateParams = QueuesAPI.QueueUpdateParams; export import Subdomains = SubdomainsAPI.Subdomains; + export import SubdomainUpdateResponse = SubdomainsAPI.SubdomainUpdateResponse; export import SubdomainGetResponse = SubdomainsAPI.SubdomainGetResponse; - export import SubdomainReplaceResponse = SubdomainsAPI.SubdomainReplaceResponse; - export import SubdomainReplaceParams = SubdomainsAPI.SubdomainReplaceParams; + export import SubdomainUpdateParams = SubdomainsAPI.SubdomainUpdateParams; export import DeploymentsByScript = DeploymentsByScriptAPI.DeploymentsByScript; export import DeploymentsByScriptListResponse = DeploymentsByScriptAPI.DeploymentsByScriptListResponse; export import DeploymentsByScriptDetailResponse = DeploymentsByScriptAPI.DeploymentsByScriptDetailResponse; diff --git a/src/resources/zaraz/config.ts b/src/resources/zaraz/config.ts index 9103bca435..01b05425e1 100644 --- a/src/resources/zaraz/config.ts +++ b/src/resources/zaraz/config.ts @@ -6,29 +6,29 @@ import * as ConfigAPI from 'cloudflare/resources/zaraz/config'; export class Config extends APIResource { /** - * Gets latest Zaraz configuration for a zone. It can be preview or published - * configuration, whichever was the last updated. Secret variables values will not - * be included. + * Updates Zaraz configuration for a zone. */ - get(zoneId: string, options?: Core.RequestOptions): Core.APIPromise { + update( + zoneId: string, + body: ConfigUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { return ( - this._client.get(`/zones/${zoneId}/settings/zaraz/config`, options) as Core.APIPromise<{ - result: ConfigGetResponse; + this._client.put(`/zones/${zoneId}/settings/zaraz/config`, { body, ...options }) as Core.APIPromise<{ + result: ConfigUpdateResponse; }> )._thenUnwrap((obj) => obj.result); } /** - * Updates Zaraz configuration for a zone. + * Gets latest Zaraz configuration for a zone. It can be preview or published + * configuration, whichever was the last updated. Secret variables values will not + * be included. */ - replace( - zoneId: string, - body: ConfigReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { + get(zoneId: string, options?: Core.RequestOptions): Core.APIPromise { return ( - this._client.put(`/zones/${zoneId}/settings/zaraz/config`, { body, ...options }) as Core.APIPromise<{ - result: ConfigReplaceResponse; + this._client.get(`/zones/${zoneId}/settings/zaraz/config`, options) as Core.APIPromise<{ + result: ConfigGetResponse; }> )._thenUnwrap((obj) => obj.result); } @@ -37,7 +37,7 @@ export class Config extends APIResource { /** * Zaraz configuration */ -export interface ConfigGetResponse { +export interface ConfigUpdateResponse { /** * Data layer compatibility mode enabled. */ @@ -51,7 +51,7 @@ export interface ConfigGetResponse { /** * General Zaraz settings. */ - settings: ConfigGetResponse.Settings; + settings: ConfigUpdateResponse.Settings; /** * Tools set up under Zaraz configuration, where key is the alpha-numeric tool ID @@ -59,21 +59,21 @@ export interface ConfigGetResponse { */ tools: Record< string, - ConfigGetResponse.ZarazManagedComponent | ConfigGetResponse.ZarazCustomManagedComponent + ConfigUpdateResponse.ZarazManagedComponent | ConfigUpdateResponse.ZarazCustomManagedComponent >; /** * Triggers set up under Zaraz configuration, where key is the trigger * alpha-numeric ID and value is the trigger configuration. */ - triggers: Record; + triggers: Record; /** * Variables set up under Zaraz configuration, where key is the variable * alpha-numeric ID and value is the variable configuration. Values of variables of * type secret are not included. */ - variables: Record; + variables: Record; /** * Zaraz internal version of the config. @@ -83,7 +83,7 @@ export interface ConfigGetResponse { /** * Consent management configuration. */ - consent?: ConfigGetResponse.Consent; + consent?: ConfigUpdateResponse.Consent; /** * Single Page Application support enabled. @@ -91,7 +91,7 @@ export interface ConfigGetResponse { historyChange?: boolean; } -export namespace ConfigGetResponse { +export namespace ConfigUpdateResponse { /** * General Zaraz settings. */ @@ -773,7 +773,7 @@ export namespace ConfigGetResponse { /** * Zaraz configuration */ -export interface ConfigReplaceResponse { +export interface ConfigGetResponse { /** * Data layer compatibility mode enabled. */ @@ -787,7 +787,7 @@ export interface ConfigReplaceResponse { /** * General Zaraz settings. */ - settings: ConfigReplaceResponse.Settings; + settings: ConfigGetResponse.Settings; /** * Tools set up under Zaraz configuration, where key is the alpha-numeric tool ID @@ -795,21 +795,21 @@ export interface ConfigReplaceResponse { */ tools: Record< string, - ConfigReplaceResponse.ZarazManagedComponent | ConfigReplaceResponse.ZarazCustomManagedComponent + ConfigGetResponse.ZarazManagedComponent | ConfigGetResponse.ZarazCustomManagedComponent >; /** * Triggers set up under Zaraz configuration, where key is the trigger * alpha-numeric ID and value is the trigger configuration. */ - triggers: Record; + triggers: Record; /** * Variables set up under Zaraz configuration, where key is the variable * alpha-numeric ID and value is the variable configuration. Values of variables of * type secret are not included. */ - variables: Record; + variables: Record; /** * Zaraz internal version of the config. @@ -819,7 +819,7 @@ export interface ConfigReplaceResponse { /** * Consent management configuration. */ - consent?: ConfigReplaceResponse.Consent; + consent?: ConfigGetResponse.Consent; /** * Single Page Application support enabled. @@ -827,7 +827,7 @@ export interface ConfigReplaceResponse { historyChange?: boolean; } -export namespace ConfigReplaceResponse { +export namespace ConfigGetResponse { /** * General Zaraz settings. */ @@ -1506,7 +1506,7 @@ export namespace ConfigReplaceResponse { } } -export interface ConfigReplaceParams { +export interface ConfigUpdateParams { /** * Data layer compatibility mode enabled. */ @@ -1520,7 +1520,7 @@ export interface ConfigReplaceParams { /** * General Zaraz settings. */ - settings: ConfigReplaceParams.Settings; + settings: ConfigUpdateParams.Settings; /** * Tools set up under Zaraz configuration, where key is the alpha-numeric tool ID @@ -1528,23 +1528,23 @@ export interface ConfigReplaceParams { */ tools: Record< string, - | ConfigReplaceParams.ZarazLegacyTool - | ConfigReplaceParams.ZarazManagedComponent - | ConfigReplaceParams.ZarazCustomManagedComponent + | ConfigUpdateParams.ZarazLegacyTool + | ConfigUpdateParams.ZarazManagedComponent + | ConfigUpdateParams.ZarazCustomManagedComponent >; /** * Triggers set up under Zaraz configuration, where key is the trigger * alpha-numeric ID and value is the trigger configuration. */ - triggers: Record; + triggers: Record; /** * Variables set up under Zaraz configuration, where key is the variable * alpha-numeric ID and value is the variable configuration. Values of variables of * type secret are not included. */ - variables: Record; + variables: Record; /** * Zaraz internal version of the config. @@ -1554,7 +1554,7 @@ export interface ConfigReplaceParams { /** * Consent management configuration. */ - consent?: ConfigReplaceParams.Consent; + consent?: ConfigUpdateParams.Consent; /** * Single Page Application support enabled. @@ -1562,7 +1562,7 @@ export interface ConfigReplaceParams { historyChange?: boolean; } -export namespace ConfigReplaceParams { +export namespace ConfigUpdateParams { /** * General Zaraz settings. */ @@ -2300,7 +2300,7 @@ export namespace ConfigReplaceParams { } export namespace Config { + export import ConfigUpdateResponse = ConfigAPI.ConfigUpdateResponse; export import ConfigGetResponse = ConfigAPI.ConfigGetResponse; - export import ConfigReplaceResponse = ConfigAPI.ConfigReplaceResponse; - export import ConfigReplaceParams = ConfigAPI.ConfigReplaceParams; + export import ConfigUpdateParams = ConfigAPI.ConfigUpdateParams; } diff --git a/src/resources/zaraz/history/history.ts b/src/resources/zaraz/history/history.ts index 82b38f5854..8cf49bc30b 100644 --- a/src/resources/zaraz/history/history.ts +++ b/src/resources/zaraz/history/history.ts @@ -9,6 +9,21 @@ import * as ConfigsAPI from 'cloudflare/resources/zaraz/history/configs'; export class History extends APIResource { configs: ConfigsAPI.Configs = new ConfigsAPI.Configs(this._client); + /** + * Restores a historical published Zaraz configuration by ID for a zone. + */ + update( + zoneId: string, + body: HistoryUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.put(`/zones/${zoneId}/settings/zaraz/history`, { body, ...options }) as Core.APIPromise<{ + result: HistoryUpdateResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + /** * Lists a history of published Zaraz configuration records for a zone. */ @@ -32,58 +47,12 @@ export class History extends APIResource { }> )._thenUnwrap((obj) => obj.result); } - - /** - * Restores a historical published Zaraz configuration by ID for a zone. - */ - replace( - zoneId: string, - body: HistoryReplaceParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.put(`/zones/${zoneId}/settings/zaraz/history`, { body, ...options }) as Core.APIPromise<{ - result: HistoryReplaceResponse; - }> - )._thenUnwrap((obj) => obj.result); - } -} - -export type HistoryListResponse = Array; - -export namespace HistoryListResponse { - export interface HistoryListResponseItem { - /** - * ID of the configuration - */ - id: number; - - /** - * Date and time the configuration was created - */ - createdAt: string; - - /** - * Configuration description provided by the user who published this configuration - */ - description: string; - - /** - * Date and time the configuration was last updated - */ - updatedAt: string; - - /** - * Alpha-numeric ID of the account user who published the configuration - */ - userId: string; - } } /** * Zaraz configuration */ -export interface HistoryReplaceResponse { +export interface HistoryUpdateResponse { /** * Data layer compatibility mode enabled. */ @@ -97,7 +66,7 @@ export interface HistoryReplaceResponse { /** * General Zaraz settings. */ - settings: HistoryReplaceResponse.Settings; + settings: HistoryUpdateResponse.Settings; /** * Tools set up under Zaraz configuration, where key is the alpha-numeric tool ID @@ -105,21 +74,21 @@ export interface HistoryReplaceResponse { */ tools: Record< string, - HistoryReplaceResponse.ZarazManagedComponent | HistoryReplaceResponse.ZarazCustomManagedComponent + HistoryUpdateResponse.ZarazManagedComponent | HistoryUpdateResponse.ZarazCustomManagedComponent >; /** * Triggers set up under Zaraz configuration, where key is the trigger * alpha-numeric ID and value is the trigger configuration. */ - triggers: Record; + triggers: Record; /** * Variables set up under Zaraz configuration, where key is the variable * alpha-numeric ID and value is the variable configuration. Values of variables of * type secret are not included. */ - variables: Record; + variables: Record; /** * Zaraz internal version of the config. @@ -129,7 +98,7 @@ export interface HistoryReplaceResponse { /** * Consent management configuration. */ - consent?: HistoryReplaceResponse.Consent; + consent?: HistoryUpdateResponse.Consent; /** * Single Page Application support enabled. @@ -137,7 +106,7 @@ export interface HistoryReplaceResponse { historyChange?: boolean; } -export namespace HistoryReplaceResponse { +export namespace HistoryUpdateResponse { /** * General Zaraz settings. */ @@ -816,6 +785,39 @@ export namespace HistoryReplaceResponse { } } +export type HistoryListResponse = Array; + +export namespace HistoryListResponse { + export interface HistoryListResponseItem { + /** + * ID of the configuration + */ + id: number; + + /** + * Date and time the configuration was created + */ + createdAt: string; + + /** + * Configuration description provided by the user who published this configuration + */ + description: string; + + /** + * Date and time the configuration was last updated + */ + updatedAt: string; + + /** + * Alpha-numeric ID of the account user who published the configuration + */ + userId: string; + } +} + +export type HistoryUpdateParams = number; + export interface HistoryListParams { /** * Maximum amount of results to list. Default value is 10. @@ -838,13 +840,11 @@ export interface HistoryListParams { sortOrder?: 'DESC' | 'ASC'; } -export type HistoryReplaceParams = number; - export namespace History { + export import HistoryUpdateResponse = HistoryAPI.HistoryUpdateResponse; export import HistoryListResponse = HistoryAPI.HistoryListResponse; - export import HistoryReplaceResponse = HistoryAPI.HistoryReplaceResponse; + export import HistoryUpdateParams = HistoryAPI.HistoryUpdateParams; export import HistoryListParams = HistoryAPI.HistoryListParams; - export import HistoryReplaceParams = HistoryAPI.HistoryReplaceParams; export import Configs = ConfigsAPI.Configs; export import ConfigGetResponse = ConfigsAPI.ConfigGetResponse; export import ConfigGetParams = ConfigsAPI.ConfigGetParams; diff --git a/src/resources/zaraz/history/index.ts b/src/resources/zaraz/history/index.ts index aafe4a1055..2005b84f75 100644 --- a/src/resources/zaraz/history/index.ts +++ b/src/resources/zaraz/history/index.ts @@ -2,9 +2,9 @@ export { ConfigGetResponse, ConfigGetParams, Configs } from './configs'; export { + HistoryUpdateResponse, HistoryListResponse, - HistoryReplaceResponse, + HistoryUpdateParams, HistoryListParams, - HistoryReplaceParams, History, } from './history'; diff --git a/src/resources/zaraz/index.ts b/src/resources/zaraz/index.ts index 94a3202901..2811a8e6b3 100644 --- a/src/resources/zaraz/index.ts +++ b/src/resources/zaraz/index.ts @@ -1,15 +1,15 @@ // File generated from our OpenAPI spec by Stainless. -export { ConfigGetResponse, ConfigReplaceResponse, ConfigReplaceParams, Config } from './config'; +export { ConfigUpdateResponse, ConfigGetResponse, ConfigUpdateParams, Config } from './config'; export { DefaultGetResponse, Default } from './default'; export { ExportGetResponse, Export } from './export'; export { + HistoryUpdateResponse, HistoryListResponse, - HistoryReplaceResponse, + HistoryUpdateParams, HistoryListParams, - HistoryReplaceParams, History, } from './history/index'; export { PublishCreateResponse, PublishCreateParams, Publish } from './publish'; export { WorkflowGetResponse, Workflow } from './workflow'; -export { ZarazReplaceResponse, ZarazReplaceParams, Zaraz } from './zaraz'; +export { ZarazUpdateResponse, ZarazUpdateParams, Zaraz } from './zaraz'; diff --git a/src/resources/zaraz/zaraz.ts b/src/resources/zaraz/zaraz.ts index 450a0e64e5..c5d5e36f7e 100644 --- a/src/resources/zaraz/zaraz.ts +++ b/src/resources/zaraz/zaraz.ts @@ -21,14 +21,14 @@ export class Zaraz extends APIResource { /** * Updates Zaraz workflow for a zone. */ - replace( + update( zoneId: string, - body: ZarazReplaceParams, + body: ZarazUpdateParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.put(`/zones/${zoneId}/settings/zaraz/workflow`, { body, ...options }) as Core.APIPromise<{ - result: ZarazReplaceResponse; + result: ZarazUpdateResponse; }> )._thenUnwrap((obj) => obj.result); } @@ -37,26 +37,26 @@ export class Zaraz extends APIResource { /** * Zaraz workflow */ -export type ZarazReplaceResponse = 'realtime' | 'preview'; +export type ZarazUpdateResponse = 'realtime' | 'preview'; -export type ZarazReplaceParams = 'realtime' | 'preview'; +export type ZarazUpdateParams = 'realtime' | 'preview'; export namespace Zaraz { - export import ZarazReplaceResponse = ZarazAPI.ZarazReplaceResponse; - export import ZarazReplaceParams = ZarazAPI.ZarazReplaceParams; + export import ZarazUpdateResponse = ZarazAPI.ZarazUpdateResponse; + export import ZarazUpdateParams = ZarazAPI.ZarazUpdateParams; export import Config = ConfigAPI.Config; + export import ConfigUpdateResponse = ConfigAPI.ConfigUpdateResponse; export import ConfigGetResponse = ConfigAPI.ConfigGetResponse; - export import ConfigReplaceResponse = ConfigAPI.ConfigReplaceResponse; - export import ConfigReplaceParams = ConfigAPI.ConfigReplaceParams; + export import ConfigUpdateParams = ConfigAPI.ConfigUpdateParams; export import Default = DefaultAPI.Default; export import DefaultGetResponse = DefaultAPI.DefaultGetResponse; export import Export = ExportAPI.Export; export import ExportGetResponse = ExportAPI.ExportGetResponse; export import History = HistoryAPI.History; + export import HistoryUpdateResponse = HistoryAPI.HistoryUpdateResponse; export import HistoryListResponse = HistoryAPI.HistoryListResponse; - export import HistoryReplaceResponse = HistoryAPI.HistoryReplaceResponse; + export import HistoryUpdateParams = HistoryAPI.HistoryUpdateParams; export import HistoryListParams = HistoryAPI.HistoryListParams; - export import HistoryReplaceParams = HistoryAPI.HistoryReplaceParams; export import Publish = PublishAPI.Publish; export import PublishCreateResponse = PublishAPI.PublishCreateResponse; export import PublishCreateParams = PublishAPI.PublishCreateParams; diff --git a/src/resources/zerotrust/connectivity-settings.ts b/src/resources/zerotrust/connectivity-settings.ts index 0617c1d8c8..4eecc3e6f8 100644 --- a/src/resources/zerotrust/connectivity-settings.ts +++ b/src/resources/zerotrust/connectivity-settings.ts @@ -8,16 +8,16 @@ export class ConnectivitySettings extends APIResource { /** * Updates the Zero Trust Connectivity Settings for the given account. */ - update( + edit( accountId: string, - body: ConnectivitySettingUpdateParams, + body: ConnectivitySettingEditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { return ( this._client.patch(`/accounts/${accountId}/zerotrust/connectivity_settings`, { body, ...options, - }) as Core.APIPromise<{ result: ConnectivitySettingUpdateResponse }> + }) as Core.APIPromise<{ result: ConnectivitySettingEditResponse }> )._thenUnwrap((obj) => obj.result); } @@ -33,7 +33,7 @@ export class ConnectivitySettings extends APIResource { } } -export interface ConnectivitySettingUpdateResponse { +export interface ConnectivitySettingEditResponse { /** * A flag to enable the ICMP proxy for the account network. */ @@ -57,7 +57,7 @@ export interface ConnectivitySettingGetResponse { offramp_warp_enabled?: boolean; } -export interface ConnectivitySettingUpdateParams { +export interface ConnectivitySettingEditParams { /** * A flag to enable the ICMP proxy for the account network. */ @@ -70,7 +70,7 @@ export interface ConnectivitySettingUpdateParams { } export namespace ConnectivitySettings { - export import ConnectivitySettingUpdateResponse = ConnectivitySettingsAPI.ConnectivitySettingUpdateResponse; + export import ConnectivitySettingEditResponse = ConnectivitySettingsAPI.ConnectivitySettingEditResponse; export import ConnectivitySettingGetResponse = ConnectivitySettingsAPI.ConnectivitySettingGetResponse; - export import ConnectivitySettingUpdateParams = ConnectivitySettingsAPI.ConnectivitySettingUpdateParams; + export import ConnectivitySettingEditParams = ConnectivitySettingsAPI.ConnectivitySettingEditParams; } diff --git a/src/resources/zerotrust/index.ts b/src/resources/zerotrust/index.ts index 5c41c67ed9..7701343ba7 100644 --- a/src/resources/zerotrust/index.ts +++ b/src/resources/zerotrust/index.ts @@ -1,9 +1,9 @@ // File generated from our OpenAPI spec by Stainless. export { - ConnectivitySettingUpdateResponse, + ConnectivitySettingEditResponse, ConnectivitySettingGetResponse, - ConnectivitySettingUpdateParams, + ConnectivitySettingEditParams, ConnectivitySettings, } from './connectivity-settings'; export { Zerotrust } from './zerotrust'; diff --git a/src/resources/zerotrust/zerotrust.ts b/src/resources/zerotrust/zerotrust.ts index 196a062311..5990461719 100644 --- a/src/resources/zerotrust/zerotrust.ts +++ b/src/resources/zerotrust/zerotrust.ts @@ -10,7 +10,7 @@ export class Zerotrust extends APIResource { export namespace Zerotrust { export import ConnectivitySettings = ConnectivitySettingsAPI.ConnectivitySettings; - export import ConnectivitySettingUpdateResponse = ConnectivitySettingsAPI.ConnectivitySettingUpdateResponse; + export import ConnectivitySettingEditResponse = ConnectivitySettingsAPI.ConnectivitySettingEditResponse; export import ConnectivitySettingGetResponse = ConnectivitySettingsAPI.ConnectivitySettingGetResponse; - export import ConnectivitySettingUpdateParams = ConnectivitySettingsAPI.ConnectivitySettingUpdateParams; + export import ConnectivitySettingEditParams = ConnectivitySettingsAPI.ConnectivitySettingEditParams; } diff --git a/src/resources/zones/index.ts b/src/resources/zones/index.ts index 11825fe616..e0e0708bb9 100644 --- a/src/resources/zones/index.ts +++ b/src/resources/zones/index.ts @@ -10,13 +10,13 @@ export { } from './holds'; export { ZoneCreateResponse, - ZoneUpdateResponse, ZoneListResponse, ZoneDeleteResponse, + ZoneEditResponse, ZoneGetResponse, ZoneCreateParams, - ZoneUpdateParams, ZoneListParams, + ZoneEditParams, ZoneListResponsesV4PagePaginationArray, Zones, } from './zones'; diff --git a/src/resources/zones/zones.ts b/src/resources/zones/zones.ts index cdd4793dfe..b0842ea483 100644 --- a/src/resources/zones/zones.ts +++ b/src/resources/zones/zones.ts @@ -19,21 +19,6 @@ export class Zones extends APIResource { )._thenUnwrap((obj) => obj.result); } - /** - * Edits a zone. Only one zone property can be changed at a time. - */ - update( - zoneId: string, - body: ZoneUpdateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.patch(`/zones/${zoneId}`, { body, ...options }) as Core.APIPromise<{ - result: ZoneUpdateResponse; - }> - )._thenUnwrap((obj) => obj.result); - } - /** * Lists, searches, sorts, and filters your zones. */ @@ -65,6 +50,21 @@ export class Zones extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Edits a zone. Only one zone property can be changed at a time. + */ + edit( + zoneId: string, + body: ZoneEditParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return ( + this._client.patch(`/zones/${zoneId}`, { body, ...options }) as Core.APIPromise<{ + result: ZoneEditResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + /** * Zone Details */ @@ -222,7 +222,7 @@ export namespace ZoneCreateResponse { } } -export interface ZoneUpdateResponse { +export interface ZoneListResponse { /** * Identifier */ @@ -231,7 +231,7 @@ export interface ZoneUpdateResponse { /** * The account the zone belongs to */ - account: ZoneUpdateResponse.Account; + account: ZoneListResponse.Account; /** * The last time proof of ownership was detected and the zone was made active @@ -253,7 +253,7 @@ export interface ZoneUpdateResponse { /** * Metadata about the zone */ - meta: ZoneUpdateResponse.Meta; + meta: ZoneListResponse.Meta; /** * When the zone was last modified @@ -284,7 +284,7 @@ export interface ZoneUpdateResponse { /** * The owner of the zone */ - owner: ZoneUpdateResponse.Owner; + owner: ZoneListResponse.Owner; /** * An array of domains used for custom name servers. This is only available for @@ -293,7 +293,7 @@ export interface ZoneUpdateResponse { vanity_name_servers?: Array; } -export namespace ZoneUpdateResponse { +export namespace ZoneListResponse { /** * The account the zone belongs to */ @@ -367,7 +367,14 @@ export namespace ZoneUpdateResponse { } } -export interface ZoneListResponse { +export interface ZoneDeleteResponse { + /** + * Identifier + */ + id: string; +} + +export interface ZoneEditResponse { /** * Identifier */ @@ -376,7 +383,7 @@ export interface ZoneListResponse { /** * The account the zone belongs to */ - account: ZoneListResponse.Account; + account: ZoneEditResponse.Account; /** * The last time proof of ownership was detected and the zone was made active @@ -398,7 +405,7 @@ export interface ZoneListResponse { /** * Metadata about the zone */ - meta: ZoneListResponse.Meta; + meta: ZoneEditResponse.Meta; /** * When the zone was last modified @@ -429,7 +436,7 @@ export interface ZoneListResponse { /** * The owner of the zone */ - owner: ZoneListResponse.Owner; + owner: ZoneEditResponse.Owner; /** * An array of domains used for custom name servers. This is only available for @@ -438,7 +445,7 @@ export interface ZoneListResponse { vanity_name_servers?: Array; } -export namespace ZoneListResponse { +export namespace ZoneEditResponse { /** * The account the zone belongs to */ @@ -512,13 +519,6 @@ export namespace ZoneListResponse { } } -export interface ZoneDeleteResponse { - /** - * Identifier - */ - id: string; -} - export interface ZoneGetResponse { /** * Identifier @@ -688,43 +688,6 @@ export namespace ZoneCreateParams { } } -export interface ZoneUpdateParams { - /** - * (Deprecated) Please use the `/zones/{zone_id}/subscription` API to update a - * zone's plan. Changing this value will create/cancel associated subscriptions. To - * view available plans for this zone, see Zone Plans. - */ - plan?: ZoneUpdateParams.Plan; - - /** - * A full zone implies that DNS is hosted with Cloudflare. A partial zone is - * typically a partner-hosted zone or a CNAME setup. This parameter is only - * available to Enterprise customers or if it has been explicitly enabled on a - * zone. - */ - type?: 'full' | 'partial' | 'secondary'; - - /** - * An array of domains used for custom name servers. This is only available for - * Business and Enterprise plans. - */ - vanity_name_servers?: Array; -} - -export namespace ZoneUpdateParams { - /** - * (Deprecated) Please use the `/zones/{zone_id}/subscription` API to update a - * zone's plan. Changing this value will create/cancel associated subscriptions. To - * view available plans for this zone, see Zone Plans. - */ - export interface Plan { - /** - * Identifier - */ - id?: string; - } -} - export interface ZoneListParams extends V4PagePaginationArrayParams { account?: ZoneListParams.Account; @@ -788,16 +751,53 @@ export namespace ZoneListParams { } } +export interface ZoneEditParams { + /** + * (Deprecated) Please use the `/zones/{zone_id}/subscription` API to update a + * zone's plan. Changing this value will create/cancel associated subscriptions. To + * view available plans for this zone, see Zone Plans. + */ + plan?: ZoneEditParams.Plan; + + /** + * A full zone implies that DNS is hosted with Cloudflare. A partial zone is + * typically a partner-hosted zone or a CNAME setup. This parameter is only + * available to Enterprise customers or if it has been explicitly enabled on a + * zone. + */ + type?: 'full' | 'partial' | 'secondary'; + + /** + * An array of domains used for custom name servers. This is only available for + * Business and Enterprise plans. + */ + vanity_name_servers?: Array; +} + +export namespace ZoneEditParams { + /** + * (Deprecated) Please use the `/zones/{zone_id}/subscription` API to update a + * zone's plan. Changing this value will create/cancel associated subscriptions. To + * view available plans for this zone, see Zone Plans. + */ + export interface Plan { + /** + * Identifier + */ + id?: string; + } +} + export namespace Zones { export import ZoneCreateResponse = ZonesAPI.ZoneCreateResponse; - export import ZoneUpdateResponse = ZonesAPI.ZoneUpdateResponse; export import ZoneListResponse = ZonesAPI.ZoneListResponse; export import ZoneDeleteResponse = ZonesAPI.ZoneDeleteResponse; + export import ZoneEditResponse = ZonesAPI.ZoneEditResponse; export import ZoneGetResponse = ZonesAPI.ZoneGetResponse; export import ZoneListResponsesV4PagePaginationArray = ZonesAPI.ZoneListResponsesV4PagePaginationArray; export import ZoneCreateParams = ZonesAPI.ZoneCreateParams; - export import ZoneUpdateParams = ZonesAPI.ZoneUpdateParams; export import ZoneListParams = ZonesAPI.ZoneListParams; + export import ZoneEditParams = ZonesAPI.ZoneEditParams; export import Holds = HoldsAPI.Holds; export import HoldCreateResponse = HoldsAPI.HoldCreateResponse; export import HoldDeleteResponse = HoldsAPI.HoldDeleteResponse; diff --git a/tests/api-resources/access/applications/applications.test.ts b/tests/api-resources/access/applications/applications.test.ts index cd38dc14fd..893de62aaa 100644 --- a/tests/api-resources/access/applications/applications.test.ts +++ b/tests/api-resources/access/applications/applications.test.ts @@ -77,6 +77,73 @@ describe('resource applications', () => { ); }); + // skipped: tests are disabled for the time being + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.access.applications.update( + 'string', + '023e105f4ecef8ad9ca31a8372d0c353', + '023e105f4ecef8ad9ca31a8372d0c353', + { domain: 'test.example.com/admin', type: 'self_hosted' }, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('update: required and optional params', async () => { + const response = await cloudflare.access.applications.update( + 'string', + '023e105f4ecef8ad9ca31a8372d0c353', + '023e105f4ecef8ad9ca31a8372d0c353', + { + domain: 'test.example.com/admin', + type: 'self_hosted', + allow_authenticate_via_warp: true, + allowed_idps: [ + '699d98642c564d2e855e9661899b7252', + '699d98642c564d2e855e9661899b7252', + '699d98642c564d2e855e9661899b7252', + ], + app_launcher_visible: true, + auto_redirect_to_identity: true, + cors_headers: { + allow_all_headers: true, + allow_all_methods: true, + allow_all_origins: true, + allow_credentials: true, + allowed_headers: [{}, {}, {}], + allowed_methods: ['GET'], + allowed_origins: ['https://example.com'], + max_age: -1, + }, + custom_deny_message: 'string', + custom_deny_url: 'string', + custom_non_identity_deny_url: 'string', + custom_pages: [ + '699d98642c564d2e855e9661899b7252', + '699d98642c564d2e855e9661899b7252', + '699d98642c564d2e855e9661899b7252', + ], + enable_binding_cookie: true, + http_only_cookie_attribute: true, + logo_url: 'https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg', + name: 'Admin Site', + path_cookie_attribute: true, + same_site_cookie_attribute: 'strict', + self_hosted_domains: ['test.example.com/admin', 'test.anotherexample.com/staff'], + service_auth_401_redirect: true, + session_duration: '24h', + skip_interstitial: true, + tags: ['engineers', 'engineers', 'engineers'], + }, + ); + }); + // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.access.applications.list('string', '023e105f4ecef8ad9ca31a8372d0c353'); @@ -157,73 +224,6 @@ describe('resource applications', () => { ).rejects.toThrow(Cloudflare.NotFoundError); }); - // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.access.applications.replace( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - '023e105f4ecef8ad9ca31a8372d0c353', - { domain: 'test.example.com/admin', type: 'self_hosted' }, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.access.applications.replace( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - '023e105f4ecef8ad9ca31a8372d0c353', - { - domain: 'test.example.com/admin', - type: 'self_hosted', - allow_authenticate_via_warp: true, - allowed_idps: [ - '699d98642c564d2e855e9661899b7252', - '699d98642c564d2e855e9661899b7252', - '699d98642c564d2e855e9661899b7252', - ], - app_launcher_visible: true, - auto_redirect_to_identity: true, - cors_headers: { - allow_all_headers: true, - allow_all_methods: true, - allow_all_origins: true, - allow_credentials: true, - allowed_headers: [{}, {}, {}], - allowed_methods: ['GET'], - allowed_origins: ['https://example.com'], - max_age: -1, - }, - custom_deny_message: 'string', - custom_deny_url: 'string', - custom_non_identity_deny_url: 'string', - custom_pages: [ - '699d98642c564d2e855e9661899b7252', - '699d98642c564d2e855e9661899b7252', - '699d98642c564d2e855e9661899b7252', - ], - enable_binding_cookie: true, - http_only_cookie_attribute: true, - logo_url: 'https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg', - name: 'Admin Site', - path_cookie_attribute: true, - same_site_cookie_attribute: 'strict', - self_hosted_domains: ['test.example.com/admin', 'test.anotherexample.com/staff'], - service_auth_401_redirect: true, - session_duration: '24h', - skip_interstitial: true, - tags: ['engineers', 'engineers', 'engineers'], - }, - ); - }); - // skipped: tests are disabled for the time being test.skip('revokeTokens', async () => { const responsePromise = cloudflare.access.applications.revokeTokens( diff --git a/tests/api-resources/access/applications/policies.test.ts b/tests/api-resources/access/applications/policies.test.ts index cdc6ad5d27..d2b775a677 100644 --- a/tests/api-resources/access/applications/policies.test.ts +++ b/tests/api-resources/access/applications/policies.test.ts @@ -83,6 +83,79 @@ describe('resource policies', () => { ); }); + // skipped: tests are disabled for the time being + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.access.applications.policies.update( + 'string', + '023e105f4ecef8ad9ca31a8372d0c353', + 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + { + decision: 'allow', + include: [ + { email: { email: 'test@example.com' } }, + { email: { email: 'test@example.com' } }, + { email: { email: 'test@example.com' } }, + ], + name: 'Allow devs', + }, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('update: required and optional params', async () => { + const response = await cloudflare.access.applications.policies.update( + 'string', + '023e105f4ecef8ad9ca31a8372d0c353', + 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + { + decision: 'allow', + include: [ + { email: { email: 'test@example.com' } }, + { email: { email: 'test@example.com' } }, + { email: { email: 'test@example.com' } }, + ], + name: 'Allow devs', + approval_groups: [ + { + approvals_needed: 1, + email_addresses: ['test1@cloudflare.com', 'test2@cloudflare.com'], + email_list_uuid: 'string', + }, + { + approvals_needed: 3, + email_addresses: ['test@cloudflare.com', 'test2@cloudflare.com'], + email_list_uuid: '597147a1-976b-4ef2-9af0-81d5d007fc34', + }, + ], + approval_required: true, + exclude: [ + { email: { email: 'test@example.com' } }, + { email: { email: 'test@example.com' } }, + { email: { email: 'test@example.com' } }, + ], + isolation_required: false, + precedence: 0, + purpose_justification_prompt: 'Please enter a justification for entering this protected domain.', + purpose_justification_required: true, + require: [ + { email: { email: 'test@example.com' } }, + { email: { email: 'test@example.com' } }, + { email: { email: 'test@example.com' } }, + ], + session_duration: '24h', + }, + ); + }); + // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.access.applications.policies.list( @@ -173,77 +246,4 @@ describe('resource policies', () => { ), ).rejects.toThrow(Cloudflare.NotFoundError); }); - - // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.access.applications.policies.replace( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', - 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', - { - decision: 'allow', - include: [ - { email: { email: 'test@example.com' } }, - { email: { email: 'test@example.com' } }, - { email: { email: 'test@example.com' } }, - ], - name: 'Allow devs', - }, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.access.applications.policies.replace( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', - 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', - { - decision: 'allow', - include: [ - { email: { email: 'test@example.com' } }, - { email: { email: 'test@example.com' } }, - { email: { email: 'test@example.com' } }, - ], - name: 'Allow devs', - approval_groups: [ - { - approvals_needed: 1, - email_addresses: ['test1@cloudflare.com', 'test2@cloudflare.com'], - email_list_uuid: 'string', - }, - { - approvals_needed: 3, - email_addresses: ['test@cloudflare.com', 'test2@cloudflare.com'], - email_list_uuid: '597147a1-976b-4ef2-9af0-81d5d007fc34', - }, - ], - approval_required: true, - exclude: [ - { email: { email: 'test@example.com' } }, - { email: { email: 'test@example.com' } }, - { email: { email: 'test@example.com' } }, - ], - isolation_required: false, - precedence: 0, - purpose_justification_prompt: 'Please enter a justification for entering this protected domain.', - purpose_justification_required: true, - require: [ - { email: { email: 'test@example.com' } }, - { email: { email: 'test@example.com' } }, - { email: { email: 'test@example.com' } }, - ], - session_duration: '24h', - }, - ); - }); }); diff --git a/tests/api-resources/access/bookmarks.test.ts b/tests/api-resources/access/bookmarks.test.ts index c82bac313a..fbcec33675 100644 --- a/tests/api-resources/access/bookmarks.test.ts +++ b/tests/api-resources/access/bookmarks.test.ts @@ -12,6 +12,21 @@ const cloudflare = new Cloudflare({ }); describe('resource bookmarks', () => { + // skipped: tests are disabled for the time being + test.skip('update', async () => { + const responsePromise = cloudflare.access.bookmarks.update( + '699d98642c564d2e855e9661899b7252', + 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.access.bookmarks.list('699d98642c564d2e855e9661899b7252'); @@ -75,19 +90,4 @@ describe('resource bookmarks', () => { ), ).rejects.toThrow(Cloudflare.NotFoundError); }); - - // skipped: tests are disabled for the time being - test.skip('replace', async () => { - const responsePromise = cloudflare.access.bookmarks.replace( - '699d98642c564d2e855e9661899b7252', - 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); }); diff --git a/tests/api-resources/access/certificates/certificates.test.ts b/tests/api-resources/access/certificates/certificates.test.ts index 5b52850dcb..817ac66ece 100644 --- a/tests/api-resources/access/certificates/certificates.test.ts +++ b/tests/api-resources/access/certificates/certificates.test.ts @@ -46,6 +46,36 @@ describe('resource certificates', () => { ); }); + // skipped: tests are disabled for the time being + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.access.certificates.update( + 'string', + '023e105f4ecef8ad9ca31a8372d0c353', + 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + { associated_hostnames: ['admin.example.com', 'admin.example.com', 'admin.example.com'] }, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('update: required and optional params', async () => { + const response = await cloudflare.access.certificates.update( + 'string', + '023e105f4ecef8ad9ca31a8372d0c353', + 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + { + associated_hostnames: ['admin.example.com', 'admin.example.com', 'admin.example.com'], + name: 'Allow devs', + }, + ); + }); + // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.access.certificates.list('string', '023e105f4ecef8ad9ca31a8372d0c353'); @@ -125,34 +155,4 @@ describe('resource certificates', () => { ), ).rejects.toThrow(Cloudflare.NotFoundError); }); - - // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.access.certificates.replace( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', - { associated_hostnames: ['admin.example.com', 'admin.example.com', 'admin.example.com'] }, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.access.certificates.replace( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', - { - associated_hostnames: ['admin.example.com', 'admin.example.com', 'admin.example.com'], - name: 'Allow devs', - }, - ); - }); }); diff --git a/tests/api-resources/access/certificates/settings.test.ts b/tests/api-resources/access/certificates/settings.test.ts index dfa870e82a..ae98a9ee86 100644 --- a/tests/api-resources/access/certificates/settings.test.ts +++ b/tests/api-resources/access/certificates/settings.test.ts @@ -13,10 +13,17 @@ const cloudflare = new Cloudflare({ describe('resource settings', () => { // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.access.certificates.settings.list( + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.access.certificates.settings.update( 'string', '023e105f4ecef8ad9ca31a8372d0c353', + { + settings: [ + { china_network: false, client_certificate_forwarding: true, hostname: 'admin.example.com' }, + { china_network: false, client_certificate_forwarding: true, hostname: 'admin.example.com' }, + { china_network: false, client_certificate_forwarding: true, hostname: 'admin.example.com' }, + ], + }, ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -28,18 +35,8 @@ describe('resource settings', () => { }); // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.access.certificates.settings.list('string', '023e105f4ecef8ad9ca31a8372d0c353', { - path: '/_stainless_unknown_path', - }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.access.certificates.settings.replace( + test.skip('update: required and optional params', async () => { + const response = await cloudflare.access.certificates.settings.update( 'string', '023e105f4ecef8ad9ca31a8372d0c353', { @@ -50,6 +47,14 @@ describe('resource settings', () => { ], }, ); + }); + + // skipped: tests are disabled for the time being + test.skip('list', async () => { + const responsePromise = cloudflare.access.certificates.settings.list( + 'string', + '023e105f4ecef8ad9ca31a8372d0c353', + ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -60,17 +65,12 @@ describe('resource settings', () => { }); // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.access.certificates.settings.replace( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - { - settings: [ - { china_network: false, client_certificate_forwarding: true, hostname: 'admin.example.com' }, - { china_network: false, client_certificate_forwarding: true, hostname: 'admin.example.com' }, - { china_network: false, client_certificate_forwarding: true, hostname: 'admin.example.com' }, - ], - }, - ); + test.skip('list: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.access.certificates.settings.list('string', '023e105f4ecef8ad9ca31a8372d0c353', { + path: '/_stainless_unknown_path', + }), + ).rejects.toThrow(Cloudflare.NotFoundError); }); }); diff --git a/tests/api-resources/access/custom-pages.test.ts b/tests/api-resources/access/custom-pages.test.ts index 9ecf362b28..4926b9fe33 100644 --- a/tests/api-resources/access/custom-pages.test.ts +++ b/tests/api-resources/access/custom-pages.test.ts @@ -38,6 +38,40 @@ describe('resource customPages', () => { }); }); + // skipped: tests are disabled for the time being + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.access.customPages.update( + '023e105f4ecef8ad9ca31a8372d0c353', + 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + { + custom_html: '

Access Denied

', + name: 'string', + type: 'identity_denied', + }, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('update: required and optional params', async () => { + const response = await cloudflare.access.customPages.update( + '023e105f4ecef8ad9ca31a8372d0c353', + 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + { + custom_html: '

Access Denied

', + name: 'string', + type: 'identity_denied', + app_count: 0, + }, + ); + }); + // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.access.customPages.list('023e105f4ecef8ad9ca31a8372d0c353'); @@ -113,38 +147,4 @@ describe('resource customPages', () => { ), ).rejects.toThrow(Cloudflare.NotFoundError); }); - - // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.access.customPages.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', - { - custom_html: '

Access Denied

', - name: 'string', - type: 'identity_denied', - }, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.access.customPages.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', - { - custom_html: '

Access Denied

', - name: 'string', - type: 'identity_denied', - app_count: 0, - }, - ); - }); }); diff --git a/tests/api-resources/access/groups.test.ts b/tests/api-resources/access/groups.test.ts index 7189dbfe3c..b287d87163 100644 --- a/tests/api-resources/access/groups.test.ts +++ b/tests/api-resources/access/groups.test.ts @@ -54,6 +54,58 @@ describe('resource groups', () => { }); }); + // skipped: tests are disabled for the time being + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.access.groups.update( + 'string', + '023e105f4ecef8ad9ca31a8372d0c353', + 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + { + include: [ + { email: { email: 'test@example.com' } }, + { email: { email: 'test@example.com' } }, + { email: { email: 'test@example.com' } }, + ], + name: 'Allow devs', + }, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('update: required and optional params', async () => { + const response = await cloudflare.access.groups.update( + 'string', + '023e105f4ecef8ad9ca31a8372d0c353', + 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + { + include: [ + { email: { email: 'test@example.com' } }, + { email: { email: 'test@example.com' } }, + { email: { email: 'test@example.com' } }, + ], + name: 'Allow devs', + exclude: [ + { email: { email: 'test@example.com' } }, + { email: { email: 'test@example.com' } }, + { email: { email: 'test@example.com' } }, + ], + is_default: true, + require: [ + { email: { email: 'test@example.com' } }, + { email: { email: 'test@example.com' } }, + { email: { email: 'test@example.com' } }, + ], + }, + ); + }); + // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.access.groups.list('string', '023e105f4ecef8ad9ca31a8372d0c353'); @@ -133,56 +185,4 @@ describe('resource groups', () => { ), ).rejects.toThrow(Cloudflare.NotFoundError); }); - - // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.access.groups.replace( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', - { - include: [ - { email: { email: 'test@example.com' } }, - { email: { email: 'test@example.com' } }, - { email: { email: 'test@example.com' } }, - ], - name: 'Allow devs', - }, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.access.groups.replace( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', - { - include: [ - { email: { email: 'test@example.com' } }, - { email: { email: 'test@example.com' } }, - { email: { email: 'test@example.com' } }, - ], - name: 'Allow devs', - exclude: [ - { email: { email: 'test@example.com' } }, - { email: { email: 'test@example.com' } }, - { email: { email: 'test@example.com' } }, - ], - is_default: true, - require: [ - { email: { email: 'test@example.com' } }, - { email: { email: 'test@example.com' } }, - { email: { email: 'test@example.com' } }, - ], - }, - ); - }); }); diff --git a/tests/api-resources/access/identity-providers.test.ts b/tests/api-resources/access/identity-providers.test.ts index 5b1cec655f..00d59dda49 100644 --- a/tests/api-resources/access/identity-providers.test.ts +++ b/tests/api-resources/access/identity-providers.test.ts @@ -56,6 +56,52 @@ describe('resource identityProviders', () => { ); }); + // skipped: tests are disabled for the time being + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.access.identityProviders.update( + 'string', + '023e105f4ecef8ad9ca31a8372d0c353', + 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + { config: {}, name: 'Widget Corps IDP', type: 'onetimepin' }, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('update: required and optional params', async () => { + const response = await cloudflare.access.identityProviders.update( + 'string', + '023e105f4ecef8ad9ca31a8372d0c353', + 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + { + config: { + client_id: '', + client_secret: '', + claims: ['email_verified', 'preferred_username', 'custom_claim_name'], + email_claim_name: 'custom_claim_name', + conditional_access_enabled: true, + directory_id: '', + support_groups: true, + }, + name: 'Widget Corps IDP', + type: 'onetimepin', + scim_config: { + enabled: true, + group_member_deprovision: true, + seat_deprovision: true, + secret: 'string', + user_deprovision: true, + }, + }, + ); + }); + // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.access.identityProviders.list( @@ -138,50 +184,4 @@ describe('resource identityProviders', () => { ), ).rejects.toThrow(Cloudflare.NotFoundError); }); - - // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.access.identityProviders.replace( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', - { config: {}, name: 'Widget Corps IDP', type: 'onetimepin' }, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.access.identityProviders.replace( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', - { - config: { - client_id: '', - client_secret: '', - claims: ['email_verified', 'preferred_username', 'custom_claim_name'], - email_claim_name: 'custom_claim_name', - conditional_access_enabled: true, - directory_id: '', - support_groups: true, - }, - name: 'Widget Corps IDP', - type: 'onetimepin', - scim_config: { - enabled: true, - group_member_deprovision: true, - seat_deprovision: true, - secret: 'string', - user_deprovision: true, - }, - }, - ); - }); }); diff --git a/tests/api-resources/access/keys.test.ts b/tests/api-resources/access/keys.test.ts index 1b7a192ea8..1ccbcc5ffb 100644 --- a/tests/api-resources/access/keys.test.ts +++ b/tests/api-resources/access/keys.test.ts @@ -13,8 +13,10 @@ const cloudflare = new Cloudflare({ describe('resource keys', () => { // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.access.keys.list('023e105f4ecef8ad9ca31a8372d0c353'); + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.access.keys.update('023e105f4ecef8ad9ca31a8372d0c353', { + key_rotation_interval_days: 30, + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -25,18 +27,15 @@ describe('resource keys', () => { }); // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.access.keys.list('023e105f4ecef8ad9ca31a8372d0c353', { path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); + test.skip('update: required and optional params', async () => { + const response = await cloudflare.access.keys.update('023e105f4ecef8ad9ca31a8372d0c353', { + key_rotation_interval_days: 30, + }); }); // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.access.keys.replace('023e105f4ecef8ad9ca31a8372d0c353', { - key_rotation_interval_days: 30, - }); + test.skip('list', async () => { + const responsePromise = cloudflare.access.keys.list('023e105f4ecef8ad9ca31a8372d0c353'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -47,10 +46,11 @@ describe('resource keys', () => { }); // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.access.keys.replace('023e105f4ecef8ad9ca31a8372d0c353', { - key_rotation_interval_days: 30, - }); + test.skip('list: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.access.keys.list('023e105f4ecef8ad9ca31a8372d0c353', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); }); // skipped: tests are disabled for the time being diff --git a/tests/api-resources/access/organizations.test.ts b/tests/api-resources/access/organizations.test.ts index 279ee94d23..0ec09010c8 100644 --- a/tests/api-resources/access/organizations.test.ts +++ b/tests/api-resources/access/organizations.test.ts @@ -55,10 +55,11 @@ describe('resource organizations', () => { }); // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.access.organizations.list( + test.skip('update', async () => { + const responsePromise = cloudflare.access.organizations.update( 'string', '023e105f4ecef8ad9ca31a8372d0c353', + {}, ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -70,21 +71,10 @@ describe('resource organizations', () => { }); // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.access.organizations.list('string', '023e105f4ecef8ad9ca31a8372d0c353', { - path: '/_stainless_unknown_path', - }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - // skipped: tests are disabled for the time being - test.skip('replace', async () => { - const responsePromise = cloudflare.access.organizations.replace( + test.skip('list', async () => { + const responsePromise = cloudflare.access.organizations.list( 'string', '023e105f4ecef8ad9ca31a8372d0c353', - {}, ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -95,6 +85,16 @@ describe('resource organizations', () => { expect(dataAndResponse.response).toBe(rawResponse); }); + // skipped: tests are disabled for the time being + test.skip('list: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.access.organizations.list('string', '023e105f4ecef8ad9ca31a8372d0c353', { + path: '/_stainless_unknown_path', + }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + // skipped: tests are disabled for the time being test.skip('revokeUsers: only required params', async () => { const responsePromise = cloudflare.access.organizations.revokeUsers( diff --git a/tests/api-resources/access/seats.test.ts b/tests/api-resources/access/seats.test.ts index 064244455b..bda2b01163 100644 --- a/tests/api-resources/access/seats.test.ts +++ b/tests/api-resources/access/seats.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource seats', () => { // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.access.seats.update('023e105f4ecef8ad9ca31a8372d0c353', [ + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.access.seats.edit('023e105f4ecef8ad9ca31a8372d0c353', [ { access_seat: false, gateway_seat: false }, { access_seat: false, gateway_seat: false }, { access_seat: false, gateway_seat: false }, @@ -29,8 +29,8 @@ describe('resource seats', () => { }); // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.access.seats.update('023e105f4ecef8ad9ca31a8372d0c353', [ + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.access.seats.edit('023e105f4ecef8ad9ca31a8372d0c353', [ { access_seat: false, gateway_seat: false }, { access_seat: false, gateway_seat: false }, { access_seat: false, gateway_seat: false }, diff --git a/tests/api-resources/access/service-tokens.test.ts b/tests/api-resources/access/service-tokens.test.ts index d0b8033e02..0a00495114 100644 --- a/tests/api-resources/access/service-tokens.test.ts +++ b/tests/api-resources/access/service-tokens.test.ts @@ -37,6 +37,23 @@ describe('resource serviceTokens', () => { ); }); + // skipped: tests are disabled for the time being + test.skip('update', async () => { + const responsePromise = cloudflare.access.serviceTokens.update( + 'string', + '023e105f4ecef8ad9ca31a8372d0c353', + 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + {}, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.access.serviceTokens.list( @@ -118,23 +135,6 @@ describe('resource serviceTokens', () => { ).rejects.toThrow(Cloudflare.NotFoundError); }); - // skipped: tests are disabled for the time being - test.skip('replace', async () => { - const responsePromise = cloudflare.access.serviceTokens.replace( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', - {}, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - // skipped: tests are disabled for the time being test.skip('rotate', async () => { const responsePromise = cloudflare.access.serviceTokens.rotate( diff --git a/tests/api-resources/access/tags.test.ts b/tests/api-resources/access/tags.test.ts index 6007ad2a6e..1358c56fe6 100644 --- a/tests/api-resources/access/tags.test.ts +++ b/tests/api-resources/access/tags.test.ts @@ -33,6 +33,27 @@ describe('resource tags', () => { }); }); + // skipped: tests are disabled for the time being + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.access.tags.update('023e105f4ecef8ad9ca31a8372d0c353', 'engineers', { + name: 'engineers', + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('update: required and optional params', async () => { + const response = await cloudflare.access.tags.update('023e105f4ecef8ad9ca31a8372d0c353', 'engineers', { + name: 'engineers', + }); + }); + // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.access.tags.list('023e105f4ecef8ad9ca31a8372d0c353'); @@ -96,25 +117,4 @@ describe('resource tags', () => { }), ).rejects.toThrow(Cloudflare.NotFoundError); }); - - // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.access.tags.replace('023e105f4ecef8ad9ca31a8372d0c353', 'engineers', { - name: 'engineers', - }); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.access.tags.replace('023e105f4ecef8ad9ca31a8372d0c353', 'engineers', { - name: 'engineers', - }); - }); }); diff --git a/tests/api-resources/account-members.test.ts b/tests/api-resources/account-members.test.ts index 0b8665513c..d9fdcb52a1 100644 --- a/tests/api-resources/account-members.test.ts +++ b/tests/api-resources/account-members.test.ts @@ -50,6 +50,35 @@ describe('resource accountMembers', () => { ); }); + // skipped: tests are disabled for the time being + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.accountMembers.update({}, '4536bcfad5faccb111b47003c79917fa', { + roles: [ + { id: '3536bcfad5faccb999b47003c79917fb' }, + { id: '3536bcfad5faccb999b47003c79917fb' }, + { id: '3536bcfad5faccb999b47003c79917fb' }, + ], + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('update: required and optional params', async () => { + const response = await cloudflare.accountMembers.update({}, '4536bcfad5faccb111b47003c79917fa', { + roles: [ + { id: '3536bcfad5faccb999b47003c79917fb' }, + { id: '3536bcfad5faccb999b47003c79917fb' }, + { id: '3536bcfad5faccb999b47003c79917fb' }, + ], + }); + }); + // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.accountMembers.list({}); @@ -115,33 +144,4 @@ describe('resource accountMembers', () => { }), ).rejects.toThrow(Cloudflare.NotFoundError); }); - - // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.accountMembers.replace({}, '4536bcfad5faccb111b47003c79917fa', { - roles: [ - { id: '3536bcfad5faccb999b47003c79917fb' }, - { id: '3536bcfad5faccb999b47003c79917fb' }, - { id: '3536bcfad5faccb999b47003c79917fb' }, - ], - }); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.accountMembers.replace({}, '4536bcfad5faccb111b47003c79917fa', { - roles: [ - { id: '3536bcfad5faccb999b47003c79917fb' }, - { id: '3536bcfad5faccb999b47003c79917fb' }, - { id: '3536bcfad5faccb999b47003c79917fb' }, - ], - }); - }); }); diff --git a/tests/api-resources/accounts.test.ts b/tests/api-resources/accounts.test.ts index 5ebdd00c90..1c5afb32f1 100644 --- a/tests/api-resources/accounts.test.ts +++ b/tests/api-resources/accounts.test.ts @@ -12,6 +12,33 @@ const cloudflare = new Cloudflare({ }); describe('resource accounts', () => { + // skipped: tests are disabled for the time being + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.accounts.update({}, { name: 'Demo Account' }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('update: required and optional params', async () => { + const response = await cloudflare.accounts.update( + {}, + { + name: 'Demo Account', + settings: { + default_nameservers: 'cloudflare.standard', + enforce_twofactor: true, + use_account_custom_ns_by_default: true, + }, + }, + ); + }); + // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.accounts.list(); @@ -62,31 +89,4 @@ describe('resource accounts', () => { Cloudflare.NotFoundError, ); }); - - // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.accounts.replace({}, { name: 'Demo Account' }); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.accounts.replace( - {}, - { - name: 'Demo Account', - settings: { - default_nameservers: 'cloudflare.standard', - enforce_twofactor: true, - use_account_custom_ns_by_default: true, - }, - }, - ); - }); }); diff --git a/tests/api-resources/activation-checks.test.ts b/tests/api-resources/activation-checks.test.ts index 0a1445295b..8fde3ecd31 100644 --- a/tests/api-resources/activation-checks.test.ts +++ b/tests/api-resources/activation-checks.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource activationChecks', () => { // skipped: tests are disabled for the time being - test.skip('replace', async () => { - const responsePromise = cloudflare.activationChecks.replace('023e105f4ecef8ad9ca31a8372d0c353'); + test.skip('update', async () => { + const responsePromise = cloudflare.activationChecks.update('023e105f4ecef8ad9ca31a8372d0c353'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -25,10 +25,10 @@ describe('resource activationChecks', () => { }); // skipped: tests are disabled for the time being - test.skip('replace: request options instead of params are passed correctly', async () => { + test.skip('update: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - cloudflare.activationChecks.replace('023e105f4ecef8ad9ca31a8372d0c353', { + cloudflare.activationChecks.update('023e105f4ecef8ad9ca31a8372d0c353', { path: '/_stainless_unknown_path', }), ).rejects.toThrow(Cloudflare.NotFoundError); diff --git a/tests/api-resources/addresses/address-maps/accounts.test.ts b/tests/api-resources/addresses/address-maps/accounts.test.ts index b0b81b9fa8..ba0d890e52 100644 --- a/tests/api-resources/addresses/address-maps/accounts.test.ts +++ b/tests/api-resources/addresses/address-maps/accounts.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource accounts', () => { // skipped: tests are disabled for the time being - test.skip('delete', async () => { - const responsePromise = cloudflare.addresses.addressMaps.accounts.delete( + test.skip('update', async () => { + const responsePromise = cloudflare.addresses.addressMaps.accounts.update( '023e105f4ecef8ad9ca31a8372d0c353', '023e105f4ecef8ad9ca31a8372d0c353', ); @@ -28,8 +28,8 @@ describe('resource accounts', () => { }); // skipped: tests are disabled for the time being - test.skip('replace', async () => { - const responsePromise = cloudflare.addresses.addressMaps.accounts.replace( + test.skip('delete', async () => { + const responsePromise = cloudflare.addresses.addressMaps.accounts.delete( '023e105f4ecef8ad9ca31a8372d0c353', '023e105f4ecef8ad9ca31a8372d0c353', ); diff --git a/tests/api-resources/addresses/address-maps/address-maps.test.ts b/tests/api-resources/addresses/address-maps/address-maps.test.ts index 6352f7c582..3d6610e759 100644 --- a/tests/api-resources/addresses/address-maps/address-maps.test.ts +++ b/tests/api-resources/addresses/address-maps/address-maps.test.ts @@ -24,22 +24,6 @@ describe('resource addressMaps', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being - test.skip('update', async () => { - const responsePromise = cloudflare.addresses.addressMaps.update( - '023e105f4ecef8ad9ca31a8372d0c353', - '023e105f4ecef8ad9ca31a8372d0c353', - {}, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.addresses.addressMaps.list('023e105f4ecef8ad9ca31a8372d0c353'); @@ -77,6 +61,22 @@ describe('resource addressMaps', () => { expect(dataAndResponse.response).toBe(rawResponse); }); + // skipped: tests are disabled for the time being + test.skip('edit', async () => { + const responsePromise = cloudflare.addresses.addressMaps.edit( + '023e105f4ecef8ad9ca31a8372d0c353', + '023e105f4ecef8ad9ca31a8372d0c353', + {}, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + // skipped: tests are disabled for the time being test.skip('get', async () => { const responsePromise = cloudflare.addresses.addressMaps.get( diff --git a/tests/api-resources/addresses/address-maps/ips.test.ts b/tests/api-resources/addresses/address-maps/ips.test.ts index a659787507..624e75d216 100644 --- a/tests/api-resources/addresses/address-maps/ips.test.ts +++ b/tests/api-resources/addresses/address-maps/ips.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource ips', () => { // skipped: tests are disabled for the time being - test.skip('delete', async () => { - const responsePromise = cloudflare.addresses.addressMaps.ips.delete( + test.skip('update', async () => { + const responsePromise = cloudflare.addresses.addressMaps.ips.update( '023e105f4ecef8ad9ca31a8372d0c353', '023e105f4ecef8ad9ca31a8372d0c353', '192.0.2.1', @@ -29,8 +29,8 @@ describe('resource ips', () => { }); // skipped: tests are disabled for the time being - test.skip('replace', async () => { - const responsePromise = cloudflare.addresses.addressMaps.ips.replace( + test.skip('delete', async () => { + const responsePromise = cloudflare.addresses.addressMaps.ips.delete( '023e105f4ecef8ad9ca31a8372d0c353', '023e105f4ecef8ad9ca31a8372d0c353', '192.0.2.1', diff --git a/tests/api-resources/addresses/address-maps/zones.test.ts b/tests/api-resources/addresses/address-maps/zones.test.ts index fc33e30d6d..9fa055157f 100644 --- a/tests/api-resources/addresses/address-maps/zones.test.ts +++ b/tests/api-resources/addresses/address-maps/zones.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource zones', () => { // skipped: tests are disabled for the time being - test.skip('delete', async () => { - const responsePromise = cloudflare.addresses.addressMaps.zones.delete( + test.skip('update', async () => { + const responsePromise = cloudflare.addresses.addressMaps.zones.update( '023e105f4ecef8ad9ca31a8372d0c353', '023e105f4ecef8ad9ca31a8372d0c353', '023e105f4ecef8ad9ca31a8372d0c353', @@ -29,8 +29,8 @@ describe('resource zones', () => { }); // skipped: tests are disabled for the time being - test.skip('replace', async () => { - const responsePromise = cloudflare.addresses.addressMaps.zones.replace( + test.skip('delete', async () => { + const responsePromise = cloudflare.addresses.addressMaps.zones.delete( '023e105f4ecef8ad9ca31a8372d0c353', '023e105f4ecef8ad9ca31a8372d0c353', '023e105f4ecef8ad9ca31a8372d0c353', diff --git a/tests/api-resources/addresses/prefixes/bgps/statuses.test.ts b/tests/api-resources/addresses/prefixes/bgps/statuses.test.ts index 6f0be2a344..d64c4f52c7 100644 --- a/tests/api-resources/addresses/prefixes/bgps/statuses.test.ts +++ b/tests/api-resources/addresses/prefixes/bgps/statuses.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource statuses', () => { // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.addresses.prefixes.bgps.statuses.update( + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.addresses.prefixes.bgps.statuses.edit( '023e105f4ecef8ad9ca31a8372d0c353', '023e105f4ecef8ad9ca31a8372d0c353', { advertised: true }, @@ -29,8 +29,8 @@ describe('resource statuses', () => { }); // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.addresses.prefixes.bgps.statuses.update( + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.addresses.prefixes.bgps.statuses.edit( '023e105f4ecef8ad9ca31a8372d0c353', '023e105f4ecef8ad9ca31a8372d0c353', { advertised: true }, diff --git a/tests/api-resources/addresses/prefixes/prefixes.test.ts b/tests/api-resources/addresses/prefixes/prefixes.test.ts index 5b76e3955b..3820e963d3 100644 --- a/tests/api-resources/addresses/prefixes/prefixes.test.ts +++ b/tests/api-resources/addresses/prefixes/prefixes.test.ts @@ -37,31 +37,6 @@ describe('resource prefixes', () => { }); }); - // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.addresses.prefixes.update( - '023e105f4ecef8ad9ca31a8372d0c353', - '023e105f4ecef8ad9ca31a8372d0c353', - { description: 'Internal test prefix' }, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.addresses.prefixes.update( - '023e105f4ecef8ad9ca31a8372d0c353', - '023e105f4ecef8ad9ca31a8372d0c353', - { description: 'Internal test prefix' }, - ); - }); - // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.addresses.prefixes.list('023e105f4ecef8ad9ca31a8372d0c353'); @@ -99,6 +74,31 @@ describe('resource prefixes', () => { expect(dataAndResponse.response).toBe(rawResponse); }); + // skipped: tests are disabled for the time being + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.addresses.prefixes.edit( + '023e105f4ecef8ad9ca31a8372d0c353', + '023e105f4ecef8ad9ca31a8372d0c353', + { description: 'Internal test prefix' }, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.addresses.prefixes.edit( + '023e105f4ecef8ad9ca31a8372d0c353', + '023e105f4ecef8ad9ca31a8372d0c353', + { description: 'Internal test prefix' }, + ); + }); + // skipped: tests are disabled for the time being test.skip('get', async () => { const responsePromise = cloudflare.addresses.prefixes.get( diff --git a/tests/api-resources/addressing/prefixes/bgp-prefixes.test.ts b/tests/api-resources/addressing/prefixes/bgp-prefixes.test.ts index 1f1705fcfa..bd35c7bf5b 100644 --- a/tests/api-resources/addressing/prefixes/bgp-prefixes.test.ts +++ b/tests/api-resources/addressing/prefixes/bgp-prefixes.test.ts @@ -12,23 +12,6 @@ const cloudflare = new Cloudflare({ }); describe('resource bgpPrefixes', () => { - // skipped: tests are disabled for the time being - test.skip('update', async () => { - const responsePromise = cloudflare.addressing.prefixes.bgpPrefixes.update( - '023e105f4ecef8ad9ca31a8372d0c353', - '023e105f4ecef8ad9ca31a8372d0c353', - '023e105f4ecef8ad9ca31a8372d0c353', - {}, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.addressing.prefixes.bgpPrefixes.list( @@ -56,6 +39,23 @@ describe('resource bgpPrefixes', () => { ).rejects.toThrow(Cloudflare.NotFoundError); }); + // skipped: tests are disabled for the time being + test.skip('edit', async () => { + const responsePromise = cloudflare.addressing.prefixes.bgpPrefixes.edit( + '023e105f4ecef8ad9ca31a8372d0c353', + '023e105f4ecef8ad9ca31a8372d0c353', + '023e105f4ecef8ad9ca31a8372d0c353', + {}, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + // skipped: tests are disabled for the time being test.skip('get', async () => { const responsePromise = cloudflare.addressing.prefixes.bgpPrefixes.get( diff --git a/tests/api-resources/alerting/v3/destinations/webhooks.test.ts b/tests/api-resources/alerting/v3/destinations/webhooks.test.ts index 915984d769..26e5306376 100644 --- a/tests/api-resources/alerting/v3/destinations/webhooks.test.ts +++ b/tests/api-resources/alerting/v3/destinations/webhooks.test.ts @@ -39,6 +39,35 @@ describe('resource webhooks', () => { ); }); + // skipped: tests are disabled for the time being + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.alerting.v3.destinations.webhooks.update( + '023e105f4ecef8ad9ca31a8372d0c353', + 'b115d5ec-15c6-41ee-8b76-92c449b5227b', + { name: 'Slack Webhook', url: 'https://hooks.slack.com/services/Ds3fdBFbV/456464Gdd' }, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('update: required and optional params', async () => { + const response = await cloudflare.alerting.v3.destinations.webhooks.update( + '023e105f4ecef8ad9ca31a8372d0c353', + 'b115d5ec-15c6-41ee-8b76-92c449b5227b', + { + name: 'Slack Webhook', + url: 'https://hooks.slack.com/services/Ds3fdBFbV/456464Gdd', + secret: 'string', + }, + ); + }); + // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.alerting.v3.destinations.webhooks.list( @@ -116,33 +145,4 @@ describe('resource webhooks', () => { ), ).rejects.toThrow(Cloudflare.NotFoundError); }); - - // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.alerting.v3.destinations.webhooks.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - 'b115d5ec-15c6-41ee-8b76-92c449b5227b', - { name: 'Slack Webhook', url: 'https://hooks.slack.com/services/Ds3fdBFbV/456464Gdd' }, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.alerting.v3.destinations.webhooks.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - 'b115d5ec-15c6-41ee-8b76-92c449b5227b', - { - name: 'Slack Webhook', - url: 'https://hooks.slack.com/services/Ds3fdBFbV/456464Gdd', - secret: 'string', - }, - ); - }); }); diff --git a/tests/api-resources/alerting/v3/policies.test.ts b/tests/api-resources/alerting/v3/policies.test.ts index b454880ee5..d5dce0f0a9 100644 --- a/tests/api-resources/alerting/v3/policies.test.ts +++ b/tests/api-resources/alerting/v3/policies.test.ts @@ -86,6 +86,22 @@ describe('resource policies', () => { }); }); + // skipped: tests are disabled for the time being + test.skip('update', async () => { + const responsePromise = cloudflare.alerting.v3.policies.update( + '023e105f4ecef8ad9ca31a8372d0c353', + '0da2b59e-f118-439d-8097-bdfb215203c9', + {}, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.alerting.v3.policies.list('023e105f4ecef8ad9ca31a8372d0c353'); @@ -161,20 +177,4 @@ describe('resource policies', () => { ), ).rejects.toThrow(Cloudflare.NotFoundError); }); - - // skipped: tests are disabled for the time being - test.skip('replace', async () => { - const responsePromise = cloudflare.alerting.v3.policies.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - '0da2b59e-f118-439d-8097-bdfb215203c9', - {}, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); }); diff --git a/tests/api-resources/argo/smart-routing.test.ts b/tests/api-resources/argo/smart-routing.test.ts index f96413aaee..e8f5400948 100644 --- a/tests/api-resources/argo/smart-routing.test.ts +++ b/tests/api-resources/argo/smart-routing.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource smartRouting', () => { // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.argo.smartRouting.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.argo.smartRouting.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: 'on', }); const rawResponse = await responsePromise.asResponse(); @@ -27,8 +27,8 @@ describe('resource smartRouting', () => { }); // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.argo.smartRouting.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.argo.smartRouting.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: 'on', }); }); diff --git a/tests/api-resources/argo/tiered-caching.test.ts b/tests/api-resources/argo/tiered-caching.test.ts index 4f2ef70e16..cff0fb85a8 100644 --- a/tests/api-resources/argo/tiered-caching.test.ts +++ b/tests/api-resources/argo/tiered-caching.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource tieredCaching', () => { // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.argo.tieredCaching.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.argo.tieredCaching.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: 'on', }); const rawResponse = await responsePromise.asResponse(); @@ -27,8 +27,8 @@ describe('resource tieredCaching', () => { }); // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.argo.tieredCaching.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.argo.tieredCaching.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: 'on', }); }); diff --git a/tests/api-resources/bot-management.test.ts b/tests/api-resources/bot-management.test.ts index 8a8da066e6..327a733abc 100644 --- a/tests/api-resources/bot-management.test.ts +++ b/tests/api-resources/bot-management.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource botManagement', () => { // skipped: tests are disabled for the time being - test.skip('get', async () => { - const responsePromise = cloudflare.botManagement.get('023e105f4ecef8ad9ca31a8372d0c353'); + test.skip('update', async () => { + const responsePromise = cloudflare.botManagement.update('023e105f4ecef8ad9ca31a8372d0c353', {}); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -25,16 +25,8 @@ describe('resource botManagement', () => { }); // skipped: tests are disabled for the time being - test.skip('get: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.botManagement.get('023e105f4ecef8ad9ca31a8372d0c353', { path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - // skipped: tests are disabled for the time being - test.skip('replace', async () => { - const responsePromise = cloudflare.botManagement.replace('023e105f4ecef8ad9ca31a8372d0c353', {}); + test.skip('get', async () => { + const responsePromise = cloudflare.botManagement.get('023e105f4ecef8ad9ca31a8372d0c353'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -43,4 +35,12 @@ describe('resource botManagement', () => { expect(dataAndResponse.data).toBe(response); expect(dataAndResponse.response).toBe(rawResponse); }); + + // skipped: tests are disabled for the time being + test.skip('get: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.botManagement.get('023e105f4ecef8ad9ca31a8372d0c353', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); }); diff --git a/tests/api-resources/cache/cache-reserves.test.ts b/tests/api-resources/cache/cache-reserves.test.ts index bead9a92a9..ff438a695e 100644 --- a/tests/api-resources/cache/cache-reserves.test.ts +++ b/tests/api-resources/cache/cache-reserves.test.ts @@ -13,10 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource cacheReserves', () => { // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.cache.cacheReserves.update('023e105f4ecef8ad9ca31a8372d0c353', { - value: 'on', - }); + test.skip('list', async () => { + const responsePromise = cloudflare.cache.cacheReserves.list('023e105f4ecef8ad9ca31a8372d0c353'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -27,15 +25,20 @@ describe('resource cacheReserves', () => { }); // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.cache.cacheReserves.update('023e105f4ecef8ad9ca31a8372d0c353', { - value: 'on', - }); + test.skip('list: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.cache.cacheReserves.list('023e105f4ecef8ad9ca31a8372d0c353', { + path: '/_stainless_unknown_path', + }), + ).rejects.toThrow(Cloudflare.NotFoundError); }); // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.cache.cacheReserves.list('023e105f4ecef8ad9ca31a8372d0c353'); + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.cache.cacheReserves.edit('023e105f4ecef8ad9ca31a8372d0c353', { + value: 'on', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -46,12 +49,9 @@ describe('resource cacheReserves', () => { }); // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.cache.cacheReserves.list('023e105f4ecef8ad9ca31a8372d0c353', { - path: '/_stainless_unknown_path', - }), - ).rejects.toThrow(Cloudflare.NotFoundError); + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.cache.cacheReserves.edit('023e105f4ecef8ad9ca31a8372d0c353', { + value: 'on', + }); }); }); diff --git a/tests/api-resources/cache/cache.test.ts b/tests/api-resources/cache/cache.test.ts new file mode 100644 index 0000000000..828786b36b --- /dev/null +++ b/tests/api-resources/cache/cache.test.ts @@ -0,0 +1,26 @@ +// File generated from our OpenAPI spec by Stainless. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const cloudflare = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'dev@cloudflare.com', + apiToken: 'Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY', + userServiceKey: 'My User Service Key', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource cache', () => { + // skipped: tests are disabled for the time being + test.skip('purge', async () => { + const responsePromise = cloudflare.cache.purge('string', {}); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); +}); diff --git a/tests/api-resources/cache/regional-tiered-cache.test.ts b/tests/api-resources/cache/regional-tiered-cache.test.ts index 191f4b7ad2..3947c87912 100644 --- a/tests/api-resources/cache/regional-tiered-cache.test.ts +++ b/tests/api-resources/cache/regional-tiered-cache.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource regionalTieredCache', () => { // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.cache.regionalTieredCache.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.cache.regionalTieredCache.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: 'on', }); const rawResponse = await responsePromise.asResponse(); @@ -27,8 +27,8 @@ describe('resource regionalTieredCache', () => { }); // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.cache.regionalTieredCache.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.cache.regionalTieredCache.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: 'on', }); }); diff --git a/tests/api-resources/cache/tiered-cache-smart-topology.test.ts b/tests/api-resources/cache/tiered-cache-smart-topology.test.ts index ba3a441533..bf650d18cf 100644 --- a/tests/api-resources/cache/tiered-cache-smart-topology.test.ts +++ b/tests/api-resources/cache/tiered-cache-smart-topology.test.ts @@ -13,10 +13,9 @@ const cloudflare = new Cloudflare({ describe('resource tieredCacheSmartTopology', () => { // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.cache.tieredCacheSmartTopology.update( + test.skip('delete', async () => { + const responsePromise = cloudflare.cache.tieredCacheSmartTopology.delete( '023e105f4ecef8ad9ca31a8372d0c353', - { value: 'on' }, ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -28,18 +27,11 @@ describe('resource tieredCacheSmartTopology', () => { }); // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.cache.tieredCacheSmartTopology.update( + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.cache.tieredCacheSmartTopology.edit( '023e105f4ecef8ad9ca31a8372d0c353', { value: 'on' }, ); - }); - - // skipped: tests are disabled for the time being - test.skip('delete', async () => { - const responsePromise = cloudflare.cache.tieredCacheSmartTopology.delete( - '023e105f4ecef8ad9ca31a8372d0c353', - ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -49,6 +41,14 @@ describe('resource tieredCacheSmartTopology', () => { expect(dataAndResponse.response).toBe(rawResponse); }); + // skipped: tests are disabled for the time being + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.cache.tieredCacheSmartTopology.edit( + '023e105f4ecef8ad9ca31a8372d0c353', + { value: 'on' }, + ); + }); + // skipped: tests are disabled for the time being test.skip('get', async () => { const responsePromise = cloudflare.cache.tieredCacheSmartTopology.get('023e105f4ecef8ad9ca31a8372d0c353'); diff --git a/tests/api-resources/cache/variants.test.ts b/tests/api-resources/cache/variants.test.ts index dbe302d1a6..f59e1662a2 100644 --- a/tests/api-resources/cache/variants.test.ts +++ b/tests/api-resources/cache/variants.test.ts @@ -12,39 +12,6 @@ const cloudflare = new Cloudflare({ }); describe('resource variants', () => { - // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.cache.variants.update('023e105f4ecef8ad9ca31a8372d0c353', { - value: {}, - }); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.cache.variants.update('023e105f4ecef8ad9ca31a8372d0c353', { - value: { - avif: ['image/webp', 'image/jpeg'], - bmp: ['image/webp', 'image/jpeg'], - gif: ['image/webp', 'image/jpeg'], - jp2: ['image/webp', 'image/avif'], - jpeg: ['image/webp', 'image/avif'], - jpg: ['image/webp', 'image/avif'], - jpg2: ['image/webp', 'image/avif'], - png: ['image/webp', 'image/avif'], - tif: ['image/webp', 'image/avif'], - tiff: ['image/webp', 'image/avif'], - webp: ['image/jpeg', 'image/avif'], - }, - }); - }); - // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.cache.variants.list('023e105f4ecef8ad9ca31a8372d0c353'); @@ -78,4 +45,35 @@ describe('resource variants', () => { expect(dataAndResponse.data).toBe(response); expect(dataAndResponse.response).toBe(rawResponse); }); + + // skipped: tests are disabled for the time being + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.cache.variants.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: {} }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.cache.variants.edit('023e105f4ecef8ad9ca31a8372d0c353', { + value: { + avif: ['image/webp', 'image/jpeg'], + bmp: ['image/webp', 'image/jpeg'], + gif: ['image/webp', 'image/jpeg'], + jp2: ['image/webp', 'image/avif'], + jpeg: ['image/webp', 'image/avif'], + jpg: ['image/webp', 'image/avif'], + jpg2: ['image/webp', 'image/avif'], + png: ['image/webp', 'image/avif'], + tif: ['image/webp', 'image/avif'], + tiff: ['image/webp', 'image/avif'], + webp: ['image/jpeg', 'image/avif'], + }, + }); + }); }); diff --git a/tests/api-resources/calls.test.ts b/tests/api-resources/calls.test.ts index a1e4f29e9c..512b468952 100644 --- a/tests/api-resources/calls.test.ts +++ b/tests/api-resources/calls.test.ts @@ -24,6 +24,22 @@ describe('resource calls', () => { expect(dataAndResponse.response).toBe(rawResponse); }); + // skipped: tests are disabled for the time being + test.skip('update', async () => { + const responsePromise = cloudflare.calls.update( + '023e105f4ecef8ad9ca31a8372d0c353', + '2a95132c15732412d22c1476fa83f27a', + {}, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.calls.list('023e105f4ecef8ad9ca31a8372d0c353'); @@ -93,20 +109,4 @@ describe('resource calls', () => { }), ).rejects.toThrow(Cloudflare.NotFoundError); }); - - // skipped: tests are disabled for the time being - test.skip('replace', async () => { - const responsePromise = cloudflare.calls.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - '2a95132c15732412d22c1476fa83f27a', - {}, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); }); diff --git a/tests/api-resources/certificate-authorities/hostname-associations.test.ts b/tests/api-resources/certificate-authorities/hostname-associations.test.ts index f1e2d6bd63..0d586e55aa 100644 --- a/tests/api-resources/certificate-authorities/hostname-associations.test.ts +++ b/tests/api-resources/certificate-authorities/hostname-associations.test.ts @@ -12,6 +12,21 @@ const cloudflare = new Cloudflare({ }); describe('resource hostnameAssociations', () => { + // skipped: tests are disabled for the time being + test.skip('update', async () => { + const responsePromise = cloudflare.certificateAuthorities.hostnameAssociations.update( + '023e105f4ecef8ad9ca31a8372d0c353', + {}, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.certificateAuthorities.hostnameAssociations.list( @@ -47,19 +62,4 @@ describe('resource hostnameAssociations', () => { ), ).rejects.toThrow(Cloudflare.NotFoundError); }); - - // skipped: tests are disabled for the time being - test.skip('replace', async () => { - const responsePromise = cloudflare.certificateAuthorities.hostnameAssociations.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - {}, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); }); diff --git a/tests/api-resources/challenges/widgets.test.ts b/tests/api-resources/challenges/widgets.test.ts index ce7351f217..59b77b1949 100644 --- a/tests/api-resources/challenges/widgets.test.ts +++ b/tests/api-resources/challenges/widgets.test.ts @@ -45,6 +45,42 @@ describe('resource widgets', () => { }); }); + // skipped: tests are disabled for the time being + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.challenges.widgets.update( + '023e105f4ecef8ad9ca31a8372d0c353', + '0x4AAF00AAAABn0R22HWm-YUc', + { + domains: ['203.0.113.1', 'cloudflare.com', 'blog.example.com'], + mode: 'invisible', + name: 'blog.cloudflare.com login form', + }, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('update: required and optional params', async () => { + const response = await cloudflare.challenges.widgets.update( + '023e105f4ecef8ad9ca31a8372d0c353', + '0x4AAF00AAAABn0R22HWm-YUc', + { + domains: ['203.0.113.1', 'cloudflare.com', 'blog.example.com'], + mode: 'invisible', + name: 'blog.cloudflare.com login form', + bot_fight_mode: true, + clearance_level: 'interactive', + offlabel: true, + }, + ); + }); + // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.challenges.widgets.list('023e105f4ecef8ad9ca31a8372d0c353'); @@ -129,42 +165,6 @@ describe('resource widgets', () => { ).rejects.toThrow(Cloudflare.NotFoundError); }); - // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.challenges.widgets.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - '0x4AAF00AAAABn0R22HWm-YUc', - { - domains: ['203.0.113.1', 'cloudflare.com', 'blog.example.com'], - mode: 'invisible', - name: 'blog.cloudflare.com login form', - }, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.challenges.widgets.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - '0x4AAF00AAAABn0R22HWm-YUc', - { - domains: ['203.0.113.1', 'cloudflare.com', 'blog.example.com'], - mode: 'invisible', - name: 'blog.cloudflare.com login form', - bot_fight_mode: true, - clearance_level: 'interactive', - offlabel: true, - }, - ); - }); - // skipped: tests are disabled for the time being test.skip('rotateSecret', async () => { const responsePromise = cloudflare.challenges.widgets.rotateSecret( diff --git a/tests/api-resources/client-certificates.test.ts b/tests/api-resources/client-certificates.test.ts index 2c41a06ad8..c55ba3d318 100644 --- a/tests/api-resources/client-certificates.test.ts +++ b/tests/api-resources/client-certificates.test.ts @@ -35,33 +35,6 @@ describe('resource clientCertificates', () => { }); }); - // skipped: tests are disabled for the time being - test.skip('update', async () => { - const responsePromise = cloudflare.clientCertificates.update( - '023e105f4ecef8ad9ca31a8372d0c353', - '023e105f4ecef8ad9ca31a8372d0c353', - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('update: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.clientCertificates.update( - '023e105f4ecef8ad9ca31a8372d0c353', - '023e105f4ecef8ad9ca31a8372d0c353', - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.clientCertificates.list('023e105f4ecef8ad9ca31a8372d0c353'); @@ -123,6 +96,33 @@ describe('resource clientCertificates', () => { ).rejects.toThrow(Cloudflare.NotFoundError); }); + // skipped: tests are disabled for the time being + test.skip('edit', async () => { + const responsePromise = cloudflare.clientCertificates.edit( + '023e105f4ecef8ad9ca31a8372d0c353', + '023e105f4ecef8ad9ca31a8372d0c353', + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('edit: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.clientCertificates.edit( + '023e105f4ecef8ad9ca31a8372d0c353', + '023e105f4ecef8ad9ca31a8372d0c353', + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + // skipped: tests are disabled for the time being test.skip('get', async () => { const responsePromise = cloudflare.clientCertificates.get( diff --git a/tests/api-resources/custom-certificates/custom-certificates.test.ts b/tests/api-resources/custom-certificates/custom-certificates.test.ts index 07acfc66a0..a1ea7b1f03 100644 --- a/tests/api-resources/custom-certificates/custom-certificates.test.ts +++ b/tests/api-resources/custom-certificates/custom-certificates.test.ts @@ -43,22 +43,6 @@ describe('resource customCertificates', () => { }); }); - // skipped: tests are disabled for the time being - test.skip('update', async () => { - const responsePromise = cloudflare.customCertificates.update( - '023e105f4ecef8ad9ca31a8372d0c353', - '023e105f4ecef8ad9ca31a8372d0c353', - {}, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.customCertificates.list('023e105f4ecef8ad9ca31a8372d0c353'); @@ -108,6 +92,22 @@ describe('resource customCertificates', () => { expect(dataAndResponse.response).toBe(rawResponse); }); + // skipped: tests are disabled for the time being + test.skip('edit', async () => { + const responsePromise = cloudflare.customCertificates.edit( + '023e105f4ecef8ad9ca31a8372d0c353', + '023e105f4ecef8ad9ca31a8372d0c353', + {}, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + // skipped: tests are disabled for the time being test.skip('get', async () => { const responsePromise = cloudflare.customCertificates.get( diff --git a/tests/api-resources/custom-certificates/prioritize.test.ts b/tests/api-resources/custom-certificates/prioritize.test.ts index 060170b722..b220c4c90b 100644 --- a/tests/api-resources/custom-certificates/prioritize.test.ts +++ b/tests/api-resources/custom-certificates/prioritize.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource prioritize', () => { // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.customCertificates.prioritize.replace( + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.customCertificates.prioritize.update( '023e105f4ecef8ad9ca31a8372d0c353', { certificates: [{}, {}] }, ); @@ -28,8 +28,8 @@ describe('resource prioritize', () => { }); // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.customCertificates.prioritize.replace( + test.skip('update: required and optional params', async () => { + const response = await cloudflare.customCertificates.prioritize.update( '023e105f4ecef8ad9ca31a8372d0c353', { certificates: [{ priority: 2 }, { priority: 1 }] }, ); diff --git a/tests/api-resources/custom-hostnames/custom-hostnames.test.ts b/tests/api-resources/custom-hostnames/custom-hostnames.test.ts index c4153f53a9..d02b34246e 100644 --- a/tests/api-resources/custom-hostnames/custom-hostnames.test.ts +++ b/tests/api-resources/custom-hostnames/custom-hostnames.test.ts @@ -53,22 +53,6 @@ describe('resource customHostnames', () => { }); }); - // skipped: tests are disabled for the time being - test.skip('update', async () => { - const responsePromise = cloudflare.customHostnames.update( - '023e105f4ecef8ad9ca31a8372d0c353', - '023e105f4ecef8ad9ca31a8372d0c353', - {}, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.customHostnames.list('023e105f4ecef8ad9ca31a8372d0c353'); @@ -126,6 +110,22 @@ describe('resource customHostnames', () => { expect(dataAndResponse.response).toBe(rawResponse); }); + // skipped: tests are disabled for the time being + test.skip('edit', async () => { + const responsePromise = cloudflare.customHostnames.edit( + '023e105f4ecef8ad9ca31a8372d0c353', + '023e105f4ecef8ad9ca31a8372d0c353', + {}, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + // skipped: tests are disabled for the time being test.skip('get', async () => { const responsePromise = cloudflare.customHostnames.get( diff --git a/tests/api-resources/custom-hostnames/fallback-origin.test.ts b/tests/api-resources/custom-hostnames/fallback-origin.test.ts index 8e624fd0b1..2cbb73da7b 100644 --- a/tests/api-resources/custom-hostnames/fallback-origin.test.ts +++ b/tests/api-resources/custom-hostnames/fallback-origin.test.ts @@ -12,6 +12,29 @@ const cloudflare = new Cloudflare({ }); describe('resource fallbackOrigin', () => { + // skipped: tests are disabled for the time being + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.customHostnames.fallbackOrigin.update( + '023e105f4ecef8ad9ca31a8372d0c353', + { origin: 'fallback.example.com' }, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('update: required and optional params', async () => { + const response = await cloudflare.customHostnames.fallbackOrigin.update( + '023e105f4ecef8ad9ca31a8372d0c353', + { origin: 'fallback.example.com' }, + ); + }); + // skipped: tests are disabled for the time being test.skip('delete', async () => { const responsePromise = cloudflare.customHostnames.fallbackOrigin.delete( @@ -47,27 +70,4 @@ describe('resource fallbackOrigin', () => { }), ).rejects.toThrow(Cloudflare.NotFoundError); }); - - // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.customHostnames.fallbackOrigin.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - { origin: 'fallback.example.com' }, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.customHostnames.fallbackOrigin.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - { origin: 'fallback.example.com' }, - ); - }); }); diff --git a/tests/api-resources/devices/dex-tests.test.ts b/tests/api-resources/devices/dex-tests.test.ts index b4df644054..8db83a7510 100644 --- a/tests/api-resources/devices/dex-tests.test.ts +++ b/tests/api-resources/devices/dex-tests.test.ts @@ -40,6 +40,37 @@ describe('resource dexTests', () => { }); }); + // skipped: tests are disabled for the time being + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.devices.dexTests.update( + '699d98642c564d2e855e9661899b7252', + 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + { data: {}, enabled: true, interval: '30m', name: 'HTTP dash health check' }, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('update: required and optional params', async () => { + const response = await cloudflare.devices.dexTests.update( + '699d98642c564d2e855e9661899b7252', + 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + { + data: { host: 'https://dash.cloudflare.com', kind: 'http', method: 'GET' }, + enabled: true, + interval: '30m', + name: 'HTTP dash health check', + description: 'Checks the dash endpoint every 30 minutes', + }, + ); + }); + // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.devices.dexTests.list('699d98642c564d2e855e9661899b7252'); @@ -115,35 +146,4 @@ describe('resource dexTests', () => { ), ).rejects.toThrow(Cloudflare.NotFoundError); }); - - // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.devices.dexTests.replace( - '699d98642c564d2e855e9661899b7252', - 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', - { data: {}, enabled: true, interval: '30m', name: 'HTTP dash health check' }, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.devices.dexTests.replace( - '699d98642c564d2e855e9661899b7252', - 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', - { - data: { host: 'https://dash.cloudflare.com', kind: 'http', method: 'GET' }, - enabled: true, - interval: '30m', - name: 'HTTP dash health check', - description: 'Checks the dash endpoint every 30 minutes', - }, - ); - }); }); diff --git a/tests/api-resources/devices/networks.test.ts b/tests/api-resources/devices/networks.test.ts index 8ed77b4893..6d8d771c34 100644 --- a/tests/api-resources/devices/networks.test.ts +++ b/tests/api-resources/devices/networks.test.ts @@ -40,6 +40,22 @@ describe('resource networks', () => { }); }); + // skipped: tests are disabled for the time being + test.skip('update', async () => { + const responsePromise = cloudflare.devices.networks.update( + '699d98642c564d2e855e9661899b7252', + 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + {}, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.devices.networks.list('699d98642c564d2e855e9661899b7252'); @@ -103,20 +119,4 @@ describe('resource networks', () => { ), ).rejects.toThrow(Cloudflare.NotFoundError); }); - - // skipped: tests are disabled for the time being - test.skip('replace', async () => { - const responsePromise = cloudflare.devices.networks.replace( - '699d98642c564d2e855e9661899b7252', - 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', - {}, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); }); diff --git a/tests/api-resources/devices/policies/excludes.test.ts b/tests/api-resources/devices/policies/excludes.test.ts index fe4f5ff4da..6e5069dba8 100644 --- a/tests/api-resources/devices/policies/excludes.test.ts +++ b/tests/api-resources/devices/policies/excludes.test.ts @@ -13,30 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource excludes', () => { // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.devices.policies.excludes.list('699d98642c564d2e855e9661899b7252'); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.devices.policies.excludes.list('699d98642c564d2e855e9661899b7252', { - path: '/_stainless_unknown_path', - }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.devices.policies.excludes.replace('699d98642c564d2e855e9661899b7252', [ + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.devices.policies.excludes.update('699d98642c564d2e855e9661899b7252', [ { address: '192.0.2.0/24', description: 'Exclude testing domains from the tunnel' }, { address: '192.0.2.0/24', description: 'Exclude testing domains from the tunnel' }, { address: '192.0.2.0/24', description: 'Exclude testing domains from the tunnel' }, @@ -51,8 +29,8 @@ describe('resource excludes', () => { }); // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.devices.policies.excludes.replace('699d98642c564d2e855e9661899b7252', [ + test.skip('update: required and optional params', async () => { + const response = await cloudflare.devices.policies.excludes.update('699d98642c564d2e855e9661899b7252', [ { address: '192.0.2.0/24', description: 'Exclude testing domains from the tunnel', @@ -70,4 +48,26 @@ describe('resource excludes', () => { }, ]); }); + + // skipped: tests are disabled for the time being + test.skip('list', async () => { + const responsePromise = cloudflare.devices.policies.excludes.list('699d98642c564d2e855e9661899b7252'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('list: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.devices.policies.excludes.list('699d98642c564d2e855e9661899b7252', { + path: '/_stainless_unknown_path', + }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); }); diff --git a/tests/api-resources/devices/policies/fallback-domains.test.ts b/tests/api-resources/devices/policies/fallback-domains.test.ts index f75a9d00a3..ceb756ce90 100644 --- a/tests/api-resources/devices/policies/fallback-domains.test.ts +++ b/tests/api-resources/devices/policies/fallback-domains.test.ts @@ -13,35 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource fallbackDomains', () => { // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.devices.policies.fallbackDomains.list( - '699d98642c564d2e855e9661899b7252', - 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.devices.policies.fallbackDomains.list( - '699d98642c564d2e855e9661899b7252', - 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.devices.policies.fallbackDomains.replace( + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.devices.policies.fallbackDomains.update( '699d98642c564d2e855e9661899b7252', 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', [{ suffix: 'example.com' }, { suffix: 'example.com' }, { suffix: 'example.com' }], @@ -56,8 +29,8 @@ describe('resource fallbackDomains', () => { }); // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.devices.policies.fallbackDomains.replace( + test.skip('update: required and optional params', async () => { + const response = await cloudflare.devices.policies.fallbackDomains.update( '699d98642c564d2e855e9661899b7252', 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', [ @@ -79,4 +52,31 @@ describe('resource fallbackDomains', () => { ], ); }); + + // skipped: tests are disabled for the time being + test.skip('list', async () => { + const responsePromise = cloudflare.devices.policies.fallbackDomains.list( + '699d98642c564d2e855e9661899b7252', + 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('list: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.devices.policies.fallbackDomains.list( + '699d98642c564d2e855e9661899b7252', + 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); }); diff --git a/tests/api-resources/devices/policies/includes.test.ts b/tests/api-resources/devices/policies/includes.test.ts index 40b217315a..ad8b4d6a01 100644 --- a/tests/api-resources/devices/policies/includes.test.ts +++ b/tests/api-resources/devices/policies/includes.test.ts @@ -13,30 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource includes', () => { // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.devices.policies.includes.list('699d98642c564d2e855e9661899b7252'); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.devices.policies.includes.list('699d98642c564d2e855e9661899b7252', { - path: '/_stainless_unknown_path', - }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.devices.policies.includes.replace('699d98642c564d2e855e9661899b7252', [ + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.devices.policies.includes.update('699d98642c564d2e855e9661899b7252', [ { address: '192.0.2.0/24', description: 'Include testing domains from the tunnel' }, { address: '192.0.2.0/24', description: 'Include testing domains from the tunnel' }, { address: '192.0.2.0/24', description: 'Include testing domains from the tunnel' }, @@ -51,8 +29,8 @@ describe('resource includes', () => { }); // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.devices.policies.includes.replace('699d98642c564d2e855e9661899b7252', [ + test.skip('update: required and optional params', async () => { + const response = await cloudflare.devices.policies.includes.update('699d98642c564d2e855e9661899b7252', [ { address: '192.0.2.0/24', description: 'Include testing domains from the tunnel', @@ -70,4 +48,26 @@ describe('resource includes', () => { }, ]); }); + + // skipped: tests are disabled for the time being + test.skip('list', async () => { + const responsePromise = cloudflare.devices.policies.includes.list('699d98642c564d2e855e9661899b7252'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('list: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.devices.policies.includes.list('699d98642c564d2e855e9661899b7252', { + path: '/_stainless_unknown_path', + }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); }); diff --git a/tests/api-resources/devices/policies/policies.test.ts b/tests/api-resources/devices/policies/policies.test.ts index ed786ce367..a91e8b5c43 100644 --- a/tests/api-resources/devices/policies/policies.test.ts +++ b/tests/api-resources/devices/policies/policies.test.ts @@ -51,22 +51,6 @@ describe('resource policies', () => { }); }); - // skipped: tests are disabled for the time being - test.skip('update', async () => { - const responsePromise = cloudflare.devices.policies.update( - '699d98642c564d2e855e9661899b7252', - 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', - {}, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.devices.policies.list('699d98642c564d2e855e9661899b7252'); @@ -104,6 +88,22 @@ describe('resource policies', () => { expect(dataAndResponse.response).toBe(rawResponse); }); + // skipped: tests are disabled for the time being + test.skip('edit', async () => { + const responsePromise = cloudflare.devices.policies.edit( + '699d98642c564d2e855e9661899b7252', + 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + {}, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + // skipped: tests are disabled for the time being test.skip('get', async () => { const responsePromise = cloudflare.devices.policies.get( diff --git a/tests/api-resources/devices/postures/integrations.test.ts b/tests/api-resources/devices/postures/integrations.test.ts index 4d4ee05585..39ef3e60fa 100644 --- a/tests/api-resources/devices/postures/integrations.test.ts +++ b/tests/api-resources/devices/postures/integrations.test.ts @@ -56,11 +56,10 @@ describe('resource integrations', () => { }); // skipped: tests are disabled for the time being - test.skip('update', async () => { - const responsePromise = cloudflare.devices.postures.integrations.update( + test.skip('delete', async () => { + const responsePromise = cloudflare.devices.postures.integrations.delete( '699d98642c564d2e855e9661899b7252', 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', - {}, ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -72,10 +71,11 @@ describe('resource integrations', () => { }); // skipped: tests are disabled for the time being - test.skip('delete', async () => { - const responsePromise = cloudflare.devices.postures.integrations.delete( + test.skip('edit', async () => { + const responsePromise = cloudflare.devices.postures.integrations.edit( '699d98642c564d2e855e9661899b7252', 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + {}, ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); diff --git a/tests/api-resources/devices/postures/postures.test.ts b/tests/api-resources/devices/postures/postures.test.ts index 17d894e615..ebac038d94 100644 --- a/tests/api-resources/devices/postures/postures.test.ts +++ b/tests/api-resources/devices/postures/postures.test.ts @@ -46,6 +46,45 @@ describe('resource postures', () => { }); }); + // skipped: tests are disabled for the time being + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.devices.postures.update( + '699d98642c564d2e855e9661899b7252', + 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + { name: 'Admin Serial Numbers', type: 'file' }, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('update: required and optional params', async () => { + const response = await cloudflare.devices.postures.update( + '699d98642c564d2e855e9661899b7252', + 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + { + name: 'Admin Serial Numbers', + type: 'file', + description: 'The rule for admin serial numbers', + expiration: '1h', + input: { + exists: true, + operating_system: 'linux', + path: '/bin/cat', + sha256: 'https://api.us-2.crowdstrike.com', + thumbprint: '0aabab210bdb998e9cf45da2c9ce352977ab531c681b74cf1e487be1bbe9fe6e', + }, + match: [{ platform: 'windows' }, { platform: 'windows' }, { platform: 'windows' }], + schedule: '1h', + }, + ); + }); + // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.devices.postures.list('699d98642c564d2e855e9661899b7252'); @@ -109,43 +148,4 @@ describe('resource postures', () => { ), ).rejects.toThrow(Cloudflare.NotFoundError); }); - - // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.devices.postures.replace( - '699d98642c564d2e855e9661899b7252', - 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', - { name: 'Admin Serial Numbers', type: 'file' }, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.devices.postures.replace( - '699d98642c564d2e855e9661899b7252', - 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', - { - name: 'Admin Serial Numbers', - type: 'file', - description: 'The rule for admin serial numbers', - expiration: '1h', - input: { - exists: true, - operating_system: 'linux', - path: '/bin/cat', - sha256: 'https://api.us-2.crowdstrike.com', - thumbprint: '0aabab210bdb998e9cf45da2c9ce352977ab531c681b74cf1e487be1bbe9fe6e', - }, - match: [{ platform: 'windows' }, { platform: 'windows' }, { platform: 'windows' }], - schedule: '1h', - }, - ); - }); }); diff --git a/tests/api-resources/devices/settings.test.ts b/tests/api-resources/devices/settings.test.ts index dcf87c0b95..94016bdf12 100644 --- a/tests/api-resources/devices/settings.test.ts +++ b/tests/api-resources/devices/settings.test.ts @@ -12,6 +12,18 @@ const cloudflare = new Cloudflare({ }); describe('resource settings', () => { + // skipped: tests are disabled for the time being + test.skip('update', async () => { + const responsePromise = cloudflare.devices.settings.update('699d98642c564d2e855e9661899b7252', {}); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.devices.settings.list('699d98642c564d2e855e9661899b7252'); @@ -33,16 +45,4 @@ describe('resource settings', () => { }), ).rejects.toThrow(Cloudflare.NotFoundError); }); - - // skipped: tests are disabled for the time being - test.skip('replace', async () => { - const responsePromise = cloudflare.devices.settings.replace('699d98642c564d2e855e9661899b7252', {}); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); }); diff --git a/tests/api-resources/dispatchers/scripts.test.ts b/tests/api-resources/dispatchers/scripts.test.ts index de9bb22a12..11194d4138 100644 --- a/tests/api-resources/dispatchers/scripts.test.ts +++ b/tests/api-resources/dispatchers/scripts.test.ts @@ -12,6 +12,23 @@ const cloudflare = new Cloudflare({ }); describe('resource scripts', () => { + // skipped: tests are disabled for the time being + test.skip('update', async () => { + const responsePromise = cloudflare.dispatchers.scripts.update( + '023e105f4ecef8ad9ca31a8372d0c353', + 'my-dispatch-namespace', + 'this-is_my_script-01', + {}, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + // skipped: tests are disabled for the time being test.skip('delete', async () => { const responsePromise = cloudflare.dispatchers.scripts.delete( @@ -57,21 +74,4 @@ describe('resource scripts', () => { ), ).rejects.toThrow(Cloudflare.NotFoundError); }); - - // skipped: tests are disabled for the time being - test.skip('replace', async () => { - const responsePromise = cloudflare.dispatchers.scripts.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - 'my-dispatch-namespace', - 'this-is_my_script-01', - {}, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); }); diff --git a/tests/api-resources/dlp/datasets/datasets.test.ts b/tests/api-resources/dlp/datasets/datasets.test.ts index c9b4c247dc..e871e73a07 100644 --- a/tests/api-resources/dlp/datasets/datasets.test.ts +++ b/tests/api-resources/dlp/datasets/datasets.test.ts @@ -33,6 +33,22 @@ describe('resource datasets', () => { }); }); + // skipped: tests are disabled for the time being + test.skip('update', async () => { + const responsePromise = cloudflare.dlp.datasets.update( + 'string', + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + {}, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.dlp.datasets.list('string'); @@ -96,20 +112,4 @@ describe('resource datasets', () => { }), ).rejects.toThrow(Cloudflare.NotFoundError); }); - - // skipped: tests are disabled for the time being - test.skip('replace', async () => { - const responsePromise = cloudflare.dlp.datasets.replace( - 'string', - '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', - {}, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); }); diff --git a/tests/api-resources/dlp/datasets/upload.test.ts b/tests/api-resources/dlp/datasets/upload.test.ts index 9673c2b6d5..aa1c3acf0c 100644 --- a/tests/api-resources/dlp/datasets/upload.test.ts +++ b/tests/api-resources/dlp/datasets/upload.test.ts @@ -38,8 +38,8 @@ describe('resource upload', () => { }); // skipped: tests are disabled for the time being - test.skip('update', async () => { - const responsePromise = cloudflare.dlp.datasets.upload.update( + test.skip('edit', async () => { + const responsePromise = cloudflare.dlp.datasets.upload.edit( 'string', '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', 0, diff --git a/tests/api-resources/dlp/payload-logs.test.ts b/tests/api-resources/dlp/payload-logs.test.ts index 0b9a02a77b..622706802b 100644 --- a/tests/api-resources/dlp/payload-logs.test.ts +++ b/tests/api-resources/dlp/payload-logs.test.ts @@ -13,8 +13,10 @@ const cloudflare = new Cloudflare({ describe('resource payloadLogs', () => { // skipped: tests are disabled for the time being - test.skip('get', async () => { - const responsePromise = cloudflare.dlp.payloadLogs.get('023e105f4ecef8ad9ca31a8372d0c353'); + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.dlp.payloadLogs.update('023e105f4ecef8ad9ca31a8372d0c353', { + public_key: 'EmpOvSXw8BfbrGCi0fhGiD/3yXk2SiV1Nzg2lru3oj0=', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -25,20 +27,15 @@ describe('resource payloadLogs', () => { }); // skipped: tests are disabled for the time being - test.skip('get: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.dlp.payloadLogs.get('023e105f4ecef8ad9ca31a8372d0c353', { - path: '/_stainless_unknown_path', - }), - ).rejects.toThrow(Cloudflare.NotFoundError); + test.skip('update: required and optional params', async () => { + const response = await cloudflare.dlp.payloadLogs.update('023e105f4ecef8ad9ca31a8372d0c353', { + public_key: 'EmpOvSXw8BfbrGCi0fhGiD/3yXk2SiV1Nzg2lru3oj0=', + }); }); // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.dlp.payloadLogs.replace('023e105f4ecef8ad9ca31a8372d0c353', { - public_key: 'EmpOvSXw8BfbrGCi0fhGiD/3yXk2SiV1Nzg2lru3oj0=', - }); + test.skip('get', async () => { + const responsePromise = cloudflare.dlp.payloadLogs.get('023e105f4ecef8ad9ca31a8372d0c353'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -49,9 +46,12 @@ describe('resource payloadLogs', () => { }); // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.dlp.payloadLogs.replace('023e105f4ecef8ad9ca31a8372d0c353', { - public_key: 'EmpOvSXw8BfbrGCi0fhGiD/3yXk2SiV1Nzg2lru3oj0=', - }); + test.skip('get: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.dlp.payloadLogs.get('023e105f4ecef8ad9ca31a8372d0c353', { + path: '/_stainless_unknown_path', + }), + ).rejects.toThrow(Cloudflare.NotFoundError); }); }); diff --git a/tests/api-resources/dlp/profiles/customs.test.ts b/tests/api-resources/dlp/profiles/customs.test.ts index 15d6966e38..9f975a4672 100644 --- a/tests/api-resources/dlp/profiles/customs.test.ts +++ b/tests/api-resources/dlp/profiles/customs.test.ts @@ -100,6 +100,22 @@ describe('resource customs', () => { }); }); + // skipped: tests are disabled for the time being + test.skip('update', async () => { + const responsePromise = cloudflare.dlp.profiles.customs.update( + '023e105f4ecef8ad9ca31a8372d0c353', + '384e129d-25bd-403c-8019-bc19eb7a8a5f', + {}, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + // skipped: tests are disabled for the time being test.skip('delete', async () => { const responsePromise = cloudflare.dlp.profiles.customs.delete( @@ -141,20 +157,4 @@ describe('resource customs', () => { ), ).rejects.toThrow(Cloudflare.NotFoundError); }); - - // skipped: tests are disabled for the time being - test.skip('replace', async () => { - const responsePromise = cloudflare.dlp.profiles.customs.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - '384e129d-25bd-403c-8019-bc19eb7a8a5f', - {}, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); }); diff --git a/tests/api-resources/dlp/profiles/predefineds.test.ts b/tests/api-resources/dlp/profiles/predefineds.test.ts index ab1ca44086..33779aeeaf 100644 --- a/tests/api-resources/dlp/profiles/predefineds.test.ts +++ b/tests/api-resources/dlp/profiles/predefineds.test.ts @@ -12,6 +12,22 @@ const cloudflare = new Cloudflare({ }); describe('resource predefineds', () => { + // skipped: tests are disabled for the time being + test.skip('update', async () => { + const responsePromise = cloudflare.dlp.profiles.predefineds.update( + '023e105f4ecef8ad9ca31a8372d0c353', + '384e129d-25bd-403c-8019-bc19eb7a8a5f', + {}, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + // skipped: tests are disabled for the time being test.skip('get', async () => { const responsePromise = cloudflare.dlp.profiles.predefineds.get( @@ -38,20 +54,4 @@ describe('resource predefineds', () => { ), ).rejects.toThrow(Cloudflare.NotFoundError); }); - - // skipped: tests are disabled for the time being - test.skip('replace', async () => { - const responsePromise = cloudflare.dlp.profiles.predefineds.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - '384e129d-25bd-403c-8019-bc19eb7a8a5f', - {}, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); }); diff --git a/tests/api-resources/dns-firewall/dns-firewall.test.ts b/tests/api-resources/dns-firewall/dns-firewall.test.ts index 15dbe5fc13..5fd749cc5a 100644 --- a/tests/api-resources/dns-firewall/dns-firewall.test.ts +++ b/tests/api-resources/dns-firewall/dns-firewall.test.ts @@ -48,56 +48,6 @@ describe('resource dnsFirewall', () => { }); }); - // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.dnsFirewall.update( - '023e105f4ecef8ad9ca31a8372d0c353', - '023e105f4ecef8ad9ca31a8372d0c353', - { - deprecate_any_requests: true, - dns_firewall_ips: ['203.0.113.1', '203.0.113.254', '2001:DB8:AB::CF', '2001:DB8:CD::CF'], - ecs_fallback: false, - maximum_cache_ttl: 900, - minimum_cache_ttl: 60, - name: 'My Awesome DNS Firewall cluster', - upstream_ips: ['192.0.2.1', '198.51.100.1', '2001:DB8:100::CF'], - }, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.dnsFirewall.update( - '023e105f4ecef8ad9ca31a8372d0c353', - '023e105f4ecef8ad9ca31a8372d0c353', - { - deprecate_any_requests: true, - dns_firewall_ips: ['203.0.113.1', '203.0.113.254', '2001:DB8:AB::CF', '2001:DB8:CD::CF'], - ecs_fallback: false, - maximum_cache_ttl: 900, - minimum_cache_ttl: 60, - name: 'My Awesome DNS Firewall cluster', - upstream_ips: ['192.0.2.1', '198.51.100.1', '2001:DB8:100::CF'], - attack_mitigation: { - enabled: true, - only_when_origin_unhealthy: {}, - only_when_upstream_unhealthy: false, - }, - negative_cache_ttl: 900, - origin_ips: {}, - ratelimit: 600, - retries: 2, - }, - ); - }); - // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.dnsFirewall.list('023e105f4ecef8ad9ca31a8372d0c353'); @@ -145,6 +95,56 @@ describe('resource dnsFirewall', () => { expect(dataAndResponse.response).toBe(rawResponse); }); + // skipped: tests are disabled for the time being + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.dnsFirewall.edit( + '023e105f4ecef8ad9ca31a8372d0c353', + '023e105f4ecef8ad9ca31a8372d0c353', + { + deprecate_any_requests: true, + dns_firewall_ips: ['203.0.113.1', '203.0.113.254', '2001:DB8:AB::CF', '2001:DB8:CD::CF'], + ecs_fallback: false, + maximum_cache_ttl: 900, + minimum_cache_ttl: 60, + name: 'My Awesome DNS Firewall cluster', + upstream_ips: ['192.0.2.1', '198.51.100.1', '2001:DB8:100::CF'], + }, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.dnsFirewall.edit( + '023e105f4ecef8ad9ca31a8372d0c353', + '023e105f4ecef8ad9ca31a8372d0c353', + { + deprecate_any_requests: true, + dns_firewall_ips: ['203.0.113.1', '203.0.113.254', '2001:DB8:AB::CF', '2001:DB8:CD::CF'], + ecs_fallback: false, + maximum_cache_ttl: 900, + minimum_cache_ttl: 60, + name: 'My Awesome DNS Firewall cluster', + upstream_ips: ['192.0.2.1', '198.51.100.1', '2001:DB8:100::CF'], + attack_mitigation: { + enabled: true, + only_when_origin_unhealthy: {}, + only_when_upstream_unhealthy: false, + }, + negative_cache_ttl: 900, + origin_ips: {}, + ratelimit: 600, + retries: 2, + }, + ); + }); + // skipped: tests are disabled for the time being test.skip('get', async () => { const responsePromise = cloudflare.dnsFirewall.get( diff --git a/tests/api-resources/dns-records.test.ts b/tests/api-resources/dns-records.test.ts index ab106ebae3..8b8a261cee 100644 --- a/tests/api-resources/dns-records.test.ts +++ b/tests/api-resources/dns-records.test.ts @@ -41,6 +41,39 @@ describe('resource dnsRecords', () => { }); }); + // skipped: tests are disabled for the time being + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.dnsRecords.update( + '023e105f4ecef8ad9ca31a8372d0c353', + '023e105f4ecef8ad9ca31a8372d0c353', + { content: '198.51.100.4', name: 'example.com', type: 'A' }, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('update: required and optional params', async () => { + const response = await cloudflare.dnsRecords.update( + '023e105f4ecef8ad9ca31a8372d0c353', + '023e105f4ecef8ad9ca31a8372d0c353', + { + content: '198.51.100.4', + name: 'example.com', + type: 'A', + comment: 'Domain verification record', + proxied: false, + tags: ['owner:dns-team', 'owner:dns-team', 'owner:dns-team'], + ttl: 3600, + }, + ); + }); + // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.dnsRecords.list('023e105f4ecef8ad9ca31a8372d0c353'); @@ -183,39 +216,6 @@ describe('resource dnsRecords', () => { }); }); - // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.dnsRecords.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - '023e105f4ecef8ad9ca31a8372d0c353', - { content: '198.51.100.4', name: 'example.com', type: 'A' }, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.dnsRecords.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - '023e105f4ecef8ad9ca31a8372d0c353', - { - content: '198.51.100.4', - name: 'example.com', - type: 'A', - comment: 'Domain verification record', - proxied: false, - tags: ['owner:dns-team', 'owner:dns-team', 'owner:dns-team'], - ttl: 3600, - }, - ); - }); - // skipped: tests are disabled for the time being test.skip('scan', async () => { const responsePromise = cloudflare.dnsRecords.scan('023e105f4ecef8ad9ca31a8372d0c353'); diff --git a/tests/api-resources/dnssec.test.ts b/tests/api-resources/dnssec.test.ts index ce722bf298..8a19111cc4 100644 --- a/tests/api-resources/dnssec.test.ts +++ b/tests/api-resources/dnssec.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource dnssec', () => { // skipped: tests are disabled for the time being - test.skip('update', async () => { - const responsePromise = cloudflare.dnssec.update('023e105f4ecef8ad9ca31a8372d0c353', {}); + test.skip('delete', async () => { + const responsePromise = cloudflare.dnssec.delete('023e105f4ecef8ad9ca31a8372d0c353'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -25,8 +25,8 @@ describe('resource dnssec', () => { }); // skipped: tests are disabled for the time being - test.skip('delete', async () => { - const responsePromise = cloudflare.dnssec.delete('023e105f4ecef8ad9ca31a8372d0c353'); + test.skip('edit', async () => { + const responsePromise = cloudflare.dnssec.edit('023e105f4ecef8ad9ca31a8372d0c353', {}); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; diff --git a/tests/api-resources/emails/routing/rules/catch-alls.test.ts b/tests/api-resources/emails/routing/rules/catch-alls.test.ts index 43a0097b49..e8c8a671d9 100644 --- a/tests/api-resources/emails/routing/rules/catch-alls.test.ts +++ b/tests/api-resources/emails/routing/rules/catch-alls.test.ts @@ -13,30 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource catchAlls', () => { // skipped: tests are disabled for the time being - test.skip('get', async () => { - const responsePromise = cloudflare.emails.routing.rules.catchAlls.get('023e105f4ecef8ad9ca31a8372d0c353'); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('get: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.emails.routing.rules.catchAlls.get('023e105f4ecef8ad9ca31a8372d0c353', { - path: '/_stainless_unknown_path', - }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.emails.routing.rules.catchAlls.replace( + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.emails.routing.rules.catchAlls.update( '023e105f4ecef8ad9ca31a8372d0c353', { actions: [{ type: 'forward' }, { type: 'forward' }, { type: 'forward' }], @@ -53,8 +31,8 @@ describe('resource catchAlls', () => { }); // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.emails.routing.rules.catchAlls.replace( + test.skip('update: required and optional params', async () => { + const response = await cloudflare.emails.routing.rules.catchAlls.update( '023e105f4ecef8ad9ca31a8372d0c353', { actions: [ @@ -89,4 +67,26 @@ describe('resource catchAlls', () => { }, ); }); + + // skipped: tests are disabled for the time being + test.skip('get', async () => { + const responsePromise = cloudflare.emails.routing.rules.catchAlls.get('023e105f4ecef8ad9ca31a8372d0c353'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.emails.routing.rules.catchAlls.get('023e105f4ecef8ad9ca31a8372d0c353', { + path: '/_stainless_unknown_path', + }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); }); diff --git a/tests/api-resources/emails/routing/rules/rules.test.ts b/tests/api-resources/emails/routing/rules/rules.test.ts index 91cefb45a5..210b4fa1ff 100644 --- a/tests/api-resources/emails/routing/rules/rules.test.ts +++ b/tests/api-resources/emails/routing/rules/rules.test.ts @@ -97,96 +97,8 @@ describe('resource rules', () => { }); // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.emails.routing.rules.list('023e105f4ecef8ad9ca31a8372d0c353'); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.emails.routing.rules.list('023e105f4ecef8ad9ca31a8372d0c353', { - path: '/_stainless_unknown_path', - }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.emails.routing.rules.list( - '023e105f4ecef8ad9ca31a8372d0c353', - { enabled: true, page: 1, per_page: 5 }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - // skipped: tests are disabled for the time being - test.skip('delete', async () => { - const responsePromise = cloudflare.emails.routing.rules.delete( - '023e105f4ecef8ad9ca31a8372d0c353', - 'a7e6fb77503c41d8a7f3113c6918f10c', - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('delete: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.emails.routing.rules.delete( - '023e105f4ecef8ad9ca31a8372d0c353', - 'a7e6fb77503c41d8a7f3113c6918f10c', - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - // skipped: tests are disabled for the time being - test.skip('get', async () => { - const responsePromise = cloudflare.emails.routing.rules.get( - '023e105f4ecef8ad9ca31a8372d0c353', - 'a7e6fb77503c41d8a7f3113c6918f10c', - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('get: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.emails.routing.rules.get( - '023e105f4ecef8ad9ca31a8372d0c353', - 'a7e6fb77503c41d8a7f3113c6918f10c', - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.emails.routing.rules.replace( + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.emails.routing.rules.update( '023e105f4ecef8ad9ca31a8372d0c353', 'a7e6fb77503c41d8a7f3113c6918f10c', { @@ -233,8 +145,8 @@ describe('resource rules', () => { }); // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.emails.routing.rules.replace( + test.skip('update: required and optional params', async () => { + const response = await cloudflare.emails.routing.rules.update( '023e105f4ecef8ad9ca31a8372d0c353', 'a7e6fb77503c41d8a7f3113c6918f10c', { @@ -275,4 +187,92 @@ describe('resource rules', () => { }, ); }); + + // skipped: tests are disabled for the time being + test.skip('list', async () => { + const responsePromise = cloudflare.emails.routing.rules.list('023e105f4ecef8ad9ca31a8372d0c353'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('list: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.emails.routing.rules.list('023e105f4ecef8ad9ca31a8372d0c353', { + path: '/_stainless_unknown_path', + }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('list: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.emails.routing.rules.list( + '023e105f4ecef8ad9ca31a8372d0c353', + { enabled: true, page: 1, per_page: 5 }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('delete', async () => { + const responsePromise = cloudflare.emails.routing.rules.delete( + '023e105f4ecef8ad9ca31a8372d0c353', + 'a7e6fb77503c41d8a7f3113c6918f10c', + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('delete: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.emails.routing.rules.delete( + '023e105f4ecef8ad9ca31a8372d0c353', + 'a7e6fb77503c41d8a7f3113c6918f10c', + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('get', async () => { + const responsePromise = cloudflare.emails.routing.rules.get( + '023e105f4ecef8ad9ca31a8372d0c353', + 'a7e6fb77503c41d8a7f3113c6918f10c', + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.emails.routing.rules.get( + '023e105f4ecef8ad9ca31a8372d0c353', + 'a7e6fb77503c41d8a7f3113c6918f10c', + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); }); diff --git a/tests/api-resources/filters.test.ts b/tests/api-resources/filters.test.ts index b9c751042d..75ef5c9bbf 100644 --- a/tests/api-resources/filters.test.ts +++ b/tests/api-resources/filters.test.ts @@ -29,6 +29,31 @@ describe('resource filters', () => { const response = await cloudflare.filters.create('023e105f4ecef8ad9ca31a8372d0c353', {}); }); + // skipped: tests are disabled for the time being + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.filters.update( + '023e105f4ecef8ad9ca31a8372d0c353', + '372e67954025e0ba6aaa6d586b9e0b61', + {}, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('update: required and optional params', async () => { + const response = await cloudflare.filters.update( + '023e105f4ecef8ad9ca31a8372d0c353', + '372e67954025e0ba6aaa6d586b9e0b61', + {}, + ); + }); + // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.filters.list('023e105f4ecef8ad9ca31a8372d0c353'); @@ -100,29 +125,4 @@ describe('resource filters', () => { }), ).rejects.toThrow(Cloudflare.NotFoundError); }); - - // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.filters.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - '372e67954025e0ba6aaa6d586b9e0b61', - {}, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.filters.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - '372e67954025e0ba6aaa6d586b9e0b61', - {}, - ); - }); }); diff --git a/tests/api-resources/firewall/waf/packages/groups.test.ts b/tests/api-resources/firewall/waf/packages/groups.test.ts index fbe944c9fe..87317dd293 100644 --- a/tests/api-resources/firewall/waf/packages/groups.test.ts +++ b/tests/api-resources/firewall/waf/packages/groups.test.ts @@ -12,23 +12,6 @@ const cloudflare = new Cloudflare({ }); describe('resource groups', () => { - // skipped: tests are disabled for the time being - test.skip('update', async () => { - const responsePromise = cloudflare.firewall.waf.packages.groups.update( - '023e105f4ecef8ad9ca31a8372d0c353', - 'a25a9a7e9c00afc1fb2e0245519d725b', - 'a25a9a7e9c00afc1fb2e0245519d725b', - {}, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.firewall.waf.packages.groups.list( @@ -69,6 +52,23 @@ describe('resource groups', () => { ).rejects.toThrow(Cloudflare.NotFoundError); }); + // skipped: tests are disabled for the time being + test.skip('edit', async () => { + const responsePromise = cloudflare.firewall.waf.packages.groups.edit( + '023e105f4ecef8ad9ca31a8372d0c353', + 'a25a9a7e9c00afc1fb2e0245519d725b', + 'a25a9a7e9c00afc1fb2e0245519d725b', + {}, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + // skipped: tests are disabled for the time being test.skip('get', async () => { const responsePromise = cloudflare.firewall.waf.packages.groups.get( diff --git a/tests/api-resources/firewall/waf/packages/rules.test.ts b/tests/api-resources/firewall/waf/packages/rules.test.ts index 1d3b19596e..dacccab64d 100644 --- a/tests/api-resources/firewall/waf/packages/rules.test.ts +++ b/tests/api-resources/firewall/waf/packages/rules.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource rules', () => { // skipped: tests are disabled for the time being - test.skip('update', async () => { - const responsePromise = cloudflare.firewall.waf.packages.rules.update( + test.skip('edit', async () => { + const responsePromise = cloudflare.firewall.waf.packages.rules.edit( '023e105f4ecef8ad9ca31a8372d0c353', 'a25a9a7e9c00afc1fb2e0245519d725b', 'a25a9a7e9c00afc1fb2e0245519d725b', diff --git a/tests/api-resources/firewalls/access-rules.test.ts b/tests/api-resources/firewalls/access-rules.test.ts index 0d5e7c6b6f..6861a785fc 100644 --- a/tests/api-resources/firewalls/access-rules.test.ts +++ b/tests/api-resources/firewalls/access-rules.test.ts @@ -41,34 +41,6 @@ describe('resource accessRules', () => { ); }); - // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.firewalls.accessRules.update( - {}, - { account_identifier: {}, configuration: {}, mode: 'challenge' }, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.firewalls.accessRules.update( - {}, - { - account_identifier: {}, - configuration: { target: 'ip', value: '198.51.100.4' }, - mode: 'challenge', - notes: 'This rule is enabled because of an event that occurred on date X.', - }, - ); - }); - // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.firewalls.accessRules.list('string', {}); @@ -127,6 +99,34 @@ describe('resource accessRules', () => { expect(dataAndResponse.response).toBe(rawResponse); }); + // skipped: tests are disabled for the time being + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.firewalls.accessRules.edit( + {}, + { account_identifier: {}, configuration: {}, mode: 'challenge' }, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.firewalls.accessRules.edit( + {}, + { + account_identifier: {}, + configuration: { target: 'ip', value: '198.51.100.4' }, + mode: 'challenge', + notes: 'This rule is enabled because of an event that occurred on date X.', + }, + ); + }); + // skipped: tests are disabled for the time being test.skip('get', async () => { const responsePromise = cloudflare.firewalls.accessRules.get('string', {}, {}); diff --git a/tests/api-resources/firewalls/lockdowns.test.ts b/tests/api-resources/firewalls/lockdowns.test.ts index 799ce1f6cf..3b26b529cc 100644 --- a/tests/api-resources/firewalls/lockdowns.test.ts +++ b/tests/api-resources/firewalls/lockdowns.test.ts @@ -29,6 +29,31 @@ describe('resource lockdowns', () => { const response = await cloudflare.firewalls.lockdowns.create('023e105f4ecef8ad9ca31a8372d0c353', {}); }); + // skipped: tests are disabled for the time being + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.firewalls.lockdowns.update( + '023e105f4ecef8ad9ca31a8372d0c353', + '372e67954025e0ba6aaa6d586b9e0b59', + {}, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('update: required and optional params', async () => { + const response = await cloudflare.firewalls.lockdowns.update( + '023e105f4ecef8ad9ca31a8372d0c353', + '372e67954025e0ba6aaa6d586b9e0b59', + {}, + ); + }); + // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.firewalls.lockdowns.list('023e105f4ecef8ad9ca31a8372d0c353'); @@ -114,29 +139,4 @@ describe('resource lockdowns', () => { ), ).rejects.toThrow(Cloudflare.NotFoundError); }); - - // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.firewalls.lockdowns.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - '372e67954025e0ba6aaa6d586b9e0b59', - {}, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.firewalls.lockdowns.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - '372e67954025e0ba6aaa6d586b9e0b59', - {}, - ); - }); }); diff --git a/tests/api-resources/firewalls/rules.test.ts b/tests/api-resources/firewalls/rules.test.ts index c9951c543a..f47a84a741 100644 --- a/tests/api-resources/firewalls/rules.test.ts +++ b/tests/api-resources/firewalls/rules.test.ts @@ -31,7 +31,11 @@ describe('resource rules', () => { // skipped: tests are disabled for the time being test.skip('update: only required params', async () => { - const responsePromise = cloudflare.firewalls.rules.update('023e105f4ecef8ad9ca31a8372d0c353', {}); + const responsePromise = cloudflare.firewalls.rules.update( + '023e105f4ecef8ad9ca31a8372d0c353', + '372e67954025e0ba6aaa6d586b9e0b60', + {}, + ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -43,7 +47,11 @@ describe('resource rules', () => { // skipped: tests are disabled for the time being test.skip('update: required and optional params', async () => { - const response = await cloudflare.firewalls.rules.update('023e105f4ecef8ad9ca31a8372d0c353', {}); + const response = await cloudflare.firewalls.rules.update( + '023e105f4ecef8ad9ca31a8372d0c353', + '372e67954025e0ba6aaa6d586b9e0b60', + {}, + ); }); // skipped: tests are disabled for the time being @@ -97,11 +105,8 @@ describe('resource rules', () => { }); // skipped: tests are disabled for the time being - test.skip('get', async () => { - const responsePromise = cloudflare.firewalls.rules.get( - '023e105f4ecef8ad9ca31a8372d0c353', - '372e67954025e0ba6aaa6d586b9e0b60', - ); + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.firewalls.rules.edit('023e105f4ecef8ad9ca31a8372d0c353', {}); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -112,21 +117,15 @@ describe('resource rules', () => { }); // skipped: tests are disabled for the time being - test.skip('get: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.firewalls.rules.get('023e105f4ecef8ad9ca31a8372d0c353', '372e67954025e0ba6aaa6d586b9e0b60', { - path: '/_stainless_unknown_path', - }), - ).rejects.toThrow(Cloudflare.NotFoundError); + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.firewalls.rules.edit('023e105f4ecef8ad9ca31a8372d0c353', {}); }); // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.firewalls.rules.replace( + test.skip('get', async () => { + const responsePromise = cloudflare.firewalls.rules.get( '023e105f4ecef8ad9ca31a8372d0c353', '372e67954025e0ba6aaa6d586b9e0b60', - {}, ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -138,11 +137,12 @@ describe('resource rules', () => { }); // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.firewalls.rules.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - '372e67954025e0ba6aaa6d586b9e0b60', - {}, - ); + test.skip('get: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.firewalls.rules.get('023e105f4ecef8ad9ca31a8372d0c353', '372e67954025e0ba6aaa6d586b9e0b60', { + path: '/_stainless_unknown_path', + }), + ).rejects.toThrow(Cloudflare.NotFoundError); }); }); diff --git a/tests/api-resources/firewalls/ua-rules.test.ts b/tests/api-resources/firewalls/ua-rules.test.ts index a60917eec6..b2ba9e42f0 100644 --- a/tests/api-resources/firewalls/ua-rules.test.ts +++ b/tests/api-resources/firewalls/ua-rules.test.ts @@ -29,6 +29,31 @@ describe('resource uaRules', () => { const response = await cloudflare.firewalls.uaRules.create('023e105f4ecef8ad9ca31a8372d0c353', {}); }); + // skipped: tests are disabled for the time being + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.firewalls.uaRules.update( + '023e105f4ecef8ad9ca31a8372d0c353', + '372e67954025e0ba6aaa6d586b9e0b59', + {}, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('update: required and optional params', async () => { + const response = await cloudflare.firewalls.uaRules.update( + '023e105f4ecef8ad9ca31a8372d0c353', + '372e67954025e0ba6aaa6d586b9e0b59', + {}, + ); + }); + // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.firewalls.uaRules.list('023e105f4ecef8ad9ca31a8372d0c353'); @@ -104,29 +129,4 @@ describe('resource uaRules', () => { ), ).rejects.toThrow(Cloudflare.NotFoundError); }); - - // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.firewalls.uaRules.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - '372e67954025e0ba6aaa6d586b9e0b59', - {}, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.firewalls.uaRules.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - '372e67954025e0ba6aaa6d586b9e0b59', - {}, - ); - }); }); diff --git a/tests/api-resources/firewalls/waf/overrides.test.ts b/tests/api-resources/firewalls/waf/overrides.test.ts index 25e6153ae8..e897e2c3df 100644 --- a/tests/api-resources/firewalls/waf/overrides.test.ts +++ b/tests/api-resources/firewalls/waf/overrides.test.ts @@ -29,6 +29,31 @@ describe('resource overrides', () => { const response = await cloudflare.firewalls.waf.overrides.create('023e105f4ecef8ad9ca31a8372d0c353', {}); }); + // skipped: tests are disabled for the time being + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.firewalls.waf.overrides.update( + '023e105f4ecef8ad9ca31a8372d0c353', + 'de677e5818985db1285d0e80225f06e5', + {}, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('update: required and optional params', async () => { + const response = await cloudflare.firewalls.waf.overrides.update( + '023e105f4ecef8ad9ca31a8372d0c353', + 'de677e5818985db1285d0e80225f06e5', + {}, + ); + }); + // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.firewalls.waf.overrides.list('023e105f4ecef8ad9ca31a8372d0c353'); @@ -104,29 +129,4 @@ describe('resource overrides', () => { ), ).rejects.toThrow(Cloudflare.NotFoundError); }); - - // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.firewalls.waf.overrides.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - 'de677e5818985db1285d0e80225f06e5', - {}, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.firewalls.waf.overrides.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - 'de677e5818985db1285d0e80225f06e5', - {}, - ); - }); }); diff --git a/tests/api-resources/firewalls/waf/packages/groups.test.ts b/tests/api-resources/firewalls/waf/packages/groups.test.ts index 2f411359af..676e6821ac 100644 --- a/tests/api-resources/firewalls/waf/packages/groups.test.ts +++ b/tests/api-resources/firewalls/waf/packages/groups.test.ts @@ -12,23 +12,6 @@ const cloudflare = new Cloudflare({ }); describe('resource groups', () => { - // skipped: tests are disabled for the time being - test.skip('update', async () => { - const responsePromise = cloudflare.firewalls.waf.packages.groups.update( - '023e105f4ecef8ad9ca31a8372d0c353', - 'a25a9a7e9c00afc1fb2e0245519d725b', - 'a25a9a7e9c00afc1fb2e0245519d725b', - {}, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.firewalls.waf.packages.groups.list( @@ -69,6 +52,23 @@ describe('resource groups', () => { ).rejects.toThrow(Cloudflare.NotFoundError); }); + // skipped: tests are disabled for the time being + test.skip('edit', async () => { + const responsePromise = cloudflare.firewalls.waf.packages.groups.edit( + '023e105f4ecef8ad9ca31a8372d0c353', + 'a25a9a7e9c00afc1fb2e0245519d725b', + 'a25a9a7e9c00afc1fb2e0245519d725b', + {}, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + // skipped: tests are disabled for the time being test.skip('get', async () => { const responsePromise = cloudflare.firewalls.waf.packages.groups.get( diff --git a/tests/api-resources/firewalls/waf/packages/rules.test.ts b/tests/api-resources/firewalls/waf/packages/rules.test.ts index e894269d53..85ed8cdbfd 100644 --- a/tests/api-resources/firewalls/waf/packages/rules.test.ts +++ b/tests/api-resources/firewalls/waf/packages/rules.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource rules', () => { // skipped: tests are disabled for the time being - test.skip('update', async () => { - const responsePromise = cloudflare.firewalls.waf.packages.rules.update( + test.skip('edit', async () => { + const responsePromise = cloudflare.firewalls.waf.packages.rules.edit( '023e105f4ecef8ad9ca31a8372d0c353', 'a25a9a7e9c00afc1fb2e0245519d725b', 'a25a9a7e9c00afc1fb2e0245519d725b', diff --git a/tests/api-resources/gateways/audit-ssh-settings.test.ts b/tests/api-resources/gateways/audit-ssh-settings.test.ts index 2c43df4b43..426196651e 100644 --- a/tests/api-resources/gateways/audit-ssh-settings.test.ts +++ b/tests/api-resources/gateways/audit-ssh-settings.test.ts @@ -13,8 +13,10 @@ const cloudflare = new Cloudflare({ describe('resource auditSSHSettings', () => { // skipped: tests are disabled for the time being - test.skip('get', async () => { - const responsePromise = cloudflare.gateways.auditSSHSettings.get('699d98642c564d2e855e9661899b7252'); + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.gateways.auditSSHSettings.update('699d98642c564d2e855e9661899b7252', { + public_key: '1pyl6I1tL7xfJuFYVzXlUW8uXXlpxegHXBzGCBKaSFA=', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -25,20 +27,16 @@ describe('resource auditSSHSettings', () => { }); // skipped: tests are disabled for the time being - test.skip('get: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.gateways.auditSSHSettings.get('699d98642c564d2e855e9661899b7252', { - path: '/_stainless_unknown_path', - }), - ).rejects.toThrow(Cloudflare.NotFoundError); + test.skip('update: required and optional params', async () => { + const response = await cloudflare.gateways.auditSSHSettings.update('699d98642c564d2e855e9661899b7252', { + public_key: '1pyl6I1tL7xfJuFYVzXlUW8uXXlpxegHXBzGCBKaSFA=', + seed_id: 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + }); }); // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.gateways.auditSSHSettings.replace('699d98642c564d2e855e9661899b7252', { - public_key: '1pyl6I1tL7xfJuFYVzXlUW8uXXlpxegHXBzGCBKaSFA=', - }); + test.skip('get', async () => { + const responsePromise = cloudflare.gateways.auditSSHSettings.get('699d98642c564d2e855e9661899b7252'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -49,10 +47,12 @@ describe('resource auditSSHSettings', () => { }); // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.gateways.auditSSHSettings.replace('699d98642c564d2e855e9661899b7252', { - public_key: '1pyl6I1tL7xfJuFYVzXlUW8uXXlpxegHXBzGCBKaSFA=', - seed_id: 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', - }); + test.skip('get: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.gateways.auditSSHSettings.get('699d98642c564d2e855e9661899b7252', { + path: '/_stainless_unknown_path', + }), + ).rejects.toThrow(Cloudflare.NotFoundError); }); }); diff --git a/tests/api-resources/gateways/configurations.test.ts b/tests/api-resources/gateways/configurations.test.ts index 96a67023b0..bbc1849c20 100644 --- a/tests/api-resources/gateways/configurations.test.ts +++ b/tests/api-resources/gateways/configurations.test.ts @@ -24,6 +24,18 @@ describe('resource configurations', () => { expect(dataAndResponse.response).toBe(rawResponse); }); + // skipped: tests are disabled for the time being + test.skip('edit', async () => { + const responsePromise = cloudflare.gateways.configurations.edit('699d98642c564d2e855e9661899b7252', {}); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + // skipped: tests are disabled for the time being test.skip('get', async () => { const responsePromise = cloudflare.gateways.configurations.get('699d98642c564d2e855e9661899b7252'); @@ -45,19 +57,4 @@ describe('resource configurations', () => { }), ).rejects.toThrow(Cloudflare.NotFoundError); }); - - // skipped: tests are disabled for the time being - test.skip('replace', async () => { - const responsePromise = cloudflare.gateways.configurations.replace( - '699d98642c564d2e855e9661899b7252', - {}, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); }); diff --git a/tests/api-resources/gateways/lists/lists.test.ts b/tests/api-resources/gateways/lists/lists.test.ts index 4024380895..43b2a9365f 100644 --- a/tests/api-resources/gateways/lists/lists.test.ts +++ b/tests/api-resources/gateways/lists/lists.test.ts @@ -37,6 +37,31 @@ describe('resource lists', () => { }); }); + // skipped: tests are disabled for the time being + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.gateways.lists.update( + '699d98642c564d2e855e9661899b7252', + 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + { name: 'Admin Serial Numbers' }, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('update: required and optional params', async () => { + const response = await cloudflare.gateways.lists.update( + '699d98642c564d2e855e9661899b7252', + 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + { name: 'Admin Serial Numbers', description: 'The serial numbers for administrators' }, + ); + }); + // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.gateways.lists.list('699d98642c564d2e855e9661899b7252'); @@ -100,29 +125,4 @@ describe('resource lists', () => { ), ).rejects.toThrow(Cloudflare.NotFoundError); }); - - // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.gateways.lists.replace( - '699d98642c564d2e855e9661899b7252', - 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', - { name: 'Admin Serial Numbers' }, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.gateways.lists.replace( - '699d98642c564d2e855e9661899b7252', - 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', - { name: 'Admin Serial Numbers', description: 'The serial numbers for administrators' }, - ); - }); }); diff --git a/tests/api-resources/gateways/locations.test.ts b/tests/api-resources/gateways/locations.test.ts index de29febfb4..1c7a5a393c 100644 --- a/tests/api-resources/gateways/locations.test.ts +++ b/tests/api-resources/gateways/locations.test.ts @@ -36,6 +36,36 @@ describe('resource locations', () => { }); }); + // skipped: tests are disabled for the time being + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.gateways.locations.update( + '699d98642c564d2e855e9661899b7252', + 'ed35569b41ce4d1facfe683550f54086', + { name: 'Austin Office Location' }, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('update: required and optional params', async () => { + const response = await cloudflare.gateways.locations.update( + '699d98642c564d2e855e9661899b7252', + 'ed35569b41ce4d1facfe683550f54086', + { + name: 'Austin Office Location', + client_default: false, + ecs_support: false, + networks: [{ network: '192.0.2.1/32' }, { network: '192.0.2.1/32' }, { network: '192.0.2.1/32' }], + }, + ); + }); + // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.gateways.locations.list('699d98642c564d2e855e9661899b7252'); @@ -99,34 +129,4 @@ describe('resource locations', () => { ), ).rejects.toThrow(Cloudflare.NotFoundError); }); - - // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.gateways.locations.replace( - '699d98642c564d2e855e9661899b7252', - 'ed35569b41ce4d1facfe683550f54086', - { name: 'Austin Office Location' }, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.gateways.locations.replace( - '699d98642c564d2e855e9661899b7252', - 'ed35569b41ce4d1facfe683550f54086', - { - name: 'Austin Office Location', - client_default: false, - ecs_support: false, - networks: [{ network: '192.0.2.1/32' }, { network: '192.0.2.1/32' }, { network: '192.0.2.1/32' }], - }, - ); - }); }); diff --git a/tests/api-resources/gateways/loggings.test.ts b/tests/api-resources/gateways/loggings.test.ts index 675e2fc3c9..96e585c9a1 100644 --- a/tests/api-resources/gateways/loggings.test.ts +++ b/tests/api-resources/gateways/loggings.test.ts @@ -12,6 +12,18 @@ const cloudflare = new Cloudflare({ }); describe('resource loggings', () => { + // skipped: tests are disabled for the time being + test.skip('update', async () => { + const responsePromise = cloudflare.gateways.loggings.update('699d98642c564d2e855e9661899b7252', {}); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + // skipped: tests are disabled for the time being test.skip('get', async () => { const responsePromise = cloudflare.gateways.loggings.get('699d98642c564d2e855e9661899b7252'); @@ -33,16 +45,4 @@ describe('resource loggings', () => { }), ).rejects.toThrow(Cloudflare.NotFoundError); }); - - // skipped: tests are disabled for the time being - test.skip('replace', async () => { - const responsePromise = cloudflare.gateways.loggings.replace('699d98642c564d2e855e9661899b7252', {}); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); }); diff --git a/tests/api-resources/gateways/proxy-endpoints.test.ts b/tests/api-resources/gateways/proxy-endpoints.test.ts index d1b4bbbdc3..879d016f77 100644 --- a/tests/api-resources/gateways/proxy-endpoints.test.ts +++ b/tests/api-resources/gateways/proxy-endpoints.test.ts @@ -36,22 +36,6 @@ describe('resource proxyEndpoints', () => { }); }); - // skipped: tests are disabled for the time being - test.skip('update', async () => { - const responsePromise = cloudflare.gateways.proxyEndpoints.update( - '699d98642c564d2e855e9661899b7252', - 'ed35569b41ce4d1facfe683550f54086', - {}, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.gateways.proxyEndpoints.list('699d98642c564d2e855e9661899b7252'); @@ -89,6 +73,22 @@ describe('resource proxyEndpoints', () => { expect(dataAndResponse.response).toBe(rawResponse); }); + // skipped: tests are disabled for the time being + test.skip('edit', async () => { + const responsePromise = cloudflare.gateways.proxyEndpoints.edit( + '699d98642c564d2e855e9661899b7252', + 'ed35569b41ce4d1facfe683550f54086', + {}, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + // skipped: tests are disabled for the time being test.skip('get', async () => { const responsePromise = cloudflare.gateways.proxyEndpoints.get( diff --git a/tests/api-resources/gateways/rules.test.ts b/tests/api-resources/gateways/rules.test.ts index 133827c43c..f4cf30ee45 100644 --- a/tests/api-resources/gateways/rules.test.ts +++ b/tests/api-resources/gateways/rules.test.ts @@ -117,72 +117,8 @@ describe('resource rules', () => { }); // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.gateways.rules.list('699d98642c564d2e855e9661899b7252'); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.gateways.rules.list('699d98642c564d2e855e9661899b7252', { - path: '/_stainless_unknown_path', - }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - // skipped: tests are disabled for the time being - test.skip('delete', async () => { - const responsePromise = cloudflare.gateways.rules.delete( - '699d98642c564d2e855e9661899b7252', - 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('get', async () => { - const responsePromise = cloudflare.gateways.rules.get( - '699d98642c564d2e855e9661899b7252', - 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('get: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.gateways.rules.get( - '699d98642c564d2e855e9661899b7252', - 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.gateways.rules.replace( + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.gateways.rules.update( '699d98642c564d2e855e9661899b7252', 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { action: 'allow', name: 'block bad websites' }, @@ -197,8 +133,8 @@ describe('resource rules', () => { }); // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.gateways.rules.replace( + test.skip('update: required and optional params', async () => { + const response = await cloudflare.gateways.rules.update( '699d98642c564d2e855e9661899b7252', 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { @@ -288,4 +224,68 @@ describe('resource rules', () => { }, ); }); + + // skipped: tests are disabled for the time being + test.skip('list', async () => { + const responsePromise = cloudflare.gateways.rules.list('699d98642c564d2e855e9661899b7252'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('list: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.gateways.rules.list('699d98642c564d2e855e9661899b7252', { + path: '/_stainless_unknown_path', + }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('delete', async () => { + const responsePromise = cloudflare.gateways.rules.delete( + '699d98642c564d2e855e9661899b7252', + 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('get', async () => { + const responsePromise = cloudflare.gateways.rules.get( + '699d98642c564d2e855e9661899b7252', + 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.gateways.rules.get( + '699d98642c564d2e855e9661899b7252', + 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); }); diff --git a/tests/api-resources/healthchecks/healthchecks.test.ts b/tests/api-resources/healthchecks/healthchecks.test.ts index 849346b933..6bb983739d 100644 --- a/tests/api-resources/healthchecks/healthchecks.test.ts +++ b/tests/api-resources/healthchecks/healthchecks.test.ts @@ -55,6 +55,54 @@ describe('resource healthchecks', () => { }); }); + // skipped: tests are disabled for the time being + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.healthchecks.update( + '023e105f4ecef8ad9ca31a8372d0c353', + '023e105f4ecef8ad9ca31a8372d0c353', + { address: 'www.example.com', name: 'server-1' }, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('update: required and optional params', async () => { + const response = await cloudflare.healthchecks.update( + '023e105f4ecef8ad9ca31a8372d0c353', + '023e105f4ecef8ad9ca31a8372d0c353', + { + address: 'www.example.com', + name: 'server-1', + check_regions: ['WEU', 'ENAM'], + consecutive_fails: 0, + consecutive_successes: 0, + description: 'Health check for www.example.com', + http_config: { + allow_insecure: true, + expected_body: 'success', + expected_codes: ['2xx', '302'], + follow_redirects: true, + header: { Host: ['example.com'], 'X-App-ID': ['abc123'] }, + method: 'GET', + path: '/health', + port: 0, + }, + interval: 0, + retries: 0, + suspended: true, + tcp_config: { method: 'connection_established', port: 0 }, + timeout: 0, + type: 'HTTPS', + }, + ); + }); + // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.healthchecks.list('023e105f4ecef8ad9ca31a8372d0c353'); @@ -114,52 +162,4 @@ describe('resource healthchecks', () => { }), ).rejects.toThrow(Cloudflare.NotFoundError); }); - - // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.healthchecks.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - '023e105f4ecef8ad9ca31a8372d0c353', - { address: 'www.example.com', name: 'server-1' }, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.healthchecks.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - '023e105f4ecef8ad9ca31a8372d0c353', - { - address: 'www.example.com', - name: 'server-1', - check_regions: ['WEU', 'ENAM'], - consecutive_fails: 0, - consecutive_successes: 0, - description: 'Health check for www.example.com', - http_config: { - allow_insecure: true, - expected_body: 'success', - expected_codes: ['2xx', '302'], - follow_redirects: true, - header: { Host: ['example.com'], 'X-App-ID': ['abc123'] }, - method: 'GET', - path: '/health', - port: 0, - }, - interval: 0, - retries: 0, - suspended: true, - tcp_config: { method: 'connection_established', port: 0 }, - timeout: 0, - type: 'HTTPS', - }, - ); - }); }); diff --git a/tests/api-resources/hostnames/settings/tls.test.ts b/tests/api-resources/hostnames/settings/tls.test.ts index 342079b833..32f8a5efd6 100644 --- a/tests/api-resources/hostnames/settings/tls.test.ts +++ b/tests/api-resources/hostnames/settings/tls.test.ts @@ -12,6 +12,33 @@ const cloudflare = new Cloudflare({ }); describe('resource tls', () => { + // skipped: tests are disabled for the time being + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.hostnames.settings.tls.update( + '023e105f4ecef8ad9ca31a8372d0c353', + 'ciphers', + 'app.example.com', + { value: ['ECDHE-RSA-AES128-GCM-SHA256', 'AES128-GCM-SHA256'] }, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('update: required and optional params', async () => { + const response = await cloudflare.hostnames.settings.tls.update( + '023e105f4ecef8ad9ca31a8372d0c353', + 'ciphers', + 'app.example.com', + { value: ['ECDHE-RSA-AES128-GCM-SHA256', 'AES128-GCM-SHA256'] }, + ); + }); + // skipped: tests are disabled for the time being test.skip('delete', async () => { const responsePromise = cloudflare.hostnames.settings.tls.delete( @@ -65,31 +92,4 @@ describe('resource tls', () => { }), ).rejects.toThrow(Cloudflare.NotFoundError); }); - - // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.hostnames.settings.tls.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - 'ciphers', - 'app.example.com', - { value: ['ECDHE-RSA-AES128-GCM-SHA256', 'AES128-GCM-SHA256'] }, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.hostnames.settings.tls.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - 'ciphers', - 'app.example.com', - { value: ['ECDHE-RSA-AES128-GCM-SHA256', 'AES128-GCM-SHA256'] }, - ); - }); }); diff --git a/tests/api-resources/hyperdrive/configs.test.ts b/tests/api-resources/hyperdrive/configs.test.ts index 8613b075bb..2bd68bccfc 100644 --- a/tests/api-resources/hyperdrive/configs.test.ts +++ b/tests/api-resources/hyperdrive/configs.test.ts @@ -33,6 +33,31 @@ describe('resource configs', () => { }); }); + // skipped: tests are disabled for the time being + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.hyperdrive.configs.update( + '023e105f4ecef8ad9ca31a8372d0c353', + '023e105f4ecef8ad9ca31a8372d0c353', + { origin: { password: 'password1234!' } }, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('update: required and optional params', async () => { + const response = await cloudflare.hyperdrive.configs.update( + '023e105f4ecef8ad9ca31a8372d0c353', + '023e105f4ecef8ad9ca31a8372d0c353', + { origin: { password: 'password1234!' } }, + ); + }); + // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.hyperdrive.configs.list('023e105f4ecef8ad9ca31a8372d0c353'); @@ -108,29 +133,4 @@ describe('resource configs', () => { ), ).rejects.toThrow(Cloudflare.NotFoundError); }); - - // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.hyperdrive.configs.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - '023e105f4ecef8ad9ca31a8372d0c353', - { origin: { password: 'password1234!' } }, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.hyperdrive.configs.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - '023e105f4ecef8ad9ca31a8372d0c353', - { origin: { password: 'password1234!' } }, - ); - }); }); diff --git a/tests/api-resources/images/v1s/v1s.test.ts b/tests/api-resources/images/v1s/v1s.test.ts index 84ba80ad20..cc9769214e 100644 --- a/tests/api-resources/images/v1s/v1s.test.ts +++ b/tests/api-resources/images/v1s/v1s.test.ts @@ -29,18 +29,6 @@ describe('resource v1s', () => { const response = await cloudflare.images.v1s.create('023e105f4ecef8ad9ca31a8372d0c353', { file: {} }); }); - // skipped: tests are disabled for the time being - test.skip('update', async () => { - const responsePromise = cloudflare.images.v1s.update('023e105f4ecef8ad9ca31a8372d0c353', 'string', {}); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.images.v1s.list('023e105f4ecef8ad9ca31a8372d0c353'); @@ -85,6 +73,18 @@ describe('resource v1s', () => { expect(dataAndResponse.response).toBe(rawResponse); }); + // skipped: tests are disabled for the time being + test.skip('edit', async () => { + const responsePromise = cloudflare.images.v1s.edit('023e105f4ecef8ad9ca31a8372d0c353', 'string', {}); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + // skipped: tests are disabled for the time being test.skip('get', async () => { const responsePromise = cloudflare.images.v1s.get('023e105f4ecef8ad9ca31a8372d0c353', 'string'); diff --git a/tests/api-resources/images/v1s/variants.test.ts b/tests/api-resources/images/v1s/variants.test.ts index 6c28b3e604..befaaecd79 100644 --- a/tests/api-resources/images/v1s/variants.test.ts +++ b/tests/api-resources/images/v1s/variants.test.ts @@ -36,30 +36,6 @@ describe('resource variants', () => { }); }); - // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.images.v1s.variants.update( - '023e105f4ecef8ad9ca31a8372d0c353', - 'hero', - { options: { fit: 'scale-down', height: 768, metadata: 'none', width: 1366 } }, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.images.v1s.variants.update('023e105f4ecef8ad9ca31a8372d0c353', 'hero', { - options: { fit: 'scale-down', height: 768, metadata: 'none', width: 1366 }, - neverRequireSignedURLs: true, - }); - }); - // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.images.v1s.variants.list('023e105f4ecef8ad9ca31a8372d0c353'); @@ -94,6 +70,28 @@ describe('resource variants', () => { expect(dataAndResponse.response).toBe(rawResponse); }); + // skipped: tests are disabled for the time being + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.images.v1s.variants.edit('023e105f4ecef8ad9ca31a8372d0c353', 'hero', { + options: { fit: 'scale-down', height: 768, metadata: 'none', width: 1366 }, + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.images.v1s.variants.edit('023e105f4ecef8ad9ca31a8372d0c353', 'hero', { + options: { fit: 'scale-down', height: 768, metadata: 'none', width: 1366 }, + neverRequireSignedURLs: true, + }); + }); + // skipped: tests are disabled for the time being test.skip('get', async () => { const responsePromise = cloudflare.images.v1s.variants.get('023e105f4ecef8ad9ca31a8372d0c353', 'hero'); diff --git a/tests/api-resources/intel/indicator-feeds/indicator-feeds.test.ts b/tests/api-resources/intel/indicator-feeds/indicator-feeds.test.ts index 12722f4167..64f01fed5d 100644 --- a/tests/api-resources/intel/indicator-feeds/indicator-feeds.test.ts +++ b/tests/api-resources/intel/indicator-feeds/indicator-feeds.test.ts @@ -24,6 +24,22 @@ describe('resource indicatorFeeds', () => { expect(dataAndResponse.response).toBe(rawResponse); }); + // skipped: tests are disabled for the time being + test.skip('update', async () => { + const responsePromise = cloudflare.intel.indicatorFeeds.update( + '023e105f4ecef8ad9ca31a8372d0c353', + 12, + {}, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.intel.indicatorFeeds.list('023e105f4ecef8ad9ca31a8372d0c353'); @@ -89,20 +105,4 @@ describe('resource indicatorFeeds', () => { }), ).rejects.toThrow(Cloudflare.NotFoundError); }); - - // skipped: tests are disabled for the time being - test.skip('replace', async () => { - const responsePromise = cloudflare.intel.indicatorFeeds.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - 12, - {}, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); }); diff --git a/tests/api-resources/keyless-certificates.test.ts b/tests/api-resources/keyless-certificates.test.ts index ec5b69ed50..61ad720498 100644 --- a/tests/api-resources/keyless-certificates.test.ts +++ b/tests/api-resources/keyless-certificates.test.ts @@ -42,22 +42,6 @@ describe('resource keylessCertificates', () => { }); }); - // skipped: tests are disabled for the time being - test.skip('update', async () => { - const responsePromise = cloudflare.keylessCertificates.update( - '023e105f4ecef8ad9ca31a8372d0c353', - '023e105f4ecef8ad9ca31a8372d0c353', - {}, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.keylessCertificates.list('023e105f4ecef8ad9ca31a8372d0c353'); @@ -95,6 +79,22 @@ describe('resource keylessCertificates', () => { expect(dataAndResponse.response).toBe(rawResponse); }); + // skipped: tests are disabled for the time being + test.skip('edit', async () => { + const responsePromise = cloudflare.keylessCertificates.edit( + '023e105f4ecef8ad9ca31a8372d0c353', + '023e105f4ecef8ad9ca31a8372d0c353', + {}, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + // skipped: tests are disabled for the time being test.skip('get', async () => { const responsePromise = cloudflare.keylessCertificates.get( diff --git a/tests/api-resources/load-balancers/load-balancers.test.ts b/tests/api-resources/load-balancers/load-balancers.test.ts index 251504affd..f8f2bdea0e 100644 --- a/tests/api-resources/load-balancers/load-balancers.test.ts +++ b/tests/api-resources/load-balancers/load-balancers.test.ts @@ -245,22 +245,6 @@ describe('resource loadBalancers', () => { }); }); - // skipped: tests are disabled for the time being - test.skip('update', async () => { - const responsePromise = cloudflare.loadBalancers.update( - '699d98642c564d2e855e9661899b7252', - '699d98642c564d2e855e9661899b7252', - {}, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.loadBalancers.list('699d98642c564d2e855e9661899b7252'); @@ -296,6 +280,22 @@ describe('resource loadBalancers', () => { expect(dataAndResponse.response).toBe(rawResponse); }); + // skipped: tests are disabled for the time being + test.skip('edit', async () => { + const responsePromise = cloudflare.loadBalancers.edit( + '699d98642c564d2e855e9661899b7252', + '699d98642c564d2e855e9661899b7252', + {}, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + // skipped: tests are disabled for the time being test.skip('get', async () => { const responsePromise = cloudflare.loadBalancers.get( diff --git a/tests/api-resources/load-balancers/monitors/monitors.test.ts b/tests/api-resources/load-balancers/monitors/monitors.test.ts index 40a96498b2..ef1584feca 100644 --- a/tests/api-resources/load-balancers/monitors/monitors.test.ts +++ b/tests/api-resources/load-balancers/monitors/monitors.test.ts @@ -49,8 +49,45 @@ describe('resource monitors', () => { }); // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.loadBalancers.monitors.update( + test.skip('list', async () => { + const responsePromise = cloudflare.loadBalancers.monitors.list('023e105f4ecef8ad9ca31a8372d0c353'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('list: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.loadBalancers.monitors.list('023e105f4ecef8ad9ca31a8372d0c353', { + path: '/_stainless_unknown_path', + }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('delete', async () => { + const responsePromise = cloudflare.loadBalancers.monitors.delete( + '023e105f4ecef8ad9ca31a8372d0c353', + 'f1aba936b94213e5b8dca0c0dbf1f9cc', + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.loadBalancers.monitors.edit( '023e105f4ecef8ad9ca31a8372d0c353', 'f1aba936b94213e5b8dca0c0dbf1f9cc', { expected_codes: '2xx' }, @@ -65,8 +102,8 @@ describe('resource monitors', () => { }); // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.loadBalancers.monitors.update( + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.loadBalancers.monitors.edit( '023e105f4ecef8ad9ca31a8372d0c353', 'f1aba936b94213e5b8dca0c0dbf1f9cc', { @@ -90,43 +127,6 @@ describe('resource monitors', () => { ); }); - // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.loadBalancers.monitors.list('023e105f4ecef8ad9ca31a8372d0c353'); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.loadBalancers.monitors.list('023e105f4ecef8ad9ca31a8372d0c353', { - path: '/_stainless_unknown_path', - }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - // skipped: tests are disabled for the time being - test.skip('delete', async () => { - const responsePromise = cloudflare.loadBalancers.monitors.delete( - '023e105f4ecef8ad9ca31a8372d0c353', - 'f1aba936b94213e5b8dca0c0dbf1f9cc', - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - // skipped: tests are disabled for the time being test.skip('get', async () => { const responsePromise = cloudflare.loadBalancers.monitors.get( diff --git a/tests/api-resources/load-balancers/pools/pools.test.ts b/tests/api-resources/load-balancers/pools/pools.test.ts index 5016de8304..c6c2082fae 100644 --- a/tests/api-resources/load-balancers/pools/pools.test.ts +++ b/tests/api-resources/load-balancers/pools/pools.test.ts @@ -78,22 +78,6 @@ describe('resource pools', () => { }); }); - // skipped: tests are disabled for the time being - test.skip('update', async () => { - const responsePromise = cloudflare.loadBalancers.pools.update( - '023e105f4ecef8ad9ca31a8372d0c353', - '17b5962d775c646f3f9725cbc7a53df4', - {}, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.loadBalancers.pools.list('023e105f4ecef8ad9ca31a8372d0c353'); @@ -143,6 +127,22 @@ describe('resource pools', () => { expect(dataAndResponse.response).toBe(rawResponse); }); + // skipped: tests are disabled for the time being + test.skip('edit', async () => { + const responsePromise = cloudflare.loadBalancers.pools.edit( + '023e105f4ecef8ad9ca31a8372d0c353', + '17b5962d775c646f3f9725cbc7a53df4', + {}, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + // skipped: tests are disabled for the time being test.skip('get', async () => { const responsePromise = cloudflare.loadBalancers.pools.get( diff --git a/tests/api-resources/logpush/jobs.test.ts b/tests/api-resources/logpush/jobs.test.ts index 59cef9a9cf..111823c5c8 100644 --- a/tests/api-resources/logpush/jobs.test.ts +++ b/tests/api-resources/logpush/jobs.test.ts @@ -53,6 +53,23 @@ describe('resource jobs', () => { }); }); + // skipped: tests are disabled for the time being + test.skip('update', async () => { + const responsePromise = cloudflare.logpush.jobs.update( + 'string', + '023e105f4ecef8ad9ca31a8372d0c353', + 1, + {}, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.logpush.jobs.list('string', '023e105f4ecef8ad9ca31a8372d0c353'); @@ -108,21 +125,4 @@ describe('resource jobs', () => { }), ).rejects.toThrow(Cloudflare.NotFoundError); }); - - // skipped: tests are disabled for the time being - test.skip('replace', async () => { - const responsePromise = cloudflare.logpush.jobs.replace( - 'string', - '023e105f4ecef8ad9ca31a8372d0c353', - 1, - {}, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); }); diff --git a/tests/api-resources/magics/cf-interconnects.test.ts b/tests/api-resources/magics/cf-interconnects.test.ts index a3b4434afa..f41bcec9f3 100644 --- a/tests/api-resources/magics/cf-interconnects.test.ts +++ b/tests/api-resources/magics/cf-interconnects.test.ts @@ -12,6 +12,22 @@ const cloudflare = new Cloudflare({ }); describe('resource cfInterconnects', () => { + // skipped: tests are disabled for the time being + test.skip('update', async () => { + const responsePromise = cloudflare.magics.cfInterconnects.update( + '023e105f4ecef8ad9ca31a8372d0c353', + '023e105f4ecef8ad9ca31a8372d0c353', + {}, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.magics.cfInterconnects.list('023e105f4ecef8ad9ca31a8372d0c353'); @@ -60,20 +76,4 @@ describe('resource cfInterconnects', () => { ), ).rejects.toThrow(Cloudflare.NotFoundError); }); - - // skipped: tests are disabled for the time being - test.skip('replace', async () => { - const responsePromise = cloudflare.magics.cfInterconnects.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - '023e105f4ecef8ad9ca31a8372d0c353', - {}, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); }); diff --git a/tests/api-resources/magics/gre-tunnels.test.ts b/tests/api-resources/magics/gre-tunnels.test.ts index 55851ed8c3..9b32ccbf0a 100644 --- a/tests/api-resources/magics/gre-tunnels.test.ts +++ b/tests/api-resources/magics/gre-tunnels.test.ts @@ -29,6 +29,51 @@ describe('resource greTunnels', () => { const response = await cloudflare.magics.greTunnels.create('023e105f4ecef8ad9ca31a8372d0c353', {}); }); + // skipped: tests are disabled for the time being + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.magics.greTunnels.update( + '023e105f4ecef8ad9ca31a8372d0c353', + '023e105f4ecef8ad9ca31a8372d0c353', + { + cloudflare_gre_endpoint: '203.0.113.1', + customer_gre_endpoint: '203.0.113.1', + interface_address: '192.0.2.0/31', + name: 'GRE_1', + }, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('update: required and optional params', async () => { + const response = await cloudflare.magics.greTunnels.update( + '023e105f4ecef8ad9ca31a8372d0c353', + '023e105f4ecef8ad9ca31a8372d0c353', + { + cloudflare_gre_endpoint: '203.0.113.1', + customer_gre_endpoint: '203.0.113.1', + interface_address: '192.0.2.0/31', + name: 'GRE_1', + description: 'Tunnel for ISP X', + health_check: { + direction: 'bidirectional', + enabled: true, + rate: 'low', + target: '203.0.113.1', + type: 'request', + }, + mtu: 0, + ttl: 0, + }, + ); + }); + // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.magics.greTunnels.list('023e105f4ecef8ad9ca31a8372d0c353'); @@ -92,49 +137,4 @@ describe('resource greTunnels', () => { ), ).rejects.toThrow(Cloudflare.NotFoundError); }); - - // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.magics.greTunnels.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - '023e105f4ecef8ad9ca31a8372d0c353', - { - cloudflare_gre_endpoint: '203.0.113.1', - customer_gre_endpoint: '203.0.113.1', - interface_address: '192.0.2.0/31', - name: 'GRE_1', - }, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.magics.greTunnels.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - '023e105f4ecef8ad9ca31a8372d0c353', - { - cloudflare_gre_endpoint: '203.0.113.1', - customer_gre_endpoint: '203.0.113.1', - interface_address: '192.0.2.0/31', - name: 'GRE_1', - description: 'Tunnel for ISP X', - health_check: { - direction: 'bidirectional', - enabled: true, - rate: 'low', - target: '203.0.113.1', - type: 'request', - }, - mtu: 0, - ttl: 0, - }, - ); - }); }); diff --git a/tests/api-resources/magics/ipsec-tunnels/ipsec-tunnels.test.ts b/tests/api-resources/magics/ipsec-tunnels/ipsec-tunnels.test.ts index 8940f47d0b..01c2e5feb2 100644 --- a/tests/api-resources/magics/ipsec-tunnels/ipsec-tunnels.test.ts +++ b/tests/api-resources/magics/ipsec-tunnels/ipsec-tunnels.test.ts @@ -41,6 +41,39 @@ describe('resource ipsecTunnels', () => { }); }); + // skipped: tests are disabled for the time being + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.magics.ipsecTunnels.update( + '023e105f4ecef8ad9ca31a8372d0c353', + '023e105f4ecef8ad9ca31a8372d0c353', + { cloudflare_endpoint: '203.0.113.1', interface_address: '192.0.2.0/31', name: 'IPsec_1' }, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('update: required and optional params', async () => { + const response = await cloudflare.magics.ipsecTunnels.update( + '023e105f4ecef8ad9ca31a8372d0c353', + '023e105f4ecef8ad9ca31a8372d0c353', + { + cloudflare_endpoint: '203.0.113.1', + interface_address: '192.0.2.0/31', + name: 'IPsec_1', + customer_endpoint: '203.0.113.1', + description: 'Tunnel for ISP X', + psk: 'O3bwKSjnaoCxDoUxjcq4Rk8ZKkezQUiy', + replay_protection: false, + }, + ); + }); + // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.magics.ipsecTunnels.list('023e105f4ecef8ad9ca31a8372d0c353'); @@ -104,37 +137,4 @@ describe('resource ipsecTunnels', () => { ), ).rejects.toThrow(Cloudflare.NotFoundError); }); - - // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.magics.ipsecTunnels.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - '023e105f4ecef8ad9ca31a8372d0c353', - { cloudflare_endpoint: '203.0.113.1', interface_address: '192.0.2.0/31', name: 'IPsec_1' }, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.magics.ipsecTunnels.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - '023e105f4ecef8ad9ca31a8372d0c353', - { - cloudflare_endpoint: '203.0.113.1', - interface_address: '192.0.2.0/31', - name: 'IPsec_1', - customer_endpoint: '203.0.113.1', - description: 'Tunnel for ISP X', - psk: 'O3bwKSjnaoCxDoUxjcq4Rk8ZKkezQUiy', - replay_protection: false, - }, - ); - }); }); diff --git a/tests/api-resources/magics/routes.test.ts b/tests/api-resources/magics/routes.test.ts index e12fb5d936..aa151cfc7c 100644 --- a/tests/api-resources/magics/routes.test.ts +++ b/tests/api-resources/magics/routes.test.ts @@ -29,6 +29,38 @@ describe('resource routes', () => { const response = await cloudflare.magics.routes.create('023e105f4ecef8ad9ca31a8372d0c353', {}); }); + // skipped: tests are disabled for the time being + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.magics.routes.update( + '023e105f4ecef8ad9ca31a8372d0c353', + '023e105f4ecef8ad9ca31a8372d0c353', + { nexthop: '203.0.113.1', prefix: '192.0.2.0/24', priority: 0 }, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('update: required and optional params', async () => { + const response = await cloudflare.magics.routes.update( + '023e105f4ecef8ad9ca31a8372d0c353', + '023e105f4ecef8ad9ca31a8372d0c353', + { + nexthop: '203.0.113.1', + prefix: '192.0.2.0/24', + priority: 0, + description: 'New route for new prefix 203.0.113.1', + scope: { colo_names: ['den01', 'den01', 'den01'], colo_regions: ['APAC', 'APAC', 'APAC'] }, + weight: 0, + }, + ); + }); + // skipped: tests are disabled for the time being test.skip('delete', async () => { const responsePromise = cloudflare.magics.routes.delete( @@ -92,36 +124,4 @@ describe('resource routes', () => { }), ).rejects.toThrow(Cloudflare.NotFoundError); }); - - // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.magics.routes.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - '023e105f4ecef8ad9ca31a8372d0c353', - { nexthop: '203.0.113.1', prefix: '192.0.2.0/24', priority: 0 }, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.magics.routes.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - '023e105f4ecef8ad9ca31a8372d0c353', - { - nexthop: '203.0.113.1', - prefix: '192.0.2.0/24', - priority: 0, - description: 'New route for new prefix 203.0.113.1', - scope: { colo_names: ['den01', 'den01', 'den01'], colo_regions: ['APAC', 'APAC', 'APAC'] }, - weight: 0, - }, - ); - }); }); diff --git a/tests/api-resources/managed-headers.test.ts b/tests/api-resources/managed-headers.test.ts index 1caa0fa053..dd732b7caf 100644 --- a/tests/api-resources/managed-headers.test.ts +++ b/tests/api-resources/managed-headers.test.ts @@ -13,8 +13,30 @@ const cloudflare = new Cloudflare({ describe('resource managedHeaders', () => { // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.managedHeaders.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('list', async () => { + const responsePromise = cloudflare.managedHeaders.list('023e105f4ecef8ad9ca31a8372d0c353'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('list: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.managedHeaders.list('023e105f4ecef8ad9ca31a8372d0c353', { + path: '/_stainless_unknown_path', + }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.managedHeaders.edit('023e105f4ecef8ad9ca31a8372d0c353', { managed_request_headers: [{}, {}, {}], managed_response_headers: [{}, {}, {}], }); @@ -28,8 +50,8 @@ describe('resource managedHeaders', () => { }); // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.managedHeaders.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.managedHeaders.edit('023e105f4ecef8ad9ca31a8372d0c353', { managed_request_headers: [ { enabled: true, id: 'add_cf-bot-score_header' }, { enabled: true, id: 'add_cf-bot-score_header' }, @@ -42,26 +64,4 @@ describe('resource managedHeaders', () => { ], }); }); - - // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.managedHeaders.list('023e105f4ecef8ad9ca31a8372d0c353'); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.managedHeaders.list('023e105f4ecef8ad9ca31a8372d0c353', { - path: '/_stainless_unknown_path', - }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); }); diff --git a/tests/api-resources/memberships.test.ts b/tests/api-resources/memberships.test.ts index fdfeb38538..97aba18129 100644 --- a/tests/api-resources/memberships.test.ts +++ b/tests/api-resources/memberships.test.ts @@ -12,6 +12,27 @@ const cloudflare = new Cloudflare({ }); describe('resource memberships', () => { + // skipped: tests are disabled for the time being + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.memberships.update('4536bcfad5faccb111b47003c79917fa', { + status: 'accepted', + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('update: required and optional params', async () => { + const response = await cloudflare.memberships.update('4536bcfad5faccb111b47003c79917fa', { + status: 'accepted', + }); + }); + // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.memberships.list(); @@ -82,25 +103,4 @@ describe('resource memberships', () => { cloudflare.memberships.get('4536bcfad5faccb111b47003c79917fa', { path: '/_stainless_unknown_path' }), ).rejects.toThrow(Cloudflare.NotFoundError); }); - - // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.memberships.replace('4536bcfad5faccb111b47003c79917fa', { - status: 'accepted', - }); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.memberships.replace('4536bcfad5faccb111b47003c79917fa', { - status: 'accepted', - }); - }); }); diff --git a/tests/api-resources/mnms/configs/configs.test.ts b/tests/api-resources/mnms/configs/configs.test.ts index 66dd2bb974..0b6cf6f60d 100644 --- a/tests/api-resources/mnms/configs/configs.test.ts +++ b/tests/api-resources/mnms/configs/configs.test.ts @@ -69,8 +69,8 @@ describe('resource configs', () => { }); // skipped: tests are disabled for the time being - test.skip('replace', async () => { - const responsePromise = cloudflare.mnms.configs.replace('6f91088a406011ed95aed352566e8d4c'); + test.skip('edit', async () => { + const responsePromise = cloudflare.mnms.configs.edit('6f91088a406011ed95aed352566e8d4c'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; diff --git a/tests/api-resources/mnms/rules/advertisements.test.ts b/tests/api-resources/mnms/rules/advertisements.test.ts index f124e7ba8b..32437916c4 100644 --- a/tests/api-resources/mnms/rules/advertisements.test.ts +++ b/tests/api-resources/mnms/rules/advertisements.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource advertisements', () => { // skipped: tests are disabled for the time being - test.skip('update', async () => { - const responsePromise = cloudflare.mnms.rules.advertisements.update( + test.skip('edit', async () => { + const responsePromise = cloudflare.mnms.rules.advertisements.edit( '6f91088a406011ed95aed352566e8d4c', '2890e6fa406311ed9b5a23f70f6fb8cf', ); diff --git a/tests/api-resources/mnms/rules/rules.test.ts b/tests/api-resources/mnms/rules/rules.test.ts index 8a6acafb9e..b09d5234ba 100644 --- a/tests/api-resources/mnms/rules/rules.test.ts +++ b/tests/api-resources/mnms/rules/rules.test.ts @@ -26,10 +26,7 @@ describe('resource rules', () => { // skipped: tests are disabled for the time being test.skip('update', async () => { - const responsePromise = cloudflare.mnms.rules.update( - '6f91088a406011ed95aed352566e8d4c', - '2890e6fa406311ed9b5a23f70f6fb8cf', - ); + const responsePromise = cloudflare.mnms.rules.update('6f91088a406011ed95aed352566e8d4c'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -74,6 +71,21 @@ describe('resource rules', () => { expect(dataAndResponse.response).toBe(rawResponse); }); + // skipped: tests are disabled for the time being + test.skip('edit', async () => { + const responsePromise = cloudflare.mnms.rules.edit( + '6f91088a406011ed95aed352566e8d4c', + '2890e6fa406311ed9b5a23f70f6fb8cf', + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + // skipped: tests are disabled for the time being test.skip('get', async () => { const responsePromise = cloudflare.mnms.rules.get( @@ -98,16 +110,4 @@ describe('resource rules', () => { }), ).rejects.toThrow(Cloudflare.NotFoundError); }); - - // skipped: tests are disabled for the time being - test.skip('replace', async () => { - const responsePromise = cloudflare.mnms.rules.replace('6f91088a406011ed95aed352566e8d4c'); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); }); diff --git a/tests/api-resources/origin-post-quantum-encryption.test.ts b/tests/api-resources/origin-post-quantum-encryption.test.ts index 6e2413e2d0..08b4bf83cb 100644 --- a/tests/api-resources/origin-post-quantum-encryption.test.ts +++ b/tests/api-resources/origin-post-quantum-encryption.test.ts @@ -13,8 +13,11 @@ const cloudflare = new Cloudflare({ describe('resource originPostQuantumEncryption', () => { // skipped: tests are disabled for the time being - test.skip('get', async () => { - const responsePromise = cloudflare.originPostQuantumEncryption.get('023e105f4ecef8ad9ca31a8372d0c353'); + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.originPostQuantumEncryption.update( + '023e105f4ecef8ad9ca31a8372d0c353', + { value: 'preferred' }, + ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -25,21 +28,15 @@ describe('resource originPostQuantumEncryption', () => { }); // skipped: tests are disabled for the time being - test.skip('get: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.originPostQuantumEncryption.get('023e105f4ecef8ad9ca31a8372d0c353', { - path: '/_stainless_unknown_path', - }), - ).rejects.toThrow(Cloudflare.NotFoundError); + test.skip('update: required and optional params', async () => { + const response = await cloudflare.originPostQuantumEncryption.update('023e105f4ecef8ad9ca31a8372d0c353', { + value: 'preferred', + }); }); // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.originPostQuantumEncryption.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - { value: 'preferred' }, - ); + test.skip('get', async () => { + const responsePromise = cloudflare.originPostQuantumEncryption.get('023e105f4ecef8ad9ca31a8372d0c353'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -50,10 +47,12 @@ describe('resource originPostQuantumEncryption', () => { }); // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.originPostQuantumEncryption.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - { value: 'preferred' }, - ); + test.skip('get: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.originPostQuantumEncryption.get('023e105f4ecef8ad9ca31a8372d0c353', { + path: '/_stainless_unknown_path', + }), + ).rejects.toThrow(Cloudflare.NotFoundError); }); }); diff --git a/tests/api-resources/origin-tls-client-auth/hostnames/hostnames.test.ts b/tests/api-resources/origin-tls-client-auth/hostnames/hostnames.test.ts index 154a238637..d9ba7fe0e7 100644 --- a/tests/api-resources/origin-tls-client-auth/hostnames/hostnames.test.ts +++ b/tests/api-resources/origin-tls-client-auth/hostnames/hostnames.test.ts @@ -13,10 +13,10 @@ const cloudflare = new Cloudflare({ describe('resource hostnames', () => { // skipped: tests are disabled for the time being - test.skip('get', async () => { - const responsePromise = cloudflare.originTLSClientAuth.hostnames.get( + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.originTLSClientAuth.hostnames.update( '023e105f4ecef8ad9ca31a8372d0c353', - 'app.example.com', + { config: [{}, {}, {}] }, ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -28,20 +28,24 @@ describe('resource hostnames', () => { }); // skipped: tests are disabled for the time being - test.skip('get: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.originTLSClientAuth.hostnames.get('023e105f4ecef8ad9ca31a8372d0c353', 'app.example.com', { - path: '/_stainless_unknown_path', - }), - ).rejects.toThrow(Cloudflare.NotFoundError); + test.skip('update: required and optional params', async () => { + const response = await cloudflare.originTLSClientAuth.hostnames.update( + '023e105f4ecef8ad9ca31a8372d0c353', + { + config: [ + { cert_id: '2458ce5a-0c35-4c7f-82c7-8e9487d3ff60', enabled: true, hostname: 'app.example.com' }, + { cert_id: '2458ce5a-0c35-4c7f-82c7-8e9487d3ff60', enabled: true, hostname: 'app.example.com' }, + { cert_id: '2458ce5a-0c35-4c7f-82c7-8e9487d3ff60', enabled: true, hostname: 'app.example.com' }, + ], + }, + ); }); // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.originTLSClientAuth.hostnames.replace( + test.skip('get', async () => { + const responsePromise = cloudflare.originTLSClientAuth.hostnames.get( '023e105f4ecef8ad9ca31a8372d0c353', - { config: [{}, {}, {}] }, + 'app.example.com', ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -53,16 +57,12 @@ describe('resource hostnames', () => { }); // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.originTLSClientAuth.hostnames.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - { - config: [ - { cert_id: '2458ce5a-0c35-4c7f-82c7-8e9487d3ff60', enabled: true, hostname: 'app.example.com' }, - { cert_id: '2458ce5a-0c35-4c7f-82c7-8e9487d3ff60', enabled: true, hostname: 'app.example.com' }, - { cert_id: '2458ce5a-0c35-4c7f-82c7-8e9487d3ff60', enabled: true, hostname: 'app.example.com' }, - ], - }, - ); + test.skip('get: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.originTLSClientAuth.hostnames.get('023e105f4ecef8ad9ca31a8372d0c353', 'app.example.com', { + path: '/_stainless_unknown_path', + }), + ).rejects.toThrow(Cloudflare.NotFoundError); }); }); diff --git a/tests/api-resources/origin-tls-client-auth/settings.test.ts b/tests/api-resources/origin-tls-client-auth/settings.test.ts index 83f069e2ef..2b39795937 100644 --- a/tests/api-resources/origin-tls-client-auth/settings.test.ts +++ b/tests/api-resources/origin-tls-client-auth/settings.test.ts @@ -13,8 +13,11 @@ const cloudflare = new Cloudflare({ describe('resource settings', () => { // skipped: tests are disabled for the time being - test.skip('get', async () => { - const responsePromise = cloudflare.originTLSClientAuth.settings.get('023e105f4ecef8ad9ca31a8372d0c353'); + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.originTLSClientAuth.settings.update( + '023e105f4ecef8ad9ca31a8372d0c353', + { enabled: true }, + ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -25,21 +28,16 @@ describe('resource settings', () => { }); // skipped: tests are disabled for the time being - test.skip('get: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.originTLSClientAuth.settings.get('023e105f4ecef8ad9ca31a8372d0c353', { - path: '/_stainless_unknown_path', - }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.originTLSClientAuth.settings.replace( + test.skip('update: required and optional params', async () => { + const response = await cloudflare.originTLSClientAuth.settings.update( '023e105f4ecef8ad9ca31a8372d0c353', { enabled: true }, ); + }); + + // skipped: tests are disabled for the time being + test.skip('get', async () => { + const responsePromise = cloudflare.originTLSClientAuth.settings.get('023e105f4ecef8ad9ca31a8372d0c353'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -50,10 +48,12 @@ describe('resource settings', () => { }); // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.originTLSClientAuth.settings.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - { enabled: true }, - ); + test.skip('get: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.originTLSClientAuth.settings.get('023e105f4ecef8ad9ca31a8372d0c353', { + path: '/_stainless_unknown_path', + }), + ).rejects.toThrow(Cloudflare.NotFoundError); }); }); diff --git a/tests/api-resources/page-shield/page-shield.test.ts b/tests/api-resources/page-shield/page-shield.test.ts index 3cb31f7b88..80a7e2e28c 100644 --- a/tests/api-resources/page-shield/page-shield.test.ts +++ b/tests/api-resources/page-shield/page-shield.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource pageShield', () => { // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.pageShield.list('023e105f4ecef8ad9ca31a8372d0c353'); + test.skip('update', async () => { + const responsePromise = cloudflare.pageShield.update('023e105f4ecef8ad9ca31a8372d0c353', {}); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -25,16 +25,8 @@ describe('resource pageShield', () => { }); // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.pageShield.list('023e105f4ecef8ad9ca31a8372d0c353', { path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - // skipped: tests are disabled for the time being - test.skip('replace', async () => { - const responsePromise = cloudflare.pageShield.replace('023e105f4ecef8ad9ca31a8372d0c353', {}); + test.skip('list', async () => { + const responsePromise = cloudflare.pageShield.list('023e105f4ecef8ad9ca31a8372d0c353'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -43,4 +35,12 @@ describe('resource pageShield', () => { expect(dataAndResponse.data).toBe(response); expect(dataAndResponse.response).toBe(rawResponse); }); + + // skipped: tests are disabled for the time being + test.skip('list: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.pageShield.list('023e105f4ecef8ad9ca31a8372d0c353', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); }); diff --git a/tests/api-resources/page-shield/policies.test.ts b/tests/api-resources/page-shield/policies.test.ts index b4c24a9677..ff40e20295 100644 --- a/tests/api-resources/page-shield/policies.test.ts +++ b/tests/api-resources/page-shield/policies.test.ts @@ -24,6 +24,22 @@ describe('resource policies', () => { expect(dataAndResponse.response).toBe(rawResponse); }); + // skipped: tests are disabled for the time being + test.skip('update', async () => { + const responsePromise = cloudflare.pageShield.policies.update( + '023e105f4ecef8ad9ca31a8372d0c353', + 'c9ef84a6bf5e47138c75d95e2f933e8f', + {}, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.pageShield.policies.list('023e105f4ecef8ad9ca31a8372d0c353'); @@ -99,20 +115,4 @@ describe('resource policies', () => { ), ).rejects.toThrow(Cloudflare.NotFoundError); }); - - // skipped: tests are disabled for the time being - test.skip('replace', async () => { - const responsePromise = cloudflare.pageShield.policies.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - 'c9ef84a6bf5e47138c75d95e2f933e8f', - {}, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); }); diff --git a/tests/api-resources/pagerules/pagerules.test.ts b/tests/api-resources/pagerules/pagerules.test.ts index 6307c25a1a..f7c3ceddad 100644 --- a/tests/api-resources/pagerules/pagerules.test.ts +++ b/tests/api-resources/pagerules/pagerules.test.ts @@ -45,6 +45,47 @@ describe('resource pagerules', () => { }); }); + // skipped: tests are disabled for the time being + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.pagerules.update( + '023e105f4ecef8ad9ca31a8372d0c353', + '023e105f4ecef8ad9ca31a8372d0c353', + { + actions: [{}], + targets: [{ constraint: { operator: 'matches', value: '*example.com/images/*' }, target: 'url' }], + }, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('update: required and optional params', async () => { + const response = await cloudflare.pagerules.update( + '023e105f4ecef8ad9ca31a8372d0c353', + '023e105f4ecef8ad9ca31a8372d0c353', + { + actions: [ + { + name: 'forward_url', + value: { + type: 'temporary', + url: 'http://www.example.com/somewhere/$1/astring/$2/anotherstring/$3', + }, + }, + ], + targets: [{ constraint: { operator: 'matches', value: '*example.com/images/*' }, target: 'url' }], + priority: 0, + status: 'active', + }, + ); + }); + // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.pagerules.list('023e105f4ecef8ad9ca31a8372d0c353'); @@ -116,45 +157,4 @@ describe('resource pagerules', () => { }), ).rejects.toThrow(Cloudflare.NotFoundError); }); - - // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.pagerules.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - '023e105f4ecef8ad9ca31a8372d0c353', - { - actions: [{}], - targets: [{ constraint: { operator: 'matches', value: '*example.com/images/*' }, target: 'url' }], - }, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.pagerules.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - '023e105f4ecef8ad9ca31a8372d0c353', - { - actions: [ - { - name: 'forward_url', - value: { - type: 'temporary', - url: 'http://www.example.com/somewhere/$1/astring/$2/anotherstring/$3', - }, - }, - ], - targets: [{ constraint: { operator: 'matches', value: '*example.com/images/*' }, target: 'url' }], - priority: 0, - status: 'active', - }, - ); - }); }); diff --git a/tests/api-resources/pages/projects/domains.test.ts b/tests/api-resources/pages/projects/domains.test.ts index 945303d850..c54eb0c381 100644 --- a/tests/api-resources/pages/projects/domains.test.ts +++ b/tests/api-resources/pages/projects/domains.test.ts @@ -37,22 +37,6 @@ describe('resource domains', () => { ); }); - // skipped: tests are disabled for the time being - test.skip('update', async () => { - const responsePromise = cloudflare.pages.projects.domains.update( - '023e105f4ecef8ad9ca31a8372d0c353', - 'this-is-my-project-01', - 'string', - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.pages.projects.domains.list( @@ -94,6 +78,22 @@ describe('resource domains', () => { expect(dataAndResponse.response).toBe(rawResponse); }); + // skipped: tests are disabled for the time being + test.skip('edit', async () => { + const responsePromise = cloudflare.pages.projects.domains.edit( + '023e105f4ecef8ad9ca31a8372d0c353', + 'this-is-my-project-01', + 'string', + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + // skipped: tests are disabled for the time being test.skip('get', async () => { const responsePromise = cloudflare.pages.projects.domains.get( diff --git a/tests/api-resources/pages/projects/projects.test.ts b/tests/api-resources/pages/projects/projects.test.ts index 390d8f47f0..534aaa7527 100644 --- a/tests/api-resources/pages/projects/projects.test.ts +++ b/tests/api-resources/pages/projects/projects.test.ts @@ -25,23 +25,32 @@ describe('resource projects', () => { }); // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.pages.projects.update( + test.skip('list', async () => { + const responsePromise = cloudflare.pages.projects.list('023e105f4ecef8ad9ca31a8372d0c353'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('list: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.pages.projects.list('023e105f4ecef8ad9ca31a8372d0c353', { + path: '/_stainless_unknown_path', + }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('delete', async () => { + const responsePromise = cloudflare.pages.projects.delete( '023e105f4ecef8ad9ca31a8372d0c353', 'this-is-my-project-01', - { - deployment_configs: { - production: { - compatibility_date: '2022-01-01', - compatibility_flags: ['url_standard'], - env_vars: { - BUILD_VERSION: { value: '3.3' }, - delete_this_env_var: null, - secret_var: { type: 'secret_text', value: 'A_CMS_API_TOKEN' }, - }, - }, - }, - }, ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -53,8 +62,8 @@ describe('resource projects', () => { }); // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.pages.projects.update( + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.pages.projects.edit( '023e105f4ecef8ad9ca31a8372d0c353', 'this-is-my-project-01', { @@ -71,11 +80,6 @@ describe('resource projects', () => { }, }, ); - }); - - // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.pages.projects.list('023e105f4ecef8ad9ca31a8372d0c353'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -86,28 +90,24 @@ describe('resource projects', () => { }); // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.pages.projects.list('023e105f4ecef8ad9ca31a8372d0c353', { - path: '/_stainless_unknown_path', - }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - // skipped: tests are disabled for the time being - test.skip('delete', async () => { - const responsePromise = cloudflare.pages.projects.delete( + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.pages.projects.edit( '023e105f4ecef8ad9ca31a8372d0c353', 'this-is-my-project-01', + { + deployment_configs: { + production: { + compatibility_date: '2022-01-01', + compatibility_flags: ['url_standard'], + env_vars: { + BUILD_VERSION: { value: '3.3' }, + delete_this_env_var: null, + secret_var: { type: 'secret_text', value: 'A_CMS_API_TOKEN' }, + }, + }, + }, + }, ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); }); // skipped: tests are disabled for the time being diff --git a/tests/api-resources/rate-limits.test.ts b/tests/api-resources/rate-limits.test.ts index 7c1ef45d0e..4a1a9a7dc0 100644 --- a/tests/api-resources/rate-limits.test.ts +++ b/tests/api-resources/rate-limits.test.ts @@ -29,31 +29,6 @@ describe('resource rateLimits', () => { const response = await cloudflare.rateLimits.create('023e105f4ecef8ad9ca31a8372d0c353', {}); }); - // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.rateLimits.update( - '023e105f4ecef8ad9ca31a8372d0c353', - '372e67954025e0ba6aaa6d586b9e0b59', - {}, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.rateLimits.update( - '023e105f4ecef8ad9ca31a8372d0c353', - '372e67954025e0ba6aaa6d586b9e0b59', - {}, - ); - }); - // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.rateLimits.list('023e105f4ecef8ad9ca31a8372d0c353'); @@ -101,6 +76,31 @@ describe('resource rateLimits', () => { expect(dataAndResponse.response).toBe(rawResponse); }); + // skipped: tests are disabled for the time being + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.rateLimits.edit( + '023e105f4ecef8ad9ca31a8372d0c353', + '372e67954025e0ba6aaa6d586b9e0b59', + {}, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.rateLimits.edit( + '023e105f4ecef8ad9ca31a8372d0c353', + '372e67954025e0ba6aaa6d586b9e0b59', + {}, + ); + }); + // skipped: tests are disabled for the time being test.skip('get', async () => { const responsePromise = cloudflare.rateLimits.get( diff --git a/tests/api-resources/registrar/domains.test.ts b/tests/api-resources/registrar/domains.test.ts index 34010bcb83..9a518f3140 100644 --- a/tests/api-resources/registrar/domains.test.ts +++ b/tests/api-resources/registrar/domains.test.ts @@ -12,6 +12,22 @@ const cloudflare = new Cloudflare({ }); describe('resource domains', () => { + // skipped: tests are disabled for the time being + test.skip('update', async () => { + const responsePromise = cloudflare.registrar.domains.update( + '023e105f4ecef8ad9ca31a8372d0c353', + 'cloudflare.com', + {}, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.registrar.domains.list('023e105f4ecef8ad9ca31a8372d0c353'); @@ -58,20 +74,4 @@ describe('resource domains', () => { }), ).rejects.toThrow(Cloudflare.NotFoundError); }); - - // skipped: tests are disabled for the time being - test.skip('replace', async () => { - const responsePromise = cloudflare.registrar.domains.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - 'cloudflare.com', - {}, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); }); diff --git a/tests/api-resources/rules/lists/items.test.ts b/tests/api-resources/rules/lists/items.test.ts index d6c89a830d..cc7c9ff9e1 100644 --- a/tests/api-resources/rules/lists/items.test.ts +++ b/tests/api-resources/rules/lists/items.test.ts @@ -83,6 +83,77 @@ describe('resource items', () => { ); }); + // skipped: tests are disabled for the time being + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.rules.lists.items.update( + '023e105f4ecef8ad9ca31a8372d0c353', + '2c0fc9fa937b11eaa1b71c4d701ab86e', + [{}, {}, {}], + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('update: required and optional params', async () => { + const response = await cloudflare.rules.lists.items.update( + '023e105f4ecef8ad9ca31a8372d0c353', + '2c0fc9fa937b11eaa1b71c4d701ab86e', + [ + { + asn: 5567, + comment: 'Private IP address', + hostname: { url_hostname: 'example.com' }, + ip: '10.0.0.1', + redirect: { + include_subdomains: true, + preserve_path_suffix: true, + preserve_query_string: true, + source_url: 'example.com/arch', + status_code: 301, + subpath_matching: true, + target_url: 'https://archlinux.org/', + }, + }, + { + asn: 5567, + comment: 'Private IP address', + hostname: { url_hostname: 'example.com' }, + ip: '10.0.0.1', + redirect: { + include_subdomains: true, + preserve_path_suffix: true, + preserve_query_string: true, + source_url: 'example.com/arch', + status_code: 301, + subpath_matching: true, + target_url: 'https://archlinux.org/', + }, + }, + { + asn: 5567, + comment: 'Private IP address', + hostname: { url_hostname: 'example.com' }, + ip: '10.0.0.1', + redirect: { + include_subdomains: true, + preserve_path_suffix: true, + preserve_query_string: true, + source_url: 'example.com/arch', + status_code: 301, + subpath_matching: true, + target_url: 'https://archlinux.org/', + }, + }, + ], + ); + }); + // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.rules.lists.items.list( @@ -167,75 +238,4 @@ describe('resource items', () => { ), ).rejects.toThrow(Cloudflare.NotFoundError); }); - - // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.rules.lists.items.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - '2c0fc9fa937b11eaa1b71c4d701ab86e', - [{}, {}, {}], - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.rules.lists.items.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - '2c0fc9fa937b11eaa1b71c4d701ab86e', - [ - { - asn: 5567, - comment: 'Private IP address', - hostname: { url_hostname: 'example.com' }, - ip: '10.0.0.1', - redirect: { - include_subdomains: true, - preserve_path_suffix: true, - preserve_query_string: true, - source_url: 'example.com/arch', - status_code: 301, - subpath_matching: true, - target_url: 'https://archlinux.org/', - }, - }, - { - asn: 5567, - comment: 'Private IP address', - hostname: { url_hostname: 'example.com' }, - ip: '10.0.0.1', - redirect: { - include_subdomains: true, - preserve_path_suffix: true, - preserve_query_string: true, - source_url: 'example.com/arch', - status_code: 301, - subpath_matching: true, - target_url: 'https://archlinux.org/', - }, - }, - { - asn: 5567, - comment: 'Private IP address', - hostname: { url_hostname: 'example.com' }, - ip: '10.0.0.1', - redirect: { - include_subdomains: true, - preserve_path_suffix: true, - preserve_query_string: true, - source_url: 'example.com/arch', - status_code: 301, - subpath_matching: true, - target_url: 'https://archlinux.org/', - }, - }, - ], - ); - }); }); diff --git a/tests/api-resources/rules/lists/lists.test.ts b/tests/api-resources/rules/lists/lists.test.ts index e0bb335484..99dfbf9468 100644 --- a/tests/api-resources/rules/lists/lists.test.ts +++ b/tests/api-resources/rules/lists/lists.test.ts @@ -36,6 +36,22 @@ describe('resource lists', () => { }); }); + // skipped: tests are disabled for the time being + test.skip('update', async () => { + const responsePromise = cloudflare.rules.lists.update( + '023e105f4ecef8ad9ca31a8372d0c353', + '2c0fc9fa937b11eaa1b71c4d701ab86e', + {}, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.rules.lists.list('023e105f4ecef8ad9ca31a8372d0c353'); @@ -95,20 +111,4 @@ describe('resource lists', () => { }), ).rejects.toThrow(Cloudflare.NotFoundError); }); - - // skipped: tests are disabled for the time being - test.skip('replace', async () => { - const responsePromise = cloudflare.rules.lists.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - '2c0fc9fa937b11eaa1b71c4d701ab86e', - {}, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); }); diff --git a/tests/api-resources/rulesets/rules.test.ts b/tests/api-resources/rulesets/rules.test.ts index b0b30f1118..0254210148 100644 --- a/tests/api-resources/rulesets/rules.test.ts +++ b/tests/api-resources/rulesets/rules.test.ts @@ -30,8 +30,39 @@ describe('resource rules', () => { }); // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.rulesets.rules.update( + test.skip('delete', async () => { + const responsePromise = cloudflare.rulesets.rules.delete( + 'string', + 'abf9b32d38c5f572afde3336ec0ce302', + '2f2feab2026849078ba485f918791bdc', + '3a03d665bac047339bb530ecb439a90d', + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('delete: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.rulesets.rules.delete( + 'string', + 'abf9b32d38c5f572afde3336ec0ce302', + '2f2feab2026849078ba485f918791bdc', + '3a03d665bac047339bb530ecb439a90d', + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.rulesets.rules.edit( '2f2feab2026849078ba485f918791bdc', '3a03d665bac047339bb530ecb439a90d', { account_id: 'abf9b32d38c5f572afde3336ec0ce302' }, @@ -46,8 +77,8 @@ describe('resource rules', () => { }); // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.rulesets.rules.update( + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.rulesets.rules.edit( '2f2feab2026849078ba485f918791bdc', '3a03d665bac047339bb530ecb439a90d', { @@ -69,35 +100,4 @@ describe('resource rules', () => { }, ); }); - - // skipped: tests are disabled for the time being - test.skip('delete', async () => { - const responsePromise = cloudflare.rulesets.rules.delete( - 'string', - 'abf9b32d38c5f572afde3336ec0ce302', - '2f2feab2026849078ba485f918791bdc', - '3a03d665bac047339bb530ecb439a90d', - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('delete: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.rulesets.rules.delete( - 'string', - 'abf9b32d38c5f572afde3336ec0ce302', - '2f2feab2026849078ba485f918791bdc', - '3a03d665bac047339bb530ecb439a90d', - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); }); diff --git a/tests/api-resources/rulesets/rulesets.test.ts b/tests/api-resources/rulesets/rulesets.test.ts index 6d31c526bf..5def20e0a8 100644 --- a/tests/api-resources/rulesets/rulesets.test.ts +++ b/tests/api-resources/rulesets/rulesets.test.ts @@ -89,6 +89,89 @@ describe('resource rulesets', () => { }); }); + // skipped: tests are disabled for the time being + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.rulesets.update( + 'string', + 'abf9b32d38c5f572afde3336ec0ce302', + '2f2feab2026849078ba485f918791bdc', + { id: '2f2feab2026849078ba485f918791bdc', rules: [{}, {}, {}] }, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('update: required and optional params', async () => { + const response = await cloudflare.rulesets.update( + 'string', + 'abf9b32d38c5f572afde3336ec0ce302', + '2f2feab2026849078ba485f918791bdc', + { + id: '2f2feab2026849078ba485f918791bdc', + rules: [ + { + action: 'block', + action_parameters: { + response: { + content: '{\n "success": false,\n "error": "you have been blocked"\n}', + content_type: 'application/json', + status_code: 400, + }, + }, + description: 'Block when the IP address is not 1.1.1.1', + enabled: true, + expression: 'ip.src ne 1.1.1.1', + id: '3a03d665bac047339bb530ecb439a90d', + logging: { enabled: true }, + ref: 'my_ref', + }, + { + action: 'block', + action_parameters: { + response: { + content: '{\n "success": false,\n "error": "you have been blocked"\n}', + content_type: 'application/json', + status_code: 400, + }, + }, + description: 'Block when the IP address is not 1.1.1.1', + enabled: true, + expression: 'ip.src ne 1.1.1.1', + id: '3a03d665bac047339bb530ecb439a90d', + logging: { enabled: true }, + ref: 'my_ref', + }, + { + action: 'block', + action_parameters: { + response: { + content: '{\n "success": false,\n "error": "you have been blocked"\n}', + content_type: 'application/json', + status_code: 400, + }, + }, + description: 'Block when the IP address is not 1.1.1.1', + enabled: true, + expression: 'ip.src ne 1.1.1.1', + id: '3a03d665bac047339bb530ecb439a90d', + logging: { enabled: true }, + ref: 'my_ref', + }, + ], + description: 'My ruleset to execute managed rulesets', + kind: 'root', + name: 'My ruleset', + phase: 'http_request_firewall_custom', + }, + ); + }); + // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.rulesets.list('string', 'abf9b32d38c5f572afde3336ec0ce302'); @@ -168,87 +251,4 @@ describe('resource rulesets', () => { ), ).rejects.toThrow(Cloudflare.NotFoundError); }); - - // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.rulesets.replace( - 'string', - 'abf9b32d38c5f572afde3336ec0ce302', - '2f2feab2026849078ba485f918791bdc', - { id: '2f2feab2026849078ba485f918791bdc', rules: [{}, {}, {}] }, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.rulesets.replace( - 'string', - 'abf9b32d38c5f572afde3336ec0ce302', - '2f2feab2026849078ba485f918791bdc', - { - id: '2f2feab2026849078ba485f918791bdc', - rules: [ - { - action: 'block', - action_parameters: { - response: { - content: '{\n "success": false,\n "error": "you have been blocked"\n}', - content_type: 'application/json', - status_code: 400, - }, - }, - description: 'Block when the IP address is not 1.1.1.1', - enabled: true, - expression: 'ip.src ne 1.1.1.1', - id: '3a03d665bac047339bb530ecb439a90d', - logging: { enabled: true }, - ref: 'my_ref', - }, - { - action: 'block', - action_parameters: { - response: { - content: '{\n "success": false,\n "error": "you have been blocked"\n}', - content_type: 'application/json', - status_code: 400, - }, - }, - description: 'Block when the IP address is not 1.1.1.1', - enabled: true, - expression: 'ip.src ne 1.1.1.1', - id: '3a03d665bac047339bb530ecb439a90d', - logging: { enabled: true }, - ref: 'my_ref', - }, - { - action: 'block', - action_parameters: { - response: { - content: '{\n "success": false,\n "error": "you have been blocked"\n}', - content_type: 'application/json', - status_code: 400, - }, - }, - description: 'Block when the IP address is not 1.1.1.1', - enabled: true, - expression: 'ip.src ne 1.1.1.1', - id: '3a03d665bac047339bb530ecb439a90d', - logging: { enabled: true }, - ref: 'my_ref', - }, - ], - description: 'My ruleset to execute managed rulesets', - kind: 'root', - name: 'My ruleset', - phase: 'http_request_firewall_custom', - }, - ); - }); }); diff --git a/tests/api-resources/rum/rules.test.ts b/tests/api-resources/rum/rules.test.ts index 9ae13d0cce..038d891901 100644 --- a/tests/api-resources/rum/rules.test.ts +++ b/tests/api-resources/rum/rules.test.ts @@ -28,6 +28,23 @@ describe('resource rules', () => { expect(dataAndResponse.response).toBe(rawResponse); }); + // skipped: tests are disabled for the time being + test.skip('update', async () => { + const responsePromise = cloudflare.rum.rules.update( + '023e105f4ecef8ad9ca31a8372d0c353', + 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + {}, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.rum.rules.list( @@ -81,21 +98,4 @@ describe('resource rules', () => { ), ).rejects.toThrow(Cloudflare.NotFoundError); }); - - // skipped: tests are disabled for the time being - test.skip('replace', async () => { - const responsePromise = cloudflare.rum.rules.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', - 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', - {}, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); }); diff --git a/tests/api-resources/rum/site-infos.test.ts b/tests/api-resources/rum/site-infos.test.ts index 2aa9991049..4716c1f891 100644 --- a/tests/api-resources/rum/site-infos.test.ts +++ b/tests/api-resources/rum/site-infos.test.ts @@ -24,6 +24,22 @@ describe('resource siteInfos', () => { expect(dataAndResponse.response).toBe(rawResponse); }); + // skipped: tests are disabled for the time being + test.skip('update', async () => { + const responsePromise = cloudflare.rum.siteInfos.update( + '023e105f4ecef8ad9ca31a8372d0c353', + '023e105f4ecef8ad9ca31a8372d0c353', + {}, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.rum.siteInfos.list('023e105f4ecef8ad9ca31a8372d0c353'); @@ -107,20 +123,4 @@ describe('resource siteInfos', () => { }), ).rejects.toThrow(Cloudflare.NotFoundError); }); - - // skipped: tests are disabled for the time being - test.skip('replace', async () => { - const responsePromise = cloudflare.rum.siteInfos.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - '023e105f4ecef8ad9ca31a8372d0c353', - {}, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); }); diff --git a/tests/api-resources/secondary-dns/acls.test.ts b/tests/api-resources/secondary-dns/acls.test.ts index 1375cde6cc..63c1ede884 100644 --- a/tests/api-resources/secondary-dns/acls.test.ts +++ b/tests/api-resources/secondary-dns/acls.test.ts @@ -29,6 +29,31 @@ describe('resource acls', () => { const response = await cloudflare.secondaryDNS.acls.create('01a7362d577a6c3019a474fd6f485823', {}); }); + // skipped: tests are disabled for the time being + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.secondaryDNS.acls.update( + '01a7362d577a6c3019a474fd6f485823', + '23ff594956f20c2a721606e94745a8aa', + { ip_range: '192.0.2.53/28', name: 'my-acl-1' }, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('update: required and optional params', async () => { + const response = await cloudflare.secondaryDNS.acls.update( + '01a7362d577a6c3019a474fd6f485823', + '23ff594956f20c2a721606e94745a8aa', + { ip_range: '192.0.2.53/28', name: 'my-acl-1' }, + ); + }); + // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.secondaryDNS.acls.list('01a7362d577a6c3019a474fd6f485823'); @@ -92,29 +117,4 @@ describe('resource acls', () => { ), ).rejects.toThrow(Cloudflare.NotFoundError); }); - - // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.secondaryDNS.acls.replace( - '01a7362d577a6c3019a474fd6f485823', - '23ff594956f20c2a721606e94745a8aa', - { ip_range: '192.0.2.53/28', name: 'my-acl-1' }, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.secondaryDNS.acls.replace( - '01a7362d577a6c3019a474fd6f485823', - '23ff594956f20c2a721606e94745a8aa', - { ip_range: '192.0.2.53/28', name: 'my-acl-1' }, - ); - }); }); diff --git a/tests/api-resources/secondary-dns/incoming.test.ts b/tests/api-resources/secondary-dns/incoming.test.ts index 93de308909..c8ae0a5ff8 100644 --- a/tests/api-resources/secondary-dns/incoming.test.ts +++ b/tests/api-resources/secondary-dns/incoming.test.ts @@ -37,6 +37,31 @@ describe('resource incoming', () => { }); }); + // skipped: tests are disabled for the time being + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.secondaryDNS.incoming.update('269d8f4853475ca241c4e730be286b20', { + auto_refresh_seconds: 86400, + name: 'www.example.com.', + peers: ['23ff594956f20c2a721606e94745a8aa', '00920f38ce07c2e2f4df50b1f61d4194'], + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('update: required and optional params', async () => { + const response = await cloudflare.secondaryDNS.incoming.update('269d8f4853475ca241c4e730be286b20', { + auto_refresh_seconds: 86400, + name: 'www.example.com.', + peers: ['23ff594956f20c2a721606e94745a8aa', '00920f38ce07c2e2f4df50b1f61d4194'], + }); + }); + // skipped: tests are disabled for the time being test.skip('delete', async () => { const responsePromise = cloudflare.secondaryDNS.incoming.delete('269d8f4853475ca241c4e730be286b20'); @@ -70,29 +95,4 @@ describe('resource incoming', () => { }), ).rejects.toThrow(Cloudflare.NotFoundError); }); - - // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.secondaryDNS.incoming.replace('269d8f4853475ca241c4e730be286b20', { - auto_refresh_seconds: 86400, - name: 'www.example.com.', - peers: ['23ff594956f20c2a721606e94745a8aa', '00920f38ce07c2e2f4df50b1f61d4194'], - }); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.secondaryDNS.incoming.replace('269d8f4853475ca241c4e730be286b20', { - auto_refresh_seconds: 86400, - name: 'www.example.com.', - peers: ['23ff594956f20c2a721606e94745a8aa', '00920f38ce07c2e2f4df50b1f61d4194'], - }); - }); }); diff --git a/tests/api-resources/secondary-dns/outgoing/outgoing.test.ts b/tests/api-resources/secondary-dns/outgoing/outgoing.test.ts index ea1a3317fe..72b0200f71 100644 --- a/tests/api-resources/secondary-dns/outgoing/outgoing.test.ts +++ b/tests/api-resources/secondary-dns/outgoing/outgoing.test.ts @@ -35,6 +35,29 @@ describe('resource outgoing', () => { }); }); + // skipped: tests are disabled for the time being + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.secondaryDNS.outgoing.update('269d8f4853475ca241c4e730be286b20', { + name: 'www.example.com.', + peers: ['23ff594956f20c2a721606e94745a8aa', '00920f38ce07c2e2f4df50b1f61d4194'], + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('update: required and optional params', async () => { + const response = await cloudflare.secondaryDNS.outgoing.update('269d8f4853475ca241c4e730be286b20', { + name: 'www.example.com.', + peers: ['23ff594956f20c2a721606e94745a8aa', '00920f38ce07c2e2f4df50b1f61d4194'], + }); + }); + // skipped: tests are disabled for the time being test.skip('delete', async () => { const responsePromise = cloudflare.secondaryDNS.outgoing.delete('269d8f4853475ca241c4e730be286b20'); @@ -104,27 +127,4 @@ describe('resource outgoing', () => { }), ).rejects.toThrow(Cloudflare.NotFoundError); }); - - // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.secondaryDNS.outgoing.replace('269d8f4853475ca241c4e730be286b20', { - name: 'www.example.com.', - peers: ['23ff594956f20c2a721606e94745a8aa', '00920f38ce07c2e2f4df50b1f61d4194'], - }); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.secondaryDNS.outgoing.replace('269d8f4853475ca241c4e730be286b20', { - name: 'www.example.com.', - peers: ['23ff594956f20c2a721606e94745a8aa', '00920f38ce07c2e2f4df50b1f61d4194'], - }); - }); }); diff --git a/tests/api-resources/secondary-dns/peers.test.ts b/tests/api-resources/secondary-dns/peers.test.ts index cd21c74801..fb2fc374df 100644 --- a/tests/api-resources/secondary-dns/peers.test.ts +++ b/tests/api-resources/secondary-dns/peers.test.ts @@ -29,6 +29,37 @@ describe('resource peers', () => { const response = await cloudflare.secondaryDNS.peers.create('01a7362d577a6c3019a474fd6f485823', {}); }); + // skipped: tests are disabled for the time being + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.secondaryDNS.peers.update( + '01a7362d577a6c3019a474fd6f485823', + '23ff594956f20c2a721606e94745a8aa', + { name: 'my-peer-1' }, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('update: required and optional params', async () => { + const response = await cloudflare.secondaryDNS.peers.update( + '01a7362d577a6c3019a474fd6f485823', + '23ff594956f20c2a721606e94745a8aa', + { + name: 'my-peer-1', + ip: '192.0.2.53', + ixfr_enable: false, + port: 53, + tsig_id: '69cd1e104af3e6ed3cb344f263fd0d5a', + }, + ); + }); + // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.secondaryDNS.peers.list('01a7362d577a6c3019a474fd6f485823'); @@ -92,35 +123,4 @@ describe('resource peers', () => { ), ).rejects.toThrow(Cloudflare.NotFoundError); }); - - // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.secondaryDNS.peers.replace( - '01a7362d577a6c3019a474fd6f485823', - '23ff594956f20c2a721606e94745a8aa', - { name: 'my-peer-1' }, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.secondaryDNS.peers.replace( - '01a7362d577a6c3019a474fd6f485823', - '23ff594956f20c2a721606e94745a8aa', - { - name: 'my-peer-1', - ip: '192.0.2.53', - ixfr_enable: false, - port: 53, - tsig_id: '69cd1e104af3e6ed3cb344f263fd0d5a', - }, - ); - }); }); diff --git a/tests/api-resources/secondary-dns/tsigs.test.ts b/tests/api-resources/secondary-dns/tsigs.test.ts index ebbe669c4e..9ba2ba7442 100644 --- a/tests/api-resources/secondary-dns/tsigs.test.ts +++ b/tests/api-resources/secondary-dns/tsigs.test.ts @@ -39,6 +39,41 @@ describe('resource tsigs', () => { }); }); + // skipped: tests are disabled for the time being + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.secondaryDNS.tsigs.update( + '01a7362d577a6c3019a474fd6f485823', + '69cd1e104af3e6ed3cb344f263fd0d5a', + { + algo: 'hmac-sha512.', + name: 'tsig.customer.cf.', + secret: + 'caf79a7804b04337c9c66ccd7bef9190a1e1679b5dd03d8aa10f7ad45e1a9dab92b417896c15d4d007c7c14194538d2a5d0feffdecc5a7f0e1c570cfa700837c', + }, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('update: required and optional params', async () => { + const response = await cloudflare.secondaryDNS.tsigs.update( + '01a7362d577a6c3019a474fd6f485823', + '69cd1e104af3e6ed3cb344f263fd0d5a', + { + algo: 'hmac-sha512.', + name: 'tsig.customer.cf.', + secret: + 'caf79a7804b04337c9c66ccd7bef9190a1e1679b5dd03d8aa10f7ad45e1a9dab92b417896c15d4d007c7c14194538d2a5d0feffdecc5a7f0e1c570cfa700837c', + }, + ); + }); + // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.secondaryDNS.tsigs.list('01a7362d577a6c3019a474fd6f485823'); @@ -102,39 +137,4 @@ describe('resource tsigs', () => { ), ).rejects.toThrow(Cloudflare.NotFoundError); }); - - // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.secondaryDNS.tsigs.replace( - '01a7362d577a6c3019a474fd6f485823', - '69cd1e104af3e6ed3cb344f263fd0d5a', - { - algo: 'hmac-sha512.', - name: 'tsig.customer.cf.', - secret: - 'caf79a7804b04337c9c66ccd7bef9190a1e1679b5dd03d8aa10f7ad45e1a9dab92b417896c15d4d007c7c14194538d2a5d0feffdecc5a7f0e1c570cfa700837c', - }, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.secondaryDNS.tsigs.replace( - '01a7362d577a6c3019a474fd6f485823', - '69cd1e104af3e6ed3cb344f263fd0d5a', - { - algo: 'hmac-sha512.', - name: 'tsig.customer.cf.', - secret: - 'caf79a7804b04337c9c66ccd7bef9190a1e1679b5dd03d8aa10f7ad45e1a9dab92b417896c15d4d007c7c14194538d2a5d0feffdecc5a7f0e1c570cfa700837c', - }, - ); - }); }); diff --git a/tests/api-resources/settings/always-online.test.ts b/tests/api-resources/settings/always-online.test.ts index 57dd3b27bf..a02c5ed5a9 100644 --- a/tests/api-resources/settings/always-online.test.ts +++ b/tests/api-resources/settings/always-online.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource alwaysOnline', () => { // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.settings.alwaysOnline.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.settings.alwaysOnline.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: 'on', }); const rawResponse = await responsePromise.asResponse(); @@ -27,8 +27,8 @@ describe('resource alwaysOnline', () => { }); // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.settings.alwaysOnline.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.settings.alwaysOnline.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: 'on', }); }); diff --git a/tests/api-resources/settings/always-use-https.test.ts b/tests/api-resources/settings/always-use-https.test.ts index 26a66452b7..eda8e8f027 100644 --- a/tests/api-resources/settings/always-use-https.test.ts +++ b/tests/api-resources/settings/always-use-https.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource alwaysUseHTTPS', () => { // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.settings.alwaysUseHTTPS.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.settings.alwaysUseHTTPS.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: 'on', }); const rawResponse = await responsePromise.asResponse(); @@ -27,8 +27,8 @@ describe('resource alwaysUseHTTPS', () => { }); // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.settings.alwaysUseHTTPS.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.settings.alwaysUseHTTPS.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: 'on', }); }); diff --git a/tests/api-resources/settings/automatic-https-rewrites.test.ts b/tests/api-resources/settings/automatic-https-rewrites.test.ts index b10706eac4..f1b5393be8 100644 --- a/tests/api-resources/settings/automatic-https-rewrites.test.ts +++ b/tests/api-resources/settings/automatic-https-rewrites.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource automaticHTTPSRewrites', () => { // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.settings.automaticHTTPSRewrites.update( + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.settings.automaticHTTPSRewrites.edit( '023e105f4ecef8ad9ca31a8372d0c353', { value: 'on' }, ); @@ -28,8 +28,8 @@ describe('resource automaticHTTPSRewrites', () => { }); // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.settings.automaticHTTPSRewrites.update( + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.settings.automaticHTTPSRewrites.edit( '023e105f4ecef8ad9ca31a8372d0c353', { value: 'on' }, ); diff --git a/tests/api-resources/settings/automatic-platform-optimization.test.ts b/tests/api-resources/settings/automatic-platform-optimization.test.ts index ae37b59f26..6d99a58c5a 100644 --- a/tests/api-resources/settings/automatic-platform-optimization.test.ts +++ b/tests/api-resources/settings/automatic-platform-optimization.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource automaticPlatformOptimization', () => { // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.settings.automaticPlatformOptimization.update( + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.settings.automaticPlatformOptimization.edit( '023e105f4ecef8ad9ca31a8372d0c353', { value: { @@ -37,8 +37,8 @@ describe('resource automaticPlatformOptimization', () => { }); // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.settings.automaticPlatformOptimization.update( + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.settings.automaticPlatformOptimization.edit( '023e105f4ecef8ad9ca31a8372d0c353', { value: { diff --git a/tests/api-resources/settings/brotli.test.ts b/tests/api-resources/settings/brotli.test.ts index 286e977769..a03c699f4a 100644 --- a/tests/api-resources/settings/brotli.test.ts +++ b/tests/api-resources/settings/brotli.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource brotli', () => { // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.settings.brotli.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.settings.brotli.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: 'off', }); const rawResponse = await responsePromise.asResponse(); @@ -27,8 +27,8 @@ describe('resource brotli', () => { }); // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.settings.brotli.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.settings.brotli.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: 'off', }); }); diff --git a/tests/api-resources/settings/browser-cache-ttl.test.ts b/tests/api-resources/settings/browser-cache-ttl.test.ts index c30e9cbc00..15bc229250 100644 --- a/tests/api-resources/settings/browser-cache-ttl.test.ts +++ b/tests/api-resources/settings/browser-cache-ttl.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource browserCacheTTL', () => { // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.settings.browserCacheTTL.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.settings.browserCacheTTL.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: 0, }); const rawResponse = await responsePromise.asResponse(); @@ -27,8 +27,8 @@ describe('resource browserCacheTTL', () => { }); // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.settings.browserCacheTTL.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.settings.browserCacheTTL.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: 0, }); }); diff --git a/tests/api-resources/settings/browser-check.test.ts b/tests/api-resources/settings/browser-check.test.ts index d0a12e1888..7b042eec57 100644 --- a/tests/api-resources/settings/browser-check.test.ts +++ b/tests/api-resources/settings/browser-check.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource browserCheck', () => { // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.settings.browserCheck.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.settings.browserCheck.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: 'on', }); const rawResponse = await responsePromise.asResponse(); @@ -27,8 +27,8 @@ describe('resource browserCheck', () => { }); // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.settings.browserCheck.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.settings.browserCheck.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: 'on', }); }); diff --git a/tests/api-resources/settings/cache-level.test.ts b/tests/api-resources/settings/cache-level.test.ts index fecd739a89..974580aff4 100644 --- a/tests/api-resources/settings/cache-level.test.ts +++ b/tests/api-resources/settings/cache-level.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource cacheLevel', () => { // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.settings.cacheLevel.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.settings.cacheLevel.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: 'aggressive', }); const rawResponse = await responsePromise.asResponse(); @@ -27,8 +27,8 @@ describe('resource cacheLevel', () => { }); // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.settings.cacheLevel.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.settings.cacheLevel.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: 'aggressive', }); }); diff --git a/tests/api-resources/settings/challenge-ttl.test.ts b/tests/api-resources/settings/challenge-ttl.test.ts index 4ffd7244e6..de4eb90370 100644 --- a/tests/api-resources/settings/challenge-ttl.test.ts +++ b/tests/api-resources/settings/challenge-ttl.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource challengeTTL', () => { // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.settings.challengeTTL.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.settings.challengeTTL.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: 300, }); const rawResponse = await responsePromise.asResponse(); @@ -27,8 +27,8 @@ describe('resource challengeTTL', () => { }); // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.settings.challengeTTL.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.settings.challengeTTL.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: 300, }); }); diff --git a/tests/api-resources/settings/ciphers.test.ts b/tests/api-resources/settings/ciphers.test.ts index b4517e17df..8d2b23f4dd 100644 --- a/tests/api-resources/settings/ciphers.test.ts +++ b/tests/api-resources/settings/ciphers.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource ciphers', () => { // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.settings.ciphers.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.settings.ciphers.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: ['ECDHE-RSA-AES128-GCM-SHA256', 'AES128-SHA'], }); const rawResponse = await responsePromise.asResponse(); @@ -27,8 +27,8 @@ describe('resource ciphers', () => { }); // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.settings.ciphers.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.settings.ciphers.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: ['ECDHE-RSA-AES128-GCM-SHA256', 'AES128-SHA'], }); }); diff --git a/tests/api-resources/settings/development-mode.test.ts b/tests/api-resources/settings/development-mode.test.ts index b7e5611913..2629fff251 100644 --- a/tests/api-resources/settings/development-mode.test.ts +++ b/tests/api-resources/settings/development-mode.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource developmentMode', () => { // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.settings.developmentMode.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.settings.developmentMode.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: 'on', }); const rawResponse = await responsePromise.asResponse(); @@ -27,8 +27,8 @@ describe('resource developmentMode', () => { }); // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.settings.developmentMode.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.settings.developmentMode.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: 'on', }); }); diff --git a/tests/api-resources/settings/early-hints.test.ts b/tests/api-resources/settings/early-hints.test.ts index bbc88e1ca3..aa5a71c641 100644 --- a/tests/api-resources/settings/early-hints.test.ts +++ b/tests/api-resources/settings/early-hints.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource earlyHints', () => { // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.settings.earlyHints.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.settings.earlyHints.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: 'on', }); const rawResponse = await responsePromise.asResponse(); @@ -27,8 +27,8 @@ describe('resource earlyHints', () => { }); // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.settings.earlyHints.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.settings.earlyHints.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: 'on', }); }); diff --git a/tests/api-resources/settings/email-obfuscation.test.ts b/tests/api-resources/settings/email-obfuscation.test.ts index 1629853f0d..c74b7ef632 100644 --- a/tests/api-resources/settings/email-obfuscation.test.ts +++ b/tests/api-resources/settings/email-obfuscation.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource emailObfuscation', () => { // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.settings.emailObfuscation.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.settings.emailObfuscation.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: 'on', }); const rawResponse = await responsePromise.asResponse(); @@ -27,8 +27,8 @@ describe('resource emailObfuscation', () => { }); // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.settings.emailObfuscation.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.settings.emailObfuscation.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: 'on', }); }); diff --git a/tests/api-resources/settings/font-settings.test.ts b/tests/api-resources/settings/font-settings.test.ts index 72653f3def..1f7388ca4f 100644 --- a/tests/api-resources/settings/font-settings.test.ts +++ b/tests/api-resources/settings/font-settings.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource fontSettings', () => { // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.settings.fontSettings.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.settings.fontSettings.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: 'on', }); const rawResponse = await responsePromise.asResponse(); @@ -27,8 +27,8 @@ describe('resource fontSettings', () => { }); // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.settings.fontSettings.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.settings.fontSettings.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: 'on', }); }); diff --git a/tests/api-resources/settings/h2-prioritization.test.ts b/tests/api-resources/settings/h2-prioritization.test.ts index 92297069fb..331229945a 100644 --- a/tests/api-resources/settings/h2-prioritization.test.ts +++ b/tests/api-resources/settings/h2-prioritization.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource h2Prioritization', () => { // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.settings.h2Prioritization.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.settings.h2Prioritization.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: { id: 'h2_prioritization', value: 'on' }, }); const rawResponse = await responsePromise.asResponse(); @@ -27,8 +27,8 @@ describe('resource h2Prioritization', () => { }); // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.settings.h2Prioritization.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.settings.h2Prioritization.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: { id: 'h2_prioritization', value: 'on' }, }); }); diff --git a/tests/api-resources/settings/hotlink-protection.test.ts b/tests/api-resources/settings/hotlink-protection.test.ts index c9a6c2db33..5c855f7b69 100644 --- a/tests/api-resources/settings/hotlink-protection.test.ts +++ b/tests/api-resources/settings/hotlink-protection.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource hotlinkProtection', () => { // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.settings.hotlinkProtection.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.settings.hotlinkProtection.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: 'on', }); const rawResponse = await responsePromise.asResponse(); @@ -27,8 +27,8 @@ describe('resource hotlinkProtection', () => { }); // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.settings.hotlinkProtection.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.settings.hotlinkProtection.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: 'on', }); }); diff --git a/tests/api-resources/settings/http2.test.ts b/tests/api-resources/settings/http2.test.ts index 8c7b9a728b..855efae589 100644 --- a/tests/api-resources/settings/http2.test.ts +++ b/tests/api-resources/settings/http2.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource http2', () => { // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.settings.http2.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.settings.http2.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: 'on', }); const rawResponse = await responsePromise.asResponse(); @@ -27,8 +27,8 @@ describe('resource http2', () => { }); // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.settings.http2.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.settings.http2.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: 'on', }); }); diff --git a/tests/api-resources/settings/http3.test.ts b/tests/api-resources/settings/http3.test.ts index db8333adce..72ce9aff87 100644 --- a/tests/api-resources/settings/http3.test.ts +++ b/tests/api-resources/settings/http3.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource http3', () => { // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.settings.http3.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.settings.http3.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: 'on', }); const rawResponse = await responsePromise.asResponse(); @@ -27,8 +27,8 @@ describe('resource http3', () => { }); // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.settings.http3.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.settings.http3.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: 'on', }); }); diff --git a/tests/api-resources/settings/image-resizing.test.ts b/tests/api-resources/settings/image-resizing.test.ts index 6e92c265eb..7c28871e4c 100644 --- a/tests/api-resources/settings/image-resizing.test.ts +++ b/tests/api-resources/settings/image-resizing.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource imageResizing', () => { // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.settings.imageResizing.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.settings.imageResizing.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: { id: 'image_resizing', value: 'on' }, }); const rawResponse = await responsePromise.asResponse(); @@ -27,8 +27,8 @@ describe('resource imageResizing', () => { }); // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.settings.imageResizing.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.settings.imageResizing.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: { id: 'image_resizing', value: 'on' }, }); }); diff --git a/tests/api-resources/settings/ip-geolocation.test.ts b/tests/api-resources/settings/ip-geolocation.test.ts index 50a69aeaff..720965cc1f 100644 --- a/tests/api-resources/settings/ip-geolocation.test.ts +++ b/tests/api-resources/settings/ip-geolocation.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource ipGeolocation', () => { // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.settings.ipGeolocation.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.settings.ipGeolocation.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: 'on', }); const rawResponse = await responsePromise.asResponse(); @@ -27,8 +27,8 @@ describe('resource ipGeolocation', () => { }); // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.settings.ipGeolocation.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.settings.ipGeolocation.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: 'on', }); }); diff --git a/tests/api-resources/settings/ipv6.test.ts b/tests/api-resources/settings/ipv6.test.ts index d0f4afbaa0..a3f0c2a21e 100644 --- a/tests/api-resources/settings/ipv6.test.ts +++ b/tests/api-resources/settings/ipv6.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource ipv6', () => { // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.settings.ipv6.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.settings.ipv6.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: 'off', }); const rawResponse = await responsePromise.asResponse(); @@ -27,8 +27,8 @@ describe('resource ipv6', () => { }); // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.settings.ipv6.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.settings.ipv6.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: 'off', }); }); diff --git a/tests/api-resources/settings/min-tls-version.test.ts b/tests/api-resources/settings/min-tls-version.test.ts index 0b518f2ae5..99aa5bcfb8 100644 --- a/tests/api-resources/settings/min-tls-version.test.ts +++ b/tests/api-resources/settings/min-tls-version.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource minTLSVersion', () => { // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.settings.minTLSVersion.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.settings.minTLSVersion.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: '1.0', }); const rawResponse = await responsePromise.asResponse(); @@ -27,8 +27,8 @@ describe('resource minTLSVersion', () => { }); // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.settings.minTLSVersion.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.settings.minTLSVersion.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: '1.0', }); }); diff --git a/tests/api-resources/settings/minify.test.ts b/tests/api-resources/settings/minify.test.ts index 39f7fbd00a..9513e28fdf 100644 --- a/tests/api-resources/settings/minify.test.ts +++ b/tests/api-resources/settings/minify.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource minify', () => { // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.settings.minify.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.settings.minify.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: {}, }); const rawResponse = await responsePromise.asResponse(); @@ -27,8 +27,8 @@ describe('resource minify', () => { }); // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.settings.minify.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.settings.minify.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: { css: 'on', html: 'on', js: 'on' }, }); }); diff --git a/tests/api-resources/settings/mirage.test.ts b/tests/api-resources/settings/mirage.test.ts index 8919276066..9ee0a62e4b 100644 --- a/tests/api-resources/settings/mirage.test.ts +++ b/tests/api-resources/settings/mirage.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource mirage', () => { // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.settings.mirage.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.settings.mirage.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: 'on', }); const rawResponse = await responsePromise.asResponse(); @@ -27,8 +27,8 @@ describe('resource mirage', () => { }); // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.settings.mirage.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.settings.mirage.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: 'on', }); }); diff --git a/tests/api-resources/settings/mobile-redirect.test.ts b/tests/api-resources/settings/mobile-redirect.test.ts index b8e2da3a61..534884144a 100644 --- a/tests/api-resources/settings/mobile-redirect.test.ts +++ b/tests/api-resources/settings/mobile-redirect.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource mobileRedirect', () => { // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.settings.mobileRedirect.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.settings.mobileRedirect.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: {}, }); const rawResponse = await responsePromise.asResponse(); @@ -27,8 +27,8 @@ describe('resource mobileRedirect', () => { }); // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.settings.mobileRedirect.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.settings.mobileRedirect.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: { mobile_subdomain: 'm', status: 'on', strip_uri: false }, }); }); diff --git a/tests/api-resources/settings/nel.test.ts b/tests/api-resources/settings/nel.test.ts index 9062954e96..e541b1e0c8 100644 --- a/tests/api-resources/settings/nel.test.ts +++ b/tests/api-resources/settings/nel.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource nel', () => { // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.settings.nel.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.settings.nel.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: { id: 'nel', value: {} }, }); const rawResponse = await responsePromise.asResponse(); @@ -27,8 +27,8 @@ describe('resource nel', () => { }); // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.settings.nel.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.settings.nel.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: { id: 'nel', value: { enabled: false } }, }); }); diff --git a/tests/api-resources/settings/opportunistic-encryption.test.ts b/tests/api-resources/settings/opportunistic-encryption.test.ts index f921802265..48a219ce0d 100644 --- a/tests/api-resources/settings/opportunistic-encryption.test.ts +++ b/tests/api-resources/settings/opportunistic-encryption.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource opportunisticEncryption', () => { // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.settings.opportunisticEncryption.update( + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.settings.opportunisticEncryption.edit( '023e105f4ecef8ad9ca31a8372d0c353', { value: 'on' }, ); @@ -28,8 +28,8 @@ describe('resource opportunisticEncryption', () => { }); // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.settings.opportunisticEncryption.update( + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.settings.opportunisticEncryption.edit( '023e105f4ecef8ad9ca31a8372d0c353', { value: 'on' }, ); diff --git a/tests/api-resources/settings/opportunistic-onion.test.ts b/tests/api-resources/settings/opportunistic-onion.test.ts index 73b748d4fe..a96f7a0aee 100644 --- a/tests/api-resources/settings/opportunistic-onion.test.ts +++ b/tests/api-resources/settings/opportunistic-onion.test.ts @@ -13,11 +13,10 @@ const cloudflare = new Cloudflare({ describe('resource opportunisticOnion', () => { // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.settings.opportunisticOnion.update( - '023e105f4ecef8ad9ca31a8372d0c353', - { value: 'on' }, - ); + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.settings.opportunisticOnion.edit('023e105f4ecef8ad9ca31a8372d0c353', { + value: 'on', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -28,8 +27,8 @@ describe('resource opportunisticOnion', () => { }); // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.settings.opportunisticOnion.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.settings.opportunisticOnion.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: 'on', }); }); diff --git a/tests/api-resources/settings/orange-to-orange.test.ts b/tests/api-resources/settings/orange-to-orange.test.ts index 1c2bcea0f7..c0f659140d 100644 --- a/tests/api-resources/settings/orange-to-orange.test.ts +++ b/tests/api-resources/settings/orange-to-orange.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource orangeToOrange', () => { // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.settings.orangeToOrange.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.settings.orangeToOrange.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: { id: 'orange_to_orange', value: 'on' }, }); const rawResponse = await responsePromise.asResponse(); @@ -27,8 +27,8 @@ describe('resource orangeToOrange', () => { }); // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.settings.orangeToOrange.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.settings.orangeToOrange.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: { id: 'orange_to_orange', value: 'on' }, }); }); diff --git a/tests/api-resources/settings/origin-error-page-pass-thru.test.ts b/tests/api-resources/settings/origin-error-page-pass-thru.test.ts index e0966a5a36..63c0ed6001 100644 --- a/tests/api-resources/settings/origin-error-page-pass-thru.test.ts +++ b/tests/api-resources/settings/origin-error-page-pass-thru.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource originErrorPagePassThru', () => { // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.settings.originErrorPagePassThru.update( + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.settings.originErrorPagePassThru.edit( '023e105f4ecef8ad9ca31a8372d0c353', { value: 'on' }, ); @@ -28,8 +28,8 @@ describe('resource originErrorPagePassThru', () => { }); // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.settings.originErrorPagePassThru.update( + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.settings.originErrorPagePassThru.edit( '023e105f4ecef8ad9ca31a8372d0c353', { value: 'on' }, ); diff --git a/tests/api-resources/settings/origin-max-http-version.test.ts b/tests/api-resources/settings/origin-max-http-version.test.ts index d89cd144d9..057caed221 100644 --- a/tests/api-resources/settings/origin-max-http-version.test.ts +++ b/tests/api-resources/settings/origin-max-http-version.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource originMaxHTTPVersion', () => { // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.settings.originMaxHTTPVersion.update( + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.settings.originMaxHTTPVersion.edit( '023e105f4ecef8ad9ca31a8372d0c353', { value: '2' }, ); @@ -28,11 +28,10 @@ describe('resource originMaxHTTPVersion', () => { }); // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.settings.originMaxHTTPVersion.update( - '023e105f4ecef8ad9ca31a8372d0c353', - { value: '2' }, - ); + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.settings.originMaxHTTPVersion.edit('023e105f4ecef8ad9ca31a8372d0c353', { + value: '2', + }); }); // skipped: tests are disabled for the time being diff --git a/tests/api-resources/settings/polish.test.ts b/tests/api-resources/settings/polish.test.ts index 2d9897ae17..6cce39c628 100644 --- a/tests/api-resources/settings/polish.test.ts +++ b/tests/api-resources/settings/polish.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource polish', () => { // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.settings.polish.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.settings.polish.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: { id: 'polish', value: 'off' }, }); const rawResponse = await responsePromise.asResponse(); @@ -27,8 +27,8 @@ describe('resource polish', () => { }); // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.settings.polish.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.settings.polish.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: { id: 'polish', value: 'off' }, }); }); diff --git a/tests/api-resources/settings/prefetch-preload.test.ts b/tests/api-resources/settings/prefetch-preload.test.ts index 3eabcfb25d..ed073faf99 100644 --- a/tests/api-resources/settings/prefetch-preload.test.ts +++ b/tests/api-resources/settings/prefetch-preload.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource prefetchPreload', () => { // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.settings.prefetchPreload.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.settings.prefetchPreload.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: 'on', }); const rawResponse = await responsePromise.asResponse(); @@ -27,8 +27,8 @@ describe('resource prefetchPreload', () => { }); // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.settings.prefetchPreload.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.settings.prefetchPreload.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: 'on', }); }); diff --git a/tests/api-resources/settings/proxy-read-timeout.test.ts b/tests/api-resources/settings/proxy-read-timeout.test.ts index 171e3ffbff..6340d090b7 100644 --- a/tests/api-resources/settings/proxy-read-timeout.test.ts +++ b/tests/api-resources/settings/proxy-read-timeout.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource proxyReadTimeout', () => { // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.settings.proxyReadTimeout.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.settings.proxyReadTimeout.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: { id: 'proxy_read_timeout', value: 0 }, }); const rawResponse = await responsePromise.asResponse(); @@ -27,8 +27,8 @@ describe('resource proxyReadTimeout', () => { }); // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.settings.proxyReadTimeout.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.settings.proxyReadTimeout.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: { id: 'proxy_read_timeout', value: 0 }, }); }); diff --git a/tests/api-resources/settings/pseudo-ipv4.test.ts b/tests/api-resources/settings/pseudo-ipv4.test.ts index b4f40e2d97..df4dc0850b 100644 --- a/tests/api-resources/settings/pseudo-ipv4.test.ts +++ b/tests/api-resources/settings/pseudo-ipv4.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource pseudoIPV4', () => { // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.settings.pseudoIPV4.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.settings.pseudoIPV4.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: 'off', }); const rawResponse = await responsePromise.asResponse(); @@ -27,8 +27,8 @@ describe('resource pseudoIPV4', () => { }); // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.settings.pseudoIPV4.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.settings.pseudoIPV4.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: 'off', }); }); diff --git a/tests/api-resources/settings/response-buffering.test.ts b/tests/api-resources/settings/response-buffering.test.ts index 63a6fdba2f..2c5ca548b0 100644 --- a/tests/api-resources/settings/response-buffering.test.ts +++ b/tests/api-resources/settings/response-buffering.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource responseBuffering', () => { // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.settings.responseBuffering.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.settings.responseBuffering.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: 'on', }); const rawResponse = await responsePromise.asResponse(); @@ -27,8 +27,8 @@ describe('resource responseBuffering', () => { }); // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.settings.responseBuffering.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.settings.responseBuffering.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: 'on', }); }); diff --git a/tests/api-resources/settings/rocket-loader.test.ts b/tests/api-resources/settings/rocket-loader.test.ts index a5e7d1dd98..418ce40b07 100644 --- a/tests/api-resources/settings/rocket-loader.test.ts +++ b/tests/api-resources/settings/rocket-loader.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource rocketLoader', () => { // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.settings.rocketLoader.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.settings.rocketLoader.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: { id: 'rocket_loader', value: 'on' }, }); const rawResponse = await responsePromise.asResponse(); @@ -27,8 +27,8 @@ describe('resource rocketLoader', () => { }); // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.settings.rocketLoader.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.settings.rocketLoader.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: { id: 'rocket_loader', value: 'on' }, }); }); diff --git a/tests/api-resources/settings/security-headers.test.ts b/tests/api-resources/settings/security-headers.test.ts index 42ab0eb736..647c945c8c 100644 --- a/tests/api-resources/settings/security-headers.test.ts +++ b/tests/api-resources/settings/security-headers.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource securityHeaders', () => { // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.settings.securityHeaders.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.settings.securityHeaders.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: {}, }); const rawResponse = await responsePromise.asResponse(); @@ -27,8 +27,8 @@ describe('resource securityHeaders', () => { }); // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.settings.securityHeaders.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.settings.securityHeaders.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: { strict_transport_security: { enabled: true, include_subdomains: true, max_age: 86400, nosniff: true }, }, diff --git a/tests/api-resources/settings/security-level.test.ts b/tests/api-resources/settings/security-level.test.ts index 0b6696f09b..140109694a 100644 --- a/tests/api-resources/settings/security-level.test.ts +++ b/tests/api-resources/settings/security-level.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource securityLevel', () => { // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.settings.securityLevel.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.settings.securityLevel.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: 'off', }); const rawResponse = await responsePromise.asResponse(); @@ -27,8 +27,8 @@ describe('resource securityLevel', () => { }); // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.settings.securityLevel.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.settings.securityLevel.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: 'off', }); }); diff --git a/tests/api-resources/settings/server-side-excludes.test.ts b/tests/api-resources/settings/server-side-excludes.test.ts index c2746826da..a582a54e77 100644 --- a/tests/api-resources/settings/server-side-excludes.test.ts +++ b/tests/api-resources/settings/server-side-excludes.test.ts @@ -13,11 +13,10 @@ const cloudflare = new Cloudflare({ describe('resource serverSideExcludes', () => { // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.settings.serverSideExcludes.update( - '023e105f4ecef8ad9ca31a8372d0c353', - { value: 'on' }, - ); + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.settings.serverSideExcludes.edit('023e105f4ecef8ad9ca31a8372d0c353', { + value: 'on', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -28,8 +27,8 @@ describe('resource serverSideExcludes', () => { }); // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.settings.serverSideExcludes.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.settings.serverSideExcludes.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: 'on', }); }); diff --git a/tests/api-resources/settings/sort-query-string-for-cache.test.ts b/tests/api-resources/settings/sort-query-string-for-cache.test.ts index cf613b7cc1..5d6bc1c641 100644 --- a/tests/api-resources/settings/sort-query-string-for-cache.test.ts +++ b/tests/api-resources/settings/sort-query-string-for-cache.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource sortQueryStringForCache', () => { // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.settings.sortQueryStringForCache.update( + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.settings.sortQueryStringForCache.edit( '023e105f4ecef8ad9ca31a8372d0c353', { value: 'on' }, ); @@ -28,8 +28,8 @@ describe('resource sortQueryStringForCache', () => { }); // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.settings.sortQueryStringForCache.update( + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.settings.sortQueryStringForCache.edit( '023e105f4ecef8ad9ca31a8372d0c353', { value: 'on' }, ); diff --git a/tests/api-resources/settings/ssl-recommender.test.ts b/tests/api-resources/settings/ssl-recommender.test.ts index 2dda808fd0..8f53e0f3ee 100644 --- a/tests/api-resources/settings/ssl-recommender.test.ts +++ b/tests/api-resources/settings/ssl-recommender.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource sslRecommender', () => { // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.settings.sslRecommender.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.settings.sslRecommender.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: {}, }); const rawResponse = await responsePromise.asResponse(); @@ -27,8 +27,8 @@ describe('resource sslRecommender', () => { }); // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.settings.sslRecommender.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.settings.sslRecommender.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: { enabled: true, id: 'ssl_recommender' }, }); }); diff --git a/tests/api-resources/settings/ssl.test.ts b/tests/api-resources/settings/ssl.test.ts index dbdf7702c1..570db1bb74 100644 --- a/tests/api-resources/settings/ssl.test.ts +++ b/tests/api-resources/settings/ssl.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource ssl', () => { // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.settings.ssl.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.settings.ssl.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: 'off', }); const rawResponse = await responsePromise.asResponse(); @@ -27,10 +27,8 @@ describe('resource ssl', () => { }); // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.settings.ssl.update('023e105f4ecef8ad9ca31a8372d0c353', { - value: 'off', - }); + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.settings.ssl.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: 'off' }); }); // skipped: tests are disabled for the time being diff --git a/tests/api-resources/settings/tls-1-3.test.ts b/tests/api-resources/settings/tls-1-3.test.ts index ff000d5b5c..d0c0836646 100644 --- a/tests/api-resources/settings/tls-1-3.test.ts +++ b/tests/api-resources/settings/tls-1-3.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource tls1_3', () => { // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.settings.tls1_3.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.settings.tls1_3.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: 'on', }); const rawResponse = await responsePromise.asResponse(); @@ -27,8 +27,8 @@ describe('resource tls1_3', () => { }); // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.settings.tls1_3.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.settings.tls1_3.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: 'on', }); }); diff --git a/tests/api-resources/settings/tls-client-auth.test.ts b/tests/api-resources/settings/tls-client-auth.test.ts index 6f88a3fa0e..ec85f02f40 100644 --- a/tests/api-resources/settings/tls-client-auth.test.ts +++ b/tests/api-resources/settings/tls-client-auth.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource tlsClientAuth', () => { // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.settings.tlsClientAuth.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.settings.tlsClientAuth.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: 'on', }); const rawResponse = await responsePromise.asResponse(); @@ -27,8 +27,8 @@ describe('resource tlsClientAuth', () => { }); // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.settings.tlsClientAuth.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.settings.tlsClientAuth.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: 'on', }); }); diff --git a/tests/api-resources/settings/true-client-ip-header.test.ts b/tests/api-resources/settings/true-client-ip-header.test.ts index 885cb05615..09d9c53a91 100644 --- a/tests/api-resources/settings/true-client-ip-header.test.ts +++ b/tests/api-resources/settings/true-client-ip-header.test.ts @@ -13,11 +13,10 @@ const cloudflare = new Cloudflare({ describe('resource trueClientIPHeader', () => { // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.settings.trueClientIPHeader.update( - '023e105f4ecef8ad9ca31a8372d0c353', - { value: 'on' }, - ); + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.settings.trueClientIPHeader.edit('023e105f4ecef8ad9ca31a8372d0c353', { + value: 'on', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -28,8 +27,8 @@ describe('resource trueClientIPHeader', () => { }); // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.settings.trueClientIPHeader.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.settings.trueClientIPHeader.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: 'on', }); }); diff --git a/tests/api-resources/settings/waf.test.ts b/tests/api-resources/settings/waf.test.ts index faf7bb7ef0..4530941465 100644 --- a/tests/api-resources/settings/waf.test.ts +++ b/tests/api-resources/settings/waf.test.ts @@ -13,10 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource waf', () => { // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.settings.waf.update('023e105f4ecef8ad9ca31a8372d0c353', { - value: 'on', - }); + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.settings.waf.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: 'on' }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -27,10 +25,8 @@ describe('resource waf', () => { }); // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.settings.waf.update('023e105f4ecef8ad9ca31a8372d0c353', { - value: 'on', - }); + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.settings.waf.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: 'on' }); }); // skipped: tests are disabled for the time being diff --git a/tests/api-resources/settings/webp.test.ts b/tests/api-resources/settings/webp.test.ts index 2fae210e01..4fabf55fdf 100644 --- a/tests/api-resources/settings/webp.test.ts +++ b/tests/api-resources/settings/webp.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource webp', () => { // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.settings.webp.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.settings.webp.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: 'off', }); const rawResponse = await responsePromise.asResponse(); @@ -27,8 +27,8 @@ describe('resource webp', () => { }); // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.settings.webp.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.settings.webp.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: 'off', }); }); diff --git a/tests/api-resources/settings/websocket.test.ts b/tests/api-resources/settings/websocket.test.ts index 16637b818d..05209b76eb 100644 --- a/tests/api-resources/settings/websocket.test.ts +++ b/tests/api-resources/settings/websocket.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource websocket', () => { // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.settings.websocket.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.settings.websocket.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: 'off', }); const rawResponse = await responsePromise.asResponse(); @@ -27,8 +27,8 @@ describe('resource websocket', () => { }); // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.settings.websocket.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.settings.websocket.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: 'off', }); }); diff --git a/tests/api-resources/settings/zero-rtt.test.ts b/tests/api-resources/settings/zero-rtt.test.ts index 12159c7e86..7d55b2c0af 100644 --- a/tests/api-resources/settings/zero-rtt.test.ts +++ b/tests/api-resources/settings/zero-rtt.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource zeroRtt', () => { // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.settings.zeroRtt.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.settings.zeroRtt.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: 'on', }); const rawResponse = await responsePromise.asResponse(); @@ -27,8 +27,8 @@ describe('resource zeroRtt', () => { }); // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.settings.zeroRtt.update('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.settings.zeroRtt.edit('023e105f4ecef8ad9ca31a8372d0c353', { value: 'on', }); }); diff --git a/tests/api-resources/snippets/snippet-rules.test.ts b/tests/api-resources/snippets/snippet-rules.test.ts index d8ed71248b..bd2c195eaf 100644 --- a/tests/api-resources/snippets/snippet-rules.test.ts +++ b/tests/api-resources/snippets/snippet-rules.test.ts @@ -13,30 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource snippetRules', () => { // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.snippets.snippetRules.list('023e105f4ecef8ad9ca31a8372d0c353'); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.snippets.snippetRules.list('023e105f4ecef8ad9ca31a8372d0c353', { - path: '/_stainless_unknown_path', - }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - // skipped: tests are disabled for the time being - test.skip('replace', async () => { - const responsePromise = cloudflare.snippets.snippetRules.replace('023e105f4ecef8ad9ca31a8372d0c353'); + test.skip('update', async () => { + const responsePromise = cloudflare.snippets.snippetRules.update('023e105f4ecef8ad9ca31a8372d0c353'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -47,20 +25,20 @@ describe('resource snippetRules', () => { }); // skipped: tests are disabled for the time being - test.skip('replace: request options instead of params are passed correctly', async () => { + test.skip('update: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - cloudflare.snippets.snippetRules.replace('023e105f4ecef8ad9ca31a8372d0c353', { + cloudflare.snippets.snippetRules.update('023e105f4ecef8ad9ca31a8372d0c353', { path: '/_stainless_unknown_path', }), ).rejects.toThrow(Cloudflare.NotFoundError); }); // skipped: tests are disabled for the time being - test.skip('replace: request options and params are passed correctly', async () => { + test.skip('update: request options and params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - cloudflare.snippets.snippetRules.replace( + cloudflare.snippets.snippetRules.update( '023e105f4ecef8ad9ca31a8372d0c353', { rules: [ @@ -88,4 +66,26 @@ describe('resource snippetRules', () => { ), ).rejects.toThrow(Cloudflare.NotFoundError); }); + + // skipped: tests are disabled for the time being + test.skip('list', async () => { + const responsePromise = cloudflare.snippets.snippetRules.list('023e105f4ecef8ad9ca31a8372d0c353'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('list: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.snippets.snippetRules.list('023e105f4ecef8ad9ca31a8372d0c353', { + path: '/_stainless_unknown_path', + }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); }); diff --git a/tests/api-resources/snippets/snippets.test.ts b/tests/api-resources/snippets/snippets.test.ts index cbbefc0268..791c202a4d 100644 --- a/tests/api-resources/snippets/snippets.test.ts +++ b/tests/api-resources/snippets/snippets.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource snippets', () => { // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.snippets.list('023e105f4ecef8ad9ca31a8372d0c353'); + test.skip('update', async () => { + const responsePromise = cloudflare.snippets.update('023e105f4ecef8ad9ca31a8372d0c353', 'snippet_name_01'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -25,16 +25,34 @@ describe('resource snippets', () => { }); // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { + test.skip('update: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - cloudflare.snippets.list('023e105f4ecef8ad9ca31a8372d0c353', { path: '/_stainless_unknown_path' }), + cloudflare.snippets.update('023e105f4ecef8ad9ca31a8372d0c353', 'snippet_name_01', { + path: '/_stainless_unknown_path', + }), ).rejects.toThrow(Cloudflare.NotFoundError); }); // skipped: tests are disabled for the time being - test.skip('delete', async () => { - const responsePromise = cloudflare.snippets.delete('023e105f4ecef8ad9ca31a8372d0c353', 'snippet_name_01'); + test.skip('update: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.snippets.update( + '023e105f4ecef8ad9ca31a8372d0c353', + 'snippet_name_01', + { + files: "export { async function fetch(request, env) {return new Response('some_response') } }", + metadata: { main_module: 'main.js' }, + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('list', async () => { + const responsePromise = cloudflare.snippets.list('023e105f4ecef8ad9ca31a8372d0c353'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -45,18 +63,16 @@ describe('resource snippets', () => { }); // skipped: tests are disabled for the time being - test.skip('delete: request options instead of params are passed correctly', async () => { + test.skip('list: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - cloudflare.snippets.delete('023e105f4ecef8ad9ca31a8372d0c353', 'snippet_name_01', { - path: '/_stainless_unknown_path', - }), + cloudflare.snippets.list('023e105f4ecef8ad9ca31a8372d0c353', { path: '/_stainless_unknown_path' }), ).rejects.toThrow(Cloudflare.NotFoundError); }); // skipped: tests are disabled for the time being - test.skip('get', async () => { - const responsePromise = cloudflare.snippets.get('023e105f4ecef8ad9ca31a8372d0c353', 'snippet_name_01'); + test.skip('delete', async () => { + const responsePromise = cloudflare.snippets.delete('023e105f4ecef8ad9ca31a8372d0c353', 'snippet_name_01'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -67,21 +83,18 @@ describe('resource snippets', () => { }); // skipped: tests are disabled for the time being - test.skip('get: request options instead of params are passed correctly', async () => { + test.skip('delete: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - cloudflare.snippets.get('023e105f4ecef8ad9ca31a8372d0c353', 'snippet_name_01', { + cloudflare.snippets.delete('023e105f4ecef8ad9ca31a8372d0c353', 'snippet_name_01', { path: '/_stainless_unknown_path', }), ).rejects.toThrow(Cloudflare.NotFoundError); }); // skipped: tests are disabled for the time being - test.skip('replace', async () => { - const responsePromise = cloudflare.snippets.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - 'snippet_name_01', - ); + test.skip('get', async () => { + const responsePromise = cloudflare.snippets.get('023e105f4ecef8ad9ca31a8372d0c353', 'snippet_name_01'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -92,28 +105,12 @@ describe('resource snippets', () => { }); // skipped: tests are disabled for the time being - test.skip('replace: request options instead of params are passed correctly', async () => { + test.skip('get: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - cloudflare.snippets.replace('023e105f4ecef8ad9ca31a8372d0c353', 'snippet_name_01', { + cloudflare.snippets.get('023e105f4ecef8ad9ca31a8372d0c353', 'snippet_name_01', { path: '/_stainless_unknown_path', }), ).rejects.toThrow(Cloudflare.NotFoundError); }); - - // skipped: tests are disabled for the time being - test.skip('replace: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.snippets.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - 'snippet_name_01', - { - files: "export { async function fetch(request, env) {return new Response('some_response') } }", - metadata: { main_module: 'main.js' }, - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); }); diff --git a/tests/api-resources/spectrum/apps.test.ts b/tests/api-resources/spectrum/apps.test.ts index e7661d146e..484d87ea4c 100644 --- a/tests/api-resources/spectrum/apps.test.ts +++ b/tests/api-resources/spectrum/apps.test.ts @@ -45,6 +45,42 @@ describe('resource apps', () => { }); }); + // skipped: tests are disabled for the time being + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.spectrum.apps.update( + '023e105f4ecef8ad9ca31a8372d0c353', + 'ea95132c15732412d22c1476fa83f27a', + { dns: {}, origin_dns: {}, origin_port: 22, protocol: 'tcp/22' }, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('update: required and optional params', async () => { + const response = await cloudflare.spectrum.apps.update( + '023e105f4ecef8ad9ca31a8372d0c353', + 'ea95132c15732412d22c1476fa83f27a', + { + dns: { name: 'ssh.example.com', type: 'CNAME' }, + origin_dns: { name: 'origin.example.com', ttl: 600, type: '' }, + origin_port: 22, + protocol: 'tcp/22', + argo_smart_routing: true, + edge_ips: { connectivity: 'all', type: 'dynamic' }, + ip_firewall: true, + proxy_protocol: 'off', + tls: 'full', + traffic_type: 'direct', + }, + ); + }); + // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.spectrum.apps.list('023e105f4ecef8ad9ca31a8372d0c353'); @@ -116,40 +152,4 @@ describe('resource apps', () => { }), ).rejects.toThrow(Cloudflare.NotFoundError); }); - - // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.spectrum.apps.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - 'ea95132c15732412d22c1476fa83f27a', - { dns: {}, origin_dns: {}, origin_port: 22, protocol: 'tcp/22' }, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.spectrum.apps.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - 'ea95132c15732412d22c1476fa83f27a', - { - dns: { name: 'ssh.example.com', type: 'CNAME' }, - origin_dns: { name: 'origin.example.com', ttl: 600, type: '' }, - origin_port: 22, - protocol: 'tcp/22', - argo_smart_routing: true, - edge_ips: { connectivity: 'all', type: 'dynamic' }, - ip_firewall: true, - proxy_protocol: 'off', - tls: 'full', - traffic_type: 'direct', - }, - ); - }); }); diff --git a/tests/api-resources/ssl/certificate-packs/certificate-packs.test.ts b/tests/api-resources/ssl/certificate-packs/certificate-packs.test.ts index 57a924c26c..47fbae1196 100644 --- a/tests/api-resources/ssl/certificate-packs/certificate-packs.test.ts +++ b/tests/api-resources/ssl/certificate-packs/certificate-packs.test.ts @@ -12,21 +12,6 @@ const cloudflare = new Cloudflare({ }); describe('resource certificatePacks', () => { - // skipped: tests are disabled for the time being - test.skip('update', async () => { - const responsePromise = cloudflare.ssl.certificatePacks.update( - '023e105f4ecef8ad9ca31a8372d0c353', - '023e105f4ecef8ad9ca31a8372d0c353', - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.ssl.certificatePacks.list('023e105f4ecef8ad9ca31a8372d0c353'); @@ -76,6 +61,21 @@ describe('resource certificatePacks', () => { expect(dataAndResponse.response).toBe(rawResponse); }); + // skipped: tests are disabled for the time being + test.skip('edit', async () => { + const responsePromise = cloudflare.ssl.certificatePacks.edit( + '023e105f4ecef8ad9ca31a8372d0c353', + '023e105f4ecef8ad9ca31a8372d0c353', + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + // skipped: tests are disabled for the time being test.skip('get', async () => { const responsePromise = cloudflare.ssl.certificatePacks.get( diff --git a/tests/api-resources/ssl/universal/settings.test.ts b/tests/api-resources/ssl/universal/settings.test.ts index 0e23e34e4e..d4f19d885d 100644 --- a/tests/api-resources/ssl/universal/settings.test.ts +++ b/tests/api-resources/ssl/universal/settings.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource settings', () => { // skipped: tests are disabled for the time being - test.skip('update', async () => { - const responsePromise = cloudflare.ssl.universal.settings.update('023e105f4ecef8ad9ca31a8372d0c353', {}); + test.skip('edit', async () => { + const responsePromise = cloudflare.ssl.universal.settings.edit('023e105f4ecef8ad9ca31a8372d0c353', {}); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; diff --git a/tests/api-resources/ssl/verification.test.ts b/tests/api-resources/ssl/verification.test.ts index beef172121..46f462bae7 100644 --- a/tests/api-resources/ssl/verification.test.ts +++ b/tests/api-resources/ssl/verification.test.ts @@ -12,31 +12,6 @@ const cloudflare = new Cloudflare({ }); describe('resource verification', () => { - // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.ssl.verification.update( - '023e105f4ecef8ad9ca31a8372d0c353', - 'a77f8bd7-3b47-46b4-a6f1-75cf98109948', - { validation_method: 'txt' }, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.ssl.verification.update( - '023e105f4ecef8ad9ca31a8372d0c353', - 'a77f8bd7-3b47-46b4-a6f1-75cf98109948', - { validation_method: 'txt' }, - ); - }); - // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.ssl.verification.list('023e105f4ecef8ad9ca31a8372d0c353'); @@ -70,4 +45,29 @@ describe('resource verification', () => { ), ).rejects.toThrow(Cloudflare.NotFoundError); }); + + // skipped: tests are disabled for the time being + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.ssl.verification.edit( + '023e105f4ecef8ad9ca31a8372d0c353', + 'a77f8bd7-3b47-46b4-a6f1-75cf98109948', + { validation_method: 'txt' }, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.ssl.verification.edit( + '023e105f4ecef8ad9ca31a8372d0c353', + 'a77f8bd7-3b47-46b4-a6f1-75cf98109948', + { validation_method: 'txt' }, + ); + }); }); diff --git a/tests/api-resources/storage/kv/namespaces/bulk.test.ts b/tests/api-resources/storage/kv/namespaces/bulk.test.ts index d7ae1a27bb..d567b991ed 100644 --- a/tests/api-resources/storage/kv/namespaces/bulk.test.ts +++ b/tests/api-resources/storage/kv/namespaces/bulk.test.ts @@ -13,33 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource bulk', () => { // skipped: tests are disabled for the time being - test.skip('delete: only required params', async () => { - const responsePromise = cloudflare.storage.kv.namespaces.bulk.delete( - '023e105f4ecef8ad9ca31a8372d0c353', - '0f2ac74b498b48028cb68387c421e279', - ['My-Key', 'My-Key', 'My-Key'], - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('delete: required and optional params', async () => { - const response = await cloudflare.storage.kv.namespaces.bulk.delete( - '023e105f4ecef8ad9ca31a8372d0c353', - '0f2ac74b498b48028cb68387c421e279', - ['My-Key', 'My-Key', 'My-Key'], - ); - }); - - // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.storage.kv.namespaces.bulk.replace( + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.storage.kv.namespaces.bulk.update( '023e105f4ecef8ad9ca31a8372d0c353', '0f2ac74b498b48028cb68387c421e279', [{}, {}, {}], @@ -54,8 +29,8 @@ describe('resource bulk', () => { }); // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.storage.kv.namespaces.bulk.replace( + test.skip('update: required and optional params', async () => { + const response = await cloudflare.storage.kv.namespaces.bulk.update( '023e105f4ecef8ad9ca31a8372d0c353', '0f2ac74b498b48028cb68387c421e279', [ @@ -86,4 +61,29 @@ describe('resource bulk', () => { ], ); }); + + // skipped: tests are disabled for the time being + test.skip('delete: only required params', async () => { + const responsePromise = cloudflare.storage.kv.namespaces.bulk.delete( + '023e105f4ecef8ad9ca31a8372d0c353', + '0f2ac74b498b48028cb68387c421e279', + ['My-Key', 'My-Key', 'My-Key'], + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('delete: required and optional params', async () => { + const response = await cloudflare.storage.kv.namespaces.bulk.delete( + '023e105f4ecef8ad9ca31a8372d0c353', + '0f2ac74b498b48028cb68387c421e279', + ['My-Key', 'My-Key', 'My-Key'], + ); + }); }); diff --git a/tests/api-resources/storage/kv/namespaces/namespaces.test.ts b/tests/api-resources/storage/kv/namespaces/namespaces.test.ts index 41a89229cf..e3b6afb299 100644 --- a/tests/api-resources/storage/kv/namespaces/namespaces.test.ts +++ b/tests/api-resources/storage/kv/namespaces/namespaces.test.ts @@ -33,6 +33,31 @@ describe('resource namespaces', () => { }); }); + // skipped: tests are disabled for the time being + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.storage.kv.namespaces.update( + '023e105f4ecef8ad9ca31a8372d0c353', + '0f2ac74b498b48028cb68387c421e279', + { title: 'My Own Namespace' }, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('update: required and optional params', async () => { + const response = await cloudflare.storage.kv.namespaces.update( + '023e105f4ecef8ad9ca31a8372d0c353', + '0f2ac74b498b48028cb68387c421e279', + { title: 'My Own Namespace' }, + ); + }); + // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.storage.kv.namespaces.list('023e105f4ecef8ad9ca31a8372d0c353'); @@ -81,29 +106,4 @@ describe('resource namespaces', () => { expect(dataAndResponse.data).toBe(response); expect(dataAndResponse.response).toBe(rawResponse); }); - - // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.storage.kv.namespaces.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - '0f2ac74b498b48028cb68387c421e279', - { title: 'My Own Namespace' }, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.storage.kv.namespaces.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - '0f2ac74b498b48028cb68387c421e279', - { title: 'My Own Namespace' }, - ); - }); }); diff --git a/tests/api-resources/storage/kv/namespaces/values.test.ts b/tests/api-resources/storage/kv/namespaces/values.test.ts index 82c84ad996..05315caa63 100644 --- a/tests/api-resources/storage/kv/namespaces/values.test.ts +++ b/tests/api-resources/storage/kv/namespaces/values.test.ts @@ -13,11 +13,12 @@ const cloudflare = new Cloudflare({ describe('resource values', () => { // skipped: tests are disabled for the time being - test.skip('delete', async () => { - const responsePromise = cloudflare.storage.kv.namespaces.values.delete( + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.storage.kv.namespaces.values.update( '023e105f4ecef8ad9ca31a8372d0c353', '0f2ac74b498b48028cb68387c421e279', 'My-Key', + { metadata: '{"someMetadataKey": "someMetadataValue"}', value: 'Some Value' }, ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -29,8 +30,18 @@ describe('resource values', () => { }); // skipped: tests are disabled for the time being - test.skip('get', async () => { - const responsePromise = cloudflare.storage.kv.namespaces.values.get( + test.skip('update: required and optional params', async () => { + const response = await cloudflare.storage.kv.namespaces.values.update( + '023e105f4ecef8ad9ca31a8372d0c353', + '0f2ac74b498b48028cb68387c421e279', + 'My-Key', + { metadata: '{"someMetadataKey": "someMetadataValue"}', value: 'Some Value' }, + ); + }); + + // skipped: tests are disabled for the time being + test.skip('delete', async () => { + const responsePromise = cloudflare.storage.kv.namespaces.values.delete( '023e105f4ecef8ad9ca31a8372d0c353', '0f2ac74b498b48028cb68387c421e279', 'My-Key', @@ -45,25 +56,11 @@ describe('resource values', () => { }); // skipped: tests are disabled for the time being - test.skip('get: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.storage.kv.namespaces.values.get( - '023e105f4ecef8ad9ca31a8372d0c353', - '0f2ac74b498b48028cb68387c421e279', - 'My-Key', - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.storage.kv.namespaces.values.replace( + test.skip('get', async () => { + const responsePromise = cloudflare.storage.kv.namespaces.values.get( '023e105f4ecef8ad9ca31a8372d0c353', '0f2ac74b498b48028cb68387c421e279', 'My-Key', - { metadata: '{"someMetadataKey": "someMetadataValue"}', value: 'Some Value' }, ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -75,12 +72,15 @@ describe('resource values', () => { }); // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.storage.kv.namespaces.values.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - '0f2ac74b498b48028cb68387c421e279', - 'My-Key', - { metadata: '{"someMetadataKey": "someMetadataValue"}', value: 'Some Value' }, - ); + test.skip('get: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.storage.kv.namespaces.values.get( + '023e105f4ecef8ad9ca31a8372d0c353', + '0f2ac74b498b48028cb68387c421e279', + 'My-Key', + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); }); }); diff --git a/tests/api-resources/stream/audio-tracks.test.ts b/tests/api-resources/stream/audio-tracks.test.ts index 69e1dc66be..ca93d4bc9c 100644 --- a/tests/api-resources/stream/audio-tracks.test.ts +++ b/tests/api-resources/stream/audio-tracks.test.ts @@ -37,23 +37,6 @@ describe('resource audioTracks', () => { ); }); - // skipped: tests are disabled for the time being - test.skip('update', async () => { - const responsePromise = cloudflare.stream.audioTracks.update( - '023e105f4ecef8ad9ca31a8372d0c353', - 'ea95132c15732412d22c1476fa83f27a', - 'ea95132c15732412d22c1476fa83f27a', - {}, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.stream.audioTracks.list( @@ -109,4 +92,21 @@ describe('resource audioTracks', () => { ), ).rejects.toThrow(Cloudflare.NotFoundError); }); + + // skipped: tests are disabled for the time being + test.skip('edit', async () => { + const responsePromise = cloudflare.stream.audioTracks.edit( + '023e105f4ecef8ad9ca31a8372d0c353', + 'ea95132c15732412d22c1476fa83f27a', + 'ea95132c15732412d22c1476fa83f27a', + {}, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); }); diff --git a/tests/api-resources/stream/captions.test.ts b/tests/api-resources/stream/captions.test.ts index 3dfe578b07..a591ba5afe 100644 --- a/tests/api-resources/stream/captions.test.ts +++ b/tests/api-resources/stream/captions.test.ts @@ -13,10 +13,12 @@ const cloudflare = new Cloudflare({ describe('resource captions', () => { // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.stream.captions.list( + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.stream.captions.update( '023e105f4ecef8ad9ca31a8372d0c353', 'ea95132c15732412d22c1476fa83f27a', + 'tr', + { file: '@/Users/kyle/Desktop/tr.vtt' }, ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -28,23 +30,20 @@ describe('resource captions', () => { }); // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.stream.captions.list( - '023e105f4ecef8ad9ca31a8372d0c353', - 'ea95132c15732412d22c1476fa83f27a', - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); + test.skip('update: required and optional params', async () => { + const response = await cloudflare.stream.captions.update( + '023e105f4ecef8ad9ca31a8372d0c353', + 'ea95132c15732412d22c1476fa83f27a', + 'tr', + { file: '@/Users/kyle/Desktop/tr.vtt' }, + ); }); // skipped: tests are disabled for the time being - test.skip('delete', async () => { - const responsePromise = cloudflare.stream.captions.delete( + test.skip('list', async () => { + const responsePromise = cloudflare.stream.captions.list( '023e105f4ecef8ad9ca31a8372d0c353', 'ea95132c15732412d22c1476fa83f27a', - 'tr', ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -56,12 +55,23 @@ describe('resource captions', () => { }); // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.stream.captions.replace( + test.skip('list: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.stream.captions.list( + '023e105f4ecef8ad9ca31a8372d0c353', + 'ea95132c15732412d22c1476fa83f27a', + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('delete', async () => { + const responsePromise = cloudflare.stream.captions.delete( '023e105f4ecef8ad9ca31a8372d0c353', 'ea95132c15732412d22c1476fa83f27a', 'tr', - { file: '@/Users/kyle/Desktop/tr.vtt' }, ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -71,14 +81,4 @@ describe('resource captions', () => { expect(dataAndResponse.data).toBe(response); expect(dataAndResponse.response).toBe(rawResponse); }); - - // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.stream.captions.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - 'ea95132c15732412d22c1476fa83f27a', - 'tr', - { file: '@/Users/kyle/Desktop/tr.vtt' }, - ); - }); }); diff --git a/tests/api-resources/stream/live-inputs/live-inputs.test.ts b/tests/api-resources/stream/live-inputs/live-inputs.test.ts index c70017c576..3b14b7bb86 100644 --- a/tests/api-resources/stream/live-inputs/live-inputs.test.ts +++ b/tests/api-resources/stream/live-inputs/live-inputs.test.ts @@ -24,6 +24,22 @@ describe('resource liveInputs', () => { expect(dataAndResponse.response).toBe(rawResponse); }); + // skipped: tests are disabled for the time being + test.skip('update', async () => { + const responsePromise = cloudflare.stream.liveInputs.update( + '023e105f4ecef8ad9ca31a8372d0c353', + '66be4bf738797e01e1fca35a7bdecdcd', + {}, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.stream.liveInputs.list('023e105f4ecef8ad9ca31a8372d0c353'); @@ -99,20 +115,4 @@ describe('resource liveInputs', () => { ), ).rejects.toThrow(Cloudflare.NotFoundError); }); - - // skipped: tests are disabled for the time being - test.skip('replace', async () => { - const responsePromise = cloudflare.stream.liveInputs.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - '66be4bf738797e01e1fca35a7bdecdcd', - {}, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); }); diff --git a/tests/api-resources/stream/live-inputs/outputs.test.ts b/tests/api-resources/stream/live-inputs/outputs.test.ts index 50ca5d4565..e5796c019b 100644 --- a/tests/api-resources/stream/live-inputs/outputs.test.ts +++ b/tests/api-resources/stream/live-inputs/outputs.test.ts @@ -38,10 +38,12 @@ describe('resource outputs', () => { }); // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.stream.liveInputs.outputs.list( + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.stream.liveInputs.outputs.update( '023e105f4ecef8ad9ca31a8372d0c353', '66be4bf738797e01e1fca35a7bdecdcd', + 'baea4d9c515887b80289d5c33cf01145', + { enabled: true }, ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -53,23 +55,20 @@ describe('resource outputs', () => { }); // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.stream.liveInputs.outputs.list( - '023e105f4ecef8ad9ca31a8372d0c353', - '66be4bf738797e01e1fca35a7bdecdcd', - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); + test.skip('update: required and optional params', async () => { + const response = await cloudflare.stream.liveInputs.outputs.update( + '023e105f4ecef8ad9ca31a8372d0c353', + '66be4bf738797e01e1fca35a7bdecdcd', + 'baea4d9c515887b80289d5c33cf01145', + { enabled: true }, + ); }); // skipped: tests are disabled for the time being - test.skip('delete', async () => { - const responsePromise = cloudflare.stream.liveInputs.outputs.delete( + test.skip('list', async () => { + const responsePromise = cloudflare.stream.liveInputs.outputs.list( '023e105f4ecef8ad9ca31a8372d0c353', '66be4bf738797e01e1fca35a7bdecdcd', - 'baea4d9c515887b80289d5c33cf01145', ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -81,12 +80,23 @@ describe('resource outputs', () => { }); // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.stream.liveInputs.outputs.replace( + test.skip('list: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.stream.liveInputs.outputs.list( + '023e105f4ecef8ad9ca31a8372d0c353', + '66be4bf738797e01e1fca35a7bdecdcd', + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('delete', async () => { + const responsePromise = cloudflare.stream.liveInputs.outputs.delete( '023e105f4ecef8ad9ca31a8372d0c353', '66be4bf738797e01e1fca35a7bdecdcd', 'baea4d9c515887b80289d5c33cf01145', - { enabled: true }, ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -96,14 +106,4 @@ describe('resource outputs', () => { expect(dataAndResponse.data).toBe(response); expect(dataAndResponse.response).toBe(rawResponse); }); - - // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.stream.liveInputs.outputs.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - '66be4bf738797e01e1fca35a7bdecdcd', - 'baea4d9c515887b80289d5c33cf01145', - { enabled: true }, - ); - }); }); diff --git a/tests/api-resources/stream/webhooks.test.ts b/tests/api-resources/stream/webhooks.test.ts index 41007a2baa..549aa9aa79 100644 --- a/tests/api-resources/stream/webhooks.test.ts +++ b/tests/api-resources/stream/webhooks.test.ts @@ -12,6 +12,27 @@ const cloudflare = new Cloudflare({ }); describe('resource webhooks', () => { + // skipped: tests are disabled for the time being + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.stream.webhooks.update('023e105f4ecef8ad9ca31a8372d0c353', { + notificationUrl: 'https://example.com', + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('update: required and optional params', async () => { + const response = await cloudflare.stream.webhooks.update('023e105f4ecef8ad9ca31a8372d0c353', { + notificationUrl: 'https://example.com', + }); + }); + // skipped: tests are disabled for the time being test.skip('delete', async () => { const responsePromise = cloudflare.stream.webhooks.delete('023e105f4ecef8ad9ca31a8372d0c353'); @@ -45,25 +66,4 @@ describe('resource webhooks', () => { }), ).rejects.toThrow(Cloudflare.NotFoundError); }); - - // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.stream.webhooks.replace('023e105f4ecef8ad9ca31a8372d0c353', { - notificationUrl: 'https://example.com', - }); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.stream.webhooks.replace('023e105f4ecef8ad9ca31a8372d0c353', { - notificationUrl: 'https://example.com', - }); - }); }); diff --git a/tests/api-resources/subscriptions.test.ts b/tests/api-resources/subscriptions.test.ts index b1103f0336..4d395d61e3 100644 --- a/tests/api-resources/subscriptions.test.ts +++ b/tests/api-resources/subscriptions.test.ts @@ -24,6 +24,22 @@ describe('resource subscriptions', () => { expect(dataAndResponse.response).toBe(rawResponse); }); + // skipped: tests are disabled for the time being + test.skip('update', async () => { + const responsePromise = cloudflare.subscriptions.update( + '023e105f4ecef8ad9ca31a8372d0c353', + '506e3185e9c882d175a2d0cb0093d9f2', + {}, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.subscriptions.list('023e105f4ecef8ad9ca31a8372d0c353'); @@ -78,20 +94,4 @@ describe('resource subscriptions', () => { cloudflare.subscriptions.get('506e3185e9c882d175a2d0cb0093d9f2', { path: '/_stainless_unknown_path' }), ).rejects.toThrow(Cloudflare.NotFoundError); }); - - // skipped: tests are disabled for the time being - test.skip('replace', async () => { - const responsePromise = cloudflare.subscriptions.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - '506e3185e9c882d175a2d0cb0093d9f2', - {}, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); }); diff --git a/tests/api-resources/teamnet/routes.test.ts b/tests/api-resources/teamnet/routes.test.ts index fd3b537d1c..c006f7e150 100644 --- a/tests/api-resources/teamnet/routes.test.ts +++ b/tests/api-resources/teamnet/routes.test.ts @@ -35,22 +35,6 @@ describe('resource routes', () => { }); }); - // skipped: tests are disabled for the time being - test.skip('update', async () => { - const responsePromise = cloudflare.teamnet.routes.update( - '699d98642c564d2e855e9661899b7252', - 'f70ff985-a4ef-4643-bbbc-4a0ed4fc8415', - {}, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - // skipped: tests are disabled for the time being test.skip('delete', async () => { const responsePromise = cloudflare.teamnet.routes.delete( @@ -77,4 +61,20 @@ describe('resource routes', () => { ), ).rejects.toThrow(Cloudflare.NotFoundError); }); + + // skipped: tests are disabled for the time being + test.skip('edit', async () => { + const responsePromise = cloudflare.teamnet.routes.edit( + '699d98642c564d2e855e9661899b7252', + 'f70ff985-a4ef-4643-bbbc-4a0ed4fc8415', + {}, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); }); diff --git a/tests/api-resources/teamnets/virtual-networks.test.ts b/tests/api-resources/teamnets/virtual-networks.test.ts index 4513aa6828..5497ee3812 100644 --- a/tests/api-resources/teamnets/virtual-networks.test.ts +++ b/tests/api-resources/teamnets/virtual-networks.test.ts @@ -35,22 +35,6 @@ describe('resource virtualNetworks', () => { }); }); - // skipped: tests are disabled for the time being - test.skip('update', async () => { - const responsePromise = cloudflare.teamnets.virtualNetworks.update( - '699d98642c564d2e855e9661899b7252', - 'f70ff985-a4ef-4643-bbbc-4a0ed4fc8415', - {}, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.teamnets.virtualNetworks.list('699d98642c564d2e855e9661899b7252'); @@ -99,4 +83,20 @@ describe('resource virtualNetworks', () => { expect(dataAndResponse.data).toBe(response); expect(dataAndResponse.response).toBe(rawResponse); }); + + // skipped: tests are disabled for the time being + test.skip('edit', async () => { + const responsePromise = cloudflare.teamnets.virtualNetworks.edit( + '699d98642c564d2e855e9661899b7252', + 'f70ff985-a4ef-4643-bbbc-4a0ed4fc8415', + {}, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); }); diff --git a/tests/api-resources/tunnels/configurations.test.ts b/tests/api-resources/tunnels/configurations.test.ts index a69f9cf449..71a20ca1a7 100644 --- a/tests/api-resources/tunnels/configurations.test.ts +++ b/tests/api-resources/tunnels/configurations.test.ts @@ -12,6 +12,22 @@ const cloudflare = new Cloudflare({ }); describe('resource configurations', () => { + // skipped: tests are disabled for the time being + test.skip('update', async () => { + const responsePromise = cloudflare.tunnels.configurations.update( + '023e105f4ecef8ad9ca31a8372d0c353', + 'f70ff985-a4ef-4643-bbbc-4a0ed4fc8415', + {}, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.tunnels.configurations.list( @@ -38,20 +54,4 @@ describe('resource configurations', () => { ), ).rejects.toThrow(Cloudflare.NotFoundError); }); - - // skipped: tests are disabled for the time being - test.skip('replace', async () => { - const responsePromise = cloudflare.tunnels.configurations.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - 'f70ff985-a4ef-4643-bbbc-4a0ed4fc8415', - {}, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); }); diff --git a/tests/api-resources/tunnels/tunnels.test.ts b/tests/api-resources/tunnels/tunnels.test.ts index a4cfb28093..f24e958f96 100644 --- a/tests/api-resources/tunnels/tunnels.test.ts +++ b/tests/api-resources/tunnels/tunnels.test.ts @@ -35,22 +35,6 @@ describe('resource tunnels', () => { }); }); - // skipped: tests are disabled for the time being - test.skip('update', async () => { - const responsePromise = cloudflare.tunnels.update( - '699d98642c564d2e855e9661899b7252', - 'f70ff985-a4ef-4643-bbbc-4a0ed4fc8415', - {}, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.tunnels.list('699d98642c564d2e855e9661899b7252'); @@ -119,6 +103,22 @@ describe('resource tunnels', () => { ); }); + // skipped: tests are disabled for the time being + test.skip('edit', async () => { + const responsePromise = cloudflare.tunnels.edit( + '699d98642c564d2e855e9661899b7252', + 'f70ff985-a4ef-4643-bbbc-4a0ed4fc8415', + {}, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + // skipped: tests are disabled for the time being test.skip('get', async () => { const responsePromise = cloudflare.tunnels.get( diff --git a/tests/api-resources/url-normalizations.test.ts b/tests/api-resources/url-normalizations.test.ts index 098710c989..257c496db8 100644 --- a/tests/api-resources/url-normalizations.test.ts +++ b/tests/api-resources/url-normalizations.test.ts @@ -12,6 +12,18 @@ const cloudflare = new Cloudflare({ }); describe('resource urlNormalizations', () => { + // skipped: tests are disabled for the time being + test.skip('update', async () => { + const responsePromise = cloudflare.urlNormalizations.update('023e105f4ecef8ad9ca31a8372d0c353', {}); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + // skipped: tests are disabled for the time being test.skip('get', async () => { const responsePromise = cloudflare.urlNormalizations.get('023e105f4ecef8ad9ca31a8372d0c353'); @@ -33,16 +45,4 @@ describe('resource urlNormalizations', () => { }), ).rejects.toThrow(Cloudflare.NotFoundError); }); - - // skipped: tests are disabled for the time being - test.skip('replace', async () => { - const responsePromise = cloudflare.urlNormalizations.replace('023e105f4ecef8ad9ca31a8372d0c353', {}); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); }); diff --git a/tests/api-resources/users/firewall/access-rules/rules.test.ts b/tests/api-resources/users/firewall/access-rules/rules.test.ts index 9a4e6c6746..1eda0664bd 100644 --- a/tests/api-resources/users/firewall/access-rules/rules.test.ts +++ b/tests/api-resources/users/firewall/access-rules/rules.test.ts @@ -36,21 +36,6 @@ describe('resource rules', () => { }); }); - // skipped: tests are disabled for the time being - test.skip('update', async () => { - const responsePromise = cloudflare.users.firewall.accessRules.rules.update( - '92f17202ed8bd63d69a66b86a49a8f6b', - {}, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.users.firewall.accessRules.rules.list(); @@ -108,4 +93,19 @@ describe('resource rules', () => { expect(dataAndResponse.data).toBe(response); expect(dataAndResponse.response).toBe(rawResponse); }); + + // skipped: tests are disabled for the time being + test.skip('edit', async () => { + const responsePromise = cloudflare.users.firewall.accessRules.rules.edit( + '92f17202ed8bd63d69a66b86a49a8f6b', + {}, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); }); diff --git a/tests/api-resources/users/invites.test.ts b/tests/api-resources/users/invites.test.ts index 448a4fbf84..18ece0a90d 100644 --- a/tests/api-resources/users/invites.test.ts +++ b/tests/api-resources/users/invites.test.ts @@ -13,10 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource invites', () => { // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.users.invites.update('4f5f0c14a2a41d5063dd301b2f829f04', { - status: 'accepted', - }); + test.skip('list', async () => { + const responsePromise = cloudflare.users.invites.list(); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -27,15 +25,18 @@ describe('resource invites', () => { }); // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.users.invites.update('4f5f0c14a2a41d5063dd301b2f829f04', { - status: 'accepted', - }); + test.skip('list: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect(cloudflare.users.invites.list({ path: '/_stainless_unknown_path' })).rejects.toThrow( + Cloudflare.NotFoundError, + ); }); // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.users.invites.list(); + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.users.invites.edit('4f5f0c14a2a41d5063dd301b2f829f04', { + status: 'accepted', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -46,11 +47,10 @@ describe('resource invites', () => { }); // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect(cloudflare.users.invites.list({ path: '/_stainless_unknown_path' })).rejects.toThrow( - Cloudflare.NotFoundError, - ); + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.users.invites.edit('4f5f0c14a2a41d5063dd301b2f829f04', { + status: 'accepted', + }); }); // skipped: tests are disabled for the time being diff --git a/tests/api-resources/users/load-balancers/monitors/monitors.test.ts b/tests/api-resources/users/load-balancers/monitors/monitors.test.ts index 149d92034e..dffb12ccc8 100644 --- a/tests/api-resources/users/load-balancers/monitors/monitors.test.ts +++ b/tests/api-resources/users/load-balancers/monitors/monitors.test.ts @@ -46,46 +46,6 @@ describe('resource monitors', () => { }); }); - // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.users.loadBalancers.monitors.update( - 'f1aba936b94213e5b8dca0c0dbf1f9cc', - { expected_codes: '2xx' }, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.users.loadBalancers.monitors.update( - 'f1aba936b94213e5b8dca0c0dbf1f9cc', - { - expected_codes: '2xx', - allow_insecure: true, - consecutive_down: 0, - consecutive_up: 0, - description: 'Login page monitor', - expected_body: 'alive', - follow_redirects: true, - header: { Host: ['example.com'], 'X-App-ID': ['abc123'] }, - interval: 0, - method: 'GET', - path: '/health', - port: 0, - probe_zone: 'example.com', - retries: 0, - timeout: 0, - type: 'https', - }, - ); - }); - // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.users.loadBalancers.monitors.list(); @@ -120,6 +80,42 @@ describe('resource monitors', () => { expect(dataAndResponse.response).toBe(rawResponse); }); + // skipped: tests are disabled for the time being + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.users.loadBalancers.monitors.edit('f1aba936b94213e5b8dca0c0dbf1f9cc', { + expected_codes: '2xx', + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.users.loadBalancers.monitors.edit('f1aba936b94213e5b8dca0c0dbf1f9cc', { + expected_codes: '2xx', + allow_insecure: true, + consecutive_down: 0, + consecutive_up: 0, + description: 'Login page monitor', + expected_body: 'alive', + follow_redirects: true, + header: { Host: ['example.com'], 'X-App-ID': ['abc123'] }, + interval: 0, + method: 'GET', + path: '/health', + port: 0, + probe_zone: 'example.com', + retries: 0, + timeout: 0, + type: 'https', + }); + }); + // skipped: tests are disabled for the time being test.skip('get', async () => { const responsePromise = cloudflare.users.loadBalancers.monitors.get('f1aba936b94213e5b8dca0c0dbf1f9cc'); diff --git a/tests/api-resources/users/load-balancers/pools/pools.test.ts b/tests/api-resources/users/load-balancers/pools/pools.test.ts index b8c9504892..dbf5a7de9a 100644 --- a/tests/api-resources/users/load-balancers/pools/pools.test.ts +++ b/tests/api-resources/users/load-balancers/pools/pools.test.ts @@ -79,21 +79,6 @@ describe('resource pools', () => { }); }); - // skipped: tests are disabled for the time being - test.skip('update', async () => { - const responsePromise = cloudflare.users.loadBalancers.pools.update( - '17b5962d775c646f3f9725cbc7a53df4', - {}, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.users.loadBalancers.pools.list(); @@ -134,6 +119,18 @@ describe('resource pools', () => { expect(dataAndResponse.response).toBe(rawResponse); }); + // skipped: tests are disabled for the time being + test.skip('edit', async () => { + const responsePromise = cloudflare.users.loadBalancers.pools.edit('17b5962d775c646f3f9725cbc7a53df4', {}); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + // skipped: tests are disabled for the time being test.skip('get', async () => { const responsePromise = cloudflare.users.loadBalancers.pools.get('17b5962d775c646f3f9725cbc7a53df4'); diff --git a/tests/api-resources/users/subscriptions.test.ts b/tests/api-resources/users/subscriptions.test.ts index 642994fdbe..675ba08062 100644 --- a/tests/api-resources/users/subscriptions.test.ts +++ b/tests/api-resources/users/subscriptions.test.ts @@ -12,6 +12,18 @@ const cloudflare = new Cloudflare({ }); describe('resource subscriptions', () => { + // skipped: tests are disabled for the time being + test.skip('update', async () => { + const responsePromise = cloudflare.users.subscriptions.update('506e3185e9c882d175a2d0cb0093d9f2', {}); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.users.subscriptions.list(); @@ -43,16 +55,4 @@ describe('resource subscriptions', () => { expect(dataAndResponse.data).toBe(response); expect(dataAndResponse.response).toBe(rawResponse); }); - - // skipped: tests are disabled for the time being - test.skip('replace', async () => { - const responsePromise = cloudflare.users.subscriptions.replace('506e3185e9c882d175a2d0cb0093d9f2', {}); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); }); diff --git a/tests/api-resources/users/tokens/tokens.test.ts b/tests/api-resources/users/tokens/tokens.test.ts index 7cc1ae79a4..2a79cd9cbc 100644 --- a/tests/api-resources/users/tokens/tokens.test.ts +++ b/tests/api-resources/users/tokens/tokens.test.ts @@ -94,71 +94,8 @@ describe('resource tokens', () => { }); // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.users.tokens.list(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect(cloudflare.users.tokens.list({ path: '/_stainless_unknown_path' })).rejects.toThrow( - Cloudflare.NotFoundError, - ); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.users.tokens.list( - { direction: 'desc', page: 1, per_page: 5 }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - // skipped: tests are disabled for the time being - test.skip('delete', async () => { - const responsePromise = cloudflare.users.tokens.delete({}); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('get', async () => { - const responsePromise = cloudflare.users.tokens.get({}); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('get: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect(cloudflare.users.tokens.get({}, { path: '/_stainless_unknown_path' })).rejects.toThrow( - Cloudflare.NotFoundError, - ); - }); - - // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.users.tokens.replace( + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.users.tokens.update( {}, { name: 'readonly token', @@ -201,8 +138,8 @@ describe('resource tokens', () => { }); // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.users.tokens.replace( + test.skip('update: required and optional params', async () => { + const response = await cloudflare.users.tokens.update( {}, { name: 'readonly token', @@ -245,6 +182,69 @@ describe('resource tokens', () => { ); }); + // skipped: tests are disabled for the time being + test.skip('list', async () => { + const responsePromise = cloudflare.users.tokens.list(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('list: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect(cloudflare.users.tokens.list({ path: '/_stainless_unknown_path' })).rejects.toThrow( + Cloudflare.NotFoundError, + ); + }); + + // skipped: tests are disabled for the time being + test.skip('list: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.users.tokens.list( + { direction: 'desc', page: 1, per_page: 5 }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('delete', async () => { + const responsePromise = cloudflare.users.tokens.delete({}); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('get', async () => { + const responsePromise = cloudflare.users.tokens.get({}); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect(cloudflare.users.tokens.get({}, { path: '/_stainless_unknown_path' })).rejects.toThrow( + Cloudflare.NotFoundError, + ); + }); + // skipped: tests are disabled for the time being test.skip('verify', async () => { const responsePromise = cloudflare.users.tokens.verify(); diff --git a/tests/api-resources/users/tokens/values.test.ts b/tests/api-resources/users/tokens/values.test.ts index fefa3fb40c..37ab27225b 100644 --- a/tests/api-resources/users/tokens/values.test.ts +++ b/tests/api-resources/users/tokens/values.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource values', () => { // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.users.tokens.values.replace({}, {}); + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.users.tokens.values.update({}, {}); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -25,7 +25,7 @@ describe('resource values', () => { }); // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.users.tokens.values.replace({}, {}); + test.skip('update: required and optional params', async () => { + const response = await cloudflare.users.tokens.values.update({}, {}); }); }); diff --git a/tests/api-resources/users/users.test.ts b/tests/api-resources/users/users.test.ts index 5294c08ecc..dd2a680eac 100644 --- a/tests/api-resources/users/users.test.ts +++ b/tests/api-resources/users/users.test.ts @@ -12,18 +12,6 @@ const cloudflare = new Cloudflare({ }); describe('resource users', () => { - // skipped: tests are disabled for the time being - test.skip('update', async () => { - const responsePromise = cloudflare.users.update({}); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.users.list(); @@ -43,4 +31,16 @@ describe('resource users', () => { Cloudflare.NotFoundError, ); }); + + // skipped: tests are disabled for the time being + test.skip('edit', async () => { + const responsePromise = cloudflare.users.edit({}); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); }); diff --git a/tests/api-resources/vectorize/indexes.test.ts b/tests/api-resources/vectorize/indexes.test.ts index 6af3b531ff..db92e98ec1 100644 --- a/tests/api-resources/vectorize/indexes.test.ts +++ b/tests/api-resources/vectorize/indexes.test.ts @@ -36,6 +36,31 @@ describe('resource indexes', () => { }); }); + // skipped: tests are disabled for the time being + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.vectorize.indexes.update( + '023e105f4ecef8ad9ca31a8372d0c353', + 'example-index', + { description: 'This is my example index.' }, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('update: required and optional params', async () => { + const response = await cloudflare.vectorize.indexes.update( + '023e105f4ecef8ad9ca31a8372d0c353', + 'example-index', + { description: 'This is my example index.' }, + ); + }); + // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.vectorize.indexes.list('023e105f4ecef8ad9ca31a8372d0c353'); @@ -140,31 +165,6 @@ describe('resource indexes', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.vectorize.indexes.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - 'example-index', - { description: 'This is my example index.' }, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.vectorize.indexes.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - 'example-index', - { description: 'This is my example index.' }, - ); - }); - // skipped: tests are disabled for the time being test.skip('upsert', async () => { const responsePromise = cloudflare.vectorize.indexes.upsert( diff --git a/tests/api-resources/waiting-rooms/events/events.test.ts b/tests/api-resources/waiting-rooms/events/events.test.ts index cc202c55ac..1bdc2a7225 100644 --- a/tests/api-resources/waiting-rooms/events/events.test.ts +++ b/tests/api-resources/waiting-rooms/events/events.test.ts @@ -56,6 +56,52 @@ describe('resource events', () => { ); }); + // skipped: tests are disabled for the time being + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.waitingRooms.events.update( + '023e105f4ecef8ad9ca31a8372d0c353', + '699d98642c564d2e855e9661899b7252', + '25756b2dfe6e378a06b033b670413757', + { + event_end_time: '2021-09-28T17:00:00.000Z', + event_start_time: '2021-09-28T15:30:00.000Z', + name: 'production_webinar_event', + }, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('update: required and optional params', async () => { + const response = await cloudflare.waitingRooms.events.update( + '023e105f4ecef8ad9ca31a8372d0c353', + '699d98642c564d2e855e9661899b7252', + '25756b2dfe6e378a06b033b670413757', + { + event_end_time: '2021-09-28T17:00:00.000Z', + event_start_time: '2021-09-28T15:30:00.000Z', + name: 'production_webinar_event', + custom_page_html: + '{{#waitTimeKnown}} {{waitTime}} mins {{/waitTimeKnown}} {{^waitTimeKnown}} Event is prequeueing / Queue all enabled {{/waitTimeKnown}}', + description: 'Production event - DO NOT MODIFY', + disable_session_renewal: true, + new_users_per_minute: 200, + prequeue_start_time: '2021-09-28T15:00:00.000Z', + queueing_method: 'random', + session_duration: 1, + shuffle_at_event_start: true, + suspended: true, + total_active_users: 200, + }, + ); + }); + // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.waitingRooms.events.list( @@ -127,50 +173,4 @@ describe('resource events', () => { ), ).rejects.toThrow(Cloudflare.NotFoundError); }); - - // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.waitingRooms.events.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - '699d98642c564d2e855e9661899b7252', - '25756b2dfe6e378a06b033b670413757', - { - event_end_time: '2021-09-28T17:00:00.000Z', - event_start_time: '2021-09-28T15:30:00.000Z', - name: 'production_webinar_event', - }, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.waitingRooms.events.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - '699d98642c564d2e855e9661899b7252', - '25756b2dfe6e378a06b033b670413757', - { - event_end_time: '2021-09-28T17:00:00.000Z', - event_start_time: '2021-09-28T15:30:00.000Z', - name: 'production_webinar_event', - custom_page_html: - '{{#waitTimeKnown}} {{waitTime}} mins {{/waitTimeKnown}} {{^waitTimeKnown}} Event is prequeueing / Queue all enabled {{/waitTimeKnown}}', - description: 'Production event - DO NOT MODIFY', - disable_session_renewal: true, - new_users_per_minute: 200, - prequeue_start_time: '2021-09-28T15:00:00.000Z', - queueing_method: 'random', - session_duration: 1, - shuffle_at_event_start: true, - suspended: true, - total_active_users: 200, - }, - ); - }); }); diff --git a/tests/api-resources/waiting-rooms/rules.test.ts b/tests/api-resources/waiting-rooms/rules.test.ts index cf6101f87c..3094b7d481 100644 --- a/tests/api-resources/waiting-rooms/rules.test.ts +++ b/tests/api-resources/waiting-rooms/rules.test.ts @@ -47,8 +47,11 @@ describe('resource rules', () => { const responsePromise = cloudflare.waitingRooms.rules.update( '023e105f4ecef8ad9ca31a8372d0c353', '699d98642c564d2e855e9661899b7252', - '25756b2dfe6e378a06b033b670413757', - { action: 'bypass_waiting_room', expression: 'ip.src in {10.20.30.40}' }, + [ + { action: 'bypass_waiting_room', expression: 'ip.src in {10.20.30.40}' }, + { action: 'bypass_waiting_room', expression: 'ip.src in {10.20.30.40}' }, + { action: 'bypass_waiting_room', expression: 'ip.src in {10.20.30.40}' }, + ], ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -64,14 +67,26 @@ describe('resource rules', () => { const response = await cloudflare.waitingRooms.rules.update( '023e105f4ecef8ad9ca31a8372d0c353', '699d98642c564d2e855e9661899b7252', - '25756b2dfe6e378a06b033b670413757', - { - action: 'bypass_waiting_room', - expression: 'ip.src in {10.20.30.40}', - description: 'allow all traffic from 10.20.30.40', - enabled: true, - position: { index: 0 }, - }, + [ + { + action: 'bypass_waiting_room', + description: 'allow all traffic from 10.20.30.40', + enabled: true, + expression: 'ip.src in {10.20.30.40}', + }, + { + action: 'bypass_waiting_room', + description: 'allow all traffic from 10.20.30.40', + enabled: true, + expression: 'ip.src in {10.20.30.40}', + }, + { + action: 'bypass_waiting_room', + description: 'allow all traffic from 10.20.30.40', + enabled: true, + expression: 'ip.src in {10.20.30.40}', + }, + ], ); }); @@ -119,15 +134,12 @@ describe('resource rules', () => { }); // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.waitingRooms.rules.replace( + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.waitingRooms.rules.edit( '023e105f4ecef8ad9ca31a8372d0c353', '699d98642c564d2e855e9661899b7252', - [ - { action: 'bypass_waiting_room', expression: 'ip.src in {10.20.30.40}' }, - { action: 'bypass_waiting_room', expression: 'ip.src in {10.20.30.40}' }, - { action: 'bypass_waiting_room', expression: 'ip.src in {10.20.30.40}' }, - ], + '25756b2dfe6e378a06b033b670413757', + { action: 'bypass_waiting_room', expression: 'ip.src in {10.20.30.40}' }, ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -139,30 +151,18 @@ describe('resource rules', () => { }); // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.waitingRooms.rules.replace( + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.waitingRooms.rules.edit( '023e105f4ecef8ad9ca31a8372d0c353', '699d98642c564d2e855e9661899b7252', - [ - { - action: 'bypass_waiting_room', - description: 'allow all traffic from 10.20.30.40', - enabled: true, - expression: 'ip.src in {10.20.30.40}', - }, - { - action: 'bypass_waiting_room', - description: 'allow all traffic from 10.20.30.40', - enabled: true, - expression: 'ip.src in {10.20.30.40}', - }, - { - action: 'bypass_waiting_room', - description: 'allow all traffic from 10.20.30.40', - enabled: true, - expression: 'ip.src in {10.20.30.40}', - }, - ], + '25756b2dfe6e378a06b033b670413757', + { + action: 'bypass_waiting_room', + expression: 'ip.src in {10.20.30.40}', + description: 'allow all traffic from 10.20.30.40', + enabled: true, + position: { index: 0 }, + }, ); }); }); diff --git a/tests/api-resources/waiting-rooms/settings.test.ts b/tests/api-resources/waiting-rooms/settings.test.ts index 7bbf5e4757..642b348265 100644 --- a/tests/api-resources/waiting-rooms/settings.test.ts +++ b/tests/api-resources/waiting-rooms/settings.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource settings', () => { // skipped: tests are disabled for the time being - test.skip('update', async () => { - const responsePromise = cloudflare.waitingRooms.settings.update('023e105f4ecef8ad9ca31a8372d0c353', {}); + test.skip('edit', async () => { + const responsePromise = cloudflare.waitingRooms.settings.edit('023e105f4ecef8ad9ca31a8372d0c353', {}); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; diff --git a/tests/api-resources/waiting-rooms/waiting-rooms.test.ts b/tests/api-resources/waiting-rooms/waiting-rooms.test.ts index 378c58312b..bd79a80f97 100644 --- a/tests/api-resources/waiting-rooms/waiting-rooms.test.ts +++ b/tests/api-resources/waiting-rooms/waiting-rooms.test.ts @@ -58,6 +58,60 @@ describe('resource waitingRooms', () => { }); }); + // skipped: tests are disabled for the time being + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.waitingRooms.update( + '023e105f4ecef8ad9ca31a8372d0c353', + '699d98642c564d2e855e9661899b7252', + { + host: 'shop.example.com', + name: 'production_webinar', + new_users_per_minute: 200, + total_active_users: 200, + }, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('update: required and optional params', async () => { + const response = await cloudflare.waitingRooms.update( + '023e105f4ecef8ad9ca31a8372d0c353', + '699d98642c564d2e855e9661899b7252', + { + host: 'shop.example.com', + name: 'production_webinar', + new_users_per_minute: 200, + total_active_users: 200, + additional_routes: [ + { host: 'shop2.example.com', path: '/shop2/checkout' }, + { host: 'shop2.example.com', path: '/shop2/checkout' }, + { host: 'shop2.example.com', path: '/shop2/checkout' }, + ], + cookie_attributes: { samesite: 'auto', secure: 'auto' }, + cookie_suffix: 'abcd', + custom_page_html: + '{{#waitTimeKnown}} {{waitTime}} mins {{/waitTimeKnown}} {{^waitTimeKnown}} Queue all enabled {{/waitTimeKnown}}', + default_template_language: 'es-ES', + description: 'Production - DO NOT MODIFY', + disable_session_renewal: false, + json_response_enabled: false, + path: '/shop/checkout', + queue_all: true, + queueing_method: 'fifo', + queueing_status_code: 202, + session_duration: 1, + suspended: true, + }, + ); + }); + // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.waitingRooms.list('023e105f4ecef8ad9ca31a8372d0c353'); @@ -140,58 +194,4 @@ describe('resource waitingRooms', () => { '{{#waitTimeKnown}} {{waitTime}} mins {{/waitTimeKnown}} {{^waitTimeKnown}} Queue all enabled {{/waitTimeKnown}}', }); }); - - // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.waitingRooms.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - '699d98642c564d2e855e9661899b7252', - { - host: 'shop.example.com', - name: 'production_webinar', - new_users_per_minute: 200, - total_active_users: 200, - }, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.waitingRooms.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - '699d98642c564d2e855e9661899b7252', - { - host: 'shop.example.com', - name: 'production_webinar', - new_users_per_minute: 200, - total_active_users: 200, - additional_routes: [ - { host: 'shop2.example.com', path: '/shop2/checkout' }, - { host: 'shop2.example.com', path: '/shop2/checkout' }, - { host: 'shop2.example.com', path: '/shop2/checkout' }, - ], - cookie_attributes: { samesite: 'auto', secure: 'auto' }, - cookie_suffix: 'abcd', - custom_page_html: - '{{#waitTimeKnown}} {{waitTime}} mins {{/waitTimeKnown}} {{^waitTimeKnown}} Queue all enabled {{/waitTimeKnown}}', - default_template_language: 'es-ES', - description: 'Production - DO NOT MODIFY', - disable_session_renewal: false, - json_response_enabled: false, - path: '/shop/checkout', - queue_all: true, - queueing_method: 'fifo', - queueing_status_code: 202, - session_duration: 1, - suspended: true, - }, - ); - }); }); diff --git a/tests/api-resources/warp-connector.test.ts b/tests/api-resources/warp-connector.test.ts index ee27a745fd..3d31730573 100644 --- a/tests/api-resources/warp-connector.test.ts +++ b/tests/api-resources/warp-connector.test.ts @@ -33,22 +33,6 @@ describe('resource warpConnector', () => { }); }); - // skipped: tests are disabled for the time being - test.skip('update', async () => { - const responsePromise = cloudflare.warpConnector.update( - '699d98642c564d2e855e9661899b7252', - 'f70ff985-a4ef-4643-bbbc-4a0ed4fc8415', - {}, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.warpConnector.list('699d98642c564d2e855e9661899b7252'); @@ -116,6 +100,22 @@ describe('resource warpConnector', () => { ); }); + // skipped: tests are disabled for the time being + test.skip('edit', async () => { + const responsePromise = cloudflare.warpConnector.edit( + '699d98642c564d2e855e9661899b7252', + 'f70ff985-a4ef-4643-bbbc-4a0ed4fc8415', + {}, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + // skipped: tests are disabled for the time being test.skip('get', async () => { const responsePromise = cloudflare.warpConnector.get( diff --git a/tests/api-resources/web3/hostnames/hostnames.test.ts b/tests/api-resources/web3/hostnames/hostnames.test.ts index 890721efb8..2418a5fc22 100644 --- a/tests/api-resources/web3/hostnames/hostnames.test.ts +++ b/tests/api-resources/web3/hostnames/hostnames.test.ts @@ -35,22 +35,6 @@ describe('resource hostnames', () => { }); }); - // skipped: tests are disabled for the time being - test.skip('update', async () => { - const responsePromise = cloudflare.web3.hostnames.update( - '023e105f4ecef8ad9ca31a8372d0c353', - '023e105f4ecef8ad9ca31a8372d0c353', - {}, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.web3.hostnames.list('023e105f4ecef8ad9ca31a8372d0c353'); @@ -88,6 +72,22 @@ describe('resource hostnames', () => { expect(dataAndResponse.response).toBe(rawResponse); }); + // skipped: tests are disabled for the time being + test.skip('edit', async () => { + const responsePromise = cloudflare.web3.hostnames.edit( + '023e105f4ecef8ad9ca31a8372d0c353', + '023e105f4ecef8ad9ca31a8372d0c353', + {}, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + // skipped: tests are disabled for the time being test.skip('get', async () => { const responsePromise = cloudflare.web3.hostnames.get( diff --git a/tests/api-resources/web3/hostnames/ipfs-universal-paths/content-lists/content-lists.test.ts b/tests/api-resources/web3/hostnames/ipfs-universal-paths/content-lists/content-lists.test.ts index 902317f74c..8892c7acb5 100644 --- a/tests/api-resources/web3/hostnames/ipfs-universal-paths/content-lists/content-lists.test.ts +++ b/tests/api-resources/web3/hostnames/ipfs-universal-paths/content-lists/content-lists.test.ts @@ -13,35 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource contentLists', () => { // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.web3.hostnames.ipfsUniversalPaths.contentLists.list( - '023e105f4ecef8ad9ca31a8372d0c353', - '023e105f4ecef8ad9ca31a8372d0c353', - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.web3.hostnames.ipfsUniversalPaths.contentLists.list( - '023e105f4ecef8ad9ca31a8372d0c353', - '023e105f4ecef8ad9ca31a8372d0c353', - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.web3.hostnames.ipfsUniversalPaths.contentLists.replace( + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.web3.hostnames.ipfsUniversalPaths.contentLists.update( '023e105f4ecef8ad9ca31a8372d0c353', '023e105f4ecef8ad9ca31a8372d0c353', { action: 'block', entries: [{}, {}, {}] }, @@ -56,8 +29,8 @@ describe('resource contentLists', () => { }); // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.web3.hostnames.ipfsUniversalPaths.contentLists.replace( + test.skip('update: required and optional params', async () => { + const response = await cloudflare.web3.hostnames.ipfsUniversalPaths.contentLists.update( '023e105f4ecef8ad9ca31a8372d0c353', '023e105f4ecef8ad9ca31a8372d0c353', { @@ -82,4 +55,31 @@ describe('resource contentLists', () => { }, ); }); + + // skipped: tests are disabled for the time being + test.skip('list', async () => { + const responsePromise = cloudflare.web3.hostnames.ipfsUniversalPaths.contentLists.list( + '023e105f4ecef8ad9ca31a8372d0c353', + '023e105f4ecef8ad9ca31a8372d0c353', + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('list: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.web3.hostnames.ipfsUniversalPaths.contentLists.list( + '023e105f4ecef8ad9ca31a8372d0c353', + '023e105f4ecef8ad9ca31a8372d0c353', + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); }); diff --git a/tests/api-resources/web3/hostnames/ipfs-universal-paths/content-lists/entries.test.ts b/tests/api-resources/web3/hostnames/ipfs-universal-paths/content-lists/entries.test.ts index 49047ef1c2..ff6f86a463 100644 --- a/tests/api-resources/web3/hostnames/ipfs-universal-paths/content-lists/entries.test.ts +++ b/tests/api-resources/web3/hostnames/ipfs-universal-paths/content-lists/entries.test.ts @@ -41,6 +41,37 @@ describe('resource entries', () => { ); }); + // skipped: tests are disabled for the time being + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.web3.hostnames.ipfsUniversalPaths.contentLists.entries.update( + '023e105f4ecef8ad9ca31a8372d0c353', + '023e105f4ecef8ad9ca31a8372d0c353', + '023e105f4ecef8ad9ca31a8372d0c353', + { content: 'QmPZ9gcCEpqKTo6aq61g2nXGUhM4iCL3ewB6LDXZCtioEB', type: 'cid' }, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('update: required and optional params', async () => { + const response = await cloudflare.web3.hostnames.ipfsUniversalPaths.contentLists.entries.update( + '023e105f4ecef8ad9ca31a8372d0c353', + '023e105f4ecef8ad9ca31a8372d0c353', + '023e105f4ecef8ad9ca31a8372d0c353', + { + content: 'QmPZ9gcCEpqKTo6aq61g2nXGUhM4iCL3ewB6LDXZCtioEB', + type: 'cid', + description: 'this is my content list entry', + }, + ); + }); + // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.web3.hostnames.ipfsUniversalPaths.contentLists.entries.list( @@ -112,35 +143,4 @@ describe('resource entries', () => { ), ).rejects.toThrow(Cloudflare.NotFoundError); }); - - // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.web3.hostnames.ipfsUniversalPaths.contentLists.entries.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - '023e105f4ecef8ad9ca31a8372d0c353', - '023e105f4ecef8ad9ca31a8372d0c353', - { content: 'QmPZ9gcCEpqKTo6aq61g2nXGUhM4iCL3ewB6LDXZCtioEB', type: 'cid' }, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.web3.hostnames.ipfsUniversalPaths.contentLists.entries.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - '023e105f4ecef8ad9ca31a8372d0c353', - '023e105f4ecef8ad9ca31a8372d0c353', - { - content: 'QmPZ9gcCEpqKTo6aq61g2nXGUhM4iCL3ewB6LDXZCtioEB', - type: 'cid', - description: 'this is my content list entry', - }, - ); - }); }); diff --git a/tests/api-resources/worker-scripts/content.test.ts b/tests/api-resources/worker-scripts/content.test.ts index b41109ca20..e9cc4b1a64 100644 --- a/tests/api-resources/worker-scripts/content.test.ts +++ b/tests/api-resources/worker-scripts/content.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource content', () => { // skipped: tests are disabled for the time being - test.skip('replace', async () => { - const responsePromise = cloudflare.workerScripts.content.replace( + test.skip('update', async () => { + const responsePromise = cloudflare.workerScripts.content.update( '023e105f4ecef8ad9ca31a8372d0c353', 'this-is_my_script-01', {}, diff --git a/tests/api-resources/worker-scripts/settings.test.ts b/tests/api-resources/worker-scripts/settings.test.ts index 0d7afd0cd2..d543dda3e1 100644 --- a/tests/api-resources/worker-scripts/settings.test.ts +++ b/tests/api-resources/worker-scripts/settings.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource settings', () => { // skipped: tests are disabled for the time being - test.skip('update', async () => { - const responsePromise = cloudflare.workerScripts.settings.update( + test.skip('edit', async () => { + const responsePromise = cloudflare.workerScripts.settings.edit( '023e105f4ecef8ad9ca31a8372d0c353', 'this-is_my_script-01', {}, diff --git a/tests/api-resources/workers-for-platforms/dispatch/namespaces/scripts/content.test.ts b/tests/api-resources/workers-for-platforms/dispatch/namespaces/scripts/content.test.ts index 57c1cdbe2f..5cc4e53815 100644 --- a/tests/api-resources/workers-for-platforms/dispatch/namespaces/scripts/content.test.ts +++ b/tests/api-resources/workers-for-platforms/dispatch/namespaces/scripts/content.test.ts @@ -13,21 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource content', () => { // skipped: tests are disabled for the time being - test.skip('get: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.workersForPlatforms.dispatch.namespaces.scripts.content.get( - '023e105f4ecef8ad9ca31a8372d0c353', - 'my-dispatch-namespace', - 'this-is_my_script-01', - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - // skipped: tests are disabled for the time being - test.skip('replace', async () => { - const responsePromise = cloudflare.workersForPlatforms.dispatch.namespaces.scripts.content.replace( + test.skip('update', async () => { + const responsePromise = cloudflare.workersForPlatforms.dispatch.namespaces.scripts.content.update( '023e105f4ecef8ad9ca31a8372d0c353', 'my-dispatch-namespace', 'this-is_my_script-01', @@ -41,4 +28,17 @@ describe('resource content', () => { expect(dataAndResponse.data).toBe(response); expect(dataAndResponse.response).toBe(rawResponse); }); + + // skipped: tests are disabled for the time being + test.skip('get: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.workersForPlatforms.dispatch.namespaces.scripts.content.get( + '023e105f4ecef8ad9ca31a8372d0c353', + 'my-dispatch-namespace', + 'this-is_my_script-01', + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); }); diff --git a/tests/api-resources/workers-for-platforms/dispatch/namespaces/scripts/settings.test.ts b/tests/api-resources/workers-for-platforms/dispatch/namespaces/scripts/settings.test.ts index 4c1d9522f9..243a219472 100644 --- a/tests/api-resources/workers-for-platforms/dispatch/namespaces/scripts/settings.test.ts +++ b/tests/api-resources/workers-for-platforms/dispatch/namespaces/scripts/settings.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource settings', () => { // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.workersForPlatforms.dispatch.namespaces.scripts.settings.update( + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.workersForPlatforms.dispatch.namespaces.scripts.settings.edit( '023e105f4ecef8ad9ca31a8372d0c353', 'my-dispatch-namespace', 'this-is_my_script-01', @@ -43,8 +43,8 @@ describe('resource settings', () => { }); // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.workersForPlatforms.dispatch.namespaces.scripts.settings.update( + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.workersForPlatforms.dispatch.namespaces.scripts.settings.edit( '023e105f4ecef8ad9ca31a8372d0c353', 'my-dispatch-namespace', 'this-is_my_script-01', diff --git a/tests/api-resources/workers/account-settings.test.ts b/tests/api-resources/workers/account-settings.test.ts index 6ccc0e0169..899517f98c 100644 --- a/tests/api-resources/workers/account-settings.test.ts +++ b/tests/api-resources/workers/account-settings.test.ts @@ -13,8 +13,11 @@ const cloudflare = new Cloudflare({ describe('resource accountSettings', () => { // skipped: tests are disabled for the time being - test.skip('get', async () => { - const responsePromise = cloudflare.workers.accountSettings.get('023e105f4ecef8ad9ca31a8372d0c353'); + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.workers.accountSettings.update( + '023e105f4ecef8ad9ca31a8372d0c353', + "{'default_usage_model': 'unbound'}", + ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -25,21 +28,16 @@ describe('resource accountSettings', () => { }); // skipped: tests are disabled for the time being - test.skip('get: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.workers.accountSettings.get('023e105f4ecef8ad9ca31a8372d0c353', { - path: '/_stainless_unknown_path', - }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.workers.accountSettings.replace( + test.skip('update: required and optional params', async () => { + const response = await cloudflare.workers.accountSettings.update( '023e105f4ecef8ad9ca31a8372d0c353', "{'default_usage_model': 'unbound'}", ); + }); + + // skipped: tests are disabled for the time being + test.skip('get', async () => { + const responsePromise = cloudflare.workers.accountSettings.get('023e105f4ecef8ad9ca31a8372d0c353'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -50,10 +48,12 @@ describe('resource accountSettings', () => { }); // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.workers.accountSettings.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - "{'default_usage_model': 'unbound'}", - ); + test.skip('get: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.workers.accountSettings.get('023e105f4ecef8ad9ca31a8372d0c353', { + path: '/_stainless_unknown_path', + }), + ).rejects.toThrow(Cloudflare.NotFoundError); }); }); diff --git a/tests/api-resources/workers/domains.test.ts b/tests/api-resources/workers/domains.test.ts index b5493652cc..61278e2c16 100644 --- a/tests/api-resources/workers/domains.test.ts +++ b/tests/api-resources/workers/domains.test.ts @@ -12,6 +12,33 @@ const cloudflare = new Cloudflare({ }); describe('resource domains', () => { + // skipped: tests are disabled for the time being + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.workers.domains.update('9a7806061c88ada191ed06f989cc3dac', { + environment: 'production', + hostname: 'foo.example.com', + service: 'foo', + zone_id: '593c9c94de529bbbfaac7c53ced0447d', + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('update: required and optional params', async () => { + const response = await cloudflare.workers.domains.update('9a7806061c88ada191ed06f989cc3dac', { + environment: 'production', + hostname: 'foo.example.com', + service: 'foo', + zone_id: '593c9c94de529bbbfaac7c53ced0447d', + }); + }); + // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.workers.domains.list('9a7806061c88ada191ed06f989cc3dac'); @@ -91,31 +118,4 @@ describe('resource domains', () => { }), ).rejects.toThrow(Cloudflare.NotFoundError); }); - - // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.workers.domains.replace('9a7806061c88ada191ed06f989cc3dac', { - environment: 'production', - hostname: 'foo.example.com', - service: 'foo', - zone_id: '593c9c94de529bbbfaac7c53ced0447d', - }); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.workers.domains.replace('9a7806061c88ada191ed06f989cc3dac', { - environment: 'production', - hostname: 'foo.example.com', - service: 'foo', - zone_id: '593c9c94de529bbbfaac7c53ced0447d', - }); - }); }); diff --git a/tests/api-resources/workers/filters.test.ts b/tests/api-resources/workers/filters.test.ts index 550588f344..302a23e99e 100644 --- a/tests/api-resources/workers/filters.test.ts +++ b/tests/api-resources/workers/filters.test.ts @@ -35,6 +35,31 @@ describe('resource filters', () => { }); }); + // skipped: tests are disabled for the time being + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.workers.filters.update( + '023e105f4ecef8ad9ca31a8372d0c353', + '023e105f4ecef8ad9ca31a8372d0c353', + { enabled: true, pattern: 'example.net/*' }, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('update: required and optional params', async () => { + const response = await cloudflare.workers.filters.update( + '023e105f4ecef8ad9ca31a8372d0c353', + '023e105f4ecef8ad9ca31a8372d0c353', + { enabled: true, pattern: 'example.net/*' }, + ); + }); + // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.workers.filters.list('023e105f4ecef8ad9ca31a8372d0c353'); @@ -71,29 +96,4 @@ describe('resource filters', () => { expect(dataAndResponse.data).toBe(response); expect(dataAndResponse.response).toBe(rawResponse); }); - - // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.workers.filters.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - '023e105f4ecef8ad9ca31a8372d0c353', - { enabled: true, pattern: 'example.net/*' }, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.workers.filters.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - '023e105f4ecef8ad9ca31a8372d0c353', - { enabled: true, pattern: 'example.net/*' }, - ); - }); }); diff --git a/tests/api-resources/workers/queues/consumers.test.ts b/tests/api-resources/workers/queues/consumers.test.ts index 04a418d64f..f9e1de1316 100644 --- a/tests/api-resources/workers/queues/consumers.test.ts +++ b/tests/api-resources/workers/queues/consumers.test.ts @@ -48,10 +48,17 @@ describe('resource consumers', () => { }); // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.workers.queues.consumers.list( + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.workers.queues.consumers.update( '023e105f4ecef8ad9ca31a8372d0c353', 'example-queue', + 'example-consumer', + { + dead_letter_queue: 'updated-example-dlq', + environment: 'production', + script_name: 'example-consumer', + settings: { batch_size: 100 }, + }, ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -63,21 +70,25 @@ describe('resource consumers', () => { }); // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.workers.queues.consumers.list('023e105f4ecef8ad9ca31a8372d0c353', 'example-queue', { - path: '/_stainless_unknown_path', - }), - ).rejects.toThrow(Cloudflare.NotFoundError); + test.skip('update: required and optional params', async () => { + const response = await cloudflare.workers.queues.consumers.update( + '023e105f4ecef8ad9ca31a8372d0c353', + 'example-queue', + 'example-consumer', + { + dead_letter_queue: 'updated-example-dlq', + environment: 'production', + script_name: 'example-consumer', + settings: { batch_size: 100 }, + }, + ); }); // skipped: tests are disabled for the time being - test.skip('delete', async () => { - const responsePromise = cloudflare.workers.queues.consumers.delete( + test.skip('list', async () => { + const responsePromise = cloudflare.workers.queues.consumers.list( '023e105f4ecef8ad9ca31a8372d0c353', 'example-queue', - 'example-consumer', ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -89,17 +100,21 @@ describe('resource consumers', () => { }); // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.workers.queues.consumers.replace( + test.skip('list: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.workers.queues.consumers.list('023e105f4ecef8ad9ca31a8372d0c353', 'example-queue', { + path: '/_stainless_unknown_path', + }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + // skipped: tests are disabled for the time being + test.skip('delete', async () => { + const responsePromise = cloudflare.workers.queues.consumers.delete( '023e105f4ecef8ad9ca31a8372d0c353', 'example-queue', 'example-consumer', - { - dead_letter_queue: 'updated-example-dlq', - environment: 'production', - script_name: 'example-consumer', - settings: { batch_size: 100 }, - }, ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -109,19 +124,4 @@ describe('resource consumers', () => { expect(dataAndResponse.data).toBe(response); expect(dataAndResponse.response).toBe(rawResponse); }); - - // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.workers.queues.consumers.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - 'example-queue', - 'example-consumer', - { - dead_letter_queue: 'updated-example-dlq', - environment: 'production', - script_name: 'example-consumer', - settings: { batch_size: 100 }, - }, - ); - }); }); diff --git a/tests/api-resources/workers/queues/queues.test.ts b/tests/api-resources/workers/queues/queues.test.ts index f4ed800e71..a5a32d2726 100644 --- a/tests/api-resources/workers/queues/queues.test.ts +++ b/tests/api-resources/workers/queues/queues.test.ts @@ -33,6 +33,31 @@ describe('resource queues', () => { }); }); + // skipped: tests are disabled for the time being + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.workers.queues.update( + '023e105f4ecef8ad9ca31a8372d0c353', + 'example-queue', + { queue_name: 'renamed-example-queue' }, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('update: required and optional params', async () => { + const response = await cloudflare.workers.queues.update( + '023e105f4ecef8ad9ca31a8372d0c353', + 'example-queue', + { queue_name: 'renamed-example-queue' }, + ); + }); + // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.workers.queues.list('023e105f4ecef8ad9ca31a8372d0c353'); @@ -94,29 +119,4 @@ describe('resource queues', () => { }), ).rejects.toThrow(Cloudflare.NotFoundError); }); - - // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.workers.queues.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - 'example-queue', - { queue_name: 'renamed-example-queue' }, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.workers.queues.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - 'example-queue', - { queue_name: 'renamed-example-queue' }, - ); - }); }); diff --git a/tests/api-resources/workers/routes.test.ts b/tests/api-resources/workers/routes.test.ts index e1ea41d944..6363acf72c 100644 --- a/tests/api-resources/workers/routes.test.ts +++ b/tests/api-resources/workers/routes.test.ts @@ -34,6 +34,31 @@ describe('resource routes', () => { }); }); + // skipped: tests are disabled for the time being + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.workers.routes.update( + '023e105f4ecef8ad9ca31a8372d0c353', + '023e105f4ecef8ad9ca31a8372d0c353', + { pattern: 'example.net/*' }, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('update: required and optional params', async () => { + const response = await cloudflare.workers.routes.update( + '023e105f4ecef8ad9ca31a8372d0c353', + '023e105f4ecef8ad9ca31a8372d0c353', + { pattern: 'example.net/*', script: 'this-is_my_script-01' }, + ); + }); + // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.workers.routes.list('023e105f4ecef8ad9ca31a8372d0c353'); @@ -95,29 +120,4 @@ describe('resource routes', () => { }), ).rejects.toThrow(Cloudflare.NotFoundError); }); - - // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.workers.routes.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - '023e105f4ecef8ad9ca31a8372d0c353', - { pattern: 'example.net/*' }, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.workers.routes.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - '023e105f4ecef8ad9ca31a8372d0c353', - { pattern: 'example.net/*', script: 'this-is_my_script-01' }, - ); - }); }); diff --git a/tests/api-resources/workers/scripts/schedules.test.ts b/tests/api-resources/workers/scripts/schedules.test.ts index 53bd350acf..6037e07a85 100644 --- a/tests/api-resources/workers/scripts/schedules.test.ts +++ b/tests/api-resources/workers/scripts/schedules.test.ts @@ -13,10 +13,11 @@ const cloudflare = new Cloudflare({ describe('resource schedules', () => { // skipped: tests are disabled for the time being - test.skip('list', async () => { - const responsePromise = cloudflare.workers.scripts.schedules.list( + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.workers.scripts.schedules.update( '023e105f4ecef8ad9ca31a8372d0c353', 'this-is_my_script-01', + "[{'cron': '*/30 * * * *'}]", ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -28,21 +29,19 @@ describe('resource schedules', () => { }); // skipped: tests are disabled for the time being - test.skip('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.workers.scripts.schedules.list('023e105f4ecef8ad9ca31a8372d0c353', 'this-is_my_script-01', { - path: '/_stainless_unknown_path', - }), - ).rejects.toThrow(Cloudflare.NotFoundError); + test.skip('update: required and optional params', async () => { + const response = await cloudflare.workers.scripts.schedules.update( + '023e105f4ecef8ad9ca31a8372d0c353', + 'this-is_my_script-01', + "[{'cron': '*/30 * * * *'}]", + ); }); // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.workers.scripts.schedules.replace( + test.skip('list', async () => { + const responsePromise = cloudflare.workers.scripts.schedules.list( '023e105f4ecef8ad9ca31a8372d0c353', 'this-is_my_script-01', - "[{'cron': '*/30 * * * *'}]", ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -54,11 +53,12 @@ describe('resource schedules', () => { }); // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.workers.scripts.schedules.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - 'this-is_my_script-01', - "[{'cron': '*/30 * * * *'}]", - ); + test.skip('list: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.workers.scripts.schedules.list('023e105f4ecef8ad9ca31a8372d0c353', 'this-is_my_script-01', { + path: '/_stainless_unknown_path', + }), + ).rejects.toThrow(Cloudflare.NotFoundError); }); }); diff --git a/tests/api-resources/workers/scripts/scripts.test.ts b/tests/api-resources/workers/scripts/scripts.test.ts index cfb31df39f..38d24a87c7 100644 --- a/tests/api-resources/workers/scripts/scripts.test.ts +++ b/tests/api-resources/workers/scripts/scripts.test.ts @@ -12,6 +12,22 @@ const cloudflare = new Cloudflare({ }); describe('resource scripts', () => { + // skipped: tests are disabled for the time being + test.skip('update', async () => { + const responsePromise = cloudflare.workers.scripts.update( + '023e105f4ecef8ad9ca31a8372d0c353', + 'this-is_my_script-01', + {}, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.workers.scripts.list('023e105f4ecef8ad9ca31a8372d0c353'); @@ -59,20 +75,4 @@ describe('resource scripts', () => { }), ).rejects.toThrow(Cloudflare.NotFoundError); }); - - // skipped: tests are disabled for the time being - test.skip('replace', async () => { - const responsePromise = cloudflare.workers.scripts.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - 'this-is_my_script-01', - {}, - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); }); diff --git a/tests/api-resources/workers/scripts/usage-model.test.ts b/tests/api-resources/workers/scripts/usage-model.test.ts index b2ff62b105..261411314b 100644 --- a/tests/api-resources/workers/scripts/usage-model.test.ts +++ b/tests/api-resources/workers/scripts/usage-model.test.ts @@ -13,10 +13,11 @@ const cloudflare = new Cloudflare({ describe('resource usageModel', () => { // skipped: tests are disabled for the time being - test.skip('get', async () => { - const responsePromise = cloudflare.workers.scripts.usageModel.get( + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.workers.scripts.usageModel.update( '023e105f4ecef8ad9ca31a8372d0c353', 'this-is_my_script-01', + "{'usage_model': 'unbound'}", ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -28,21 +29,19 @@ describe('resource usageModel', () => { }); // skipped: tests are disabled for the time being - test.skip('get: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.workers.scripts.usageModel.get('023e105f4ecef8ad9ca31a8372d0c353', 'this-is_my_script-01', { - path: '/_stainless_unknown_path', - }), - ).rejects.toThrow(Cloudflare.NotFoundError); + test.skip('update: required and optional params', async () => { + const response = await cloudflare.workers.scripts.usageModel.update( + '023e105f4ecef8ad9ca31a8372d0c353', + 'this-is_my_script-01', + "{'usage_model': 'unbound'}", + ); }); // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.workers.scripts.usageModel.replace( + test.skip('get', async () => { + const responsePromise = cloudflare.workers.scripts.usageModel.get( '023e105f4ecef8ad9ca31a8372d0c353', 'this-is_my_script-01', - "{'usage_model': 'unbound'}", ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -54,11 +53,12 @@ describe('resource usageModel', () => { }); // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.workers.scripts.usageModel.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - 'this-is_my_script-01', - "{'usage_model': 'unbound'}", - ); + test.skip('get: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.workers.scripts.usageModel.get('023e105f4ecef8ad9ca31a8372d0c353', 'this-is_my_script-01', { + path: '/_stainless_unknown_path', + }), + ).rejects.toThrow(Cloudflare.NotFoundError); }); }); diff --git a/tests/api-resources/workers/services/environments/content.test.ts b/tests/api-resources/workers/services/environments/content.test.ts index 7f68dd383c..bcc33a7099 100644 --- a/tests/api-resources/workers/services/environments/content.test.ts +++ b/tests/api-resources/workers/services/environments/content.test.ts @@ -13,21 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource content', () => { // skipped: tests are disabled for the time being - test.skip('get: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.workers.services.environments.content.get( - '023e105f4ecef8ad9ca31a8372d0c353', - 'my-worker', - 'production', - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - // skipped: tests are disabled for the time being - test.skip('replace', async () => { - const responsePromise = cloudflare.workers.services.environments.content.replace( + test.skip('update', async () => { + const responsePromise = cloudflare.workers.services.environments.content.update( '023e105f4ecef8ad9ca31a8372d0c353', 'my-worker', 'production', @@ -41,4 +28,17 @@ describe('resource content', () => { expect(dataAndResponse.data).toBe(response); expect(dataAndResponse.response).toBe(rawResponse); }); + + // skipped: tests are disabled for the time being + test.skip('get: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.workers.services.environments.content.get( + '023e105f4ecef8ad9ca31a8372d0c353', + 'my-worker', + 'production', + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); }); diff --git a/tests/api-resources/workers/services/environments/settings.test.ts b/tests/api-resources/workers/services/environments/settings.test.ts index 0363574184..76d14baa2e 100644 --- a/tests/api-resources/workers/services/environments/settings.test.ts +++ b/tests/api-resources/workers/services/environments/settings.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource settings', () => { // skipped: tests are disabled for the time being - test.skip('update: only required params', async () => { - const responsePromise = cloudflare.workers.services.environments.settings.update( + test.skip('edit: only required params', async () => { + const responsePromise = cloudflare.workers.services.environments.settings.edit( '023e105f4ecef8ad9ca31a8372d0c353', 'my-worker', 'production', @@ -43,8 +43,8 @@ describe('resource settings', () => { }); // skipped: tests are disabled for the time being - test.skip('update: required and optional params', async () => { - const response = await cloudflare.workers.services.environments.settings.update( + test.skip('edit: required and optional params', async () => { + const response = await cloudflare.workers.services.environments.settings.edit( '023e105f4ecef8ad9ca31a8372d0c353', 'my-worker', 'production', diff --git a/tests/api-resources/workers/subdomains.test.ts b/tests/api-resources/workers/subdomains.test.ts index 16c383a639..b2cbbdba97 100644 --- a/tests/api-resources/workers/subdomains.test.ts +++ b/tests/api-resources/workers/subdomains.test.ts @@ -13,8 +13,11 @@ const cloudflare = new Cloudflare({ describe('resource subdomains', () => { // skipped: tests are disabled for the time being - test.skip('get', async () => { - const responsePromise = cloudflare.workers.subdomains.get('023e105f4ecef8ad9ca31a8372d0c353'); + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.workers.subdomains.update( + '023e105f4ecef8ad9ca31a8372d0c353', + "{'subdomain': 'example-subdomain'}", + ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -25,21 +28,16 @@ describe('resource subdomains', () => { }); // skipped: tests are disabled for the time being - test.skip('get: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.workers.subdomains.get('023e105f4ecef8ad9ca31a8372d0c353', { - path: '/_stainless_unknown_path', - }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.workers.subdomains.replace( + test.skip('update: required and optional params', async () => { + const response = await cloudflare.workers.subdomains.update( '023e105f4ecef8ad9ca31a8372d0c353', "{'subdomain': 'example-subdomain'}", ); + }); + + // skipped: tests are disabled for the time being + test.skip('get', async () => { + const responsePromise = cloudflare.workers.subdomains.get('023e105f4ecef8ad9ca31a8372d0c353'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -50,10 +48,12 @@ describe('resource subdomains', () => { }); // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.workers.subdomains.replace( - '023e105f4ecef8ad9ca31a8372d0c353', - "{'subdomain': 'example-subdomain'}", - ); + test.skip('get: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.workers.subdomains.get('023e105f4ecef8ad9ca31a8372d0c353', { + path: '/_stainless_unknown_path', + }), + ).rejects.toThrow(Cloudflare.NotFoundError); }); }); diff --git a/tests/api-resources/zaraz/config.test.ts b/tests/api-resources/zaraz/config.test.ts index 70aae9c1a2..d424e29adf 100644 --- a/tests/api-resources/zaraz/config.test.ts +++ b/tests/api-resources/zaraz/config.test.ts @@ -13,28 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource config', () => { // skipped: tests are disabled for the time being - test.skip('get', async () => { - const responsePromise = cloudflare.zaraz.config.get('023e105f4ecef8ad9ca31a8372d0c353'); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('get: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - cloudflare.zaraz.config.get('023e105f4ecef8ad9ca31a8372d0c353', { path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.zaraz.config.replace('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.zaraz.config.update('023e105f4ecef8ad9ca31a8372d0c353', { dataLayer: true, debugKey: 'my-debug-key', settings: { autoInjectScript: true }, @@ -81,8 +61,8 @@ describe('resource config', () => { }); // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.zaraz.config.replace('023e105f4ecef8ad9ca31a8372d0c353', { + test.skip('update: required and optional params', async () => { + const response = await cloudflare.zaraz.config.update('023e105f4ecef8ad9ca31a8372d0c353', { dataLayer: true, debugKey: 'my-debug-key', settings: { @@ -161,4 +141,24 @@ describe('resource config', () => { historyChange: true, }); }); + + // skipped: tests are disabled for the time being + test.skip('get', async () => { + const responsePromise = cloudflare.zaraz.config.get('023e105f4ecef8ad9ca31a8372d0c353'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('get: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + cloudflare.zaraz.config.get('023e105f4ecef8ad9ca31a8372d0c353', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); }); diff --git a/tests/api-resources/zaraz/history/history.test.ts b/tests/api-resources/zaraz/history/history.test.ts index 3ac0d9ef57..c7c43497ab 100644 --- a/tests/api-resources/zaraz/history/history.test.ts +++ b/tests/api-resources/zaraz/history/history.test.ts @@ -12,6 +12,23 @@ const cloudflare = new Cloudflare({ }); describe('resource history', () => { + // skipped: tests are disabled for the time being + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.zaraz.history.update('023e105f4ecef8ad9ca31a8372d0c353', 12345); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // skipped: tests are disabled for the time being + test.skip('update: required and optional params', async () => { + const response = await cloudflare.zaraz.history.update('023e105f4ecef8ad9ca31a8372d0c353', 12345); + }); + // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.zaraz.history.list('023e105f4ecef8ad9ca31a8372d0c353'); @@ -43,21 +60,4 @@ describe('resource history', () => { ), ).rejects.toThrow(Cloudflare.NotFoundError); }); - - // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.zaraz.history.replace('023e105f4ecef8ad9ca31a8372d0c353', 12345); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.zaraz.history.replace('023e105f4ecef8ad9ca31a8372d0c353', 12345); - }); }); diff --git a/tests/api-resources/zaraz/zaraz.test.ts b/tests/api-resources/zaraz/zaraz.test.ts index 2f81397cd4..627271ef86 100644 --- a/tests/api-resources/zaraz/zaraz.test.ts +++ b/tests/api-resources/zaraz/zaraz.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource zaraz', () => { // skipped: tests are disabled for the time being - test.skip('replace: only required params', async () => { - const responsePromise = cloudflare.zaraz.replace('023e105f4ecef8ad9ca31a8372d0c353', 'realtime'); + test.skip('update: only required params', async () => { + const responsePromise = cloudflare.zaraz.update('023e105f4ecef8ad9ca31a8372d0c353', 'realtime'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -25,7 +25,7 @@ describe('resource zaraz', () => { }); // skipped: tests are disabled for the time being - test.skip('replace: required and optional params', async () => { - const response = await cloudflare.zaraz.replace('023e105f4ecef8ad9ca31a8372d0c353', 'realtime'); + test.skip('update: required and optional params', async () => { + const response = await cloudflare.zaraz.update('023e105f4ecef8ad9ca31a8372d0c353', 'realtime'); }); }); diff --git a/tests/api-resources/zerotrust/connectivity-settings.test.ts b/tests/api-resources/zerotrust/connectivity-settings.test.ts index 1f83eca90c..022b2d985f 100644 --- a/tests/api-resources/zerotrust/connectivity-settings.test.ts +++ b/tests/api-resources/zerotrust/connectivity-settings.test.ts @@ -13,8 +13,8 @@ const cloudflare = new Cloudflare({ describe('resource connectivitySettings', () => { // skipped: tests are disabled for the time being - test.skip('update', async () => { - const responsePromise = cloudflare.zerotrust.connectivitySettings.update( + test.skip('edit', async () => { + const responsePromise = cloudflare.zerotrust.connectivitySettings.edit( '699d98642c564d2e855e9661899b7252', {}, ); diff --git a/tests/api-resources/zones/zones.test.ts b/tests/api-resources/zones/zones.test.ts index 9e7262c323..5d362278d3 100644 --- a/tests/api-resources/zones/zones.test.ts +++ b/tests/api-resources/zones/zones.test.ts @@ -33,18 +33,6 @@ describe('resource zones', () => { }); }); - // skipped: tests are disabled for the time being - test.skip('update', async () => { - const responsePromise = cloudflare.zones.update('023e105f4ecef8ad9ca31a8372d0c353', {}); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - // skipped: tests are disabled for the time being test.skip('list', async () => { const responsePromise = cloudflare.zones.list(); @@ -105,6 +93,18 @@ describe('resource zones', () => { ).rejects.toThrow(Cloudflare.NotFoundError); }); + // skipped: tests are disabled for the time being + test.skip('edit', async () => { + const responsePromise = cloudflare.zones.edit('023e105f4ecef8ad9ca31a8372d0c353', {}); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + // skipped: tests are disabled for the time being test.skip('get', async () => { const responsePromise = cloudflare.zones.get('023e105f4ecef8ad9ca31a8372d0c353');